20#include "ns3/header-serialization-test.h"
22#include "ns3/mgt-headers.h"
23#include "ns3/multi-link-element.h"
24#include "ns3/reduced-neighbor-report.h"
25#include "ns3/wifi-phy-operating-channel.h"
59 std::vector<MultiLinkElement::PerStaProfileSubelement> subelements);
62 void DoRun()
override;
69 "Check serialization and deserialization of Basic variant Multi-Link elements"),
81 std::vector<MultiLinkElement::PerStaProfileSubelement> subelements)
102 for (std::size_t i = 0; i < subelements.size(); ++i)
132 .mediumSyncOfdmEdThreshold = 4,
133 .mediumSyncMaxNTxops = 5};
200 void DoRun()
override;
205 "Check serialization and deserialization of Reduced Neighbor Report elements")
220 std::stringstream info;
222 if (channel2_4It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
226 info <<
"{Ch=" << +
channel.GetNumber() <<
", Bw=" <<
channel.GetWidth() <<
", 2.4 GHz} ";
239 if (channel5It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
243 info <<
"{Ch=" << +
channel.GetNumber() <<
", Bw=" <<
channel.GetWidth() <<
", 5 GHz} ";
263 if (channel6It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
267 info <<
"{Ch=" << +
channel.GetNumber() <<
", Bw=" <<
channel.GetWidth() <<
", 6 GHz} ";
290 channel2_4It = channel5It = channel6It = WifiPhyOperatingChannel::m_frequencyChannels.cbegin();
293 while (channel2_4It != WifiPhyOperatingChannel::m_frequencyChannels.cend() ||
294 channel5It != WifiPhyOperatingChannel::m_frequencyChannels.cend() ||
295 channel6It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
297 if (channel2_4It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
299 channel2_4It = WifiPhyOperatingChannel::FindFirst(0,
306 if (channel5It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
308 channel5It = WifiPhyOperatingChannel::FindFirst(0,
315 if (channel6It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
317 channel6It = WifiPhyOperatingChannel::FindFirst(0,
328 if (channel2_4It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
332 if (channel5It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
336 if (channel6It != WifiPhyOperatingChannel::m_frequencyChannels.cend())
Test Multi-Link Element (Basic variant) serialization and deserialization.
WifiMacType m_frameType
the type of frame possibly included in the MLE
~BasicMultiLinkElementTest() override
BasicMultiLinkElementTest()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
MultiLinkElement GetMultiLinkElement(const CommonInfoBasicMle &commonInfo, std::vector< MultiLinkElement::PerStaProfileSubelement > subelements)
Get a Multi-Link Element including the given Common Info field and the given Per-STA Profile Subeleme...
Test Reduced Neighbor Report serialization and deserialization.
ReducedNeighborReport GetReducedNeighborReport(PhyOpChannelIt channel2_4It, PhyOpChannelIt channel5It, PhyOpChannelIt channel6It)
Get a Reduced Neighbor Report element including the given operating channels.
ReducedNeighborReportTest()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~ReducedNeighborReportTest() override
WifiPhyOperatingChannel::ConstIterator PhyOpChannelIt
typedef for const iterator on the set of available channels
wifi EHT Information Elements Test Suite
WifiEhtInfoElemsTestSuite()
Per-STA Profile Subelement of Multi-Link element.
void SetStaMacAddress(Mac48Address address)
Set the STA MAC Address subfield in the STA Info field.
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...
void SetLinkId(uint8_t linkId)
Set the Link ID subfield in the STA Control field.
void AddPerStaProfileSubelement()
Add a Per-STA Profile Subelement in the Link Info field.
void SetMediumSyncMaxNTxops(uint8_t nTxops)
Set the Medium Synchronization Maximum Number of TXOPs subfield of the Medium Synchronization Delay i...
void SetBssParamsChangeCount(uint8_t count)
Set the BSS Parameters Change Count subfield in the Common Info field.
void SetLinkIdInfo(uint8_t linkIdInfo)
Set the Link ID Info subfield in the Common Info field.
void SetMediumSyncDelayTimer(Time delay)
Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay information in t...
PerStaProfileSubelement & GetPerStaProfile(std::size_t i)
Get a reference to the i-th Per-STA Profile Subelement in the Link Info field.
void SetMediumSyncOfdmEdThreshold(int8_t threshold)
Set the Medium Synchronization OFDM ED Threshold subfield of the Medium Synchronization Delay informa...
void SetMldMacAddress(Mac48Address address)
Set the MLD MAC Address subfield in the Common Info field.
The Reduced Neighbor Report element.
std::size_t GetNNbrApInfoFields() const
Get the number of Neighbor AP Information fields.
void SetMldParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t mldId, uint8_t linkId, uint8_t changeSequence)
Set the MLD Parameters subfield of the i-th TBTT Information field of the given Neighbor AP Informati...
void SetShortSsid(std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid)
Set the Short SSID field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
void SetBssid(std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid)
Set the BSSID field of the i-th TBTT Information field of the given Neighbor AP Information field.
void SetPsd20MHz(std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz)
Set the 20 MHz PSD field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
void AddNbrApInfoField()
Add a Neighbor AP Information field.
void SetBssParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t bssParameters)
Set the BSS Parameters field of the i-th TBTT Information field of the given Neighbor AP Information ...
void AddTbttInformationField(std::size_t nbrApInfoId)
Add a TBTT Information fields to the TBTT Information Set field of the given Neighbor AP Information ...
void SetOperatingChannel(std::size_t nbrApInfoId, const WifiPhyOperatingChannel &channel)
Set the Operating Class and the Channel Number fields of the given Neighbor AP Information field base...
The IEEE 802.11 SSID Information Element.
The Supported Rates Information Element.
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Class that keeps track of all information about the current PHY operating channel.
std::set< FrequencyChannelInfo >::const_iterator ConstIterator
Typedef for a const iterator pointing to a channel in the set of available channels.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ 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.
WifiMacType
Combination of valid MAC header type/subtype.
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
Medium Synchronization Delay Information subfield.
uint8_t mediumSyncDuration
Medium Synchronization Duration.
Common Info field of the Basic Multi-Link element.
std::optional< MediumSyncDelayInfo > m_mediumSyncDelayInfo
Medium Synchronization Delay Information.
Mac48Address m_mldMacAddress
Subfields.
std::optional< uint8_t > m_bssParamsChangeCount
BSS Parameters Change Count.
std::optional< uint8_t > m_linkIdInfo
Link ID Info.
static WifiEhtInfoElemsTestSuite g_wifiEhtInfoElemsTestSuite
the test suite