A Discrete-Event Network Simulator
API
ns3::SixLowPanHc1 Class Reference

6LoWPAN HC1 header - see RFC 4944. More...

#include "sixlowpan-header.h"

+ Inheritance diagram for ns3::SixLowPanHc1:
+ Collaboration diagram for ns3::SixLowPanHc1:

Public Types

enum  LowPanHc1Addr_e { HC1_PIII = 0x00 , HC1_PIIC = 0x01 , HC1_PCII = 0x02 , HC1_PCIC = 0x03 }
 Kind of address compression. More...
 
enum  LowPanHc1NextHeader_e { HC1_NC = 0x00 , HC1_UDP = 0x01 , HC1_ICMP = 0x02 , HC1_TCP = 0x03 }
 Next header information. More...
 

Public Member Functions

 SixLowPanHc1 ()
 
uint32_t Deserialize (Buffer::Iterator start) override
 Deserialize the packet. More...
 
LowPanHc1Addr_e GetDstCompression () const
 Get Destination Compression type. More...
 
const uint8_t * GetDstInterface () const
 Get the destination interface. More...
 
const uint8_t * GetDstPrefix () const
 Get the destination prefix. More...
 
uint32_t GetFlowLabel () const
 Get the Flow Label value. More...
 
uint8_t GetHopLimit () const
 Get the "Hop limit" field (TTL). More...
 
TypeId GetInstanceTypeId () const override
 Return the instance type identifier. More...
 
uint8_t GetNextHeader () const
 Get the Next Header value. More...
 
uint32_t GetSerializedSize () const override
 Get the serialized size of the packet. More...
 
LowPanHc1Addr_e GetSrcCompression () const
 Get Source Compression type. More...
 
const uint8_t * GetSrcInterface () const
 Get the source interface. More...
 
const uint8_t * GetSrcPrefix () const
 Get the source prefix. More...
 
uint8_t GetTrafficClass () const
 Get the Traffic Class value. More...
 
bool IsHc2HeaderPresent () const
 Check if there is a HC2 compressed header. More...
 
bool IsTcflCompression () const
 Check if the Traffic Class and Flow Labels are compressed. More...
 
void Print (std::ostream &os) const override
 
void Serialize (Buffer::Iterator start) const override
 Serialize the packet. More...
 
void SetDstCompression (LowPanHc1Addr_e dstCompression)
 Set Destination Compression type. More...
 
void SetDstInterface (const uint8_t *dstInterface)
 Set the destination interface. More...
 
void SetDstPrefix (const uint8_t *dstPrefix)
 Set the destination prefix. More...
 
void SetFlowLabel (uint32_t flowLabel)
 Set the Flow Label value. More...
 
void SetHc2HeaderPresent (bool hc2HeaderPresent)
 Set the next header a HC2 compressed header. More...
 
void SetHopLimit (uint8_t limit)
 Set the "Hop limit" field (TTL). More...
 
void SetNextHeader (uint8_t nextHeader)
 Set the Next Header value. More...
 
void SetSrcCompression (LowPanHc1Addr_e srcCompression)
 Set Source Compression type. More...
 
void SetSrcInterface (const uint8_t *srcInterface)
 Set the source interface. More...
 
void SetSrcPrefix (const uint8_t *srcPrefix)
 Set the source prefix. More...
 
void SetTcflCompression (bool tcflCompression)
 Set the Traffic Class and Flow Labels as compressed. More...
 
void SetTrafficClass (uint8_t trafficClass)
 Set the Traffic Class value. More...
 
- Public Member Functions inherited from ns3::Header
 ~Header () override
 
virtual uint32_t Deserialize (Buffer::Iterator start)=0
 Deserialize the object from a buffer iterator. More...
 
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::Chunk
virtual uint32_t Deserialize (Buffer::Iterator start, Buffer::Iterator end)
 Deserialize the object from a buffer iterator. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Header
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::Chunk
static TypeId GetTypeId ()
 Get the type ID. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID. More...
 

Private Attributes

LowPanHc1Addr_e m_dstCompression
 Destination compression type. More...
 
