ns-3
|
Packet header for IPv6. More...
#include <ipv6-header.h>
Public Types | |
enum | NextHeader_e { IPV6_EXT_HOP_BY_HOP = 0, IPV6_IPV4 = 4, IPV6_TCP = 6, IPV6_UDP = 17, IPV6_IPV6 = 41, IPV6_EXT_ROUTING = 43, IPV6_EXT_FRAGMENTATION = 44, IPV6_EXT_CONFIDENTIALITY = 50, IPV6_EXT_AUTHENTIFICATION = 51, IPV6_ICMPV6 = 58, IPV6_EXT_END = 59, IPV6_EXT_DESTINATION = 60, IPV6_SCTP = 135, IPV6_EXT_MOBILITY = 135, IPV6_UDP_LITE = 136 } |
IPv6 next-header value. |
Public Member Functions | |
virtual TypeId | GetInstanceTypeId (void) const |
Return the instance type identifier. | |
Ipv6Header (void) | |
Constructor. | |
void | SetTrafficClass (uint8_t traffic) |
Set the "Traffic class" field. | |
uint8_t | GetTrafficClass (void) const |
Get the "Traffic class" field. | |
void | SetFlowLabel (uint32_t flow) |
Set the "Flow label" field. | |
uint32_t | GetFlowLabel (void) const |
Get the "Flow label" field. | |
void | SetPayloadLength (uint16_t len) |
Set the "Payload length" field. | |
uint16_t | GetPayloadLength (void) const |
Get the "Payload length" field. | |
void | SetNextHeader (uint8_t next) |
Set the "Next header" field. | |
uint8_t | GetNextHeader (void) const |
Get the next header. | |
void | SetHopLimit (uint8_t limit) |
Set the "Hop limit" field (TTL). | |
uint8_t | GetHopLimit (void) const |
Get the "Hop limit" field (TTL). | |
void | SetSourceAddress (Ipv6Address src) |
Set the "Source address" field. | |
Ipv6Address | GetSourceAddress (void) const |
Get the "Source address" field. | |
void | SetDestinationAddress (Ipv6Address dst) |
Set the "Destination address" field. | |
Ipv6Address | GetDestinationAddress (void) const |
Get the "Destination address" field. | |
virtual void | Print (std::ostream &os) const |
Print some informations about the packet. | |
virtual uint32_t | GetSerializedSize (void) const |
Get the serialized size of the packet. | |
virtual void | Serialize (Buffer::Iterator start) const |
Serialize the packet. | |
virtual uint32_t | Deserialize (Buffer::Iterator start) |
Deserialize the packet. |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type identifier. |
Packet header for IPv6.
|
virtual |
Deserialize the packet.
start | Buffer iterator |
Implements ns3::Header.
References GetSerializedSize(), NS_ASSERT, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), and ns3::Buffer::Iterator::ReadU8().
Referenced by ns3::Ipv6ExtensionLooseRouting::Process().
Ipv6Address ns3::Ipv6Header::GetDestinationAddress | ( | void | ) | const |
Get the "Destination address" field.
Referenced by ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::Ipv6L3Protocol::Receive(), ns3::Ipv6ListRouting::RouteInput(), ns3::Ipv6StaticRouting::RouteInput(), ns3::Ipv6ListRouting::RouteOutput(), and ns3::Ipv6StaticRouting::RouteOutput().
uint32_t ns3::Ipv6Header::GetFlowLabel | ( | void | ) | const |
Get the "Flow label" field.
uint8_t ns3::Ipv6Header::GetHopLimit | ( | void | ) | const |
Get the "Hop limit" field (TTL).
Referenced by ns3::Ipv6ExtensionLooseRouting::Process().
|
virtual |
Return the instance type identifier.
Implements ns3::ObjectBase.
References GetTypeId().
uint8_t ns3::Ipv6Header::GetNextHeader | ( | void | ) | const |
Get the next header.
Referenced by ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Ipv6ExtensionFragment::GetFragments(), and ns3::Ipv6L3Protocol::Receive().
uint16_t ns3::Ipv6Header::GetPayloadLength | ( | void | ) | const |
Get the "Payload length" field.
Referenced by ns3::Ipv6L3Protocol::Receive().
|
virtual |
Get the serialized size of the packet.
Implements ns3::Header.
Referenced by Deserialize(), ns3::Ipv6ExtensionFragment::GetFragments(), and ns3::Ipv6ExtensionLooseRouting::Process().
Ipv6Address ns3::Ipv6Header::GetSourceAddress | ( | void | ) | const |
Get the "Source address" field.
Referenced by ns3::Ipv6RawSocketImpl::ForwardUp(), ns3::Ipv6ExtensionFragment::Process(), ns3::Ipv6ExtensionRouting::Process(), ns3::Ipv6ExtensionLooseRouting::Process(), ns3::Ipv6Extension::ProcessOptions(), ns3::Ipv6StaticRouting::RouteInput(), and ns3::Ipv6ListRouting::RouteOutput().
uint8_t ns3::Ipv6Header::GetTrafficClass | ( | void | ) | const |
Get the "Traffic class" field.
|
static |
Get the type identifier.
This method returns the TypeId associated to ns3::Ipv6Header.
No Attributes defined for this type.
No TraceSources defined for this type.
Reimplemented from ns3::Header.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
|
virtual |
Print some informations about the packet.
os | output stream |
Implements ns3::Header.
|
virtual |
Serialize the packet.
start | Buffer iterator |
Implements ns3::Header.
References ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::Ipv6ExtensionLooseRouting::Process().
void ns3::Ipv6Header::SetDestinationAddress | ( | Ipv6Address | dst | ) |
Set the "Destination address" field.
dst | the destination address |
Referenced by Ipv6Header(), ns3::Ipv6ExtensionLooseRouting::Process(), and ns3::Ipv6RawSocketImpl::SendTo().
void ns3::Ipv6Header::SetFlowLabel | ( | uint32_t | flow | ) |
Set the "Flow label" field.
flow | the 20-bit value |
void ns3::Ipv6Header::SetHopLimit | ( | uint8_t | limit | ) |
Set the "Hop limit" field (TTL).
limit | the 8-bit value |
Referenced by ns3::Ipv6ExtensionLooseRouting::Process().
void ns3::Ipv6Header::SetNextHeader | ( | uint8_t | next | ) |
Set the "Next header" field.
next | the next header number |
Referenced by ns3::Ipv6ExtensionFragment::GetFragments(), and ns3::Ipv6ExtensionFragment::Process().
void ns3::Ipv6Header::SetPayloadLength | ( | uint16_t | len | ) |
Set the "Payload length" field.
len | the length of the payload in bytes |
Referenced by ns3::Ipv6ExtensionFragment::GetFragments().
void ns3::Ipv6Header::SetSourceAddress | ( | Ipv6Address | src | ) |
void ns3::Ipv6Header::SetTrafficClass | ( | uint8_t | traffic | ) |
Set the "Traffic class" field.
traffic | the 8-bit value |