WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were enqueued. More...
#include "wifi-mac-queue-item.h"
Public Member Functions | |
WifiMacQueueItem (Ptr< const Packet > p, const WifiMacHeader &header) | |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header. More... | |
WifiMacQueueItem (Ptr< const Packet > p, const WifiMacHeader &header, Time tstamp) | |
Create a Wifi MAC queue item containing a packet and a Wifi MAC header. More... | |
virtual | ~WifiMacQueueItem () |
void | Aggregate (Ptr< const WifiMacQueueItem > msdu) |
Aggregate the MSDU contained in the given MPDU to this MPDU (thus constituting an A-MSDU). More... | |
MsduAggregator::DeaggregatedMsdusCI | begin (void) |
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs. More... | |
MsduAggregator::DeaggregatedMsdusCI | end (void) |
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs. More... | |
Mac48Address | GetDestinationAddress (void) const |
Return the destination address present in the header. More... | |
const WifiMacHeader & | GetHeader (void) const |
Get the header stored in this item. More... | |
WifiMacHeader & | GetHeader (void) |
Get the header stored in this item. More... | |
Ptr< const Packet > | GetPacket (void) const |
Get the packet stored in this item. More... | |
Ptr< Packet > | GetProtocolDataUnit (void) const |
Get the MAC protocol data unit (MPDU) corresponding to this item (i.e. More... | |
uint32_t | GetSize (void) const |
Return the size of the packet stored by this item, including header size and trailer size. More... | |
Time | GetTimeStamp (void) const |
Get the timestamp included in this item. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
![]() | |
SimpleRefCount () | |
Default 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 operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Private Member Functions | |
void | DoAggregate (Ptr< const WifiMacQueueItem > 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... | |
MsduAggregator::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... | |
Time | m_tstamp |
timestamp when the packet arrived at the queue More... | |
WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were enqueued.
Definition at line 43 of file wifi-mac-queue-item.h.
ns3::WifiMacQueueItem::WifiMacQueueItem | ( | 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 35 of file wifi-mac-queue-item.cc.
ns3::WifiMacQueueItem::WifiMacQueueItem | ( | Ptr< const Packet > | p, |
const WifiMacHeader & | header, | ||
Time | tstamp | ||
) |
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. |
tstamp | the timestamp associated with the created item. |
Definition at line 40 of file wifi-mac-queue-item.cc.
References ns3::Packet::Copy(), ns3::MsduAggregator::Deaggregate(), ns3::WifiMacHeader::IsQosAmsdu(), ns3::WifiMacHeader::IsQosData(), and m_msduList.
|
virtual |
Definition at line 51 of file wifi-mac-queue-item.cc.
void ns3::WifiMacQueueItem::Aggregate | ( | Ptr< const WifiMacQueueItem > | msdu | ) |
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 101 of file wifi-mac-queue-item.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().
MsduAggregator::DeaggregatedMsdusCI ns3::WifiMacQueueItem::begin | ( | void | ) |
Get a constant iterator pointing to the first MSDU in the list of aggregated MSDUs.
Definition at line 191 of file wifi-mac-queue-item.cc.
References m_msduList.
|
private |
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 135 of file wifi-mac-queue-item.cc.
References ns3::Packet::AddAtEnd(), ns3::Packet::AddHeader(), ns3::MsduAggregator::CalculatePadding(), ns3::Packet::Copy(), ns3::Packet::GetSize(), m_msduList, m_packet, m_tstamp, ns3::Max(), NS_ASSERT, NS_LOG_FUNCTION, ns3::AmsduSubframeHeader::SetDestinationAddr(), ns3::AmsduSubframeHeader::SetLength(), and ns3::AmsduSubframeHeader::SetSourceAddr().
Referenced by Aggregate().
MsduAggregator::DeaggregatedMsdusCI ns3::WifiMacQueueItem::end | ( | void | ) |
Get a constant iterator indicating past-the-last MSDU in the list of aggregated MSDUs.
Definition at line 197 of file wifi-mac-queue-item.cc.
References m_msduList.
Mac48Address ns3::WifiMacQueueItem::GetDestinationAddress | ( | void | ) | const |
Return the destination address present in the header.
Definition at line 74 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetAddr1(), and m_header.
const WifiMacHeader & ns3::WifiMacQueueItem::GetHeader | ( | void | ) | const |
Get the header stored in this item.
Definition at line 62 of file wifi-mac-queue-item.cc.
References m_header.
Referenced by OriginatorBlockAckWindowTest::DoRun().
WifiMacHeader & ns3::WifiMacQueueItem::GetHeader | ( | void | ) |
Get the header stored in this item.
Definition at line 68 of file wifi-mac-queue-item.cc.
References m_header.
Get the packet stored in this item.
Definition at line 56 of file wifi-mac-queue-item.cc.
References m_packet.
Referenced by TwoLevelAggregationTest::DoRun(), and WifiAcMappingTest::PacketEnqueuedInWifiMacQueue().
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 92 of file wifi-mac-queue-item.cc.
References ns3::Packet::AddHeader(), ns3::AddWifiMacTrailer(), ns3::Packet::Copy(), m_header, and m_packet.
uint32_t ns3::WifiMacQueueItem::GetSize | ( | void | ) | const |
Return the size of the packet stored by this item, including header size and trailer size.
Definition at line 86 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetSerializedSize(), ns3::Packet::GetSize(), m_header, m_packet, and ns3::WIFI_MAC_FCS_LENGTH.
Time ns3::WifiMacQueueItem::GetTimeStamp | ( | void | ) | const |
Get the timestamp included in this item.
Definition at line 80 of file wifi-mac-queue-item.cc.
References m_tstamp.
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Definition at line 203 of file wifi-mac-queue-item.cc.
References ns3::WifiMacHeader::GetAddr1(), ns3::WifiMacHeader::GetQosTid(), ns3::WifiMacHeader::GetSequenceNumber(), ns3::Packet::GetSize(), ns3::WifiMacHeader::IsQosAck(), ns3::WifiMacHeader::IsQosBlockAck(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsQosNoAck(), m_header, m_packet, m_tstamp, and ns3::Simulator::Now().
Referenced by ns3::operator<<().
|
private |
Wifi MAC header associated with the packet.
Definition at line 146 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), GetDestinationAddress(), GetHeader(), GetProtocolDataUnit(), GetSize(), and Print().
|
private |
The list of aggregated MSDUs included in this MPDU.
Definition at line 148 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), begin(), DoAggregate(), end(), and WifiMacQueueItem().
The packet (MSDU or A-MSDU) contained in this queue item.
Definition at line 145 of file wifi-mac-queue-item.h.
Referenced by Aggregate(), DoAggregate(), GetPacket(), GetProtocolDataUnit(), GetSize(), and Print().
|
private |
timestamp when the packet arrived at the queue
Definition at line 147 of file wifi-mac-queue-item.h.
Referenced by DoAggregate(), GetTimeStamp(), and Print().