19 #include "ns3/simulator.h"
20 #include "ns3/socket.h"
21 #include "ns3/wifi-phy.h"
42 .SetGroupName (
"Wave")
51 m_vsaReceived = MakeNullCallback<bool, Ptr<const Packet>,
const Address &, uint32_t, uint32_t> ();
71 for (std::map<uint32_t,
Ptr<OcbWifiMac> >::iterator i = macs.begin (); i != macs.end (); ++i)
92 uint8_t oibytes[5] = {0x00, 0x50, 0xC2, 0x4A, 0x40};
147 interval,
channel, vsc, oi, peer);
157 interval,
channel, vsc, oi, peer);
167 if (!scheduler->IsChannelAccessAssigned (
channel))
188 mac->SendVsc (vsc, peer, oi);
195 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
198 if (!(*i)->repeat.IsExpired ())
200 (*i)->repeat.Cancel ();
212 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
215 if ((*i)->channelNumber == channelNumber)
217 if (!(*i)->repeat.IsExpired ())
219 (*i)->repeat.Cancel ();
237 for (std::vector<VsaWork *>::iterator i =
m_vsas.begin ();
242 if (!(*i)->repeat.IsExpired ())
244 (*i)->repeat.Cancel ();
273 uint32_t channelNumber =
mac->GetWifiPhy ()->GetChannelNumber ();
275 return m_vsaReceived (vsc, src, managementId, channelNumber);
a polymophic address class
Time NeedTimeToCchInterval(Time duration=Seconds(0.0)) const
Time NeedTimeToSchInterval(Time duration=Seconds(0.0)) const
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
A base class which provides memory management and object aggregation.
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
uint8_t GetManagementId(void) const
void AddPacketTag(const Tag &tag) const
Add a packet tag.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
indicates whether the socket has a priority set.
void SetPriority(uint8_t priority)
Set the tag's priority.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission.
void DoInitialize(void)
Initialize() implementation.
void SetWaveVsaCallback(Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > vsaCallback)
Set wave vsa callback function.
void DoDispose(void)
Destructor implementation.
void DoSendVsa(enum VsaTransmitInterval interval, uint32_t channel, Ptr< Packet > vsc, OrganizationIdentifier oi, Mac48Address peer)
Ptr< WaveNetDevice > m_device
the device
static const uint32_t VSA_REPEAT_PERIOD
A number of VSA frames will be transmitted repeatedly during the period of 5s.
void DoRepeat(VsaWork *vsa)
bool ReceiveVsc(Ptr< WifiMac > mac, const OrganizationIdentifier &oi, Ptr< const Packet > vsc, const Address &src)
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
static TypeId GetTypeId(void)
Get the type ID.
void RemoveAll(void)
cancel all VSA transmissions
void RemoveByChannel(uint32_t channelNumber)
virtual ~VsaManager(void)
void RemoveByOrganizationIdentifier(const OrganizationIdentifier &oi)
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
VSA received callback.
std::vector< VsaWork * > m_vsas
VSAs.
void SendVsa(const VsaInfo &vsaInfo)
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Ptr< ChannelManager > GetChannelManager(void) const
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
Ptr< ChannelScheduler > GetChannelScheduler(void) const
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
VsaTransmitInterval
indicate which interval the VSA frames will be transmitted in.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const OrganizationIdentifier oi_1609
OI for IEEE standard 1609.
static const uint8_t oi_bytes_1609[5]
OI bytes for use in organization identifier.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
uint8_t managementId
management ID
uint32_t channelNumber
channel number
enum VsaTransmitInterval sendInterval
send interval
uint8_t repeatRate
repeat rate
OrganizationIdentifier oi
OI.
Time repeatPeriod
repeat period
OrganizationIdentifier oi
OI.
uint32_t channelNumber
channel number
enum VsaTransmitInterval sentInterval
VSA transmit interval.