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

Represent a variable portion of the zigbee payload header that includes the route request command. More...

#include "zigbee-nwk-payload-header.h"

+ Inheritance diagram for ns3::zigbee::ZigbeePayloadRouteRequestCommand:
+ Collaboration diagram for ns3::zigbee::ZigbeePayloadRouteRequestCommand:

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.
 
- 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 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

- 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

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.

Constructor & Destructor Documentation

◆ ZigbeePayloadRouteRequestCommand()

ns3::zigbee::ZigbeePayloadRouteRequestCommand::ZigbeePayloadRouteRequestCommand ( )

Member Function Documentation

◆ Deserialize()

uint32_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::Deserialize ( Buffer::Iterator start)
overridevirtual
Parameters
startan iterator which points to where the header should read from.
Returns
the number of bytes read.

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().

+ Here is the call graph for this function:

◆ GetCmdOptionField()

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetCmdOptionField ( ) const
private

Get the 8bits representing the complete command option field of the route request command.

Returns
The command option field (8 bits)

Definition at line 312 of file zigbee-nwk-payload-header.cc.

References m_cmdOptDstIeeeAddr, m_cmdOptManyToOne, and m_cmdOptMcst.

Referenced by Serialize().

+ Here is the caller graph for this function:

◆ GetCmdOptManyToOneField()

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetCmdOptManyToOneField ( ) const

Get the command option field Many To One.

Returns
The command option field

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().

+ Here is the caller graph for this function:

◆ GetDstAddr()

Mac16Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetDstAddr ( ) const

Get the Destination address.

Returns
the Destination address (16bits)

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().

+ Here is the caller graph for this function:

◆ GetDstIeeeAddr()

Mac64Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetDstIeeeAddr ( ) const

Get the destination IEEE address.

Returns
The destination IEEE address (64bits)

Definition at line 298 of file zigbee-nwk-payload-header.cc.

References m_dstIeeeAddr.

◆ GetInstanceTypeId()

TypeId ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetInstanceTypeId ( ) const
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.

Returns
The TypeId associated to the most-derived type of this instance.

Implements ns3::ObjectBase.

Definition at line 158 of file zigbee-nwk-payload-header.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetPathCost()

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetPathCost ( ) const

Set the path cost.

Returns
the path cost

Definition at line 279 of file zigbee-nwk-payload-header.cc.

References m_pathCost.

Referenced by ns3::zigbee::ZigbeeNwk::ReceiveRREQ().

+ Here is the caller graph for this function:

◆ GetRouteReqId()

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetRouteReqId ( ) const

Get the Route request identifier.

Returns
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().

+ Here is the caller graph for this function:

◆ GetSerializedSize()

uint32_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetSerializedSize ( ) const
overridevirtual
Returns
the expected size of the header.

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.

◆ GetTypeId()

TypeId ns3::zigbee::ZigbeePayloadRouteRequestCommand::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 148 of file zigbee-nwk-payload-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:

◆ IsDstIeeeAddressPresent()

bool ns3::zigbee::ZigbeePayloadRouteRequestCommand::IsDstIeeeAddressPresent ( ) const

Describe whether or not the destination IEEE Address field is present in the Route Request.

Returns
True if the command option destination IEEE Address field is active

Definition at line 285 of file zigbee-nwk-payload-header.cc.

References m_cmdOptDstIeeeAddr.

◆ Print()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::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 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.

◆ Serialize()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::Serialize ( Buffer::Iterator start) const
overridevirtual
Parameters
startan 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().

+ Here is the call graph for this function:

◆ SetCmdOptionField()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetCmdOptionField ( uint8_t cmdOptionField)
private

Set the complete command option field of the route request command.

Parameters
cmdOptionFieldThe 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().

+ Here is the caller graph for this function:

◆ SetCmdOptManyToOneField()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetCmdOptManyToOneField ( enum ManyToOne manyToOne)

Set the command option field Many To One.

Parameters
manyToOneThe Many To One field ()

Definition at line 237 of file zigbee-nwk-payload-header.cc.

References m_cmdOptManyToOne.

Referenced by ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest().

+ Here is the caller graph for this function:

◆ SetDstAddr()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetDstAddr ( Mac16Address addr)

Set Destination address.

Parameters
addrThe 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().

+ Here is the caller graph for this function:

◆ SetDstIeeeAddr()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetDstIeeeAddr ( Mac64Address dst)

Set the destination IEEE address.

Parameters
dstThe destination IEEE address (64 bits)

Definition at line 291 of file zigbee-nwk-payload-header.cc.

References m_cmdOptDstIeeeAddr, and m_dstIeeeAddr.

◆ SetPathCost()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetPathCost ( uint8_t cost)

Set the path cost.

Parameters
costthe 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().

+ Here is the caller graph for this function:

◆ SetRouteReqId()

void ns3::zigbee::ZigbeePayloadRouteRequestCommand::SetRouteReqId ( uint8_t id)

Set the Route request identifier.

Parameters
idthe 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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cmdOptDstIeeeAddr

bool ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_cmdOptDstIeeeAddr
private

◆ m_cmdOptManyToOne

ManyToOne ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_cmdOptManyToOne
private

◆ m_cmdOptMcst

bool ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_cmdOptMcst
private

Multicast Flag (Bit 6)

Definition at line 198 of file zigbee-nwk-payload-header.h.

Referenced by ZigbeePayloadRouteRequestCommand(), GetCmdOptionField(), Print(), and SetCmdOptionField().

◆ m_dstAddr

Mac16Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_dstAddr
private

Destination address (2 Octets)

Definition at line 203 of file zigbee-nwk-payload-header.h.

Referenced by Deserialize(), GetDstAddr(), Print(), Serialize(), and SetDstAddr().

◆ m_dstIeeeAddr

Mac64Address ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_dstIeeeAddr
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().

◆ m_pathCost

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_pathCost
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().

◆ m_routeReqId

uint8_t ns3::zigbee::ZigbeePayloadRouteRequestCommand::m_routeReqId
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().


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