15#include "ns3/multi-link-element.h"
16#include "ns3/packet.h"
17#include "ns3/simulator.h"
55 m_actionValue =
static_cast<uint8_t
>(action.radioMeasurementAction);
67 m_actionValue =
static_cast<uint8_t
>(action.selfProtectedAction);
79 m_actionValue =
static_cast<uint8_t
>(action.unprotectedDmgAction);
83 m_actionValue =
static_cast<uint8_t
>(action.protectedEhtAction);
482 .SetGroupName(
"Wifi")
493std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
497 pkt->PeekHeader(actionHdr);
501std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
505 pkt->RemoveHeader(actionHdr);
512#define CASE_ACTION_VALUE(x) \
555 os <<
"RADIO_MEASUREMENT[";
598 os <<
"SELF_PROTECTED[";
655 os <<
"UNPROTECTED_DMG[";
669 os <<
"PROTECTED_EHT[";
687 os <<
"VENDOR_SPECIFIC_ACTION";
692#undef CASE_ACTION_VALUE
726 static TypeId tid =
TypeId(
"ns3::MgtAddBaRequestHeader")
728 .SetGroupName(
"Wifi")
903 m_tid = (params >> 2) & 0x0f;
916 static TypeId tid =
TypeId(
"ns3::MgtAddBaResponseHeader")
918 .SetGroupName(
"Wifi")
932 os <<
"status code=" <<
m_code;
1082 m_tid = (params >> 2) & 0x0f;
1097 .SetGroupName(
"Wifi")
1149 auto tid =
static_cast<uint8_t
>(
m_tid);
1169 m_tid =
static_cast<uint16_t
>(tid);
1185 m_tid = (params >> 12) & 0x0f;
1197 static TypeId tid =
TypeId(
"ns3::MgtEmlOperatingModeNotification")
1199 .SetGroupName(
"Wifi")
1221 os <<
" EMLSR Padding Delay="
1224 <<
" EMLSR Transition Delay="
1256 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1263 "The EMLSR/EMLMR Link Bitmap is present if and only if either of the EMLSR "
1264 "Mode and EMLMR Mode subfields are set to 1");
1273 "The EMLSR Parameter Update field is present "
1275 <<
" if and only if the EMLSR "
1276 "Parameter Update Control subfield is set to 1 "
1292 uint8_t val = i.
ReadU8();
1298 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1332 std::list<uint8_t>
list;
1335 for (uint8_t linkId = 0; linkId < 16; linkId++)
1337 if ((bitmap & 0x0001) == 1)
1339 list.push_back(linkId);
1357 .SetGroupName(
"Wifi")
1369 : m_len(m_frameCtl.m_lenPresenceInd),
1370 m_fdCap(m_frameCtl.m_capPresenceInd),
1371 m_primaryCh(m_frameCtl.m_primChPresenceInd),
1372 m_apConfigSeqNum(m_frameCtl.m_apCsnPresenceInd),
1373 m_accessNetOpt(m_frameCtl.m_anoPresenceInd),
1374 m_chCntrFreqSeg1(m_frameCtl.m_chCntrFreqSeg1PresenceInd)
1396 size +=
m_fdCap.has_value() ? 2 : 0;
1410 size +=
m_rnr.has_value() ?
m_rnr->GetSerializedSize() : 0;
1411 size +=
m_tim.has_value() ?
m_tim->GetSerializedSize() : 0;
1430 NS_ABORT_MSG_IF(infoFieldSize < nonOptSubfieldsSize,
"Length subfield is less than 0");
1431 m_len = infoFieldSize - nonOptSubfieldsSize;
1440 <<
"SSID=" <<
m_ssid <<
", ";
1443 os <<
"Length=" << *
m_len <<
", ";
1447 os <<
"FD Capability=" << *
m_fdCap <<
", ";
1451 os <<
"Operating Class=" << *
m_opClass <<
", ";
1469 if (
m_tim.has_value())
1471 os <<
"Traffic Indicator Map=" << *
m_tim;
1512 i =
m_rnr.has_value() ?
m_rnr->Serialize(i) : i;
1513 i =
m_tim.has_value() ?
m_tim->Serialize(i) : i;
1527 m_ssid = std::string(
reinterpret_cast<char*
>(ssid.data()));
1535 nOctets =
m_fdCap->Deserialize(i);
1558 i =
m_rnr->DeserializeIfPresent(i);
1566 i =
m_tim->DeserializeIfPresent(i);
1598 start.WriteHtolsbU16(val);
1604 auto val = start.ReadLsbtohU16();
1606 m_ssidLen = val & 0x001f;
1607 m_capPresenceInd = ((val >> 5) & 0x0001) == 1;
1608 m_shortSsidInd = (val >> 6) & 0x0001;
1609 m_apCsnPresenceInd = ((val >> 7) & 0x0001) == 1;
1610 m_anoPresenceInd = ((val >> 8) & 0x0001) == 1;
1611 m_chCntrFreqSeg1PresenceInd = ((val >> 9) & 0x0001) == 1;
1612 m_primChPresenceInd = ((val >> 10) & 0x0001) == 1;
1613 m_rsnInfoPresenceInd = (val >> 11) & 0x0001;
1614 m_lenPresenceInd = ((val >> 12) & 0x0001) == 1;
1615 m_mdPresenceInd = (val >> 13) & 0x0001;
1623 os <<
"ess:" << capability.
m_ess <<
" privacy:" << capability.
m_privacy
1624 <<
" channelWidth:" << capability.
m_chWidth <<
" maxNss:" << capability.
m_maxNss
1633 uint16_t val = m_ess | (m_privacy << 1) | (m_chWidth << 2) | (m_maxNss << 5) |
1634 (m_multiBssidPresenceInd << 9) | (m_phyIdx << 10) | (m_minRate << 13);
1635 start.WriteHtolsbU16(val);
1641 auto val = start.ReadLsbtohU16();
1643 m_ess = val & 0x0001;
1644 m_privacy = (val >> 1) & 0x0001;
1645 m_chWidth = (val >> 2) & 0x0007;
1646 m_maxNss = (val >> 5) & 0x0007;
1647 m_multiBssidPresenceInd = (val >> 9) & 0x0001;
1648 m_phyIdx = (val >> 10) & 0x0007;
1649 m_minRate = (val >> 13) & 0x0007;
1657 m_chWidth = (width == 20 || width == 22) ? 0
1660 : (width == 160) ? 3
1670 return m_phyIdx == 0 ? 22 : 20;
1689 m_maxNss = std::min<uint8_t>(maxNss, 4);
1695 return m_maxNss + 1;
1736 "Invalid PHY band (" << band <<
") with PHY index of 1");
The IEEE 802.11 ADDBA Extension Element (Sec.
ExtParamSet m_extParamSet
ADDBA Extended Parameter Set field.
iterator in a Buffer instance
void WriteHtolsbU16(uint16_t data)
void WriteU8(uint8_t data)
void Write(const uint8_t *buffer, uint32_t size)
void Read(uint8_t *buffer, uint32_t size)
void WriteHtolsbU64(uint64_t data)
uint32_t GetDistanceFrom(const Iterator &o) const
void Next()
go forward by one byte
Implement the header for Action frames of type EML Operating Mode Notification.
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
EmlControl m_emlControl
EML Control field.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_dialogToken
Dialog Token.
std::list< uint8_t > GetLinkBitmap() const
static TypeId GetTypeId()
Register this type.
constexpr void reset()
Destroy the value (if any) contained in the optional field.
constexpr bool has_value() const
Check whether this object contains a value.
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Status code for association response.
Buffer::Iterator Serialize(Buffer::Iterator start) const
Buffer::Iterator Deserialize(Buffer::Iterator start)
uint32_t GetSerializedSize() const
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#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.
WifiPhyBand
Identifies the PHY band.
@ WIFI_STANDARD_UNSPECIFIED
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
uint8_t extBufferSize
extended buffer size
static Time DecodeEmlsrTransitionDelay(uint8_t value)
static Time DecodeEmlsrPaddingDelay(uint8_t value)
std::optional< uint8_t > mcsMapCountCtrl
MCS Map Count Control.
uint8_t emlsrMode
EMLSR Mode.
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
uint8_t emlmrMode
EMLMR Mode.
std::optional< uint16_t > linkBitmap
EMLSR/EMLMR Link Bitmap.
EMLSR Parameter Update field.
uint8_t paddingDelay
EMLSR Padding Delay.