6LoWPAN HC1 header - see RFC 4944 More...
#include <sixlowpan-header.h>
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 (void) | |
virtual uint32_t | Deserialize (Buffer::Iterator start) |
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 (void) const |
Get the "Hop limit" field (TTL). More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Return the instance type identifier. More... | |
uint8_t | GetNextHeader () const |
Get the Next Header value. More... | |
virtual uint32_t | GetSerializedSize (void) const |
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... | |
virtual void | Print (std::ostream &os) const |
virtual void | Serialize (Buffer::Iterator start) const |
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) |
Get the Dispatch type. 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 | |
virtual | ~Header () |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Header | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Chunk | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Attributes | |
LowPanHc1Addr_e | m_dstCompression |
Destination compresison type. More... | |
uint8_t | m_dstInterface [8] |
Destination interface. More... | |
uint8_t | m_dstPrefix [8] |
Destinaiton 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 compresison 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) |
virtual void | NotifyConstructionCompleted (void) |
This method is invoked once all member attributes have been initialized. More... | |
6LoWPAN HC1 header - see RFC 4944
Doxygen introspection did not find any typical Config paths.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Definition at line 133 of file sixlowpan-header.h.
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 143 of file sixlowpan-header.h.
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 157 of file sixlowpan-header.h.
ns3::SixLowPanHc1::SixLowPanHc1 | ( | void | ) |
Definition at line 100 of file sixlowpan-header.cc.
|
virtual |
Deserialize the packet.
start | Buffer iterator |
Implements ns3::Header.
Definition at line 269 of file sixlowpan-header.cc.
References GetSerializedSize(), HC1_ICMP, HC1_NC, HC1_PCIC, HC1_PCII, HC1_PIIC, HC1_PIII, HC1_TCP, HC1_UDP, ns3::Ipv6Header::IPV6_ICMPV6, ns3::Ipv6Header::IPV6_TCP, ns3::Ipv6Header::IPV6_UDP, ns3::SixLowPanDispatch::LOWPAN_HC1, m_dstCompression, m_dstInterface, m_dstPrefix, m_flowLabel, m_hc2HeaderPresent, m_hopLimit, m_nextHeader, m_nextHeaderCompression, m_srcCompression, m_srcInterface, m_srcPrefix, m_tcflCompression, m_trafficClass, NS_ASSERT_MSG, ns3::Buffer::Iterator::Read(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().
SixLowPanHc1::LowPanHc1Addr_e ns3::SixLowPanHc1::GetDstCompression | ( | ) | const |
Get Destination Compression type.
Definition at line 393 of file sixlowpan-header.cc.
References m_dstCompression.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
const uint8_t * ns3::SixLowPanHc1::GetDstInterface | ( | ) | const |
Get the destination interface.
Definition at line 398 of file sixlowpan-header.cc.
References m_dstInterface.
const uint8_t * ns3::SixLowPanHc1::GetDstPrefix | ( | ) | const |
Get the destination prefix.
Definition at line 403 of file sixlowpan-header.cc.
References m_dstPrefix.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
uint32_t ns3::SixLowPanHc1::GetFlowLabel | ( | void | ) | const |
Get the Flow Label value.
Definition at line 408 of file sixlowpan-header.cc.
References m_flowLabel.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
uint8_t ns3::SixLowPanHc1::GetHopLimit | ( | void | ) | const |
Get the "Hop limit" field (TTL).
Definition at line 388 of file sixlowpan-header.cc.
References m_hopLimit.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
|
virtual |
Return the instance type identifier.
Implements ns3::ObjectBase.
Definition at line 111 of file sixlowpan-header.cc.
References GetTypeId().
uint8_t ns3::SixLowPanHc1::GetNextHeader | ( | void | ) | const |
Get the Next Header value.
Definition at line 413 of file sixlowpan-header.cc.
References m_nextHeader.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
|
virtual |
Get the serialized size of the packet.
Implements ns3::Header.
Definition at line 132 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().
SixLowPanHc1::LowPanHc1Addr_e ns3::SixLowPanHc1::GetSrcCompression | ( | ) | const |
Get Source Compression type.
Definition at line 418 of file sixlowpan-header.cc.
References m_srcCompression.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
const uint8_t * ns3::SixLowPanHc1::GetSrcInterface | ( | ) | const |
Get the source interface.
Definition at line 423 of file sixlowpan-header.cc.
References m_srcInterface.
const uint8_t * ns3::SixLowPanHc1::GetSrcPrefix | ( | ) | const |
Get the source prefix.
Definition at line 428 of file sixlowpan-header.cc.
References m_srcPrefix.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
uint8_t ns3::SixLowPanHc1::GetTrafficClass | ( | void | ) | const |
Get the Traffic Class value.
Definition at line 433 of file sixlowpan-header.cc.
References m_trafficClass.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
|
static |
Get the type ID.
Definition at line 105 of file sixlowpan-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
bool ns3::SixLowPanHc1::IsHc2HeaderPresent | ( | ) | const |
Check if there is a HC2 compressed header.
Definition at line 443 of file sixlowpan-header.cc.
References m_hc2HeaderPresent.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
bool ns3::SixLowPanHc1::IsTcflCompression | ( | ) | const |
Check if the Traffic Class and Flow Labels are compressed.
Definition at line 438 of file sixlowpan-header.cc.
References m_tcflCompression.
Referenced by ns3::SixLowPanNetDevice::DecompressLowPanHc1().
|
virtual |
os | output stream This method is used by Packet::Print to print the content of a trailer as ascii data to a c++ output stream. Although the trailer 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 116 of file sixlowpan-header.cc.
References m_dstCompression, m_hc2HeaderPresent, m_hopLimit, m_nextHeaderCompression, m_srcCompression, and m_tcflCompression.
Referenced by ns3::operator<<().
|
virtual |
Serialize the packet.
start | Buffer iterator |
Implements ns3::Header.
Definition at line 178 of file sixlowpan-header.cc.
References HC1_NC, HC1_PCIC, HC1_PCII, HC1_PIIC, HC1_PIII, ns3::SixLowPanDispatch::LOWPAN_HC1, m_dstCompression, m_dstInterface, m_dstPrefix, m_flowLabel, m_hc2HeaderPresent, m_hopLimit, m_nextHeader, m_nextHeaderCompression, m_srcCompression, m_srcInterface, m_srcPrefix, m_tcflCompression, m_trafficClass, NS_ASSERT_MSG, visualizer.core::start(), ns3::Buffer::Iterator::Write(), and ns3::Buffer::Iterator::WriteU8().
void ns3::SixLowPanHc1::SetDstCompression | ( | LowPanHc1Addr_e | dstCompression | ) |
Set Destination Compression type.
dstCompression | the kind of address compression |
Definition at line 448 of file sixlowpan-header.cc.
References m_dstCompression.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetDstInterface | ( | const uint8_t * | dstInterface | ) |
Set the destination interface.
dstInterface | the destination interface |
Definition at line 453 of file sixlowpan-header.cc.
References m_dstInterface.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetDstPrefix | ( | const uint8_t * | dstPrefix | ) |
Set the destination prefix.
dstPrefix | the destination prefix |
Definition at line 461 of file sixlowpan-header.cc.
References m_dstPrefix.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetFlowLabel | ( | uint32_t | flowLabel | ) |
Set the Flow Label value.
flowLabel | the Flow Label |
Definition at line 469 of file sixlowpan-header.cc.
References m_flowLabel.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetHc2HeaderPresent | ( | bool | hc2HeaderPresent | ) |
Set the next header a HC2 compressed header.
hc2HeaderPresent | true if next header is HC2 compressed |
Definition at line 527 of file sixlowpan-header.cc.
References m_hc2HeaderPresent.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetHopLimit | ( | uint8_t | limit | ) |
Get the Dispatch type.
limit | the hop limit value |
Definition at line 383 of file sixlowpan-header.cc.
References m_hopLimit.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetNextHeader | ( | uint8_t | nextHeader | ) |
Set the Next Header value.
nextHeader | the Next Header value |
Definition at line 474 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().
void ns3::SixLowPanHc1::SetSrcCompression | ( | LowPanHc1Addr_e | srcCompression | ) |
Set Source Compression type.
srcCompression | the kind of address compression |
Definition at line 495 of file sixlowpan-header.cc.
References m_srcCompression.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetSrcInterface | ( | const uint8_t * | srcInterface | ) |
Set the source interface.
srcInterface | the source interface |
Definition at line 500 of file sixlowpan-header.cc.
References m_srcInterface.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetSrcPrefix | ( | const uint8_t * | srcPrefix | ) |
Set the source prefix.
srcPrefix | the source prefix |
Definition at line 508 of file sixlowpan-header.cc.
References m_srcPrefix.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetTcflCompression | ( | bool | tcflCompression | ) |
Set the Traffic Class and Flow Labels as compressed.
tcflCompression | true if TC and FL are compressed |
Definition at line 516 of file sixlowpan-header.cc.
References m_tcflCompression.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
void ns3::SixLowPanHc1::SetTrafficClass | ( | uint8_t | trafficClass | ) |
Set the Traffic Class value.
trafficClass | the Traffic Class value |
Definition at line 521 of file sixlowpan-header.cc.
References m_trafficClass.
Referenced by ns3::SixLowPanNetDevice::CompressLowPanHc1().
|
private |
Destination compresison type.
Definition at line 361 of file sixlowpan-header.h.
Referenced by Deserialize(), GetDstCompression(), GetSerializedSize(), Print(), Serialize(), and SetDstCompression().
|
private |
Destination interface.
Definition at line 356 of file sixlowpan-header.h.
Referenced by Deserialize(), GetDstInterface(), Serialize(), and SetDstInterface().
|
private |
Destinaiton prefix.
Definition at line 355 of file sixlowpan-header.h.
Referenced by Deserialize(), GetDstPrefix(), Serialize(), and SetDstPrefix().
|
private |
Flow Label.
Definition at line 358 of file sixlowpan-header.h.
Referenced by Deserialize(), GetFlowLabel(), Serialize(), and SetFlowLabel().
|
private |
is next header HC2 compressed
Definition at line 364 of file sixlowpan-header.h.
Referenced by Deserialize(), IsHc2HeaderPresent(), Print(), Serialize(), and SetHc2HeaderPresent().
|
private |
Hop Limit.
Definition at line 352 of file sixlowpan-header.h.
Referenced by Deserialize(), GetHopLimit(), Print(), Serialize(), and SetHopLimit().
|
private |
Next header.
Definition at line 359 of file sixlowpan-header.h.
Referenced by Deserialize(), GetNextHeader(), Serialize(), and SetNextHeader().
|
private |
next header compression
Definition at line 363 of file sixlowpan-header.h.
Referenced by Deserialize(), GetSerializedSize(), Print(), Serialize(), and SetNextHeader().
|
private |
Source compresison type.
Definition at line 360 of file sixlowpan-header.h.
Referenced by Deserialize(), GetSerializedSize(), GetSrcCompression(), Print(), Serialize(), and SetSrcCompression().
|
private |
Source interface.
Definition at line 354 of file sixlowpan-header.h.
Referenced by Deserialize(), GetSrcInterface(), Serialize(), and SetSrcInterface().
|
private |
Source prefix.
Definition at line 353 of file sixlowpan-header.h.
Referenced by Deserialize(), GetSrcPrefix(), Serialize(), and SetSrcPrefix().
|
private |
is TC and FL compressed
Definition at line 362 of file sixlowpan-header.h.
Referenced by Deserialize(), GetSerializedSize(), IsTcflCompression(), Print(), Serialize(), and SetTcflCompression().
|
private |
Traffic Class.
Definition at line 357 of file sixlowpan-header.h.
Referenced by Deserialize(), GetTrafficClass(), Serialize(), and SetTrafficClass().