Information element, as defined in 802.11-2007 standardThe 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. More...
#include <wifi-information-element.h>
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... | |
uint16_t | GetSerializedSize () const |
Get the size of the serialized IE including Element ID and length fields. More... | |
Buffer::Iterator | Serialize (Buffer::Iterator i) const |
Serialize entire IE including Element ID and length fields. More... | |
Each subclass must implement | |
virtual WifiInformationElementId | ElementId () const =0 |
Own unique Element ID. More... | |
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 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... | |
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 void | Print (std::ostream &os) const |
In addition, a subclass may optionally override the following... More... | |
virtual bool | operator< (WifiInformationElement const &a) const |
Compare information elements using Element ID. More... | |
virtual bool | operator== (WifiInformationElement const &a) const |
Compare two IEs for equality by ID & Length, and then through memcmp of serialised version. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement > | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement > | |
static void | Cleanup (void) |
Noop. More... | |
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 130 of file wifi-information-element.h.
|
virtual |
Definition at line 25 of file wifi-information-element.cc.
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.
i | an iterator which points to where the IE should be read. |
Definition at line 51 of file wifi-information-element.cc.
References DeserializeIfPresent(), ns3::Buffer::Iterator::GetDistanceFrom(), NS_ASSERT, and visualizer.core::start().
Referenced by ns3::dot11s::PeerLinkFrameStart::Deserialize(), ns3::MgtAssocRequestHeader::Deserialize(), ns3::MgtAssocResponseHeader::Deserialize(), ns3::MgtProbeRequestHeader::Deserialize(), and ns3::MgtProbeResponseHeader::Deserialize().
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.
i | an iterator which points to where the IE should be read. |
Definition at line 62 of file wifi-information-element.cc.
References DeserializeInformationField(), ElementId(), ns3::Buffer::Iterator::Next(), ns3::Buffer::Iterator::ReadU8(), and visualizer.core::start().
Referenced by ns3::dot11s::PeerLinkFrameStart::Deserialize(), ns3::MgtAssocRequestHeader::Deserialize(), Deserialize(), ns3::MgtAssocResponseHeader::Deserialize(), ns3::MgtProbeRequestHeader::Deserialize(), and ns3::MgtProbeResponseHeader::Deserialize().
|
pure virtual |
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
start | an iterator which points to where the information should be written. |
length |
Implemented in ns3::SupportedRates, ns3::dot11s::IePreq, ns3::dot11s::IeConfiguration, ns3::dot11s::IeBeaconTiming, ns3::dot11s::IePeerManagement, ns3::Ssid, ns3::HtCapabilities, ns3::ExtendedSupportedRatesIE, ns3::dot11s::IePrep, ns3::dot11s::IeRann, ns3::dot11s::IeMeshId, ns3::dot11s::IePerr, ns3::dot11s::IeLinkMetricReport, and ns3::dot11s::IePeeringProtocol.
Referenced by DeserializeIfPresent(), and ns3::MeshInformationElementVector::DeserializeSingleIe().
|
pure virtual |
Own unique Element ID.
Implemented in ns3::SupportedRates, ns3::dot11s::IePreq, ns3::dot11s::IeConfiguration, ns3::dot11s::IeBeaconTiming, ns3::dot11s::IePeerManagement, ns3::Ssid, ns3::HtCapabilities, ns3::dot11s::IePrep, ns3::ExtendedSupportedRatesIE, ns3::dot11s::IeRann, ns3::dot11s::IeMeshId, ns3::dot11s::IePerr, ns3::dot11s::IeLinkMetricReport, and ns3::dot11s::IePeeringProtocol.
Referenced by DeserializeIfPresent(), operator<(), operator==(), and Serialize().
|
pure virtual |
Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets.
This is the value that will appear in the second octet of the entire IE - the length field)
Implemented in ns3::SupportedRates, ns3::dot11s::IePreq, ns3::dot11s::IeConfiguration, ns3::dot11s::IeBeaconTiming, ns3::dot11s::IePeerManagement, ns3::Ssid, ns3::HtCapabilities, ns3::dot11s::IePrep, ns3::ExtendedSupportedRatesIE, ns3::dot11s::IeRann, ns3::dot11s::IeMeshId, ns3::dot11s::IePerr, ns3::dot11s::IeLinkMetricReport, and ns3::dot11s::IePeeringProtocol.
Referenced by ns3::WifiInformationElementVector::AddInformationElement(), GetSerializedSize(), operator==(), and Serialize().
uint16_t ns3::WifiInformationElement::GetSerializedSize | ( | void | ) | const |
Get the size of the serialized IE including Element ID and length fields.
Definition at line 35 of file wifi-information-element.cc.
References GetInformationFieldSize().
Referenced by ns3::dot11s::PeerLinkFrameStart::GetSerializedSize(), ns3::ExtendedSupportedRatesIE::GetSerializedSize(), ns3::HtCapabilities::GetSerializedSize(), ns3::MgtAssocRequestHeader::GetSerializedSize(), ns3::MgtAssocResponseHeader::GetSerializedSize(), ns3::MgtProbeRequestHeader::GetSerializedSize(), and ns3::MgtProbeResponseHeader::GetSerializedSize().
|
virtual |
Compare information elements using Element ID.
a | another information element to compare with |
Definition at line 85 of file wifi-information-element.cc.
References ElementId().
|
virtual |
Compare two IEs for equality by ID & Length, and then through memcmp of serialised version.
a | another information element to compare with |
Reimplemented in ns3::dot11s::IeBeaconTiming.
Definition at line 91 of file wifi-information-element.cc.
References ns3::Buffer::AddAtEnd(), ns3::Buffer::Begin(), ElementId(), GetInformationFieldSize(), ns3::Buffer::PeekData(), and SerializeInformationField().
|
virtual |
In addition, a subclass may optionally override the following...
Generate human-readable form of IE
os | output stream |
Reimplemented in ns3::dot11s::IePreq, ns3::dot11s::IeConfiguration, ns3::dot11s::IeBeaconTiming, ns3::dot11s::IePeerManagement, ns3::dot11s::IePrep, ns3::dot11s::IeRann, ns3::dot11s::IeMeshId, ns3::dot11s::IePerr, ns3::dot11s::IeLinkMetricReport, and ns3::dot11s::IePeeringProtocol.
Definition at line 30 of file wifi-information-element.cc.
Buffer::Iterator ns3::WifiInformationElement::Serialize | ( | Buffer::Iterator | i | ) | const |
Serialize entire IE including Element ID and length fields.
i | an iterator which points to where the IE should be written. |
Definition at line 41 of file wifi-information-element.cc.
References ElementId(), GetInformationFieldSize(), ns3::Buffer::Iterator::Next(), SerializeInformationField(), and ns3::Buffer::Iterator::WriteU8().
Referenced by ns3::dot11s::PeerLinkFrameStart::Serialize(), ns3::ExtendedSupportedRatesIE::Serialize(), ns3::HtCapabilities::Serialize(), ns3::MgtAssocRequestHeader::Serialize(), ns3::MgtAssocResponseHeader::Serialize(), ns3::MgtProbeRequestHeader::Serialize(), and ns3::MgtProbeResponseHeader::Serialize().
|
pure virtual |
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
start | an iterator which points to where the information should be written. |
Implemented in ns3::SupportedRates, ns3::dot11s::IePreq, ns3::dot11s::IeConfiguration, ns3::dot11s::IeBeaconTiming, ns3::dot11s::IePeerManagement, ns3::Ssid, ns3::HtCapabilities, ns3::ExtendedSupportedRatesIE, ns3::dot11s::IePrep, ns3::dot11s::IeRann, ns3::dot11s::IeMeshId, ns3::dot11s::IePerr, ns3::dot11s::IeLinkMetricReport, and ns3::dot11s::IePeeringProtocol.
Referenced by operator==(), and Serialize().