Base class for implementing management frame headers. More...
#include "wifi-mgt-header.h"
Public Member Functions | |
uint32_t | Deserialize (Buffer::Iterator start) final |
template<typename T , std::enable_if_t<(std::is_same_v< std::vector< T >, Elems >+...)==0, int > = 0> | |
std::optional< T > & | Get () |
Access a (mandatory or optional) Information Element. | |
template<typename T , std::enable_if_t<(std::is_same_v< std::vector< T >, Elems >+...)==1, int > = 0> | |
std::vector< T > & | Get () |
Access an Information Element that can be present zero or more times. | |
template<typename T , std::enable_if_t<(std::is_same_v< std::vector< T >, Elems >+...)==0, int > = 0> | |
const std::optional< T > & | Get () const |
Access a (mandatory or optional) Information Element. | |
template<typename T , std::enable_if_t<(std::is_same_v< std::vector< T >, Elems >+...)==1, int > = 0> | |
const std::vector< T > & | Get () const |
Access an Information Element that can be present zero or more times. | |
uint32_t | GetSerializedSize () const final |
void | Print (std::ostream &os) const final |
void | Serialize (Buffer::Iterator start) const final |
Public Member Functions inherited from ns3::Header | |
~Header () override | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
Get the value of an attribute, raising fatal errors if unsuccessful. | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising errors. | |
virtual TypeId | GetInstanceTypeId () const =0 |
Get the most derived TypeId for this Object. | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. | |
Protected Types | |
using | Elements = std::tuple<internal::GetStoredIeT<Elems>...> |
type of the Information Elements contained by this frame | |
Protected Member Functions | |
uint32_t | DeserializeImpl (Buffer::Iterator start) |
template<typename T > | |
Buffer::Iterator | DoDeserialize (std::optional< T > &elem, Buffer::Iterator start) |
template<typename T > | |
Buffer::Iterator | DoDeserialize (std::vector< T > &elems, Buffer::Iterator start) |
uint32_t | GetSerializedSizeImpl () const |
void | InitForDeserialization (std::optional< EhtCapabilities > &optElem) |
template<typename IE > | |
void | InitForDeserialization (std::optional< IE > &optElem) |
void | PrintImpl (std::ostream &os) const |
void | SerializeImpl (Buffer::Iterator start) const |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. | |
virtual void | NotifyConstructionCompleted () |
Notifier called once the ObjectBase is fully constructed. | |
Protected Attributes | |
Elements | m_elements |
Information Elements contained by this frame. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::Header | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::Chunk | |
static TypeId | GetTypeId () |
Get the type ID. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. | |
Related Symbols inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Base class for implementing management frame headers.
This class adopts the CRTP idiom, mainly to allow subclasses to specialize the method used to initialize Information Elements before deserialization (InitForDeserialization).
The sorted list of Information Elements that can be included in the management frame implemented as a subclass of this class is provided as the template parameter pack. Specifically:
Derived | [explicit] the type of derived management frame |
Elems | [explicit] sorted list of Information Elements that can be included in mgt frame |
Definition at line 95 of file wifi-mgt-header.h.
|
protected |
type of the Information Elements contained by this frame
Definition at line 187 of file wifi-mgt-header.h.
|
finalvirtual |
start | an iterator which points to where the header should read from. |
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.
Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.
Implements ns3::Header.
Definition at line 525 of file wifi-mgt-header.h.
|
protected |
start | an iterator which points to where the header should read from. |
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet. The data read is expected to match bit-for-bit the representation of this header in real networks.
Note that data is not actually removed from the buffer to which the iterator points. Both Packet::RemoveHeader() and Packet::PeekHeader() call Deserialize(), but only the RemoveHeader() has additional statements to remove the header bytes from the underlying buffer and associated metadata.
Definition at line 532 of file wifi-mgt-header.h.
|
protected |
T | [deduced] the type of the Information Element |
elem | the optional Information Element |
start | the buffer iterator pointing to where deserialization starts |
Definition at line 488 of file wifi-mgt-header.h.
|
protected |
T | [deduced] the type of the Information Elements |
elems | a vector of Information Elements |
start | the buffer iterator pointing to where deserialization starts |
Definition at line 504 of file wifi-mgt-header.h.
std::optional< T > & ns3::WifiMgtHeader< Derived, std::tuple< Elems... > >::Get | ( | ) |
Access a (mandatory or optional) Information Element.
T | [explicit] the type of the Information Element to return |
Definition at line 324 of file wifi-mgt-header.h.
std::vector< T > & ns3::WifiMgtHeader< Derived, std::tuple< Elems... > >::Get | ( | ) |
Access an Information Element that can be present zero or more times.
T | [explicit] the type of the Information Element to return |
Definition at line 340 of file wifi-mgt-header.h.
const std::optional< T > & ns3::WifiMgtHeader< Derived, std::tuple< Elems... > >::Get | ( | ) | const |
Access a (mandatory or optional) Information Element.
T | [explicit] the type of the Information Element to return |
Definition at line 332 of file wifi-mgt-header.h.
const std::vector< T > & ns3::WifiMgtHeader< Derived, std::tuple< Elems... > >::Get | ( | ) | const |
Access an Information Element that can be present zero or more times.
T | [explicit] the type of the Information Element to return |
Definition at line 348 of file wifi-mgt-header.h.
|
finalvirtual |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.
Implements ns3::Header.
Definition at line 423 of file wifi-mgt-header.h.
|
protected |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. This method should return the number of bytes which are needed to store the full header data by Serialize.
Definition at line 430 of file wifi-mgt-header.h.
References ns3::internal::DoGetSerializedSize().
|
protected |
optElem | the EhtCapabilities object to initialize for deserializing the information element into |
Definition at line 363 of file wifi-mgt-header.h.
References ns3::AllSupportedRates::IsSupportedRate(), and NS_ASSERT.
|
protected |
IE | [deduced] the type of the Information Element to initialize for deserialization |
optElem | the object to initialize for deserializing the information element into |
The Information Element object is constructed by calling the object's default constructor.
Definition at line 356 of file wifi-mgt-header.h.
|
finalvirtual |
os | output stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 |
Implements ns3::Header.
Definition at line 595 of file wifi-mgt-header.h.
|
protected |
os | output stream This method is used by Packet::Print to print the content of a header as ascii data to a c++ output stream. Although the header is free to format its output as it wishes, it is recommended to follow a few rules to integrate with the packet pretty printer: start with flags, small field values located between a pair of parens. Values should be separated by whitespace. Follow the parens with the important fields, separated by whitespace. i.e.: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5 |
Definition at line 602 of file wifi-mgt-header.h.
References ns3::internal::DoPrint().
|
finalvirtual |
start | an iterator which points to where the header should be written. |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.
Implements ns3::Header.
Definition at line 472 of file wifi-mgt-header.h.
|
protected |
start | an iterator which points to where the header should be written. |
This method is used by Packet::AddHeader to store a header into the byte buffer of a packet. The data written is expected to match bit-for-bit the representation of this header in a real network.
Definition at line 479 of file wifi-mgt-header.h.
References ns3::internal::DoSerialize().
|
protected |
Information Elements contained by this frame.
Definition at line 189 of file wifi-mgt-header.h.