From adad3f4b9ff10eb86bdc924f4257a8df91a43d0c Mon Sep 17 00:00:00 2001 From: Pavel Boyko Date: Mon, 14 Sep 2009 10:19:33 +0400 Subject: [PATCH] Cosmetics --- CHANGES.html | 25 +++++++++++++- RELEASE_NOTES | 11 +++--- examples/wscript | 2 +- src/devices/mesh/dot11s/hwmp-protocol.cc | 12 +++---- .../mesh/dot11s/ie-dot11s-beacon-timing.cc | 34 ++++++++++++------- .../mesh/dot11s/ie-dot11s-beacon-timing.h | 7 ++-- src/devices/mesh/dot11s/ie-dot11s-perr.cc | 4 +-- src/devices/mesh/dot11s/ie-dot11s-prep.cc | 16 ++++----- src/devices/mesh/dot11s/ie-dot11s-preq.cc | 5 --- .../mesh/wifi-information-element-vector.cc | 1 + .../mesh/wifi-information-element-vector.h | 2 ++ 11 files changed, 75 insertions(+), 44 deletions(-) diff --git a/CHANGES.html b/CHANGES.html index d2269f231..997b0e95f 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -67,6 +67,7 @@ allows a user to insert a route and have it redistributed like an OSPF external LSA to the rest of the topology.

