22 #include "ie-dot11s-configuration.h"
23 #include "ns3/packet.h"
27 Dot11sMeshCapability::Dot11sMeshCapability () :
28 acceptPeerLinks (true), MCCASupported (false), MCCAEnabled (false), forwarding (true), beaconTimingReport (
29 true), TBTTAdjustment (true), powerSaveLevel (false)
33 Dot11sMeshCapability::GetSerializedSize ()
const
38 Dot11sMeshCapability::GetUint16 ()
const
57 if (beaconTimingReport)
72 Dot11sMeshCapability::Serialize (Buffer::Iterator i)
const
74 i.WriteHtolsbU16 (GetUint16 ());
78 Dot11sMeshCapability::Deserialize (Buffer::Iterator i)
80 uint16_t cap = i.ReadLsbtohU16 ();
81 acceptPeerLinks = Is (cap, 0);
82 MCCASupported = Is (cap, 1);
83 MCCAEnabled = Is (cap, 2);
84 forwarding = Is (cap, 3);
85 beaconTimingReport = Is (cap, 4);
86 TBTTAdjustment = Is (cap, 5);
87 powerSaveLevel = Is (cap, 6);
91 Dot11sMeshCapability::Is (uint16_t cap, uint8_t n)
const
93 uint16_t mask = 1 << n;
99 return IE11S_MESH_CONFIGURATION;
102 IeConfiguration::IeConfiguration () :
103 m_APSPId (PROTOCOL_HWMP), m_APSMId (METRIC_AIRTIME), m_CCMId (CONGESTION_NULL), m_SPId (
104 SYNC_NEIGHBOUR_OFFSET), m_APId (AUTH_NULL), m_neighbors (0)
117 + m_meshCap.GetSerializedSize ();
134 m_meshCap.Serialize (i);
154 m_neighbors = (i.
ReadU8 () >> 1) & 0xF;
155 i = m_meshCap.Deserialize (i);
161 os << std::endl <<
"<information_element id=" <<
ElementId () <<
">" << std::endl;
162 os <<
"Number of neighbors: = " << (uint16_t) m_neighbors
163 << std::endl <<
"Active Path Selection Protocol ID: = " << (uint32_t)
m_APSPId
164 << std::endl <<
"Active Path Selection Metric ID: = " << (uint32_t)
m_APSMId
165 << std::endl <<
"Congestion Control Mode ID: = " << (uint32_t)
m_CCMId
166 << std::endl <<
"Synchronize protocol ID: = " << (uint32_t)
m_SPId
167 << std::endl <<
"Authentication protocol ID: = " << (uint32_t)
m_APId
168 << std::endl <<
"Capabilities: = " << m_meshCap.GetUint16 () << std::endl;
169 os <<
"</information_element>" << std::endl;
182 IeConfiguration::IsHWMP ()
187 IeConfiguration::IsAirtime ()
189 return (
m_APSMId == METRIC_AIRTIME);
192 IeConfiguration::SetNeighborCount (uint8_t neighbors)
194 m_neighbors = (neighbors > 31) ? 31 : neighbors;
197 IeConfiguration::GetNeighborCount ()
201 Dot11sMeshCapability
const&
202 IeConfiguration::MeshCapability ()
207 operator== (
const Dot11sMeshCapability & a,
const Dot11sMeshCapability & b)
209 return ((a.acceptPeerLinks == b.acceptPeerLinks) && (a.MCCASupported == b.MCCASupported) && (a.MCCAEnabled
210 == b.MCCAEnabled) && (a.forwarding == b.forwarding) && (a.beaconTimingReport == b.beaconTimingReport)
211 && (a.TBTTAdjustment == b.TBTTAdjustment) && (a.powerSaveLevel == b.powerSaveLevel));
214 operator== (
const IeConfiguration & a,
const IeConfiguration & b)
216 return ((a.m_APSPId == b.m_APSPId) && (a.m_APSMId == b.m_APSMId) && (a.m_CCMId == b.m_CCMId) && (a.m_SPId
217 == b.m_SPId) && (a.m_APId == b.m_APId) && (a.m_neighbors == b.m_neighbors) && (a.m_meshCap
221 operator << (std::ostream &os,
const IeConfiguration &a)
dot11sAuthenticationProtocol m_APId
virtual void SerializeInformationField(Buffer::Iterator i) const
virtual uint8_t DeserializeInformationField(Buffer::Iterator i, uint8_t length)
dot11sPathSelectionProtocol
See 7.3.2.86.1 in 802.11s draft 3.0.
virtual WifiInformationElementId ElementId() const
Own unique Element ID.
dot11sPathSelectionMetric m_APSMId
uint32_t GetDistanceFrom(Iterator const &o) const
#define NS_FATAL_ERROR(msg)
fatal error handling
iterator in a Buffer instance
dot11sSynchronizationProtocolIdentifier
See 7.3.2.86.4 in 802.11s draft 3.0.
dot11sPathSelectionProtocol m_APSPId
dot11sCongestionControlMode m_CCMId
dot11sPathSelectionMetric
See 7.3.2.86.2 in 802.11s draft 3.0.
virtual void Print(std::ostream &os) const
In addition, a subclass may optionally override the following...
std::ostream & operator<<(std::ostream &os, const Angles &a)
void WriteU8(uint8_t data)
dot11sSynchronizationProtocolIdentifier m_SPId
uint8_t WifiInformationElementId
dot11sAuthenticationProtocol
See 7.3.2.86.5 in 802.11s draft 3.0.
uint32_t ReadLsbtohU32(void)
dot11sCongestionControlMode
See 7.3.2.86.3 in 802.11s draft 3.0.
void WriteHtolsbU32(uint32_t data)
virtual uint8_t GetInformationFieldSize() const