Rstructured file names: IeDot11s* no is Ie, because it is in namespace dot11s

This commit is contained in:
Kirill Andreev
2009-03-25 12:23:12 +03:00
parent a7aeceb937
commit 91a655467b
24 changed files with 285 additions and 284 deletions

View File

@@ -71,7 +71,7 @@ main (int argc, char *argv[])
"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.

View File

@@ -154,7 +154,7 @@ MeshWifiHelper::Install (const WifiPhyHelper &phyHelper, NodeContainer c) const
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);

View File

@@ -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 @@ IeDot11sBeaconTimingUnit::IeDot11sBeaconTimingUnit ():
}
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 @@ IeDot11sBeaconTiming::AddNeighboursTimingElementUnit (
&& ((*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 @@ IeDot11sBeaconTiming::AddNeighboursTimingElementUnit (
}
void
IeDot11sBeaconTiming::DelNeighboursTimingElementUnit (
IeBeaconTiming::DelNeighboursTimingElementUnit (
uint16_t aid,
Time last_beacon, //MicroSeconds!
Time beacon_interval //MicroSeconds!
@@ -129,7 +129,7 @@ IeDot11sBeaconTiming::DelNeighboursTimingElementUnit (
}
void
IeDot11sBeaconTiming::ClearTimingElement ()
IeBeaconTiming::ClearTimingElement ()
{
uint16_t to_delete = 0;
uint16_t i;
@@ -145,13 +145,13 @@ IeDot11sBeaconTiming::ClearTimingElement ()
}
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 @@ IeDot11sBeaconTiming::PrintInformation (std::ostream& os) const
}
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 @@ IeDot11sBeaconTiming::SerializeInformation (Buffer::Iterator i) const
}
}
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 @@ IeDot11sBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t le
};
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);
};

View File

@@ -33,10 +33,10 @@ namespace dot11s {
* \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 @@ public:
* \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:

View File

@@ -76,7 +76,7 @@ bool dot11sMeshCapability::Is (uint16_t cap, uint8_t n) const
return (cap & mask) == mask;
}
IeDot11sConfiguration::IeDot11sConfiguration ():
IeConfiguration::IeConfiguration ():
m_APSId (PROTOCOL_HWMP),
m_APSMId (METRIC_AIRTIME),
m_CCMId (CONGESTION_DEFAULT),
@@ -84,20 +84,20 @@ IeDot11sConfiguration::IeDot11sConfiguration ():
{}
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 @@ IeDot11sConfiguration::GetInformationSize () const
}
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 @@ IeDot11sConfiguration::SerializeInformation (Buffer::Iterator i) const
}
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 @@ IeDot11sConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t lengt
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;
}

View File

@@ -89,13 +89,13 @@ public:
* \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 ();

View File

@@ -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 @@ IeDot11sPeerManagement::IeDot11sPeerManagement ():
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 @@ IeDot11sPeerManagement::SetPeerClose (uint16_t localLinkId, uint16_t peerLinkId,
}
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 @@ IeDot11sPeerManagement::SetPeerConfirm (uint16_t localLinkId, uint16_t peerLinkI
}
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 @@ IeDot11sPeerManagement::SerializeInformation (Buffer::Iterator i) const
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 @@ IeDot11sPeerManagement::DeserializeInformation (Buffer::Iterator start, uint8_t
return i.GetDistanceFrom (start);
}
void
IeDot11sPeerManagement::PrintInformation (std::ostream& os) const
IePeerManagement::PrintInformation (std::ostream& os) const
{
//TODO
}

View File

