|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #include "ns3/address-utils.h"
23 #include "ns3/assert.h"
24 #include "ns3/packet.h"
32 m_do (false), m_rf (false), m_usn (false), m_destinationAddress (
Mac48Address ()), m_destSeqNumber (0)
90 m_maxSize (32), m_flags (0), m_hopCount (0), m_ttl (0), m_preqId (0), m_originatorAddress (
91 Mac48Address::GetBroadcast ()), m_originatorSeqNumber (0), m_lifetime (0), m_metric (0),
243 WriteTo (i, (*j)->GetDestinationAddress ());
270 bool usnFlag =
false;
271 uint8_t flags = i.
ReadU8 ();
272 if (flags & (1 << 0))
276 if (flags & (1 << 1))
280 if (flags & (1 << 2))
284 new_element->SetFlags (doFlag, rfFlag, usnFlag);
287 new_element->SetDestinationAddress (addr);
320 <<
", TTL=" << (uint16_t)
m_ttl
326 <<
", Destinations=(";
333 std::vector<Ptr<DestinationAddressUnit> >
340 uint32_t dest_seq_number)
345 if ((*i)->GetDestinationAddress () == dest_address)
352 new_element->SetFlags (doFlag, rfFlag, (dest_seq_number == 0));
353 new_element->SetDestinationAddress (dest_address);
354 new_element->SetDestSeqNumber (dest_seq_number);
364 if ((*i)->GetDestinationAddress () == dest_address)
void AddDestinationAddressElement(bool doFlag, bool rfFlag, Mac48Address dest_address, uint32_t dest_seq_number)
Add a destination address unit: flags, destination and sequence number.
std::vector< Ptr< DestinationAddressUnit > > GetDestinationList()
Get all destinations, which are stored in PREQ:
uint32_t GetOriginatorSeqNumber() const
Get originator sequence numnber value.
void SetMetric(uint32_t metric)
Set metric value.
uint8_t m_hopCount
hop count
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
uint32_t m_lifetime
lifetime
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)
bool operator==(const MeshHeader &a, const MeshHeader &b)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetUnicastPreq()
Set flag indicating that PREQ is unicast.
uint32_t GetDistanceFrom(Iterator const &o) const
void IncrementMetric(uint32_t metric)
Handle Metric:
Mac48Address m_originatorAddress
originator address
void SetDestCount(uint8_t dest_count)
Set destination count value.
bool IsRf()
is RF function
uint8_t GetHopCount() const
Get hop count value.
void SetTTL(uint8_t ttl)
Set remaining number of hops allowed for this element.
void WriteU8(uint8_t data)
void SetDestSeqNumber(uint32_t dest_seq_number)
Set destination sequence number.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
bool IsUnicastPreq() const
Is unicast PREQ function.
U * PeekPointer(const Ptr< U > &p)
bool IsNeedNotPrep() const
Check whether Proactive PREP subfield to off.
Smart pointer class similar to boost::intrusive_ptr.
static Mac48Address GetBroadcast(void)
void SetOriginatorAddress(Mac48Address originator_address)
Set originator address value.
uint32_t GetDestSeqNumber() const
Get destination sequence number.
void WriteHtolsbU32(uint32_t data)
virtual uint8_t GetInformationFieldSize() const
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
bool IsDo()
Is do function.
uint8_t GetDestCount() const
Get destination count.
void SetNeedNotPrep()
Set Proactive PREP subfield to off.
uint32_t m_preqId
PREQ ID.
See 7.3.2.96 of 802.11s draft 2.07.
void ClearDestinationAddressElements()
Clear PREQ: remove all destinations.
virtual void Print(std::ostream &os) const
Generate human-readable form of IE.
void SetLifetime(uint32_t lifetime)
Set lifetime in TUs for the forwarding information to be considered valid.
uint32_t ReadLsbtohU32(void)
uint32_t GetPreqID() const
Get path discovery id field.
void DecrementTtl()
Handle TTL.
uint32_t GetMetric() const
Get metric value.
uint8_t m_destCount
destination count
uint32_t m_destSeqNumber
destination sequence number
iterator in a Buffer instance
Mac48Address GetDestinationAddress() const
Get destination address function.
void DelDestinationAddressElement(Mac48Address dest_address)
Delete a destination address unit by destination.
virtual WifiInformationElementId ElementId() const
void SetFlags(bool doFlag, bool rfFlag, bool usnFlag)
Set flags function.
uint32_t GetLifetime() const
Get lifetime value.
virtual void SerializeInformationField(Buffer::Iterator i) const
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetTtl() const
Get TTL value.
Describes an address unit in PREQ information element See 7.3.2.96 for more details.
void SetPreqID(uint32_t id)
Set path discovery id field.
uint8_t m_maxSize
how many destinations we support
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void SetOriginatorSeqNumber(uint32_t originator_seq_number)
Set originator sequence number.
bool IsUsn()
Is USN function.
uint32_t m_originatorSeqNumber
originator sequence number
void SetHopcount(uint8_t hopcount)
Set number of hops from originator to mesh STA transmitting this element.
void SetDestinationAddress(Mac48Address dest_address)
Set destination address function.
std::vector< Ptr< DestinationAddressUnit > > m_destinations
the destinations
Mac48Address GetOriginatorAddress() const
Get originator address value.
std::ostream & operator<<(std::ostream &os, const IeBeaconTiming &a)
Mac48Address m_destinationAddress
destination address
bool IsFull() const
Is full function.
bool MayAddAddress(Mac48Address originator)
Checks that preq's originator address equals to originator, and this preq is not proactive.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.