uint8_t m_dstInterface [8]
 Destination interface. More...
 
uint8_t m_dstPrefix [8]
 Destination prefix. More...
 
uint32_t m_flowLabel
 Flow Label. More...
 
bool m_hc2HeaderPresent
 Is next header HC2 compressed. More...
 
uint8_t m_hopLimit
 Hop Limit. More...
 
uint8_t m_nextHeader
 Next header. More...
 
LowPanHc1NextHeader_e m_nextHeaderCompression
 Next header compression. More...
 
LowPanHc1Addr_e m_srcCompression
 Source compression type. More...
 
uint8_t m_srcInterface [8]
 Source interface. More...
 
uint8_t m_srcPrefix [8]
 Source prefix. More...
 
bool m_tcflCompression
 Is TC and FL compressed. More...
 
uint8_t m_trafficClass
 Traffic Class. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

6LoWPAN HC1 header - see RFC 4944.

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

Member Enumeration Documentation

◆ LowPanHc1Addr_e

Kind of address compression.

The address compression is handled in 4 bits and might mean: PI: Prefix inline, PC: Prefix Compressed, II: Interface Identifier, Inline, IC: Interface Identifier Compressed.

Enumerator
HC1_PIII 
HC1_PIIC 
HC1_PCII 
HC1_PCIC 

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

◆ LowPanHc1NextHeader_e

Next header information.

The Next header compression is handled in 4 bits and might mean: NC: Not Compressed, UDP, ICMP or TCP.

Enumerator
HC1_NC 
HC1_UDP 
HC1_ICMP 
HC1_TCP 

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

Constructor & Destructor Documentation

◆ SixLowPanHc1()

ns3::SixLowPanHc1::SixLowPanHc1 ( )

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

Member Function Documentation

◆ Deserialize()

◆ GetDstCompression()

SixLowPanHc1::LowPanHc1Addr_e ns3::SixLowPanHc1::GetDstCompression ( ) const

Get Destination Compression type.

Returns
The kind of address compression.

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

References m_dstCompression.

◆ GetDstInterface()

const uint8_t * ns3::SixLowPanHc1::GetDstInterface ( ) const

Get the destination interface.

Returns
The destination interface.

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

References m_dstInterface.

◆ GetDstPrefix()

const uint8_t * ns3::SixLowPanHc1::GetDstPrefix ( ) const

Get the destination prefix.

Returns
The destination prefix.

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

References m_dstPrefix.

◆ GetFlowLabel()

uint32_t ns3::SixLowPanHc1::GetFlowLabel ( ) const

Get the Flow Label value.

Returns
The Flow Label.

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

References m_flowLabel.

◆ GetHopLimit()

uint8_t ns3::SixLowPanHc1::GetHopLimit ( ) const

Get the "Hop limit" field (TTL).

Returns
The hop limit value.

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

References m_hopLimit.

◆ GetInstanceTypeId()

TypeId ns3::SixLowPanHc1::GetInstanceTypeId ( void  ) const
overridevirtual

Return the instance type identifier.

Returns
Instance type ID.

Implements ns3::ObjectBase.

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

References GetTypeId().

+ Here is the call graph for this function:

◆ GetNextHeader()

uint8_t ns3::SixLowPanHc1::GetNextHeader ( ) const

Get the Next Header value.

Returns
The Next Header value.

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

References m_nextHeader.

◆ GetSerializedSize()

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

Get the serialized size of the packet.

Returns
Size.

Implements ns3::Header.

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

References HC1_NC, HC1_PCIC, HC1_PCII, HC1_PIIC, HC1_PIII, m_dstCompression, m_nextHeaderCompression, m_srcCompression, and m_tcflCompression.

Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1(), and Deserialize().

+ Here is the caller graph for this function:

◆ GetSrcCompression()

SixLowPanHc1::LowPanHc1Addr_e ns3::SixLowPanHc1::GetSrcCompression ( ) const

Get Source Compression type.

Returns
The kind of address compression.

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

References m_srcCompression.

◆ GetSrcInterface()

const uint8_t * ns3::SixLowPanHc1::GetSrcInterface ( ) const

Get the source interface.