@@ -32,10 +32,10 @@ namespace dot11s {
* \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,

View File

@@ -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 @@ IeDot11sPerr::SerializeInformation (Buffer::Iterator i) const
}
}
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 @@ IeDot11sPerr::DeserializeInformation (Buffer::Iterator start, uint8_t length)
}
uint8_t
IeDot11sPerr::GetInformationSize () const
IePerr::GetInformationSize () const
{
uint8_t retval =
1 //ModeFlags
@@ -97,7 +97,7 @@ IeDot11sPerr::GetInformationSize () const
}
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 @@ IeDot11sPerr::AddAddressUnit (FailedDestination unit)
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 @@ IeDot11sPerr::DeleteAddressUnit (Mac48Address address)
}
void
IeDot11sPerr::ResetPerr ()
IePerr::ResetPerr ()
{
m_numOfDest = 0;
m_addressUnits.clear ();

View File

@@ -32,11 +32,11 @@ namespace dot11s {
* \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

View File

@@ -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 @@ IeDot11sPrep::IeDot11sPrep ():
{
}
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 @@ IeDot11sPrep::SerializeInformation (Buffer::Iterator i) const
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 @@ IeDot11sPrep::DeserializeInformation (Buffer::Iterator start, uint8_t length)
return i.GetDistanceFrom (start);
}
uint8_t
IeDot11sPrep::GetInformationSize () const
IePrep::GetInformationSize () const
{
uint32_t retval =
1 //Flags
@@ -210,7 +210,7 @@ IeDot11sPrep::GetInformationSize () const
};
void
IeDot11sPrep::PrintInformation (std::ostream& os) const
IePrep::PrintInformation (std::ostream& os) const
{
//TODO
}

View File

@@ -33,11 +33,11 @@ namespace dot11s {
* \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;

View File

@@ -81,32 +81,32 @@ DestinationAddressUnit::GetDestinationAddress () const
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 @@ IeDot11sPreq::IeDot11sPreq ():
{
}
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 @@ IeDot11sPreq::SerializeInformation (Buffer::Iterator i) const
}
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 @@ IeDot11sPreq::DeserializeInformation (Buffer::Iterator start, uint8_t length)
return i.GetDistanceFrom (start);
}
uint8_t
IeDot11sPreq::GetInformationSize () const
IePreq::GetInformationSize () const
{
uint8_t retval =
1 //Flags
@@ -334,17 +334,17 @@ IeDot11sPreq::GetInformationSize () const
}
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 @@ IeDot11sPreq::AddDestinationAddressElement (
}
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 @@ IeDot11sPreq::DelDestinationAddressElement (Mac48Address dest_address)
}
void
IeDot11sPreq::ClearDestinationAddressElement ()
IePreq::ClearDestinationAddressElement ()
{
int i;
for (std::vector<Ptr<DestinationAddressUnit> >::iterator j = m_destinations.begin (); j != m_destinations.end(); j++)

View File

@@ -57,11 +57,11 @@ private:
* \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;

View File

@@ -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 @@ IeDot11sRann::IeDot11sRann ():
{
}
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 @@ IeDot11sRann::SerializeInformation (Buffer::Iterator i) const
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 @@ IeDot11sRann::DeserializeInformation (Buffer::Iterator start, uint8_t length)
return i.GetDistanceFrom (start);
}
uint8_t
IeDot11sRann::GetInformationSize () const
IeRann::GetInformationSize () const
{
uint8_t retval =
1 //Flags

View File

@@ -32,11 +32,11 @@ namespace dot11s {
* \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;

View File

@@ -26,7 +26,7 @@ NS_OBJECT_ENSURE_REGISTERED (PeerLinkFrameStart);
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 @@ uint32_t
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 @@ PeerLinkFrameStart::Serialize (Buffer::Iterator start) const
{
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 @@ uint32_t
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

View File

@@ -123,7 +123,7 @@ PeerLink::BeaconLoss ()
}
void
PeerLink::SetBeaconTimingElement (IeDot11sBeaconTiming beaconTiming)
PeerLink::SetBeaconTimingElement (IeBeaconTiming beaconTiming)
{
m_beaconTiming = beaconTiming;
}
@@ -152,7 +152,7 @@ PeerLink::GetBeaconInterval () const
return m_beaconInterval;
}
IeDot11sBeaconTiming
IeBeaconTiming
PeerLink::GetBeaconTimingElement () const
{
return m_beaconTiming;
@@ -195,7 +195,7 @@ void PeerLink::Close (uint16_t localLinkId, uint16_t peerLinkId, dot11sReasonCod
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 @@ void PeerLink::OpenAccept (uint16_t localLinkId, IeDot11sConfiguration conf)
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::OpenReject (uint16_t localLinkId, IeDot11sConfiguration conf,dot
}
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 @@ PeerLink::ConfirmAccept (uint16_t localLinkId, uint16_t peerLinkId, uint16_t pee
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::ClearHoldingTimer ()
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::SendPeerLinkOpen ()
void PeerLink::SendPeerLinkConfirm ()
{
IeDot11sPeerManagement peerElement;
IePeerManagement peerElement;
peerElement.SetPeerConfirm (m_localLinkId, m_peerLinkId);
m_macPlugin->SendPeerLinkManagementFrame (m_peerAddress, m_assocId, peerElement, m_configuration);
}

View File

@@ -39,6 +39,7 @@ namespace dot11s {
class PeerLink : public Object
{
public:
friend class PeerManagerProtocol;
/// Support object system
static TypeId GetTypeId();
/// C-tor create empty link
@@ -62,14 +63,14 @@ public:
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 @@ public:
/// Set callback
void MLMESetSignalStatusCallback (SignalStatusCallback);
//\}
private:
/**
* \name Link response to received management frames
*
@@ -104,21 +105,21 @@ public:
/// 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 @@ private:
/// 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

View File

@@ -54,7 +54,7 @@ PeerManagerMacPlugin::Receive (Ptr<Packet> const_packet, const WifiMacHeader & h
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 @@ PeerManagerMacPlugin::Receive (Ptr<Packet> const_packet, const WifiMacHeader & h
NS_LOG_DEBUG("Beacon timing:"<<beaconTiming);
meshBeacon = true;
}
m_protocol->ReceiveBeacon(
m_protocol->UpdatePeerBeaconTiming(
m_ifIndex,
meshBeacon,
beaconTiming,
@@ -107,22 +107,22 @@ PeerManagerMacPlugin::Receive (Ptr<Packet> const_packet, const WifiMacHeader & h
}
}
//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 @@ PeerManagerMacPlugin::UpdateOutcomingFrame (Ptr<Packet> packet, WifiMacHeader &
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:

View File

@@ -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 @@ public:
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;

View File

@@ -45,32 +45,25 @@ TypeId
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 @@ PeerManagerProtocol::~PeerManagerProtocol ()
}
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 @@ PeerManagerProtocol::AttachPorts(std::vector<Ptr<WifiNetDevice> > interfaces)
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 @@ PeerManagerProtocol::FillBeaconInfo(uint32_t interface, Mac48Address peerAddress
}
void
PeerManagerProtocol::ReceiveBeacon(
PeerManagerProtocol::UpdatePeerBeaconTiming(
uint32_t interface,
bool meshBeacon,
IeDot11sBeaconTiming timingElement,
IeBeaconTiming timingElement,
Mac48Address peerAddress,
Time receivingTime,
Time beaconInterval)
@@ -206,8 +199,8 @@ PeerManagerProtocol::ReceivePeerLinkFrame (
uint32_t interface,
Mac48Address peerAddress,
uint16_t aid,
IeDot11sPeerManagement peerManagementElement,
IeDot11sConfiguration meshConfig
IePeerManagement peerManagementElement,
IeConfiguration meshConfig
)
{
if (peerManagementElement.SubtypeIsOpen ())
@@ -400,10 +393,10 @@ PeerManagerProtocol::GetNextBeaconShift (
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 @@ PeerManagerProtocol::PeerLinkStatus (uint32_t interface, Mac48Address peerAddres
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

View File

@@ -45,21 +45,19 @@ public:
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 @@ public:
* \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 @@ public:
* \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 @@ public:
* \}
*/
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:

View File

@@ -533,5 +533,3 @@ MeshWifiInterfaceMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
} // namespace ns3