Fixed names
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include "ns3/wifi-module.h"
|
||||
#include "ns3/mesh-module.h"
|
||||
#include "ns3/mobility-module.h"
|
||||
#include "ns3/dot11s-helper.h"
|
||||
#include "ns3/mesh-helper.h"
|
||||
#include "ns3/mesh-interface-helper.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -233,7 +233,7 @@ HwmpProtocol::RequestRoute (
|
||||
m_stats.txBytes += packet->GetSize ();
|
||||
//channel IDs where we have already sent broadcast:
|
||||
std::vector<uint16_t> channels;
|
||||
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
for(HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
{
|
||||
bool should_send = true;
|
||||
for(std::vector<uint16_t>::const_iterator chan = channels.begin(); chan != channels.end(); chan ++)
|
||||
@@ -317,7 +317,7 @@ HwmpProtocol::ForwardUnicast(uint32_t sourceIface, const Mac48Address source, c
|
||||
uint32_t dst_seqno = 0;
|
||||
if(result.retransmitter != Mac48Address::GetBroadcast ())
|
||||
dst_seqno = result.seqnum;
|
||||
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
for(HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
i->second->RequestDestination(destination, originator_seqno, dst_seqno);
|
||||
}
|
||||
QueuedPacket pkt;
|
||||
@@ -486,7 +486,7 @@ HwmpProtocol::ReceivePreq (IePreq preq, Mac48Address from, uint32_t interface, M
|
||||
return;
|
||||
//Forward PREQ to all interfaces:
|
||||
NS_LOG_DEBUG("I am "<<GetAddress ()<<"retransmitting PREQ:"<<preq);
|
||||
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
for(HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
i->second->SendPreq (preq);
|
||||
}
|
||||
void
|
||||
@@ -553,7 +553,7 @@ HwmpProtocol::ReceivePrep (IePrep prep, Mac48Address from, uint32_t interface, M
|
||||
if (result.retransmitter == Mac48Address::GetBroadcast ())
|
||||
return;
|
||||
//Forward PREP
|
||||
HwmpPluginMap::const_iterator prep_sender = m_interfaces.find (result.ifIndex);
|
||||
HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (result.ifIndex);
|
||||
NS_ASSERT(prep_sender != m_interfaces.end ());
|
||||
prep_sender->second->SendPrep (prep, result.retransmitter);
|
||||
}
|
||||
@@ -601,7 +601,7 @@ HwmpProtocol::SendPrep (
|
||||
prep.SetMetric (0);
|
||||
prep.SetOriginatorAddress (src);
|
||||
prep.SetOriginatorSeqNumber (originatorDsn);
|
||||
HwmpPluginMap::const_iterator prep_sender = m_interfaces.find (interface);
|
||||
HwmpProtocolMacMap::const_iterator prep_sender = m_interfaces.find (interface);
|
||||
NS_ASSERT(prep_sender != m_interfaces.end ());
|
||||
prep_sender->second->SendPrep (prep, retransmitter);
|
||||
//m_prepCallback (prep, retransmitter);
|
||||
@@ -677,7 +677,7 @@ HwmpProtocol::MakePathError (std::vector<IePerr::FailedDestination> destinations
|
||||
perr.AddAddressUnit(destinations[i]);
|
||||
m_rtable->DeleteReactivePath(destinations[i].destination);
|
||||
}
|
||||
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
for(HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
{
|
||||
std::vector<Mac48Address> receivers_for_interface;
|
||||
for(unsigned int j = 0; j < receivers.size(); j ++)
|
||||
@@ -861,7 +861,7 @@ HwmpProtocol::RetryPathDiscovery (Mac48Address dst, uint8_t numOfRetry)
|
||||
uint32_t dst_seqno = 0;
|
||||
if(result.retransmitter != Mac48Address::GetBroadcast ())
|
||||
dst_seqno = result.seqnum;
|
||||
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
for(HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
i->second->RequestDestination(dst, originator_seqno, dst_seqno);
|
||||
m_preqTimeouts[dst] = Simulator::Schedule (
|
||||
MilliSeconds (2*(m_dot11MeshHWMPnetDiameterTraversalTime.GetMilliSeconds())),
|
||||
@@ -897,7 +897,7 @@ HwmpProtocol::SendProactivePreq ()
|
||||
preq.SetOriginatorAddress(GetAddress ());
|
||||
preq.SetPreqID (GetNextPreqId ());
|
||||
preq.SetOriginatorSeqNumber (GetNextHwmpSeqno ());
|
||||
for(HwmpPluginMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
for(HwmpProtocolMacMap::const_iterator i = m_interfaces.begin (); i != m_interfaces.end (); i ++)
|
||||
i->second->SendPreq(preq);
|
||||
m_proactivePreqTimer = Simulator::Schedule (m_dot11MeshHWMPpathToRootInterval, &HwmpProtocol::SendProactivePreq, this);
|
||||
}
|
||||
@@ -988,7 +988,7 @@ HwmpProtocol::Report (std::ostream & os) const
|
||||
"doFlag=\"" << m_doFlag << "\"\n"
|
||||
"rfFlag=\"" << m_rfFlag << "\">\n";
|
||||
m_stats.Print (os);
|
||||
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
for(HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
{
|
||||
plugin->second->Report(os);
|
||||
}
|
||||
@@ -998,7 +998,7 @@ void
|
||||
HwmpProtocol::ResetStats ()
|
||||
{
|
||||
m_stats = Statistics::Statistics ();
|
||||
for(HwmpPluginMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
for(HwmpProtocolMacMap::const_iterator plugin = m_interfaces.begin (); plugin != m_interfaces.end (); plugin ++)
|
||||
plugin->second->ResetStats ();
|
||||
}
|
||||
|
||||
|
||||
@@ -181,8 +181,8 @@ private:
|
||||
///\return address of MeshPointDevice
|
||||
Mac48Address GetAddress ();
|
||||
private:
|
||||
typedef std::map<uint32_t, Ptr<HwmpProtocolMac> > HwmpPluginMap;
|
||||
HwmpPluginMap m_interfaces;
|
||||
typedef std::map<uint32_t, Ptr<HwmpProtocolMac> > HwmpProtocolMacMap;
|
||||
HwmpProtocolMacMap m_interfaces;
|
||||
Mac48Address m_address;
|
||||
uint32_t m_dataSeqno;
|
||||
uint32_t m_hwmpSeqno;
|
||||
|
||||
@@ -297,10 +297,10 @@ PeerManagementProtocolMac::Statistics::Print (std::ostream & os) const
|
||||
void
|
||||
PeerManagementProtocolMac::Report (std::ostream & os) const
|
||||
{
|
||||
os << "<PeerManagerPlugin "
|
||||
os << "<PeerManagementProtocolMac "
|
||||
"address=\"" << m_parent->GetAddress () << "\">\n";
|
||||
m_stats.Print (os);
|
||||
os << "</PeerManagerPlugin>\n";
|
||||
os << "</PeerManagementProtocolMac>\n";
|
||||
}
|
||||
void
|
||||
PeerManagementProtocolMac::ResetStats ()
|
||||
|
||||
@@ -100,9 +100,9 @@ PeerManagementProtocol::Install(Ptr<MeshPointDevice> mp)
|
||||
Ptr<MeshWifiInterfaceMac> mac = wifiNetDev->GetMac ()->GetObject<MeshWifiInterfaceMac> ();
|
||||
if (mac == 0)
|
||||
return false;
|
||||
Ptr<PeerManagementProtocolMac> peerPlugin = Create<PeerManagementProtocolMac> ((*i)->GetIfIndex(), this);
|
||||
mac->InstallPlugin(peerPlugin);
|
||||
m_plugins[(*i)->GetIfIndex()] = peerPlugin;
|
||||
Ptr<PeerManagementProtocolMac> plugin = Create<PeerManagementProtocolMac> ((*i)->GetIfIndex(), this);
|
||||
mac->InstallPlugin(plugin);
|
||||
m_plugins[(*i)->GetIfIndex()] = plugin;
|
||||
PeerLinksOnInterface newmap;
|
||||
m_peerLinks[(*i)->GetIfIndex()] = newmap;
|
||||
}
|
||||
@@ -186,14 +186,14 @@ PeerManagementProtocol::UpdatePeerBeaconTiming(
|
||||
if(!meshBeacon)
|
||||
return;
|
||||
//BCA:
|
||||
PeerManagerPluginMap::iterator plugin = m_plugins.find (interface);
|
||||
PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface);
|
||||
NS_ASSERT(plugin != m_plugins.end ());
|
||||
Time shift = GetNextBeaconShift(interface);
|
||||
if(TimeToTu (shift) != 0)
|
||||
plugin->second->SetBeaconShift(shift);
|
||||
//PM STATE Machine
|
||||
//Check that a given beacon is not from our interface
|
||||
for(PeerManagerPluginMap::const_iterator i = m_plugins.begin (); i != m_plugins.end (); i ++)
|
||||
for(PeerManagementProtocolMacMap::const_iterator i = m_plugins.begin (); i != m_plugins.end (); i ++)
|
||||
if(i->second->GetAddress () == peerAddress)
|
||||
return;
|
||||
Ptr<PeerLink> peerLink = FindPeerLink(interface, peerAddress);
|
||||
@@ -284,7 +284,7 @@ PeerManagementProtocol::InitiateLink (
|
||||
NS_FATAL_ERROR ("Peer link must not exist.");
|
||||
}
|
||||
// Plugin must exist
|
||||
PeerManagerPluginMap::iterator plugin = m_plugins.find (interface);
|
||||
PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface);
|
||||
NS_ASSERT(plugin != m_plugins.end ());
|
||||
PeerLinksMap::iterator iface = m_peerLinks.find (interface);
|
||||
NS_ASSERT (iface != m_peerLinks.end());
|
||||
@@ -373,7 +373,7 @@ PeerManagementProtocol::GetNextBeaconShift (uint32_t interface)
|
||||
static int minShift = 1;
|
||||
PeerLinksMap::iterator iface = m_peerLinks.find (interface);
|
||||
NS_ASSERT (iface != m_peerLinks.end());
|
||||
PeerManagerPluginMap::iterator plugin = m_plugins.find (interface);
|
||||
PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface);
|
||||
NS_ASSERT (plugin != m_plugins.end());
|
||||
std::pair<Time, Time> myBeacon = plugin->second->GetBeaconInfo ();
|
||||
if(Simulator::Now () + TuToTime (maxShift) > myBeacon.first + myBeacon.second)
|
||||
@@ -416,7 +416,7 @@ PeerManagementProtocol::TimeToTu (Time x)
|
||||
void
|
||||
PeerManagementProtocol::PeerLinkStatus (uint32_t interface, Mac48Address peerAddress, Mac48Address peerMeshPointAddress, PeerLink::PeerState ostate, PeerLink::PeerState nstate)
|
||||
{
|
||||
PeerManagerPluginMap::iterator plugin = m_plugins.find (interface);
|
||||
PeerManagementProtocolMacMap::iterator plugin = m_plugins.find (interface);
|
||||
NS_ASSERT(plugin != m_plugins.end());
|
||||
NS_LOG_DEBUG(
|
||||
"Link between me:" << m_address <<
|
||||
@@ -478,7 +478,7 @@ PeerManagementProtocol::Report (std::ostream & os) const
|
||||
{
|
||||
os << "<PeerManagementProtocol>\n";
|
||||
m_stats.Print (os);
|
||||
for(PeerManagerPluginMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins ++)
|
||||
for(PeerManagementProtocolMacMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins ++)
|
||||
{
|
||||
//Take statistics from plugin:
|
||||
plugins->second->Report (os);
|
||||
@@ -494,7 +494,7 @@ void
|
||||
PeerManagementProtocol::ResetStats ()
|
||||
{
|
||||
m_stats = Statistics::Statistics ();
|
||||
for(PeerManagerPluginMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins ++)
|
||||
for(PeerManagementProtocolMacMap::const_iterator plugins = m_plugins.begin (); plugins != m_plugins.end (); plugins ++)
|
||||
plugins->second->ResetStats ();
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PeerManagementProtocolMac> > PeerManagerPluginMap;
|
||||
typedef std::map<uint32_t, Ptr<PeerManagementProtocolMac> > PeerManagementProtocolMacMap;
|
||||
///\}
|
||||
private:
|
||||
/**
|
||||
@@ -201,7 +201,7 @@ private:
|
||||
uint32_t TimeToTu (Time x);
|
||||
///\}
|
||||
private:
|
||||
PeerManagerPluginMap m_plugins;
|
||||
PeerManagementProtocolMacMap m_plugins;
|
||||
Mac48Address m_address;
|
||||
Ptr<IeMeshId> m_meshId;
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user