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

See 7.3.2.96 of 802.11s draft 2.07. More...

#include "ie-dot11s-preq.h"

+ Inheritance diagram for ns3::dot11s::IePreq:
+ Collaboration diagram for ns3::dot11s::IePreq:

Public Member Functions

 IePreq ()
 
 ~IePreq () override
 
void AddDestinationAddressElement (bool doFlag, bool rfFlag, Mac48Address dest_address, uint32_t dest_seq_number)
 Add a destination address unit: flags, destination and sequence number.
 
void ClearDestinationAddressElements ()
 Clear PREQ: remove all destinations.
 
void DecrementTtl ()
 Handle TTL.
 
void DelDestinationAddressElement (Mac48Address dest_address)
 Delete a destination address unit by destination.
 
uint16_t DeserializeInformationField (Buffer::Iterator i, uint16_t length) override
 Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
 
WifiInformationElementId ElementId () const override
 Get the wifi information element ID.
 
uint8_t GetDestCount () const
 Get destination count.
 
std::vector< Ptr< DestinationAddressUnit > > GetDestinationList ()
 Get all destinations, which are stored in PREQ:
 
uint8_t GetHopCount () const
 Get hop count value.
 
uint16_t GetInformationFieldSize () const override
 Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets.
 
uint32_t GetLifetime () const
 Get lifetime value.
 
uint32_t GetMetric () const
 Get metric value.
 
Mac48Address GetOriginatorAddress () const
 Get originator address value.
 
uint32_t GetOriginatorSeqNumber () const
 Get originator sequence number value.
 
uint32_t GetPreqID () const
 Get path discovery id field.
 
uint8_t GetTtl () const
 Get TTL value.
 
void IncrementMetric (uint32_t metric)
 Handle Metric:
 
bool IsFull () const
 Is full function.
 
bool IsNeedNotPrep () const
 Check whether Proactive PREP subfield to off.
 
bool IsUnicastPreq () const
 Is unicast PREQ function.
 
bool MayAddAddress (Mac48Address originator)
 Checks that preq's originator address equals to originator, and this preq is not proactive.
 
void Print (std::ostream &os) const override
 Generate human-readable form of IE.
 
void SerializeInformationField (Buffer::Iterator i) const override
 Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
 
void SetDestCount (uint8_t dest_count)
 Set destination count value.
 
void SetHopcount (uint8_t hopcount)
 Set number of hops from originator to mesh STA transmitting this element.
 
void SetLifetime (uint32_t lifetime)
 Set lifetime in TUs for the forwarding information to be considered valid.
 
void SetMetric (uint32_t metric)
 Set metric value.
 
void SetNeedNotPrep ()
 Set Proactive PREP subfield to off.
 
void SetOriginatorAddress (Mac48Address originator_address)
 Set originator address value.
 
void SetOriginatorSeqNumber (uint32_t originator_seq_number)
 Set originator sequence number.
 
void SetPreqID (uint32_t id)
 Set path discovery id field.
 
void SetTTL (uint8_t ttl)
 Set remaining number of hops allowed for this element.
 
void SetUnicastPreq ()
 Set flag indicating that PREQ is unicast.
 
- Public Member Functions inherited from ns3::WifiInformationElement
virtual ~WifiInformationElement ()
 
Buffer::Iterator Deserialize (Buffer::Iterator i)
 Deserialize entire IE (which may possibly be fragmented into multiple elements), which must be present.
 
Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i)
 Deserialize entire IE (which may possibly be fragmented into multiple elements) if it is present.
 
virtual WifiInformationElementId ElementIdExt () const
 Get the wifi information element ID extension.
 
uint16_t GetSerializedSize () const
 Get the size of the serialized IE including Element ID and length fields (for every element this IE is possibly fragmented into).
 
virtual bool operator== (const WifiInformationElement &a) const
 Compare two IEs for equality by ID & Length, and then through memcmp of serialised version.
 
Buffer::Iterator Serialize (Buffer::Iterator i) const
 Serialize entire IE including Element ID and length fields.
 
- Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Private Attributes

uint8_t m_destCount
 destination count
 
std::vector< Ptr< DestinationAddressUnit > > m_destinations
 the destinations
 
uint8_t m_flags
 flags
 
uint8_t m_hopCount
 hop count
 
uint32_t m_lifetime
 lifetime
 
uint8_t m_maxSize
 how many destinations we support
 
