From 628ac9bca7b1e8517128f41d91af76aab2b28944 Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Thu, 18 Jun 2009 18:07:22 +0400 Subject: [PATCH] Fixed names: now protocols are called *-protocol.[h,cc], plugin is called *-protocol-mac.[cc,h] --- examples/mesh.cc | 4 +- ...wmp-mac-plugin.cc => hwmp-protocol-mac.cc} | 48 +++++++++---------- ...{hwmp-mac-plugin.h => hwmp-protocol-mac.h} | 6 +-- src/devices/mesh/dot11s/hwmp-protocol.cc | 4 +- src/devices/mesh/dot11s/hwmp-protocol.h | 6 +-- src/devices/mesh/dot11s/peer-link.cc | 2 +- src/devices/mesh/dot11s/peer-link.h | 6 +-- ...gin.cc => peer-management-protocol-mac.cc} | 32 ++++++------- ...lugin.h => peer-management-protocol-mac.h} | 6 +-- .../mesh/dot11s/peer-management-protocol.cc | 4 +- .../mesh/dot11s/peer-management-protocol.h | 4 +- src/devices/mesh/dot11s/wscript | 4 +- src/devices/mesh/flame/flame-protocol-mac.cc | 20 ++++---- src/devices/mesh/flame/flame-protocol-mac.h | 6 +-- src/devices/mesh/flame/flame-protocol.cc | 2 +- src/devices/mesh/flame/flame-protocol.h | 2 +- .../{dot11s-helper.cc => mesh-helper.cc} | 18 +++---- src/helper/{dot11s-helper.h => mesh-helper.h} | 4 +- src/helper/wscript | 4 +- 19 files changed, 90 insertions(+), 92 deletions(-) rename src/devices/mesh/dot11s/{hwmp-mac-plugin.cc => hwmp-protocol-mac.cc} (87%) rename src/devices/mesh/dot11s/{hwmp-mac-plugin.h => hwmp-protocol-mac.h} (96%) rename src/devices/mesh/dot11s/{peer-management-plugin.cc => peer-management-protocol-mac.cc} (89%) rename src/devices/mesh/dot11s/{peer-management-plugin.h => peer-management-protocol-mac.h} (95%) rename src/helper/{dot11s-helper.cc => mesh-helper.cc} (81%) rename src/helper/{dot11s-helper.h => mesh-helper.h} (98%) diff --git a/examples/mesh.cc b/examples/mesh.cc index 91347e844..a20529e86 100644 --- a/examples/mesh.cc +++ b/examples/mesh.cc @@ -65,8 +65,8 @@ class MeshTest NetDeviceContainer meshDevices; //Addresses of interfaces: Ipv4InterfaceContainer interfaces; - // MeshWifiHelper. Report is not static methods - MeshWifiHelper mesh; + // MeshHelper. Report is not static methods + MeshHelper mesh; private: /// Create nodes and setup their mobility void CreateNodes (); diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc b/src/devices/mesh/dot11s/hwmp-protocol-mac.cc similarity index 87% rename from src/devices/mesh/dot11s/hwmp-mac-plugin.cc rename to src/devices/mesh/dot11s/hwmp-protocol-mac.cc index 65d4170c5..e74a0e83c 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol-mac.cc @@ -23,9 +23,9 @@ #include "ns3/simulator.h" #include "ns3/nstime.h" #include "ns3/log.h" -#include "hwmp-mac-plugin.h" #include "dot11s-mac-header.h" #include "hwmp-protocol.h" +#include "hwmp-protocol-mac.h" #include "hwmp-tag.h" #include "ie-dot11s-preq.h" #include "ie-dot11s-prep.h" @@ -33,23 +33,23 @@ namespace ns3 { namespace dot11s { -NS_LOG_COMPONENT_DEFINE ("HwmpMacPlugin"); -HwmpMacPlugin::HwmpMacPlugin (uint32_t ifIndex, Ptr protocol): +NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac"); +HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr protocol): m_ifIndex (ifIndex), m_protocol (protocol) { } -HwmpMacPlugin::~HwmpMacPlugin () +HwmpProtocolMac::~HwmpProtocolMac () { } void -HwmpMacPlugin::SetParent (Ptr parent) +HwmpProtocolMac::SetParent (Ptr parent) { m_parent = parent; } bool -HwmpMacPlugin::ReceiveData (Ptr packet, const WifiMacHeader & header) +HwmpProtocolMac::ReceiveData (Ptr packet, const WifiMacHeader & header) { NS_ASSERT (header.IsData()); @@ -88,7 +88,7 @@ HwmpMacPlugin::ReceiveData (Ptr packet, const WifiMacHeader & header) } bool -HwmpMacPlugin::ReceiveAction (Ptr packet, const WifiMacHeader & header) +HwmpProtocolMac::ReceiveAction (Ptr packet, const WifiMacHeader & header) { m_stats.rxMgt ++; m_stats.rxMgtBytes += packet->GetSize (); @@ -138,7 +138,7 @@ HwmpMacPlugin::ReceiveAction (Ptr packet, const WifiMacHeader & header) } bool -HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) +HwmpProtocolMac::Receive (Ptr packet, const WifiMacHeader & header) { if (header.IsData ()) return ReceiveData (packet, header); @@ -148,7 +148,7 @@ HwmpMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) return true; // don't care } bool -HwmpMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) +HwmpProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) { if(!header.IsData ()) return true; @@ -168,13 +168,13 @@ HwmpMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, return true; } void -HwmpMacPlugin::SendPreq(IePreq preq) +HwmpProtocolMac::SendPreq(IePreq preq) { m_preqQueue.push_back (preq); SendOnePreq (); } void -HwmpMacPlugin::RequestDestination (Mac48Address dst, uint32_t originator_seqno, uint32_t dst_seqno) +HwmpProtocolMac::RequestDestination (Mac48Address dst, uint32_t originator_seqno, uint32_t dst_seqno) { for(std::vector::iterator i = m_preqQueue.begin (); i != m_preqQueue.end (); i ++) if(i->MayAddAddress(m_protocol->GetAddress ())) @@ -196,7 +196,7 @@ HwmpMacPlugin::RequestDestination (Mac48Address dst, uint32_t originator_seqno, SendOnePreq (); } void -HwmpMacPlugin::SendOnePreq () +HwmpProtocolMac::SendOnePreq () { if(m_preqTimer.IsRunning ()) return; @@ -204,7 +204,7 @@ HwmpMacPlugin::SendOnePreq () return; //reschedule sending PREQ NS_ASSERT (!m_preqTimer.IsRunning()); - m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpMacPlugin::SendOnePreq, this); + m_preqTimer = Simulator::Schedule (m_protocol->GetPreqMinInterval (), &HwmpProtocolMac::SendOnePreq, this); Ptr packet = Create (); packet->AddHeader(m_preqQueue[0]); //Action header: @@ -234,7 +234,7 @@ HwmpMacPlugin::SendOnePreq () m_preqQueue.erase (m_preqQueue.begin()); } void -HwmpMacPlugin::SendOnePerr() +HwmpProtocolMac::SendOnePerr() { if(m_perrTimer.IsRunning ()) return; @@ -243,7 +243,7 @@ HwmpMacPlugin::SendOnePerr() m_myPerr.receivers.clear (); m_myPerr.receivers.push_back (Mac48Address::GetBroadcast ()); } - m_perrTimer = Simulator::Schedule (m_protocol->GetPerrMinInterval (), &HwmpMacPlugin::SendOnePerr, this); + m_perrTimer = Simulator::Schedule (m_protocol->GetPerrMinInterval (), &HwmpProtocolMac::SendOnePerr, this); //Create packet Ptr packet = Create (); packet->AddHeader(m_myPerr.perr); @@ -273,7 +273,7 @@ HwmpMacPlugin::SendOnePerr() m_myPerr.receivers.clear (); } void -HwmpMacPlugin::SendPrep (IePrep prep, Mac48Address receiver) +HwmpProtocolMac::SendPrep (IePrep prep, Mac48Address receiver) { //Create packet Ptr packet = Create (); @@ -299,7 +299,7 @@ HwmpMacPlugin::SendPrep (IePrep prep, Mac48Address receiver) m_parent->SendManagementFrame(packet, hdr); } void -HwmpMacPlugin::SendPerr(IePerr perr, std::vector receivers) +HwmpProtocolMac::SendPerr(IePerr perr, std::vector receivers) { m_myPerr.perr.Merge(perr); for(unsigned int i = 0; i < receivers.size (); i ++) @@ -314,17 +314,17 @@ HwmpMacPlugin::SendPerr(IePerr perr, std::vector receivers) SendOnePerr (); } uint32_t -HwmpMacPlugin::GetLinkMetric(Mac48Address peerAddress) const +HwmpProtocolMac::GetLinkMetric(Mac48Address peerAddress) const { return m_parent->GetLinkMetric(peerAddress); } uint16_t -HwmpMacPlugin::GetChannelId () const +HwmpProtocolMac::GetChannelId () const { return m_parent->GetFrequencyChannel (); } void -HwmpMacPlugin::Statistics::Print (std::ostream & os) const +HwmpProtocolMac::Statistics::Print (std::ostream & os) const { os << "\n"; } void -HwmpMacPlugin::Report (std::ostream & os) const +HwmpProtocolMac::Report (std::ostream & os) const { - os << "GetAddress () <<"\">\n"; m_stats.Print(os); - os << "\n"; + os << "\n"; } void -HwmpMacPlugin::ResetStats () +HwmpProtocolMac::ResetStats () { m_stats = Statistics::Statistics (); } diff --git a/src/devices/mesh/dot11s/hwmp-mac-plugin.h b/src/devices/mesh/dot11s/hwmp-protocol-mac.h similarity index 96% rename from src/devices/mesh/dot11s/hwmp-mac-plugin.h rename to src/devices/mesh/dot11s/hwmp-protocol-mac.h index 45d0742d8..97c37a757 100644 --- a/src/devices/mesh/dot11s/hwmp-mac-plugin.h +++ b/src/devices/mesh/dot11s/hwmp-protocol-mac.h @@ -41,11 +41,11 @@ class IePerr; * * \brief Interface MAC plugin for HWMP -- 802.11s routing protocol */ -class HwmpMacPlugin : public MeshWifiInterfaceMacPlugin +class HwmpProtocolMac : public MeshWifiInterfaceMacPlugin { public: - HwmpMacPlugin (uint32_t, Ptr); - ~HwmpMacPlugin (); + HwmpProtocolMac (uint32_t, Ptr); + ~HwmpProtocolMac (); ///\name Inherited from MAC plugin //\{ void SetParent (Ptr parent); diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index fee43cc62..e713bd3ef 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -20,7 +20,7 @@ #include "hwmp-protocol.h" -#include "hwmp-mac-plugin.h" +#include "hwmp-protocol-mac.h" #include "hwmp-tag.h" #include "hwmp-rtable.h" #include "ns3/log.h" @@ -622,7 +622,7 @@ HwmpProtocol::Install (Ptr mp) if (mac == 0) return false; // Installing plugins: - Ptr hwmpMac = Create (wifiNetDev->GetIfIndex (), this); + Ptr hwmpMac = Create (wifiNetDev->GetIfIndex (), this); m_interfaces[wifiNetDev->GetIfIndex ()] = hwmpMac; mac->InstallPlugin (hwmpMac); //Installing airtime link metric: diff --git a/src/devices/mesh/dot11s/hwmp-protocol.h b/src/devices/mesh/dot11s/hwmp-protocol.h index 4a7533e35..747500d51 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.h +++ b/src/devices/mesh/dot11s/hwmp-protocol.h @@ -34,7 +34,7 @@ class MeshPointDevice; class Packet; class Mac48Address; namespace dot11s { -class HwmpMacPlugin; +class HwmpProtocolMac; class HwmpRtable; class IePreq; class IePrep; @@ -80,7 +80,7 @@ public: void Report (std::ostream &) const; void ResetStats (); private: - friend class HwmpMacPlugin; + friend class HwmpProtocolMac; /// Like RequestRoute, but for unicast packets bool ForwardUnicast (uint32_t sourceIface, const Mac48Address source, const Mac48Address destination, @@ -181,7 +181,7 @@ private: ///\return address of MeshPointDevice Mac48Address GetAddress (); private: - typedef std::map > HwmpPluginMap; + typedef std::map > HwmpPluginMap; HwmpPluginMap m_interfaces; Mac48Address m_address; uint32_t m_dataSeqno; diff --git a/src/devices/mesh/dot11s/peer-link.cc b/src/devices/mesh/dot11s/peer-link.cc index 94417d84c..293195587 100644 --- a/src/devices/mesh/dot11s/peer-link.cc +++ b/src/devices/mesh/dot11s/peer-link.cc @@ -267,7 +267,7 @@ PeerLink::LinkIsIdle () const return (m_state == IDLE); } void -PeerLink::SetMacPlugin(Ptr plugin) +PeerLink::SetMacPlugin(Ptr plugin) { m_macPlugin = plugin; } diff --git a/src/devices/mesh/dot11s/peer-link.h b/src/devices/mesh/dot11s/peer-link.h index c0c61649d..1d1f142bb 100644 --- a/src/devices/mesh/dot11s/peer-link.h +++ b/src/devices/mesh/dot11s/peer-link.h @@ -29,7 +29,7 @@ #include "ie-dot11s-beacon-timing.h" #include "ie-dot11s-peer-management.h" #include "ie-dot11s-configuration.h" -#include "peer-management-plugin.h" +#include "peer-management-protocol-mac.h" namespace ns3 { namespace dot11s { /** @@ -143,7 +143,7 @@ private: * Set pointer to MAC-plugin, which is responsible for sending peer * link management frames */ - void SetMacPlugin(Ptr plugin); + void SetMacPlugin(Ptr plugin); /// Peer link states, see 802.11s draft 11B.3.3.1 private: /// Peer link events, see 802.11s draft 11B.3.3.2 @@ -201,7 +201,7 @@ private: ///The number of interface I am associated with uint32_t m_interface; /// pointer to mac plugin, which is responsible for peer management - Ptr m_macPlugin; + Ptr m_macPlugin; /// Peer address Mac48Address m_peerAddress; /// Mesh point address, equal to peer address in case of single diff --git a/src/devices/mesh/dot11s/peer-management-plugin.cc b/src/devices/mesh/dot11s/peer-management-protocol-mac.cc similarity index 89% rename from src/devices/mesh/dot11s/peer-management-plugin.cc rename to src/devices/mesh/dot11s/peer-management-protocol-mac.cc index df8a38edc..8aebec91a 100644 --- a/src/devices/mesh/dot11s/peer-management-plugin.cc +++ b/src/devices/mesh/dot11s/peer-management-protocol-mac.cc @@ -21,7 +21,7 @@ #include "ie-dot11s-configuration.h" #include "ie-dot11s-peer-management.h" #include "dot11s-mac-header.h" -#include "peer-management-plugin.h" +#include "peer-management-protocol-mac.h" #include "peer-management-protocol.h" #include "peer-link-frame.h" #include "ns3/mesh-wifi-interface-mac.h" @@ -29,24 +29,24 @@ #include "ns3/wifi-mac-header.h" namespace ns3 { namespace dot11s { -PeerManagerMacPlugin::PeerManagerMacPlugin (uint32_t interface, Ptr protocol) +PeerManagementProtocolMac::PeerManagementProtocolMac (uint32_t interface, Ptr protocol) { m_ifIndex = interface; m_protocol = protocol; } -PeerManagerMacPlugin::~PeerManagerMacPlugin () +PeerManagementProtocolMac::~PeerManagementProtocolMac () { } void -PeerManagerMacPlugin::SetParent (Ptr parent) +PeerManagementProtocolMac::SetParent (Ptr parent) { m_parent = parent; } bool -PeerManagerMacPlugin::Receive (Ptr const_packet, const WifiMacHeader & header) +PeerManagementProtocolMac::Receive (Ptr const_packet, const WifiMacHeader & header) { // First of all we copy a packet, because we need to remove some //headers @@ -142,7 +142,7 @@ PeerManagerMacPlugin::Receive (Ptr const_packet, const WifiMacHeader & h return m_protocol->IsActiveLink(m_ifIndex,header.GetAddr2()); } bool -PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) +PeerManagementProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) { if(header.IsAction ()) { @@ -166,7 +166,7 @@ PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & } } void -PeerManagerMacPlugin::UpdateBeacon (MeshWifiBeacon & beacon) const +PeerManagementProtocolMac::UpdateBeacon (MeshWifiBeacon & beacon) const { Ptr beaconTiming = m_protocol->GetBeaconTimingElement(m_ifIndex); beacon.AddInformationElement(beaconTiming); @@ -174,7 +174,7 @@ PeerManagerMacPlugin::UpdateBeacon (MeshWifiBeacon & beacon) const } void -PeerManagerMacPlugin::SendPeerLinkManagementFrame( +PeerManagementProtocolMac::SendPeerLinkManagementFrame( Mac48Address peerAddress, Mac48Address peerMpAddress, uint16_t aid, @@ -239,14 +239,14 @@ PeerManagerMacPlugin::SendPeerLinkManagementFrame( } Mac48Address -PeerManagerMacPlugin::GetAddress () const +PeerManagementProtocolMac::GetAddress () const { if(m_parent != 0) return m_parent->GetAddress (); else return Mac48Address::Mac48Address(); } std::pair -PeerManagerMacPlugin::GetBeaconInfo() const +PeerManagementProtocolMac::GetBeaconInfo() const { std::pair retval; retval.first = m_parent->GetTbtt (); @@ -254,13 +254,13 @@ PeerManagerMacPlugin::GetBeaconInfo() const return retval; } void -PeerManagerMacPlugin::SetBeaconShift(Time shift) +PeerManagementProtocolMac::SetBeaconShift(Time shift) { if(shift != Seconds (0)) m_stats.beaconShift ++; m_parent->ShiftTbtt (shift); } -PeerManagerMacPlugin::Statistics::Statistics () : +PeerManagementProtocolMac::Statistics::Statistics () : txOpen (0), txConfirm (0), txClose (0), @@ -277,7 +277,7 @@ PeerManagerMacPlugin::Statistics::Statistics () : { } void -PeerManagerMacPlugin::Statistics::Print (std::ostream & os) const +PeerManagementProtocolMac::Statistics::Print (std::ostream & os) const { os << "\n"; } void -PeerManagerMacPlugin::Report (std::ostream & os) const +PeerManagementProtocolMac::Report (std::ostream & os) const { os << "GetAddress () << "\">\n"; @@ -303,12 +303,12 @@ PeerManagerMacPlugin::Report (std::ostream & os) const os << "\n"; } void -PeerManagerMacPlugin::ResetStats () +PeerManagementProtocolMac::ResetStats () { m_stats = Statistics::Statistics (); } uint32_t -PeerManagerMacPlugin::GetLinkMetric (Mac48Address peerAddress) +PeerManagementProtocolMac::GetLinkMetric (Mac48Address peerAddress) { return m_parent->GetLinkMetric (peerAddress); } diff --git a/src/devices/mesh/dot11s/peer-management-plugin.h b/src/devices/mesh/dot11s/peer-management-protocol-mac.h similarity index 95% rename from src/devices/mesh/dot11s/peer-management-plugin.h rename to src/devices/mesh/dot11s/peer-management-protocol-mac.h index d19d84583..c7ad4cd11 100644 --- a/src/devices/mesh/dot11s/peer-management-plugin.h +++ b/src/devices/mesh/dot11s/peer-management-protocol-mac.h @@ -39,11 +39,11 @@ class PeerManagementProtocol; * element and mesh configuration element and passes it to main part * of protocol */ -class PeerManagerMacPlugin : public MeshWifiInterfaceMacPlugin +class PeerManagementProtocolMac : public MeshWifiInterfaceMacPlugin { public: - PeerManagerMacPlugin (uint32_t interface, Ptr protocol); - ~PeerManagerMacPlugin (); + PeerManagementProtocolMac (uint32_t interface, Ptr protocol); + ~PeerManagementProtocolMac (); ///\name Inherited from plugin abstract class ///\{ void SetParent (Ptr parent); diff --git a/src/devices/mesh/dot11s/peer-management-protocol.cc b/src/devices/mesh/dot11s/peer-management-protocol.cc index f247adc16..983394821 100644 --- a/src/devices/mesh/dot11s/peer-management-protocol.cc +++ b/src/devices/mesh/dot11s/peer-management-protocol.cc @@ -34,8 +34,6 @@ #include "ns3/mesh-wifi-interface-mac-plugin.h" #include "ns3/wifi-net-device.h" #include "peer-link.h" -#include "peer-management-plugin.h" - NS_LOG_COMPONENT_DEFINE ("PeerManagementProtocol"); namespace ns3 { @@ -102,7 +100,7 @@ PeerManagementProtocol::Install(Ptr mp) Ptr mac = wifiNetDev->GetMac ()->GetObject (); if (mac == 0) return false; - Ptr peerPlugin = Create ((*i)->GetIfIndex(), this); + Ptr peerPlugin = Create ((*i)->GetIfIndex(), this); mac->InstallPlugin(peerPlugin); m_plugins[(*i)->GetIfIndex()] = peerPlugin; PeerLinksOnInterface newmap; diff --git a/src/devices/mesh/dot11s/peer-management-protocol.h b/src/devices/mesh/dot11s/peer-management-protocol.h index e4dbdf139..f5f132500 100644 --- a/src/devices/mesh/dot11s/peer-management-protocol.h +++ b/src/devices/mesh/dot11s/peer-management-protocol.h @@ -36,7 +36,7 @@ namespace ns3 { class MeshPointDevice; namespace dot11s { -class PeerManagerMacPlugin; +class PeerManagementProtocolMac; class PeerLink; class IePeerManagement; class IeConfiguration; @@ -166,7 +166,7 @@ private: ///\brief This map keeps beacon information on all intefaces typedef std::map BeaconInfoMap; ///\brief this vector keeps pointers to MAC-plugins - typedef std::map > PeerManagerPluginMap; + typedef std::map > PeerManagerPluginMap; ///\} private: /** diff --git a/src/devices/mesh/dot11s/wscript b/src/devices/mesh/dot11s/wscript index a66de5f4e..bb2906025 100644 --- a/src/devices/mesh/dot11s/wscript +++ b/src/devices/mesh/dot11s/wscript @@ -16,11 +16,11 @@ def build(bld): 'dot11s-mac-header.cc', 'peer-link-frame.cc', 'peer-link.cc', - 'peer-management-plugin.cc', + 'peer-management-protocol-mac.cc', 'peer-management-protocol.cc', 'hwmp-tag.cc', 'hwmp-rtable.cc', - 'hwmp-mac-plugin.cc', + 'hwmp-protocol-mac.cc', 'hwmp-protocol.cc', 'airtime-metric.cc', 'dot11s-installer.cc', diff --git a/src/devices/mesh/flame/flame-protocol-mac.cc b/src/devices/mesh/flame/flame-protocol-mac.cc index 8fe0d9cfb..285fb0a05 100644 --- a/src/devices/mesh/flame/flame-protocol-mac.cc +++ b/src/devices/mesh/flame/flame-protocol-mac.cc @@ -24,23 +24,23 @@ #include "ns3/log.h" namespace ns3 { namespace flame { -NS_LOG_COMPONENT_DEFINE ("FlameMacPlugin"); -FlameMacPlugin::FlameMacPlugin (uint32_t ifIndex, Ptr protocol): +NS_LOG_COMPONENT_DEFINE ("FlameProtocolMac"); +FlameProtocolMac::FlameProtocolMac (uint32_t ifIndex, Ptr protocol): m_protocol (protocol), m_ifIndex (ifIndex) { } -FlameMacPlugin::~FlameMacPlugin () +FlameProtocolMac::~FlameProtocolMac () { } void -FlameMacPlugin::SetParent (Ptr parent) +FlameProtocolMac::SetParent (Ptr parent) { m_parent = parent; } bool -FlameMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) +FlameProtocolMac::Receive (Ptr packet, const WifiMacHeader & header) { if (!header.IsData ()) return true; @@ -54,7 +54,7 @@ FlameMacPlugin::Receive (Ptr packet, const WifiMacHeader & header) return true; } bool -FlameMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) +FlameProtocolMac::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) { if(!header.IsData ()) return true; @@ -67,22 +67,22 @@ FlameMacPlugin::UpdateOutcomingFrame (Ptr packet, WifiMacHeader & header return true; } uint8_t -FlameMacPlugin::GetCost(Mac48Address peerAddress) const +FlameProtocolMac::GetCost(Mac48Address peerAddress) const { uint32_t metric = m_parent->GetLinkMetric(peerAddress); return (metric > 255 ? 255 : (uint8_t)(metric & 0xff)); } uint16_t -FlameMacPlugin::GetChannelId () const +FlameProtocolMac::GetChannelId () const { return m_parent->GetFrequencyChannel (); } void -FlameMacPlugin::Report (std::ostream & os) const +FlameProtocolMac::Report (std::ostream & os) const { } void -FlameMacPlugin::ResetStats () +FlameProtocolMac::ResetStats () { } diff --git a/src/devices/mesh/flame/flame-protocol-mac.h b/src/devices/mesh/flame/flame-protocol-mac.h index 6882dc562..cedf950d9 100644 --- a/src/devices/mesh/flame/flame-protocol-mac.h +++ b/src/devices/mesh/flame/flame-protocol-mac.h @@ -31,11 +31,11 @@ class FlameProtocol; * * \brief Interface MAC plugin FLAME routing protocol */ -class FlameMacPlugin : public MeshWifiInterfaceMacPlugin +class FlameProtocolMac : public MeshWifiInterfaceMacPlugin { public: - FlameMacPlugin (uint32_t, Ptr); - ~FlameMacPlugin (); + FlameProtocolMac (uint32_t, Ptr); + ~FlameProtocolMac (); ///\name Inherited from MAC plugin //\{ void SetParent (Ptr parent); diff --git a/src/devices/mesh/flame/flame-protocol.cc b/src/devices/mesh/flame/flame-protocol.cc index 65b87e3c2..620f7ffdc 100644 --- a/src/devices/mesh/flame/flame-protocol.cc +++ b/src/devices/mesh/flame/flame-protocol.cc @@ -219,7 +219,7 @@ FlameProtocol::Install (Ptr mp) if (mac == 0) return false; // Installing plugins: - Ptr flameMac = Create (wifiNetDev->GetIfIndex (), this); + Ptr flameMac = Create (wifiNetDev->GetIfIndex (), this); m_interfaces[wifiNetDev->GetIfIndex ()] = flameMac; mac->InstallPlugin (flameMac); } diff --git a/src/devices/mesh/flame/flame-protocol.h b/src/devices/mesh/flame/flame-protocol.h index 585c39fbf..e06543eec 100644 --- a/src/devices/mesh/flame/flame-protocol.h +++ b/src/devices/mesh/flame/flame-protocol.h @@ -99,7 +99,7 @@ private: * \name Information about MeshPointDeviceaddress , plugins * \{ */ - typedef std::map > FlamePluginMap; + typedef std::map > FlamePluginMap; FlamePluginMap m_interfaces; Mac48Address m_address; ///\} diff --git a/src/helper/dot11s-helper.cc b/src/helper/mesh-helper.cc similarity index 81% rename from src/helper/dot11s-helper.cc rename to src/helper/mesh-helper.cc index 5afe30f03..181d26922 100644 --- a/src/helper/dot11s-helper.cc +++ b/src/helper/mesh-helper.cc @@ -18,25 +18,25 @@ * Author: Kirill Andreev * Pavel Boyko */ -#include "dot11s-helper.h" +#include "mesh-helper.h" #include "ns3/simulator.h" #include "ns3/mesh-point-device.h" #include "ns3/wifi-net-device.h" #include "ns3/log.h" -NS_LOG_COMPONENT_DEFINE ("MeshWifiHelper"); +NS_LOG_COMPONENT_DEFINE ("MeshHelper"); namespace ns3 { -MeshWifiHelper::MeshWifiHelper () : +MeshHelper::MeshHelper () : m_spreadInterfaceChannels (false), m_stack (0) { } void -MeshWifiHelper::SetSpreadInterfaceChannels (bool s) +MeshHelper::SetSpreadInterfaceChannels (bool s) { m_spreadInterfaceChannels = s; } void -MeshWifiHelper::SetStackInstaller (std::string type) +MeshHelper::SetStackInstaller (std::string type) { NS_LOG_FUNCTION (this << type); m_stackFactory = ObjectFactory (); @@ -47,7 +47,7 @@ MeshWifiHelper::SetStackInstaller (std::string type) } NetDeviceContainer -MeshWifiHelper::Install (const WifiPhyHelper &phyHelper, const MeshInterfaceHelper &interfaceHelper, NodeContainer c, uint32_t nInterfaces) const +MeshHelper::Install (const WifiPhyHelper &phyHelper, const MeshInterfaceHelper &interfaceHelper, NodeContainer c, uint32_t nInterfaces) const { NetDeviceContainer devices; NS_ASSERT (m_stack != 0); @@ -78,12 +78,12 @@ MeshWifiHelper::Install (const WifiPhyHelper &phyHelper, const MeshInterfaceHelp } NetDeviceContainer -MeshWifiHelper::Install (const WifiPhyHelper &phy, const MeshInterfaceHelper &interfaceHelper, Ptr node, uint32_t nInterfaces) const +MeshHelper::Install (const WifiPhyHelper &phy, const MeshInterfaceHelper &interfaceHelper, Ptr node, uint32_t nInterfaces) const { return Install (phy, interfaceHelper, NodeContainer (node), nInterfaces); } void -MeshWifiHelper::Report (const ns3::Ptr& device, std::ostream& os) +MeshHelper::Report (const ns3::Ptr& device, std::ostream& os) { NS_ASSERT (m_stack != 0); Ptr mp = device->GetObject (); @@ -94,7 +94,7 @@ MeshWifiHelper::Report (const ns3::Ptr& device, std::ostream& os os << "\n"; } void -MeshWifiHelper::ResetStats (const ns3::Ptr& device) +MeshHelper::ResetStats (const ns3::Ptr& device) { NS_ASSERT (m_stack != 0); Ptr mp = device->GetObject (); diff --git a/src/helper/dot11s-helper.h b/src/helper/mesh-helper.h similarity index 98% rename from src/helper/dot11s-helper.h rename to src/helper/mesh-helper.h index 3fafc3bcc..f77c73d56 100644 --- a/src/helper/dot11s-helper.h +++ b/src/helper/mesh-helper.h @@ -37,10 +37,10 @@ class WifiChannel; * * \brief Helper to create IEEE 802.11s mesh networks */ -class MeshWifiHelper +class MeshHelper { public: - MeshWifiHelper (); + MeshHelper (); /** * \brief Spread/not spread frequency channels of MP interfaces. * diff --git a/src/helper/wscript b/src/helper/wscript index 3fc225ef6..ef436cfac 100644 --- a/src/helper/wscript +++ b/src/helper/wscript @@ -26,7 +26,7 @@ def build(bld): 'nqos-wifi-mac-helper.cc', 'qos-wifi-mac-helper.cc', 'mesh-interface-helper.cc', - 'dot11s-helper.cc', + 'mesh-helper.cc', ] headers = bld.new_task_gen('ns3header') @@ -55,7 +55,7 @@ def build(bld): 'nqos-wifi-mac-helper.h', 'qos-wifi-mac-helper.h', 'mesh-interface-helper.h', - 'dot11s-helper.h', + 'mesh-helper.h', ] env = bld.env_of_name('default')