Fixed names: now protocols are called *-protocol.[h,cc], plugin is called

*-protocol-mac.[cc,h]
This commit is contained in:
Kirill Andreev
2009-06-18 18:07:22 +04:00
parent c468013d95
commit 628ac9bca7
19 changed files with 90 additions and 92 deletions

View File

@@ -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 ();

View File

@@ -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<HwmpProtocol> protocol):
NS_LOG_COMPONENT_DEFINE ("HwmpProtocolMac");
HwmpProtocolMac::HwmpProtocolMac (uint32_t ifIndex, Ptr<HwmpProtocol> protocol):
m_ifIndex (ifIndex),
m_protocol (protocol)
{
}
HwmpMacPlugin::~HwmpMacPlugin ()
HwmpProtocolMac::~HwmpProtocolMac ()
{
}
void
HwmpMacPlugin::SetParent (Ptr<MeshWifiInterfaceMac> parent)
HwmpProtocolMac::SetParent (Ptr<MeshWifiInterfaceMac> parent)
{
m_parent = parent;
}
bool
HwmpMacPlugin::ReceiveData (Ptr<Packet> packet, const WifiMacHeader & header)
HwmpProtocolMac::ReceiveData (Ptr<Packet> packet, const WifiMacHeader & header)
{
NS_ASSERT (header.IsData());
@@ -88,7 +88,7 @@ HwmpMacPlugin::ReceiveData (Ptr<Packet> packet, const WifiMacHeader & header)
}
bool
HwmpMacPlugin::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header)
HwmpProtocolMac::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header)
{
m_stats.rxMgt ++;
m_stats.rxMgtBytes += packet->GetSize ();
@@ -138,7 +138,7 @@ HwmpMacPlugin::ReceiveAction (Ptr<Packet> packet, const WifiMacHeader & header)
}
bool
HwmpMacPlugin::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
HwmpProtocolMac::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
{
if (header.IsData ())
return ReceiveData (packet, header);
@@ -148,7 +148,7 @@ HwmpMacPlugin::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
return true; // don't care
}
bool
HwmpMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
HwmpProtocolMac::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
{
if(!header.IsData ())
return true;
@@ -168,13 +168,13 @@ HwmpMacPlugin::UpdateOutcomingFrame (Ptr<Packet> 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<IePreq>::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> packet = Create<Packet> ();
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> packet = Create<Packet> ();
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> packet = Create<Packet> ();
@@ -299,7 +299,7 @@ HwmpMacPlugin::SendPrep (IePrep prep, Mac48Address receiver)
m_parent->SendManagementFrame(packet, hdr);
}
void
HwmpMacPlugin::SendPerr(IePerr perr, std::vector<Mac48Address> receivers)
HwmpProtocolMac::SendPerr(IePerr perr, std::vector<Mac48Address> 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<Mac48Address> 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 << "<Statistics "
"txPreq= \"" << txPreq << "\"\n"
@@ -343,15 +343,15 @@ HwmpMacPlugin::Statistics::Print (std::ostream & os) const
"rxDataBytes=\"" << (double)rxDataBytes / 1024.0 << "K\"/>\n";
}
void
HwmpMacPlugin::Report (std::ostream & os) const
HwmpProtocolMac::Report (std::ostream & os) const
{
os << "<HwmpMacPlugin\n"
os << "<HwmpProtocolMac\n"
"address =\""<< m_parent->GetAddress () <<"\">\n";
m_stats.Print(os);
os << "</HwmpMacPlugin>\n";
os << "</HwmpProtocolMac>\n";
}
void
HwmpMacPlugin::ResetStats ()
HwmpProtocolMac::ResetStats ()
{
m_stats = Statistics::Statistics ();
}

View File

@@ -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<HwmpProtocol>);
~HwmpMacPlugin ();
HwmpProtocolMac (uint32_t, Ptr<HwmpProtocol>);
~HwmpProtocolMac ();
///\name Inherited from MAC plugin
//\{
void SetParent (Ptr<MeshWifiInterfaceMac> parent);

View File

@@ -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<MeshPointDevice> mp)
if (mac == 0)
return false;
// Installing plugins:
Ptr<HwmpMacPlugin> hwmpMac = Create<HwmpMacPlugin> (wifiNetDev->GetIfIndex (), this);
Ptr<HwmpProtocolMac> hwmpMac = Create<HwmpProtocolMac> (wifiNetDev->GetIfIndex (), this);
m_interfaces[wifiNetDev->GetIfIndex ()] = hwmpMac;
mac->InstallPlugin (hwmpMac);
//Installing airtime link metric:

