A Discrete-Event Network Simulator
API
ns3::WifiInformationElement Class Referenceabstract

Information element, as defined in 802.11-2007 standard. More...

#include "wifi-information-element.h"

+ Inheritance diagram for ns3::WifiInformationElement:
+ Collaboration diagram for ns3::WifiInformationElement:

Public Member Functions

virtual ~WifiInformationElement ()
 
Buffer::Iterator Deserialize (Buffer::Iterator i)
 Deserialize entire IE, which must be present. More...
 
Buffer::Iterator DeserializeIfPresent (Buffer::Iterator i)
 Deserialize entire IE if it is present. More...
 
virtual uint8_t DeserializeInformationField (Buffer::Iterator start, uint8_t length)=0
 Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) More...
 
virtual WifiInformationElementId ElementId () const =0
 
virtual WifiInformationElementId ElementIdExt () const
 
virtual uint8_t GetInformationFieldSize () const =0
 Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets. More...
 
virtual uint16_t GetSerializedSize () const
 Get the size of the serialized IE including Element ID and length fields. More...
 
virtual bool operator== (WifiInformationElement const &a) const
 Compare two IEs for equality by ID & Length, and then through memcmp of serialised version. More...
 
virtual void Print (std::ostream &os) const
 Generate human-readable form of IE. More...
 
virtual Buffer::Iterator Serialize (Buffer::Iterator i) const
 Serialize entire IE including Element ID and length fields. More...
 
