21 #include "ie-dot11s-prep.h"
22 #include "ns3/address-utils.h"
23 #include "ns3/assert.h"
24 #include "ns3/packet.h"
34 m_flags (0), m_hopcount (0), m_ttl (0), m_destinationAddress (Mac48Address::GetBroadcast ()),
35 m_destSeqNumber (0), m_lifetime (0), m_metric (0), m_originatorAddress (Mac48Address::GetBroadcast ()),
36 m_originatorSeqNumber (0)
45 IePrep::SetFlags (uint8_t flags)
50 IePrep::SetHopcount (uint8_t hopcount)
52 m_hopcount = hopcount;
55 IePrep::SetTtl (uint8_t ttl)
60 IePrep::SetDestinationSeqNumber (uint32_t destSeqNumber)
62 m_destSeqNumber = destSeqNumber;
65 IePrep::SetDestinationAddress (Mac48Address destAddress)
67 m_destinationAddress = destAddress;
70 IePrep::SetMetric (uint32_t metric)
75 IePrep::SetOriginatorAddress (Mac48Address originatorAddress)
77 m_originatorAddress = originatorAddress;
80 IePrep::SetOriginatorSeqNumber (uint32_t originatorSeqNumber)
82 m_originatorSeqNumber = originatorSeqNumber;
85 IePrep::SetLifetime (uint32_t lifetime)
87 m_lifetime = lifetime;
90 IePrep::GetFlags ()
const
95 IePrep::GetHopcount ()
const
100 IePrep::GetTtl ()
const
105 IePrep::GetDestinationSeqNumber ()
const
107 return m_destSeqNumber;
110 IePrep::GetDestinationAddress ()
const
112 return m_destinationAddress;
115 IePrep::GetMetric ()
const
120 IePrep::GetOriginatorAddress ()
const
122 return m_originatorAddress;
125 IePrep::GetOriginatorSeqNumber ()
const
127 return m_originatorSeqNumber;
130 IePrep::GetLifetime ()
const
135 IePrep::DecrementTtl ()
142 IePrep::IncrementMetric (uint32_t metric)
153 WriteTo (i, m_destinationAddress);
157 WriteTo (i, m_originatorAddress);
167 ReadFrom (i, m_destinationAddress);
171 ReadFrom (i, m_originatorAddress);
192 os << std::endl <<
"<information_element id=" <<
ElementId () <<
">" << std::endl;
193 os <<
"Flags: = " << m_flags << std::endl <<
"Hopcount: = " << m_hopcount << std::endl <<
"TTL: = " << m_ttl
194 << std::endl<<
"Destination: = " << m_destinationAddress << std::endl <<
"Dest. seqnum: = " << m_destSeqNumber
195 << std::endl <<
"Lifetime: = " << m_lifetime << std::endl<<
"Metric: = " << m_metric << std::endl <<
"Originator: = "
196 << m_originatorAddress << std::endl <<
"Orig. seqnum: = " << m_originatorSeqNumber << std::endl;
197 os <<
"</information_element>" << std::endl;
202 return ((a.m_flags == b.m_flags) && (a.m_hopcount == b.m_hopcount) && (a.m_ttl == b.m_ttl)
203 && (a.m_destinationAddress == b.m_destinationAddress) && (a.m_destSeqNumber == b.m_destSeqNumber)
204 && (a.m_lifetime == b.m_lifetime) && (a.m_metric == b.m_metric) && (a.m_originatorAddress
205 == b.m_originatorAddress) && (a.m_originatorSeqNumber == b.m_originatorSeqNumber));
virtual void Print(std::ostream &os) const
In addition, a subclass may optionally override the following...
See 7.3.2.97 of 802.11s draft 2.07.
virtual WifiInformationElementId ElementId() const
Own unique Element ID.
uint32_t GetDistanceFrom(Iterator const &o) const
iterator in a Buffer instance
virtual uint8_t GetInformationFieldSize() const
std::ostream & operator<<(std::ostream &os, const Angles &a)
void WriteU8(uint8_t data)
uint8_t WifiInformationElementId
virtual uint8_t DeserializeInformationField(Buffer::Iterator start, uint8_t length)
virtual void SerializeInformationField(Buffer::Iterator i) const
uint32_t ReadLsbtohU32(void)
void WriteHtolsbU32(uint32_t data)