17#include "ns3/fatal-error.h"
59 return (os <<
"DOWNLINK");
61 return (os <<
"UPLINK");
63 return (os <<
"BOTH_DIRECTIONS");
66 return (os <<
"INVALID");
147 NS_ASSERT(
static_cast<uint16_t
>(channelWidth) % 20 == 0);
148 return channelWidth /
MHz_u{20};
164 const auto width = upper - lower;
165 NS_ASSERT((
static_cast<uint16_t
>(width) % 20 == 0));
199 const std::list<BlockAckReqType>& types);
227bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize);
243uint32_t GetSize(Ptr<const Packet> packet,
const WifiMacHeader* hdr,
bool isAmpdu);
271bool IsGcr(Ptr<WifiMac> mac,
const WifiMacHeader& hdr);
base class for all MAC-level wifi objects.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#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.
TriggerFrameVariant
The different variants for Common Info field and User Info field of Trigger Frames.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint32_t GetMuBarSize(TriggerFrameVariant variant, MHz_u bw, const std::list< BlockAckReqType > &types)
Return the total MU-BAR size (including FCS trailer).
FrequencyRange GetFrequencyRange(WifiPhyBand band)
Get the frequency range corresponding to the given PHY band.
static constexpr uint8_t WIFI_TID_UNDEFINED
Invalid TID identifier.
uint32_t GetRtsSize()
Return the total RTS size (including FCS trailer).
dB_u RatioToDb(double ratio)
Convert from ratio to dB.
std::ostream & operator<<(std::ostream &os, const Angles &a)
MHz_u HzToMHz(Hz_u val)
Convert from Hz to MHz.
dBm_u WToDbm(Watt_u val)
Convert from Watts to dBm.
double MHz_u
MHz weak type.
bool IsGroupcast(const Mac48Address &adr)
Check whether a MAC destination address corresponds to a groupcast transmission.
Time GetEstimatedAckTxTime(const WifiTxVector &txVector)
std::size_t Count20MHzSubchannels(MHz_u channelWidth)
Return the number of 20 MHz subchannels covering the channel width.
double dBm_u
dBm weak type
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
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...
double DbToRatio(dB_u val)
Convert from dB to ratio.
uint8_t tid_t
IEEE 802.11-2020 9.2.4.5.2 TID subfield.
WifiDirection
Wifi direction.
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
bool TidToLinkMappingValidForNegType1(const WifiTidLinkMapping &dlLinkMapping, const WifiTidLinkMapping &ulLinkMapping)
Check if the given TID-to-Link Mappings are valid for a negotiation type of 1.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
void AddWifiMacTrailer(Ptr< Packet > packet)
Add FCS trailer to a packet.
std::map< tid_t, std::set< linkId_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
static constexpr uint8_t WIFI_LINKID_UNDEFINED
Invalid link identifier.
Hz_u MHzToHz(MHz_u val)
Convert from MHz to Hz.
uint32_t GetAckSize()
Return the total Ack size (including FCS trailer).
uint8_t linkId_t
IEEE 802.11be D7.0 Figure 9-207e—Link ID Info field format.
uint32_t GetSize(Ptr< const Packet > packet, const WifiMacHeader *hdr, bool isAmpdu)
Return the total size of the packet after WifiMacHeader and FCS trailer have been added.
bool IsGcr(Ptr< WifiMac > mac, const WifiMacHeader &hdr)
Return whether a given packet is transmitted using the GCR service.
double Watt_u
Watt weak type.
uint32_t GetCtsSize()
Return the total CTS size (including FCS trailer).
Mac48Address GetIndividuallyAddressedRecipient(Ptr< WifiMac > mac, const WifiMacHeader &hdr)
Get the MAC address of the individually addressed recipient to use for a given packet.
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
Declaration of the constants used across wifi module.