Returns
The source interface.

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

References m_srcInterface.

◆ GetSrcPrefix()

const uint8_t * ns3::SixLowPanHc1::GetSrcPrefix ( ) const

Get the source prefix.

Returns
The source prefix.

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

References m_srcPrefix.

◆ GetTrafficClass()

uint8_t ns3::SixLowPanHc1::GetTrafficClass ( ) const

Get the Traffic Class value.

Returns
The Traffic Class value.

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

References m_trafficClass.

◆ GetTypeId()

TypeId ns3::SixLowPanHc1::GetTypeId ( void  )
static

Get the type ID.

Returns
The object TypeId.

Definition at line 104 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:

◆ IsHc2HeaderPresent()

bool ns3::SixLowPanHc1::IsHc2HeaderPresent ( ) const

Check if there is a HC2 compressed header.

Returns
True if next header is HC2 compressed.

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

References m_hc2HeaderPresent.

◆ IsTcflCompression()

bool ns3::SixLowPanHc1::IsTcflCompression ( ) const

Check if the Traffic Class and Flow Labels are compressed.

Returns
True if TC and FL are compressed.

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

References m_tcflCompression.

◆ Print()

void ns3::SixLowPanHc1::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 120 of file sixlowpan-header.cc.

References two-ray-to-three-gpp-ch-calibration::encoding, m_dstCompression, m_hc2HeaderPresent, m_hopLimit, m_nextHeaderCompression, m_srcCompression, and m_tcflCompression.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ Serialize()

◆ SetDstCompression()

void ns3::SixLowPanHc1::SetDstCompression ( LowPanHc1Addr_e  dstCompression)

Set Destination Compression type.

Parameters
[in]dstCompressionThe kind of address compression.

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

References m_dstCompression.

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

+ Here is the caller graph for this function:

◆ SetDstInterface()

void ns3::SixLowPanHc1::SetDstInterface ( const uint8_t *  dstInterface)

Set the destination interface.

Parameters
[in]dstInterfaceThe destination interface.

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

References m_dstInterface.

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

+ Here is the caller graph for this function:

◆ SetDstPrefix()

void ns3::SixLowPanHc1::SetDstPrefix ( const uint8_t *  dstPrefix)

Set the destination prefix.

Parameters
[in]dstPrefixThe destination prefix.

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

References m_dstPrefix.

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

+ Here is the caller graph for this function:

◆ SetFlowLabel()

void ns3::SixLowPanHc1::SetFlowLabel ( uint32_t  flowLabel)

Set the Flow Label value.

Parameters
[in]flowLabelThe Flow Label.

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

References m_flowLabel.

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

+ Here is the caller graph for this function:

◆ SetHc2HeaderPresent()

void ns3::SixLowPanHc1::SetHc2HeaderPresent ( bool  hc2HeaderPresent)

Set the next header a HC2 compressed header.

Parameters
[in]hc2HeaderPresentTrue if next header is HC2 compressed.

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

References m_hc2HeaderPresent.

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

+ Here is the caller graph for this function:

◆ SetHopLimit()

void ns3::SixLowPanHc1::SetHopLimit ( uint8_t  limit)

Set the "Hop limit" field (TTL).

Parameters
[in]limitThe hop limit value.

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

References m_hopLimit.

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

+ Here is the caller graph for this function:

◆ SetNextHeader()

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

Set the Next Header value.

Parameters
[in]nextHeaderThe Next Header value.

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

References HC1_ICMP, HC1_NC, HC1_TCP, HC1_UDP, ns3::Ipv6Header::IPV6_ICMPV6, ns3::Ipv6Header::IPV6_TCP, ns3::Ipv6Header::IPV6_UDP, m_nextHeader, and m_nextHeaderCompression.

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

+ Here is the caller graph for this function:

◆ SetSrcCompression()

void ns3::SixLowPanHc1::SetSrcCompression ( LowPanHc1Addr_e  srcCompression)

Set Source Compression type.

Parameters
[in]srcCompressionThe kind of address compression.

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

References m_srcCompression.

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

+ Here is the caller graph for this function:

◆ SetSrcInterface()

