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, IPV6_ICMPV6 = 58, IPV6_EXT_END, IPV6_EXT_DESTINATION, IPV6_SCTP = 135, IPV6_EXT_MOBILITY = 135, IPV6_UDP_LITE } |
IPv6 next-header value. More... | |
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. | |
Private Attributes | |
uint32_t | m_version: 4 |
The version (always equal to 6). | |
uint32_t | m_trafficClass: 8 |
The traffic class. | |
uint32_t | m_flowLabel: 20 |
The flow label. | |
uint16_t | m_payloadLength |
The payload length. | |
uint8_t | m_nextHeader |
The Next header number. | |
uint8_t | m_hopLimit |
The Hop limit value. | |
Ipv6Address | m_sourceAddress |
The source address. | |
Ipv6Address | m_destinationAddress |
The destination address. |
Packet header for IPv6.
Definition at line 33 of file ipv6-header.h.
IPv6 next-header value.
Definition at line 40 of file ipv6-header.h.
ns3::Ipv6Header::Ipv6Header | ( | void | ) |
Constructor.
Definition at line 33 of file ipv6-header.cc.
References SetDestinationAddress(), and SetSourceAddress().
uint32_t ns3::Ipv6Header::Deserialize | ( | Buffer::Iterator | start | ) | [virtual] |
Deserialize the packet.
start | Buffer iterator |
Implements ns3::Header.
Definition at line 164 of file ipv6-header.cc.
References GetSerializedSize(), m_destinationAddress, m_flowLabel, m_hopLimit, m_nextHeader, m_payloadLength, m_sourceAddress, m_trafficClass, m_version, NS_ASSERT, ns3::ReadFrom(), ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadNtohU32(), and ns3::Buffer::Iterator::ReadU8().
Ipv6Address ns3::Ipv6Header::GetDestinationAddress | ( | void | ) | const |
Get the "Destination address" field.
Definition at line 111 of file ipv6-header.cc.
References m_destinationAddress.
uint32_t ns3::Ipv6Header::GetFlowLabel | ( | void | ) | const |
Get the "Flow label" field.
Definition at line 61 of file ipv6-header.cc.
References m_flowLabel.
uint8_t ns3::Ipv6Header::GetHopLimit | ( | void | ) | const |
Get the "Hop limit" field (TTL).
Definition at line 91 of file ipv6-header.cc.
References m_hopLimit.
TypeId ns3::Ipv6Header::GetInstanceTypeId | ( | void | ) | const [virtual] |
Return the instance type identifier.
Implements ns3::ObjectBase.
Definition at line 125 of file ipv6-header.cc.
References GetTypeId().
uint8_t ns3::Ipv6Header::GetNextHeader | ( | void | ) | const |
Get the next header.
Definition at line 81 of file ipv6-header.cc.
References m_nextHeader.
uint16_t ns3::Ipv6Header::GetPayloadLength | ( | void | ) | const |
Get the "Payload length" field.
Definition at line 71 of file ipv6-header.cc.
References m_payloadLength.
uint32_t ns3::Ipv6Header::GetSerializedSize | ( | void | ) | const [virtual] |
Get the serialized size of the packet.
Implements ns3::Header.
Definition at line 143 of file ipv6-header.cc.
Referenced by Deserialize().
Ipv6Address ns3::Ipv6Header::GetSourceAddress | ( | void | ) | const |
Get the "Source address" field.
Definition at line 101 of file ipv6-header.cc.
References m_sourceAddress.
uint8_t ns3::Ipv6Header::GetTrafficClass | ( | void | ) | const |
Get the "Traffic class" field.
Definition at line 51 of file ipv6-header.cc.
References m_trafficClass.
TypeId ns3::Ipv6Header::GetTypeId | ( | void | ) | [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.
Definition at line 116 of file ipv6-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
void ns3::Ipv6Header::Print | ( | std::ostream & | os | ) | const [virtual] |
Print some informations about the packet.
os | output stream |
Implements ns3::Header.
Definition at line 130 of file ipv6-header.cc.
References m_destinationAddress, m_flowLabel, m_hopLimit, m_nextHeader, m_payloadLength, m_sourceAddress, m_trafficClass, and m_version.
void ns3::Ipv6Header::Serialize | ( | Buffer::Iterator | start | ) | const [virtual] |
Serialize the packet.
start | Buffer iterator |
Implements ns3::Header.
Definition at line 148 of file ipv6-header.cc.
References m_destinationAddress, m_flowLabel, m_hopLimit, m_nextHeader, m_payloadLength, m_sourceAddress, m_trafficClass, ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteHtonU32(), ns3::WriteTo(), and ns3::Buffer::Iterator::WriteU8().
void ns3::Ipv6Header::SetDestinationAddress | ( | Ipv6Address | dst | ) |
Set the "Destination address" field.
dst | the destination address |
Definition at line 106 of file ipv6-header.cc.
References m_destinationAddress.
Referenced by Ipv6Header().
void ns3::Ipv6Header::SetFlowLabel | ( | uint32_t | flow | ) |
Set the "Flow label" field.
flow | the 20-bit value |
Definition at line 56 of file ipv6-header.cc.
References m_flowLabel.
void ns3::Ipv6Header::SetHopLimit | ( | uint8_t | limit | ) |
Set the "Hop limit" field (TTL).
limit | the 8-bit value |
Definition at line 86 of file ipv6-header.cc.
References m_hopLimit.
void ns3::Ipv6Header::SetNextHeader | ( | uint8_t | next | ) |
Set the "Next header" field.
next | the next header number |
Definition at line 76 of file ipv6-header.cc.
References m_nextHeader.
void ns3::Ipv6Header::SetPayloadLength | ( | uint16_t | len | ) |
Set the "Payload length" field.
len | the length of the payload in bytes |
Definition at line 66 of file ipv6-header.cc.
References m_payloadLength.
void ns3::Ipv6Header::SetSourceAddress | ( | Ipv6Address | src | ) |
Set the "Source address" field.
src | the source address |
Definition at line 96 of file ipv6-header.cc.
References m_sourceAddress.
Referenced by Ipv6Header().
void ns3::Ipv6Header::SetTrafficClass | ( | uint8_t | traffic | ) |
Set the "Traffic class" field.
traffic | the 8-bit value |
Definition at line 46 of file ipv6-header.cc.
References m_trafficClass.
The destination address.
Definition at line 225 of file ipv6-header.h.
Referenced by Deserialize(), GetDestinationAddress(), Print(), Serialize(), and SetDestinationAddress().
uint32_t ns3::Ipv6Header::m_flowLabel [private] |
The flow label.
Definition at line 200 of file ipv6-header.h.
Referenced by Deserialize(), GetFlowLabel(), Print(), Serialize(), and SetFlowLabel().
uint8_t ns3::Ipv6Header::m_hopLimit [private] |
The Hop limit value.
Definition at line 215 of file ipv6-header.h.
Referenced by Deserialize(), GetHopLimit(), Print(), Serialize(), and SetHopLimit().
uint8_t ns3::Ipv6Header::m_nextHeader [private] |
The Next header number.
Definition at line 210 of file ipv6-header.h.
Referenced by Deserialize(), GetNextHeader(), Print(), Serialize(), and SetNextHeader().
uint16_t ns3::Ipv6Header::m_payloadLength [private] |
The payload length.
Definition at line 205 of file ipv6-header.h.
Referenced by Deserialize(), GetPayloadLength(), Print(), Serialize(), and SetPayloadLength().
Ipv6Address ns3::Ipv6Header::m_sourceAddress [private] |
The source address.
Definition at line 220 of file ipv6-header.h.
Referenced by Deserialize(), GetSourceAddress(), Print(), Serialize(), and SetSourceAddress().
uint32_t ns3::Ipv6Header::m_trafficClass [private] |
The traffic class.
Definition at line 194 of file ipv6-header.h.
Referenced by Deserialize(), GetTrafficClass(), Print(), Serialize(), and SetTrafficClass().
uint32_t ns3::Ipv6Header::m_version [private] |
The version (always equal to 6).
Definition at line 190 of file ipv6-header.h.
Referenced by Deserialize(), and Print().