Represent a variable portion of the zigbee payload header that includes the route request command. More...
#include "zigbee-nwk-payload-header.h"
Public Member Functions | |
ZigbeePayloadRouteRequestCommand () | |
uint32_t | Deserialize (Buffer::Iterator start) override |
uint8_t | GetCmdOptManyToOneField () const |
Get the command option field Many To One. | |
Mac16Address | GetDstAddr () const |
Get the Destination address. | |
Mac64Address | GetDstIeeeAddr () const |
Get the destination IEEE address. | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. | |
uint8_t | GetPathCost () const |
Set the path cost. | |
uint8_t | GetRouteReqId () const |
Get the Route request identifier. | |
uint32_t | GetSerializedSize () const override |
bool | IsDstIeeeAddressPresent () const |
Describe whether or not the destination IEEE Address field is present in the Route Request. | |
void | Print (std::ostream &os) const override |
void | Serialize (Buffer::Iterator start) const override |
void | SetCmdOptManyToOneField (enum ManyToOne manyToOne) |
Set the command option field Many To One. | |
void | SetDstAddr (Mac16Address addr) |
Set Destination address. | |
void | SetDstIeeeAddr (Mac64Address dst) |
Set the destination IEEE address. | |
void | SetPathCost (uint8_t cost) |
Set the path cost. | |
void | SetRouteReqId (uint8_t id) |
Set the Route request identifier. | |
![]() | |
~Header () override | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
![]() | |
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 TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
Private Member Functions | |
uint8_t | GetCmdOptionField () const |
Get the 8bits representing the complete command option field of the route request command. | |
void | SetCmdOptionField (uint8_t cmdOptionField) |
Set the complete command option field of the route request command. | |
Private Attributes | |
bool | m_cmdOptDstIeeeAddr |
Destination IEEE Address Flag (Bit 5) | |
ManyToOne | m_cmdOptManyToOne |
Many to One Subfield (Bits 3-4) | |
bool | m_cmdOptMcst |
Multicast Flag (Bit 6) | |
Mac16Address | m_dstAddr |
Destination address (2 Octets) | |
Mac64Address | m_dstIeeeAddr |
Destination IEEE address (0-8 Octets) | |
uint8_t | m_pathCost |
Path Cost (1 Octet) | |
uint8_t | m_routeReqId |
Route request identifier (1 Octet) | |
Additional Inherited Members | |
![]() | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
![]() | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Represent a variable portion of the zigbee payload header that includes the route request command.
Definition at line 98 of file zigbee-nwk-payload-header.h.
ns3::zigbee::ZigbeePayloadRouteRequestCommand::ZigbeePayloadRouteRequestCommand | ( | ) |
Definition at line 138 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr, m_cmdOptManyToOne, m_cmdOptMcst, m_pathCost, m_routeReqId, and ns3::zigbee::NO_MANY_TO_ONE.
|
overridevirtual |
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 191 of file zigbee-nwk-payload-header.cc.
References ns3::Buffer::Iterator::GetDistanceFrom(), m_cmdOptDstIeeeAddr, m_dstAddr, m_dstIeeeAddr, m_pathCost, m_routeReqId, ns3::ReadFrom(), ns3::Buffer::Iterator::ReadU16(), ns3::Buffer::Iterator::ReadU8(), and SetCmdOptionField().
|
private |
Get the 8bits representing the complete command option field of the route request command.
Definition at line 312 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr, m_cmdOptManyToOne, and m_cmdOptMcst.
Referenced by Serialize().
uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetCmdOptManyToOneField | ( | ) | const |
Get the command option field Many To One.
Definition at line 243 of file zigbee-nwk-payload-header.cc.
References m_cmdOptManyToOne.
Referenced by ns3::zigbee::ZigbeeNwk::ProcessManyToOneRoute(), ns3::zigbee::ZigbeeNwk::ReceiveRREQ(), and ns3::zigbee::ZigbeeNwk::SendRREQ().
Mac16Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetDstAddr | ( | ) | const |
Get the Destination address.
Definition at line 267 of file zigbee-nwk-payload-header.cc.
References m_dstAddr.
Referenced by ns3::zigbee::ZigbeeNwk::FindNextHop(), ns3::zigbee::ZigbeeNwk::ReceiveRREQ(), and ns3::zigbee::ZigbeeNwk::SendRREQ().
Mac64Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetDstIeeeAddr | ( | ) | const |
Get the destination IEEE address.
Definition at line 298 of file zigbee-nwk-payload-header.cc.
References m_dstIeeeAddr.
|
overridevirtual |
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 158 of file zigbee-nwk-payload-header.cc.
References GetTypeId().
uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetPathCost | ( | ) | const |
Set the path cost.
Definition at line 279 of file zigbee-nwk-payload-header.cc.
References m_pathCost.
Referenced by ns3::zigbee::ZigbeeNwk::ReceiveRREQ().
uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetRouteReqId | ( | ) | const |
Get the Route request identifier.
Definition at line 255 of file zigbee-nwk-payload-header.cc.
References m_routeReqId.
Referenced by ns3::zigbee::ZigbeeNwk::FindNextHop(), ns3::zigbee::ZigbeeNwk::ProcessManyToOneRoute(), ns3::zigbee::ZigbeeNwk::ReceiveRREQ(), and ns3::zigbee::ZigbeeNwk::SendRREQ().
|
overridevirtual |
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 164 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr.
|
static |
Get the type ID.
Definition at line 148 of file zigbee-nwk-payload-header.cc.
References ns3::TypeId::SetParent().
Referenced by GetInstanceTypeId().
bool ns3::zigbee::ZigbeePayloadRouteRequestCommand::IsDstIeeeAddressPresent | ( | ) | const |
Describe whether or not the destination IEEE Address field is present in the Route Request.
Definition at line 285 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr.
|
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 209 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr, m_cmdOptManyToOne, m_cmdOptMcst, m_dstAddr, m_dstIeeeAddr, m_pathCost, m_routeReqId, ns3::zigbee::NO_MANY_TO_ONE, ns3::zigbee::NO_ROUTE_RECORD, and ns3::zigbee::ROUTE_RECORD.
|
overridevirtual |
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 177 of file zigbee-nwk-payload-header.cc.
References GetCmdOptionField(), m_cmdOptDstIeeeAddr, m_dstAddr, m_dstIeeeAddr, m_pathCost, m_routeReqId, ns3::WriteTo(), and ns3::Buffer::Iterator::WriteU8().
|
private |
Set the complete command option field of the route request command.
cmdOptionField | The 8 bits representing the complete command option field. |
Definition at line 304 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr, m_cmdOptManyToOne, and m_cmdOptMcst.
Referenced by Deserialize().
void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetCmdOptManyToOneField | ( | enum ManyToOne | manyToOne | ) |
Set the command option field Many To One.
manyToOne | The Many To One field () |
Definition at line 237 of file zigbee-nwk-payload-header.cc.
References m_cmdOptManyToOne.
Referenced by ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest().
void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetDstAddr | ( | Mac16Address | addr | ) |
Set Destination address.
addr | The destination address (16 bit) |
Definition at line 261 of file zigbee-nwk-payload-header.cc.
References m_dstAddr.
Referenced by ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest(), and ns3::zigbee::ZigbeeNwk::SendDataUcst().
void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetDstIeeeAddr | ( | Mac64Address | dst | ) |
Set the destination IEEE address.
dst | The destination IEEE address (64 bits) |
Definition at line 291 of file zigbee-nwk-payload-header.cc.
References m_cmdOptDstIeeeAddr, and m_dstIeeeAddr.
void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetPathCost | ( | uint8_t | cost | ) |
Set the path cost.
cost | the path cost |
Definition at line 273 of file zigbee-nwk-payload-header.cc.
References m_pathCost.
Referenced by ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest(), ns3::zigbee::ZigbeeNwk::ReceiveRREQ(), and ns3::zigbee::ZigbeeNwk::SendDataUcst().
void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetRouteReqId | ( | uint8_t | id | ) |
Set the Route request identifier.
id | the route request identifier |
Definition at line 249 of file zigbee-nwk-payload-header.cc.
References m_routeReqId.
Referenced by ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest(), and ns3::zigbee::ZigbeeNwk::SendDataUcst().
|
private |
Destination IEEE Address Flag (Bit 5)
Definition at line 197 of file zigbee-nwk-payload-header.h.
Referenced by ZigbeePayloadRouteRequestCommand(), Deserialize(), GetCmdOptionField(), GetSerializedSize(), IsDstIeeeAddressPresent(), Print(), Serialize(), SetCmdOptionField(), and SetDstIeeeAddr().
|
private |
Many to One Subfield (Bits 3-4)
Definition at line 196 of file zigbee-nwk-payload-header.h.
Referenced by ZigbeePayloadRouteRequestCommand(), GetCmdOptionField(), GetCmdOptManyToOneField(), Print(), SetCmdOptionField(), and SetCmdOptManyToOneField().
|
private |
Multicast Flag (Bit 6)
Definition at line 198 of file zigbee-nwk-payload-header.h.
Referenced by ZigbeePayloadRouteRequestCommand(), GetCmdOptionField(), Print(), and SetCmdOptionField().
|
private |
Destination address (2 Octets)
Definition at line 203 of file zigbee-nwk-payload-header.h.
Referenced by Deserialize(), GetDstAddr(), Print(), Serialize(), and SetDstAddr().
|
private |
Destination IEEE address (0-8 Octets)
Definition at line 205 of file zigbee-nwk-payload-header.h.
Referenced by Deserialize(), GetDstIeeeAddr(), Print(), Serialize(), and SetDstIeeeAddr().
|
private |
Path Cost (1 Octet)
Definition at line 204 of file zigbee-nwk-payload-header.h.
Referenced by ZigbeePayloadRouteRequestCommand(), Deserialize(), GetPathCost(), Print(), Serialize(), and SetPathCost().
|
private |
Route request identifier (1 Octet)
Definition at line 202 of file zigbee-nwk-payload-header.h.
Referenced by ZigbeePayloadRouteRequestCommand(), Deserialize(), GetRouteReqId(), Print(), Serialize(), and SetRouteReqId().