9#ifndef WIFI_MGT_HEADER_H 
   10#define WIFI_MGT_HEADER_H 
   15#include "ns3/eht-capabilities.h" 
   16#include "ns3/he-6ghz-band-capabilities.h" 
   17#include "ns3/header.h" 
   18#include "ns3/multi-link-element.h" 
   19#include "ns3/vht-capabilities.h" 
   47    typedef std::optional<T> 
type;
 
 
   55    typedef std::optional<T> 
type;
 
 
   63    typedef std::vector<T> 
type;
 
 
   78template <
typename Derived, 
typename Tuple>
 
   96template <
typename Derived, 
typename... Elems>
 
  106    template <
typename T,
 
  107              std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 0, 
int> = 0>
 
  108    std::optional<T>& 
Get();
 
  116    template <
typename T,
 
  117              std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 0, 
int> = 0>
 
  118    const std::optional<T>& 
Get() 
const;
 
  126    template <
typename T,
 
  127              std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 1, 
int> = 0>
 
  128    std::vector<T>& 
Get();
 
  136    template <
typename T,
 
  137              std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 1, 
int> = 0>
 
  138    const std::vector<T>& 
Get() 
const;
 
  140    void Print(std::ostream& os) 
const final;
 
  152    template <
typename IE>
 
  176    template <
typename T>
 
  185    template <
typename T>
 
  189    using Elements = std::tuple<internal::GetStoredIeT<Elems>...>;
 
 
  216template <
typename Derived, 
typename Tuple>
 
  228template <
typename Derived, 
typename... Elems>
 
  323template <
typename Derived, 
typename... Elems>
 
  324template <
typename T, std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 0, 
int>>
 
  328    return std::get<std::optional<T>>(
m_elements);
 
 
  331template <
typename Derived, 
typename... Elems>
 
  332template <
typename T, std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 0, 
int>>
 
  333const std::optional<T>&
 
  336    return std::get<std::optional<T>>(
m_elements);
 
 
  339template <
typename Derived, 
typename... Elems>
 
  340template <
typename T, std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 1, 
int>>
 
  347template <
typename Derived, 
typename... Elems>
 
  348template <
typename T, std::enable_if_t<(std::is_same_v<std::vector<T>, Elems> + ...) == 1, 
int>>
 
  355template <
typename Derived, 
typename... Elems>
 
  356template <
typename IE>
 
  363template <
typename Derived, 
typename... Elems>
 
  366    std::optional<EhtCapabilities>& optElem)
 
  370    const auto is2_4Ghz = !vhtCapabilities && !he6GhzBandCapabilities;
 
  374        optElem.emplace(is2_4Ghz, heCapabilities.value());
 
 
  382template <
