Class names restructured
This commit is contained in:
@@ -23,9 +23,9 @@
|
||||
#include "ns3/log.h"
|
||||
namespace ns3 {
|
||||
/*******************************************
|
||||
* WifiBeaconTimingElementUnit
|
||||
* IeDot11sBeaconTimingUnit
|
||||
*******************************************/
|
||||
WifiBeaconTimingElementUnit::WifiBeaconTimingElementUnit()
|
||||
IeDot11sBeaconTimingUnit::IeDot11sBeaconTimingUnit()
|
||||
{
|
||||
AID = 0;
|
||||
LastBeacon = 0;
|
||||
@@ -33,58 +33,58 @@ WifiBeaconTimingElementUnit::WifiBeaconTimingElementUnit()
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElementUnit::SetAID(uint8_t aid)
|
||||
IeDot11sBeaconTimingUnit::SetAID(uint8_t aid)
|
||||
{
|
||||
AID = aid;
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElementUnit::SetLastBeacon(uint16_t last_beacon)
|
||||
IeDot11sBeaconTimingUnit::SetLastBeacon(uint16_t last_beacon)
|
||||
{
|
||||
LastBeacon = last_beacon;
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElementUnit::SetBeaconInterval(uint16_t beacon_interval)
|
||||
IeDot11sBeaconTimingUnit::SetBeaconInterval(uint16_t beacon_interval)
|
||||
{
|
||||
BeaconInterval = beacon_interval;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
WifiBeaconTimingElementUnit::GetAID()
|
||||
IeDot11sBeaconTimingUnit::GetAID()
|
||||
{
|
||||
return AID;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
WifiBeaconTimingElementUnit::GetLastBeacon()
|
||||
IeDot11sBeaconTimingUnit::GetLastBeacon()
|
||||
{
|
||||
return LastBeacon;
|
||||
}
|
||||
|
||||
uint16_t
|
||||
WifiBeaconTimingElementUnit::GetBeaconInterval()
|
||||
IeDot11sBeaconTimingUnit::GetBeaconInterval()
|
||||
{
|
||||
return BeaconInterval;
|
||||
}
|
||||
|
||||
/*******************************************
|
||||
* WifiBeaconTimingElement
|
||||
* IeDot11sBeaconTiming
|
||||
*******************************************/
|
||||
WifiBeaconTimingElement::WifiBeaconTimingElement()
|
||||
IeDot11sBeaconTiming::IeDot11sBeaconTiming()
|
||||
{
|
||||
m_maxSize = DEFAULT_MAX_SIZE;
|
||||
m_numOfUnits = 0;
|
||||
}
|
||||
|
||||
WifiBeaconTimingElement::NeighboursTimingUnitsList
|
||||
WifiBeaconTimingElement::GetNeighboursTimingElementsList()
|
||||
IeDot11sBeaconTiming::NeighboursTimingUnitsList
|
||||
IeDot11sBeaconTiming::GetNeighboursTimingElementsList()
|
||||
{
|
||||
return m_neighbours;
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElement::AddNeighboursTimingElementUnit(
|
||||
IeDot11sBeaconTiming::AddNeighboursTimingElementUnit(
|
||||
uint16_t aid,
|
||||
Time last_beacon, //MicroSeconds!
|
||||
Time beacon_interval //MicroSeconds!
|
||||
@@ -100,7 +100,7 @@ WifiBeaconTimingElement::AddNeighboursTimingElementUnit(
|
||||
&& ((*i)->GetBeaconInterval() == BeaconIntervalToU16(beacon_interval))
|
||||
)
|
||||
return;
|
||||
Ptr<WifiBeaconTimingElementUnit>new_element = Create<WifiBeaconTimingElementUnit>();
|
||||
Ptr<IeDot11sBeaconTimingUnit>new_element = Create<IeDot11sBeaconTimingUnit>();
|
||||
new_element->SetAID(AidToU8(aid));
|
||||
new_element->SetLastBeacon(TimestampToU16(last_beacon));
|
||||
new_element->SetBeaconInterval(BeaconIntervalToU16(beacon_interval));
|
||||
@@ -109,7 +109,7 @@ WifiBeaconTimingElement::AddNeighboursTimingElementUnit(
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElement::DelNeighboursTimingElementUnit(
|
||||
IeDot11sBeaconTiming::DelNeighboursTimingElementUnit(
|
||||
uint16_t aid,
|
||||
Time last_beacon, //MicroSeconds!
|
||||
Time beacon_interval //MicroSeconds!
|
||||
@@ -130,7 +130,7 @@ WifiBeaconTimingElement::DelNeighboursTimingElementUnit(
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElement::ClearTimingElement()
|
||||
IeDot11sBeaconTiming::ClearTimingElement()
|
||||
{
|
||||
uint16_t to_delete = 0;
|
||||
uint16_t i;
|
||||
@@ -146,19 +146,19 @@ WifiBeaconTimingElement::ClearTimingElement()
|
||||
}
|
||||
|
||||
uint16_t
|
||||
WifiBeaconTimingElement::GetInformationSize () const
|
||||
IeDot11sBeaconTiming::GetInformationSize () const
|
||||
{
|
||||
return (5*m_numOfUnits);
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElement::PrintInformation(std::ostream& os) const
|
||||
IeDot11sBeaconTiming::PrintInformation(std::ostream& os) const
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
void
|
||||
WifiBeaconTimingElement::SerializeInformation (Buffer::Iterator i) const
|
||||
IeDot11sBeaconTiming::SerializeInformation (Buffer::Iterator i) const
|
||||
{
|
||||
for (NeighboursTimingUnitsList::const_iterator j = m_neighbours.begin(); j!= m_neighbours.end(); j++)
|
||||
{
|
||||
@@ -168,13 +168,13 @@ WifiBeaconTimingElement::SerializeInformation (Buffer::Iterator i) const
|
||||
}
|
||||
}
|
||||
uint16_t
|
||||
WifiBeaconTimingElement::DeserializeInformation (Buffer::Iterator start, uint8_t length)
|
||||
IeDot11sBeaconTiming::DeserializeInformation (Buffer::Iterator start, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
m_numOfUnits = length/5;
|
||||
for (int j = 0; j < m_numOfUnits; j ++)
|
||||
{
|
||||
Ptr<WifiBeaconTimingElementUnit> new_element = Create<WifiBeaconTimingElementUnit>();
|
||||
Ptr<IeDot11sBeaconTimingUnit> new_element = Create<IeDot11sBeaconTimingUnit>();
|
||||
new_element->SetAID(i.ReadU8());
|
||||
new_element->SetLastBeacon(i.ReadNtohU16());
|
||||
new_element->SetBeaconInterval(i.ReadNtohU16());
|
||||
@@ -184,19 +184,19 @@ WifiBeaconTimingElement::DeserializeInformation (Buffer::Iterator start, uint8_t
|
||||
};
|
||||
|
||||
uint16_t
|
||||
WifiBeaconTimingElement::TimestampToU16(Time x)
|
||||
IeDot11sBeaconTiming::TimestampToU16(Time x)
|
||||
{
|
||||
return ((uint16_t)((x.GetMicroSeconds() >> 8)&0xffff));
|
||||
};
|
||||
|
||||
uint16_t
|
||||
WifiBeaconTimingElement::BeaconIntervalToU16(Time x)
|
||||
IeDot11sBeaconTiming::BeaconIntervalToU16(Time x)
|
||||
{
|
||||
return ((uint16_t)(x.GetMicroSeconds() >>10)&0xffff);
|
||||
};
|
||||
|
||||
uint8_t
|
||||
WifiBeaconTimingElement::AidToU8(uint16_t x)
|
||||
IeDot11sBeaconTiming::AidToU8(uint16_t x)
|
||||
{
|
||||
return (uint8_t)(x&0xff);
|
||||
};
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace ns3 {
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiBeaconTimingElementUnit : public RefCountBase
|
||||
class IeDot11sBeaconTimingUnit : public RefCountBase
|
||||
{
|
||||
public:
|
||||
WifiBeaconTimingElementUnit();
|
||||
IeDot11sBeaconTimingUnit();
|
||||
void SetAID(uint8_t aid);
|
||||
void SetLastBeacon(uint16_t last_beacon);
|
||||
void SetBeaconInterval(uint16_t beacon_interval);
|
||||
@@ -56,16 +56,16 @@ private:
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiBeaconTimingElement : public WifiInformationElement
|
||||
class IeDot11sBeaconTiming : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* \ingroup mesh
|
||||
* This type is a list of timing elements obtained from neigbours with their beacons:
|
||||
*/
|
||||
typedef std::list< Ptr<WifiBeaconTimingElementUnit> > NeighboursTimingUnitsList;
|
||||
typedef std::list< Ptr<IeDot11sBeaconTimingUnit> > NeighboursTimingUnitsList;
|
||||
|
||||
WifiBeaconTimingElement();
|
||||
IeDot11sBeaconTiming();
|
||||
//This methods are needed for beacon collision
|
||||
//avoidance module:
|
||||
NeighboursTimingUnitsList GetNeighboursTimingElementsList();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "ns3/ie-dot11s-configuration.h"
|
||||
#include "ns3/assert.h"
|
||||
|
||||
//NS_LOG_COMPONENT_DEFINE ("MeshConfigurationElement");
|
||||
//NS_LOG_COMPONENT_DEFINE ("IeDot11sConfiguration");
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
@@ -78,7 +78,7 @@ bool dot11sMeshCapability::Is(uint16_t cap, uint8_t n) const
|
||||
return (cap & mask) == mask;
|
||||
}
|
||||
|
||||
MeshConfigurationElement::MeshConfigurationElement ():
|
||||
IeDot11sConfiguration::IeDot11sConfiguration ():
|
||||
m_APSId(PROTOCOL_HWMP),
|
||||
m_APSMId(METRIC_AIRTIME),
|
||||
m_CCMId(CONGESTION_DEFAULT),
|
||||
@@ -86,20 +86,20 @@ MeshConfigurationElement::MeshConfigurationElement ():
|
||||
{}
|
||||
|
||||
TypeId
|
||||
MeshConfigurationElement::GetTypeId ()
|
||||
IeDot11sConfiguration::GetTypeId ()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::MeshConfigurationElement")
|
||||
static TypeId tid = TypeId ("ns3::IeDot11sConfiguration")
|
||||
.SetParent<WifiInformationElement> ();
|
||||
return tid;
|
||||
}
|
||||
|
||||
TypeId
|
||||
MeshConfigurationElement::GetInstanceTypeId () const
|
||||
IeDot11sConfiguration::GetInstanceTypeId () const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
uint16_t
|
||||
MeshConfigurationElement::GetInformationSize () const
|
||||
IeDot11sConfiguration::GetInformationSize () const
|
||||
{
|
||||
return 1 // Version
|
||||
+ 4 // APSPId
|
||||
@@ -110,7 +110,7 @@ MeshConfigurationElement::GetInformationSize () const
|
||||
}
|
||||
|
||||
void
|
||||
MeshConfigurationElement::SerializeInformation (Buffer::Iterator i) const
|
||||
IeDot11sConfiguration::SerializeInformation (Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (1); //Version
|
||||
// Active Path Selection Protocol ID:
|
||||
@@ -125,7 +125,7 @@ MeshConfigurationElement::SerializeInformation (Buffer::Iterator i) const
|
||||
}
|
||||
|
||||
uint16_t
|
||||
MeshConfigurationElement::DeserializeInformation (Buffer::Iterator i, uint8_t length)
|
||||
IeDot11sConfiguration::DeserializeInformation (Buffer::Iterator i, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator start = i;
|
||||
uint8_t version;
|
||||
@@ -142,35 +142,35 @@ MeshConfigurationElement::DeserializeInformation (Buffer::Iterator i, uint8_t le
|
||||
return i.GetDistanceFrom(start);
|
||||
}
|
||||
void
|
||||
MeshConfigurationElement::PrintInformation(std::ostream& os) const
|
||||
IeDot11sConfiguration::PrintInformation(std::ostream& os) const
|
||||
{
|
||||
//TODO: print
|
||||
}
|
||||
void
|
||||
MeshConfigurationElement::SetRouting(dot11sPathSelectionProtocol routingId)
|
||||
IeDot11sConfiguration::SetRouting(dot11sPathSelectionProtocol routingId)
|
||||
{
|
||||
m_APSId = routingId;
|
||||
}
|
||||
|
||||
void
|
||||
MeshConfigurationElement::SetMetric(dot11sPathSelectionMetric metricId)
|
||||
IeDot11sConfiguration::SetMetric(dot11sPathSelectionMetric metricId)
|
||||
{
|
||||
m_APSMId = metricId;
|
||||
}
|
||||
|
||||
bool
|
||||
MeshConfigurationElement::IsHWMP()
|
||||
IeDot11sConfiguration::IsHWMP()
|
||||
{
|
||||
return (m_APSId == PROTOCOL_HWMP);
|
||||
}
|
||||
|
||||
bool
|
||||
MeshConfigurationElement::IsAirtime()
|
||||
IeDot11sConfiguration::IsAirtime()
|
||||
{
|
||||
return (m_APSMId == METRIC_AIRTIME);
|
||||
}
|
||||
|
||||
dot11sMeshCapability const& MeshConfigurationElement::MeshCapability()
|
||||
dot11sMeshCapability const& IeDot11sConfiguration::MeshCapability()
|
||||
{
|
||||
return m_meshCap;
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ private:
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class MeshConfigurationElement : public WifiInformationElement
|
||||
class IeDot11sConfiguration : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
static TypeId GetTypeId ();
|
||||
TypeId GetInstanceTypeId () const;
|
||||
|
||||
MeshConfigurationElement();
|
||||
IeDot11sConfiguration();
|
||||
void SetRouting(dot11sPathSelectionProtocol routingId);
|
||||
void SetMetric(dot11sPathSelectionMetric metricId);
|
||||
bool IsHWMP();
|
||||
|
||||
@@ -23,38 +23,38 @@
|
||||
#include "ns3/address-utils.h"
|
||||
|
||||
namespace ns3 {
|
||||
WifiPerrInformationElement::~WifiPerrInformationElement()
|
||||
IeDot11sPerr::~IeDot11sPerr()
|
||||
{
|
||||
}
|
||||
|
||||
TypeId
|
||||
WifiPerrInformationElement::GetTypeId()
|
||||
IeDot11sPerr::GetTypeId()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::WifiPerrInformationElement")
|
||||
static TypeId tid = TypeId ("ns3::IeDot11sPerr")
|
||||
.SetParent<Object> ();
|
||||
return tid;
|
||||
}
|
||||
void
|
||||
WifiPerrInformationElement::PrintInformation(std::ostream &os) const
|
||||
IeDot11sPerr::PrintInformation(std::ostream &os) const
|
||||
{
|
||||
// FILL
|
||||
}
|
||||
TypeId
|
||||
WifiPerrInformationElement::GetInstanceTypeId() const
|
||||
IeDot11sPerr::GetInstanceTypeId() const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
WifiPerrInformationElement::WifiPerrInformationElement():
|
||||
IeDot11sPerr::IeDot11sPerr():
|
||||
m_numOfDest(0)
|
||||
{
|
||||
}
|
||||
uint8_t
|
||||
WifiPerrInformationElement::GetNumOfDest()
|
||||
IeDot11sPerr::GetNumOfDest()
|
||||
{
|
||||
return m_numOfDest;
|
||||
}
|
||||
void
|
||||
WifiPerrInformationElement::SerializeInformation(Buffer::Iterator i)const
|
||||
IeDot11sPerr::SerializeInformation(Buffer::Iterator i)const
|
||||
{
|
||||
i.WriteU8 (0);
|
||||
i.WriteU8 (m_numOfDest);
|
||||
@@ -66,7 +66,7 @@ WifiPerrInformationElement::SerializeInformation(Buffer::Iterator i)const
|
||||
}
|
||||
}
|
||||
uint16_t
|
||||
WifiPerrInformationElement::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
IeDot11sPerr::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
i.Next (1); //Mode flags is not used now
|
||||
@@ -84,7 +84,7 @@ WifiPerrInformationElement::DeserializeInformation(Buffer::Iterator start, uint8
|
||||
}
|
||||
|
||||
uint16_t
|
||||
WifiPerrInformationElement::GetInformationSize() const
|
||||
IeDot11sPerr::GetInformationSize() const
|
||||
{
|
||||
uint16_t retval =
|
||||
1 //ModeFlags
|
||||
@@ -95,7 +95,7 @@ WifiPerrInformationElement::GetInformationSize() const
|
||||
}
|
||||
|
||||
void
|
||||
WifiPerrInformationElement::AddAddressUnit(HwmpRtable::FailedDestination unit)
|
||||
IeDot11sPerr::AddAddressUnit(HwmpRtable::FailedDestination unit)
|
||||
{
|
||||
for (unsigned int i = 0; i < m_addressUnits.size(); i ++)
|
||||
if (m_addressUnits[i].destination == unit.destination)
|
||||
@@ -105,12 +105,12 @@ WifiPerrInformationElement::AddAddressUnit(HwmpRtable::FailedDestination unit)
|
||||
}
|
||||
|
||||
std::vector<HwmpRtable::FailedDestination>
|
||||
WifiPerrInformationElement::GetAddressUnitVector()
|
||||
IeDot11sPerr::GetAddressUnitVector()
|
||||
{
|
||||
return m_addressUnits;
|
||||
}
|
||||
void
|
||||
WifiPerrInformationElement::DeleteAddressUnit(Mac48Address address)
|
||||
IeDot11sPerr::DeleteAddressUnit(Mac48Address address)
|
||||
{
|
||||
for (std::vector<HwmpRtable::FailedDestination>::iterator i = m_addressUnits.begin(); i != m_addressUnits.end(); i ++)
|
||||
if ((*i).destination == address)
|
||||
@@ -122,7 +122,7 @@ WifiPerrInformationElement::DeleteAddressUnit(Mac48Address address)
|
||||
}
|
||||
|
||||
void
|
||||
WifiPerrInformationElement::ResetPerr()
|
||||
IeDot11sPerr::ResetPerr()
|
||||
{
|
||||
m_numOfDest = 0;
|
||||
m_addressUnits.clear();
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace ns3 {
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiPerrInformationElement : public WifiInformationElement
|
||||
class IeDot11sPerr : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
WifiPerrInformationElement();
|
||||
~WifiPerrInformationElement();
|
||||
IeDot11sPerr();
|
||||
~IeDot11sPerr();
|
||||
static TypeId GetTypeId();
|
||||
virtual TypeId GetInstanceTypeId() const;
|
||||
#if 0
|
||||
|
||||
@@ -24,30 +24,30 @@
|
||||
#include "ns3/assert.h"
|
||||
namespace ns3 {
|
||||
/********************************
|
||||
* WifiPrepInformationElement
|
||||
* IeDot11sPrep
|
||||
*******************************/
|
||||
WifiPrepInformationElement::~WifiPrepInformationElement()
|
||||
IeDot11sPrep::~IeDot11sPrep()
|
||||
{
|
||||
}
|
||||
|
||||
TypeId
|
||||
WifiPrepInformationElement::GetTypeId()
|
||||
IeDot11sPrep::GetTypeId()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::WifiPrepInformationElement")
|
||||
static TypeId tid = TypeId ("ns3::IeDot11sPrep")
|
||||
.SetParent<Object> ();
|
||||
return tid;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::Print(std::ostream &os) const
|
||||
IeDot11sPrep::Print(std::ostream &os) const
|
||||
{
|
||||
//TODO:fill this method
|
||||
}
|
||||
TypeId
|
||||
WifiPrepInformationElement::GetInstanceTypeId() const
|
||||
IeDot11sPrep::GetInstanceTypeId() const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
WifiPrepInformationElement::WifiPrepInformationElement():
|
||||
IeDot11sPrep::IeDot11sPrep():
|
||||
m_flags(0),
|
||||
m_hopcount(0),
|
||||
m_ttl(0),
|
||||
@@ -60,110 +60,110 @@ WifiPrepInformationElement::WifiPrepInformationElement():
|
||||
{
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetFlags(uint8_t flags)
|
||||
IeDot11sPrep::SetFlags(uint8_t flags)
|
||||
{
|
||||
m_flags = flags;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetHopcount(uint8_t hopcount)
|
||||
IeDot11sPrep::SetHopcount(uint8_t hopcount)
|
||||
{
|
||||
m_hopcount = hopcount;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetTTL(uint8_t ttl)
|
||||
IeDot11sPrep::SetTTL(uint8_t ttl)
|
||||
{
|
||||
m_ttl = ttl;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetDestinationSeqNumber(uint32_t dest_seq_number)
|
||||
IeDot11sPrep::SetDestinationSeqNumber(uint32_t dest_seq_number)
|
||||
{
|
||||
m_destSeqNumber = dest_seq_number;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetDestinationAddress(Mac48Address dest_address)
|
||||
IeDot11sPrep::SetDestinationAddress(Mac48Address dest_address)
|
||||
{
|
||||
m_destinationAddress = dest_address;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetMetric(uint32_t metric)
|
||||
IeDot11sPrep::SetMetric(uint32_t metric)
|
||||
{
|
||||
m_metric = metric;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetOriginatorAddress(Mac48Address originator_address)
|
||||
IeDot11sPrep::SetOriginatorAddress(Mac48Address originator_address)
|
||||
{
|
||||
m_originatorAddress = originator_address;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetOriginatorSeqNumber(uint32_t originator_seq_number)
|
||||
IeDot11sPrep::SetOriginatorSeqNumber(uint32_t originator_seq_number)
|
||||
{
|
||||
m_originatorSeqNumber = originator_seq_number;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::SetLifetime(uint32_t lifetime)
|
||||
IeDot11sPrep::SetLifetime(uint32_t lifetime)
|
||||
{
|
||||
m_lifetime = lifetime;
|
||||
}
|
||||
uint8_t
|
||||
WifiPrepInformationElement::GetFlags() const
|
||||
IeDot11sPrep::GetFlags() const
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
uint8_t
|
||||
WifiPrepInformationElement::GetHopcount() const
|
||||
IeDot11sPrep::GetHopcount() const
|
||||
{
|
||||
return m_hopcount;
|
||||
}
|
||||
uint32_t
|
||||
WifiPrepInformationElement::GetTTL() const
|
||||
IeDot11sPrep::GetTTL() const
|
||||
{
|
||||
return m_ttl;
|
||||
}
|
||||
uint32_t
|
||||
WifiPrepInformationElement::GetDestinationSeqNumber() const
|
||||
IeDot11sPrep::GetDestinationSeqNumber() const
|
||||
{
|
||||
return m_destSeqNumber;
|
||||
}
|
||||
Mac48Address
|
||||
WifiPrepInformationElement::GetDestinationAddress() const
|
||||
IeDot11sPrep::GetDestinationAddress() const
|
||||
{
|
||||
return m_destinationAddress;
|
||||
}
|
||||
uint32_t
|
||||
WifiPrepInformationElement::GetMetric() const
|
||||
IeDot11sPrep::GetMetric() const
|
||||
{
|
||||
return m_metric;
|
||||
}
|
||||
Mac48Address
|
||||
WifiPrepInformationElement::GetOriginatorAddress() const
|
||||
IeDot11sPrep::GetOriginatorAddress() const
|
||||
{
|
||||
return m_originatorAddress;
|
||||
}
|
||||
uint32_t
|
||||
WifiPrepInformationElement::GetOriginatorSeqNumber() const
|
||||
IeDot11sPrep::GetOriginatorSeqNumber() const
|
||||
{
|
||||
return m_originatorSeqNumber;
|
||||
}
|
||||
uint32_t
|
||||
WifiPrepInformationElement::GetLifetime() const
|
||||
IeDot11sPrep::GetLifetime() const
|
||||
{
|
||||
return m_lifetime;
|
||||
}
|
||||
void
|
||||
WifiPrepInformationElement::DecrementTtl()
|
||||
IeDot11sPrep::DecrementTtl()
|
||||
{
|
||||
m_ttl --;
|
||||
}
|
||||
|
||||
void
|
||||
WifiPrepInformationElement::IncrementMetric(uint32_t metric)
|
||||
IeDot11sPrep::IncrementMetric(uint32_t metric)
|
||||
{
|
||||
m_metric +=metric;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WifiPrepInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
IeDot11sPrep::SerializeInformation(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (m_flags);
|
||||
i.WriteU8 (m_hopcount);
|
||||
@@ -176,7 +176,7 @@ WifiPrepInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
i.WriteHtonU32 (m_originatorSeqNumber);
|
||||
}
|
||||
uint16_t
|
||||
WifiPrepInformationElement::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
IeDot11sPrep::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
m_flags = i.ReadU8();
|
||||
@@ -191,7 +191,7 @@ WifiPrepInformationElement::DeserializeInformation(Buffer::Iterator start, uint8
|
||||
return i.GetDistanceFrom(start);
|
||||
}
|
||||
uint16_t
|
||||
WifiPrepInformationElement::GetInformationSize() const
|
||||
IeDot11sPrep::GetInformationSize() const
|
||||
{
|
||||
uint32_t retval =
|
||||
1 //Element ID
|
||||
@@ -211,7 +211,7 @@ WifiPrepInformationElement::GetInformationSize() const
|
||||
};
|
||||
|
||||
void
|
||||
WifiPrepInformationElement::PrintInformation(std::ostream& os) const
|
||||
IeDot11sPrep::PrintInformation(std::ostream& os) const
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace ns3 {
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiPrepInformationElement : public WifiInformationElement
|
||||
class IeDot11sPrep : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
WifiPrepInformationElement();
|
||||
~WifiPrepInformationElement();
|
||||
IeDot11sPrep();
|
||||
~IeDot11sPrep();
|
||||
static TypeId GetTypeId();
|
||||
virtual TypeId GetInstanceTypeId() const;
|
||||
virtual void Print(std::ostream &os) const;
|
||||
|
||||
@@ -79,32 +79,32 @@ DestinationAddressUnit::GetDestinationAddress() const
|
||||
return m_destinationAddress;
|
||||
}
|
||||
/********************************
|
||||
* WifiPreqInformationElement
|
||||
* IeDot11sPreq
|
||||
*******************************/
|
||||
WifiPreqInformationElement::~WifiPreqInformationElement()
|
||||
IeDot11sPreq::~IeDot11sPreq()
|
||||
{
|
||||
}
|
||||
|
||||
TypeId
|
||||
WifiPreqInformationElement::GetTypeId()
|
||||
IeDot11sPreq::GetTypeId()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::WifiPreqInformationElement")
|
||||
static TypeId tid = TypeId ("ns3::IeDot11sPreq")
|
||||
.SetParent<Object> ();
|
||||
return tid;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::Print(std::ostream &os) const
|
||||
IeDot11sPreq::Print(std::ostream &os) const
|
||||
{
|
||||
//TODO:fill this method
|
||||
}
|
||||
|
||||
TypeId
|
||||
WifiPreqInformationElement::GetInstanceTypeId() const
|
||||
IeDot11sPreq::GetInstanceTypeId() const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
|
||||
WifiPreqInformationElement::WifiPreqInformationElement():
|
||||
IeDot11sPreq::IeDot11sPreq():
|
||||
m_maxSize(32),
|
||||
m_flags(0),
|
||||
m_hopCount(0),
|
||||
@@ -118,136 +118,136 @@ WifiPreqInformationElement::WifiPreqInformationElement():
|
||||
{
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetUnicastPreq()
|
||||
IeDot11sPreq::SetUnicastPreq()
|
||||
{
|
||||
m_flags |= 1<<1;
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::SetNeedNotPrep()
|
||||
IeDot11sPreq::SetNeedNotPrep()
|
||||
{
|
||||
m_flags |= 1<<2;
|
||||
}
|
||||
//void
|
||||
//WifiPreqInformationElement::SetFlags(uint8_t flags)
|
||||
//IeDot11sPreq::SetFlags(uint8_t flags)
|
||||
//{
|
||||
// m_flags = flags;
|
||||
//}
|
||||
void
|
||||
WifiPreqInformationElement::SetHopcount(uint8_t hopcount)
|
||||
IeDot11sPreq::SetHopcount(uint8_t hopcount)
|
||||
{
|
||||
m_hopCount = hopcount;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetTTL(uint8_t ttl)
|
||||
IeDot11sPreq::SetTTL(uint8_t ttl)
|
||||
{
|
||||
m_ttl = ttl;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetPreqID(uint32_t preq_id)
|
||||
IeDot11sPreq::SetPreqID(uint32_t preq_id)
|
||||
{
|
||||
m_preqId = preq_id;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetMetric(uint32_t metric)
|
||||
IeDot11sPreq::SetMetric(uint32_t metric)
|
||||
{
|
||||
m_metric = metric;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetOriginatorAddress(Mac48Address originator_address)
|
||||
IeDot11sPreq::SetOriginatorAddress(Mac48Address originator_address)
|
||||
{
|
||||
m_originatorAddress = originator_address;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetOriginatorSeqNumber(uint32_t originator_seq_number)
|
||||
IeDot11sPreq::SetOriginatorSeqNumber(uint32_t originator_seq_number)
|
||||
{
|
||||
m_originatorSeqNumber = originator_seq_number;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetLifetime(uint32_t lifetime)
|
||||
IeDot11sPreq::SetLifetime(uint32_t lifetime)
|
||||
{
|
||||
m_lifetime = lifetime;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::SetDestCount(uint8_t dest_count)
|
||||
IeDot11sPreq::SetDestCount(uint8_t dest_count)
|
||||
{
|
||||
m_destCount = dest_count;
|
||||
}
|
||||
|
||||
//uint8_t
|
||||
//WifiPreqInformationElement::GetFlags() const
|
||||
//IeDot11sPreq::GetFlags() const
|
||||
//{
|
||||
// return m_flags;
|
||||
//}
|
||||
bool
|
||||
WifiPreqInformationElement::IsUnicastPreq() const
|
||||
IeDot11sPreq::IsUnicastPreq() const
|
||||
{
|
||||
return (m_flags & (1<<1));
|
||||
}
|
||||
|
||||
bool
|
||||
WifiPreqInformationElement::IsNeedNotPrep() const
|
||||
IeDot11sPreq::IsNeedNotPrep() const
|
||||
{
|
||||
return (m_flags & (1<<2));
|
||||
}
|
||||
|
||||
uint8_t
|
||||
WifiPreqInformationElement::GetHopCount() const
|
||||
IeDot11sPreq::GetHopCount() const
|
||||
{
|
||||
return m_hopCount;
|
||||
}
|
||||
uint8_t
|
||||
WifiPreqInformationElement::GetTtl() const
|
||||
IeDot11sPreq::GetTtl() const
|
||||
{
|
||||
return m_ttl;
|
||||
}
|
||||
uint32_t
|
||||
WifiPreqInformationElement::GetPreqID() const
|
||||
IeDot11sPreq::GetPreqID() const
|
||||
{
|
||||
return m_preqId;
|
||||
}
|
||||
uint32_t
|
||||
WifiPreqInformationElement::GetMetric() const
|
||||
IeDot11sPreq::GetMetric() const
|
||||
{
|
||||
return m_metric;
|
||||
}
|
||||
Mac48Address
|
||||
WifiPreqInformationElement::GetOriginatorAddress() const
|
||||
IeDot11sPreq::GetOriginatorAddress() const
|
||||
{
|
||||
return m_originatorAddress;
|
||||
}
|
||||
uint32_t
|
||||
WifiPreqInformationElement::GetOriginatorSeqNumber() const
|
||||
IeDot11sPreq::GetOriginatorSeqNumber() const
|
||||
{
|
||||
return m_originatorSeqNumber;
|
||||
}
|
||||
uint32_t
|
||||
WifiPreqInformationElement::GetLifetime() const
|
||||
IeDot11sPreq::GetLifetime() const
|
||||
{
|
||||
return m_lifetime;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
WifiPreqInformationElement::GetDestCount() const
|
||||
IeDot11sPreq::GetDestCount() const
|
||||
{
|
||||
return m_destCount;
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::DecrementTtl()
|
||||
IeDot11sPreq::DecrementTtl()
|
||||
{
|
||||
m_ttl --;
|
||||
m_hopCount ++;
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::IncrementMetric(uint32_t metric)
|
||||
IeDot11sPreq::IncrementMetric(uint32_t metric)
|
||||
{
|
||||
m_metric +=metric;
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
IeDot11sPreq::SerializeInformation(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (m_flags);
|
||||
i.WriteU8 (m_hopCount);
|
||||
@@ -276,7 +276,7 @@ WifiPreqInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
}
|
||||
|
||||
uint16_t
|
||||
WifiPreqInformationElement::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
IeDot11sPreq::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
m_flags = i.ReadU8 ();
|
||||
@@ -312,7 +312,7 @@ WifiPreqInformationElement::DeserializeInformation(Buffer::Iterator start, uint8
|
||||
return i.GetDistanceFrom(start);
|
||||
}
|
||||
uint16_t
|
||||
WifiPreqInformationElement::GetInformationSize() const
|
||||
IeDot11sPreq::GetInformationSize() const
|
||||
{
|
||||
uint32_t retval =
|
||||
1 //Flags
|
||||
@@ -332,17 +332,17 @@ WifiPreqInformationElement::GetInformationSize() const
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::PrintInformation(std::ostream& os) const
|
||||
IeDot11sPreq::PrintInformation(std::ostream& os) const
|
||||
{
|
||||
//TODO
|
||||
}
|
||||
std::vector<Ptr<DestinationAddressUnit> >
|
||||
WifiPreqInformationElement::GetDestinationList()
|
||||
IeDot11sPreq::GetDestinationList()
|
||||
{
|
||||
return m_destinations;
|
||||
}
|
||||
void
|
||||
WifiPreqInformationElement::AddDestinationAddressElement(
|
||||
IeDot11sPreq::AddDestinationAddressElement(
|
||||
bool doFlag, bool rfFlag,
|
||||
Mac48Address dest_address,
|
||||
uint32_t dest_seq_number
|
||||
@@ -360,7 +360,7 @@ WifiPreqInformationElement::AddDestinationAddressElement(
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::DelDestinationAddressElement(Mac48Address dest_address)
|
||||
IeDot11sPreq::DelDestinationAddressElement(Mac48Address dest_address)
|
||||
{
|
||||
for (std::vector<Ptr<DestinationAddressUnit> >::iterator i = m_destinations.begin(); i!=m_destinations.end(); i++)
|
||||
if ((*i)->GetDestinationAddress() == dest_address)
|
||||
@@ -372,7 +372,7 @@ WifiPreqInformationElement::DelDestinationAddressElement(Mac48Address dest_addre
|
||||
}
|
||||
|
||||
void
|
||||
WifiPreqInformationElement::ClearDestinationAddressElement()
|
||||
IeDot11sPreq::ClearDestinationAddressElement()
|
||||
{
|
||||
int i;
|
||||
for (std::vector<Ptr<DestinationAddressUnit> >::iterator j = m_destinations.begin(); j!= m_destinations.end(); j++)
|
||||
|
||||
@@ -58,11 +58,11 @@ private:
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiPreqInformationElement : public WifiInformationElement
|
||||
class IeDot11sPreq : public WifiInformationElement
|
||||
{
|
||||
public:
|
||||
WifiPreqInformationElement();
|
||||
~WifiPreqInformationElement ();
|
||||
IeDot11sPreq();
|
||||
~IeDot11sPreq ();
|
||||
static TypeId GetTypeId ();
|
||||
virtual TypeId GetInstanceTypeId() const;
|
||||
virtual void Print(std::ostream &os) const;
|
||||
|
||||
@@ -25,26 +25,26 @@
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
WifiRannInformationElement::~WifiRannInformationElement()
|
||||
IeDot11sRann::~IeDot11sRann()
|
||||
{
|
||||
}
|
||||
TypeId
|
||||
WifiRannInformationElement::GetTypeId()
|
||||
IeDot11sRann::GetTypeId()
|
||||
{
|
||||
static TypeId tid = TypeId ("ns3::WifiRannInformationElement").SetParent<Object> ();
|
||||
static TypeId tid = TypeId ("ns3::IeDot11sRann").SetParent<Object> ();
|
||||
return tid;
|
||||
}
|
||||
TypeId
|
||||
WifiRannInformationElement::GetInstanceTypeId() const
|
||||
IeDot11sRann::GetInstanceTypeId() const
|
||||
{
|
||||
return GetTypeId();
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::Print(std::ostream &os)const
|
||||
IeDot11sRann::Print(std::ostream &os)const
|
||||
{
|
||||
// FILL
|
||||
}
|
||||
WifiRannInformationElement::WifiRannInformationElement():
|
||||
IeDot11sRann::IeDot11sRann():
|
||||
m_flags(0),
|
||||
m_hopcount(0),
|
||||
m_ttl(0),
|
||||
@@ -54,68 +54,68 @@ WifiRannInformationElement::WifiRannInformationElement():
|
||||
{
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetFlags(uint8_t flags)
|
||||
IeDot11sRann::SetFlags(uint8_t flags)
|
||||
{
|
||||
m_flags = flags;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetHopcount(uint8_t hopcount)
|
||||
IeDot11sRann::SetHopcount(uint8_t hopcount)
|
||||
{
|
||||
m_hopcount = hopcount;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetTTL(uint8_t ttl)
|
||||
IeDot11sRann::SetTTL(uint8_t ttl)
|
||||
{
|
||||
m_ttl = ttl;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetDestSeqNumber(uint32_t dest_seq_number)
|
||||
IeDot11sRann::SetDestSeqNumber(uint32_t dest_seq_number)
|
||||
{
|
||||
m_destSeqNumber = dest_seq_number;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetMetric(uint32_t metric)
|
||||
IeDot11sRann::SetMetric(uint32_t metric)
|
||||
{
|
||||
m_metric = metric;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SetOriginatorAddress(Mac48Address originator_address)
|
||||
IeDot11sRann::SetOriginatorAddress(Mac48Address originator_address)
|
||||
{
|
||||
m_originatorAddress = originator_address;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
WifiRannInformationElement::GetFlags()
|
||||
IeDot11sRann::GetFlags()
|
||||
{
|
||||
return m_flags;
|
||||
}
|
||||
uint8_t
|
||||
WifiRannInformationElement::GetHopcount()
|
||||
IeDot11sRann::GetHopcount()
|
||||
{
|
||||
return m_hopcount;
|
||||
}
|
||||
uint8_t
|
||||
WifiRannInformationElement::GetTTL()
|
||||
IeDot11sRann::GetTTL()
|
||||
{
|
||||
return m_ttl;
|
||||
}
|
||||
uint32_t
|
||||
WifiRannInformationElement::GetDestSeqNumber()
|
||||
IeDot11sRann::GetDestSeqNumber()
|
||||
{
|
||||
return m_destSeqNumber;
|
||||
}
|
||||
uint32_t
|
||||
WifiRannInformationElement::GetMetric()
|
||||
IeDot11sRann::GetMetric()
|
||||
{
|
||||
return m_metric;
|
||||
}
|
||||
Mac48Address
|
||||
WifiRannInformationElement::GetOriginatorAddress()
|
||||
IeDot11sRann::GetOriginatorAddress()
|
||||
{
|
||||
return m_originatorAddress;
|
||||
}
|
||||
void
|
||||
WifiRannInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
IeDot11sRann::SerializeInformation(Buffer::Iterator i) const
|
||||
{
|
||||
i.WriteU8 (m_flags);
|
||||
i.WriteU8 (m_hopcount);
|
||||
@@ -125,7 +125,7 @@ WifiRannInformationElement::SerializeInformation(Buffer::Iterator i) const
|
||||
i.WriteHtonU32 (m_metric);
|
||||
}
|
||||
uint16_t
|
||||
WifiRannInformationElement::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
IeDot11sRann::DeserializeInformation(Buffer::Iterator start, uint8_t length)
|
||||
{
|
||||
Buffer::Iterator i = start;
|
||||
m_flags = i.ReadU8();
|
||||
@@ -137,7 +137,7 @@ WifiRannInformationElement::DeserializeInformation(Buffer::Iterator start, uint8
|
||||
return i.GetDistanceFrom(start);
|
||||
}
|
||||
uint16_t
|
||||
WifiRannInformationElement::GetInformationSize() const
|
||||
IeDot11sRann::GetInformationSize() const
|
||||
{
|
||||
uint16_t retval =
|
||||
1//Flags
|
||||
|
||||
@@ -35,11 +35,11 @@ namespace ns3 {
|
||||
/**
|
||||
* \ingroup mesh
|
||||
*/
|
||||
class WifiRannInformationElement
|
||||
class IeDot11sRann
|
||||
{
|
||||
public:
|
||||
WifiRannInformationElement();
|
||||
virtual ~WifiRannInformationElement();
|
||||
IeDot11sRann();
|
||||
virtual ~IeDot11sRann();
|
||||
static TypeId GetTypeId();
|
||||
virtual TypeId GetInstanceTypeId() const;
|
||||
virtual void Print(std::ostream &os) const;
|
||||
|
||||
@@ -97,7 +97,7 @@ HwmpState::RequestDestination(Mac48Address dst)
|
||||
{
|
||||
if (m_preqQueue.end() == m_myPreq)
|
||||
{
|
||||
WifiPreqInformationElement preq;
|
||||
IeDot11sPreq preq;
|
||||
//fill PREQ:
|
||||
preq.SetHopcount(0);
|
||||
preq.SetTTL(m_maxTtl);
|
||||
@@ -173,7 +173,7 @@ HwmpState::GetAssociatedIfaceId()
|
||||
|
||||
//Interaction with MAC:
|
||||
void
|
||||
HwmpState::ReceivePreq(WifiPreqInformationElement& preq, const Mac48Address& from, const uint32_t& metric)
|
||||
HwmpState::ReceivePreq(IeDot11sPreq& preq, const Mac48Address& from, const uint32_t& metric)
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
@@ -312,7 +312,7 @@ HwmpState::ReceivePreq(WifiPreqInformationElement& preq, const Mac48Address& fr
|
||||
}
|
||||
|
||||
void
|
||||
HwmpState::ReceivePrep(WifiPrepInformationElement& prep, const Mac48Address& from, const uint32_t& metric)
|
||||
HwmpState::ReceivePrep(IeDot11sPrep& prep, const Mac48Address& from, const uint32_t& metric)
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
@@ -357,7 +357,7 @@ HwmpState::ReceivePrep(WifiPrepInformationElement& prep, const Mac48Address& fro
|
||||
}
|
||||
|
||||
void
|
||||
HwmpState::ReceivePerr(WifiPerrInformationElement& perr, const Mac48Address& from)
|
||||
HwmpState::ReceivePerr(IeDot11sPerr& perr, const Mac48Address& from)
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
@@ -420,7 +420,7 @@ void
|
||||
HwmpState::SendProactivePreq()
|
||||
{
|
||||
NS_LOG_DEBUG("Sending proactive PREQ");
|
||||
WifiPreqInformationElement preq;
|
||||
IeDot11sPreq preq;
|
||||
//By default: must answer
|
||||
preq.SetHopcount(0);
|
||||
preq.SetTTL(m_maxTtl);
|
||||
@@ -492,7 +492,7 @@ HwmpState::SendOnePreq()
|
||||
return;
|
||||
if (m_myPreq == m_preqQueue.begin())
|
||||
m_myPreq == m_preqQueue.end();
|
||||
WifiPreqInformationElement preq = m_preqQueue[0];
|
||||
IeDot11sPreq preq = m_preqQueue[0];
|
||||
NS_LOG_DEBUG(
|
||||
"Sending PREQ from "<<preq.GetOriginatorAddress() <<
|
||||
" destinations are "<<(int)preq.GetDestCount()<<
|
||||
@@ -516,7 +516,7 @@ HwmpState::SendPrep(Mac48Address dst,
|
||||
uint32_t originatorDsn,
|
||||
uint32_t lifetime)
|
||||
{
|
||||
WifiPrepInformationElement prep;
|
||||
IeDot11sPrep prep;
|
||||
prep.SetHopcount(0);
|
||||
prep.SetTTL(m_maxTtl);
|
||||
prep.SetDestinationAddress(dst);
|
||||
|
||||
@@ -94,14 +94,14 @@ public:
|
||||
//Mac interaction:
|
||||
void SetMac(Ptr<MeshWifiMac> mac);
|
||||
void SetSendPreqCallback(
|
||||
Callback<void, const WifiPreqInformationElement&> cb);
|
||||
Callback<void, const IeDot11sPreq&> cb);
|
||||
void SetSendPrepCallback(
|
||||
Callback<void, const WifiPrepInformationElement&> cb);
|
||||
Callback<void, const IeDot11sPrep&> cb);
|
||||
void SetSendPerrCallback(
|
||||
Callback<void, const WifiPerrInformationElement&, std::vector<Mac48Address> > cb);
|
||||
void ReceivePreq(WifiPreqInformationElement&, const Mac48Address& from, const uint32_t& metric);
|
||||
void ReceivePrep(WifiPrepInformationElement&, const Mac48Address& from, const uint32_t& metric);
|
||||
void ReceivePerr(WifiPerrInformationElement&, const Mac48Address& from);
|
||||
Callback<void, const IeDot11sPerr&, std::vector<Mac48Address> > cb);
|
||||
void ReceivePreq(IeDot11sPreq&, const Mac48Address& from, const uint32_t& metric);
|
||||
void ReceivePrep(IeDot11sPrep&, const Mac48Address& from, const uint32_t& metric);
|
||||
void ReceivePerr(IeDot11sPerr&, const Mac48Address& from);
|
||||
void PeerStatus(
|
||||
const Mac48Address peerAddress,
|
||||
const bool status,
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
//timers for PREQ and PREP:
|
||||
EventId m_preqTimer;
|
||||
void SendOnePreq();
|
||||
std::vector<WifiPreqInformationElement>
|
||||
std::vector<IeDot11sPreq>
|
||||
m_preqQueue;
|
||||
//true means that we can add a destination to
|
||||
//existing PREQ element
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
uint32_t originatorDsn, //taken from rtable or as m_myDsn ++;
|
||||
uint32_t lifetime //taken from PREQ
|
||||
);
|
||||
std::vector<WifiPreqInformationElement>::iterator
|
||||
std::vector<IeDot11sPreq>::iterator
|
||||
m_myPreq;
|
||||
//HWMP interaction callbacks:
|
||||
Callback<void, INFO>
|
||||
@@ -152,10 +152,10 @@ private:
|
||||
Callback<HwmpRtable::LookupResult, uint32_t>
|
||||
m_requestRootPathCallback;
|
||||
//Mac interaction callbacks:
|
||||
Callback<void, const WifiPreqInformationElement&> m_preqCallback;
|
||||
Callback<void, const WifiPrepInformationElement&, const Mac48Address&>
|
||||
Callback<void, const IeDot11sPreq&> m_preqCallback;
|
||||
Callback<void, const IeDot11sPrep&, const Mac48Address&>
|
||||
m_prepCallback;
|
||||
Callback<void, const WifiPerrInformationElement&, std::vector<Mac48Address> >
|
||||
Callback<void, const IeDot11sPerr&, std::vector<Mac48Address> >
|
||||
m_perrCallback;
|
||||
//HwmpCounters:
|
||||
uint32_t m_preqId;
|
||||
@@ -177,7 +177,7 @@ private:
|
||||
* should send PERR, and PERR element should
|
||||
* be cleared
|
||||
*/
|
||||
WifiPerrInformationElement m_myPerr;
|
||||
IeDot11sPerr m_myPerr;
|
||||
std::vector<Mac48Address> m_myPerrReceivers;
|
||||
void AddPerrReceiver(Mac48Address receiver);
|
||||
EventId m_perrTimer;
|
||||
|
||||
@@ -34,25 +34,25 @@ namespace ns3 {
|
||||
* Mesh Beacon
|
||||
***********************************************************/
|
||||
void
|
||||
MgtMeshBeaconHeader::SetMeshConfigurationElement(MeshConfigurationElement mesh_config)
|
||||
MgtMeshBeaconHeader::SetIeDot11sConfiguration(IeDot11sConfiguration mesh_config)
|
||||
{
|
||||
m_meshConfig = mesh_config;
|
||||
}
|
||||
|
||||
void
|
||||
MgtMeshBeaconHeader::SetWifiBeaconTimingElement(WifiBeaconTimingElement wifi_timing)
|
||||
MgtMeshBeaconHeader::SetIeDot11sBeaconTiming(IeDot11sBeaconTiming wifi_timing)
|
||||
{
|
||||
m_meshTiming = wifi_timing;
|
||||
}
|
||||
|
||||
MeshConfigurationElement
|
||||
MgtMeshBeaconHeader::GetMeshConfigurationElement()
|
||||
IeDot11sConfiguration
|
||||
MgtMeshBeaconHeader::GetIeDot11sConfiguration()
|
||||
{
|
||||
return m_meshConfig;
|
||||
}
|
||||
|
||||
WifiBeaconTimingElement
|
||||
MgtMeshBeaconHeader::GetWifiBeaconTimingElement()
|
||||
IeDot11sBeaconTiming
|
||||
MgtMeshBeaconHeader::GetIeDot11sBeaconTiming()
|
||||
{
|
||||
return m_meshTiming;
|
||||
}
|
||||
@@ -132,7 +132,7 @@ MeshMgtPeerLinkManFrame::SetMeshId(Ssid Id)
|
||||
}
|
||||
|
||||
void
|
||||
MeshMgtPeerLinkManFrame::SetMeshConfigurationElement(MeshConfigurationElement MeshConf)
|
||||
MeshMgtPeerLinkManFrame::SetIeDot11sConfiguration(IeDot11sConfiguration MeshConf)
|
||||
{
|
||||
MeshConfig = MeshConf;
|
||||
}
|
||||
@@ -167,8 +167,8 @@ MeshMgtPeerLinkManFrame::GetMeshId()
|
||||
return MeshId;
|
||||
}
|
||||
|
||||
MeshConfigurationElement
|
||||
MeshMgtPeerLinkManFrame::GetMeshConfigurationElement()
|
||||
IeDot11sConfiguration
|
||||
MeshMgtPeerLinkManFrame::GetIeDot11sConfiguration()
|
||||
{
|
||||
return MeshConfig;
|
||||
}
|
||||
|
||||
@@ -45,17 +45,17 @@ namespace ns3 {
|
||||
class MgtMeshBeaconHeader : public MgtBeaconHeader
|
||||
{
|
||||
public:
|
||||
void SetMeshConfigurationElement(MeshConfigurationElement mesh_config);
|
||||
void SetWifiBeaconTimingElement(WifiBeaconTimingElement wifi_timing);
|
||||
MeshConfigurationElement GetMeshConfigurationElement();
|
||||
WifiBeaconTimingElement GetWifiBeaconTimingElement();
|
||||
void SetIeDot11sConfiguration(IeDot11sConfiguration mesh_config);
|
||||
void SetIeDot11sBeaconTiming(IeDot11sBeaconTiming wifi_timing);
|
||||
IeDot11sConfiguration GetIeDot11sConfiguration();
|
||||
IeDot11sBeaconTiming GetIeDot11sBeaconTiming();
|
||||
virtual uint32_t GetSerializedSize () const;
|
||||
virtual void Serialize (Buffer::Iterator start) const;
|
||||
virtual uint32_t Deserialize (Buffer::Iterator start);
|
||||
|
||||
private:
|
||||
MeshConfigurationElement m_meshConfig;
|
||||
WifiBeaconTimingElement m_meshTiming;
|
||||
IeDot11sConfiguration m_meshConfig;
|
||||
IeDot11sBeaconTiming m_meshTiming;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -69,14 +69,14 @@ public:
|
||||
void SetSupportedRates(SupportedRates rates);
|
||||
void SetQosField(uint16_t qos);
|
||||
void SetMeshId(Ssid Id);
|
||||
void SetMeshConfigurationElement(MeshConfigurationElement MeshConf);
|
||||
void SetIeDot11sConfiguration(IeDot11sConfiguration MeshConf);
|
||||
void SetPeerLinkManagementElement(PeerLinkManagementElement MeshPeerElement);
|
||||
|
||||
uint16_t GetAid();
|
||||
SupportedRates GetSupportedRates();
|
||||
uint16_t GetQosField();
|
||||
Ssid GetMeshId();
|
||||
MeshConfigurationElement GetMeshConfigurationElement();
|
||||
IeDot11sConfiguration GetIeDot11sConfiguration();
|
||||
PeerLinkManagementElement GetPeerLinkManagementElement();
|
||||
|
||||
static TypeId GetTypeId();
|
||||
@@ -107,7 +107,7 @@ private:
|
||||
SupportedRates Rates; //only in Open and Confirm
|
||||
uint16_t QoS; //only in Open and Confirm
|
||||
Ssid MeshId; //only in Open and Confirm
|
||||
MeshConfigurationElement MeshConfig; //only in Open and Confirm
|
||||
IeDot11sConfiguration MeshConfig; //only in Open and Confirm
|
||||
PeerLinkManagementElement PeerLinkMan; //in all types of frames
|
||||
};
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ MeshWifiMac::SendOneBeacon ()
|
||||
beacon.SetSsid (GetSsid ());
|
||||
beacon.SetSupportedRates (GetSupportedRates ());
|
||||
beacon.SetBeaconIntervalUs (m_beaconInterval.GetMicroSeconds ());
|
||||
beacon.SetWifiBeaconTimingElement(m_peerManager->GetWifiBeaconTimingElementForMyBeacon(GetAddress()));
|
||||
beacon.SetIeDot11sBeaconTiming(m_peerManager->GetIeDot11sBeaconTimingForMyBeacon(GetAddress()));
|
||||
m_beaconSendEvent = Simulator::Schedule(
|
||||
m_beaconFormingRandomDelay,
|
||||
&MeshWifiMac::QueueOneBeacon,
|
||||
@@ -492,7 +492,7 @@ MeshWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
" microseconds");
|
||||
#if 0
|
||||
NeighboursTimingUnitsList neighbours;
|
||||
neighbours = beacon.GetWifiBeaconTimingElement().GetNeighboursTimingElementsList();
|
||||
neighbours = beacon.GetIeDot11sBeaconTiming().GetNeighboursTimingElementsList();
|
||||
for (NeighboursTimingUnitsList::const_iterator j = neighbours.begin(); j!= neighbours.end(); j++)
|
||||
fprintf(
|
||||
stderr,
|
||||
@@ -507,7 +507,7 @@ MeshWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
from,
|
||||
Simulator::Now (),
|
||||
MicroSeconds(beacon.GetBeaconIntervalUs()),
|
||||
beacon.GetWifiBeaconTimingElement()
|
||||
beacon.GetIeDot11sBeaconTiming()
|
||||
);
|
||||
if (!beacon.GetSsid().IsEqual(GetSsid()))
|
||||
return;
|
||||
@@ -525,7 +525,7 @@ MeshWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO:Chack MeshConfigurationElement(now is nothing
|
||||
// TODO:Chack IeDot11sConfiguration(now is nothing
|
||||
// to be checked)
|
||||
m_peerManager->AskIfOpenNeeded(GetAddress(), from);
|
||||
return;
|
||||
@@ -610,7 +610,7 @@ MeshWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
{
|
||||
case WifiMeshMultihopActionHeader::PATH_REQUEST:
|
||||
{
|
||||
WifiPreqInformationElement preq;
|
||||
IeDot11sPreq preq;
|
||||
packet->RemoveHeader(preq);
|
||||
//TODO:recalculate
|
||||
//metric
|
||||
@@ -619,14 +619,14 @@ MeshWifiMac::Receive (Ptr<Packet> packet, WifiMacHeader const *hdr)
|
||||
}
|
||||
case WifiMeshMultihopActionHeader::PATH_REPLY:
|
||||
{
|
||||
WifiPrepInformationElement prep;
|
||||
IeDot11sPrep prep;
|
||||
packet->RemoveHeader(prep);
|
||||
m_prepReceived(prep, hdr->GetAddr2(), CalculateMetric(hdr->GetAddr2()));
|
||||
}
|
||||
return;
|
||||
case WifiMeshMultihopActionHeader::PATH_ERROR:
|
||||
{
|
||||
WifiPerrInformationElement perr;
|
||||
IeDot11sPerr perr;
|
||||
packet->RemoveHeader(perr);
|
||||
m_perrReceived(perr, hdr->GetAddr2());
|
||||
}
|
||||
@@ -681,7 +681,7 @@ MeshWifiMac::SendPeerLinkOpen(PeerLinkManagementElement peer_element, Mac48Addre
|
||||
{
|
||||
MeshMgtPeerLinkManFrame open;
|
||||
open.SetOpen();
|
||||
open.SetMeshConfigurationElement(m_meshConfig);
|
||||
open.SetIeDot11sConfiguration(m_meshConfig);
|
||||
open.SetPeerLinkManagementElement(peer_element);
|
||||
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, open, peerAddress);
|
||||
}
|
||||
@@ -691,7 +691,7 @@ MeshWifiMac::SendPeerLinkConfirm(PeerLinkManagementElement peer_element, Mac48Ad
|
||||
{
|
||||
MeshMgtPeerLinkManFrame confirm;
|
||||
confirm.SetConfirm();
|
||||
confirm.SetMeshConfigurationElement(m_meshConfig);
|
||||
confirm.SetIeDot11sConfiguration(m_meshConfig);
|
||||
confirm.SetPeerLinkManagementElement(peer_element);
|
||||
confirm.SetAid(aid);
|
||||
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, confirm, peerAddress);
|
||||
@@ -703,7 +703,7 @@ MeshWifiMac::SendPeerLinkClose(PeerLinkManagementElement peer_element, Mac48Addr
|
||||
{
|
||||
MeshMgtPeerLinkManFrame close;
|
||||
close.SetClose();
|
||||
close.SetMeshConfigurationElement(m_meshConfig);
|
||||
close.SetIeDot11sConfiguration(m_meshConfig);
|
||||
close.SetPeerLinkManagementElement(peer_element);
|
||||
Simulator::Schedule(CalcSwDelay() ,&MeshWifiMac::QueuePeerLinkFrame, this, close, peerAddress);
|
||||
|
||||
@@ -775,7 +775,7 @@ MeshWifiMac::GetSoftwareDelay()
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiMac::SendPreq(const WifiPreqInformationElement& preq)
|
||||
MeshWifiMac::SendPreq(const IeDot11sPreq& preq)
|
||||
{
|
||||
//Add a PREQ
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
@@ -806,7 +806,7 @@ MeshWifiMac::SendPreq(const WifiPreqInformationElement& preq)
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiMac::SendPrep(const WifiPrepInformationElement& prep, const Mac48Address& to)
|
||||
MeshWifiMac::SendPrep(const IeDot11sPrep& prep, const Mac48Address& to)
|
||||
{
|
||||
if (!m_peerManager->IsActiveLink(GetAddress(), to))
|
||||
return;
|
||||
@@ -837,7 +837,7 @@ MeshWifiMac::SendPrep(const WifiPrepInformationElement& prep, const Mac48Address
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiMac::SendPerr(const WifiPerrInformationElement& perr, std::vector<Mac48Address> receivers)
|
||||
MeshWifiMac::SendPerr(const IeDot11sPerr& perr, std::vector<Mac48Address> receivers)
|
||||
{
|
||||
NS_ASSERT(receivers.size()!=0);
|
||||
Ptr<Packet> packet = Create<Packet> ();
|
||||
@@ -876,21 +876,21 @@ MeshWifiMac::QueuePathSelectionFrame(Ptr<Packet> packet, const WifiMacHeader hdr
|
||||
}
|
||||
void
|
||||
MeshWifiMac::SetPreqReceivedCallback(
|
||||
Callback<void, WifiPreqInformationElement&, const Mac48Address&, const uint32_t&> cb)
|
||||
Callback<void, IeDot11sPreq&, const Mac48Address&, const uint32_t&> cb)
|
||||
{
|
||||
m_preqReceived = cb;
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiMac::SetPrepReceivedCallback(
|
||||
Callback<void, WifiPrepInformationElement&, const Mac48Address&, const uint32_t&> cb)
|
||||
Callback<void, IeDot11sPrep&, const Mac48Address&, const uint32_t&> cb)
|
||||
{
|
||||
m_prepReceived = cb;
|
||||
}
|
||||
|
||||
void
|
||||
MeshWifiMac::SetPerrReceivedCallback(
|
||||
Callback<void, WifiPerrInformationElement&, const Mac48Address&> cb)
|
||||
Callback<void, IeDot11sPerr&, const Mac48Address&> cb)
|
||||
{
|
||||
m_perrReceived = cb;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
*/
|
||||
void SetPeerLinkManager(Ptr<WifiPeerManager> manager);
|
||||
virtual void SetPreqReceivedCallback(
|
||||
Callback<void, WifiPreqInformationElement&, const Mac48Address&, const uint32_t&> cb);
|
||||
Callback<void, IeDot11sPreq&, const Mac48Address&, const uint32_t&> cb);
|
||||
/**
|
||||
* \brief this callback is set by Hwmp routing
|
||||
* protocol and executed when MAC has received
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
* receiving PREP.
|
||||
*/
|
||||
virtual void SetPrepReceivedCallback(
|
||||
Callback<void, WifiPrepInformationElement&, const Mac48Address&, const uint32_t&> cb);
|
||||
Callback<void, IeDot11sPrep&, const Mac48Address&, const uint32_t&> cb);
|
||||
/**
|
||||
* \brief this callback is set by Hwmp routing
|
||||
* protocol and executed when MAC has received
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
* receiving PERR.
|
||||
*/
|
||||
virtual void SetPerrReceivedCallback(
|
||||
Callback<void, WifiPerrInformationElement&, const Mac48Address&> cb);
|
||||
Callback<void, IeDot11sPerr&, const Mac48Address&> cb);
|
||||
|
||||
/**
|
||||
* \brief this callback is set by Hwmp routing
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
* \attention This method is public, because
|
||||
* HWMP makes a callback using this method
|
||||
*/
|
||||
virtual void SendPreq(const WifiPreqInformationElement& preq);
|
||||
virtual void SendPreq(const IeDot11sPreq& preq);
|
||||
/**
|
||||
* \brief Sends a PREP frame.
|
||||
* \param prep is prep information element
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
* HWMP makes a callback using this method
|
||||
*/
|
||||
|
||||
virtual void SendPrep(const WifiPrepInformationElement& prep, const Mac48Address& to);
|
||||
virtual void SendPrep(const IeDot11sPrep& prep, const Mac48Address& to);
|
||||
/**
|
||||
* \brief Sends a PERR frame.
|
||||
* \param perr is perr information element
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
* \attention This method is public, because
|
||||
* HWMP makes a callback using this method
|
||||
*/
|
||||
virtual void SendPerr(const WifiPerrInformationElement& perr, std::vector<Mac48Address> receivers);
|
||||
virtual void SendPerr(const IeDot11sPerr& perr, std::vector<Mac48Address> receivers);
|
||||
/**
|
||||
* \brief Sends PeerLinkOpen frame to a given
|
||||
* address. Mac only forms a proper
|
||||
@@ -333,7 +333,7 @@ private:
|
||||
Time m_ctsTimeout;
|
||||
|
||||
Time m_eifsNoDifs;
|
||||
MeshConfigurationElement m_meshConfig; //Stores my configuration;
|
||||
IeDot11sConfiguration m_meshConfig; //Stores my configuration;
|
||||
//Peer Descriptor pointer:
|
||||
Ptr<WifiPeerManager> m_peerManager;
|
||||
Time m_softwareDelay;
|
||||
@@ -358,11 +358,11 @@ private:
|
||||
* distributed between 0 and given value
|
||||
*/
|
||||
Time m_beaconFormingRandomDelay;
|
||||
Callback<void, WifiPreqInformationElement&, const Mac48Address&, const uint32_t&>
|
||||
Callback<void, IeDot11sPreq&, const Mac48Address&, const uint32_t&>
|
||||
m_preqReceived;
|
||||
Callback<void, WifiPrepInformationElement&, const Mac48Address&, const uint32_t&>
|
||||
Callback<void, IeDot11sPrep&, const Mac48Address&, const uint32_t&>
|
||||
m_prepReceived;
|
||||
Callback<void, WifiPerrInformationElement&, const Mac48Address&>
|
||||
Callback<void, IeDot11sPerr&, const Mac48Address&>
|
||||
m_perrReceived;
|
||||
Callback<void, Mac48Address, bool, uint32_t>
|
||||
m_peerStatusCallback;
|
||||
|
||||
@@ -90,7 +90,7 @@ WifiPeerLinkDescriptor::BeaconLoss()
|
||||
}
|
||||
|
||||
void
|
||||
WifiPeerLinkDescriptor::SetBeaconTimingElement(WifiBeaconTimingElement beaconTiming)
|
||||
WifiPeerLinkDescriptor::SetBeaconTimingElement(IeDot11sBeaconTiming beaconTiming)
|
||||
{
|
||||
m_beaconTiming = beaconTiming;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ WifiPeerLinkDescriptor::GetBeaconInterval() const
|
||||
{
|
||||
return m_beaconInterval;
|
||||
}
|
||||
WifiBeaconTimingElement
|
||||
IeDot11sBeaconTiming
|
||||
WifiPeerLinkDescriptor::GetBeaconTimingElement() const
|
||||
{
|
||||
return m_beaconTiming;
|
||||
@@ -178,7 +178,7 @@ void WifiPeerLinkDescriptor::PeerLinkClose(uint16_t localLinkId,uint16_t peerLin
|
||||
StateMachine(CLS_ACPT, reason);
|
||||
}
|
||||
|
||||
void WifiPeerLinkDescriptor::PeerLinkOpenAccept(uint16_t localLinkId, MeshConfigurationElement conf)
|
||||
void WifiPeerLinkDescriptor::PeerLinkOpenAccept(uint16_t localLinkId, IeDot11sConfiguration conf)
|
||||
{
|
||||
if (m_peerLinkId == 0)
|
||||
m_peerLinkId = localLinkId;
|
||||
@@ -186,7 +186,7 @@ void WifiPeerLinkDescriptor::PeerLinkOpenAccept(uint16_t localLinkId, MeshConfig
|
||||
StateMachine(OPN_ACPT);
|
||||
}
|
||||
|
||||
void WifiPeerLinkDescriptor::PeerLinkOpenReject(uint16_t localLinkId, MeshConfigurationElement conf,dot11sReasonCode reason)
|
||||
void WifiPeerLinkDescriptor::PeerLinkOpenReject(uint16_t localLinkId, IeDot11sConfiguration conf,dot11sReasonCode reason)
|
||||
{
|
||||
if ( m_peerLinkId == 0)
|
||||
m_peerLinkId = localLinkId;
|
||||
@@ -195,7 +195,7 @@ void WifiPeerLinkDescriptor::PeerLinkOpenReject(uint16_t localLinkId, MeshConfig
|
||||
}
|
||||
|
||||
void
|
||||
WifiPeerLinkDescriptor::PeerLinkConfirmAccept(uint16_t localLinkId,uint16_t peerLinkId, uint16_t peerAid, MeshConfigurationElement conf)
|
||||
WifiPeerLinkDescriptor::PeerLinkConfirmAccept(uint16_t localLinkId,uint16_t peerLinkId, uint16_t peerAid, IeDot11sConfiguration conf)
|
||||
{
|
||||
if ( m_localLinkId != peerLinkId)
|
||||
return;
|
||||
@@ -209,7 +209,7 @@ WifiPeerLinkDescriptor::PeerLinkConfirmAccept(uint16_t localLinkId,uint16_t peer
|
||||
}
|
||||
|
||||
void WifiPeerLinkDescriptor:: PeerLinkConfirmReject(uint16_t localLinkId, uint16_t peerLinkId,
|
||||
MeshConfigurationElement conf,dot11sReasonCode reason)
|
||||
IeDot11sConfiguration conf,dot11sReasonCode reason)
|
||||
{
|
||||
if (m_localLinkId != peerLinkId)
|
||||
return;
|
||||
@@ -636,7 +636,7 @@ WifiPeerManager::SetReceivedBeaconTimers(
|
||||
Mac48Address peerAddress,
|
||||
Time lastBeacon,
|
||||
Time beaconInterval,
|
||||
WifiBeaconTimingElement beaconTiming
|
||||
IeDot11sBeaconTiming beaconTiming
|
||||
)
|
||||
{
|
||||
PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress);
|
||||
@@ -695,7 +695,7 @@ WifiPeerManager::SetOpenReceived(
|
||||
Mac48Address portAddress,
|
||||
Mac48Address peerAddress,
|
||||
PeerLinkManagementElement peerMan,
|
||||
MeshConfigurationElement conf
|
||||
IeDot11sConfiguration conf
|
||||
)
|
||||
{
|
||||
dot11sReasonCode reasonCode;
|
||||
@@ -725,7 +725,7 @@ WifiPeerManager::SetConfirmReceived(
|
||||
Mac48Address peerAddress,
|
||||
uint16_t peerAid,
|
||||
PeerLinkManagementElement peerMan,
|
||||
MeshConfigurationElement meshConfig
|
||||
IeDot11sConfiguration meshConfig
|
||||
)
|
||||
{
|
||||
PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress);
|
||||
@@ -769,12 +769,12 @@ WifiPeerManager::ConfigurationMismatch(
|
||||
|
||||
}
|
||||
|
||||
WifiBeaconTimingElement
|
||||
WifiPeerManager::GetWifiBeaconTimingElementForMyBeacon(Mac48Address portAddress)
|
||||
IeDot11sBeaconTiming
|
||||
WifiPeerManager::GetIeDot11sBeaconTimingForMyBeacon(Mac48Address portAddress)
|
||||
{
|
||||
PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress);
|
||||
NS_ASSERT(port!= m_peerDescriptors.end());
|
||||
WifiBeaconTimingElement return_val;
|
||||
IeDot11sBeaconTiming return_val;
|
||||
for (std::vector<Ptr<WifiPeerLinkDescriptor> >::iterator i = port->second.begin(); i!= port->second.end(); i++)
|
||||
{
|
||||
//Just go through all neighbor entries and add it to timing element:
|
||||
@@ -787,14 +787,14 @@ WifiPeerManager::GetWifiBeaconTimingElementForMyBeacon(Mac48Address portAddress)
|
||||
return return_val;
|
||||
|
||||
}
|
||||
WifiBeaconTimingElement
|
||||
WifiPeerManager::GetWifiBeaconTimingElementForAddress(
|
||||
IeDot11sBeaconTiming
|
||||
WifiPeerManager::GetIeDot11sBeaconTimingForAddress(
|
||||
Mac48Address portAddress,
|
||||
Mac48Address addr)
|
||||
{
|
||||
PeerDescriptorsMap::iterator port = m_peerDescriptors.find(portAddress);
|
||||
NS_ASSERT(port != m_peerDescriptors.end());
|
||||
WifiBeaconTimingElement return_val;
|
||||
IeDot11sBeaconTiming return_val;
|
||||
for (std::vector<Ptr<WifiPeerLinkDescriptor> >::iterator i = port->second.begin(); i != port->second.end(); i++)
|
||||
if ((*i)->GetPeerAddress() == addr)
|
||||
return_val = (*i)->GetBeaconTimingElement();
|
||||
@@ -918,10 +918,10 @@ WifiPeerManager::GetNextBeaconShift(
|
||||
NS_ASSERT(myBeacon!=m_myBeaconInfo.end());
|
||||
for (std::vector<Ptr<WifiPeerLinkDescriptor> >::iterator i = port->second.begin(); i!= port->second.end(); i++)
|
||||
{
|
||||
WifiBeaconTimingElement::NeighboursTimingUnitsList neighbours;
|
||||
IeDot11sBeaconTiming::NeighboursTimingUnitsList neighbours;
|
||||
neighbours = (*i)->GetBeaconTimingElement().GetNeighboursTimingElementsList();
|
||||
//first let's form the list of all kown TBTTs
|
||||
for (WifiBeaconTimingElement::NeighboursTimingUnitsList::const_iterator j = neighbours.begin(); j!= neighbours.end(); j++)
|
||||
for (IeDot11sBeaconTiming::NeighboursTimingUnitsList::const_iterator j = neighbours.begin(); j!= neighbours.end(); j++)
|
||||
{
|
||||
uint16_t beaconIntervalTimeUnits;
|
||||
beaconIntervalTimeUnits = (*j)->GetBeaconInterval();
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
void SetPeerLinkId(uint16_t id);
|
||||
void SetLocalAid(uint16_t aid);
|
||||
void SetPeerAid(uint16_t aid);
|
||||
void SetBeaconTimingElement(WifiBeaconTimingElement beaconTiming);
|
||||
void SetBeaconTimingElement(IeDot11sBeaconTiming beaconTiming);
|
||||
void SetPeerLinkDescriptorElement(
|
||||
PeerLinkManagementElement peerLinkElement
|
||||
);
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
uint16_t GetLocalAid()const;
|
||||
Time GetLastBeacon()const;
|
||||
Time GetBeaconInterval()const;
|
||||
WifiBeaconTimingElement
|
||||
IeDot11sBeaconTiming
|
||||
GetBeaconTimingElement()const;
|
||||
PeerLinkManagementElement
|
||||
GetPeerLinkDescriptorElement()const;
|
||||
@@ -94,18 +94,18 @@ public:
|
||||
#endif
|
||||
void SetMac(Ptr<MeshWifiMac> mac);
|
||||
void PeerLinkClose(uint16_t localLinkID,uint16_t peerLinkID, dot11sReasonCode reason);
|
||||
void PeerLinkOpenAccept(uint16_t localLinkId, MeshConfigurationElement conf);
|
||||
void PeerLinkOpenReject(uint16_t localLinkId, MeshConfigurationElement conf,dot11sReasonCode reason);
|
||||
void PeerLinkOpenAccept(uint16_t localLinkId, IeDot11sConfiguration conf);
|
||||
void PeerLinkOpenReject(uint16_t localLinkId, IeDot11sConfiguration conf,dot11sReasonCode reason);
|
||||
void PeerLinkConfirmAccept(
|
||||
uint16_t localLinkId,
|
||||
uint16_t peerLinkId,
|
||||
uint16_t peerAid,
|
||||
MeshConfigurationElement conf
|
||||
IeDot11sConfiguration conf
|
||||
);
|
||||
void PeerLinkConfirmReject(
|
||||
uint16_t localLinkId,
|
||||
uint16_t peerLinkId,
|
||||
MeshConfigurationElement conf,
|
||||
IeDot11sConfiguration conf,
|
||||
dot11sReasonCode reason
|
||||
);
|
||||
bool LinkIsEstab() const;
|
||||
@@ -171,11 +171,11 @@ private:
|
||||
//State of our peer Link:
|
||||
PeerState m_state;
|
||||
|
||||
MeshConfigurationElement
|
||||
IeDot11sConfiguration
|
||||
m_configuration;
|
||||
// State is a bitfield as defined as follows:
|
||||
// This are states for a given
|
||||
WifiBeaconTimingElement
|
||||
IeDot11sBeaconTiming
|
||||
m_beaconTiming;
|
||||
|
||||
EventId m_retryTimer;
|
||||
@@ -203,8 +203,8 @@ public:
|
||||
~WifiPeerManager();
|
||||
static TypeId GetTypeId ();
|
||||
//Returns a beacon timing element stored for remote station:
|
||||
WifiBeaconTimingElement
|
||||
GetWifiBeaconTimingElementForAddress(Mac48Address portAddress, Mac48Address addr);
|
||||
IeDot11sBeaconTiming
|
||||
GetIeDot11sBeaconTimingForAddress(Mac48Address portAddress, Mac48Address addr);
|
||||
//Returns a list of all addresses, which beacons can be decoded:
|
||||
std::vector<Mac48Address>
|
||||
GetNeighbourAddressList(Mac48Address portAddress, Mac48Address peerAddress);
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
Mac48Address peerAddress,
|
||||
Time lastBeacon,
|
||||
Time beaconInterval,
|
||||
WifiBeaconTimingElement
|
||||
IeDot11sBeaconTiming
|
||||
beaconTiming
|
||||
);
|
||||
void SetOpenReceived(
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
Mac48Address peerAddress,
|
||||
PeerLinkManagementElement
|
||||
peerMan,
|
||||
MeshConfigurationElement conf
|
||||
IeDot11sConfiguration conf
|
||||
);
|
||||
void SetConfirmReceived(
|
||||
Mac48Address portAddress,
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
uint16_t peerAid,
|
||||
PeerLinkManagementElement
|
||||
peerMan,
|
||||
MeshConfigurationElement meshConfig
|
||||
IeDot11sConfiguration meshConfig
|
||||
);
|
||||
void SetCloseReceived(
|
||||
Mac48Address portAddress,
|
||||
@@ -255,8 +255,8 @@ public:
|
||||
Mac48Address peerAddress
|
||||
);
|
||||
//Returns a beacon timing element to added into my beacon:
|
||||
WifiBeaconTimingElement
|
||||
GetWifiBeaconTimingElementForMyBeacon(
|
||||
IeDot11sBeaconTiming
|
||||
GetIeDot11sBeaconTimingForMyBeacon(
|
||||
Mac48Address portAddress
|
||||
);
|
||||
bool IsActiveLink(
|
||||
|
||||
Reference in New Issue
Block a user