View File

@@ -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<uint32_t, Ptr<HwmpMacPlugin> > HwmpPluginMap;
typedef std::map<uint32_t, Ptr<HwmpProtocolMac> > HwmpPluginMap;
HwmpPluginMap m_interfaces;
Mac48Address m_address;
uint32_t m_dataSeqno;

View File

@@ -267,7 +267,7 @@ PeerLink::LinkIsIdle () const
return (m_state == IDLE);
}
void
PeerLink::SetMacPlugin(Ptr<PeerManagerMacPlugin> plugin)
PeerLink::SetMacPlugin(Ptr<PeerManagementProtocolMac> plugin)
{
m_macPlugin = plugin;
}

View File

@@ -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<PeerManagerMacPlugin> plugin);
void SetMacPlugin(Ptr<PeerManagementProtocolMac> 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<PeerManagerMacPlugin> m_macPlugin;
Ptr<PeerManagementProtocolMac> m_macPlugin;
/// Peer address
Mac48Address m_peerAddress;
/// Mesh point address, equal to peer address in case of single

View File

@@ -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<PeerManagementProtocol> protocol)
PeerManagementProtocolMac::PeerManagementProtocolMac (uint32_t interface, Ptr<PeerManagementProtocol> protocol)
{
m_ifIndex = interface;
m_protocol = protocol;
}
PeerManagerMacPlugin::~PeerManagerMacPlugin ()
PeerManagementProtocolMac::~PeerManagementProtocolMac ()
{
}
void
PeerManagerMacPlugin::SetParent (Ptr<MeshWifiInterfaceMac> parent)
PeerManagementProtocolMac::SetParent (Ptr<MeshWifiInterfaceMac> parent)
{
m_parent = parent;
}
bool
PeerManagerMacPlugin::Receive (Ptr<Packet> const_packet, const WifiMacHeader & header)
PeerManagementProtocolMac::Receive (Ptr<Packet> 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<Packet> const_packet, const WifiMacHeader & h
return m_protocol->IsActiveLink(m_ifIndex,header.GetAddr2());
}
bool
PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
PeerManagementProtocolMac::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
{
if(header.IsAction ())
{
@@ -166,7 +166,7 @@ PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader &
}
}
void
PeerManagerMacPlugin::UpdateBeacon (MeshWifiBeacon & beacon) const
PeerManagementProtocolMac::UpdateBeacon (MeshWifiBeacon & beacon) const
{
Ptr<IeBeaconTiming> 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<Time, Time>
PeerManagerMacPlugin::GetBeaconInfo() const
PeerManagementProtocolMac::GetBeaconInfo() const
{
std::pair<Time,Time> 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 << "<Statistics "
"txOpen=\"" << txOpen << "\"\n"
@@ -295,7 +295,7 @@ PeerManagerMacPlugin::Statistics::Print (std::ostream & os) const
"beaconShift=\"" << beaconShift << "\"/>\n";
}
void
PeerManagerMacPlugin::Report (std::ostream & os) const
PeerManagementProtocolMac::Report (std::ostream & os) const
{
os << "<PeerManagerPlugin "
"address=\"" << m_parent->GetAddress () << "\">\n";
@@ -303,12 +303,12 @@ PeerManagerMacPlugin::Report (std::ostream & os) const
os << "</PeerManagerPlugin>\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);
}

View File

@@ -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<PeerManagementProtocol> protocol);
~PeerManagerMacPlugin ();
PeerManagementProtocolMac (uint32_t interface, Ptr<PeerManagementProtocol> protocol);
~PeerManagementProtocolMac ();
///\name Inherited from plugin abstract class
///\{
void SetParent (Ptr<MeshWifiInterfaceMac> parent);

View File

@@ -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<MeshPointDevice> mp)
Ptr<MeshWifiInterfaceMac> mac = wifiNetDev->GetMac ()->GetObject<MeshWifiInterfaceMac> ();
if (mac == 0)
return false;
Ptr<PeerManagerMacPlugin> peerPlugin = Create<PeerManagerMacPlugin> ((*i)->GetIfIndex(), this);
Ptr<PeerManagementProtocolMac> peerPlugin = Create<PeerManagementProtocolMac> ((*i)->GetIfIndex(), this);
mac->InstallPlugin(peerPlugin);
m_plugins[(*i)->GetIfIndex()] = peerPlugin;
PeerLinksOnInterface newmap;