void ns3::SixLowPanHc1::SetSrcInterface ( const uint8_t *  srcInterface)

Set the source interface.

Parameters
[in]srcInterfaceThe source interface.

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

References m_srcInterface.

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

+ Here is the caller graph for this function:

◆ SetSrcPrefix()

void ns3::SixLowPanHc1::SetSrcPrefix ( const uint8_t *  srcPrefix)

Set the source prefix.

Parameters
[in]srcPrefixThe source prefix.

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

References m_srcPrefix.

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

+ Here is the caller graph for this function:

◆ SetTcflCompression()

void ns3::SixLowPanHc1::SetTcflCompression ( bool  tcflCompression)

Set the Traffic Class and Flow Labels as compressed.

Parameters
[in]tcflCompressionTrue if TC and FL are compressed.

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

References m_tcflCompression.

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

+ Here is the caller graph for this function:

◆ SetTrafficClass()

void ns3::SixLowPanHc1::SetTrafficClass ( uint8_t  trafficClass)

Set the Traffic Class value.

Parameters
[in]trafficClassThe Traffic Class value.

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

References m_trafficClass.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_dstCompression

LowPanHc1Addr_e ns3::SixLowPanHc1::m_dstCompression
private

Destination compression type.

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

Referenced by Deserialize(), GetDstCompression(), GetSerializedSize(), Print(), Serialize(), and SetDstCompression().

◆ m_dstInterface

uint8_t ns3::SixLowPanHc1::m_dstInterface[8]
private

Destination interface.

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

Referenced by Deserialize(), GetDstInterface(), Serialize(), and SetDstInterface().

◆ m_dstPrefix

uint8_t ns3::SixLowPanHc1::m_dstPrefix[8]
private

Destination prefix.

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

Referenced by Deserialize(), GetDstPrefix(), Serialize(), and SetDstPrefix().

◆ m_flowLabel

uint32_t ns3::SixLowPanHc1::m_flowLabel
private

Flow Label.

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

Referenced by Deserialize(), GetFlowLabel(), Serialize(), and SetFlowLabel().

◆ m_hc2HeaderPresent

bool ns3::SixLowPanHc1::m_hc2HeaderPresent
private

Is next header HC2 compressed.

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

Referenced by Deserialize(), IsHc2HeaderPresent(), Print(), Serialize(), and SetHc2HeaderPresent().

◆ m_hopLimit

uint8_t ns3::SixLowPanHc1::m_hopLimit
private

Hop Limit.

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

Referenced by Deserialize(), GetHopLimit(), Print(), Serialize(), and SetHopLimit().

◆ m_nextHeader

uint8_t ns3::SixLowPanHc1::m_nextHeader
private

Next header.

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

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

◆ m_nextHeaderCompression

LowPanHc1NextHeader_e ns3::SixLowPanHc1::m_nextHeaderCompression
private

Next header compression.

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

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

◆ m_srcCompression

LowPanHc1Addr_e ns3::SixLowPanHc1::m_srcCompression
private

Source compression type.

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

Referenced by Deserialize(), GetSerializedSize(), GetSrcCompression(), Print(), Serialize(), and SetSrcCompression().

◆ m_srcInterface

uint8_t ns3::SixLowPanHc1::m_srcInterface[8]
private

Source interface.

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

Referenced by Deserialize(), GetSrcInterface(), Serialize(), and SetSrcInterface().

◆ m_srcPrefix

uint8_t ns3::SixLowPanHc1::m_srcPrefix[8]
private

Source prefix.

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

Referenced by Deserialize(), GetSrcPrefix(), Serialize(), and SetSrcPrefix().

◆ m_tcflCompression

bool ns3::SixLowPanHc1::m_tcflCompression
private

Is TC and FL compressed.

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

Referenced by Deserialize(), GetSerializedSize(), IsTcflCompression(), Print(), Serialize(), and SetTcflCompression().

◆ m_trafficClass

uint8_t ns3::SixLowPanHc1::m_trafficClass
private

Traffic Class.

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

Referenced by Deserialize(), GetTrafficClass(), Serialize(), and SetTrafficClass().


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