UDP LOWPAN_NHC Extension Header Encoding - see RFC 6282 . More...
#include "sixlowpan-header.h"
Public Types | |
enum | Ports_e { PORTS_INLINE = 0 , PORTS_ALL_SRC_LAST_DST , PORTS_LAST_SRC_ALL_DST , PORTS_LAST_SRC_LAST_DST } |
Ports: More... | |
Public Member Functions | |
SixLowPanUdpNhcExtension () | |
uint32_t | Deserialize (Buffer::Iterator start) override |
Deserialize the packet. | |
bool | GetC () const |
Get the C (Checksum). | |
uint16_t | GetChecksum () const |
Get the Checksum field value. | |
uint16_t | GetDstPort () const |
Get the Destination Port. | |
TypeId | GetInstanceTypeId () const override |
Return the instance type identifier. | |
virtual SixLowPanDispatch::NhcDispatch_e | GetNhcDispatchType () const |
Get the NhcDispatch type. | |
Ports_e | GetPorts () const |
Get the compressed Src and Dst Ports. | |
uint32_t | GetSerializedSize () const override |
Get the serialized size of the packet. | |
uint16_t | GetSrcPort () const |
Get the Source Port. | |
void | Print (std::ostream &os) const override |
void | Serialize (Buffer::Iterator start) const override |
Serialize the packet. | |
void | SetC (bool cField) |
Set the C (Checksum). | |
void | SetChecksum (uint16_t checksum) |
Set the Checksum field values. | |
void | SetDstPort (uint16_t port) |
Set the Destination Port. | |
void | SetPorts (Ports_e port) |
Set the compressed Src and Dst Ports. | |
void | SetSrcPort (uint16_t port) |
Set the Source Port. | |
Public Member Functions inherited from ns3::Header | |
~Header () override | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Header | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Chunk | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Private Attributes | |
uint8_t | m_baseFormat |
Dispatch + encoding fields. | |
uint16_t | m_checksum |
Checksum. | |
uint16_t | m_dstPort |
Destination port. | |
uint16_t | m_srcPort |
Source port. | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
UDP LOWPAN_NHC Extension Header Encoding - see RFC 6282 .
Introspection did not find any typical Config paths.
0 1 2 3 4 5 6 7 +---+---+---+---+---+---+---+---+ | 1 | 1 | 1 | 1 | 0 | C | P | +---+---+---+---+---+---+---+---+
No Attributes are defined for this type.
No TraceSources are defined for this type.
Group: SixLowPan
Size of this type is 16 bytes (on a 64-bit architecture).
Definition at line 1077 of file sixlowpan-header.h.
Ports:
00: 16 bits for both Source Port and Destination Port 01: 16 bits for Source Port. Last 8 bits for Destination Port 10: Last 8 bits for Source Port. All 16 bits for Destination Port 11: Last 4 bits of both Source Port and Destination Port
Enumerator | |
---|---|
PORTS_INLINE | |
PORTS_ALL_SRC_LAST_DST | |
PORTS_LAST_SRC_ALL_DST | |
PORTS_LAST_SRC_LAST_DST |
Definition at line 1088 of file sixlowpan-header.h.
ns3::SixLowPanUdpNhcExtension::SixLowPanUdpNhcExtension | ( | ) |
Definition at line 1649 of file sixlowpan-header.cc.
References m_baseFormat, m_checksum, m_dstPort, and m_srcPort.
|
overridevirtual |
Deserialize the packet.
[in] | start | Buffer iterator. |
Implements ns3::Header.
Definition at line 1744 of file sixlowpan-header.cc.
References GetC(), GetPorts(), GetSerializedSize(), m_baseFormat, m_checksum, m_dstPort, m_srcPort, PORTS_ALL_SRC_LAST_DST, PORTS_INLINE, PORTS_LAST_SRC_ALL_DST, PORTS_LAST_SRC_LAST_DST, ns3::Buffer::Iterator::ReadNtohU16(), ns3::Buffer::Iterator::ReadU16(), and ns3::Buffer::Iterator::ReadU8().
bool ns3::SixLowPanUdpNhcExtension::GetC | ( | ) | const |
Get the C (Checksum).
Definition at line 1834 of file sixlowpan-header.cc.
References m_baseFormat.
Referenced by Deserialize(), GetSerializedSize(), and Serialize().
uint16_t ns3::SixLowPanUdpNhcExtension::GetChecksum | ( | ) | const |
Get the Checksum field value.
Definition at line 1846 of file sixlowpan-header.cc.
References m_checksum.
uint16_t ns3::SixLowPanUdpNhcExtension::GetDstPort | ( | ) | const |
Get the Destination Port.
Definition at line 1821 of file sixlowpan-header.cc.
References m_dstPort.
|
overridevirtual |
Return the instance type identifier.
Implements ns3::ObjectBase.
Definition at line 1669 of file sixlowpan-header.cc.
References GetTypeId().
|
virtual |
Get the NhcDispatch type.
Definition at line 1784 of file sixlowpan-header.cc.
References ns3::SixLowPanDispatch::LOWPAN_UDPNHC.
SixLowPanUdpNhcExtension::Ports_e ns3::SixLowPanUdpNhcExtension::GetPorts | ( | ) | const |
Get the compressed Src and Dst Ports.
Definition at line 1797 of file sixlowpan-header.cc.
References m_baseFormat.
Referenced by Deserialize(), GetSerializedSize(), and Serialize().
|
overridevirtual |
Get the serialized size of the packet.
Implements ns3::Header.
Definition at line 1681 of file sixlowpan-header.cc.
References GetC(), GetPorts(), PORTS_ALL_SRC_LAST_DST, PORTS_INLINE, PORTS_LAST_SRC_ALL_DST, and PORTS_LAST_SRC_LAST_DST.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc(), and Deserialize().
uint16_t ns3::SixLowPanUdpNhcExtension::GetSrcPort | ( | ) | const |
Get the Source Port.
Definition at line 1809 of file sixlowpan-header.cc.
References m_srcPort.
|
static |
Get the type ID.
Definition at line 1659 of file sixlowpan-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
|
overridevirtual |
os | output stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 |
Implements ns3::Header.
Definition at line 1675 of file sixlowpan-header.cc.
References m_baseFormat.
Referenced by ns3::operator<<().
|
overridevirtual |
Serialize the packet.
[in] | start | Buffer iterator. |
Implements ns3::Header.
Definition at line 1707 of file sixlowpan-header.cc.
References GetC(), GetPorts(), m_baseFormat, m_checksum, m_dstPort, m_srcPort, PORTS_ALL_SRC_LAST_DST, PORTS_INLINE, PORTS_LAST_SRC_ALL_DST, PORTS_LAST_SRC_LAST_DST, ns3::Buffer::Iterator::WriteHtonU16(), ns3::Buffer::Iterator::WriteU16(), and ns3::Buffer::Iterator::WriteU8().
void ns3::SixLowPanUdpNhcExtension::SetC | ( | bool | cField | ) |
Set the C (Checksum).
[in] | cField | False (All checksum carried in-line), true (Checksum elided). |
Definition at line 1827 of file sixlowpan-header.cc.
References m_baseFormat.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc().
void ns3::SixLowPanUdpNhcExtension::SetChecksum | ( | uint16_t | checksum | ) |
Set the Checksum field values.
[in] | checksum | The Checksum field value. |
Definition at line 1840 of file sixlowpan-header.cc.
References m_checksum.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc().
void ns3::SixLowPanUdpNhcExtension::SetDstPort | ( | uint16_t | port | ) |
Set the Destination Port.
[in] | port | The Destination Port. |
Definition at line 1815 of file sixlowpan-header.cc.
References m_dstPort.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc().
void ns3::SixLowPanUdpNhcExtension::SetPorts | ( | Ports_e | port | ) |
Set the compressed Src and Dst Ports.
[in] | port | Src and Dst Ports. |
Definition at line 1790 of file sixlowpan-header.cc.
References m_baseFormat.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc().
void ns3::SixLowPanUdpNhcExtension::SetSrcPort | ( | uint16_t | port | ) |
Set the Source Port.
[in] | port | The Source Port. |
Definition at line 1803 of file sixlowpan-header.cc.
References m_srcPort.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanUdpNhc().
|
private |
Dispatch + encoding fields.
Definition at line 1198 of file sixlowpan-header.h.
Referenced by SixLowPanUdpNhcExtension(), Deserialize(), GetC(), GetPorts(), Print(), Serialize(), SetC(), and SetPorts().
|
private |
Checksum.
Definition at line 1199 of file sixlowpan-header.h.
Referenced by SixLowPanUdpNhcExtension(), Deserialize(), GetChecksum(), Serialize(), and SetChecksum().
|
private |
Destination port.
Definition at line 1201 of file sixlowpan-header.h.
Referenced by SixLowPanUdpNhcExtension(), Deserialize(), GetDstPort(), Serialize(), and SetDstPort().
|
private |
Source port.
Definition at line 1200 of file sixlowpan-header.h.
Referenced by SixLowPanUdpNhcExtension(), Deserialize(), GetSrcPort(), Serialize(), and SetSrcPort().