uint32_t m_metric
 metric
 
Mac48Address m_originatorAddress
 originator address
 
uint32_t m_originatorSeqNumber
 originator sequence number
 
uint32_t m_preqId
 PREQ ID.
 
uint8_t m_ttl
 TTL.
 

Friends

bool operator== (const IePreq &a, const IePreq &b)
 equality operator
 

Detailed Description

See 7.3.2.96 of 802.11s draft 2.07.

Definition at line 94 of file ie-dot11s-preq.h.

Constructor & Destructor Documentation

◆ IePreq()

ns3::dot11s::IePreq::IePreq ( )

Definition at line 92 of file ie-dot11s-preq.cc.

◆ ~IePreq()

ns3::dot11s::IePreq::~IePreq ( )
override

Definition at line 88 of file ie-dot11s-preq.cc.

Member Function Documentation

◆ AddDestinationAddressElement()

void ns3::dot11s::IePreq::AddDestinationAddressElement ( bool doFlag,
bool rfFlag,
Mac48Address dest_address,
uint32_t dest_seq_number )

Add a destination address unit: flags, destination and sequence number.

Parameters
doFlag
rfFlag
dest_address
dest_seq_number
Todo
check overflow

Definition at line 371 of file ie-dot11s-preq.cc.

References ns3::Create(), m_destCount, and m_destinations.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearDestinationAddressElements()

void ns3::dot11s::IePreq::ClearDestinationAddressElements ( )

Clear PREQ: remove all destinations.

Definition at line 407 of file ie-dot11s-preq.cc.

References m_destCount, and m_destinations.

◆ DecrementTtl()

void ns3::dot11s::IePreq::DecrementTtl ( )

Handle TTL.

Definition at line 233 of file ie-dot11s-preq.cc.

References m_hopCount, and m_ttl.

◆ DelDestinationAddressElement()

void ns3::dot11s::IePreq::DelDestinationAddressElement ( Mac48Address dest_address)

Delete a destination address unit by destination.

Parameters
dest_addressthe destination address

Definition at line 393 of file ie-dot11s-preq.cc.

References m_destCount, and m_destinations.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ DeserializeInformationField()

uint16_t ns3::dot11s::IePreq::DeserializeInformationField ( Buffer::Iterator start,
uint16_t length )
overridevirtual

Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)

Parameters
startan iterator which points to where the information should be written.
lengththe expected number of bytes to read
Returns
the number of bytes read

Implements ns3::WifiInformationElement.

Definition at line 285 of file ie-dot11s-preq.cc.

References ns3::Create(), ns3::Buffer::Iterator::GetDistanceFrom(), m_destCount, m_destinations, m_flags, m_hopCount, m_lifetime, m_metric, m_originatorAddress, m_originatorSeqNumber, m_preqId, m_ttl, NS_ASSERT, ns3::ReadFrom(), ns3::Buffer::Iterator::ReadLsbtohU32(), and ns3::Buffer::Iterator::ReadU8().

+ Here is the call graph for this function:

◆ ElementId()

WifiInformationElementId ns3::dot11s::IePreq::ElementId ( ) const
overridevirtual

Get the wifi information element ID.

Returns
the wifi information element ID

Implements ns3::WifiInformationElement.

Definition at line 107 of file ie-dot11s-preq.cc.

References IE_PREQ.

◆ GetDestCount()

uint8_t ns3::dot11s::IePreq::GetDestCount ( ) const

Get destination count.

Returns
the destination count

Definition at line 227 of file ie-dot11s-preq.cc.

References m_destCount.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetDestinationList()

std::vector< Ptr< DestinationAddressUnit > > ns3::dot11s::IePreq::GetDestinationList ( )

Get all destinations, which are stored in PREQ:

Returns
the list of destination addresses

Definition at line 365 of file ie-dot11s-preq.cc.

References m_destinations.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetHopCount()

uint8_t ns3::dot11s::IePreq::GetHopCount ( ) const

Get hop count value.

Returns
the hop count

Definition at line 185 of file ie-dot11s-preq.cc.

References m_hopCount.

◆ GetInformationFieldSize()

uint16_t ns3::dot11s::IePreq::GetInformationFieldSize ( ) const
overridevirtual

Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets.

This is the value that will appear in the second octet of the entire IE - the length field - if the IE is not fragmented)

Returns
the length of serialized information

Implements ns3::WifiInformationElement.

