The Traffic Indication Map Information Element. More...
#include "tim.h"
Inheritance diagram for ns3::Tim:
Collaboration diagram for ns3::Tim:Public Member Functions | |
| template<typename Iterator> | |
| void | AddAid (Iterator begin, Iterator end) |
| Add the AID values in the provided iterator range to the list contained in the Virtual Bitmap. | |
| void | AddAid (uint16_t aid) |
| Add the provided AID value to the list contained in the Virtual Bitmap. | |
| WifiInformationElementId | ElementId () const override |
| Get the wifi information element ID. | |
| std::set< uint16_t > | GetAidSet (uint16_t aid=0) const |
| Return the AID values, greater than the given AID value, whose corresponding bits are set in the virtual bitmap. | |
| uint8_t | GetLastNonZeroOctetIndex () const |
| uint8_t | GetPartialVirtualBitmapOffset () const |
| Get the Partial Virtual Bitmap offset, i.e., the number (denoted as N1 by the specs) of the first octet included in the Partial Virtual Bitmap. | |
| bool | HasAid (uint16_t aid) const |
| Check whether the bit corresponding to the provided AID is set in the Virtual Bitmap included in this TIM. | |
| void | Print (std::ostream &os) const override |
| Generate human-readable form of IE. | |
Public Member Functions inherited from ns3::WifiInformationElement | |
| virtual | ~WifiInformationElement () |
| Buffer::Iterator | Deserialize (Buffer::Iterator i) |
| Deserialize entire IE (which may possibly be fragmented into multiple elements), which must be present. | |
| Buffer::Iterator | DeserializeIfPresent (Buffer::Iterator i) |
| Deserialize entire IE (which may possibly be fragmented into multiple elements) if it is present. | |
| virtual WifiInformationElementId | ElementIdExt () const |
| Get the wifi information element ID extension. | |
| uint16_t | GetSerializedSize () const |
| Get the size of the serialized IE including Element ID and length fields (for every element this IE is possibly fragmented into). | |
| virtual bool | operator== (const WifiInformationElement &a) const |
| Compare two IEs for equality by ID & Length, and then through memcmp of serialized version. | |
| Buffer::Iterator | Serialize (Buffer::Iterator i) const |
| Serialize entire IE including Element ID and length fields. | |
Public Member Functions inherited from ns3::SimpleRefCount< WifiInformationElement > | |
| SimpleRefCount () | |
| Default constructor. | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. | |
| void | Ref () const |
| Increment the reference count. | |
| void | Unref () const |
| Decrement the reference count. | |
Public Attributes | |
| uint8_t | m_dtimCount {0} |
| The DTIM Count field. | |
| uint8_t | m_dtimPeriod {0} |
| The DTIM Period field. | |
| bool | m_hasMulticastPending {false} |
| Whether there is Multicast / Broadcast data. | |
Private Member Functions | |
| uint16_t | DeserializeInformationField (Buffer::Iterator start, uint16_t length) override |
| Deserialize information (i.e., the body of the IE, not including the Element ID and length octets) | |
| uint8_t | GetAidBit (uint16_t aid) const |
| Obtain an octet with a set bit, corresponding to the provided AID value. | |
| uint16_t | GetAidFromOctetIndexAndBitPosition (uint16_t octet, uint8_t position) const |
| Obtain the AID value represented by a certain octet index and bit position inside the Virtual Bitmap. | |
| uint8_t | GetAidOctetIndex (uint16_t aid) const |
| Obtain the index of the octet where the provided AID value should be set in the Virtual Bitmap. | |
| uint8_t | GetBitmapControl () const |
| The Bitmap Control field is optional if the TIM is carried in an S1G PPDU, while it is always present when the TIM is carried in a non-S1G PPDU. | |
| uint16_t | GetInformationFieldSize () const override |
| Length of serialized information (i.e., the length of the body of the IE, not including the Element ID and length octets. | |
| std::vector< uint8_t > | GetPartialVirtualBitmap () const |
| void | SerializeInformationField (Buffer::Iterator start) const override |
| Serialize information (i.e., the body of the IE, not including the Element ID and length octets) | |
Private Attributes | |
| std::set< uint16_t > | m_aidValues |
| List of AID values included in this TIM. | |
The Traffic Indication Map Information Element.
The 802.11 Traffic Indication Map (see section 9.4.2.5 of 802.11-2020)
Note: The current implementation does not support S1G operation, or multiple BSSID.
| void ns3::Tim::AddAid | ( | Iterator | begin, |
| Iterator | end ) |
Add the AID values in the provided iterator range to the list contained in the Virtual Bitmap.
| Iterator | Type of iterator |
| begin | Starting position of the iterator range |
| end | Ending position of the iterator range |
Definition at line 140 of file tim.h.
References AddAid().
Here is the call graph for this function:| void ns3::Tim::AddAid | ( | uint16_t | aid | ) |
Add the provided AID value to the list contained in the Virtual Bitmap.
| aid | the AID value to add to this TIM's Virtual Bitmap |
Definition at line 40 of file tim.cc.
References m_aidValues, ns3::MAX_AID, and NS_ABORT_IF.
Referenced by AddAid(), and TimInformationElementTest::SetTim().
Here is the caller graph for this function:
|
overrideprivatevirtual |
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 | the expected number of bytes to read |
Implements ns3::WifiInformationElement.
Definition at line 77 of file tim.cc.
References GetAidFromOctetIndexAndBitPosition(), m_aidValues, m_dtimCount, m_dtimPeriod, m_hasMulticastPending, and NS_ABORT_MSG_IF.
Here is the call graph for this function:
|
overridevirtual |
Get the wifi information element ID.
Implements ns3::WifiInformationElement.
Definition at line 20 of file tim.cc.
References IE_TIM.
|
private |
Obtain an octet with a set bit, corresponding to the provided AID value.
| aid | the provided AID value |
Definition at line 129 of file tim.cc.
Referenced by GetPartialVirtualBitmap().
Here is the caller graph for this function:
|
private |
Obtain the AID value represented by a certain octet index and bit position inside the Virtual Bitmap.
| octet | the octet index in the Virtual Bitmap |
| position | the bit position in the octet of the Virtual Bitmap |
Definition at line 138 of file tim.cc.
Referenced by DeserializeInformationField().
Here is the caller graph for this function:
|
private |
Obtain the index of the octet where the provided AID value should be set in the Virtual Bitmap.
| aid | the provided AID value |
Definition at line 120 of file tim.cc.
Referenced by GetLastNonZeroOctetIndex(), GetPartialVirtualBitmap(), and GetPartialVirtualBitmapOffset().
Here is the caller graph for this function:| std::set< uint16_t > ns3::Tim::GetAidSet | ( | uint16_t | aid = 0 | ) | const |
Return the AID values, greater than the given AID value, whose corresponding bits are set in the virtual bitmap.
| aid | the given AID value |
Definition at line 54 of file tim.cc.
References m_aidValues.
Referenced by TimInformationElementTest::CheckAidSet().
Here is the caller graph for this function:
|
private |
The Bitmap Control field is optional if the TIM is carried in an S1G PPDU, while it is always present when the TIM is carried in a non-S1G PPDU.
Definition at line 174 of file tim.cc.
References GetPartialVirtualBitmapOffset(), m_dtimCount, and m_hasMulticastPending.
Referenced by SerializeInformationField().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprivatevirtual |
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 - if the IE is not fragmented)
Implements ns3::WifiInformationElement.
Definition at line 26 of file tim.cc.
References GetLastNonZeroOctetIndex(), and GetPartialVirtualBitmapOffset().
Here is the call graph for this function:| uint8_t ns3::Tim::GetLastNonZeroOctetIndex | ( | ) | const |
Definition at line 159 of file tim.cc.
References GetAidOctetIndex(), and m_aidValues.
Referenced by GetInformationFieldSize(), and GetPartialVirtualBitmap().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 191 of file tim.cc.
References GetAidBit(), GetAidOctetIndex(), GetLastNonZeroOctetIndex(), GetPartialVirtualBitmapOffset(), and m_aidValues.
Referenced by SerializeInformationField().
Here is the call graph for this function:
Here is the caller graph for this function:| uint8_t ns3::Tim::GetPartialVirtualBitmapOffset | ( | ) | const |
Get the Partial Virtual Bitmap offset, i.e., the number (denoted as N1 by the specs) of the first octet included in the Partial Virtual Bitmap.
Note that the Bitmap Offset subfield contains the number N1/2.
Definition at line 144 of file tim.cc.
References GetAidOctetIndex(), and m_aidValues.
Referenced by GetBitmapControl(), GetInformationFieldSize(), and GetPartialVirtualBitmap().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ns3::Tim::HasAid | ( | uint16_t | aid | ) | const |
Check whether the bit corresponding to the provided AID is set in the Virtual Bitmap included in this TIM.
| aid | The AID value to look for |
Definition at line 48 of file tim.cc.
References m_aidValues.
Referenced by Print().
Here is the caller graph for this function:
|
overridevirtual |
Generate human-readable form of IE.
| os | output stream |
Reimplemented from ns3::WifiInformationElement.
Definition at line 208 of file tim.cc.
References HasAid(), m_dtimCount, m_dtimPeriod, and m_hasMulticastPending.
Here is the call graph for this function:
|
overrideprivatevirtual |
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. |
Implements ns3::WifiInformationElement.
Definition at line 61 of file tim.cc.
References GetBitmapControl(), GetPartialVirtualBitmap(), m_dtimCount, and m_dtimPeriod.
Here is the call graph for this function:
|
private |
List of AID values included in this TIM.
Definition at line 135 of file tim.h.
Referenced by AddAid(), DeserializeInformationField(), GetAidSet(), GetLastNonZeroOctetIndex(), GetPartialVirtualBitmap(), GetPartialVirtualBitmapOffset(), and HasAid().
| uint8_t ns3::Tim::m_dtimCount {0} |
The DTIM Count field.
Definition at line 85 of file tim.h.
Referenced by DeserializeInformationField(), GetBitmapControl(), Print(), SerializeInformationField(), and TimInformationElementTest::SetTim().
| uint8_t ns3::Tim::m_dtimPeriod {0} |
The DTIM Period field.
Definition at line 86 of file tim.h.
Referenced by DeserializeInformationField(), Print(), SerializeInformationField(), and TimInformationElementTest::SetTim().
| bool ns3::Tim::m_hasMulticastPending {false} |
Whether there is Multicast / Broadcast data.
Definition at line 87 of file tim.h.
Referenced by DeserializeInformationField(), GetBitmapControl(), Print(), and TimInformationElementTest::SetTim().