+
  • Athstats

    New classes AthstatsWifiTraceSink and AthstatsHelper.

    @@ -75,6 +76,7 @@ external LSA to the rest of the topology.

    New trace sources exported by WifiRemoteStationManager: MacTxRtsFailed, MacTxDataFailed, MacTxFinalRtsFailed and MacTxFinalDataFailed.

  • +
  • IPv6 additions

    Add an IPv6 protocol and ICMPv6 capability.

    + +

    +
  • + +
  • Wireless Mesh Networking models + +

    +
  • + +
  • 802.11 enhancements +

    +

    +

    +
  • +

    Changes to existing API:

    diff --git a/RELEASE_NOTES b/RELEASE_NOTES index beaf6163c..102e2bdb2 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -50,10 +50,13 @@ New user-visible features periodic reports similar to the ones generated by madwifi's athstats tool (Nicola Baldo) - d) Mesh netorking model: - - General multi-interface mesh stack infractructure (devices/mesh module); - - IEEE 802.11s (Draft 3.0) model including Peering Management Protocol and HWMP; - - FLAME - Forwarding layer for meshing. + d) Wireless Mesh Networking models: + - General multi-interface mesh stack infrastructure (devices/mesh module). + - IEEE 802.11s (Draft 3.0) model including Peering Management Protocol and HWMP. + - Forwarding Layer for Meshing (FLAME) protocol. + + e) 802.11 enhancements: + - 10MHz and 5MHz channel width supported by 802.11a model (Ramon Bauza and Kirill Andreev) API changes from ns-3.5 ----------------------- diff --git a/examples/wscript b/examples/wscript index e3d7553aa..d88436b50 100644 --- a/examples/wscript +++ b/examples/wscript @@ -133,7 +133,7 @@ def build(bld): obj.source = 'wifi-ap.cc' obj = bld.create_ns3_program('mesh', - ['core', 'simulator', 'mobility', 'wifi']) + ['core', 'simulator', 'mobility', 'wifi', 'mesh']) obj.source = 'mesh.cc' bld.add_subdirs('stats') diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index 05d7bd018..2187a9cc0 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -257,15 +257,15 @@ HwmpProtocol::RequestRoute ( std::vector channels; for (HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++) { - bool should_send = true; + bool shouldSend = true; for (std::vector::const_iterator chan = channels.begin (); chan != channels.end (); chan ++) { if ((*chan) == plugin->second->GetChannelId ()) { - should_send = false; + shouldSend = false; } } - if (!should_send) + if (!shouldSend) { continue; } @@ -273,10 +273,10 @@ HwmpProtocol::RequestRoute ( std::vector receivers = GetBroadcastReceivers (plugin->first); for (std::vector::const_iterator i = receivers.begin (); i != receivers.end (); i ++) { - Ptr packet_copy = packet->Copy(); + Ptr packetCopy = packet->Copy(); tag.SetAddress (*i); - packet_copy->AddPacketTag (tag); - routeReply (true, packet_copy, source, destination, protocolType, plugin->first); + packetCopy->AddPacketTag (tag); + routeReply (true, packetCopy, source, destination, protocolType, plugin->first); } } } diff --git a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc index 0b24b3bcf..a02053ab7 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc @@ -199,20 +199,28 @@ operator== (const IeBeaconTimingUnit & a, const IeBeaconTimingUnit & b) && (a.GetBeaconInterval () == b.GetBeaconInterval ())); } bool -operator== (const IeBeaconTiming & a, const IeBeaconTiming& b) +IeBeaconTiming::operator== (WifiInformationElement const & a) { - if (a.m_numOfUnits != b.m_numOfUnits) - { - return false; - } - for (unsigned int i = 0; i < a.m_neighbours.size (); i++) - { - if (!(*PeekPointer (a.m_neighbours[i]) == *PeekPointer (b.m_neighbours[i]))) - { - return false; - } - } - return true; + try { + IeBeaconTiming const & aa = dynamic_cast(a); + + if (m_numOfUnits != aa.m_numOfUnits) + { + return false; + } + for (unsigned int i = 0; i < m_neighbours.size (); i++) + { + if (!(*PeekPointer (m_neighbours[i]) == *PeekPointer (aa.m_neighbours[i]))) + { + return false; + } + } + return true; + } + catch (std::bad_cast) + { + return false; + } } std::ostream & operator << (std::ostream &os, const IeBeaconTiming &a) diff --git a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h index c73e4859e..8d4c404e2 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h +++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h @@ -36,8 +36,8 @@ class IeBeaconTimingUnit : public RefCountBase public: IeBeaconTimingUnit (); void SetAid (uint8_t aid); - void SetLastBeacon (uint16_t last_beacon); - void SetBeaconInterval (uint16_t beacon_interval); + void SetLastBeacon (uint16_t lastBeacon); + void SetBeaconInterval (uint16_t beaconInterval); uint8_t GetAid () const; uint16_t GetLastBeacon () const; @@ -93,6 +93,7 @@ public: virtual uint8_t DeserializeInformation (Buffer::Iterator i, uint8_t length); virtual void Print (std::ostream& os) const; ///\} + bool operator== (WifiInformationElement const & a); private: /** * Converters: @@ -106,9 +107,7 @@ private: * Timing element parameters: */ uint16_t m_numOfUnits; - friend bool operator== (const IeBeaconTiming & a, const IeBeaconTiming & b); }; -bool operator== (const IeBeaconTiming & a, const IeBeaconTiming & b); bool operator== (const IeBeaconTimingUnit & a, const IeBeaconTimingUnit & b); std::ostream &operator << (std::ostream &os, const IeBeaconTiming &beaconTiming); } // namespace dot11s diff --git a/src/devices/mesh/dot11s/ie-dot11s-perr.cc b/src/devices/mesh/dot11s/ie-dot11s-perr.cc index 750068b46..b7aed0dd4 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-perr.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-perr.cc @@ -108,7 +108,7 @@ IePerr::AddAddressUnit (HwmpProtocol::FailedDestination unit) bool IePerr::IsFull () const { - return (GetInformationSize () + 2 /* ID + LENGTH*/+ 10 /* Sie of Mac48Address + uint32_t (one unit)*/> 255); + return (GetInformationSize () + 2 /* ID + LENGTH*/+ 10 /* Size of Mac48Address + uint32_t (one unit)*/> 255); } std::vector IePerr::GetAddressUnitVector () const @@ -154,7 +154,7 @@ operator== (const IePerr & a, const IePerr & b) return true; } std::ostream & -operator << (std::ostream &os, const IePerr &a) +operator << (std::ostream & os, const IePerr & a) { a.Print (os); return os; diff --git a/src/devices/mesh/dot11s/ie-dot11s-prep.cc b/src/devices/mesh/dot11s/ie-dot11s-prep.cc index 81ceb8851..dd58053cf 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-prep.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-prep.cc @@ -57,14 +57,14 @@ IePrep::SetTtl (uint8_t ttl) m_ttl = ttl; } void -IePrep::SetDestinationSeqNumber (uint32_t dest_seq_number) +IePrep::SetDestinationSeqNumber (uint32_t destSeqNumber) { - m_destSeqNumber = dest_seq_number; + m_destSeqNumber = destSeqNumber; } void -IePrep::SetDestinationAddress (Mac48Address dest_address) +IePrep::SetDestinationAddress (Mac48Address destAddress) { - m_destinationAddress = dest_address; + m_destinationAddress = destAddress; } void IePrep::SetMetric (uint32_t metric) @@ -72,14 +72,14 @@ IePrep::SetMetric (uint32_t metric) m_metric = metric; } void -IePrep::SetOriginatorAddress (Mac48Address originator_address) +IePrep::SetOriginatorAddress (Mac48Address originatorAddress) { - m_originatorAddress = originator_address; + m_originatorAddress = originatorAddress; } void -IePrep::SetOriginatorSeqNumber (uint32_t originator_seq_number) +IePrep::SetOriginatorSeqNumber (uint32_t originatorSeqNumber) { - m_originatorSeqNumber = originator_seq_number; + m_originatorSeqNumber = originatorSeqNumber; } void IePrep::SetLifetime (uint32_t lifetime) diff --git a/src/devices/mesh/dot11s/ie-dot11s-preq.cc b/src/devices/mesh/dot11s/ie-dot11s-preq.cc index b24376c4b..c5d2c1ff9 100644 --- a/src/devices/mesh/dot11s/ie-dot11s-preq.cc +++ b/src/devices/mesh/dot11s/ie-dot11s-preq.cc @@ -108,11 +108,6 @@ IePreq::SetNeedNotPrep () { m_flags |= 1 << 2; } -//void -//IePreq::SetFlags (uint8_t flags) -//{ -// m_flags = flags; -//} void IePreq::SetHopcount (uint8_t hopcount) { diff --git a/src/devices/mesh/wifi-information-element-vector.cc b/src/devices/mesh/wifi-information-element-vector.cc index a70bf450c..99d967315 100644 --- a/src/devices/mesh/wifi-information-element-vector.cc +++ b/src/devices/mesh/wifi-information-element-vector.cc @@ -204,6 +204,7 @@ WifiInformationElementVector::GetSize () const } return size; } + bool operator== (const WifiInformationElementVector & a, const WifiInformationElementVector & b) { diff --git a/src/devices/mesh/wifi-information-element-vector.h b/src/devices/mesh/wifi-information-element-vector.h index cf9687d67..e6506c58c 100644 --- a/src/devices/mesh/wifi-information-element-vector.h +++ b/src/devices/mesh/wifi-information-element-vector.h @@ -97,6 +97,8 @@ public: /// Compare information elements using Element ID friend bool operator< (WifiInformationElement const & a, WifiInformationElement const & b); + /// + virtual bool operator== (WifiInformationElement const & a) { return false; } }; /// Compare information elements using Element ID