9#ifndef MULTI_LINK_ELEMENT_H
10#define MULTI_LINK_ELEMENT_H
12#include "ns3/nstime.h"
13#include "ns3/wifi-information-element.h"
14#include "ns3/wifi-mac-header.h"
23class MgtAssocRequestHeader;
24class MgtReassocRequestHeader;
25class MgtAssocResponseHeader;
29 std::reference_wrapper<MgtReassocRequestHeader>>;
78 std::optional<MediumSyncDelayInfo>
226 std::reference_wrapper<const MgtAssocRequestHeader>,
227 std::reference_wrapper<const MgtReassocRequestHeader>,
228 std::reference_wrapper<const MgtAssocResponseHeader>>;
489 const std::variant<MgtAssocRequestHeader, MgtReassocRequestHeader>& assoc);
491 void SetAssocRequest(std::variant<MgtAssocRequestHeader, MgtReassocRequestHeader>&& assoc);
557 std::variant<std::monostate,
558 std::unique_ptr<MgtAssocRequestHeader>,
559 std::unique_ptr<MgtReassocRequestHeader>,
560 std::unique_ptr<MgtAssocResponseHeader>>
608 std::vector<PerStaProfileSubelement>
iterator in a Buffer instance
Per-STA Profile Subelement of Multi-Link element.
PerStaProfileSubelement(Variant variant)
Constructor.
Variant m_variant
Multi-Link element variant.
MgtAssocResponseHeader & GetAssocResponse() const
Get the (Re)Association Response frame body included in the STA Profile field of this Per-STA Profile...
PerStaProfileSubelement & operator=(PerStaProfileSubelement &&perStaProfile)=default
Use default move assignment operator.
AssocReqRefVariant GetAssocRequest() const
Get the (Re)Association Request frame body included in the STA Profile field of this Per-STA Profile ...
bool HasReassocRequest() const
Return true if a Reassociation Request frame body is included in the STA Profile field of this Per-ST...
Mac48Address GetStaMacAddress() const
Get the STA MAC Address subfield in the STA Info field, if present.
bool HasStaMacAddress() const
Return true if the STA MAC Address subfield in the STA Info field is present.
void SetAssocResponse(const MgtAssocResponseHeader &assoc)
Include the given (Re)Association Response frame body in the STA Profile field of this Per-STA Profil...
PerStaProfileSubelement & operator=(const PerStaProfileSubelement &perStaProfile)
Copy assignment operator performing a deep copy of the object.
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetStaInfoLength() const
Get the size in bytes of the serialized STA Info Length subfield of the STA Info field.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
void SetStaMacAddress(Mac48Address address)
Set the STA MAC Address subfield in the STA Info field.
Mac48Address m_staMacAddress
STA MAC address.
void SetCompleteProfile()
Set the Complete Profile flag in the STA Control field.
void SetAssocRequest(const std::variant< MgtAssocRequestHeader, MgtReassocRequestHeader > &assoc)
Include the given (Re)Association Request frame body in the STA Profile field of this Per-STA Profile...
ContainingFrame m_containingFrame
the mgt frame containing this Per-STA Profile
std::variant< std::monostate, std::unique_ptr< MgtAssocRequestHeader >, std::unique_ptr< MgtReassocRequestHeader >, std::unique_ptr< MgtAssocResponseHeader > > m_staProfile
STA Profile field, containing the frame body of a frame of the same type as the frame containing the ...
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
bool IsCompleteProfileSet() const
void SetLinkId(uint8_t linkId)
Set the Link ID subfield in the STA Control field.
bool HasAssocRequest() const
Return true if an Association Request frame body is included in the STA Profile field of this Per-STA...
uint16_t m_staControl
STA Control field.
uint8_t GetLinkId() const
Get the Link ID subfield in the STA Control field.
bool HasAssocResponse() const
Return true if a (Re)Association Response frame body is included in the STA Profile field of this Per...
ContainingFrame m_containingFrame
reference to the mgt frame containing this MLE
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
bool HasBssParamsChangeCount() const
Return true if the BSS Parameters Change Count subfield in the Common Info field is present and false...
void AddPerStaProfileSubelement()
Add a Per-STA Profile Subelement in the Link Info field.
void SetEmlsrSupported(bool supported)
Set the EMLSR Support subfield of the EML Capabilities subfield in the Common Info field to 1 if EMLS...
Time GetTransitionTimeout() const
Get the Transition Timeout subfield of the EML Capabilities subfield in the Common Info field.
void SetBssParamsChangeCount(uint8_t count)
Set the BSS Parameters Change Count subfield in the Common Info field.
uint8_t GetBssParamsChangeCount() const
Return the BSS Parameters Change Count subfield in the Common Info field.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
std::variant< CommonInfoBasicMle, std::monostate > CommonInfo
Typedef for structure holding a Common Info field.
void SetLinkIdInfo(uint8_t linkIdInfo)
Set the Link ID Info subfield in the Common Info field.
void SetVariant(Variant variant)
Set the variant of this Multi-Link Element.
Time GetEmlsrTransitionDelay() const
Get the EMLSR Transition Delay subfield of the EML Capabilities subfield in the Common Info field.
std::vector< PerStaProfileSubelement > m_perStaProfileSubelements
Per-STA Profile Subelements.
CommonInfoBasicMle & GetCommonInfoBasic()
std::variant< std::monostate, std::reference_wrapper< const MgtAssocRequestHeader >, std::reference_wrapper< const MgtReassocRequestHeader >, std::reference_wrapper< const MgtAssocResponseHeader > > ContainingFrame
Typedef for structure holding a reference to the containing frame.
void SetEmlsrTransitionDelay(Time delay)
Set the EMLSR Transition Delay subfield of the EML Capabilities subfield in the Common Info field.
PerStaProfileSubelement & GetPerStaProfile(std::size_t i)
Get a reference to the i-th Per-STA Profile Subelement in the Link Info field.
Variant GetVariant() const
Get the Multi-Link element variant.
Time GetEmlsrPaddingDelay() const
Get the EMLSR Padding Delay subfield of the EML Capabilities subfield in the Common Info field.
void SetEmlsrPaddingDelay(Time delay)
Set the EMLSR Padding Delay subfield of the EML Capabilities subfield in the Common Info field.
CommonInfo m_commonInfo
Common Info field.
bool HasLinkIdInfo() const
Return true if the Link ID Info subfield in the Common Info field is present and false otherwise.
Mac48Address GetMldMacAddress() const
Return the MLD MAC Address subfield in the Common Info field.
bool HasEmlCapabilities() const
Return true if the EML Capabilities subfield in the Common Info field is present and false otherwise.
bool IsEmlsrSupported() const
Return true if the EMLSR Support subfield of the EML Capabilities subfield in the Common Info field i...
void SetMldMacAddress(Mac48Address address)
Set the MLD MAC Address subfield in the Common Info field.
MultiLinkElement(ContainingFrame frame={})
Construct a Multi-Link Element with no variant set.
WifiInformationElementId ElementIdExt() const override
Get the wifi information element ID extension.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
void SetTransitionTimeout(Time timeout)
Set the Transition Timeout subfield of the EML Capabilities subfield in the Common Info field.
std::size_t GetNPerStaProfileSubelements() const
Return the number of Per-STA Profile Subelement in the Link Info field.
uint8_t GetLinkIdInfo() const
Return the Link ID Info subfield in the Common Info field.
Simulation virtual time values and global simulation resolution.
Variant
Multi-Link element variants.
SubElementId
SubElement IDs.
@ PER_STA_PROFILE_SUBELEMENT_ID
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::variant< std::reference_wrapper< MgtAssocRequestHeader >, std::reference_wrapper< MgtReassocRequestHeader > > AssocReqRefVariant
variant holding a reference to a (Re)Association Request
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
EML Capabilities subfield.
uint8_t emlmrDelay
EMLMR Delay.
uint8_t emlsrSupport
EMLSR Support.
uint8_t emlsrPaddingDelay
EMLSR Padding Delay.
uint8_t emlmrSupport
EMLMR Support.
uint8_t emlsrTransitionDelay
EMLSR Transition Delay.
uint8_t transitionTimeout
Transition Timeout.
Medium Synchronization Delay Information subfield.
uint8_t mediumSyncOfdmEdThreshold
Medium Synchronization OFDM ED Threshold.
uint8_t mediumSyncDuration
Medium Synchronization Duration.
uint8_t mediumSyncMaxNTxops
Medium Synchronization MAximum Number of TXOPs.
MLD Capabilities subfield.
uint8_t freqSepForStrApMld
Frequency Separation For STR/AP MLD Type Indication.
uint8_t maxNSimultaneousLinks
Max number of simultaneous links.
uint8_t srsSupport
SRS Support.
uint8_t aarSupport
AAR Support.
uint8_t tidToLinkMappingSupport
TID-To-Link Mapping Negotiation Supported.
Common Info field of the Basic Multi-Link element.
uint16_t GetPresenceBitmap() const
Get the Presence Bitmap subfield of the Common Info field.
uint8_t GetSize() const
Get the size of the serialized Common Info field.
static uint8_t EncodeEmlsrTransitionDelay(Time delay)
static Time DecodeEmlsrTransitionDelay(uint8_t value)
std::optional< EmlCapabilities > m_emlCapabilities
EML Capabilities.
uint8_t Deserialize(Buffer::Iterator start, uint16_t presence)
Deserialize the Common Info field.
std::optional< uint8_t > GetMediumSyncMaxNTxops() const
Get the maximum number of TXOPs a non-AP STA is allowed to attempt to initiate while the MediumSyncDe...
int8_t GetMediumSyncOfdmEdThreshold() const
Get the Medium Synchronization OFDM ED Threshold in dBm.
std::optional< MldCapabilities > m_mldCapabilities
MLD Capabilities.
void SetMediumSyncOfdmEdThreshold(int8_t threshold)
Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization Delay Informa...
static Time DecodeEmlsrPaddingDelay(uint8_t value)
void Serialize(Buffer::Iterator &start) const
Serialize the Common Info field.
std::optional< MediumSyncDelayInfo > m_mediumSyncDelayInfo
Medium Synchronization Delay Information.
void SetMediumSyncDelayTimer(Time delay)
Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay Information in t...
Time GetMediumSyncDelayTimer() const
Get the Medium Synchronization Duration subfield of the Medium Synchronization Delay Information in t...
Mac48Address m_mldMacAddress
Subfields.
std::optional< uint8_t > m_bssParamsChangeCount
BSS Parameters Change Count.
void SetMediumSyncMaxNTxops(uint8_t nTxops)
Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization Delay I...
std::optional< uint8_t > m_linkIdInfo
Link ID Info.
static uint8_t EncodeEmlsrPaddingDelay(Time delay)