28 #include "ns3/channel-access-manager.h"
29 #include "ns3/event-id.h"
30 #include "ns3/ht-capabilities.h"
32 #include "ns3/mac-rx-middle.h"
33 #include "ns3/pointer.h"
34 #include "ns3/string.h"
35 #include "ns3/vht-capabilities.h"
87 tid = tid > 7 ? 0 : tid;
113 NS_LOG_WARN(
"in OCB mode we should not call SetSsid");
119 NS_LOG_WARN(
"in OCB mode we should not call GetSsid");
127 NS_LOG_WARN(
"in OCB mode we should not call SetBsid");
133 NS_LOG_WARN(
"in OCB mode we should not call GetBssid");
154 NS_LOG_WARN(
"in OCB mode the like will never down, so linkDown will never be called");
325 NS_LOG_DEBUG(
"cannot find VscCallback for OrganizationIdentifier=" << oi);
328 bool succeed = cb(
this, oi, packet, from);
332 NS_LOG_DEBUG(
"vsc callback could not handle the packet successfully");
403 "PHY operating channel must have been set");
405 if (link.channelAccessManager !=
nullptr)
407 link.channelAccessManager->SetupPhyListener(
phy);
409 if (link.feManager !=
nullptr)
411 link.feManager->SetWifiPhy(
phy);
429 link.channelAccessManager = CreateObject<ChannelAccessManager>();
432 uint32_t cwmax = 1023;
452 auto feManager = CreateObject<WaveFrameExchangeManager>();
453 feManager->SetWifiMac(
this);
457 link.channelAccessManager->SetupFrameExchangeManager(feManager);
460 feManager->SetWifiPhy(
phy);
461 link.channelAccessManager->SetupPhyListener(
phy);
463 link.feManager = feManager;
515 ->SetWaveNetDevice(device);
518 std::optional<uint8_t>
bool IsNull() const
Check for null implementation.
void NotifyWakeupNow()
Notify the Txop that the device has been resumed from sleep mode.
void NotifyCcaBusyStartNow(Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations)
void NotifySleepNow()
Notify the Txop that the device has been put in sleep mode.
void NotifySwitchingStartNow(Time duration)
void Add(Ptr< Txop > txop)
static Mac48Address GetBroadcast()
STAs communicate with each directly outside the context of a BSS.
std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const override
Get the ID of the link having the given MAC address, if any.
virtual Ssid GetSsid() const
virtual void SetBssid(Mac48Address bssid)
void ConfigureStandard(WifiStandard standard) override
void SetWifiPhy(Ptr< WifiPhy > phy)
Set the PHY.
VendorSpecificContentManager m_vscManager
VSC manager.
void SetLinkUpCallback(Callback< void > linkUp) override
SetLinkUpCallback and SetLinkDownCallback will be overloaded In OCB mode, stations can send packets d...
void Suspend()
To support MAC extension for multiple channel operation, Suspend the activity in current MAC entity.
void AddReceiveVscCallback(OrganizationIdentifier oi, VscCallback cb)
virtual Mac48Address GetBssid(uint8_t) const
This method shall not be used in WAVE environment and here it will overloaded to log warn message.
virtual void SetSsid(Ssid ssid)
void EnableForWave(Ptr< WaveNetDevice > device)
void SendVsc(Ptr< Packet > vsc, Mac48Address peer, OrganizationIdentifier oi)
void ConfigureEdca(uint32_t cwmin, uint32_t cwmax, uint32_t aifsn, AcIndex ac)
void Enqueue(Ptr< Packet > packet, Mac48Address to) override
virtual void SetLinkDownCallback(Callback< void > linkDown)
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
void DoDispose() override
Destructor implementation.
void Resume()
To support MAC extension for multiple channel operation, Resume the activity of suspended MAC entity.
void MakeVirtualBusy(Time duration)
void RemoveReceiveVscCallback(OrganizationIdentifier oi)
static TypeId GetTypeId()
Get the type ID.
void CancleTx(AcIndex ac)
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
void Reset()
To support MAC extension for multiple channel operation, Reset current MAC entity and flush its inter...
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
The IEEE 802.11 SSID Information Element.
Simulation virtual time values and global simulation resolution.
void SetMaxCw(uint32_t maxCw)
Set the maximum contention window size.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
void SetAifsn(uint8_t aifsn)
Set the number of slots that make up an AIFS.
void SetMinCw(uint32_t minCw)
Set the minimum contention window size.
virtual void Queue(Ptr< Packet > packet, const WifiMacHeader &hdr)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
VscCallback FindVscCallback(OrganizationIdentifier &oi)
void DeregisterVscCallback(OrganizationIdentifier &oi)
base class for all MAC-level wifi objects.
Ptr< QosTxop > GetBEQueue() const
Accessor for the AC_BE channel access function.
Ptr< Txop > GetTxop() const
Accessor for the Txop object.
VhtCapabilities GetVhtCapabilities(uint8_t linkId) const
Return the VHT capabilities of the device for the given link.
bool GetQosSupported() const
Return whether the device supports QoS.
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
bool GetHtSupported() const
Return whether the device supports HT.
Ptr< QosTxop > GetVOQueue() const
Accessor for the AC_VO channel access function.
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
HtCapabilities GetHtCapabilities(uint8_t linkId) const
Return the HT capabilities of the device for the given link.
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy >> &phys)
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
virtual void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Ptr< QosTxop > GetVIQueue() const
Accessor for the AC_VI channel access function.
void SetLinkDownCallback(Callback< void > linkDown)
Ptr< QosTxop > GetBKQueue() const
Accessor for the AC_BK channel access function.
void NotifyRxDrop(Ptr< const Packet > packet)
virtual void SetLinkUpCallback(Callback< void > linkUp)
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
virtual void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Mac48Address GetAddress() const
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
void DoDispose() override
Destructor implementation.
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
void AddStationVhtCapabilities(Mac48Address from, VhtCapabilities vhtCapabilities)
Records VHT capabilities of the remote station.
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
void AddStationHtCapabilities(Mac48Address from, HtCapabilities htCapabilities)
Records HT capabilities of the remote station.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#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_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
uint8_t QosUtilsGetTidForPacket(Ptr< const Packet > packet)
If a QoS tag is attached to the packet, returns a value < 8.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
@ AC_UNDEF
Total number of ACs.
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
static const Mac48Address WILDCARD_BSSID
Wildcard BSSID.
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values
Ptr< FrameExchangeManager > feManager
Frame Exchange Manager object.
Ptr< ChannelAccessManager > channelAccessManager
channel access manager object