View File

@@ -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<uint32_t, BeaconsOnInterface> BeaconInfoMap;
///\brief this vector keeps pointers to MAC-plugins
typedef std::map<uint32_t, Ptr<PeerManagerMacPlugin> > PeerManagerPluginMap;
typedef std::map<uint32_t, Ptr<PeerManagementProtocolMac> > PeerManagerPluginMap;
///\}
private:
/**

View File

@@ -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',

View File

@@ -24,23 +24,23 @@
#include "ns3/log.h"
namespace ns3 {
namespace flame {
NS_LOG_COMPONENT_DEFINE ("FlameMacPlugin");
FlameMacPlugin::FlameMacPlugin (uint32_t ifIndex, Ptr<FlameProtocol> protocol):
NS_LOG_COMPONENT_DEFINE ("FlameProtocolMac");
FlameProtocolMac::FlameProtocolMac (uint32_t ifIndex, Ptr<FlameProtocol> protocol):
m_protocol (protocol),
m_ifIndex (ifIndex)
{
}
FlameMacPlugin::~FlameMacPlugin ()
FlameProtocolMac::~FlameProtocolMac ()
{
}
void
FlameMacPlugin::SetParent (Ptr<MeshWifiInterfaceMac> parent)
FlameProtocolMac::SetParent (Ptr<MeshWifiInterfaceMac> parent)
{
m_parent = parent;
}
bool
FlameMacPlugin::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
FlameProtocolMac::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
{
if (!header.IsData ())
return true;
@@ -54,7 +54,7 @@ FlameMacPlugin::Receive (Ptr<Packet> packet, const WifiMacHeader & header)
return true;
}
bool
FlameMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
FlameProtocolMac::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to)
{
if(!header.IsData ())
return true;
@@ -67,22 +67,22 @@ FlameMacPlugin::UpdateOutcomingFrame (Ptr<Packet> 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 ()
{
}

View File

@@ -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<FlameProtocol>);
~FlameMacPlugin ();
FlameProtocolMac (uint32_t, Ptr<FlameProtocol>);
~FlameProtocolMac ();
///\name Inherited from MAC plugin
//\{
void SetParent (Ptr<MeshWifiInterfaceMac> parent);

View File

@@ -219,7 +219,7 @@ FlameProtocol::Install (Ptr<MeshPointDevice> mp)
if (mac == 0)
return false;
// Installing plugins:
Ptr<FlameMacPlugin> flameMac = Create<FlameMacPlugin> (wifiNetDev->GetIfIndex (), this);
Ptr<FlameProtocolMac> flameMac = Create<FlameProtocolMac> (wifiNetDev->GetIfIndex (), this);
m_interfaces[wifiNetDev->GetIfIndex ()] = flameMac;
mac->InstallPlugin (flameMac);
}

View File

@@ -99,7 +99,7 @@ private:
* \name Information about MeshPointDeviceaddress , plugins
* \{
*/
typedef std::map<uint32_t, Ptr<FlameMacPlugin> > FlamePluginMap;
typedef std::map<uint32_t, Ptr<FlameProtocolMac> > FlamePluginMap;
FlamePluginMap m_interfaces;
Mac48Address m_address;
///\}

View File

@@ -18,25 +18,25 @@
* Author: Kirill Andreev <andreev@iitp.ru>
* Pavel Boyko <boyko@iitp.ru>
*/
#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> node, uint32_t nInterfaces) const
MeshHelper::Install (const WifiPhyHelper &phy, const MeshInterfaceHelper &interfaceHelper, Ptr<Node> node, uint32_t nInterfaces) const
{
return Install (phy, interfaceHelper, NodeContainer (node), nInterfaces);
}
void
MeshWifiHelper::Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os)
MeshHelper::Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os)
{
NS_ASSERT (m_stack != 0);
Ptr <MeshPointDevice> mp = device->GetObject<MeshPointDevice> ();
@@ -94,7 +94,7 @@ MeshWifiHelper::Report (const ns3::Ptr<ns3::NetDevice>& device, std::ostream& os
os << "</MeshPointDevice>\n";
}
void
MeshWifiHelper::ResetStats (const ns3::Ptr<ns3::NetDevice>& device)
MeshHelper::ResetStats (const ns3::Ptr<ns3::NetDevice>& device)
{
NS_ASSERT (m_stack != 0);
Ptr <MeshPointDevice> mp = device->GetObject<MeshPointDevice> ();

View File

@@ -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.
*

View File

@@ -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')