A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SixLowPanNhcExtension Class Reference

LOWPAN_NHC Extension Header Encoding - see RFC 6282 . More...

#include "sixlowpan-header.h"

+ Inheritance diagram for ns3::SixLowPanNhcExtension:
+ Collaboration diagram for ns3::SixLowPanNhcExtension:

Public Types

enum  Eid_e {
  EID_HOPBYHOP_OPTIONS_H = 0 , EID_ROUTING_H , EID_FRAGMENTATION_H , EID_DESTINATION_OPTIONS_H ,
  EID_MOBILITY_H , EID_IPv6_H = 7
}
 EID: IPv6 Extension Header ID. More...
 

Public Member Functions

 SixLowPanNhcExtension ()
 
uint32_t CopyBlob (uint8_t *blob, uint32_t size) const
 Get the option header data blob.
 
uint32_t Deserialize (Buffer::Iterator start) override
 Deserialize the packet.
 
Eid_e GetEid () const
 Get the Extension Header Type.
 
TypeId GetInstanceTypeId () const override
 Return the instance type identifier.
 
uint8_t GetNextHeader () const
 Get the Next Header field value.
 
bool GetNh () const
 Get the Next Header field value.
 
virtual SixLowPanDispatch::NhcDispatch_e GetNhcDispatchType () const
 Get the NhcDispatch type.
 
uint32_t GetSerializedSize () const override
 Get the serialized size of the packet.
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 Serialize the packet.
 
void SetBlob (const uint8_t *blob, uint32_t size)
 Set the option header data blob.
 
void SetEid (Eid_e extensionHeaderType)
 Set the Extension Header Type.
 
void SetNextHeader (uint8_t nextHeader)
 Set the Next Header field values.
 
void SetNh (bool nhField)
 Set the NH field values.
 
- 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_nhcBlob [256]
 NHC compressed header.
 
uint8_t m_nhcBlobLength
 Length of the NHC compressed header.
 
uint8_t m_nhcExtensionHeader
 NHC extension header type.
 
uint8_t m_nhcNextHeader
 Next header.
 

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.
 

Detailed Description

LOWPAN_NHC Extension Header Encoding - see RFC 6282 .

   0   1   2   3   4   5   6   7
 +---+---+---+---+---+---+---+---+
 | 1 | 1 | 1 | 0 |    EID    |NH |
 +---+---+---+---+---+---+---+---+

Definition at line 933 of file sixlowpan-header.h.

Member Enumeration Documentation

◆ Eid_e

EID: IPv6 Extension Header ID.

EID: IPv6 Extension Header ID: 0: IPv6 Hop-by-Hop Options Header [RFC 2460 ] 1: IPv6 Routing Header [RFC 2460 ] 2: IPv6 Fragment Header [RFC 2460 ] 3: IPv6 Destination Options Header [RFC 2460 ] 4: IPv6 Mobility Header [RFC 6275 ] 5: Reserved 6: Reserved 7: IPv6 Header

Enumerator
EID_HOPBYHOP_OPTIONS_H 
EID_ROUTING_H 
EID_FRAGMENTATION_H 
EID_DESTINATION_OPTIONS_H 
EID_MOBILITY_H 
EID_IPv6_H 

Definition at line 949 of file sixlowpan-header.h.

Constructor & Destructor Documentation

◆ SixLowPanNhcExtension()

ns3::SixLowPanNhcExtension::SixLowPanNhcExtension ( )

Definition at line 1506 of file sixlowpan-header.cc.

References m_nhcBlobLength, m_nhcExtensionHeader, and m_nhcNextHeader.

Member Function Documentation

◆ CopyBlob()

uint32_t ns3::SixLowPanNhcExtension::CopyBlob ( uint8_t * blob,
uint32_t size ) const

Get the option header data blob.

Parameters
[in]blobA buffer to copy the blob data into.
[in]sizeThe size of the buffer.
Returns
The length of the copied data.

Definition at line 1629 of file sixlowpan-header.cc.

References m_nhcBlob, m_nhcBlobLength, and NS_ASSERT_MSG.

◆ Deserialize()

uint32_t ns3::SixLowPanNhcExtension::Deserialize ( Buffer::Iterator start)
overridevirtual

Deserialize the packet.

Parameters
[in]startBuffer iterator.
Returns
Size of the packet.

Implements ns3::Header.

Definition at line 1561 of file sixlowpan-header.cc.

References GetNh(), GetSerializedSize(), m_nhcBlob, m_nhcBlobLength, m_nhcExtensionHeader, m_nhcNextHeader, ns3::Buffer::Iterator::Read(), and ns3::Buffer::Iterator::ReadU8().

+ Here is the call graph for this function:

◆ GetEid()

SixLowPanNhcExtension::Eid_e ns3::SixLowPanNhcExtension::GetEid ( ) const

Get the Extension Header Type.

Returns
The Extension Header Type.

Definition at line 1589 of file sixlowpan-header.cc.

References m_nhcExtensionHeader.

◆ GetInstanceTypeId()

TypeId ns3::SixLowPanNhcExtension::GetInstanceTypeId ( ) const
overridevirtual

Return the instance type identifier.

Returns
Instance type ID.

Implements ns3::ObjectBase.

