A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | Friends | List of all members
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:

Public Member Functions

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

Private Attributes

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

Friends

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

Detailed Description

See 7.3.2.96 of 802.11s draft 2.07.

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

Constructor & Destructor Documentation

◆ IePreq()

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

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

◆ ~IePreq()

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

Definition at line 86 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 339 of file ie-dot11s-preq.cc.

References m_destCount, and m_destinations.

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

◆ ClearDestinationAddressElements()

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

Clear PREQ: remove all destinations.

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

References m_destCount, and m_destinations.

◆ DecrementTtl()

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

Handle TTL.

Definition at line 203 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 359 of file ie-dot11s-preq.cc.

References m_destCount, and m_destinations.

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

◆ DeserializeInformationField()

uint8_t ns3::dot11s::IePreq::DeserializeInformationField ( Buffer::Iterator  start,
uint8_t  length 
)
virtual

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.
length
Returns
the number of bytes read

Implements ns3::WifiInformationElement.

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

References 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(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().

◆ ElementId()

WifiInformationElementId ns3::dot11s::IePreq::ElementId ( ) const
virtual
Returns
Own unique Element ID

Implements ns3::WifiInformationElement.

Definition at line 96 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 198 of file ie-dot11s-preq.cc.

References m_destCount.

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

◆ 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 334 of file ie-dot11s-preq.cc.

References m_destinations.

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

◆ GetHopCount()

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

Get hop count value.

Returns
the hop count

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

References m_hopCount.

◆ GetInformationFieldSize()

uint8_t ns3::dot11s::IePreq::GetInformationFieldSize ( ) const
virtual

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)

Returns
the length of serialized information

Implements ns3::WifiInformationElement.

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

References m_destCount, and m_maxSize.

Referenced by IsFull(), and MayAddAddress().

◆ GetLifetime()

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

Get lifetime value.

Returns
the lifetime in TUs

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

References m_lifetime.

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

◆ GetMetric()

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

Get metric value.

Returns
the metric

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

References m_metric.

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

◆ GetOriginatorAddress()

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

Get originator address value.

Returns
the originator MAC address

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

References m_originatorAddress.

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

◆ GetOriginatorSeqNumber()

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

Get originator sequence numnber value.

Returns
the originator sequence number

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

References m_originatorSeqNumber.

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

◆ GetPreqID()

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

Get path discovery id field.

Returns
the path discovery ID

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

References m_preqId.

◆ GetTtl()

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

Get TTL value.

Returns
the TTL

Definition at line 167 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 209 of file ie-dot11s-preq.cc.

References m_metric.

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

◆ IsFull()

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

Is full function.

Returns
true if full

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

References GetInformationFieldSize().

◆ 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 157 of file ie-dot11s-preq.cc.

References m_flags.

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

◆ IsUnicastPreq()

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

Is unicast PREQ function.

Returns
true if unicast PREQ

Definition at line 152 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 415 of file ie-dot11s-preq.cc.

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

◆ Print()

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

Generate human-readable form of IE.

Parameters
osoutput stream

Reimplemented from ns3::WifiInformationElement.

Definition at line 317 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<<().

◆ SerializeInformationField()

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

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

◆ SetDestCount()

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

Set destination count value.

Parameters
dest_countthe destination count

Definition at line 147 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 112 of file ie-dot11s-preq.cc.

References m_hopCount.

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

◆ 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 142 of file ie-dot11s-preq.cc.

References m_lifetime.

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

◆ SetMetric()

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

Set metric value.

Parameters
metricthe metric

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

References m_metric.

◆ SetNeedNotPrep()

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

Set Proactive PREP subfield to off.

Definition at line 107 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 132 of file ie-dot11s-preq.cc.

References m_originatorAddress.

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

◆ SetOriginatorSeqNumber()

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

Set originator sequence number.

Parameters
originator_seq_number

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

References m_originatorSeqNumber.

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

◆ 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 122 of file ie-dot11s-preq.cc.

References m_preqId.

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

◆ SetTTL()

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

Set remaining number of hops allowed for this element.

Parameters
ttlthe TTL

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

References m_ttl.

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

◆ SetUnicastPreq()

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

Set flag indicating that PREQ is unicast.

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

References m_flags.

Friends And Related Function Documentation

◆ operator==

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

equality operator

Parameters
alhs
brhs
Returns
true if equal

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

Member Data Documentation

◆ m_destCount

uint8_t ns3::dot11s::IePreq::m_destCount
private

◆ m_destinations

std::vector<Ptr<DestinationAddressUnit> > ns3::dot11s::IePreq::m_destinations
private

◆ 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 268 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: