From 450348d5db2b0c6509cbf286f1a9205ed0bb5196 Mon Sep 17 00:00:00 2001 From: Andrey Mazo Date: Mon, 25 May 2009 17:04:53 +0400 Subject: [PATCH] Moving to IEEE 802.11s Draft 3.0 (Mesh Configuration Element) fix Mesh Capability field; remove old protocol Identifiers; fix links to the draft. --- .../mesh/dot11s/ie-dot11s-configuration.cc | 35 +++++++++++-------- .../mesh/dot11s/ie-dot11s-configuration.h | 28 +++++---------- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc index 0c930d577..dbb676583 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc @@ -28,7 +28,8 @@ namespace dot11s { dot11sMeshCapability::dot11sMeshCapability (): acceptPeerLinks (true), - MDAEnabled (false), + MCCASupported (false), + MCCAEnabled (false), forwarding (true), beaconTimingReport (true), TBTTAdjustment (true), @@ -45,16 +46,18 @@ Buffer::Iterator dot11sMeshCapability::Serialize (Buffer::Iterator i) const uint16_t result = 0; if (acceptPeerLinks) result |= 1 << 0; - if (MDAEnabled) + if (MCCASupported) result |= 1 << 1; - if (forwarding) + if (MCCAEnabled) result |= 1 << 2; - if (beaconTimingReport) + if (forwarding) result |= 1 << 3; - if (TBTTAdjustment) + if (beaconTimingReport) result |= 1 << 4; - if (powerSaveLevel) + if (TBTTAdjustment) result |= 1 << 5; + if (powerSaveLevel) + result |= 1 << 6; i.WriteHtolsbU16 (result); return i; } @@ -62,12 +65,13 @@ Buffer::Iterator dot11sMeshCapability::Serialize (Buffer::Iterator i) const Buffer::Iterator dot11sMeshCapability::Deserialize (Buffer::Iterator i) { uint16_t cap = i.ReadLsbtohU16 (); - acceptPeerLinks = Is (cap, 0); - MDAEnabled = Is (cap, 1); - forwarding = Is (cap, 2); - beaconTimingReport = Is (cap, 3); - TBTTAdjustment = Is (cap, 4); - powerSaveLevel = Is (cap, 5); + acceptPeerLinks = Is (cap, 0); + MCCASupported = Is (cap, 1); + MCCAEnabled = Is (cap, 2); + forwarding = Is (cap, 3); + beaconTimingReport = Is (cap, 4); + TBTTAdjustment = Is (cap, 5); + powerSaveLevel = Is (cap, 6); return i; } @@ -80,7 +84,7 @@ bool dot11sMeshCapability::Is (uint16_t cap, uint8_t n) const IeConfiguration::IeConfiguration (): m_APSId (PROTOCOL_HWMP), m_APSMId (METRIC_AIRTIME), - m_CCMId (CONGESTION_DEFAULT), + m_CCMId (CONGESTION_NULL), m_SPId (SYNC_NEIGHBOUR_OFFSET), m_APId (AUTH_NULL), m_neighbors (0) @@ -126,7 +130,7 @@ IeConfiguration::SerializeInformation (Buffer::Iterator i) const i.WriteHtolsbU32 (m_SPId); // Auth: i.WriteHtolsbU32 (m_APId); - i.WriteU8 (m_neighbors * 2); + i.WriteU8 (m_neighbors << 1); m_meshCap.Serialize (i); } @@ -194,7 +198,8 @@ bool operator== (const dot11sMeshCapability & a, const dot11sMeshCapability & b) { return ( (a.acceptPeerLinks == b.acceptPeerLinks) && - (a.MDAEnabled == b.MDAEnabled) && + (a.MCCASupported == b.MCCASupported) && + (a.MCCAEnabled == b.MCCAEnabled) && (a.forwarding == b.forwarding) && (a.beaconTimingReport == b.beaconTimingReport) && (a.TBTTAdjustment == b.TBTTAdjustment) && diff --git a/src/devices/mesh/dot11s/ie-dot11s-configuration.h b/src/devices/mesh/dot11s/ie-dot11s-configuration.h index e50371325..28d9533c0 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-configuration.h +++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.h @@ -29,30 +29,28 @@ namespace ns3 { namespace dot11s { /** * \ingroup dot11s - * \brief See 7.3.2.84.1 in 802.11s draft 3.0 + * \brief See 7.3.2.86.1 in 802.11s draft 3.0 */ enum dot11sPathSelectionProtocol { PROTOCOL_HWMP = 0x000fac00, - PROTOCOL_NULL = 0x000facff, }; /** * \ingroup dot11s - * \brief See 7.3.2.84.2 in 802.11s draft 3.0 + * \brief See 7.3.2.86.2 in 802.11s draft 3.0 */ enum dot11sPathSelectionMetric { METRIC_AIRTIME = 0x000fac00, - METRIC_NULL = 0x000facff, }; /** * \ingroup dot11s - * \brief See 7.3.2.84.3 in 802.11s draft 3.0 + * \brief See 7.3.2.86.3 in 802.11s draft 3.0 */ enum dot11sCongestionControlMode { - CONGESTION_DEFAULT = 0x000fac00, - CONGESTION_NULL = 0x000facff, + CONGESTION_SIGNALING = 0x000fac00, + CONGESTION_NULL = 0x000facff, }; /** * \ingroup dot11s @@ -74,16 +72,7 @@ enum dot11sAuthenticationProtocol }; /** * \ingroup dot11s - * \brief See 7.3.2.84.4 in 802.11s draft 3.0 - */ -enum dot11sChannelPrecedence -{ - CHANNEL_PRECEDENCE_OFF = 0x000fac00, -}; - -/** - * \ingroup dot11s - * \brief See 7.3.2.84.5 in 802.11s draft 3.0 + * \brief See 7.3.2.86.7 in 802.11s draft 3.0 */ class dot11sMeshCapability { @@ -93,7 +82,8 @@ public: Buffer::Iterator Serialize (Buffer::Iterator i) const; Buffer::Iterator Deserialize (Buffer::Iterator i); bool acceptPeerLinks; - bool MDAEnabled; + bool MCCASupported; + bool MCCAEnabled; bool forwarding; bool beaconTimingReport; bool TBTTAdjustment; @@ -105,7 +95,7 @@ public: /** * \ingroup dot11s * \brief Describes Mesh Configuration Element - * see 7.3.2.84 of 802.11s draft 3.0 + * see 7.3.2.86 of 802.11s draft 3.0 */ class IeConfiguration : public WifiInformationElement {