Definition at line 328 of file ie-dot11s-preq.cc.

References m_destCount, and m_maxSize.

Referenced by IsFull(), and MayAddAddress().

+ Here is the caller graph for this function:

◆ GetLifetime()

uint32_t ns3::dot11s::IePreq::GetLifetime ( ) const

Get lifetime value.

Returns
the lifetime in TUs

Definition at line 221 of file ie-dot11s-preq.cc.

References m_lifetime.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetMetric()

uint32_t ns3::dot11s::IePreq::GetMetric ( ) const

Get metric value.

Returns
the metric

Definition at line 203 of file ie-dot11s-preq.cc.

References m_metric.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetOriginatorAddress()

Mac48Address ns3::dot11s::IePreq::GetOriginatorAddress ( ) const

Get originator address value.

Returns
the originator MAC address

Definition at line 209 of file ie-dot11s-preq.cc.

References m_originatorAddress.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetOriginatorSeqNumber()

uint32_t ns3::dot11s::IePreq::GetOriginatorSeqNumber ( ) const

Get originator sequence number value.

Returns
the originator sequence number

Definition at line 215 of file ie-dot11s-preq.cc.

References m_originatorSeqNumber.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ GetPreqID()

uint32_t ns3::dot11s::IePreq::GetPreqID ( ) const

Get path discovery id field.

Returns
the path discovery ID

Definition at line 197 of file ie-dot11s-preq.cc.

References m_preqId.

◆ GetTtl()

uint8_t ns3::dot11s::IePreq::GetTtl ( ) const

Get TTL value.

Returns
the TTL

Definition at line 191 of file ie-dot11s-preq.cc.

References m_ttl.

◆ IncrementMetric()

void ns3::dot11s::IePreq::IncrementMetric ( uint32_t metric)

Handle Metric:

Parameters
metricthe mteric to increment

Definition at line 240 of file ie-dot11s-preq.cc.

References m_metric.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ IsFull()

bool ns3::dot11s::IePreq::IsFull ( ) const

Is full function.

Returns
true if full

Definition at line 471 of file ie-dot11s-preq.cc.

References GetInformationFieldSize().

+ Here is the call graph for this function:

◆ IsNeedNotPrep()

bool ns3::dot11s::IePreq::IsNeedNotPrep ( ) const

Check whether Proactive PREP subfield to off.

Returns
true if need not Proactive PREP subfield is off

Definition at line 179 of file ie-dot11s-preq.cc.

References m_flags.

Referenced by ns3::dot11s::HwmpProtocol::ReceivePreq().

+ Here is the caller graph for this function:

◆ IsUnicastPreq()

bool ns3::dot11s::IePreq::IsUnicastPreq ( ) const

Is unicast PREQ function.

Returns
true if unicast PREQ

Definition at line 173 of file ie-dot11s-preq.cc.

References m_flags.

◆ MayAddAddress()

bool ns3::dot11s::IePreq::MayAddAddress ( Mac48Address originator)

Checks that preq's originator address equals to originator, and this preq is not proactive.

Parameters
originatorthe originator address
Returns
true if it may add

Definition at line 452 of file ie-dot11s-preq.cc.

References ns3::Mac48Address::GetBroadcast(), GetInformationFieldSize(), m_destinations, and m_originatorAddress.

+ Here is the call graph for this function:

◆ Print()

void ns3::dot11s::IePreq::Print ( std::ostream & os) const
overridevirtual

Generate human-readable form of IE.

Parameters
osoutput stream

Reimplemented from ns3::WifiInformationElement.

Definition at line 351 of file ie-dot11s-preq.cc.

References m_destCount, m_destinations, m_hopCount, m_lifetime, m_metric, m_originatorAddress, m_originatorSeqNumber, m_preqId, and m_ttl.

Referenced by ns3::dot11s::operator<<().

+ Here is the caller graph for this function:

◆ SerializeInformationField()

void ns3::dot11s::IePreq::SerializeInformationField ( Buffer::Iterator start) const
overridevirtual

Serialize information (i.e., the body of the IE, not including the Element ID and length octets)

Parameters
startan iterator which points to where the information should be written.

Implements ns3::WifiInformationElement.

Definition at line 246 of file ie-dot11s-preq.cc.

