|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
Ptr< WaveNetDevice > m_device
the device
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
enum VsaTransmitInterval sendInterval
send interval
virtual ~VsaManager(void)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time NeedTimeToCchInterval(Time duration=Seconds(0.0)) const
This tag will be used to support higher layer control DataRate and TxPwr_Level for transmission.
Time repeatPeriod
repeat period
bool ReceiveVsc(Ptr< WifiMac > mac, const OrganizationIdentifier &oi, Ptr< const Packet > vsc, const Address &src)
std::map< uint32_t, Ptr< OcbWifiMac > > GetMacs(void) const
Ptr< ChannelManager > GetChannelManager(void) const
void SendVsa(const VsaInfo &vsaInfo)
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void RemoveByChannel(uint32_t channelNumber)
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Ptr< ChannelCoordinator > GetChannelCoordinator(void) const
uint32_t channelNumber
channel number
TypeId SetParent(TypeId tid)
Set the parent TypeId.
VsaTransmitInterval
indicate which interval the VSA frames will be transmitted in.
Time NeedTimeToSchInterval(Time duration=Seconds(0.0)) const
void SetPriority(uint8_t priority)
Set the tag's priority.
uint8_t managementId
management ID
static const uint8_t oi_bytes_1609[5]
OI bytes for use in organization identifier.
a polymophic address class
static const OrganizationIdentifier oi_1609
OI for IEEE standard 1609.
A base class which provides memory management and object aggregation.
Ptr< ChannelScheduler > GetChannelScheduler(void) const
Ptr< OcbWifiMac > GetMac(uint32_t channelNumber) const
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
refer to 1609.4-2010 chapter 6.4 Vendor Specific Action (VSA) frames transmission.
Simulation virtual time values and global simulation resolution.
void RemoveByOrganizationIdentifier(const OrganizationIdentifier &oi)
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void RemoveAll(void)
cancel all VSA transmissions
uint8_t repeatRate
repeat rate
uint32_t channelNumber
channel number
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...
static const uint32_t VSA_REPEAT_PERIOD
A number of VSA frames will be transmitted repeatedly during the period of 5s.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
std::vector< VsaWork * > m_vsas
VSAs.
static TypeId GetTypeId(void)
Get the type ID.
indicates whether the socket has a priority set.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
void SetWaveVsaCallback(Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > vsaCallback)
Set wave vsa callback function.
OrganizationIdentifier oi
OI.
uint8_t GetManagementId(void) const
Time Seconds(double value)
Construct a Time in the indicated unit.
void DoSendVsa(enum VsaTransmitInterval interval, uint32_t channel, Ptr< Packet > vsc, OrganizationIdentifier oi, Mac48Address peer)
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
enum VsaTransmitInterval sentInterval
VSA transmit interval.
Callback< bool, Ptr< const Packet >, const Address &, uint32_t, uint32_t > m_vsaReceived
VSA received callback.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
void DoInitialize(void)
Initialize() implementation.
void SetWaveNetDevice(Ptr< WaveNetDevice > device)
void DoRepeat(VsaWork *vsa)
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
OrganizationIdentifier oi
OI.
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
void DoDispose(void)
Destructor implementation.