wifi: Port probe request and association request to the new mgt header
This commit is contained in:
committed by
Stefano Avallone
parent
19e376646e
commit
01cd73b174
@@ -1607,8 +1607,8 @@ ApWifiMac::Receive(Ptr<const WifiMpdu> mpdu, uint8_t linkId)
|
||||
}
|
||||
MgtProbeRequestHeader probeRequestHeader;
|
||||
packet->PeekHeader(probeRequestHeader);
|
||||
const Ssid& ssid = probeRequestHeader.GetSsid();
|
||||
if (ssid == GetSsid() || ssid.IsBroadcast())
|
||||
const auto& ssid = probeRequestHeader.Get<Ssid>();
|
||||
if (ssid == GetSsid() || ssid->IsBroadcast())
|
||||
{
|
||||
NS_LOG_DEBUG("Probe request received from " << from << ": send probe response");
|
||||
SendProbeResp(from, linkId);
|
||||
@@ -1700,9 +1700,11 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
|
||||
// first, verify that the the station's supported
|
||||
// rate set is compatible with our Basic Rate set
|
||||
const CapabilityInformation& capabilities = frame.GetCapabilities();
|
||||
const CapabilityInformation& capabilities = frame.Capabilities();
|
||||
remoteStationManager->AddSupportedPhyPreamble(from, capabilities.IsShortPreamble());
|
||||
const auto& rates = frame.GetSupportedRates();
|
||||
NS_ASSERT(frame.template Get<SupportedRates>());
|
||||
const auto rates = AllSupportedRates{*frame.template Get<SupportedRates>(),
|
||||
frame.template Get<ExtendedSupportedRatesIE>()};
|
||||
|
||||
if (rates.GetNRates() == 0)
|
||||
{
|
||||
@@ -1712,7 +1714,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
if (GetHtSupported())
|
||||
{
|
||||
// check whether the HT STA supports all MCSs in Basic MCS Set
|
||||
const auto& htCapabilities = frame.GetHtCapabilities();
|
||||
const auto& htCapabilities = frame.template Get<HtCapabilities>();
|
||||
if (htCapabilities.has_value() && htCapabilities->IsSupportedMcs(0))
|
||||
{
|
||||
for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
|
||||
@@ -1728,7 +1730,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
if (GetVhtSupported(linkId))
|
||||
{
|
||||
// check whether the VHT STA supports all MCSs in Basic MCS Set
|
||||
const auto& vhtCapabilities = frame.GetVhtCapabilities();
|
||||
const auto& vhtCapabilities = frame.template Get<VhtCapabilities>();
|
||||
if (vhtCapabilities.has_value() && vhtCapabilities->GetVhtCapabilitiesInfo() != 0)
|
||||
{
|
||||
for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
|
||||
@@ -1744,7 +1746,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
if (GetHeSupported())
|
||||
{
|
||||
// check whether the HE STA supports all MCSs in Basic MCS Set
|
||||
const auto& heCapabilities = frame.GetHeCapabilities();
|
||||
const auto& heCapabilities = frame.template Get<HeCapabilities>();
|
||||
if (heCapabilities.has_value() && heCapabilities->GetSupportedMcsAndNss() != 0)
|
||||
{
|
||||
for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
|
||||
@@ -1782,7 +1784,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
}
|
||||
if (GetHtSupported())
|
||||
{
|
||||
const auto& htCapabilities = frame.GetHtCapabilities();
|
||||
const auto& htCapabilities = frame.template Get<HtCapabilities>();
|
||||
if (htCapabilities.has_value() && htCapabilities->IsSupportedMcs(0))
|
||||
{
|
||||
remoteStationManager->AddStationHtCapabilities(from, *htCapabilities);
|
||||
@@ -1792,7 +1794,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
}
|
||||
if (GetVhtSupported(linkId))
|
||||
{
|
||||
const auto& vhtCapabilities = frame.GetVhtCapabilities();
|
||||
const auto& vhtCapabilities = frame.template Get<VhtCapabilities>();
|
||||
// we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used
|
||||
// to check whether it supports VHT
|
||||
if (vhtCapabilities.has_value() &&
|
||||
@@ -1811,7 +1813,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
}
|
||||
if (GetHeSupported())
|
||||
{
|
||||
const auto& heCapabilities = frame.GetHeCapabilities();
|
||||
const auto& heCapabilities = frame.template Get<HeCapabilities>();
|
||||
if (heCapabilities.has_value() && heCapabilities->GetSupportedMcsAndNss() != 0)
|
||||
{
|
||||
remoteStationManager->AddStationHeCapabilities(from, *heCapabilities);
|
||||
@@ -1827,7 +1829,7 @@ ApWifiMac::ReceiveAssocRequest(const AssocReqRefVariant& assoc,
|
||||
}
|
||||
if (GetEhtSupported())
|
||||
{
|
||||
if (const auto& ehtCapabilities = frame.GetEhtCapabilities())
|
||||
if (const auto& ehtCapabilities = frame.template Get<EhtCapabilities>())
|
||||
{
|
||||
remoteStationManager->AddStationEhtCapabilities(from, *ehtCapabilities);
|
||||
}
|
||||
@@ -1855,7 +1857,7 @@ ApWifiMac::ParseReportedStaInfo(const AssocReqRefVariant& assoc, Mac48Address fr
|
||||
|
||||
// lambda to process received Multi-Link Element
|
||||
auto recvMle = [&](auto&& frame) {
|
||||
const auto& mle = frame.get().GetMultiLinkElement();
|
||||
const auto& mle = frame.get().template Get<MultiLinkElement>();
|
||||
|
||||
if (!mle.has_value())
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,6 +48,16 @@
|
||||
namespace ns3
|
||||
{
|
||||
|
||||
/// List of Information Elements included in Probe Request frames
|
||||
using ProbeRequestElems = std::tuple<Ssid,
|
||||
SupportedRates,
|
||||
std::optional<ExtendedSupportedRatesIE>,
|
||||
std::optional<HtCapabilities>,
|
||||
std::optional<ExtendedCapabilities>,
|
||||
std::optional<VhtCapabilities>,
|
||||
std::optional<HeCapabilities>,
|
||||
std::optional<EhtCapabilities>>;
|
||||
|
||||
/// List of Information Elements included in Probe Response frames
|
||||
using ProbeResponseElems = std::tuple<Ssid,
|
||||
SupportedRates,
|
||||
@@ -68,6 +78,17 @@ using ProbeResponseElems = std::tuple<Ssid,
|
||||
std::optional<EhtCapabilities>,
|
||||
std::optional<EhtOperation>>;
|
||||
|
||||
/// List of Information Elements included in Association Request frames
|
||||
using AssocRequestElems = 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>>;
|
||||
|
||||
/// List of Information Elements included in Association Response frames
|
||||
using AssocResponseElems = std::tuple<SupportedRates,
|
||||
std::optional<ExtendedSupportedRatesIE>,
|
||||
@@ -88,169 +109,12 @@ using AssocResponseElems = std::tuple<SupportedRates,
|
||||
* \ingroup wifi
|
||||
* Implement the header for management frames of type association request.
|
||||
*/
|
||||
class MgtAssocRequestHeader : public Header
|
||||
class MgtAssocRequestHeader : public WifiMgtHeader<MgtAssocRequestHeader, AssocRequestElems>
|
||||
{
|
||||
friend class WifiMgtHeader<MgtAssocRequestHeader, AssocRequestElems>;
|
||||
|
||||
public:
|
||||
MgtAssocRequestHeader();
|
||||
~MgtAssocRequestHeader() override;
|
||||
|
||||
/**
|
||||
* Set the Service Set Identifier (SSID).
|
||||
*
|
||||
* \param ssid SSID
|
||||
*/
|
||||
void SetSsid(const Ssid& ssid);
|
||||
|
||||
/** \copydoc SetSsid */
|
||||
void SetSsid(Ssid&& ssid);
|
||||
|
||||
/**
|
||||
* Set the supported rates.
|
||||
*
|
||||
* \param rates the supported rates
|
||||
*/
|
||||
void SetSupportedRates(const AllSupportedRates& rates);
|
||||
|
||||
/** \copydoc SetSupportedRates */
|
||||
void SetSupportedRates(AllSupportedRates&& rates);
|
||||
|
||||
/**
|
||||
* Set the listen interval.
|
||||
*
|
||||
* \param interval the listen interval
|
||||
*/
|
||||
void SetListenInterval(uint16_t interval);
|
||||
|
||||
/**
|
||||
* Set the Capability information.
|
||||
*
|
||||
* \param capabilities Capability information
|
||||
*/
|
||||
void SetCapabilities(const CapabilityInformation& capabilities);
|
||||
|
||||
/** \copydoc SetCapabilities */
|
||||
void SetCapabilities(CapabilityInformation&& capabilities);
|
||||
|
||||
/**
|
||||
* Set the Extended Capabilities.
|
||||
*
|
||||
* \param extendedCapabilities the Extended Capabilities
|
||||
*/
|
||||
void SetExtendedCapabilities(const ExtendedCapabilities& extendedCapabilities);
|
||||
|
||||
/** \copydoc SetExtendedCapabilities */
|
||||
void SetExtendedCapabilities(ExtendedCapabilities&& extendedCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HT capabilities.
|
||||
*
|
||||
* \param htCapabilities HT capabilities
|
||||
*/
|
||||
void SetHtCapabilities(const HtCapabilities& htCapabilities);
|
||||
|
||||
/** \copydoc SetHtCapabilities */
|
||||
void SetHtCapabilities(HtCapabilities&& htCapabilities);
|
||||
|
||||
/**
|
||||
* Set the VHT capabilities.
|
||||
*
|
||||
* \param vhtCapabilities VHT capabilities
|
||||
*/
|
||||
void SetVhtCapabilities(const VhtCapabilities& vhtCapabilities);
|
||||
|
||||
/** \copydoc SetVhtCapabilities */
|
||||
void SetVhtCapabilities(VhtCapabilities&& vhtCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HE capabilities.
|
||||
*
|
||||
* \param heCapabilities HE capabilities
|
||||
*/
|
||||
void SetHeCapabilities(const HeCapabilities& heCapabilities);
|
||||
|
||||
/** \copydoc SetHeCapabilities */
|
||||
void SetHeCapabilities(HeCapabilities&& heCapabilities);
|
||||
|
||||
/**
|
||||
* Set the EHT capabilities.
|
||||
*
|
||||
* \param ehtCapabilities EHT capabilities
|
||||
*/
|
||||
void SetEhtCapabilities(const EhtCapabilities& ehtCapabilities);
|
||||
|
||||
/** \copydoc SetEhtCapabilities */
|
||||
void SetEhtCapabilities(EhtCapabilities&& ehtCapabilities);
|
||||
|
||||
/**
|
||||
* Set the Multi-Link Element information element
|
||||
*
|
||||
* \param multiLinkElement the Multi-Link Element information element
|
||||
*/
|
||||
void SetMultiLinkElement(const MultiLinkElement& multiLinkElement);
|
||||
|
||||
/** \copydoc SetMultiLinkElement */
|
||||
void SetMultiLinkElement(MultiLinkElement&& multiLinkElement);
|
||||
|
||||
/**
|
||||
* Return the Capability information.
|
||||
*
|
||||
* \return Capability information
|
||||
*/
|
||||
const CapabilityInformation& GetCapabilities() const;
|
||||
/**
|
||||
* Return the extended capabilities, if present.
|
||||
*
|
||||
* \return the extended capabilities, if present
|
||||
*/
|
||||
const std::optional<ExtendedCapabilities>& GetExtendedCapabilities() const;
|
||||
/**
|
||||
* Return the HT capabilities, if present.
|
||||
*
|
||||
* \return HT capabilities, if present
|
||||
*/
|
||||
const std::optional<HtCapabilities>& GetHtCapabilities() const;
|
||||
/**
|
||||
* Return the VHT capabilities, if present.
|
||||
*
|
||||
* \return VHT capabilities, if present
|
||||
*/
|
||||
const std::optional<VhtCapabilities>& GetVhtCapabilities() const;
|
||||
/**
|
||||
* Return the HE capabilities, if present.
|
||||
*
|
||||
* \return HE capabilities, if present
|
||||
*/
|
||||
const std::optional<HeCapabilities>& GetHeCapabilities() const;
|
||||
/**
|
||||
* Return the EHT capabilities, if present.
|
||||
*
|
||||
* \return EHT capabilities, if present
|
||||
*/
|
||||
const std::optional<EhtCapabilities>& GetEhtCapabilities() const;
|
||||
/**
|
||||
* Return the Service Set Identifier (SSID).
|
||||
*
|
||||
* \return SSID
|
||||
*/
|
||||
const Ssid& GetSsid() const;
|
||||
/**
|
||||
* Return the supported rates.
|
||||
*
|
||||
* \return the supported rates
|
||||
*/
|
||||
const AllSupportedRates& GetSupportedRates() const;
|
||||
/**
|
||||
* Return the listen interval.
|
||||
*
|
||||
* \return the listen interval
|
||||
*/
|
||||
uint16_t GetListenInterval() const;
|
||||
/**
|
||||
* Return the Multi-Link Element information element, if present.
|
||||
*
|
||||
* \return the Multi-Link Element information element, if present
|
||||
*/
|
||||
const std::optional<MultiLinkElement>& GetMultiLinkElement() const;
|
||||
~MgtAssocRequestHeader() override = default;
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
@@ -258,54 +122,8 @@ class MgtAssocRequestHeader : public Header
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
|
||||
/** \copydoc Header::GetInstanceTypeId */
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
void Print(std::ostream& os) const override;
|
||||
uint32_t GetSerializedSize() const override;
|
||||
void Serialize(Buffer::Iterator start) const override;
|
||||
uint32_t Deserialize(Buffer::Iterator start) override;
|
||||
|
||||
private:
|
||||
Ssid m_ssid; //!< Service Set ID (SSID)
|
||||
AllSupportedRates m_rates; //!< List of supported rates
|
||||
CapabilityInformation m_capability; //!< Capability information
|
||||
std::optional<ExtendedCapabilities> m_extendedCapability; //!< Extended capabilities
|
||||
std::optional<HtCapabilities> m_htCapability; //!< HT capabilities
|
||||
std::optional<VhtCapabilities> m_vhtCapability; //!< VHT capabilities
|
||||
std::optional<HeCapabilities> m_heCapability; //!< HE capabilities
|
||||
uint16_t m_listenInterval; //!< listen interval
|
||||
std::optional<EhtCapabilities> m_ehtCapability; //!< EHT capabilities
|
||||
std::optional<MultiLinkElement> m_multiLinkElement; //!< Multi-Link Element
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
* Implement the header for management frames of type reassociation request.
|
||||
*/
|
||||
class MgtReassocRequestHeader : public Header
|
||||
{
|
||||
public:
|
||||
MgtReassocRequestHeader();
|
||||
~MgtReassocRequestHeader() override;
|
||||
|
||||
/**
|
||||
* Set the Service Set Identifier (SSID).
|
||||
*
|
||||
* \param ssid SSID
|
||||
*/
|
||||
void SetSsid(const Ssid& ssid);
|
||||
|
||||
/** \copydoc SetSsid */
|
||||
void SetSsid(Ssid&& ssid);
|
||||
|
||||
/**
|
||||
* Set the supported rates.
|
||||
*
|
||||
* \param rates the supported rates
|
||||
*/
|
||||
void SetSupportedRates(const AllSupportedRates& rates);
|
||||
|
||||
/** \copydoc SetSupportedRates */
|
||||
void SetSupportedRates(AllSupportedRates&& rates);
|
||||
|
||||
/**
|
||||
* Set the listen interval.
|
||||
@@ -313,137 +131,82 @@ class MgtReassocRequestHeader : public Header
|
||||
* \param interval the listen interval
|
||||
*/
|
||||
void SetListenInterval(uint16_t interval);
|
||||
|
||||
/**
|
||||
* Set the Capability information.
|
||||
*
|
||||
* \param capabilities Capability information
|
||||
*/
|
||||
void SetCapabilities(const CapabilityInformation& capabilities);
|
||||
|
||||
/** \copydoc SetCapabilities */
|
||||
void SetCapabilities(CapabilityInformation&& capabilities);
|
||||
|
||||
/**
|
||||
* Set the Extended Capabilities.
|
||||
*
|
||||
* \param extendedCapabilities the Extended Capabilities
|
||||
*/
|
||||
void SetExtendedCapabilities(const ExtendedCapabilities& extendedCapabilities);
|
||||
|
||||
/** \copydoc SetExtendedCapabilities */
|
||||
void SetExtendedCapabilities(ExtendedCapabilities&& extendedCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HT capabilities.
|
||||
*
|
||||
* \param htCapabilities HT capabilities
|
||||
*/
|
||||
void SetHtCapabilities(const HtCapabilities& htCapabilities);
|
||||
|
||||
/** \copydoc SetHtCapabilities */
|
||||
void SetHtCapabilities(HtCapabilities&& htCapabilities);
|
||||
|
||||
/**
|
||||
* Set the VHT capabilities.
|
||||
*
|
||||
* \param vhtCapabilities VHT capabilities
|
||||
*/
|
||||
void SetVhtCapabilities(const VhtCapabilities& vhtCapabilities);
|
||||
|
||||
/** \copydoc SetVhtCapabilities */
|
||||
void SetVhtCapabilities(VhtCapabilities&& vhtCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HE capabilities.
|
||||
*
|
||||
* \param heCapabilities HE capabilities
|
||||
*/
|
||||
void SetHeCapabilities(const HeCapabilities& heCapabilities);
|
||||
|
||||
/** \copydoc SetHeCapabilities */
|
||||
void SetHeCapabilities(HeCapabilities&& heCapabilities);
|
||||
|
||||
/**
|
||||
* Set the EHT capabilities.
|
||||
*
|
||||
* \param ehtCapabilities EHT capabilities
|
||||
*/
|
||||
void SetEhtCapabilities(const EhtCapabilities& ehtCapabilities);
|
||||
|
||||
/** \copydoc SetEhtCapabilities */
|
||||
void SetEhtCapabilities(EhtCapabilities&& ehtCapabilities);
|
||||
|
||||
/**
|
||||
* Set the Multi-Link Element information element
|
||||
*
|
||||
* \param multiLinkElement the Multi-Link Element information element
|
||||
*/
|
||||
void SetMultiLinkElement(const MultiLinkElement& multiLinkElement);
|
||||
|
||||
/** \copydoc SetMultiLinkElement */
|
||||
void SetMultiLinkElement(MultiLinkElement&& multiLinkElement);
|
||||
|
||||
/**
|
||||
* Return the Capability information.
|
||||
*
|
||||
* \return Capability information
|
||||
*/
|
||||
const CapabilityInformation& GetCapabilities() const;
|
||||
/**
|
||||
* Return the extended capabilities, if present.
|
||||
*
|
||||
* \return the extended capabilities, if present
|
||||
*/
|
||||
const std::optional<ExtendedCapabilities>& GetExtendedCapabilities() const;
|
||||
/**
|
||||
* Return the HT capabilities, if present.
|
||||
*
|
||||
* \return HT capabilities, if present
|
||||
*/
|
||||
const std::optional<HtCapabilities>& GetHtCapabilities() const;
|
||||
/**
|
||||
* Return the VHT capabilities, if present.
|
||||
*
|
||||
* \return VHT capabilities, if present
|
||||
*/
|
||||
const std::optional<VhtCapabilities>& GetVhtCapabilities() const;
|
||||
/**
|
||||
* Return the HE capabilities, if present.
|
||||
*
|
||||
* \return HE capabilities, if present
|
||||
*/
|
||||
const std::optional<HeCapabilities>& GetHeCapabilities() const;
|
||||
/**
|
||||
* Return the EHT capabilities, if present.
|
||||
*
|
||||
* \return EHT capabilities, if present
|
||||
*/
|
||||
const std::optional<EhtCapabilities>& GetEhtCapabilities() const;
|
||||
/**
|
||||
* Return the Service Set Identifier (SSID).
|
||||
*
|
||||
* \return SSID
|
||||
*/
|
||||
const Ssid& GetSsid() const;
|
||||
/**
|
||||
* Return the supported rates.
|
||||
*
|
||||
* \return the supported rates
|
||||
*/
|
||||
const AllSupportedRates& GetSupportedRates() const;
|
||||
/**
|
||||
* Return the Multi-Link Element information element, if present.
|
||||
*
|
||||
* \return the Multi-Link Element information element, if present
|
||||
*/
|
||||
const std::optional<MultiLinkElement>& GetMultiLinkElement() const;
|
||||
/**
|
||||
* Return the listen interval.
|
||||
*
|
||||
* \return the listen interval
|
||||
*/
|
||||
uint16_t GetListenInterval() const;
|
||||
/**
|
||||
* \return a reference to the Capability information
|
||||
*/
|
||||
CapabilityInformation& Capabilities();
|
||||
/**
|
||||
* \return a const reference to the Capability information
|
||||
*/
|
||||
const CapabilityInformation& Capabilities() const;
|
||||
|
||||
protected:
|
||||
/** \copydoc Header::GetSerializedSize */
|
||||
uint32_t GetSerializedSizeImpl() const;
|
||||
/** \copydoc Header::Serialize */
|
||||
void SerializeImpl(Buffer::Iterator start) const;
|
||||
/** \copydoc Header::Deserialize */
|
||||
uint32_t DeserializeImpl(Buffer::Iterator start);
|
||||
|
||||
private:
|
||||
using WifiMgtHeader<MgtAssocRequestHeader, AssocRequestElems>::InitForDeserialization;
|
||||
|
||||
/**
|
||||
* \param optElem the MultiLinkElement object to initialize for deserializing the
|
||||
* information element into
|
||||
*/
|
||||
void InitForDeserialization(std::optional<MultiLinkElement>& optElem);
|
||||
|
||||
CapabilityInformation m_capability; //!< Capability information
|
||||
uint16_t m_listenInterval{0}; //!< listen interval
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup wifi
|
||||
* Implement the header for management frames of type reassociation request.
|
||||
*/
|
||||
class MgtReassocRequestHeader : public WifiMgtHeader<MgtReassocRequestHeader, AssocRequestElems>
|
||||
{
|
||||
friend class WifiMgtHeader<MgtReassocRequestHeader, AssocRequestElems>;
|
||||
|
||||
public:
|
||||
~MgtReassocRequestHeader() override = default;
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
|
||||
/** \copydoc Header::GetInstanceTypeId */
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
|
||||
/**
|
||||
* Set the listen interval.
|
||||
*
|
||||
* \param interval the listen interval
|
||||
*/
|
||||
void SetListenInterval(uint16_t interval);
|
||||
/**
|
||||
* Return the listen interval.
|
||||
*
|
||||
* \return the listen interval
|
||||
*/
|
||||
uint16_t GetListenInterval() const;
|
||||
/**
|
||||
* \return a reference to the Capability information
|
||||
*/
|
||||
CapabilityInformation& Capabilities();
|
||||
/**
|
||||
* \return a const reference to the Capability information
|
||||
*/
|
||||
const CapabilityInformation& Capabilities() const;
|
||||
/**
|
||||
* Set the address of the current access point.
|
||||
*
|
||||
@@ -451,29 +214,28 @@ class MgtReassocRequestHeader : public Header
|
||||
*/
|
||||
void SetCurrentApAddress(Mac48Address currentApAddr);
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
void Print(std::ostream& os) const override;
|
||||
uint32_t GetSerializedSize() const override;
|
||||
void Serialize(Buffer::Iterator start) const override;
|
||||
uint32_t Deserialize(Buffer::Iterator start) override;
|
||||
protected:
|
||||
/** \copydoc Header::GetSerializedSize */
|
||||
uint32_t GetSerializedSizeImpl() const;
|
||||
/** \copydoc Header::Serialize */
|
||||
void SerializeImpl(Buffer::Iterator start) const;
|
||||
/** \copydoc Header::Deserialize */
|
||||
uint32_t DeserializeImpl(Buffer::Iterator start);
|
||||
/** \copydoc Header::Print */
|
||||
void PrintImpl(std::ostream& os) const;
|
||||
|
||||
private:
|
||||
using WifiMgtHeader<MgtReassocRequestHeader, AssocRequestElems>::InitForDeserialization;
|
||||
|
||||
/**
|
||||
* \param optElem the MultiLinkElement object to initialize for deserializing the
|
||||
* information element into
|
||||
*/
|
||||
void InitForDeserialization(std::optional<MultiLinkElement>& optElem);
|
||||
|
||||
Mac48Address m_currentApAddr; //!< Address of the current access point
|
||||
Ssid m_ssid; //!< Service Set ID (SSID)
|
||||
AllSupportedRates m_rates; //!< List of supported rates
|
||||
CapabilityInformation m_capability; //!< Capability information
|
||||
std::optional<ExtendedCapabilities> m_extendedCapability; //!< Extended capabilities
|
||||
std::optional<HtCapabilities> m_htCapability; //!< HT capabilities
|
||||
std::optional<VhtCapabilities> m_vhtCapability; //!< VHT capabilities
|
||||
std::optional<HeCapabilities> m_heCapability; //!< HE capabilities
|
||||
uint16_t m_listenInterval; //!< listen interval
|
||||
std::optional<EhtCapabilities> m_ehtCapability; //!< EHT capabilities
|
||||
std::optional<MultiLinkElement> m_multiLinkElement; //!< Multi-Link Element
|
||||
uint16_t m_listenInterval{0}; //!< listen interval
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -557,149 +319,19 @@ class MgtAssocResponseHeader : public WifiMgtHeader<MgtAssocResponseHeader, Asso
|
||||
* \ingroup wifi
|
||||
* Implement the header for management frames of type probe request.
|
||||
*/
|
||||
class MgtProbeRequestHeader : public Header
|
||||
class MgtProbeRequestHeader : public WifiMgtHeader<MgtProbeRequestHeader, ProbeRequestElems>
|
||||
{
|
||||
public:
|
||||
~MgtProbeRequestHeader() override;
|
||||
|
||||
/**
|
||||
* Set the Service Set Identifier (SSID).
|
||||
*
|
||||
* \param ssid SSID
|
||||
*/
|
||||
void SetSsid(const Ssid& ssid);
|
||||
|
||||
/** \copydoc SetSsid */
|
||||
void SetSsid(Ssid&& ssid);
|
||||
|
||||
/**
|
||||
* Set the supported rates.
|
||||
*
|
||||
* \param rates the supported rates
|
||||
*/
|
||||
void SetSupportedRates(const AllSupportedRates& rates);
|
||||
|
||||
/** \copydoc SetSupportedRates */
|
||||
void SetSupportedRates(AllSupportedRates&& rates);
|
||||
|
||||
/**
|
||||
* Set the extended capabilities.
|
||||
*
|
||||
* \param extendedCapabilities the extended capabilities
|
||||
*/
|
||||
void SetExtendedCapabilities(const ExtendedCapabilities& extendedCapabilities);
|
||||
|
||||
/** \copydoc SetExtendedCapabilities */
|
||||
void SetExtendedCapabilities(ExtendedCapabilities&& extendedCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HT capabilities.
|
||||
*
|
||||
* \param htCapabilities HT capabilities
|
||||
*/
|
||||
void SetHtCapabilities(const HtCapabilities& htCapabilities);
|
||||
|
||||
/** \copydoc SetHtCapabilities */
|
||||
void SetHtCapabilities(HtCapabilities&& htCapabilities);
|
||||
|
||||
/**
|
||||
* Set the VHT capabilities.
|
||||
*
|
||||
* \param vhtCapabilities VHT capabilities
|
||||
*/
|
||||
void SetVhtCapabilities(const VhtCapabilities& vhtCapabilities);
|
||||
|
||||
/** \copydoc SetVhtCapabilities */
|
||||
void SetVhtCapabilities(VhtCapabilities&& vhtCapabilities);
|
||||
|
||||
/**
|
||||
* Set the HE capabilities.
|
||||
*
|
||||
* \param heCapabilities HE capabilities
|
||||
*/
|
||||
void SetHeCapabilities(const HeCapabilities& heCapabilities);
|
||||
|
||||
/** \copydoc SetHeCapabilities */
|
||||
void SetHeCapabilities(HeCapabilities&& heCapabilities);
|
||||
|
||||
/**
|
||||
* Set the EHT capabilities.
|
||||
*
|
||||
* \param ehtCapabilities EHT capabilities
|
||||
*/
|
||||
void SetEhtCapabilities(const EhtCapabilities& ehtCapabilities);
|
||||
|
||||
/** \copydoc SetEhtCapabilities */
|
||||
void SetEhtCapabilities(EhtCapabilities&& ehtCapabilities);
|
||||
|
||||
/**
|
||||
* Return the Service Set Identifier (SSID).
|
||||
*
|
||||
* \return SSID
|
||||
*/
|
||||
const Ssid& GetSsid() const;
|
||||
|
||||
/**
|
||||
* Return the supported rates.
|
||||
*
|
||||
* \return the supported rates
|
||||
*/
|
||||
const AllSupportedRates& GetSupportedRates() const;
|
||||
|
||||
/**
|
||||
* Return the extended capabilities, if present.
|
||||
*
|
||||
* \return the extended capabilities, if present
|
||||
*/
|
||||
const std::optional<ExtendedCapabilities>& GetExtendedCapabilities() const;
|
||||
|
||||
/**
|
||||
* Return the HT capabilities, if present.
|
||||
*
|
||||
* \return HT capabilities, if present
|
||||
*/
|
||||
const std::optional<HtCapabilities>& GetHtCapabilities() const;
|
||||
|
||||
/**
|
||||
* Return the VHT capabilities, if present.
|
||||
*
|
||||
* \return VHT capabilities, if present
|
||||
*/
|
||||
const std::optional<VhtCapabilities>& GetVhtCapabilities() const;
|
||||
|
||||
/**
|
||||
* Return the HE capabilities, if present.
|
||||
*
|
||||
* \return HE capabilities, if present
|
||||
*/
|
||||
const std::optional<HeCapabilities>& GetHeCapabilities() const;
|
||||
|
||||
/**
|
||||
* Return the EHT capabilities, if present.
|
||||
*
|
||||
* \return EHT capabilities, if present
|
||||
*/
|
||||
const std::optional<EhtCapabilities>& GetEhtCapabilities() const;
|
||||
~MgtProbeRequestHeader() override = default;
|
||||
|
||||
/**
|
||||
* Register this type.
|
||||
* \return The TypeId.
|
||||
*/
|
||||
static TypeId GetTypeId();
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
void Print(std::ostream& os) const override;
|
||||
uint32_t GetSerializedSize() const override;
|
||||
void Serialize(Buffer::Iterator start) const override;
|
||||
uint32_t Deserialize(Buffer::Iterator start) override;
|
||||
|
||||
private:
|
||||
Ssid m_ssid; //!< Service Set ID (SSID)
|
||||
AllSupportedRates m_rates; //!< List of supported rates
|
||||
std::optional<ExtendedCapabilities> m_extendedCapability; //!< extended capabilities
|
||||
std::optional<HtCapabilities> m_htCapability; //!< HT capabilities
|
||||
std::optional<VhtCapabilities> m_vhtCapability; //!< VHT capabilities
|
||||
std::optional<HeCapabilities> m_heCapability; //!< HE capabilities
|
||||
std::optional<EhtCapabilities> m_ehtCapability; //!< EHT capabilities
|
||||
/** \copydoc Header::GetInstanceTypeId */
|
||||
TypeId GetInstanceTypeId() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -253,24 +253,26 @@ StaWifiMac::SendProbeRequest()
|
||||
hdr.SetDsNotTo();
|
||||
Ptr<Packet> packet = Create<Packet>();
|
||||
MgtProbeRequestHeader probe;
|
||||
probe.SetSsid(GetSsid());
|
||||
probe.SetSupportedRates(GetSupportedRates(SINGLE_LINK_OP_ID));
|
||||
probe.Get<Ssid>() = GetSsid();
|
||||
auto supportedRates = GetSupportedRates(SINGLE_LINK_OP_ID);
|
||||
probe.Get<SupportedRates>() = supportedRates.rates;
|
||||
probe.Get<ExtendedSupportedRatesIE>() = supportedRates.extendedRates;
|
||||
if (GetHtSupported())
|
||||
{
|
||||
probe.SetExtendedCapabilities(GetExtendedCapabilities());
|
||||
probe.SetHtCapabilities(GetHtCapabilities(SINGLE_LINK_OP_ID));
|
||||
probe.Get<ExtendedCapabilities>() = GetExtendedCapabilities();
|
||||
probe.Get<HtCapabilities>() = GetHtCapabilities(SINGLE_LINK_OP_ID);
|
||||
}
|
||||
if (GetVhtSupported(SINGLE_LINK_OP_ID))
|
||||
{
|
||||
probe.SetVhtCapabilities(GetVhtCapabilities(SINGLE_LINK_OP_ID));
|
||||
probe.Get<VhtCapabilities>() = GetVhtCapabilities(SINGLE_LINK_OP_ID);
|
||||
}
|
||||
if (GetHeSupported())
|
||||
{
|
||||
probe.SetHeCapabilities(GetHeCapabilities(SINGLE_LINK_OP_ID));
|
||||
probe.Get<HeCapabilities>() = GetHeCapabilities(SINGLE_LINK_OP_ID);
|
||||
}
|
||||
if (GetEhtSupported())
|
||||
{
|
||||
probe.SetEhtCapabilities(GetEhtCapabilities(SINGLE_LINK_OP_ID));
|
||||
probe.Get<EhtCapabilities>() = GetEhtCapabilities(SINGLE_LINK_OP_ID);
|
||||
}
|
||||
packet->AddHeader(probe);
|
||||
|
||||
@@ -311,26 +313,28 @@ StaWifiMac::GetAssociationRequest(bool isReassoc, uint8_t linkId) const
|
||||
|
||||
// lambda to set the fields of the (Re)Association Request
|
||||
auto fill = [&](auto&& frame) {
|
||||
frame.SetSsid(GetSsid());
|
||||
frame.SetSupportedRates(GetSupportedRates(linkId));
|
||||
frame.SetCapabilities(GetCapabilities(linkId));
|
||||
frame.template Get<Ssid>() = GetSsid();
|
||||
auto supportedRates = GetSupportedRates(linkId);
|
||||
frame.template Get<SupportedRates>() = supportedRates.rates;
|
||||
frame.template Get<ExtendedSupportedRatesIE>() = supportedRates.extendedRates;
|
||||
frame.Capabilities() = GetCapabilities(linkId);
|
||||
frame.SetListenInterval(0);
|
||||
if (GetHtSupported())
|
||||
{
|
||||
frame.SetExtendedCapabilities(GetExtendedCapabilities());
|
||||
frame.SetHtCapabilities(GetHtCapabilities(linkId));
|
||||
frame.template Get<ExtendedCapabilities>() = GetExtendedCapabilities();
|
||||
frame.template Get<HtCapabilities>() = GetHtCapabilities(linkId);
|
||||
}
|
||||
if (GetVhtSupported(linkId))
|
||||
{
|
||||
frame.SetVhtCapabilities(GetVhtCapabilities(linkId));
|
||||
frame.template Get<VhtCapabilities>() = GetVhtCapabilities(linkId);
|
||||
}
|
||||
if (GetHeSupported())
|
||||
{
|
||||
frame.SetHeCapabilities(GetHeCapabilities(linkId));
|
||||
frame.template Get<HeCapabilities>() = GetHeCapabilities(linkId);
|
||||
}
|
||||
if (GetEhtSupported())
|
||||
{
|
||||
frame.SetEhtCapabilities(GetEhtCapabilities(linkId));
|
||||
frame.template Get<EhtCapabilities>() = GetEhtCapabilities(linkId);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -421,7 +425,7 @@ StaWifiMac::SendAssociationRequest(bool isReassoc)
|
||||
GetWifiRemoteStationManager(linkId)->GetMldAddress(*link.bssid).has_value())
|
||||
{
|
||||
auto addMle = [&](auto&& frame) {
|
||||
frame.SetMultiLinkElement(GetMultiLinkElement(isReassoc, linkId));
|
||||
frame.template Get<MultiLinkElement>() = GetMultiLinkElement(isReassoc, linkId);
|
||||
};
|
||||
std::visit(addMle, frame);
|
||||
}
|
||||
|
||||
@@ -147,9 +147,9 @@ BasicMultiLinkElementTest::DoRun()
|
||||
capabilities.SetEss();
|
||||
|
||||
MgtAssocRequestHeader assoc;
|
||||
assoc.SetSsid(Ssid("MySsid"));
|
||||
assoc.SetSupportedRates(rates);
|
||||
assoc.SetCapabilities(capabilities);
|
||||
assoc.Get<Ssid>() = Ssid("MySsid");
|
||||
assoc.Get<SupportedRates>() = rates.rates;
|
||||
assoc.Capabilities() = capabilities;
|
||||
assoc.SetListenInterval(0);
|
||||
|
||||
MultiLinkElement::PerStaProfileSubelement perStaProfile(MultiLinkElement::BASIC_VARIANT,
|
||||
|
||||
@@ -756,7 +756,7 @@ MultiLinkSetupTest::CheckAssocRequest(Ptr<WifiMpdu> mpdu, uint8_t linkId)
|
||||
"TA of Assoc Request frame is not the address of the link it is transmitted on");
|
||||
MgtAssocRequestHeader assoc;
|
||||
mpdu->GetPacket()->PeekHeader(assoc);
|
||||
const auto& mle = assoc.GetMultiLinkElement();
|
||||
const auto& mle = assoc.Get<MultiLinkElement>();
|
||||
|
||||
if (m_apMac->GetNLinks() == 1 || m_staMacs[0]->GetNLinks() == 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user