Represent the Mac Header with the Frame Control and Sequence Number fields. More...
#include "lr-wpan-mac-header.h"
Public Types | |
enum | AddrModeType { NOADDR = 0, RESADDR = 1, SHORTADDR = 2, EXTADDR = 3 } |
The addressing mode types, see IEEE 802.15.4-2006, Table 80. More... | |
enum | KeyIdModeType { IMPLICIT = 0, NOKEYSOURCE = 1, SHORTKEYSOURCE = 2, LONGKEYSOURCE = 3 } |
The addressing mode types, see IEEE 802.15.4-2006, Table 80. More... | |
enum | LrWpanMacType { LRWPAN_MAC_BEACON = 0, LRWPAN_MAC_DATA = 1, LRWPAN_MAC_ACKNOWLEDGMENT = 2, LRWPAN_MAC_COMMAND = 3, LRWPAN_MAC_RESERVED } |
The possible MAC types, see IEEE 802.15.4-2006, Table 79. More... | |
Public Member Functions | |
LrWpanMacHeader (void) | |
LrWpanMacHeader (enum LrWpanMacType wpanMacType, uint8_t seqNum) | |
Constructor. More... | |
~LrWpanMacHeader (void) | |
uint32_t | Deserialize (Buffer::Iterator start) |
uint8_t | GetDstAddrMode (void) const |
Get the Dest. More... | |
uint16_t | GetDstPanId (void) const |
Get the Destination PAN ID. More... | |
Mac64Address | GetExtDstAddr (void) const |
Get the Destination Extended address. More... | |
Mac64Address | GetExtSrcAddr (void) const |
Get the Source Extended address. More... | |
uint16_t | GetFrameControl (void) const |
Get the Frame control field. More... | |
uint8_t | GetFrameVer (void) const |
Get the Frame Version of Frame control field. More... | |
uint32_t | GetFrmCounter (void) const |
Get the Auxiliary Security Header - Frame Counter Octects. More... | |
uint8_t | GetFrmCtrlRes (void) const |
Get the Reserved bits of Frame control field. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
uint8_t | GetKeyIdIndex (void) const |
Get the Auxiliary Security Header - Key Identifier - Key Index. More... | |
uint8_t | GetKeyIdMode (void) const |
Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits. More... | |
uint32_t | GetKeyIdSrc32 (void) const |
Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octects) More... | |
uint64_t | GetKeyIdSrc64 (void) const |
Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octects) More... | |
uint8_t | GetSecControl (void) const |
Get the Auxiliary Security Header - Security Control Octect. More... | |
uint8_t | GetSecCtrlReserved (void) const |
Get the Auxiliary Security Header - Security Control - Reserved bits. More... | |
uint8_t | GetSecLevel (void) const |
Get the Auxiliary Security Header - Security Control - Security Level bits. More... | |
uint8_t | GetSeqNum (void) const |
Get the frame Sequence number. More... | |
uint32_t | GetSerializedSize (void) const |
Mac16Address | GetShortDstAddr (void) const |
Get the Destination Short address. More... | |
Mac16Address | GetShortSrcAddr (void) const |
Get the Source Short address. More... | |
uint8_t | GetSrcAddrMode (void) const |
Get the Source Addressing Mode of Frame control field. More... | |
uint16_t | GetSrcPanId (void) const |
Get the Source PAN ID. More... | |
enum LrWpanMacType | GetType (void) const |
Get the header type. More... | |
bool | IsAcknowledgment (void) const |
Returns true if the header is an ack. More... | |
bool | IsAckReq (void) const |
Check if Ack. More... | |
bool | IsBeacon (void) const |
Returns true if the header is a beacon. More... | |
bool | IsCommand (void) const |
Returns true if the header is a command. More... | |
bool | IsData (void) const |
Returns true if the header is a data. More... | |
bool | IsFrmPend (void) const |
Check if Frame Pending bit of Frame Control is enabled. More... | |
bool | IsPanIdComp (void) const |
Check if PAN ID Compression bit of Frame Control is enabled. More... | |
bool | IsSecEnable (void) const |
Check if Security Enabled bit of Frame Control is enabled. More... | |
void | Print (std::ostream &os) const |
void | Serialize (Buffer::Iterator start) const |
void | SetAckReq (void) |
Set the Frame Control field "Ack. Request" bit to true. More... | |
void | SetDstAddrFields (uint16_t panId, Mac16Address addr) |
Set Destination address fields. More... | |
void | SetDstAddrFields (uint16_t panId, Mac64Address addr) |
Set Destination address fields. More... | |
void | SetDstAddrMode (uint8_t addrMode) |
Set the Destination address mode. More... | |
void | SetFrameControl (uint16_t frameControl) |
Set the whole Frame Control field. More... | |
void | SetFrameVer (uint8_t ver) |
Set the Frame version. More... | |
void | SetFrmCounter (uint32_t frmCntr) |
Set the auxiliary security header "Frame Counter" octet. More... | |
void | SetFrmCtrlRes (uint8_t res) |
Set the Frame Control field "Reserved" bits. More... | |
void | SetFrmPend (void) |
Set the Frame Control field "Frame Pending" bit to true. More... | |
void | SetKeyId (uint8_t keyIndex) |
Set the Key Index. More... | |
void | SetKeyId (uint32_t keySrc, uint8_t keyIndex) |
Set the Key Index and originator. More... | |
void | SetKeyId (uint64_t keySrc, uint8_t keyIndex) |
Set the Key Index and originator. More... | |
void | SetKeyIdMode (uint8_t keyIdMode) |
Set the Security Control field "Key Identifier Mode" bits (2 bits) More... | |
void | SetNoAckReq (void) |
Set the Frame Control field "Ack. Request" bit to false. More... | |
void | SetNoFrmPend (void) |
Set the Frame Control field "Frame Pending" bit to false. More... | |
void | SetNoPanIdComp (void) |
Set the Frame Control field "PAN ID Compression" bit to false. More... | |
void | SetPanIdComp (void) |
Set the Frame Control field "PAN ID Compression" bit to true. More... | |
void | SetSecControl (uint8_t secLevel) |
Set the auxiliary security header "Security Control" octet. More... | |
void | SetSecCtrlReserved (uint8_t res) |
Set the Security Control field "Reserved" bits (3 bits) More... | |
void | SetSecDisable (void) |
Set the Frame Control field "Security Enabled" bit to false. More... | |
void | SetSecEnable (void) |
Set the Frame Control field "Security Enabled" bit to true. More... | |
void | SetSecLevel (uint8_t secLevel) |
Set the Security Control field "Security Level" bits (3 bits) More... | |
void | SetSeqNum (uint8_t seqNum) |
Set the Sequence number. More... | |
void | SetSrcAddrFields (uint16_t panId, Mac16Address addr) |
Set Source address fields. More... | |
void | SetSrcAddrFields (uint16_t panId, Mac64Address addr) |
Set Source address fields. More... | |
void | SetSrcAddrMode (uint8_t addrMode) |
Set the Source address mode. More... | |
void | SetType (enum LrWpanMacType wpanMacType) |
Set the Frame Control field "Frame Type" bits. More... | |
Public Member Functions inherited from ns3::Header | |
virtual | ~Header () |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. More... | |
virtual uint32_t | Deserialize (Buffer::Iterator start)=0 |
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 erros. 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 (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Header | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Chunk | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Private Attributes | |
union { | |
uint32_t m_auxKeyIdKeySrc32 | |
Auxiliary security header - Key Source (4 Octets) More... | |
uint64_t m_auxKeyIdKeySrc64 | |
Auxiliary security header - Key Source (8 Octets) More... | |
}; | |
Auxiliary security header. More... | |
uint16_t | m_addrDstPanId |
Dst PAN id (0 or 2 Octets) More... | |
Mac64Address | m_addrExtDstAddr |
Dst Ext addr (0 or 8 Octets) More... | |
Mac64Address | m_addrExtSrcAddr |
Src Ext addr (0 or 8 Octets) More... | |
Mac16Address | m_addrShortDstAddr |
Dst Short addr (0 or 2 Octets) More... | |
Mac16Address | m_addrShortSrcAddr |
Src Short addr (0 or 2 Octets) More... | |
uint16_t | m_addrSrcPanId |
Src PAN id (0 or 2 Octets) More... | |
uint32_t | m_auxFrmCntr |
Auxiliary security header - Frame Counter (4 Octets) More... | |
uint8_t | m_auxKeyIdKeyIndex |
Auxiliary security header - Key Index (1 Octet) More... | |
uint8_t | m_fctrlAckReq |
Frame Control field Bit 5. More... | |
uint8_t | m_fctrlDstAddrMode |
Frame Control field Bit 10-11 = 0 - No DstAddr, 2 - ShtDstAddr, 3 - ExtDstAddr. More... | |
uint8_t | m_fctrlFrmPending |
Frame Control field Bit 4. More... | |
uint8_t | m_fctrlFrmType |
Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 - Command. More... | |
uint8_t | m_fctrlFrmVer |
Frame Control field Bit 12-13. More... | |
uint8_t | m_fctrlPanIdComp |
Frame Control field Bit 6 = 0 - no compression, 1 - using only DstPanId for both Src and DstPanId. More... | |
uint8_t | m_fctrlReserved |
Frame Control field Bit 7-9. More... | |
uint8_t | m_fctrlSecU |
Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security enabled AuxSecHdr present. More... | |
uint8_t | m_fctrlSrcAddrMode |
Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 - ShtSrcAddr, 3 - ExtSrcAddr. More... | |
uint8_t | m_secctrlKeyIdMode |
Auxiliary security header - Security Control field - Bit 3-4 will indicate size of Key Id. More... | |
uint8_t | m_secctrlReserved |
Auxiliary security header - Security Control field - Bit 5-7. More... | |
uint8_t | m_secctrlSecLevel |
Auxiliary security header - Security Control field - Bit 0-2. More... | |
uint8_t | m_SeqNum |
Sequence Number (1 Octet) 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 (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Represent the Mac Header with the Frame Control and Sequence Number fields.
Introspection did not find any typical Config paths.
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 72 bytes (on a 64-bit architecture).
Definition at line 53 of file lr-wpan-mac-header.h.
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
Enumerator | |
---|---|
NOADDR | |
RESADDR | |
SHORTADDR | |
EXTADDR |
Definition at line 73 of file lr-wpan-mac-header.h.
The addressing mode types, see IEEE 802.15.4-2006, Table 80.
Enumerator | |
---|---|
IMPLICIT | |
NOKEYSOURCE | |
SHORTKEYSOURCE | |
LONGKEYSOURCE |
Definition at line 84 of file lr-wpan-mac-header.h.
The possible MAC types, see IEEE 802.15.4-2006, Table 79.
Definition at line 61 of file lr-wpan-mac-header.h.
ns3::LrWpanMacHeader::LrWpanMacHeader | ( | void | ) |
Definition at line 29 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_DATA, NOADDR, SetDstAddrMode(), SetFrameVer(), SetFrmCtrlRes(), SetNoAckReq(), SetNoFrmPend(), SetNoPanIdComp(), SetSecDisable(), SetSrcAddrMode(), and SetType().
ns3::LrWpanMacHeader::LrWpanMacHeader | ( | enum LrWpanMacType | wpanMacType, |
uint8_t | seqNum | ||
) |
Constructor.
wpanMacType | the header MAC type |
seqNum | the sequence number |
Definition at line 43 of file lr-wpan-mac-header.cc.
References NOADDR, SetDstAddrMode(), SetFrameVer(), SetFrmCtrlRes(), SetNoAckReq(), SetNoFrmPend(), SetNoPanIdComp(), SetSecDisable(), SetSeqNum(), SetSrcAddrMode(), and SetType().
ns3::LrWpanMacHeader::~LrWpanMacHeader | ( | void | ) |
Definition at line 59 of file lr-wpan-mac-header.cc.
|
virtual |
start | an iterator which points to where the header should read from. |
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.
Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.
Implements ns3::Header.
Definition at line 711 of file lr-wpan-mac-header.cc.
References EXTADDR, ns3::Buffer::Iterator::GetDistanceFrom(), IMPLICIT, IsPanIdComp(), IsSecEnable(), LONGKEYSOURCE, m_addrDstPanId, m_addrExtDstAddr, m_addrExtSrcAddr, m_addrShortDstAddr, m_addrShortSrcAddr, m_addrSrcPanId, m_fctrlDstAddrMode, m_fctrlSrcAddrMode, m_secctrlKeyIdMode, NOADDR, NOKEYSOURCE, ns3::ReadFrom(), ns3::Buffer::Iterator::ReadLsbtohU16(), ns3::Buffer::Iterator::ReadLsbtohU32(), ns3::Buffer::Iterator::ReadLsbtohU64(), ns3::Buffer::Iterator::ReadU8(), SetFrameControl(), SetFrmCounter(), SetKeyId(), SetSecControl(), SetSeqNum(), SHORTADDR, SHORTKEYSOURCE, and visualizer.core::start().
uint8_t ns3::LrWpanMacHeader::GetDstAddrMode | ( | void | ) | const |
Get the Dest.
Addressing Mode of Frame control field
Definition at line 137 of file lr-wpan-mac-header.cc.
References m_fctrlDstAddrMode.
Referenced by ns3::LrWpanMac::PdDataIndication().
uint16_t ns3::LrWpanMacHeader::GetDstPanId | ( | void | ) | const |
Get the Destination PAN ID.
Definition at line 163 of file lr-wpan-mac-header.cc.
References m_addrDstPanId.
Referenced by ns3::LrWpanMac::PdDataIndication(), and Serialize().
Mac64Address ns3::LrWpanMacHeader::GetExtDstAddr | ( | void | ) | const |
Get the Destination Extended address.
Definition at line 175 of file lr-wpan-mac-header.cc.
References m_addrExtDstAddr.
Referenced by ns3::LrWpanMac::PdDataIndication().
Mac64Address ns3::LrWpanMacHeader::GetExtSrcAddr | ( | void | ) | const |
Get the Source Extended address.
Definition at line 194 of file lr-wpan-mac-header.cc.
References m_addrExtSrcAddr.
Referenced by ns3::LrWpanMac::PdDataIndication().
uint16_t ns3::LrWpanMacHeader::GetFrameControl | ( | void | ) | const |
Get the Frame control field.
Definition at line 89 of file lr-wpan-mac-header.cc.
References m_fctrlAckReq, m_fctrlDstAddrMode, m_fctrlFrmPending, m_fctrlFrmType, m_fctrlFrmVer, m_fctrlPanIdComp, m_fctrlReserved, m_fctrlSecU, and m_fctrlSrcAddrMode.
Referenced by Serialize().
uint8_t ns3::LrWpanMacHeader::GetFrameVer | ( | void | ) | const |
Get the Frame Version of Frame control field.
Definition at line 143 of file lr-wpan-mac-header.cc.
References m_fctrlFrmVer.
Referenced by ns3::LrWpanMac::PdDataIndication().
uint32_t ns3::LrWpanMacHeader::GetFrmCounter | ( | void | ) | const |
Get the Auxiliary Security Header - Frame Counter Octects.
Definition at line 213 of file lr-wpan-mac-header.cc.
References m_auxFrmCntr.
Referenced by Serialize().
uint8_t ns3::LrWpanMacHeader::GetFrmCtrlRes | ( | void | ) | const |
Get the Reserved bits of Frame control field.
Definition at line 131 of file lr-wpan-mac-header.cc.
References m_fctrlReserved.
|
virtual |
Get the most derived TypeId for this Object.
This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.
Implements ns3::ObjectBase.
Definition at line 494 of file lr-wpan-mac-header.cc.
References GetTypeId().
uint8_t ns3::LrWpanMacHeader::GetKeyIdIndex | ( | void | ) | const |
Get the Auxiliary Security Header - Key Identifier - Key Index.
Definition at line 250 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeyIndex.
Referenced by Serialize().
uint8_t ns3::LrWpanMacHeader::GetKeyIdMode | ( | void | ) | const |
Get the Auxiliary Security Header - Security Control - Key Identifier Mode bits.
Definition at line 225 of file lr-wpan-mac-header.cc.
References m_secctrlKeyIdMode.
uint32_t ns3::LrWpanMacHeader::GetKeyIdSrc32 | ( | void | ) | const |
Get the Auxiliary Security Header - Key Identifier - Key Source (2 Octects)
Definition at line 237 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeySrc32.
Referenced by Serialize().
uint64_t ns3::LrWpanMacHeader::GetKeyIdSrc64 | ( | void | ) | const |
Get the Auxiliary Security Header - Key Identifier - Key Source (4 Octects)
Definition at line 243 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeySrc64.
Referenced by Serialize().
uint8_t ns3::LrWpanMacHeader::GetSecControl | ( | void | ) | const |
Get the Auxiliary Security Header - Security Control Octect.
Definition at line 201 of file lr-wpan-mac-header.cc.
References m_secctrlKeyIdMode, m_secctrlReserved, and m_secctrlSecLevel.
Referenced by Serialize().
uint8_t ns3::LrWpanMacHeader::GetSecCtrlReserved | ( | void | ) | const |
Get the Auxiliary Security Header - Security Control - Reserved bits.
Definition at line 231 of file lr-wpan-mac-header.cc.
References m_secctrlReserved.
uint8_t ns3::LrWpanMacHeader::GetSecLevel | ( | void | ) | const |
Get the Auxiliary Security Header - Security Control - Security Level bits.
Definition at line 219 of file lr-wpan-mac-header.cc.
References m_secctrlSecLevel.
uint8_t ns3::LrWpanMacHeader::GetSeqNum | ( | void | ) | const |
Get the frame Sequence number.
Definition at line 156 of file lr-wpan-mac-header.cc.
References m_SeqNum.
Referenced by ns3::LrWpanMac::PdDataIndication(), and Serialize().
|
virtual |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.
Implements ns3::Header.
Definition at line 563 of file lr-wpan-mac-header.cc.
References EXTADDR, IMPLICIT, IsPanIdComp(), IsSecEnable(), LONGKEYSOURCE, m_fctrlDstAddrMode, m_fctrlSrcAddrMode, m_secctrlKeyIdMode, NOADDR, NOKEYSOURCE, SHORTADDR, and SHORTKEYSOURCE.
Mac16Address ns3::LrWpanMacHeader::GetShortDstAddr | ( | void | ) | const |
Get the Destination Short address.
Definition at line 170 of file lr-wpan-mac-header.cc.
References m_addrShortDstAddr.
Referenced by ns3::LrWpanMac::PdDataIndication(), and ns3::LrWpanMac::RemoveFirstTxQElement().
Mac16Address ns3::LrWpanMacHeader::GetShortSrcAddr | ( | void | ) | const |
Get the Source Short address.
Definition at line 189 of file lr-wpan-mac-header.cc.
References m_addrShortSrcAddr.
Referenced by ns3::LrWpanMac::PdDataIndication().
uint8_t ns3::LrWpanMacHeader::GetSrcAddrMode | ( | void | ) | const |
Get the Source Addressing Mode of Frame control field.
Definition at line 149 of file lr-wpan-mac-header.cc.
References m_fctrlSrcAddrMode.
Referenced by ns3::AnimationInterface::LrWpanPhyTxBeginTrace(), and ns3::LrWpanMac::PdDataIndication().
uint16_t ns3::LrWpanMacHeader::GetSrcPanId | ( | void | ) | const |
Get the Source PAN ID.
Definition at line 181 of file lr-wpan-mac-header.cc.
References m_addrSrcPanId.
Referenced by ns3::LrWpanMac::PdDataIndication(), and Serialize().
enum LrWpanMacHeader::LrWpanMacType ns3::LrWpanMacHeader::GetType | ( | void | ) | const |
Get the header type.
Definition at line 65 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_ACKNOWLEDGMENT, LRWPAN_MAC_BEACON, LRWPAN_MAC_COMMAND, LRWPAN_MAC_DATA, LRWPAN_MAC_RESERVED, and m_fctrlFrmType.
Referenced by ns3::LrWpanMac::PdDataIndication().
|
static |
Get the type ID.
Definition at line 484 of file lr-wpan-mac-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
bool ns3::LrWpanMacHeader::IsAcknowledgment | ( | void | ) | const |
Returns true if the header is an ack.
Definition at line 273 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_ACKNOWLEDGMENT, and m_fctrlFrmType.
Referenced by ns3::LrWpanMac::PdDataIndication().
bool ns3::LrWpanMacHeader::IsAckReq | ( | void | ) | const |
Check if Ack.
Request bit of Frame Control is enabled
Definition at line 119 of file lr-wpan-mac-header.cc.
References m_fctrlAckReq.
Referenced by ns3::LrWpanMac::PdDataIndication().
bool ns3::LrWpanMacHeader::IsBeacon | ( | void | ) | const |
Returns true if the header is a beacon.
Definition at line 257 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_BEACON, and m_fctrlFrmType.
bool ns3::LrWpanMacHeader::IsCommand | ( | void | ) | const |
Returns true if the header is a command.
Definition at line 281 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_COMMAND, and m_fctrlFrmType.
Referenced by ns3::LrWpanMac::PdDataIndication().
bool ns3::LrWpanMacHeader::IsData | ( | void | ) | const |
Returns true if the header is a data.
Definition at line 265 of file lr-wpan-mac-header.cc.
References LRWPAN_MAC_DATA, and m_fctrlFrmType.
Referenced by ns3::LrWpanMac::PdDataIndication().
bool ns3::LrWpanMacHeader::IsFrmPend | ( | void | ) | const |
Check if Frame Pending bit of Frame Control is enabled.
Definition at line 113 of file lr-wpan-mac-header.cc.
References m_fctrlFrmPending.
bool ns3::LrWpanMacHeader::IsPanIdComp | ( | void | ) | const |
Check if PAN ID Compression bit of Frame Control is enabled.
Definition at line 125 of file lr-wpan-mac-header.cc.
References m_fctrlPanIdComp.
Referenced by Deserialize(), GetSerializedSize(), and Serialize().
bool ns3::LrWpanMacHeader::IsSecEnable | ( | void | ) | const |
Check if Security Enabled bit of Frame Control is enabled.
Definition at line 107 of file lr-wpan-mac-header.cc.
References m_fctrlSecU.
Referenced by Deserialize(), GetSerializedSize(), Print(), and Serialize().
|
virtual |
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 500 of file lr-wpan-mac-header.cc.
References EXTADDR, IMPLICIT, IsSecEnable(), LONGKEYSOURCE, m_addrDstPanId, m_addrExtDstAddr, m_addrShortDstAddr, m_addrShortSrcAddr, m_addrSrcPanId, m_auxFrmCntr, m_auxKeyIdKeyIndex, m_auxKeyIdKeySrc32, m_auxKeyIdKeySrc64, m_fctrlAckReq, m_fctrlDstAddrMode, m_fctrlFrmPending, m_fctrlFrmType, m_fctrlFrmVer, m_fctrlPanIdComp, m_fctrlSecU, m_fctrlSrcAddrMode, m_secctrlKeyIdMode, m_secctrlSecLevel, m_SeqNum, NOADDR, NOKEYSOURCE, SHORTADDR, and SHORTKEYSOURCE.
|
virtual |
start | an iterator which points to where the header should be written. |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.
Implements ns3::Header.
Definition at line 643 of file lr-wpan-mac-header.cc.
References EXTADDR, GetDstPanId(), GetFrameControl(), GetFrmCounter(), GetKeyIdIndex(), GetKeyIdSrc32(), GetKeyIdSrc64(), GetSecControl(), GetSeqNum(), GetSrcPanId(), IMPLICIT, IsPanIdComp(), IsSecEnable(), LONGKEYSOURCE, m_addrExtDstAddr, m_addrExtSrcAddr, m_addrShortDstAddr, m_addrShortSrcAddr, m_fctrlDstAddrMode, m_fctrlSrcAddrMode, m_secctrlKeyIdMode, NOADDR, NOKEYSOURCE, SHORTADDR, SHORTKEYSOURCE, visualizer.core::start(), ns3::Buffer::Iterator::WriteHtolsbU16(), ns3::Buffer::Iterator::WriteHtolsbU32(), ns3::Buffer::Iterator::WriteHtolsbU64(), ns3::WriteTo(), and ns3::Buffer::Iterator::WriteU8().
void ns3::LrWpanMacHeader::SetAckReq | ( | void | ) |
Set the Frame Control field "Ack. Request" bit to true.
Definition at line 339 of file lr-wpan-mac-header.cc.
References m_fctrlAckReq.
void ns3::LrWpanMacHeader::SetDstAddrFields | ( | uint16_t | panId, |
Mac16Address | addr | ||
) |
Set Destination address fields.
panId | destination PAN ID |
addr | destination address (16 bit) |
Definition at line 414 of file lr-wpan-mac-header.cc.
References m_addrDstPanId, and m_addrShortDstAddr.
void ns3::LrWpanMacHeader::SetDstAddrFields | ( | uint16_t | panId, |
Mac64Address | addr | ||
) |
Set Destination address fields.
panId | destination PAN ID |
addr | destination address (64 bit) |
Definition at line 421 of file lr-wpan-mac-header.cc.
References m_addrDstPanId, and m_addrExtDstAddr.
void ns3::LrWpanMacHeader::SetDstAddrMode | ( | uint8_t | addrMode | ) |
Set the Destination address mode.
addrMode | Destination address mode |
Definition at line 371 of file lr-wpan-mac-header.cc.
References m_fctrlDstAddrMode.
Referenced by LrWpanPacketTestCase::DoRun(), and LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetFrameControl | ( | uint16_t | frameControl | ) |
Set the whole Frame Control field.
frameControl | the Frame Control field |
Definition at line 296 of file lr-wpan-mac-header.cc.
References m_fctrlAckReq, m_fctrlDstAddrMode, m_fctrlFrmPending, m_fctrlFrmType, m_fctrlFrmVer, m_fctrlPanIdComp, m_fctrlReserved, m_fctrlSecU, and m_fctrlSrcAddrMode.
Referenced by Deserialize().
void ns3::LrWpanMacHeader::SetFrameVer | ( | uint8_t | ver | ) |
Set the Frame version.
ver | frame version |
Definition at line 378 of file lr-wpan-mac-header.cc.
References m_fctrlFrmVer.
Referenced by LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetFrmCounter | ( | uint32_t | frmCntr | ) |
Set the auxiliary security header "Frame Counter" octet.
frmCntr | the "Frame Counter" octect |
Definition at line 436 of file lr-wpan-mac-header.cc.
References m_auxFrmCntr.
Referenced by Deserialize().
void ns3::LrWpanMacHeader::SetFrmCtrlRes | ( | uint8_t | res | ) |
Set the Frame Control field "Reserved" bits.
res | reserved bits |
Definition at line 365 of file lr-wpan-mac-header.cc.
References m_fctrlReserved.
Referenced by LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetFrmPend | ( | void | ) |
Set the Frame Control field "Frame Pending" bit to true.
Definition at line 325 of file lr-wpan-mac-header.cc.
References m_fctrlFrmPending.
void ns3::LrWpanMacHeader::SetKeyId | ( | uint8_t | keyIndex | ) |
Set the Key Index.
keyIndex | the Key index |
Definition at line 460 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeyIndex.
Referenced by Deserialize().
void ns3::LrWpanMacHeader::SetKeyId | ( | uint32_t | keySrc, |
uint8_t | keyIndex | ||
) |
Set the Key Index and originator.
keySrc | the originator of a group key |
keyIndex | the Key index |
Definition at line 467 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeyIndex, and m_auxKeyIdKeySrc32.
void ns3::LrWpanMacHeader::SetKeyId | ( | uint64_t | keySrc, |
uint8_t | keyIndex | ||
) |
Set the Key Index and originator.
keySrc | the originator of a group key |
keyIndex | the Key index |
Definition at line 476 of file lr-wpan-mac-header.cc.
References m_auxKeyIdKeyIndex, and m_auxKeyIdKeySrc64.
void ns3::LrWpanMacHeader::SetKeyIdMode | ( | uint8_t | keyIdMode | ) |
Set the Security Control field "Key Identifier Mode" bits (2 bits)
keyIdMode | the "Key Identifier Mode" bits |
Definition at line 448 of file lr-wpan-mac-header.cc.
References m_secctrlKeyIdMode.
void ns3::LrWpanMacHeader::SetNoAckReq | ( | void | ) |
Set the Frame Control field "Ack. Request" bit to false.
Definition at line 346 of file lr-wpan-mac-header.cc.
References m_fctrlAckReq.
Referenced by LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetNoFrmPend | ( | void | ) |
Set the Frame Control field "Frame Pending" bit to false.
Definition at line 332 of file lr-wpan-mac-header.cc.
References m_fctrlFrmPending.
Referenced by LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetNoPanIdComp | ( | void | ) |
Set the Frame Control field "PAN ID Compression" bit to false.
Definition at line 359 of file lr-wpan-mac-header.cc.
References m_fctrlPanIdComp.
Referenced by LrWpanPacketTestCase::DoRun(), and LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetPanIdComp | ( | void | ) |
Set the Frame Control field "PAN ID Compression" bit to true.
Definition at line 353 of file lr-wpan-mac-header.cc.
References m_fctrlPanIdComp.
void ns3::LrWpanMacHeader::SetSecControl | ( | uint8_t | secLevel | ) |
Set the auxiliary security header "Security Control" octet.
secLevel | the "Security Control" octect |
Definition at line 428 of file lr-wpan-mac-header.cc.
References m_secctrlKeyIdMode, m_secctrlReserved, and m_secctrlSecLevel.
Referenced by Deserialize().
void ns3::LrWpanMacHeader::SetSecCtrlReserved | ( | uint8_t | res | ) |
Set the Security Control field "Reserved" bits (3 bits)
res | the "Reserved" bits |
Definition at line 454 of file lr-wpan-mac-header.cc.
References m_secctrlReserved.
void ns3::LrWpanMacHeader::SetSecDisable | ( | void | ) |
Set the Frame Control field "Security Enabled" bit to false.
Definition at line 318 of file lr-wpan-mac-header.cc.
References m_fctrlSecU.
Referenced by LrWpanPacketTestCase::DoRun(), and LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetSecEnable | ( | void | ) |
Set the Frame Control field "Security Enabled" bit to true.
Definition at line 311 of file lr-wpan-mac-header.cc.
References m_fctrlSecU.
void ns3::LrWpanMacHeader::SetSecLevel | ( | uint8_t | secLevel | ) |
Set the Security Control field "Security Level" bits (3 bits)
secLevel | the "Security Level" bits |
Definition at line 442 of file lr-wpan-mac-header.cc.
References m_secctrlSecLevel.
void ns3::LrWpanMacHeader::SetSeqNum | ( | uint8_t | seqNum | ) |
Set the Sequence number.
seqNum | sequence number |
Definition at line 392 of file lr-wpan-mac-header.cc.
References m_SeqNum.
Referenced by Deserialize(), and LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetSrcAddrFields | ( | uint16_t | panId, |
Mac16Address | addr | ||
) |
Set Source address fields.
panId | source PAN ID |
addr | source address (16 bit) |
Definition at line 398 of file lr-wpan-mac-header.cc.
References m_addrShortSrcAddr, and m_addrSrcPanId.
Referenced by LrWpanPacketTestCase::DoRun().
void ns3::LrWpanMacHeader::SetSrcAddrFields | ( | uint16_t | panId, |
Mac64Address | addr | ||
) |
Set Source address fields.
panId | source PAN ID |
addr | source address (64 bit) |
Definition at line 406 of file lr-wpan-mac-header.cc.
References m_addrExtSrcAddr, and m_addrSrcPanId.
void ns3::LrWpanMacHeader::SetSrcAddrMode | ( | uint8_t | addrMode | ) |
Set the Source address mode.
addrMode | Source address mode |
Definition at line 385 of file lr-wpan-mac-header.cc.
References m_fctrlSrcAddrMode.
Referenced by LrWpanPacketTestCase::DoRun(), and LrWpanMacHeader().
void ns3::LrWpanMacHeader::SetType | ( | enum LrWpanMacType | wpanMacType | ) |
Set the Frame Control field "Frame Type" bits.
wpanMacType | the frame type |
Definition at line 289 of file lr-wpan-mac-header.cc.
References m_fctrlFrmType.
Referenced by LrWpanMacHeader().
union { ... } |
Auxiliary security header.
|
private |
Dst PAN id (0 or 2 Octets)
Definition at line 447 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetDstPanId(), Print(), and SetDstAddrFields().
|
private |
Dst Ext addr (0 or 8 Octets)
Definition at line 449 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetExtDstAddr(), Print(), Serialize(), and SetDstAddrFields().
|
private |
Src Ext addr (0 or 8 Octets)
Definition at line 452 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetExtSrcAddr(), Serialize(), and SetSrcAddrFields().
|
private |
Dst Short addr (0 or 2 Octets)
Definition at line 448 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetShortDstAddr(), Print(), Serialize(), and SetDstAddrFields().
|
private |
Src Short addr (0 or 2 Octets)
Definition at line 451 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetShortSrcAddr(), Print(), Serialize(), and SetSrcAddrFields().
|
private |
Src PAN id (0 or 2 Octets)
Definition at line 450 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetSrcPanId(), Print(), and SetSrcAddrFields().
|
private |
Auxiliary security header - Frame Counter (4 Octets)
Definition at line 456 of file lr-wpan-mac-header.h.
Referenced by GetFrmCounter(), Print(), and SetFrmCounter().
|
private |
Auxiliary security header - Key Index (1 Octet)
Definition at line 475 of file lr-wpan-mac-header.h.
Referenced by GetKeyIdIndex(), Print(), and SetKeyId().
uint32_t ns3::LrWpanMacHeader::m_auxKeyIdKeySrc32 |
Auxiliary security header - Key Source (4 Octets)
Definition at line 471 of file lr-wpan-mac-header.h.
Referenced by GetKeyIdSrc32(), Print(), and SetKeyId().
uint64_t ns3::LrWpanMacHeader::m_auxKeyIdKeySrc64 |
Auxiliary security header - Key Source (8 Octets)
Definition at line 472 of file lr-wpan-mac-header.h.
Referenced by GetKeyIdSrc64(), Print(), and SetKeyId().
|
private |
Frame Control field Bit 5.
Definition at line 436 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), IsAckReq(), Print(), SetAckReq(), SetFrameControl(), and SetNoAckReq().
|
private |
Frame Control field Bit 10-11 = 0 - No DstAddr, 2 - ShtDstAddr, 3 - ExtDstAddr.
Definition at line 439 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetDstAddrMode(), GetFrameControl(), GetSerializedSize(), Print(), Serialize(), SetDstAddrMode(), and SetFrameControl().
|
private |
Frame Control field Bit 4.
Definition at line 435 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), IsFrmPend(), Print(), SetFrameControl(), SetFrmPend(), and SetNoFrmPend().
|
private |
Frame Control field Bit 0-2 = 0 - Beacon, 1 - Data, 2 - Ack, 3 - Command.
Definition at line 433 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), GetType(), IsAcknowledgment(), IsBeacon(), IsCommand(), IsData(), Print(), SetFrameControl(), and SetType().
|
private |
Frame Control field Bit 12-13.
Definition at line 440 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), GetFrameVer(), Print(), SetFrameControl(), and SetFrameVer().
|
private |
Frame Control field Bit 6 = 0 - no compression, 1 - using only DstPanId for both Src and DstPanId.
Definition at line 437 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), IsPanIdComp(), Print(), SetFrameControl(), SetNoPanIdComp(), and SetPanIdComp().
|
private |
Frame Control field Bit 7-9.
Definition at line 438 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), GetFrmCtrlRes(), SetFrameControl(), and SetFrmCtrlRes().
|
private |
Frame Control field Bit 3 = 0 - no AuxSecHdr , 1 - security enabled AuxSecHdr present.
Definition at line 434 of file lr-wpan-mac-header.h.
Referenced by GetFrameControl(), IsSecEnable(), Print(), SetFrameControl(), SetSecDisable(), and SetSecEnable().
|
private |
Frame Control field Bit 14-15 = 0 - No SrcAddr, 2 - ShtSrcAddr, 3 - ExtSrcAddr.
Definition at line 441 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetFrameControl(), GetSerializedSize(), GetSrcAddrMode(), Print(), Serialize(), SetFrameControl(), and SetSrcAddrMode().
|
private |
Auxiliary security header - Security Control field - Bit 3-4 will indicate size of Key Id.
Definition at line 460 of file lr-wpan-mac-header.h.
Referenced by Deserialize(), GetKeyIdMode(), GetSecControl(), GetSerializedSize(), Print(), Serialize(), SetKeyIdMode(), and SetSecControl().
|
private |
Auxiliary security header - Security Control field - Bit 5-7.
Definition at line 467 of file lr-wpan-mac-header.h.
Referenced by GetSecControl(), GetSecCtrlReserved(), SetSecControl(), and SetSecCtrlReserved().
|
private |
Auxiliary security header - Security Control field - Bit 0-2.
Definition at line 459 of file lr-wpan-mac-header.h.
Referenced by GetSecControl(), GetSecLevel(), Print(), SetSecControl(), and SetSecLevel().
|
private |
Sequence Number (1 Octet)
Definition at line 444 of file lr-wpan-mac-header.h.
Referenced by GetSeqNum(), Print(), and SetSeqNum().