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 |
![]() | |
~Header () override | |
uint32_t | Deserialize (Buffer::Iterator start) override=0 |
virtual uint32_t | Deserialize (Buffer::Iterator start)=0 |
Deserialize the object from a buffer iterator. | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
virtual uint32_t | GetSerializedSize () const =0 |
void | Print (std::ostream &os) const override=0 |
virtual void | Serialize (Buffer::Iterator start) const =0 |
virtual uint32_t | Deserialize (Buffer::Iterator start)=0 |
Deserialize the object from a buffer iterator. | |
virtual uint32_t | Deserialize (Buffer::Iterator start, Buffer::Iterator end) |
Deserialize the object from a buffer iterator. | |
virtual void | Print (std::ostream &os) const =0 |
Print the object contents. | |
![]() | |
virtual | ~ObjectBase () |
Virtual destructor. | |
void | GetAttribute (std::string name, AttributeValue &value) 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 |
![]() | |
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 TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
static TypeId | GetTypeId () |
Get the type ID. | |
![]() | |
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 106 of file wifi-mgt-header.h.
|
protected |
type of the Information Elements contained by this frame
Definition at line 198 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 536 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 543 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 499 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 515 of file wifi-mgt-header.h.
std::optional< T > & ns3::WifiMgtHeader< Derived, std::tuple< Elems... > >::Get |
Access a (mandatory or optional) Information Element.
Implementation of the templates declared above.
T | [explicit] the type of the Information Element to return |
Definition at line 335 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 351 of file wifi-mgt-header.h.
const 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 343 of file wifi-mgt-header.h.
const 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 359 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 434 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 441 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 374 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 367 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 606 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 613 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 483 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 490 of file wifi-mgt-header.h.
References ns3::internal::DoSerialize().
|
protected |
Information Elements contained by this frame.
Definition at line 200 of file wifi-mgt-header.h.