19 #include "ns3/assert.h"
20 #include "ns3/simulator.h"
21 #include "ns3/qos-tag.h"
40 .AddConstructor<VsaManager> ()
48 m_vsaReceived = MakeNullCallback<bool, Ptr<const Packet>,
const Address &, uint32_t, uint32_t> ();
68 for (std::map<uint32_t,
Ptr<OcbWifiMac> >::iterator i = macs.begin (); i != macs.end (); ++i)
89 uint8_t oibytes[5] = {0x00, 0x50, 0xC2, 0x4A, 0x40};
144 interval, channel, vsc, oi, peer);
154 interval, channel, vsc, oi, peer);
164 if (!scheduler->IsChannelAccessAssigned (channel))
166 NS_LOG_DEBUG (
"there is no channel access assigned for channel " << channel);
177 txVector.
SetMode (manager->GetManagementDataRate (channel));
189 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
192 if (!(*i)->repeat.IsExpired ())
194 (*i)->repeat.Cancel ();
206 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
209 if ((*i)->channelNumber == channelNumber)
211 if (!(*i)->repeat.IsExpired ())
213 (*i)->repeat.Cancel ();
231 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
236 if (!(*i)->repeat.IsExpired ())
238 (*i)->repeat.Cancel ();
267 uint32_t channelNumber = mac->GetWifiPhy ()->GetChannelNumber ();
269 return m_vsaReceived (vsc, src, managementId, channelNumber);
Ptr< WaveNetDevice > m_device
Simulation virtual time values and global simulation resolution.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static const uint32_t VSA_REPEAT_PERIOD
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
virtual ~VsaManager(void)
static const uint8_t oi_bytes_1609[5]
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void SendVsa(const VsaInfo &vsaInfo)
void SetWaveVsaCallback(Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > vsaCallback)
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission...
a polymophic address class
void DoSendVsa(enum VsaTransmitInterval interval, uint32_t channel, Ptr< Packet > vsc, OrganizationIdentifier oi, Mac48Address peer)
static TypeId GetTypeId(void)
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
enum VsaTransmitInterval sentInterval
void DoInitialize(void)
Initialize() implementation.
the organization identifier is a public organizationally unique identifier assigned by the IEEE...
void DoDispose(void)
Destructor implementation.
Time NeedTimeToCchInterval(Time duration=Seconds(0.0)) const
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
The aim of the QosTag is to provide means for an Application to specify the TID which will be used by...
void DoRepeat(VsaWork *vsa)
std::vector< VsaWork * > m_vsas
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
VsaTransmitInterval
indicate which interval the VSA frames will be transmitted in.
static const OrganizationIdentifier oi_1609
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
Time NeedTimeToSchInterval(Time duration=Seconds(0.0)) const
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Ptr< ChannelManager > GetChannelManager(void) const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void RemoveByChannel(uint32_t channelNumber)
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
OrganizationIdentifier oi
OrganizationIdentifier oi
A base class which provides memory management and object aggregation.
uint8_t GetManagementId(void) const
Ptr< ChannelScheduler > GetChannelScheduler(void) const
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
void RemoveAll(void)
cancel all VSA transmissions
bool ReceiveVsc(Ptr< WifiMac > mac, const OrganizationIdentifier &oi, Ptr< const Packet > vsc, const Address &src)
void RemoveByOrganizationIdentifier(const OrganizationIdentifier &oi)
enum VsaTransmitInterval sendInterval