26#include "ns3/multi-link-element.h"
27#include "ns3/packet.h"
28#include "ns3/simulator.h"
66 m_actionValue =
static_cast<uint8_t
>(action.radioMeasurementAction);
78 m_actionValue =
static_cast<uint8_t
>(action.selfProtectedAction);
90 m_actionValue =
static_cast<uint8_t
>(action.unprotectedDmgAction);
94 m_actionValue =
static_cast<uint8_t
>(action.protectedEhtAction);
493 .SetGroupName(
"Wifi")
504std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
508 pkt->PeekHeader(actionHdr);
512std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
516 pkt->RemoveHeader(actionHdr);
523#define CASE_ACTION_VALUE(x) \
566 os <<
"RADIO_MEASUREMENT[";
609 os <<
"SELF_PROTECTED[";
666 os <<
"UNPROTECTED_DMG[";
680 os <<
"PROTECTED_EHT[";
698 os <<
"VENDOR_SPECIFIC_ACTION";
703#undef CASE_ACTION_VALUE
737 static TypeId tid =
TypeId(
"ns3::MgtAddBaRequestHeader")
739 .SetGroupName(
"Wifi")
914 m_tid = (params >> 2) & 0x0f;
927 static TypeId tid =
TypeId(
"ns3::MgtAddBaResponseHeader")
929 .SetGroupName(
"Wifi")
943 os <<
"status code=" <<
m_code;
1093 m_tid = (params >> 2) & 0x0f;
1108 .SetGroupName(
"Wifi")
1160 auto tid =
static_cast<uint8_t
>(
m_tid);
1180 m_tid =
static_cast<uint16_t
>(tid);
1196 m_tid = (params >> 12) & 0x0f;
1208 static TypeId tid =
TypeId(
"ns3::MgtEmlOperatingModeNotification")
1210 .SetGroupName(
"Wifi")
1232 os <<
" EMLSR Padding Delay="
1235 <<
" EMLSR Transition Delay="
1267 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1274 "The EMLSR/EMLMR Link Bitmap is present if and only if either of the EMLSR "
1275 "Mode and EMLMR Mode subfields are set to 1");
1284 "The EMLSR Parameter Update field is present "
1286 <<
" if and only if the EMLSR "
1287 "Parameter Update Control subfield is set to 1 "
1303 uint8_t val = i.
ReadU8();
1309 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1343 std::list<uint8_t>
list;
1346 for (uint8_t linkId = 0; linkId < 16; linkId++)
1348 if ((bitmap & 0x0001) == 1)
1350 list.push_back(linkId);
1368 .SetGroupName(
"Wifi")
1380 : m_len(m_frameCtl.m_lenPresenceInd),
1381 m_fdCap(m_frameCtl.m_capPresenceInd),
1382 m_primaryCh(m_frameCtl.m_primChPresenceInd),
1383 m_apConfigSeqNum(m_frameCtl.m_apCsnPresenceInd),
1384 m_accessNetOpt(m_frameCtl.m_anoPresenceInd),
1385 m_chCntrFreqSeg1(m_frameCtl.m_chCntrFreqSeg1PresenceInd)
1407 size +=
m_fdCap.has_value() ? 2 : 0;
1421 size +=
m_rnr.has_value() ?
m_rnr->GetSerializedSize() : 0;
1422 size +=
m_tim.has_value() ?
m_tim->GetSerializedSize() : 0;
1441 NS_ABORT_MSG_IF(infoFieldSize < nonOptSubfieldsSize,
"Length subfield is less than 0");
1442 m_len = infoFieldSize - nonOptSubfieldsSize;
1451 <<
"SSID=" <<
m_ssid <<
", ";
1454 os <<
"Length=" << *
m_len <<
", ";
1458 os <<
"FD Capability=" << *
m_fdCap <<
", ";
1462 os <<
"Operating Class=" << *
m_opClass <<
", ";
1480 if (
m_tim.has_value())
1482 os <<
"Traffic Indicator Map=" << *
m_tim;
1523 i =
m_rnr.has_value() ?
m_rnr->Serialize(i) : i;
1524 i =
m_tim.has_value() ?
m_tim->Serialize(i) : i;
1538 m_ssid = std::string(
reinterpret_cast<char*
>(ssid.data()));
1546 nOctets =
m_fdCap->Deserialize(i);
1569 i =
m_rnr->DeserializeIfPresent(i);
1577 i =
m_tim->DeserializeIfPresent(i);
1609 start.WriteHtolsbU16(val);
1615 auto val = start.ReadLsbtohU16();
1617 m_ssidLen = val & 0x001f;
1618 m_capPresenceInd = ((val >> 5) & 0x0001) == 1;
1619 m_shortSsidInd = (val >> 6) & 0x0001;
1620 m_apCsnPresenceInd = ((val >> 7) & 0x0001) == 1;
1621 m_anoPresenceInd = ((val >> 8) & 0x0001) == 1;
1622 m_chCntrFreqSeg1PresenceInd = ((val >> 9) & 0x0001) == 1;
1623 m_primChPresenceInd = ((val >> 10) & 0x0001) == 1;
1624 m_rsnInfoPresenceInd = (val >> 11) & 0x0001;
1625 m_lenPresenceInd = ((val >> 12) & 0x0001) == 1;
1626 m_mdPresenceInd = (val >> 13) & 0x0001;
1634 os <<
"ess:" << capability.
m_ess <<
" privacy:" << capability.
m_privacy
1635 <<
" channelWidth:" << capability.
m_chWidth <<
" maxNss:" << capability.
m_maxNss
1644 uint16_t val = m_ess | (m_privacy << 1) | (m_chWidth << 2) | (m_maxNss << 5) |
1645 (m_multiBssidPresenceInd << 9) | (m_phyIdx << 10) | (m_minRate << 13);
1646 start.WriteHtolsbU16(val);
1652 auto val = start.ReadLsbtohU16();
1654 m_ess = val & 0x0001;
1655 m_privacy = (val >> 1) & 0x0001;
1656 m_chWidth = (val >> 2) & 0x0007;
1657 m_maxNss = (val >> 5) & 0x0007;
1658 m_multiBssidPresenceInd = (val >> 9) & 0x0001;
1659 m_phyIdx = (val >> 10) & 0x0007;
1660 m_minRate = (val >> 13) & 0x0007;
1668 m_chWidth = (width == 20 || width == 22) ? 0
1671 : (width == 160) ? 3
1681 return m_phyIdx == 0 ? 22 : 20;
1700 m_maxNss = std::min<uint8_t>(maxNss, 4);
1706 return m_maxNss + 1;
1747 "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.