26 #include "ns3/packet.h"
36 return std::pow(10.0, 0.1 * dB);
42 return std::pow(10.0, 0.1 * (dBm - 30.0));
48 return 10.0 * std::log10(w) + 30.0;
54 return 10.0 * std::log10(ratio);
97 userInfo.SetMuBarTriggerDepUserInfo(bar);
119 IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
121 return ((seq - winstart + 4096) % 4096) < winsize;
151 if (dlLinkMapping.empty() && ulLinkMapping.empty())
157 if (dlLinkMapping.size() != 8 || ulLinkMapping.size() != 8)
163 const auto& linkSet = dlLinkMapping.cbegin()->second;
165 for (
const auto& linkMapping : {std::cref(dlLinkMapping), std::cref(ulLinkMapping)})
167 for (
const auto& [tid, links] : linkMapping.get())
169 if (links != linkSet)
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void AddTrailer(const Trailer &trailer)
Add trailer to this packet.
Implements the IEEE 802.11 MAC trailer.
uint32_t GetSerializedSize() const override
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double RatioToDb(double ratio)
Convert from ratio to dB.
double WToDbm(double w)
Convert from Watts to dBm.
uint32_t GetRtsSize()
Return the total RTS size (including FCS trailer).
double DbmToW(double dBm)
Convert from dBm to Watts.
uint32_t GetBlockAckRequestSize(BlockAckReqType type)
Return the total BlockAckRequest size (including FCS trailer).
uint32_t GetMuBarSize(std::list< BlockAckReqType > types)
Return the total MU-BAR size (including FCS trailer).
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< uint8_t, std::set< uint8_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
uint32_t GetAckSize()
Return the total Ack size (including FCS trailer).
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.
double DbToRatio(double dB)
Convert from dB to ratio.
uint32_t GetCtsSize()
Return the total CTS size (including FCS trailer).
bool IsInWindow(uint16_t seq, uint16_t winstart, uint16_t winsize)
The different BlockAckRequest variants.
The different BlockAck variants.