24#include "ns3/address-utils.h"
25#include "ns3/packet.h"
26#include "ns3/simulator.h"
62 static TypeId tid =
TypeId(
"ns3::MgtProbeResponseHeader")
148 .SetGroupName(
"Wifi")
162 static TypeId tid =
TypeId(
"ns3::MgtAssocRequestHeader")
164 .SetGroupName(
"Wifi")
202 SetMleContainingFrame();
226 SetMleContainingFrame();
252 if (
auto& mle = Get<MultiLinkElement>())
254 for (std::size_t
id = 0;
id < mle->GetNPerStaProfileSubelements();
id++)
256 auto& perStaProfile = mle->GetPerStaProfile(
id);
257 if (perStaProfile.HasAssocRequest())
259 auto& frameInPerStaProfile =
260 std::get<std::reference_wrapper<MgtAssocRequestHeader>>(
261 perStaProfile.GetAssocRequest())
263 frameInPerStaProfile.CopyIesFromContainingFrame(*
this);
280 "Bytes read (" << distance <<
") exceed expected number (" << length <<
")");
294 static TypeId tid =
TypeId(
"ns3::MgtReassocRequestHeader")
296 .SetGroupName(
"Wifi")
340 SetMleContainingFrame();
372 SetMleContainingFrame();
400 if (
auto& mle = Get<MultiLinkElement>())
402 for (std::size_t
id = 0;
id < mle->GetNPerStaProfileSubelements();
id++)
404 auto& perStaProfile = mle->GetPerStaProfile(
id);
405 if (perStaProfile.HasReassocRequest())
407 auto& frameInPerStaProfile =
408 std::get<std::reference_wrapper<MgtReassocRequestHeader>>(
409 perStaProfile.GetAssocRequest())
411 frameInPerStaProfile.CopyIesFromContainingFrame(*
this);
429 "Bytes read (" << distance <<
") exceed expected number (" << length <<
")");
443 static TypeId tid =
TypeId(
"ns3::MgtAssocResponseHeader")
445 .SetGroupName(
"Wifi")
495 SetMleContainingFrame();
521 os <<
"status code=" <<
m_code <<
", "
522 <<
"aid=" <<
m_aid <<
", ";
529 SetMleContainingFrame();
558 if (
auto& mle = Get<MultiLinkElement>())
560 for (std::size_t
id = 0;
id < mle->GetNPerStaProfileSubelements();
id++)
562 auto& perStaProfile = mle->GetPerStaProfile(
id);
563 if (perStaProfile.HasAssocResponse())
565 auto& frameInPerStaProfile = perStaProfile.GetAssocResponse();
566 frameInPerStaProfile.CopyIesFromContainingFrame(*
this);
584 "Bytes read (" << distance <<
") exceed expected number (" << length <<
")");
620 m_actionValue =
static_cast<uint8_t
>(action.radioMeasurementAction);
632 m_actionValue =
static_cast<uint8_t
>(action.selfProtectedAction);
644 m_actionValue =
static_cast<uint8_t
>(action.unprotectedDmgAction);
648 m_actionValue =
static_cast<uint8_t
>(action.protectedEhtAction);
1046 .SetGroupName(
"Wifi")
1057std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
1061 pkt->PeekHeader(actionHdr);
1065std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
1069 pkt->RemoveHeader(actionHdr);
1076#define CASE_ACTION_VALUE(x) \
1118 os <<
"RADIO_MEASUREMENT[";
1161 os <<
"SELF_PROTECTED[";
1218 os <<
"UNPROTECTED_DMG[";
1232 os <<
"PROTECTED_EHT[";
1250 os <<
"VENDOR_SPECIFIC_ACTION";
1255#undef CASE_ACTION_VALUE
1296 static TypeId tid =
TypeId(
"ns3::MgtAddBaRequestHeader")
1298 .SetGroupName(
"Wifi")
1453 m_tid = (params >> 2) & 0x0f;
1473 static TypeId tid =
TypeId(
"ns3::MgtAddBaResponseHeader")
1475 .SetGroupName(
"Wifi")
1489 os <<
"status code=" <<
m_code;
1619 m_tid = (params >> 2) & 0x0f;
1639 .SetGroupName(
"Wifi")
1691 uint8_t tid =
static_cast<uint8_t
>(
m_tid);
1711 m_tid =
static_cast<uint16_t
>(tid);
1727 m_tid = (params >> 12) & 0x0f;
1739 static TypeId tid =
TypeId(
"ns3::MgtEmlOperatingModeNotification")
1741 .SetGroupName(
"Wifi")
1763 os <<
" EMLSR Padding Delay="
1766 <<
" EMLSR Transition Delay="
1798 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1805 "The EMLSR/EMLMR Link Bitmap is present if and only if either of the EMLSR "
1806 "Mode and EMLMR Mode subfields are set to 1");
1815 "The EMLSR Parameter Update field is present "
1817 <<
" if and only if the EMLSR "
1818 "Parameter Update Control subfield is set to 1 "
1834 uint8_t val = i.
ReadU8();
1840 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1874 std::list<uint8_t>
list;
1877 for (uint8_t linkId = 0; linkId < 16; linkId++)
1879 if ((bitmap & 0x0001) == 1)
1881 list.push_back(linkId);
iterator in a Buffer instance
void WriteHtolsbU16(uint16_t data)
void WriteU8(uint8_t data)
void WriteHtolsbU64(uint64_t data)
uint32_t GetDistanceFrom(const Iterator &o) const
Implement the header for Action frames of type EML Operating Mode Notification.
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_dialogToken
Dialog Token.
EmlControl m_emlControl
EML Control field.
uint32_t Deserialize(Buffer::Iterator start) override
static TypeId GetTypeId()
Register this type.
std::list< uint8_t > GetLinkBitmap() const
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
void Print(std::ostream &os) const override
uint32_t GetSerializedSize() const override
void Serialize(Buffer::Iterator start) const override
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_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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::tuple< Ssid, SupportedRates, std::optional< ExtendedSupportedRatesIE >, std::optional< HtCapabilities >, std::optional< ExtendedCapabilities >, std::optional< VhtCapabilities >, std::optional< HeCapabilities >, std::optional< MultiLinkElement >, std::optional< EhtCapabilities >, std::optional< TidToLinkMapping > > AssocRequestElems
List of Information Elements included in Association Request frames.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
std::tuple< SupportedRates, std::optional< ExtendedSupportedRatesIE >, std::optional< EdcaParameterSet >, std::optional< HtCapabilities >, std::optional< HtOperation >, std::optional< ExtendedCapabilities >, std::optional< VhtCapabilities >, std::optional< VhtOperation >, std::optional< HeCapabilities >, std::optional< HeOperation >, std::optional< MuEdcaParameterSet >, std::optional< MultiLinkElement >, std::optional< EhtCapabilities >, std::optional< EhtOperation >, std::optional< TidToLinkMapping > > AssocResponseElems
List of Information Elements included in Association Response frames.
static Time DecodeEmlsrTransitionDelay(uint8_t value)
static Time DecodeEmlsrPaddingDelay(uint8_t value)
uint8_t emlmrMode
EMLMR Mode.
std::optional< uint8_t > mcsMapCountCtrl
MCS Map Count Control.
uint8_t emlsrMode
EMLSR Mode.
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
std::optional< uint16_t > linkBitmap
EMLSR/EMLMR Link Bitmap.
EMLSR Parameter Update field.