WifiMpdu stores (const) packets along with their Wifi MAC headers and the time when they were enqueued. More...
#include "wifi-mpdu.h"
Inheritance diagram for ns3::WifiMpdu:
Collaboration diagram for ns3::WifiMpdu:Public Types | |
| typedef std::list< std::pair< Ptr< const Packet >, AmsduSubframeHeader > > | DeaggregatedMsdus |
| DeaggregatedMsdus typedef. More... | |
| typedef std::list< std::pair< Ptr< constPacket >, AmsduSubframeHeader > >::const_iterator | DeaggregatedMsdusCI |
| DeaggregatedMsdusCI typedef. More... | |
| typedef std::list< WifiMacQueueElem >::iterator | Iterator |
| Const iterator typedef. More... | |
Public Member Functions | |
| WifiMpdu (Ptr< const Packet > p, const WifiMacHeader &header) | |
| Create a Wifi MAC queue item containing a packet and a Wifi MAC header. More... | |
| virtual | ~WifiMpdu () |
| void | Aggregate (Ptr< const WifiMpdu > msdu) |
| Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU). More... | |
| DeaggregatedMsdusCI | begin () const |
| Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs. More... | |
| DeaggregatedMsdusCI | end () const |
| Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs. More... | |
| Mac48Address | GetDestinationAddress () const |
| Return the destination address present in the header. More... | |
| Time | GetExpiryTime () const |
| WifiMacHeader & | GetHeader () |
| Get the header stored in this item. More... | |
| const WifiMacHeader & | GetHeader () const |
| Get the header stored in this item. More... | |
| Ptr< const Packet > | GetPacket () const |
| Get the packet stored in this item. More... | |
| uint32_t | GetPacketSize () const |
| Return the size in bytes of the packet or control header or management header stored by this item. More... | |
| Ptr< Packet > | GetProtocolDataUnit () const |
| Get the MAC protocol data unit (MPDU) corresponding to this item (i.e. More... | |
| AcIndex | GetQueueAc () const |
| Get the AC of the queue this item is stored into. More... | |
| Iterator | GetQueueIt (WmqIteratorTag tag) const |
| uint32_t | GetSize () const |
| Return the size of the packet stored by this item, including header size and trailer size. More... | |
| bool | IsFragment () const |
| Return true if this item contains an MSDU fragment, false otherwise. More... | |
| bool | IsInFlight () const |
| Return true if this MPDU is in flight, false otherwise. More... | |
| bool | IsQueued () const |
| Return true if this item is stored in some queue, false otherwise. More... | |
| virtual void | Print (std::ostream &os) const |
| Print the item contents. More... | |
| void | ResetInFlight () |
| Mark this MPDU as not being in flight (only used if Block Ack agreement established). More... | |
| void | SetInFlight () |
| Mark this MPDU as being in flight (only used if Block Ack agreement established). More... | |
| void | SetQueueIt (std::optional< Iterator > queueIt, WmqIteratorTag tag) |
| Set the queue iterator stored by this object. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< WifiMpdu > | |
| SimpleRefCount () | |
| Default constructor. More... | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. More... | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. More... | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. More... | |
| void | Ref () const |
| Increment the reference count. More... | |
| void | Unref () const |
| Decrement the reference count. More... | |
Private Member Functions | |
| void | DoAggregate (Ptr< const WifiMpdu > msdu) |
| Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU). More... | |
Private Attributes | |
| WifiMacHeader | m_header |
| Wifi MAC header associated with the packet. More... | |
| bool | m_inFlight |
| whether the MPDU is in flight More... | |
| DeaggregatedMsdus | m_msduList |
| The list of aggregated MSDUs included in this MPDU. More... | |
| Ptr< const Packet > | m_packet |
| The packet (MSDU or A-MSDU) contained in this queue item. More... | |
| std::optional< Iterator > | m_queueIt |
| Queue iterator pointing to this MPDU, if queued. More... | |
WifiMpdu stores (const) packets along with their Wifi MAC headers and the time when they were enqueued.
Definition at line 56 of file wifi-mpdu.h.
| typedef std::list<std::pair<Ptr<const Packet>, AmsduSubframeHeader> > ns3::WifiMpdu::DeaggregatedMsdus |
DeaggregatedMsdus typedef.
Definition at line 124 of file wifi-mpdu.h.
| typedef std::list<std::pair<Ptr<constPacket>,AmsduSubframeHeader>>::const_iterator ns3::WifiMpdu::DeaggregatedMsdusCI |
DeaggregatedMsdusCI typedef.
Definition at line 127 of file wifi-mpdu.h.
| typedef std::list<WifiMacQueueElem>::iterator ns3::WifiMpdu::Iterator |
Const iterator typedef.
Definition at line 143 of file wifi-mpdu.h.
| ns3::WifiMpdu::WifiMpdu | ( | Ptr< const Packet > | p, |
| const WifiMacHeader & | header | ||
| ) |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header.
| p | the const packet included in the created item. |
| header | the Wifi MAC header included in the created item. |
Definition at line 38 of file wifi-mpdu.cc.
References ns3::Packet::Copy(), ns3::MsduAggregator::Deaggregate(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), m_inFlight, and m_msduList.
Here is the call graph for this function:
|
virtual |
Definition at line 49 of file wifi-mpdu.cc.
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU).
Note that the given MPDU cannot contain an A-MSDU.
| msdu | the MPDU containing the MSDU to aggregate |
Definition at line 105 of file wifi-mpdu.cc.
References DoAggregate(), ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiMacHeader::IsFromDs(), ns3::WifiMacHeader::IsToDs(), m_header, m_msduList, m_packet, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_FUNCTION, ns3::WifiMacHeader::SetAddr3(), and ns3::WifiMacHeader::SetQosAmsdu().
Here is the call graph for this function:| WifiMpdu::DeaggregatedMsdusCI ns3::WifiMpdu::begin | ( | ) | const |
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs.
Definition at line 238 of file wifi-mpdu.cc.
References m_msduList.
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU).
Note that the given MPDU cannot contain an A-MSDU.
| msdu | the MPDU containing the MSDU to aggregate |
Definition at line 139 of file wifi-mpdu.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::AddHeader(), ns3::MsduAggregator::CalculatePadding(), ns3::Packet::Copy(), ns3::Packet::GetSize(), m_msduList, m_packet, NS_ASSERT, NS_LOG_FUNCTION, ns3::AmsduSubframeHeader::SetDestinationAddr(), ns3::AmsduSubframeHeader::SetLength(), and ns3::AmsduSubframeHeader::SetSourceAddr().
Referenced by Aggregate().
Here is the call graph for this function:
Here is the caller graph for this function:| WifiMpdu::DeaggregatedMsdusCI ns3::WifiMpdu::end | ( | ) | const |
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs.
Definition at line 244 of file wifi-mpdu.cc.
References m_msduList.
Referenced by grid.TimelinesRenderer::draw_events(), and grid.TimelinesRenderer::draw_ranges().
Here is the caller graph for this function:| Mac48Address ns3::WifiMpdu::GetDestinationAddress | ( | ) | const |
Return the destination address present in the header.
Definition at line 72 of file wifi-mpdu.cc.
References ns3::WifiMacHeader::GetAddr1(), and m_header.
Here is the call graph for this function:| Time ns3::WifiMpdu::GetExpiryTime | ( | ) | const |
Definition at line 213 of file wifi-mpdu.cc.
References IsQueued(), and NS_ASSERT.
Referenced by Print().
Here is the call graph for this function:
Here is the caller graph for this function:| WifiMacHeader & ns3::WifiMpdu::GetHeader | ( | ) |
Get the header stored in this item.
Definition at line 66 of file wifi-mpdu.cc.
References m_header.
| const WifiMacHeader & ns3::WifiMpdu::GetHeader | ( | ) | const |
Get the header stored in this item.
Definition at line 60 of file wifi-mpdu.cc.
References m_header.
Get the packet stored in this item.
Definition at line 54 of file wifi-mpdu.cc.
References m_packet.
| uint32_t ns3::WifiMpdu::GetPacketSize | ( | ) | const |
Return the size in bytes of the packet or control header or management header stored by this item.
Definition at line 78 of file wifi-mpdu.cc.
References ns3::Packet::GetSize(), and m_packet.
Referenced by GetSize(), and Print().
Here is the call graph for this function:
Here is the caller graph for this function:Get the MAC protocol data unit (MPDU) corresponding to this item (i.e.
a copy of the packet stored in this item wrapped with MAC header and trailer)
Definition at line 96 of file wifi-mpdu.cc.
References ns3::Packet::AddHeader(), ns3::AddWifiMacTrailer(), ns3::Packet::Copy(), m_header, and m_packet.
Here is the call graph for this function:| AcIndex ns3::WifiMpdu::GetQueueAc | ( | ) | const |
Get the AC of the queue this item is stored into.
Abort if this item is not stored in a queue.
Definition at line 206 of file wifi-mpdu.cc.
References IsQueued(), and NS_ASSERT.
Here is the call graph for this function:| WifiMpdu::Iterator ns3::WifiMpdu::GetQueueIt | ( | WmqIteratorTag | tag | ) | const |
| tag | a wifi MAC queue iterator tag (allows only WifiMacQueue to call this method) |
Definition at line 199 of file wifi-mpdu.cc.
References IsQueued(), m_queueIt, and NS_ASSERT.
Here is the call graph for this function:| uint32_t ns3::WifiMpdu::GetSize | ( | ) | const |
Return the size of the packet stored by this item, including header size and trailer size.
Definition at line 84 of file wifi-mpdu.cc.
References GetPacketSize(), ns3::WifiMacHeader::GetSerializedSize(), m_header, and ns3::WIFI_MAC_FCS_LENGTH.
Here is the call graph for this function:| bool ns3::WifiMpdu::IsFragment | ( | ) | const |
Return true if this item contains an MSDU fragment, false otherwise.
Definition at line 90 of file wifi-mpdu.cc.
References ns3::WifiMacHeader::GetFragmentNumber(), ns3::WifiMacHeader::IsMoreFragments(), and m_header.
Here is the call graph for this function:| bool ns3::WifiMpdu::IsInFlight | ( | ) | const |
Return true if this MPDU is in flight, false otherwise.
Definition at line 232 of file wifi-mpdu.cc.
References m_inFlight.
Referenced by Print().
Here is the caller graph for this function:| bool ns3::WifiMpdu::IsQueued | ( | ) | const |
Return true if this item is stored in some queue, false otherwise.
Definition at line 187 of file wifi-mpdu.cc.
References m_queueIt.
Referenced by GetExpiryTime(), GetQueueAc(), GetQueueIt(), and Print().
Here is the caller graph for this function:
|
virtual |
Print the item contents.
| os | output stream in which the data should be printed. |
Definition at line 250 of file wifi-mpdu.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetDuration(), GetExpiryTime(), GetPacketSize(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::WifiMacHeader::GetTypeString(), IsInFlight(), ns3::WifiMacHeader::IsQosAck(), ns3::WifiMacHeader::IsQosBlockAck(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsQosNoAck(), IsQueued(), m_header, m_packet, ns3::Simulator::Now(), and ns3::Time::US.
Referenced by ns3::operator<<().
Here is the call graph for this function:
Here is the caller graph for this function:| void ns3::WifiMpdu::ResetInFlight | ( | ) |
Mark this MPDU as not being in flight (only used if Block Ack agreement established).
Definition at line 226 of file wifi-mpdu.cc.
References m_inFlight.
| void ns3::WifiMpdu::SetInFlight | ( | ) |
Mark this MPDU as being in flight (only used if Block Ack agreement established).
Definition at line 220 of file wifi-mpdu.cc.
References m_inFlight.
| void ns3::WifiMpdu::SetQueueIt | ( | std::optional< Iterator > | queueIt, |
| WmqIteratorTag | tag | ||
| ) |
Set the queue iterator stored by this object.
| queueIt | the queue iterator for this object |
| tag | a wifi MAC queue iterator tag (allows only WifiMacQueue to call this method) |
Definition at line 193 of file wifi-mpdu.cc.
References m_queueIt.
|
private |
Wifi MAC header associated with the packet.
Definition at line 215 of file wifi-mpdu.h.
Referenced by Aggregate(), GetDestinationAddress(), GetHeader(), GetProtocolDataUnit(), GetSize(), IsFragment(), and Print().
|
private |
whether the MPDU is in flight
Definition at line 218 of file wifi-mpdu.h.
Referenced by WifiMpdu(), IsInFlight(), ResetInFlight(), and SetInFlight().
|
private |
The list of aggregated MSDUs included in this MPDU.
Definition at line 216 of file wifi-mpdu.h.
Referenced by WifiMpdu(), Aggregate(), begin(), DoAggregate(), and end().
The packet (MSDU or A-MSDU) contained in this queue item.
Definition at line 214 of file wifi-mpdu.h.
Referenced by Aggregate(), DoAggregate(), GetPacket(), GetPacketSize(), GetProtocolDataUnit(), and Print().
|
private |
Queue iterator pointing to this MPDU, if queued.
Definition at line 217 of file wifi-mpdu.h.
Referenced by GetQueueIt(), IsQueued(), and SetQueueIt().