virtual void SerializeInformationField (Buffer::Iterator start) const =0
 Serialize information (i.e., the body of the IE, not including the Element ID and length octets) More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o[[maybe_unused]])
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= ([[maybe_unused]] const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 

Detailed Description

Information element, as defined in 802.11-2007 standard.

The IEEE 802.11 standard includes the notion of Information Elements, which are encodings of management information to be communicated between STAs in the payload of various frames of type Management. Information Elements (IEs) have a common format, each starting with a single octet - the Element ID, which indicates the specific type of IE (a type to represent the options here is defined as WifiInformationElementId). The next octet is a length field and encodes the number of octets in the third and final field, which is the IE Information field.

The class ns3::WifiInformationElement provides a base for classes which represent specific Information Elements. This class defines pure virtual methods for serialisation (ns3::WifiInformationElement::SerializeInformationField) and deserialisation (ns3::WifiInformationElement::DeserializeInformationField) of IEs, from or to data members or other objects that simulation objects use to maintain the relevant state.

This class also provides an implementation of the equality operator, which operates by comparing the serialised versions of the two WifiInformationElement objects concerned.

Elements are defined to have a common general format consisting of a 1 octet Element ID field, a 1 octet length field, and a variable-length element-specific information field. Each element is assigned a unique Element ID as defined in this standard. The Length field specifies the number of octets in the Information field.

This class is pure virtual and acts as base for classes which know how to serialize specific IEs.

Definition at line 233 of file wifi-information-element.h.

Constructor & Destructor Documentation

◆ ~WifiInformationElement()

ns3::WifiInformationElement::~WifiInformationElement ( )
virtual

Definition at line 25 of file wifi-information-element.cc.

Member Function Documentation

◆ Deserialize()

Buffer::Iterator ns3::WifiInformationElement::Deserialize ( Buffer::Iterator  i)

Deserialize entire IE, which must be present.

The iterator passed in must be pointing at the Element ID (i.e., the very first octet) of the correct type of information element, otherwise this method will generate a fatal error.

Parameters
ian iterator which points to where the IE should be read.
Returns
an iterator

Definition at line 66 of file wifi-information-element.cc.

References DeserializeIfPresent(), ns3::Buffer::Iterator::GetDistanceFrom(), NS_ASSERT, and visualizer.core::start().

Referenced by ns3::dot11s::PeerLinkOpenStart::Deserialize(), ns3::dot11s::PeerLinkConfirmStart::Deserialize(), ns3::MgtReassocRequestHeader::Deserialize(), ns3::MgtAssocResponseHeader::Deserialize(), ns3::MgtProbeRequestHeader::Deserialize(), ns3::MgtProbeResponseHeader::Deserialize(), and ns3::MgtAssocRequestHeader::Deserialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeserializeIfPresent()

Buffer::Iterator ns3::WifiInformationElement::DeserializeIfPresent ( Buffer::Iterator  i)

Deserialize entire IE if it is present.

The iterator passed in must be pointing at the Element ID of an information element. If the Element ID is not the one that the given class is interested in then it will return the same iterator.

Parameters
ian iterator which points to where the IE should be read.
Returns
an iterator

Definition at line 77 of file wifi-information-element.cc.

References DeserializeInformationField(), ElementId(), ElementIdExt(), IE_EXTENSION, ns3::Buffer::Iterator::IsEnd(), ns3::Buffer::Iterator::Next(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().

Referenced by Deserialize(), ns3::dot11s::PeerLinkOpenStart::Deserialize(), ns3::dot11s::PeerLinkConfirmStart::Deserialize(), ns3::MgtReassocRequestHeader::Deserialize(), ns3::MgtAssocResponseHeader::Deserialize(), ns3::MgtProbeRequestHeader::Deserialize(), ns3::MgtProbeResponseHeader::Deserialize(), and ns3::MgtAssocRequestHeader::Deserialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeserializeInformationField()

virtual uint8_t ns3::WifiInformationElement::DeserializeInformationField ( Buffer::Iterator  start,
uint8_t  length 
)
pure virtual

◆ ElementId()

◆ ElementIdExt()

WifiInformationElementId ns3::WifiInformationElement::ElementIdExt ( ) const
virtual
Returns
Own unique Element ID Extension

Reimplemented in ns3::HeOperation, ns3::HeCapabilities, and ns3::MuEdcaParameterSet.

Definition at line 41 of file wifi-information-element.cc.

Referenced by DeserializeIfPresent(), operator==(), and Serialize().

+ Here is the caller graph for this function:

◆ GetInformationFieldSize()

virtual uint8_t ns3::WifiInformationElement::GetInformationFieldSize ( ) const
pure virtual

◆ GetSerializedSize()

uint16_t ns3::WifiInformationElement::GetSerializedSize ( void  ) const
virtual

◆ operator==()

bool ns3::WifiInformationElement::operator== ( WifiInformationElement const &  a) const
virtual

Compare two IEs for equality by ID & Length, and then through memcmp of serialised version.

Parameters
aanother information element to compare with
Returns
true if the two IEs are equal, false otherwise

Reimplemented in ns3::dot11s::IeBeaconTiming.

Definition at line 117 of file wifi-information-element.cc.

References ns3::Buffer::AddAtEnd(), ns3::Buffer::Begin(), ElementId(), ElementIdExt(), GetInformationFieldSize(), ns3::Buffer::PeekData(), and SerializeInformationField().

+ Here is the call graph for this function:

◆ Print()

void ns3::WifiInformationElement::Print ( std::ostream &  os) const
virtual

◆ Serialize()

Buffer::Iterator ns3::WifiInformationElement::Serialize ( Buffer::Iterator  i) const
virtual

Serialize entire IE including Element ID and length fields.

Parameters
ian iterator which points to where the IE should be written.
Returns
an iterator

Reimplemented in ns3::VhtOperation, ns3::VhtCapabilities, ns3::ExtendedSupportedRatesIE, ns3::ErpInformation, ns3::DsssParameterSet, ns3::HtOperation, ns3::HtCapabilities, ns3::HeOperation, ns3::HeCapabilities, ns3::ExtendedCapabilities, ns3::EdcaParameterSet, and ns3::MuEdcaParameterSet.

Definition at line 47 of file wifi-information-element.cc.

References ElementId(), ElementIdExt(), GetInformationFieldSize(), IE_EXTENSION, ns3::Buffer::Iterator::Next(), SerializeInformationField(), and ns3::Buffer::Iterator::WriteU8().

Referenced by ns3::dot11s::PeerLinkOpenStart::Serialize(), ns3::dot11s::PeerLinkCloseStart::Serialize(), ns3::dot11s::PeerLinkConfirmStart::Serialize(), ns3::MgtReassocRequestHeader::Serialize(), ns3::MgtAssocResponseHeader::Serialize(), ns3::MgtProbeRequestHeader::Serialize(), ns3::MgtProbeResponseHeader::Serialize(), ns3::EdcaParameterSet::Serialize(), ns3::ExtendedCapabilities::Serialize(), ns3::HeCapabilities::Serialize(), ns3::HeOperation::Serialize(), ns3::HtCapabilities::Serialize(), ns3::HtOperation::Serialize(), ns3::MgtAssocRequestHeader::Serialize(), ns3::DsssParameterSet::Serialize(), ns3::ErpInformation::Serialize(), ns3::ExtendedSupportedRatesIE::Serialize(), ns3::VhtCapabilities::Serialize(), and ns3::VhtOperation::Serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SerializeInformationField()

virtual void ns3::WifiInformationElement::SerializeInformationField ( Buffer::Iterator  start) const
pure virtual

The documentation for this class was generated from the following files: