--- a/examples/mesh.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/examples/mesh.cc Wed Mar 25 12:23:12 2009 +0300
@@ -71,7 +71,7 @@
"RandomStart", TimeValue (Seconds (randomStart))
);
//wifi.SetPeerManager("ns3::WifiPeerManager");
- wifi.SetPeerManager("ns3::Dot11sPeerManagerProtocol");
+ wifi.SetPeerManager("ns3::PeerManagerProtocol");
wifi.SetL2RoutingNetDevice ("ns3::MeshPointDevice");
meshDevices = wifi.Install (wifiPhy,nodes);
// Installing Mobility.
--- a/src/devices/mesh/dot11s/dot11s-helper.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/dot11s-helper.cc Wed Mar 25 12:23:12 2009 +0300
@@ -154,7 +154,7 @@
device->SetMac (mac);
device->SetPhy (phy);
Ptr<PeerManagerProtocol> peerMan = m_peerMan.Create<PeerManagerProtocol> ();
- NS_ASSERT(peerMan->AttachPorts(ports));
+ NS_ASSERT(peerMan->AttachInterfaces(ports));
device->SetRemoteStationManager (manager);
node->AddDevice (device);
nodeDevices.push_back (device);
--- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.cc Wed Mar 25 12:23:12 2009 +0300
@@ -24,9 +24,9 @@
namespace ns3 {
namespace dot11s {
/*******************************************
- * IeDot11sBeaconTimingUnit
+ * IeBeaconTimingUnit
*******************************************/
-IeDot11sBeaconTimingUnit::IeDot11sBeaconTimingUnit ():
+IeBeaconTimingUnit::IeBeaconTimingUnit ():
m_aid (0),
m_lastBeacon (0),
m_beaconInterval (0)
@@ -34,57 +34,57 @@
}
void
-IeDot11sBeaconTimingUnit::SetAid (uint8_t aid)
+IeBeaconTimingUnit::SetAid (uint8_t aid)
{
m_aid = aid;
}
void
-IeDot11sBeaconTimingUnit::SetLastBeacon (uint16_t lastBeacon)
+IeBeaconTimingUnit::SetLastBeacon (uint16_t lastBeacon)
{
m_lastBeacon = lastBeacon;
}
void
-IeDot11sBeaconTimingUnit::SetBeaconInterval (uint16_t beaconInterval)
+IeBeaconTimingUnit::SetBeaconInterval (uint16_t beaconInterval)
{
m_beaconInterval = beaconInterval;
}
uint8_t
-IeDot11sBeaconTimingUnit::GetAid ()
+IeBeaconTimingUnit::GetAid ()
{
return m_aid;
}
uint16_t
-IeDot11sBeaconTimingUnit::GetLastBeacon ()
+IeBeaconTimingUnit::GetLastBeacon ()
{
return m_lastBeacon;
}
uint16_t
-IeDot11sBeaconTimingUnit::GetBeaconInterval ()
+IeBeaconTimingUnit::GetBeaconInterval ()
{
return m_beaconInterval;
}
/*******************************************
- * IeDot11sBeaconTiming
+ * IeBeaconTiming
*******************************************/
-IeDot11sBeaconTiming::IeDot11sBeaconTiming ():
+IeBeaconTiming::IeBeaconTiming ():
m_numOfUnits (0)
{
}
-IeDot11sBeaconTiming::NeighboursTimingUnitsList
-IeDot11sBeaconTiming::GetNeighboursTimingElementsList ()
+IeBeaconTiming::NeighboursTimingUnitsList
+IeBeaconTiming::GetNeighboursTimingElementsList ()
{
return m_neighbours;
}
void
-IeDot11sBeaconTiming::AddNeighboursTimingElementUnit (
+IeBeaconTiming::AddNeighboursTimingElementUnit (
uint16_t aid,
Time last_beacon, //MicroSeconds!
Time beacon_interval //MicroSeconds!
@@ -100,7 +100,7 @@
&& ((*i)->GetBeaconInterval () == BeaconIntervalToU16(beacon_interval))
)
return;
- Ptr<IeDot11sBeaconTimingUnit>new_element = Create<IeDot11sBeaconTimingUnit> ();
+ Ptr<IeBeaconTimingUnit>new_element = Create<IeBeaconTimingUnit> ();
new_element->SetAid (AidToU8(aid));
new_element->SetLastBeacon (TimestampToU16(last_beacon));
new_element->SetBeaconInterval (BeaconIntervalToU16(beacon_interval));
@@ -109,7 +109,7 @@
}
void
-IeDot11sBeaconTiming::DelNeighboursTimingElementUnit (
+IeBeaconTiming::DelNeighboursTimingElementUnit (
uint16_t aid,
Time last_beacon, //MicroSeconds!
Time beacon_interval //MicroSeconds!
@@ -129,7 +129,7 @@
}
void
-IeDot11sBeaconTiming::ClearTimingElement ()
+IeBeaconTiming::ClearTimingElement ()
{
uint16_t to_delete = 0;
uint16_t i;
@@ -145,13 +145,13 @@
}
uint8_t
-IeDot11sBeaconTiming::GetInformationSize () const
+IeBeaconTiming::GetInformationSize () const
{
return (5*m_numOfUnits);
}
void
-IeDot11sBeaconTiming::PrintInformation (std::ostream& os) const
+IeBeaconTiming::PrintInformation (std::ostream& os) const
{
for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j != m_neighbours.end(); j++)
os << "AID=" << (*j)->GetAid () << ", Last beacon was at "
@@ -159,7 +159,7 @@
}
void
-IeDot11sBeaconTiming::SerializeInformation (Buffer::Iterator i) const
+IeBeaconTiming::SerializeInformation (Buffer::Iterator i) const
{
for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin (); j != m_neighbours.end(); j++)
{
@@ -169,13 +169,13 @@
}
}
uint8_t
-IeDot11sBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IeBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
m_numOfUnits = length/5;
for (int j = 0; j < m_numOfUnits; j ++)
{
- Ptr<IeDot11sBeaconTimingUnit> new_element = Create<IeDot11sBeaconTimingUnit> ();
+ Ptr<IeBeaconTimingUnit> new_element = Create<IeBeaconTimingUnit> ();
new_element->SetAid (i.ReadU8());
new_element->SetLastBeacon (i.ReadNtohU16());
new_element->SetBeaconInterval (i.ReadNtohU16());
@@ -185,19 +185,19 @@
};
uint16_t
-IeDot11sBeaconTiming::TimestampToU16 (Time x)
+IeBeaconTiming::TimestampToU16 (Time x)
{
return ((uint16_t) ((x.GetMicroSeconds() >> 8)&0xffff));
};
uint16_t
-IeDot11sBeaconTiming::BeaconIntervalToU16 (Time x)
+IeBeaconTiming::BeaconIntervalToU16 (Time x)
{
return ((uint16_t) (x.GetMicroSeconds() >>10)&0xffff);
};
uint8_t
-IeDot11sBeaconTiming::AidToU8 (uint16_t x)
+IeBeaconTiming::AidToU8 (uint16_t x)
{
return (uint8_t) (x&0xff);
};
--- a/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-beacon-timing.h Wed Mar 25 12:23:12 2009 +0300
@@ -33,10 +33,10 @@
* \ingroup dot11s
* \brief Describes one unit of beacon timing element
*/
-class IeDot11sBeaconTimingUnit : public RefCountBase
+class IeBeaconTimingUnit : public RefCountBase
{
public:
- IeDot11sBeaconTimingUnit ();
+ IeBeaconTimingUnit ();
void SetAid (uint8_t aid);
void SetLastBeacon (uint16_t last_beacon);
void SetBeaconInterval (uint16_t beacon_interval);
@@ -63,16 +63,16 @@
* \ingroup dot11s
* \brief See 7.3.2.89 of 802.11s draft 2.07
*/
-class IeDot11sBeaconTiming : public WifiInformationElement
+class IeBeaconTiming : public WifiInformationElement
{
public:
/**
* \ingroup dot11s
* This type is a list of timing elements obtained from neigbours with their beacons:
*/
- typedef std::list< Ptr<IeDot11sBeaconTimingUnit> > NeighboursTimingUnitsList;
+ typedef std::list< Ptr<IeBeaconTimingUnit> > NeighboursTimingUnitsList;
- IeDot11sBeaconTiming ();
+ IeBeaconTiming ();
/**
* This methods are needed for beacon collision
* avoidance module:
--- a/src/devices/mesh/dot11s/ie-dot11s-configuration.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.cc Wed Mar 25 12:23:12 2009 +0300
@@ -76,7 +76,7 @@
return (cap & mask) == mask;
}
-IeDot11sConfiguration::IeDot11sConfiguration ():
+IeConfiguration::IeConfiguration ():
m_APSId (PROTOCOL_HWMP),
m_APSMId (METRIC_AIRTIME),
m_CCMId (CONGESTION_DEFAULT),
@@ -84,20 +84,20 @@
{}
TypeId
-IeDot11sConfiguration::GetTypeId ()
+IeConfiguration::GetTypeId ()
{
- static TypeId tid = TypeId ("ns3::IeDot11sConfiguration")
+ static TypeId tid = TypeId ("ns3::IeConfiguration")
.SetParent<WifiInformationElement> ();
return tid;
}
TypeId
-IeDot11sConfiguration::GetInstanceTypeId () const
+IeConfiguration::GetInstanceTypeId () const
{
return GetTypeId ();
}
uint8_t
-IeDot11sConfiguration::GetInformationSize () const
+IeConfiguration::GetInformationSize () const
{
return 1 // Version
+ 4 // APSPId
@@ -108,7 +108,7 @@
}
void
-IeDot11sConfiguration::SerializeInformation (Buffer::Iterator i) const
+IeConfiguration::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (1); //Version
// Active Path Selection Protocol ID:
@@ -123,7 +123,7 @@
}
uint8_t
-IeDot11sConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length)
+IeConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length)
{
Buffer::Iterator start = i;
uint8_t version;
@@ -140,35 +140,35 @@
return i.GetDistanceFrom (start);
}
void
-IeDot11sConfiguration::PrintInformation (std::ostream& os) const
+IeConfiguration::PrintInformation (std::ostream& os) const
{
//TODO: print
}
void
-IeDot11sConfiguration::SetRouting (dot11sPathSelectionProtocol routingId)
+IeConfiguration::SetRouting (dot11sPathSelectionProtocol routingId)
{
m_APSId = routingId;
}
void
-IeDot11sConfiguration::SetMetric (dot11sPathSelectionMetric metricId)
+IeConfiguration::SetMetric (dot11sPathSelectionMetric metricId)
{
m_APSMId = metricId;
}
bool
-IeDot11sConfiguration::IsHWMP ()
+IeConfiguration::IsHWMP ()
{
return (m_APSId == PROTOCOL_HWMP);
}
bool
-IeDot11sConfiguration::IsAirtime ()
+IeConfiguration::IsAirtime ()
{
return (m_APSMId == METRIC_AIRTIME);
}
-dot11sMeshCapability const& IeDot11sConfiguration::MeshCapability ()
+dot11sMeshCapability const& IeConfiguration::MeshCapability ()
{
return m_meshCap;
}
--- a/src/devices/mesh/dot11s/ie-dot11s-configuration.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-configuration.h Wed Mar 25 12:23:12 2009 +0300
@@ -89,13 +89,13 @@
* \brief Describes Mesh Configuration Element
* see 7.3.2.81 of 802.11s draft 2.07
*/
-class IeDot11sConfiguration : public WifiInformationElement
+class IeConfiguration : public WifiInformationElement
{
public:
static TypeId GetTypeId ();
TypeId GetInstanceTypeId () const;
- IeDot11sConfiguration ();
+ IeConfiguration ();
void SetRouting (dot11sPathSelectionProtocol routingId);
void SetMetric (dot11sPathSelectionMetric metricId);
bool IsHWMP ();
--- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.cc Wed Mar 25 12:23:12 2009 +0300
@@ -29,7 +29,7 @@
namespace ns3 {
namespace dot11s {
-IeDot11sPeerManagement::IeDot11sPeerManagement ():
+IePeerManagement::IePeerManagement ():
m_length (0),
m_subtype (PEER_OPEN),
m_localLinkId (0),
@@ -39,14 +39,14 @@
void
-IeDot11sPeerManagement::SetPeerOpen (uint16_t localLinkId)
+IePeerManagement::SetPeerOpen (uint16_t localLinkId)
{
m_length = 3;
m_subtype = PEER_OPEN;
m_localLinkId = localLinkId;
}
void
-IeDot11sPeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode)
+IePeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCode reasonCode)
{
m_length = 7;
m_subtype = PEER_CLOSE;
@@ -56,7 +56,7 @@
}
void
-IeDot11sPeerManagement::SetPeerConfirm (uint16_t localLinkId, uint16_t peerLinkId)
+IePeerManagement::SetPeerConfirm (uint16_t localLinkId, uint16_t peerLinkId)
{
m_length = 5;
m_subtype = PEER_CONFIRM;
@@ -65,47 +65,47 @@
}
dot11sReasonCode
-IeDot11sPeerManagement::GetReasonCode () const
+IePeerManagement::GetReasonCode () const
{
return m_reasonCode;
}
uint16_t
-IeDot11sPeerManagement::GetLocalLinkId () const
+IePeerManagement::GetLocalLinkId () const
{
return m_localLinkId;
}
uint16_t
-IeDot11sPeerManagement::GetPeerLinkId () const
+IePeerManagement::GetPeerLinkId () const
{
return m_peerLinkId;
}
uint8_t
-IeDot11sPeerManagement::GetInformationSize (void) const
+IePeerManagement::GetInformationSize (void) const
{
return m_length;
}
bool
-IeDot11sPeerManagement::SubtypeIsOpen () const
+IePeerManagement::SubtypeIsOpen () const
{
return (m_subtype == PEER_OPEN);
}
bool
-IeDot11sPeerManagement::SubtypeIsClose () const
+IePeerManagement::SubtypeIsClose () const
{
return (m_subtype == PEER_CLOSE);
}
bool
-IeDot11sPeerManagement::SubtypeIsConfirm () const
+IePeerManagement::SubtypeIsConfirm () const
{
return (m_subtype == PEER_CONFIRM);
}
void
-IeDot11sPeerManagement::SerializeInformation (Buffer::Iterator i) const
+IePeerManagement::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (m_subtype);
i.WriteHtonU16 (m_localLinkId);
@@ -115,7 +115,7 @@
i.WriteHtonU16 (m_reasonCode);
}
uint8_t
-IeDot11sPeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IePeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
m_subtype = i.ReadU8 ();
@@ -134,7 +134,7 @@
return i.GetDistanceFrom (start);
}
void
-IeDot11sPeerManagement::PrintInformation (std::ostream& os) const
+IePeerManagement::PrintInformation (std::ostream& os) const
{
//TODO
}
--- a/src/devices/mesh/dot11s/ie-dot11s-peer-management.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-peer-management.h Wed Mar 25 12:23:12 2009 +0300
@@ -32,10 +32,10 @@
* \ingroup dot11s
* \brief See 7.3.2.85 of draft 2.07
*/
-class IeDot11sPeerManagement : public WifiInformationElement
+class IePeerManagement : public WifiInformationElement
{
public:
- IeDot11sPeerManagement ();
+ IePeerManagement ();
enum Subtype {
PEER_OPEN = 0,
PEER_CLOSE = 1,
--- a/src/devices/mesh/dot11s/ie-dot11s-perr.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-perr.cc Wed Mar 25 12:23:12 2009 +0300
@@ -25,38 +25,38 @@
namespace ns3 {
namespace dot11s {
-IeDot11sPerr::~IeDot11sPerr ()
+IePerr::~IePerr ()
{
}
TypeId
-IeDot11sPerr::GetTypeId ()
+IePerr::GetTypeId ()
{
- static TypeId tid = TypeId ("ns3::IeDot11sPerr")
+ static TypeId tid = TypeId ("ns3::IePerr")
.SetParent<Object> ();
return tid;
}
void
-IeDot11sPerr::PrintInformation (std::ostream &os) const
+IePerr::PrintInformation (std::ostream &os) const
{
// FILL
}
TypeId
-IeDot11sPerr::GetInstanceTypeId () const
+IePerr::GetInstanceTypeId () const
{
return GetTypeId ();
}
-IeDot11sPerr::IeDot11sPerr ():
+IePerr::IePerr ():
m_numOfDest (0)
{
}
uint8_t
-IeDot11sPerr::GetNumOfDest ()
+IePerr::GetNumOfDest ()
{
return m_numOfDest;
}
void
-IeDot11sPerr::SerializeInformation (Buffer::Iterator i) const
+IePerr::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (0);
i.WriteU8 (m_numOfDest);
@@ -68,7 +68,7 @@
}
}
uint8_t
-IeDot11sPerr::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IePerr::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
i.Next (1); //Mode flags is not used now
@@ -86,7 +86,7 @@
}
uint8_t
-IeDot11sPerr::GetInformationSize () const
+IePerr::GetInformationSize () const
{
uint8_t retval =
1 //ModeFlags
@@ -97,7 +97,7 @@
}
void
-IeDot11sPerr::AddAddressUnit (FailedDestination unit)
+IePerr::AddAddressUnit (FailedDestination unit)
{
for (unsigned int i = 0; i < m_addressUnits.size (); i ++)
if (m_addressUnits[i].destination == unit.destination)
@@ -106,13 +106,13 @@
m_numOfDest++;
}
-std::vector<IeDot11sPerr::FailedDestination>
-IeDot11sPerr::GetAddressUnitVector ()
+std::vector<IePerr::FailedDestination>
+IePerr::GetAddressUnitVector ()
{
return m_addressUnits;
}
void
-IeDot11sPerr::DeleteAddressUnit (Mac48Address address)
+IePerr::DeleteAddressUnit (Mac48Address address)
{
for (std::vector<FailedDestination>::iterator i = m_addressUnits.begin (); i != m_addressUnits.end(); i ++)
if ((*i).destination == address)
@@ -124,7 +124,7 @@
}
void
-IeDot11sPerr::ResetPerr ()
+IePerr::ResetPerr ()
{
m_numOfDest = 0;
m_addressUnits.clear ();
--- a/src/devices/mesh/dot11s/ie-dot11s-perr.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-perr.h Wed Mar 25 12:23:12 2009 +0300
@@ -32,11 +32,11 @@
* \ingroup dot11s
* \brief See 7.3.2.98 of 802.11s draft 2.07
*/
-class IeDot11sPerr : public WifiInformationElement
+class IePerr : public WifiInformationElement
{
public:
- IeDot11sPerr ();
- ~IeDot11sPerr ();
+ IePerr ();
+ ~IePerr ();
static TypeId GetTypeId ();
virtual TypeId GetInstanceTypeId () const;
struct FailedDestination
--- a/src/devices/mesh/dot11s/ie-dot11s-prep.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-prep.cc Wed Mar 25 12:23:12 2009 +0300
@@ -26,30 +26,30 @@
namespace ns3 {
namespace dot11s {
/********************************
- * IeDot11sPrep
+ * IePrep
*******************************/
-IeDot11sPrep::~IeDot11sPrep ()
+IePrep::~IePrep ()
{
}
TypeId
-IeDot11sPrep::GetTypeId ()
+IePrep::GetTypeId ()
{
- static TypeId tid = TypeId ("ns3::IeDot11sPrep")
+ static TypeId tid = TypeId ("ns3::IePrep")
.SetParent<Object> ();
return tid;
}
void
-IeDot11sPrep::Print (std::ostream &os) const
+IePrep::Print (std::ostream &os) const
{
//TODO:fill this method
}
TypeId
-IeDot11sPrep::GetInstanceTypeId () const
+IePrep::GetInstanceTypeId () const
{
return GetTypeId ();
}
-IeDot11sPrep::IeDot11sPrep ():
+IePrep::IePrep ():
m_flags (0),
m_hopcount (0),
m_ttl (0),
@@ -62,110 +62,110 @@
{
}
void
-IeDot11sPrep::SetFlags (uint8_t flags)
+IePrep::SetFlags (uint8_t flags)
{
m_flags = flags;
}
void
-IeDot11sPrep::SetHopcount (uint8_t hopcount)
+IePrep::SetHopcount (uint8_t hopcount)
{
m_hopcount = hopcount;
}
void
-IeDot11sPrep::SetTTL (uint8_t ttl)
+IePrep::SetTTL (uint8_t ttl)
{
m_ttl = ttl;
}
void
-IeDot11sPrep::SetDestinationSeqNumber (uint32_t dest_seq_number)
+IePrep::SetDestinationSeqNumber (uint32_t dest_seq_number)
{
m_destSeqNumber = dest_seq_number;
}
void
-IeDot11sPrep::SetDestinationAddress (Mac48Address dest_address)
+IePrep::SetDestinationAddress (Mac48Address dest_address)
{
m_destinationAddress = dest_address;
}
void
-IeDot11sPrep::SetMetric (uint32_t metric)
+IePrep::SetMetric (uint32_t metric)
{
m_metric = metric;
}
void
-IeDot11sPrep::SetOriginatorAddress (Mac48Address originator_address)
+IePrep::SetOriginatorAddress (Mac48Address originator_address)
{
m_originatorAddress = originator_address;
}
void
-IeDot11sPrep::SetOriginatorSeqNumber (uint32_t originator_seq_number)
+IePrep::SetOriginatorSeqNumber (uint32_t originator_seq_number)
{
m_originatorSeqNumber = originator_seq_number;
}
void
-IeDot11sPrep::SetLifetime (uint32_t lifetime)
+IePrep::SetLifetime (uint32_t lifetime)
{
m_lifetime = lifetime;
}
uint8_t
-IeDot11sPrep::GetFlags () const
+IePrep::GetFlags () const
{
return m_flags;
}
uint8_t
-IeDot11sPrep::GetHopcount () const
+IePrep::GetHopcount () const
{
return m_hopcount;
}
uint32_t
-IeDot11sPrep::GetTTL () const
+IePrep::GetTTL () const
{
return m_ttl;
}
uint32_t
-IeDot11sPrep::GetDestinationSeqNumber () const
+IePrep::GetDestinationSeqNumber () const
{
return m_destSeqNumber;
}
Mac48Address
-IeDot11sPrep::GetDestinationAddress () const
+IePrep::GetDestinationAddress () const
{
return m_destinationAddress;
}
uint32_t
-IeDot11sPrep::GetMetric () const
+IePrep::GetMetric () const
{
return m_metric;
}
Mac48Address
-IeDot11sPrep::GetOriginatorAddress () const
+IePrep::GetOriginatorAddress () const
{
return m_originatorAddress;
}
uint32_t
-IeDot11sPrep::GetOriginatorSeqNumber () const
+IePrep::GetOriginatorSeqNumber () const
{
return m_originatorSeqNumber;
}
uint32_t
-IeDot11sPrep::GetLifetime () const
+IePrep::GetLifetime () const
{
return m_lifetime;
}
void
-IeDot11sPrep::DecrementTtl ()
+IePrep::DecrementTtl ()
{
m_ttl --;
}
void
-IeDot11sPrep::IncrementMetric (uint32_t metric)
+IePrep::IncrementMetric (uint32_t metric)
{
m_metric +=metric;
}
void
-IeDot11sPrep::SerializeInformation (Buffer::Iterator i) const
+IePrep::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (m_flags);
i.WriteU8 (m_hopcount);
@@ -178,7 +178,7 @@
i.WriteHtonU32 (m_originatorSeqNumber);
}
uint8_t
-IeDot11sPrep::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IePrep::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
m_flags = i.ReadU8 ();
@@ -193,7 +193,7 @@
return i.GetDistanceFrom (start);
}
uint8_t
-IeDot11sPrep::GetInformationSize () const
+IePrep::GetInformationSize () const
{
uint32_t retval =
1 //Flags
@@ -210,7 +210,7 @@
};
void
-IeDot11sPrep::PrintInformation (std::ostream& os) const
+IePrep::PrintInformation (std::ostream& os) const
{
//TODO
}
--- a/src/devices/mesh/dot11s/ie-dot11s-prep.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-prep.h Wed Mar 25 12:23:12 2009 +0300
@@ -33,11 +33,11 @@
* \ingroup dot11s
* \brief See 7.3.2.97 of 802.11s draft 2.07
*/
-class IeDot11sPrep : public WifiInformationElement
+class IePrep : public WifiInformationElement
{
public:
- IeDot11sPrep ();
- ~IeDot11sPrep ();
+ IePrep ();
+ ~IePrep ();
static TypeId GetTypeId ();
virtual TypeId GetInstanceTypeId () const;
virtual void Print (std::ostream &os) const;
--- a/src/devices/mesh/dot11s/ie-dot11s-preq.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-preq.cc Wed Mar 25 12:23:12 2009 +0300
@@ -81,32 +81,32 @@
return m_destinationAddress;
}
/********************************
- * IeDot11sPreq
+ * IePreq
*******************************/
-IeDot11sPreq::~IeDot11sPreq ()
+IePreq::~IePreq ()
{
}
TypeId
-IeDot11sPreq::GetTypeId ()
+IePreq::GetTypeId ()
{
- static TypeId tid = TypeId ("ns3::IeDot11sPreq")
+ static TypeId tid = TypeId ("ns3::IePreq")
.SetParent<Object> ();
return tid;
}
void
-IeDot11sPreq::Print (std::ostream &os) const
+IePreq::Print (std::ostream &os) const
{
//TODO:fill this method
}
TypeId
-IeDot11sPreq::GetInstanceTypeId () const
+IePreq::GetInstanceTypeId () const
{
return GetTypeId ();
}
-IeDot11sPreq::IeDot11sPreq ():
+IePreq::IePreq ():
m_maxSize (32),
m_flags (0),
m_hopCount (0),
@@ -120,136 +120,136 @@
{
}
void
-IeDot11sPreq::SetUnicastPreq ()
+IePreq::SetUnicastPreq ()
{
m_flags |= 1<<1;
}
void
-IeDot11sPreq::SetNeedNotPrep ()
+IePreq::SetNeedNotPrep ()
{
m_flags |= 1<<2;
}
//void
-//IeDot11sPreq::SetFlags (uint8_t flags)
+//IePreq::SetFlags (uint8_t flags)
//{
// m_flags = flags;
//}
void
-IeDot11sPreq::SetHopcount (uint8_t hopcount)
+IePreq::SetHopcount (uint8_t hopcount)
{
m_hopCount = hopcount;
}
void
-IeDot11sPreq::SetTTL (uint8_t ttl)
+IePreq::SetTTL (uint8_t ttl)
{
m_ttl = ttl;
}
void
-IeDot11sPreq::SetPreqID (uint32_t preq_id)
+IePreq::SetPreqID (uint32_t preq_id)
{
m_preqId = preq_id;
}
void
-IeDot11sPreq::SetMetric (uint32_t metric)
+IePreq::SetMetric (uint32_t metric)
{
m_metric = metric;
}
void
-IeDot11sPreq::SetOriginatorAddress (Mac48Address originator_address)
+IePreq::SetOriginatorAddress (Mac48Address originator_address)
{
m_originatorAddress = originator_address;
}
void
-IeDot11sPreq::SetOriginatorSeqNumber (uint32_t originator_seq_number)
+IePreq::SetOriginatorSeqNumber (uint32_t originator_seq_number)
{
m_originatorSeqNumber = originator_seq_number;
}
void
-IeDot11sPreq::SetLifetime (uint32_t lifetime)
+IePreq::SetLifetime (uint32_t lifetime)
{
m_lifetime = lifetime;
}
void
-IeDot11sPreq::SetDestCount (uint8_t dest_count)
+IePreq::SetDestCount (uint8_t dest_count)
{
m_destCount = dest_count;
}
//uint8_t
-//IeDot11sPreq::GetFlags () const
+//IePreq::GetFlags () const
//{
// return m_flags;
//}
bool
-IeDot11sPreq::IsUnicastPreq () const
+IePreq::IsUnicastPreq () const
{
return (m_flags & (1<<1));
}
bool
-IeDot11sPreq::IsNeedNotPrep () const
+IePreq::IsNeedNotPrep () const
{
return (m_flags & (1<<2));
}
uint8_t
-IeDot11sPreq::GetHopCount () const
+IePreq::GetHopCount () const
{
return m_hopCount;
}
uint8_t
-IeDot11sPreq::GetTtl () const
+IePreq::GetTtl () const
{
return m_ttl;
}
uint32_t
-IeDot11sPreq::GetPreqID () const
+IePreq::GetPreqID () const
{
return m_preqId;
}
uint32_t
-IeDot11sPreq::GetMetric () const
+IePreq::GetMetric () const
{
return m_metric;
}
Mac48Address
-IeDot11sPreq::GetOriginatorAddress () const
+IePreq::GetOriginatorAddress () const
{
return m_originatorAddress;
}
uint32_t
-IeDot11sPreq::GetOriginatorSeqNumber () const
+IePreq::GetOriginatorSeqNumber () const
{
return m_originatorSeqNumber;
}
uint32_t
-IeDot11sPreq::GetLifetime () const
+IePreq::GetLifetime () const
{
return m_lifetime;
}
uint8_t
-IeDot11sPreq::GetDestCount () const
+IePreq::GetDestCount () const
{
return m_destCount;
}
void
-IeDot11sPreq::DecrementTtl ()
+IePreq::DecrementTtl ()
{
m_ttl --;
m_hopCount ++;
}
void
-IeDot11sPreq::IncrementMetric (uint32_t metric)
+IePreq::IncrementMetric (uint32_t metric)
{
m_metric +=metric;
}
void
-IeDot11sPreq::SerializeInformation (Buffer::Iterator i) const
+IePreq::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (m_flags);
i.WriteU8 (m_hopCount);
@@ -278,7 +278,7 @@
}
uint8_t
-IeDot11sPreq::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IePreq::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
m_flags = i.ReadU8 ();
@@ -314,7 +314,7 @@
return i.GetDistanceFrom (start);
}
uint8_t
-IeDot11sPreq::GetInformationSize () const
+IePreq::GetInformationSize () const
{
uint8_t retval =
1 //Flags
@@ -334,17 +334,17 @@
}
void
-IeDot11sPreq::PrintInformation (std::ostream& os) const
+IePreq::PrintInformation (std::ostream& os) const
{
//TODO
}
std::vector<Ptr<DestinationAddressUnit> >
-IeDot11sPreq::GetDestinationList ()
+IePreq::GetDestinationList ()
{
return m_destinations;
}
void
-IeDot11sPreq::AddDestinationAddressElement (
+IePreq::AddDestinationAddressElement (
bool doFlag, bool rfFlag,
Mac48Address dest_address,
uint32_t dest_seq_number
@@ -362,7 +362,7 @@
}
void
-IeDot11sPreq::DelDestinationAddressElement (Mac48Address dest_address)
+IePreq::DelDestinationAddressElement (Mac48Address dest_address)
{
for (std::vector<Ptr<DestinationAddressUnit> >::iterator i = m_destinations.begin (); i != m_destinations.end(); i++)
if ((*i)->GetDestinationAddress () == dest_address)
@@ -374,7 +374,7 @@
}
void
-IeDot11sPreq::ClearDestinationAddressElement ()
+IePreq::ClearDestinationAddressElement ()
{
int i;
for (std::vector<Ptr<DestinationAddressUnit> >::iterator j = m_destinations.begin (); j != m_destinations.end(); j++)
--- a/src/devices/mesh/dot11s/ie-dot11s-preq.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-preq.h Wed Mar 25 12:23:12 2009 +0300
@@ -57,11 +57,11 @@
* \ingroup dot11s
* \brief See 7.3.2.96 of 802.11s draft 2.07
*/
-class IeDot11sPreq : public WifiInformationElement
+class IePreq : public WifiInformationElement
{
public:
- IeDot11sPreq ();
- ~IeDot11sPreq ();
+ IePreq ();
+ ~IePreq ();
static TypeId GetTypeId ();
virtual TypeId GetInstanceTypeId () const;
virtual void Print (std::ostream &os) const;
--- a/src/devices/mesh/dot11s/ie-dot11s-rann.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-rann.cc Wed Mar 25 12:23:12 2009 +0300
@@ -27,26 +27,26 @@
namespace ns3 {
namespace dot11s {
-IeDot11sRann::~IeDot11sRann ()
+IeRann::~IeRann ()
{
}
TypeId
-IeDot11sRann::GetTypeId ()
+IeRann::GetTypeId ()
{
- static TypeId tid = TypeId ("ns3::IeDot11sRann").SetParent<Object> ();
+ static TypeId tid = TypeId ("ns3::IeRann").SetParent<Object> ();
return tid;
}
TypeId
-IeDot11sRann::GetInstanceTypeId () const
+IeRann::GetInstanceTypeId () const
{
return GetTypeId ();
}
void
-IeDot11sRann::Print (std::ostream &os)const
+IeRann::Print (std::ostream &os)const
{
// FILL
}
-IeDot11sRann::IeDot11sRann ():
+IeRann::IeRann ():
m_flags (0),
m_hopcount (0),
m_ttl (0),
@@ -56,68 +56,68 @@
{
}
void
-IeDot11sRann::SetFlags (uint8_t flags)
+IeRann::SetFlags (uint8_t flags)
{
m_flags = flags;
}
void
-IeDot11sRann::SetHopcount (uint8_t hopcount)
+IeRann::SetHopcount (uint8_t hopcount)
{
m_hopcount = hopcount;
}
void
-IeDot11sRann::SetTTL (uint8_t ttl)
+IeRann::SetTTL (uint8_t ttl)
{
m_ttl = ttl;
}
void
-IeDot11sRann::SetDestSeqNumber (uint32_t dest_seq_number)
+IeRann::SetDestSeqNumber (uint32_t dest_seq_number)
{
m_destSeqNumber = dest_seq_number;
}
void
-IeDot11sRann::SetMetric (uint32_t metric)
+IeRann::SetMetric (uint32_t metric)
{
m_metric = metric;
}
void
-IeDot11sRann::SetOriginatorAddress (Mac48Address originator_address)
+IeRann::SetOriginatorAddress (Mac48Address originator_address)
{
m_originatorAddress = originator_address;
}
uint8_t
-IeDot11sRann::GetFlags ()
+IeRann::GetFlags ()
{
return m_flags;
}
uint8_t
-IeDot11sRann::GetHopcount ()
+IeRann::GetHopcount ()
{
return m_hopcount;
}
uint8_t
-IeDot11sRann::GetTTL ()
+IeRann::GetTTL ()
{
return m_ttl;
}
uint32_t
-IeDot11sRann::GetDestSeqNumber ()
+IeRann::GetDestSeqNumber ()
{
return m_destSeqNumber;
}
uint32_t
-IeDot11sRann::GetMetric ()
+IeRann::GetMetric ()
{
return m_metric;
}
Mac48Address
-IeDot11sRann::GetOriginatorAddress ()
+IeRann::GetOriginatorAddress ()
{
return m_originatorAddress;
}
void
-IeDot11sRann::SerializeInformation (Buffer::Iterator i) const
+IeRann::SerializeInformation (Buffer::Iterator i) const
{
i.WriteU8 (m_flags);
i.WriteU8 (m_hopcount);
@@ -127,7 +127,7 @@
i.WriteHtonU32 (m_metric);
}
uint8_t
-IeDot11sRann::DeserializeInformation (Buffer::Iterator start, uint8_t length)
+IeRann::DeserializeInformation (Buffer::Iterator start, uint8_t length)
{
Buffer::Iterator i = start;
m_flags = i.ReadU8 ();
@@ -139,7 +139,7 @@
return i.GetDistanceFrom (start);
}
uint8_t
-IeDot11sRann::GetInformationSize () const
+IeRann::GetInformationSize () const
{
uint8_t retval =
1 //Flags
--- a/src/devices/mesh/dot11s/ie-dot11s-rann.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/ie-dot11s-rann.h Wed Mar 25 12:23:12 2009 +0300
@@ -32,11 +32,11 @@
* \ingroup dot11s
* \brief See 7.3.2.95 of 802.11s draft 2.07
*/
-class IeDot11sRann
+class IeRann
{
public:
- IeDot11sRann ();
- virtual ~IeDot11sRann ();
+ IeRann ();
+ virtual ~IeRann ();
static TypeId GetTypeId ();
virtual TypeId GetInstanceTypeId () const;
virtual void Print (std::ostream &os) const;
--- a/src/devices/mesh/dot11s/peer-link-frame.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-link-frame.cc Wed Mar 25 12:23:12 2009 +0300
@@ -26,7 +26,7 @@
PeerLinkFrameStart::PeerLinkFrameStart ()
{
- m_fields.subtype = IeDot11sPeerManagement::PEER_OPEN;
+ m_fields.subtype = IePeerManagement::PEER_OPEN;
m_fields.aid = 0;
m_fields.rates = SupportedRates();
m_fields.meshId = Ssid();
@@ -80,9 +80,9 @@
PeerLinkFrameStart::GetSerializedSize () const
{
uint32_t size = 1; //Subtype
- if (IeDot11sPeerManagement::PEER_CONFIRM == m_fields.subtype)
+ if (IePeerManagement::PEER_CONFIRM == m_fields.subtype)
size += 2; //AID of remote peer
- if (IeDot11sPeerManagement::PEER_CLOSE != m_fields.subtype)
+ if (IePeerManagement::PEER_CLOSE != m_fields.subtype)
{
size += m_fields.rates.GetSerializedSize ();
size += 2;
@@ -96,9 +96,9 @@
{
Buffer::Iterator i = start;
i.WriteU8 (m_fields.subtype); //Like a Category in Standart
- if (IeDot11sPeerManagement::PEER_CONFIRM == m_fields.subtype)
+ if (IePeerManagement::PEER_CONFIRM == m_fields.subtype)
i.WriteHtonU16 (m_fields.aid);
- if (IeDot11sPeerManagement::PEER_CLOSE != m_fields.subtype)
+ if (IePeerManagement::PEER_CLOSE != m_fields.subtype)
{
i = m_fields.rates.Serialize (i);
i.Next(2); //QoS
@@ -110,10 +110,10 @@
PeerLinkFrameStart::Deserialize (Buffer::Iterator start)
{
Buffer::Iterator i = start;
- m_fields.subtype = (IeDot11sPeerManagement::Subtype)i.ReadU8 ();
- if (IeDot11sPeerManagement::PEER_CONFIRM == m_fields.subtype)
+ m_fields.subtype = (IePeerManagement::Subtype)i.ReadU8 ();
+ if (IePeerManagement::PEER_CONFIRM == m_fields.subtype)
m_fields.aid = i.ReadNtohU16 ();
- if (IeDot11sPeerManagement::PEER_CLOSE != m_fields.subtype)
+ if (IePeerManagement::PEER_CLOSE != m_fields.subtype)
{
i = m_fields.rates.Deserialize (i);
i.Next(2); //QoS
--- a/src/devices/mesh/dot11s/peer-link.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-link.cc Wed Mar 25 12:23:12 2009 +0300
@@ -123,7 +123,7 @@
}
void
-PeerLink::SetBeaconTimingElement (IeDot11sBeaconTiming beaconTiming)
+PeerLink::SetBeaconTimingElement (IeBeaconTiming beaconTiming)
{
m_beaconTiming = beaconTiming;
}
@@ -152,7 +152,7 @@
return m_beaconInterval;
}
-IeDot11sBeaconTiming
+IeBeaconTiming
PeerLink::GetBeaconTimingElement () const
{
return m_beaconTiming;
@@ -195,7 +195,7 @@
StateMachine (CLS_ACPT, reason);
}
-void PeerLink::OpenAccept (uint16_t localLinkId, IeDot11sConfiguration conf)
+void PeerLink::OpenAccept (uint16_t localLinkId, IeConfiguration conf)
{
if (m_peerLinkId == 0)
m_peerLinkId = localLinkId;
@@ -203,7 +203,7 @@
StateMachine (OPN_ACPT);
}
-void PeerLink::OpenReject (uint16_t localLinkId, IeDot11sConfiguration conf,dot11sReasonCode reason)
+void PeerLink::OpenReject (uint16_t localLinkId, IeConfiguration conf,dot11sReasonCode reason)
{
if ( m_peerLinkId == 0)
m_peerLinkId = localLinkId;
@@ -212,7 +212,7 @@
}
void
-PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeDot11sConfiguration conf)
+PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t peerAid, IeConfiguration conf)
{
if ( m_localLinkId != peerLinkId)
return;
@@ -227,7 +227,7 @@
void
PeerLink::ConfirmReject (uint16_t localLinkId, uint16_t peerLinkId,
- IeDot11sConfiguration conf,dot11sReasonCode reason)
+ IeConfiguration conf,dot11sReasonCode reason)
{
if (m_localLinkId != peerLinkId)
return;
@@ -507,14 +507,14 @@
void PeerLink::SendPeerLinkClose (dot11sReasonCode reasoncode)
{
- IeDot11sPeerManagement peerElement;
+ IePeerManagement peerElement;
peerElement.SetPeerClose (m_localLinkId, m_peerLinkId, reasoncode);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_assocId, peerElement, m_configuration);
}
void PeerLink::SendPeerLinkOpen ()
{
- IeDot11sPeerManagement peerElement;
+ IePeerManagement peerElement;
peerElement.SetPeerOpen (m_localLinkId);
NS_ASSERT (m_macPlugin != NULL);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_assocId, peerElement, m_configuration);
@@ -522,7 +522,7 @@
void PeerLink::SendPeerLinkConfirm ()
{
- IeDot11sPeerManagement peerElement;
+ IePeerManagement peerElement;
peerElement.SetPeerConfirm (m_localLinkId, m_peerLinkId);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_assocId, peerElement, m_configuration);
}
--- a/src/devices/mesh/dot11s/peer-link.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-link.h Wed Mar 25 12:23:12 2009 +0300
@@ -39,6 +39,7 @@
class PeerLink : public Object
{
public:
+ friend class PeerManagerProtocol;
/// Support object system
static TypeId GetTypeId();
/// C-tor create empty link
@@ -62,14 +63,14 @@
void SetPeerLinkId (uint16_t id);
void SetLocalAid (uint16_t aid);
void SetPeerAid (uint16_t aid);
- void SetBeaconTimingElement (IeDot11sBeaconTiming beaconTiming);
- void SetPeerLinkDescriptorElement (IeDot11sPeerManagement peerLinkElement);
+ void SetBeaconTimingElement (IeBeaconTiming beaconTiming);
+ void SetPeerLinkDescriptorElement (IePeerManagement peerLinkElement);
Mac48Address GetPeerAddress () const;
uint16_t GetLocalAid () const;
Time GetLastBeacon () const;
Time GetBeaconInterval () const;
- IeDot11sBeaconTiming GetBeaconTimingElement ()const;
- IeDot11sPeerManagement GetPeerLinkDescriptorElement ()const;
+ IeBeaconTiming GetBeaconTimingElement ()const;
+ IePeerManagement GetPeerLinkDescriptorElement ()const;
void ClearTimingElement ();
//\}
@@ -90,7 +91,7 @@
/// Set callback
void MLMESetSignalStatusCallback (SignalStatusCallback);
//\}
-
+private:
/**
* \name Link response to received management frames
*
@@ -104,21 +105,21 @@
/// Close link
void Close (uint16_t localLinkID, uint16_t peerLinkID, dot11sReasonCode reason);
/// Accept open link
- void OpenAccept (uint16_t localLinkId, IeDot11sConfiguration conf);
+ void OpenAccept (uint16_t localLinkId, IeConfiguration conf);
/// Reject open link
- void OpenReject (uint16_t localLinkId, IeDot11sConfiguration conf, dot11sReasonCode reason);
+ void OpenReject (uint16_t localLinkId, IeConfiguration conf, dot11sReasonCode reason);
/// Confirm accept
void ConfirmAccept (
uint16_t localLinkId,
uint16_t peerLinkId,
uint16_t peerAid,
- IeDot11sConfiguration conf
+ IeConfiguration conf
);
/// Confirm reject
void ConfirmReject (
uint16_t localLinkId,
uint16_t peerLinkId,
- IeDot11sConfiguration conf,
+ IeConfiguration conf,
dot11sReasonCode reason
);
//\}
@@ -219,11 +220,11 @@
/// Current state
PeerState m_state;
/// Mesh interface configuration
- IeDot11sConfiguration m_configuration;
+ IeConfiguration m_configuration;
// State is a bitfield as defined as follows:
// This are states for a given
- IeDot11sBeaconTiming m_beaconTiming;
+ IeBeaconTiming m_beaconTiming;
/**
* \name Timers & counters used for internal state transitions
--- a/src/devices/mesh/dot11s/peer-manager-plugin.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-manager-plugin.cc Wed Mar 25 12:23:12 2009 +0300
@@ -54,7 +54,7 @@
Ptr<Packet> packet = const_packet->Copy();
if(header.IsBeacon())
{
- IeDot11sBeaconTiming beaconTiming;
+ IeBeaconTiming beaconTiming;
Ptr<Packet> myBeacon = packet->Copy();
MgtBeaconHeader beacon_hdr;
myBeacon->RemoveHeader(beacon_hdr);
@@ -64,7 +64,7 @@
NS_LOG_DEBUG("Beacon timing:"<<beaconTiming);
meshBeacon = true;
}
- m_protocol->ReceiveBeacon(
+ m_protocol->UpdatePeerBeaconTiming(
m_ifIndex,
meshBeacon,
beaconTiming,
@@ -107,22 +107,22 @@
}
}
//link management element:
- IeDot11sConfiguration meshConfig;
- if(fields.subtype != IeDot11sPeerManagement::PEER_CLOSE)
+ IeConfiguration meshConfig;
+ if(fields.subtype != IePeerManagement::PEER_CLOSE)
packet->RemoveHeader(meshConfig);
- IeDot11sPeerManagement peerElement;
+ IePeerManagement peerElement;
packet->RemoveHeader(peerElement);
switch (actionValue.peerLink)
{
case WifiMeshMultihopActionHeader::PEER_LINK_CONFIRM:
- NS_ASSERT(fields.subtype == IeDot11sPeerManagement::PEER_CONFIRM);
+ NS_ASSERT(fields.subtype == IePeerManagement::PEER_CONFIRM);
break;
case WifiMeshMultihopActionHeader::PEER_LINK_OPEN:
- NS_ASSERT(fields.subtype == IeDot11sPeerManagement::PEER_OPEN);
+ NS_ASSERT(fields.subtype == IePeerManagement::PEER_OPEN);
break;
case WifiMeshMultihopActionHeader::PEER_LINK_CLOSE:
- NS_ASSERT(fields.subtype == IeDot11sPeerManagement::PEER_CLOSE);
+ NS_ASSERT(fields.subtype == IePeerManagement::PEER_CLOSE);
break;
default:
return false;
@@ -142,19 +142,15 @@
void
PeerManagerMacPlugin::UpdateBeacon (MeshWifiBeacon & beacon) const
{
- Ptr<IeDot11sBeaconTiming> beaconTiming =
- m_protocol->SendBeacon(
- m_ifIndex,
- Simulator::Now(),
- MicroSeconds(beacon.BeaconHeader().GetBeaconIntervalUs()));
+ Ptr<IeBeaconTiming> beaconTiming = m_protocol->GetBeaconTimingElement(m_ifIndex);
beacon.AddInformationElement(beaconTiming);
}
void
PeerManagerMacPlugin::SendPeerLinkManagementFrame(
Mac48Address peerAddress,
uint16_t aid,
- IeDot11sPeerManagement peerElement,
- IeDot11sConfiguration meshConfig
+ IePeerManagement peerElement,
+ IeConfiguration meshConfig
)
{
//Create a packet:
--- a/src/devices/mesh/dot11s/peer-manager-plugin.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-manager-plugin.h Wed Mar 25 12:23:12 2009 +0300
@@ -27,8 +27,8 @@
namespace ns3 {
class MeshWifiInterfaceMac;
namespace dot11s {
-class IeDot11sConfiguration;
-class IeDot11sPeerManagement;
+class IeConfiguration;
+class IePeerManagement;
class PeerManagerProtocol;
/**
* \ingroup dot11s
@@ -51,12 +51,15 @@
bool UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader & header, Mac48Address from, Mac48Address to) const;
void UpdateBeacon (MeshWifiBeacon & beacon) const;
///\}
+private:
+ friend class PeerManagerProtocol;
+ friend class PeerLink;
void SetPeerManagerProtcol(Ptr<PeerManagerProtocol> protocol);
void SendPeerLinkManagementFrame(
Mac48Address peerAddress,
uint16_t aid,
- IeDot11sPeerManagement peerElement,
- IeDot11sConfiguration meshConfig
+ IePeerManagement peerElement,
+ IeConfiguration meshConfig
);
///\brief DUBUG only - to print established links
Mac48Address GetAddress () const;
--- a/src/devices/mesh/dot11s/peer-manager-protocol.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-manager-protocol.cc Wed Mar 25 12:23:12 2009 +0300
@@ -45,32 +45,25 @@
PeerManagerProtocol::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::PeerManagerProtocol")
- .SetParent<Object> ()
- .AddConstructor<PeerManagerProtocol> ()
- //peerLinkCleanupTimeout. This constant is not specified in Draft 2.0
- .AddAttribute ("PeerLinkCleanupPeriod",
- "PeerLinkCleanupPeriod",
- TimeValue (MilliSeconds (80)),
- MakeTimeAccessor (&PeerManagerProtocol::m_peerLinkCleanupPeriod),
- MakeTimeChecker ()
- )
- //MaxBeaconLost. This constant is not specified in Draft 2.0
-#if 0
- .AddAttribute ("MaxBeaconLost", "Max Beacon Lost",
- UintegerValue (3),
- MakeUintegerAccessor (&PeerManagerProtocol::m_maxBeaconLoss),
- MakeUintegerChecker<uint8_t> ()
- )
-#endif
- //maximum number of peer links.
- .AddAttribute ("MaxNumberOfPeerLinks",
- "Maximum number of peer links ",
- UintegerValue (32),
- MakeUintegerAccessor (&PeerManagerProtocol::m_maxNumberOfPeerLinks),
- MakeUintegerChecker<uint8_t> ()
- );
+ .SetParent<Object> ()
+ .AddConstructor<PeerManagerProtocol> ()
+ /// peerLinkCleanupTimeout. We go through the map of peer links and
+ /// remove all links which state is IDLE.
+ .AddAttribute ("PeerLinkCleanupPeriod",
+ "PeerLinkCleanupPeriod",
+ TimeValue (MilliSeconds (80)),
+ MakeTimeAccessor (&PeerManagerProtocol::m_peerLinkCleanupPeriod),
+ MakeTimeChecker ()
+ )
+ /// maximum number of peer links. Now we calculate the total
+ /// number of peer links on all interfaces
+ .AddAttribute ("MaxNumberOfPeerLinks",
+ "Maximum number of peer links ",
+ UintegerValue (32),
+ MakeUintegerAccessor (&PeerManagerProtocol::m_maxNumberOfPeerLinks),
+ MakeUintegerChecker<uint8_t> ()
+ );
return tid;
-
}
PeerManagerProtocol::PeerManagerProtocol ():
m_lastAssocId (0),
@@ -103,7 +96,7 @@
}
bool
-PeerManagerProtocol::AttachPorts(std::vector<Ptr<WifiNetDevice> > interfaces)
+PeerManagerProtocol::AttachInterfaces(std::vector<Ptr<WifiNetDevice> > interfaces)
{
for(std::vector<Ptr<WifiNetDevice> >::iterator i = interfaces.begin(); i != interfaces.end(); i ++)
{
@@ -119,10 +112,10 @@
return true;
}
-Ptr<IeDot11sBeaconTiming>
-PeerManagerProtocol::SendBeacon(uint32_t interface, Time currentTbtt, Time beaconInterval)
+Ptr<IeBeaconTiming>
+PeerManagerProtocol::GetBeaconTimingElement(uint32_t interface)
{
- Ptr<IeDot11sBeaconTiming> retval = Create<IeDot11sBeaconTiming> ();
+ Ptr<IeBeaconTiming> retval = Create<IeBeaconTiming> ();
BeaconInfoMap::iterator i = m_neighbourBeacons.find(interface);
if(i == m_neighbourBeacons.end())
return retval;
@@ -169,10 +162,10 @@
}
void
-PeerManagerProtocol::ReceiveBeacon(
+PeerManagerProtocol::UpdatePeerBeaconTiming(
uint32_t interface,
bool meshBeacon,
- IeDot11sBeaconTiming timingElement,
+ IeBeaconTiming timingElement,
Mac48Address peerAddress,
Time receivingTime,
Time beaconInterval)
@@ -206,8 +199,8 @@
uint32_t interface,
Mac48Address peerAddress,
uint16_t aid,
- IeDot11sPeerManagement peerManagementElement,
- IeDot11sConfiguration meshConfig
+ IePeerManagement peerManagementElement,
+ IeConfiguration meshConfig
)
{
if (peerManagementElement.SubtypeIsOpen ())
@@ -400,10 +393,10 @@
NS_ASSERT (myBeacon != m_myBeaconInfo.end());
for (PeerLinksOnInterface::iterator i = interface->second.begin (); i != interface->second.end(); i++)
{
- IeDot11sBeaconTiming::NeighboursTimingUnitsList neighbours;
+ IeBeaconTiming::NeighboursTimingUnitsList neighbours;
neighbours = (*i)->GetBeaconTimingElement ().GetNeighboursTimingElementsList();
//first let's form the list of all kown TBTTs
- for (IeDot11sBeaconTiming::NeighboursTimingUnitsList::const_iterator j = neighbours.begin (); j != neighbours.end(); j++)
+ for (IeBeaconTiming::NeighboursTimingUnitsList::const_iterator j = neighbours.begin (); j != neighbours.end(); j++)
{
uint16_t beaconIntervalTimeUnits;
beaconIntervalTimeUnits = (*j)->GetBeaconInterval ();
@@ -471,9 +464,15 @@
NS_ASSERT(plugin != m_plugins.end());
NS_LOG_UNCOND("LINK between me:"<<plugin->second->GetAddress() <<" and peer:"<<peerAddress<<", at interface "<<interface);
if(status)
+ {
NS_LOG_UNCOND("Established");
+ m_numberOfActivePeers ++;
+ }
else
+ {
NS_LOG_UNCOND("Closed");
+ m_numberOfActivePeers --;
+ }
}
} // namespace dot11s
--- a/src/devices/mesh/dot11s/peer-manager-protocol.h Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/dot11s/peer-manager-protocol.h Wed Mar 25 12:23:12 2009 +0300
@@ -45,21 +45,19 @@
PeerManagerProtocol ();
~PeerManagerProtocol ();
static TypeId GetTypeId ();
- bool AttachPorts(std::vector<Ptr<WifiNetDevice> >);
+ bool AttachInterfaces(std::vector<Ptr<WifiNetDevice> >);
/** \brief Methods that handle beacon sending/receiving procedure.
* This methods interact with MAC_layer plug-in
* \{
*/
/**
- * \brief When we are sending a beacon - we add a timing element to
- * it and remember the time, when we sent a beacon (for BCA)
- * \param IeDot11sBeaconTiming is a beacon timing element that
+ * \brief When we are sending a beacon - we fill beacon timing
+ * element
+ * \param IeBeaconTiming is a beacon timing element that
* should be present in beacon
* \param interface is a interface sending a beacon
- * \param currentTbtt is a time of beacon sending
- * \param beaconInterval is a beacon interval on this interface
*/
- Ptr<IeDot11sBeaconTiming> SendBeacon(uint32_t interface, Time currentTbtt, Time beaconInterval);
+ Ptr<IeBeaconTiming> GetBeaconTimingElement(uint32_t interface);
/**
* \brief When we receive a beacon from peer-station, we remember
* its beacon timing element (needed for peer choosing mechanism),
@@ -68,10 +66,10 @@
* \param interface is a interface on which beacon was received
* \param timingElement is a timing element of remote beacon
*/
- void ReceiveBeacon(
+ void UpdatePeerBeaconTiming(
uint32_t interface,
bool meshBeacon,
- IeDot11sBeaconTiming timingElement,
+ IeBeaconTiming timingElement,
Mac48Address peerAddress,
Time receivingTime,
Time beaconInterval
@@ -93,16 +91,16 @@
* \param Mac48Address is address of peer
* \param uint16_t is association ID, which peer has assigned to
* us
- * \param IeDot11sConfiguration is mesh configuration element
+ * \param IeConfiguration is mesh configuration element
* taken from the peer management frame
- * \param IeDot11sPeerManagement is peer link management element
+ * \param IePeerManagement is peer link management element
*/
void ReceivePeerLinkFrame(
uint32_t interface,
Mac48Address peerAddress,
uint16_t aid,
- IeDot11sPeerManagement peerManagementElement,
- IeDot11sConfiguration meshConfig
+ IePeerManagement peerManagementElement,
+ IeConfiguration meshConfig
);
/**
* Cancell peer link due to broken configuration (SSID or Supported
@@ -117,23 +115,29 @@
* \}
*/
private:
- /**
- * All private structures:
- * * peer link descriptors;
- * * information about received beacons
- * * pointers to proper plugins
- * \{
- */
+ ///\name Private structures
+ ///\{
+ ///\brief keeps information about beacon of peer station:
+ /// beacon interval, association ID, last time we have received a
+ /// beacon
struct BeaconInfo
{
uint16_t aid; //Assoc ID
Time referenceTbtt; //When one of my station's beacons was put into a beacon queue;
Time beaconInterval; //Beacon interval of my station;
};
+ /// We keep a vector of pointers to PeerLink class. This vector
+ /// keeps all peer links at a given interface.
typedef std::vector<Ptr<PeerLink> > PeerLinksOnInterface;
+ /// This map keeps all peer links.
+ ///\param uint32_t is interface ID
typedef std::map<uint32_t, PeerLinksOnInterface> PeerLinksMap;
+ ///\brief This map keeps relationship between peer address and its
+ /// beacon information
typedef std::map<Mac48Address, BeaconInfo> BeaconsOnInterface;
+ ///\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;
///\}
private:
--- a/src/devices/mesh/mesh-wifi-interface-mac.cc Tue Mar 24 20:08:53 2009 +0300
+++ b/src/devices/mesh/mesh-wifi-interface-mac.cc Wed Mar 25 12:23:12 2009 +0300
@@ -533,5 +533,3 @@
} // namespace ns3
-
-