References m_destCount, m_destinations, m_flags, m_hopCount, m_lifetime, m_maxSize, m_metric, m_originatorAddress, m_originatorSeqNumber, m_preqId, m_ttl, ns3::Buffer::Iterator::WriteHtolsbU32(), ns3::WriteTo(), and ns3::Buffer::Iterator::WriteU8().

+ Here is the call graph for this function:

◆ SetDestCount()

void ns3::dot11s::IePreq::SetDestCount ( uint8_t dest_count)

Set destination count value.

Parameters
dest_countthe destination count

Definition at line 167 of file ie-dot11s-preq.cc.

References m_destCount.

◆ SetHopcount()

void ns3::dot11s::IePreq::SetHopcount ( uint8_t hopcount)

Set number of hops from originator to mesh STA transmitting this element.

Parameters
hopcountthe hop count

Definition at line 125 of file ie-dot11s-preq.cc.

References m_hopCount.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetLifetime()

void ns3::dot11s::IePreq::SetLifetime ( uint32_t lifetime)

Set lifetime in TUs for the forwarding information to be considered valid.

Parameters
lifetimethe lifetime in TUs

Definition at line 161 of file ie-dot11s-preq.cc.

References m_lifetime.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetMetric()

void ns3::dot11s::IePreq::SetMetric ( uint32_t metric)

Set metric value.

Parameters
metricthe metric

Definition at line 143 of file ie-dot11s-preq.cc.

References m_metric.

◆ SetNeedNotPrep()

void ns3::dot11s::IePreq::SetNeedNotPrep ( )

Set Proactive PREP subfield to off.

Definition at line 119 of file ie-dot11s-preq.cc.

References m_flags.

◆ SetOriginatorAddress()

void ns3::dot11s::IePreq::SetOriginatorAddress ( Mac48Address originator_address)

Set originator address value.

Parameters
originator_addressthe originator MAC address

Definition at line 149 of file ie-dot11s-preq.cc.

References m_originatorAddress.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetOriginatorSeqNumber()

void ns3::dot11s::IePreq::SetOriginatorSeqNumber ( uint32_t originator_seq_number)

Set originator sequence number.

Parameters
originator_seq_number

Definition at line 155 of file ie-dot11s-preq.cc.

References m_originatorSeqNumber.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetPreqID()

void ns3::dot11s::IePreq::SetPreqID ( uint32_t id)

Set path discovery id field.

Parameters
idsome unique id for this path discovery

Definition at line 137 of file ie-dot11s-preq.cc.

References m_preqId.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetTTL()

void ns3::dot11s::IePreq::SetTTL ( uint8_t ttl)

Set remaining number of hops allowed for this element.

Parameters
ttlthe TTL

Definition at line 131 of file ie-dot11s-preq.cc.

References m_ttl.

Referenced by ns3::dot11s::HwmpProtocolMac::RequestDestination(), and ns3::dot11s::HwmpProtocol::SendProactivePreq().

+ Here is the caller graph for this function:

◆ SetUnicastPreq()

void ns3::dot11s::IePreq::SetUnicastPreq ( )

Set flag indicating that PREQ is unicast.

Definition at line 113 of file ie-dot11s-preq.cc.

References m_flags.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const IePreq & a,
const IePreq & b )
friend

equality operator

Parameters
alhs
brhs
Returns
true if equal

Definition at line 426 of file ie-dot11s-preq.cc.

Member Data Documentation

◆ m_destCount

◆ m_destinations

◆ m_flags

uint8_t ns3::dot11s::IePreq::m_flags
private

◆ m_hopCount

uint8_t ns3::dot11s::IePreq::m_hopCount
private

◆ m_lifetime

uint32_t ns3::dot11s::IePreq::m_lifetime
private

◆ m_maxSize

uint8_t ns3::dot11s::IePreq::m_maxSize
private

how many destinations we support

Todo
make as an attribute

Definition at line 258 of file ie-dot11s-preq.h.

Referenced by GetInformationFieldSize(), and SerializeInformationField().

◆ m_metric

uint32_t ns3::dot11s::IePreq::m_metric
private

◆ m_originatorAddress

Mac48Address ns3::dot11s::IePreq::m_originatorAddress
private

◆ m_originatorSeqNumber

uint32_t ns3::dot11s::IePreq::m_originatorSeqNumber
private

◆ m_preqId

uint32_t ns3::dot11s::IePreq::m_preqId
private

◆ m_ttl

uint8_t ns3::dot11s::IePreq::m_ttl
private

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