22 #ifndef WIFI_MAC_QUEUE_H
23 #define WIFI_MAC_QUEUE_H
27 #include "ns3/packet.h"
28 #include "ns3/nstime.h"
29 #include "ns3/object.h"
33 class QosBlockedDestinations;
Time m_maxDelay
Time to live for packets in the queue.
Keep track of destination address - TID pairs that are waiting for a block ACK response.
uint32_t GetSize(void)
Return the current queue size.
WifiMacHeader hdr
Wifi MAC header associated with the packet.
keep track of time values and allow control of global simulation resolution
void SetMaxDelay(Time delay)
Set the maximum delay before the packet is discarded.
Ptr< const Packet > packet
Actual packet.
void Flush(void)
Flush the queue.
virtual void Cleanup(void)
Clean up the queue by removing packets that exceeded the maximum delay.
Ptr< const Packet > PeekByTidAndAddress(WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
Searchs and returns, if is present in this queue, first packet having address indicated by type equal...
uint32_t GetNPacketsByTidAndAddress(uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
Returns number of QoS packets having tid equals to tid and address specified by type equals to addr...
bool Remove(Ptr< const Packet > packet)
If exists, removes packet from queue and returns true.
void SetMaxSize(uint32_t maxSize)
Set the maximum queue size.
Ptr< const Packet > DequeueFirstAvailable(WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets)
Returns first available packet for transmission.
std::list< struct Item >::reverse_iterator PacketQueueRI
typedef for packet (struct Item) queue reverse iterator.
Ptr< const Packet > DequeueByTidAndAddress(WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
Searchs and returns, if is present in this queue, first packet having address indicated by type equal...
bool IsEmpty(void)
Return if the queue is empty.
static TypeId GetTypeId(void)
uint32_t GetMaxSize(void) const
Return the maximum queue size.
Ptr< const Packet > Dequeue(WifiMacHeader *hdr)
Dequeue the packet in the front of the queue.
uint32_t m_size
Current queue size.
Ptr< const Packet > Peek(WifiMacHeader *hdr)
Peek the packet in the front of the queue.
void PushFront(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Enqueue the given packet and its corresponding WifiMacHeader at the front of the queue.
Time tstamp
timestamp when the packet arrived at the queue
This queue implements the timeout procedure described in IEEE Std.
Mac48Address GetAddressForPacket(enum WifiMacHeader::AddressType type, PacketQueueI it)
Return the appropriate address for the given packet (given by PacketQueue iterator).
Ptr< const Packet > PeekFirstAvailable(WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets)
Returns first available packet for transmission.
void Enqueue(Ptr< const Packet > packet, const WifiMacHeader &hdr)
Enqueue the given packet and its corresponding WifiMacHeader at the end of the queue.
Time GetMaxDelay(void) const
Return the maximum delay before the packet is discarded.
a base class which provides memory management and object aggregation
A struct that holds information about a packet for putting in a packet queue.
std::list< struct Item > PacketQueue
typedef for packet (struct Item) queue.
a unique identifier for an interface.
std::list< struct Item >::iterator PacketQueueI
typedef for packet (struct Item) queue iterator.
PacketQueue m_queue
Packet (struct Item) queue.
uint32_t m_maxSize
Queue capacity.
Item(Ptr< const Packet > packet, const WifiMacHeader &hdr, Time tstamp)
Create a struct with the given parameters.