typename Derived, 
typename... Elems>
 
  385    std::optional<MultiLinkElement>& optElem)
 
  387    optElem.emplace(*
static_cast<const Derived*
>(
this));
 
 
  402    return elem.has_value() ? elem->GetSerializedSize() : 0;
 
 
  414    return std::accumulate(elems.cbegin(), elems.cend(), 0, [](uint16_t a, 
const auto& b) {
 
  415        return b.GetSerializedSize() + a;
 
 
  421template <
typename Derived, 
typename... Elems>
 
  428template <
typename Derived, 
typename... Elems>
 
  449    return elem.has_value() ? elem->Serialize(start) : start;
 
 
  462    return std::accumulate(elems.cbegin(),
 
 
  470template <
typename Derived, 
typename... Elems>
 
  477template <
typename Derived, 
typename... Elems>
 
  485template <
typename Derived, 
typename... Elems>
 
  493    i = elem->DeserializeIfPresent(i);
 
  494    if (i.GetDistanceFrom(start) == 0)
 
 
  501template <
typename Derived, 
typename... Elems>
 
  511        std::optional<T> item;
 
  513        i = item->DeserializeIfPresent(i);
 
  514        if (i.GetDistanceFrom(tmp) == 0)
 
  518        elems.push_back(std::move(*item));
 
 
  523template <
typename Derived, 
typename... Elems>
 
  530template <
typename Derived, 
typename... Elems>
 
  542                    if constexpr (std::is_same_v<std::remove_reference_t<
decltype(elems)>, Elems>)
 
  551                        i = elems->Deserialize(i);
 
  558    return i.GetDistanceFrom(start);
 
 
  571DoPrint(
const std::optional<T>& elem, std::ostream& os)
 
  573    if (elem.has_value())
 
 
  586DoPrint(
const std::vector<T>& elems, std::ostream& os)
 
  588    std::copy(elems.cbegin(), elems.cend(), std::ostream_iterator<T>(os, 
" , "));
 
 
  593template <
typename Derived, 
typename... Elems>
 
  600template <
typename Derived, 
typename... Elems>
 
  618template <
typename T, 
typename Derived>
 
  627    if (
auto& outsideIe = frame.template Get<T>();
 
  628        outsideIe.has_value() && elem.has_value() && !(outsideIe.value() == elem.value()))
 
  635    if (!frame.template Get<T>().has_value() && elem.has_value())
 
 
  653template <
typename T, 
typename Derived>
 
  662    if (
auto& outsideIe = frame.template Get<T>();
 
  663        !outsideIe.empty() && !elems.empty() && !(outsideIe == elems))
 
  670    if (frame.template Get<T>().empty() && !elems.empty())
 
 
  689template <
typename T, 
typename Derived>
 
  690std::optional<std::pair<uint8_t, uint8_t>>
 
  693    if (
auto& outsideIe = frame.template Get<T>();
 
  696        return {{outsideIe->ElementId(), outsideIe->ElementIdExt()}};
 
 
  710template <
typename T, 
typename Derived>
 
  711std::optional<std::pair<uint8_t, uint8_t>>
 
  714    if (
auto& outsideIe = frame.template Get<T>();
 
  717        return {{outsideIe.front().ElementId(), outsideIe.front().ElementIdExt()}};
 
 
  724template <
typename Derived, 
typename... Elems>
 
  732template <
typename Derived, 
typename... Elems>
 
  738    std::optional<NonInheritance> nonInheritance;
 
  741        [&](
auto&... elems) {
 
  752                            nonInheritance.emplace();
 
  754                        nonInheritance->Add(idPair->first, idPair->second);
 
  763        size += nonInheritance->GetSerializedSize();
 
 
  768template <
typename Derived, 
typename... Elems>
 
  777template <
typename Derived, 
typename... Elems>
 
  784    std::optional<NonInheritance> nonInheritance;
 
  787        [&](
auto&... elems) {
 
  798                            nonInheritance.emplace();
 
  800                        nonInheritance->Add(idPair->first, idPair->second);
 
  809        nonInheritance->Serialize(i);
 
 
  826template <
typename T, 
typename Derived>
 
  830    if (
auto& outsideIe = frame.template Get<T>();
 
  833        elem = outsideIe.value();
 
 
  847template <
typename T, 
typename Derived>
 
  851    if (
auto& outsideIe = frame.template Get<T>();
 
 
  860template <
typename Derived, 
typename... Elems>
 
  870template <
typename Derived, 
typename... Elems>
 
  881        [&](
auto&... elems) {
 
  884                    if (i.GetDistanceFrom(start) < length)
 
  898    auto distance = i.GetDistanceFrom(start);
 
  900                  "Bytes read (" << distance << 
") not matching expected number (" << length
 
 
  920    if (elem.has_value() && nonInheritance.
IsPresent(elem->ElementId(), elem->ElementIdExt()))
 
 
  939        nonInheritance.
IsPresent(elem.front().ElementId(), elem.front().ElementIdExt()))
 
 
  947template <
typename Derived, 
typename... Elems>
 
  962            [&](
auto&... elems) {
 
 
  969template <
typename Derived, 
typename... Elems>
 
  975        mle->m_containingFrame = *
static_cast<const Derived*
>(
this);
 
 
Simple class derived from ns3::Object, used to check attribute constructors.
iterator in a Buffer instance
The IEEE 802.11 Non-Inheritance Information Element.
bool IsPresent(uint8_t elemId, uint8_t elemIdExt=0) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void Print(ComponentCarrier cc)
Namespace for implementation details.
void DoPrint(const std::optional< T > &elem, std::ostream &os)
bool MustBeSerializedInPerStaProfile(const std::optional< T > &elem, const Derived &frame)
void DoCopyIeFromContainingFrame(std::optional< T > &elem, const Derived &frame)
uint16_t DoGetSerializedSize(const std::optional< T > &elem)
std::optional< std::pair< uint8_t, uint8_t > > MustBeListedInNonInheritance(const std::optional< T > &elem, const Derived &frame)
void RemoveIfNotInherited(std::optional< T > &elem, const NonInheritance &nonInheritance)
Buffer::Iterator DoSerialize(const std::optional< T > &elem, Buffer::Iterator start)
typename GetStoredIe< T >::type GetStoredIeT
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr bool CanBeInPerStaProfileV
Inspect a type to deduce whether it is an Information Element that can be included in a Per-STA Profi...
Inspect a type to deduce whether it is an Information Element that can be included in a Per-STA Profi...
std::optional< T > type
typedef for the resulting optional type
std::vector< T > type
typedef for the resulting optional type
std::optional< T > type
typedef for the resulting optional type