Definition at line 1525 of file sixlowpan-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetNextHeader()

uint8_t ns3::SixLowPanNhcExtension::GetNextHeader ( ) const

Get the Next Header field value.

Returns
The Next Header field value.

Definition at line 1601 of file sixlowpan-header.cc.

References m_nhcNextHeader.

◆ GetNh()

bool ns3::SixLowPanNhcExtension::GetNh ( ) const

Get the Next Header field value.

Returns
The NH field value.

Definition at line 1614 of file sixlowpan-header.cc.

References m_nhcExtensionHeader.

Referenced by Deserialize(), GetSerializedSize(), and Serialize().

+ Here is the caller graph for this function:

◆ GetNhcDispatchType()

SixLowPanDispatch::NhcDispatch_e ns3::SixLowPanNhcExtension::GetNhcDispatchType ( ) const
virtual

Get the NhcDispatch type.

Returns
The NhcDispatch type.

Definition at line 1576 of file sixlowpan-header.cc.

References ns3::SixLowPanDispatch::LOWPAN_NHC.

◆ GetSerializedSize()

uint32_t ns3::SixLowPanNhcExtension::GetSerializedSize ( ) const
overridevirtual

Get the serialized size of the packet.

Returns
Size.

Implements ns3::Header.

Definition at line 1537 of file sixlowpan-header.cc.

References GetNh(), and m_nhcBlobLength.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanNhc(), Deserialize(), and Print().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SixLowPanNhcExtension::GetTypeId ( )
static

Get the type ID.

Returns
The object TypeId.

Definition at line 1515 of file sixlowpan-header.cc.

References ns3::TypeId::SetParent().

Referenced by GetInstanceTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Print()

void ns3::SixLowPanNhcExtension::Print ( std::ostream & os) const
overridevirtual
Parameters
osoutput 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 1531 of file sixlowpan-header.cc.

References GetSerializedSize(), and m_nhcExtensionHeader.

Referenced by ns3::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Serialize()

void ns3::SixLowPanNhcExtension::Serialize ( Buffer::Iterator start) const
overridevirtual

Serialize the packet.

Parameters
[in]startBuffer iterator.

Implements ns3::Header.

Definition at line 1548 of file sixlowpan-header.cc.

References GetNh(), m_nhcBlob, m_nhcBlobLength, m_nhcExtensionHeader, m_nhcNextHeader, ns3::Buffer::Iterator::Write(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetBlob()

void ns3::SixLowPanNhcExtension::SetBlob ( const uint8_t * blob,
uint32_t size )

Set the option header data blob.

Parameters
[in]blobA buffer holding the blob data.
[in]sizeThe data blob size.

Definition at line 1620 of file sixlowpan-header.cc.

References m_nhcBlob, m_nhcBlobLength, and NS_ASSERT_MSG.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanNhc().

+ Here is the caller graph for this function:

◆ SetEid()

void ns3::SixLowPanNhcExtension::SetEid ( Eid_e extensionHeaderType)

Set the Extension Header Type.

Parameters
[in]extensionHeaderTypeThe Extension Header Type.

Definition at line 1582 of file sixlowpan-header.cc.

References m_nhcExtensionHeader.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanNhc().

+ Here is the caller graph for this function:

◆ SetNextHeader()

void ns3::SixLowPanNhcExtension::SetNextHeader ( uint8_t nextHeader)

Set the Next Header field values.

Parameters
[in]nextHeaderThe Next Header field value.

Definition at line 1595 of file sixlowpan-header.cc.

References m_nhcNextHeader.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanNhc().

+ Here is the caller graph for this function:

◆ SetNh()

void ns3::SixLowPanNhcExtension::SetNh ( bool nhField)

Set the NH field values.

Parameters
[in]nhFieldThe NH field value.

Definition at line 1607 of file sixlowpan-header.cc.

References m_nhcExtensionHeader.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanNhc().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_nhcBlob

uint8_t ns3::SixLowPanNhcExtension::m_nhcBlob[256]
private

NHC compressed header.

Definition at line 1055 of file sixlowpan-header.h.

Referenced by CopyBlob(), Deserialize(), Serialize(), and SetBlob().

◆ m_nhcBlobLength

uint8_t ns3::SixLowPanNhcExtension::m_nhcBlobLength
private

Length of the NHC compressed header.

Definition at line 1054 of file sixlowpan-header.h.

Referenced by SixLowPanNhcExtension(), CopyBlob(), Deserialize(), GetSerializedSize(), Serialize(), and SetBlob().

◆ m_nhcExtensionHeader

uint8_t ns3::SixLowPanNhcExtension::m_nhcExtensionHeader
private

NHC extension header type.

Definition at line 1052 of file sixlowpan-header.h.

Referenced by SixLowPanNhcExtension(), Deserialize(), GetEid(), GetNh(), Print(), Serialize(), SetEid(), and SetNh().

◆ m_nhcNextHeader

uint8_t ns3::SixLowPanNhcExtension::m_nhcNextHeader
private

Next header.

Definition at line 1053 of file sixlowpan-header.h.

Referenced by SixLowPanNhcExtension(), Deserialize(), GetNextHeader(), Serialize(), and SetNextHeader().


The documentation for this class was generated from the following files: