#include <wifi-mac-queue.h>
Classes | |
struct | Item |
Public Member Functions | |
WifiMacQueue () | |
~WifiMacQueue () | |
Ptr< const Packet > | Dequeue (WifiMacHeader *hdr) |
Ptr< const Packet > | DequeueByTidAndAddress (WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr) |
Ptr< const Packet > | DequeueFirstAvailable (WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets) |
void | Enqueue (Ptr< const Packet > packet, const WifiMacHeader &hdr) |
void | Flush (void) |
Time | GetMaxDelay (void) const |
uint32_t | GetMaxSize (void) const |
uint32_t | GetNPacketsByTidAndAddress (uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr) |
uint32_t | GetSize (void) |
bool | IsEmpty (void) |
Ptr< const Packet > | Peek (WifiMacHeader *hdr) |
Ptr< const Packet > | PeekByTidAndAddress (WifiMacHeader *hdr, uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr) |
Ptr< const Packet > | PeekFirstAvailable (WifiMacHeader *hdr, Time &tStamp, const QosBlockedDestinations *blockedPackets) |
void | PushFront (Ptr< const Packet > packet, const WifiMacHeader &hdr) |
bool | Remove (Ptr< const Packet > packet) |
void | SetMaxDelay (Time delay) |
void | SetMaxSize (uint32_t maxSize) |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::WifiMacQueue. |
Private Types | |
typedef std::list< struct Item > | PacketQueue |
typedef std::list< struct Item > ::iterator | PacketQueueI |
typedef std::list< struct Item > ::reverse_iterator | PacketQueueRI |
Private Member Functions | |
void | Cleanup (void) |
Mac48Address | GetAddressForPacket (enum WifiMacHeader::AddressType type, PacketQueueI) |
Private Attributes | |
Time | m_maxDelay |
uint32_t | m_maxSize |
WifiMacParameters * | m_parameters |
PacketQueue | m_queue |
uint32_t | m_size |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
This queue implements the timeout procedure described in IEEE Std. 802.11-2007, section 9.9.1.6, paragraph 6.
When a packet is received by the MAC, to be sent to the PHY, it is queued in the internal queue after being tagged by the current time.
When a packet is dequeued, the queue checks its timestamp to verify whether or not it should be dropped. If dot11EDCATableMSDULifetime has elapsed, it is dropped. Otherwise, it is returned to the caller.
Definition at line 52 of file wifi-mac-queue.h.
|
private |
Definition at line 124 of file wifi-mac-queue.h.
|
private |
Definition at line 128 of file wifi-mac-queue.h.
|
private |
Definition at line 127 of file wifi-mac-queue.h.
ns3::WifiMacQueue::WifiMacQueue | ( | ) |
Definition at line 62 of file wifi-mac-queue.cc.
ns3::WifiMacQueue::~WifiMacQueue | ( | ) |
Definition at line 67 of file wifi-mac-queue.cc.
References Flush().
|
private |
Definition at line 110 of file wifi-mac-queue.cc.
References m_maxDelay, m_queue, m_size, and ns3::Now().
Referenced by Dequeue(), DequeueByTidAndAddress(), DequeueFirstAvailable(), Enqueue(), GetNPacketsByTidAndAddress(), IsEmpty(), Peek(), PeekByTidAndAddress(), PeekFirstAvailable(), and PushFront().
Ptr< const Packet > ns3::WifiMacQueue::Dequeue | ( | WifiMacHeader * | hdr | ) |
Definition at line 135 of file wifi-mac-queue.cc.
References Cleanup(), ns3::WifiMacQueue::Item::hdr, m_queue, m_size, and ns3::WifiMacQueue::Item::packet.
Referenced by ns3::DcaTxop::NotifyAccessGranted().
Ptr< const Packet > ns3::WifiMacQueue::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 equals to addr, and tid equals to tid. This method removes the packet from this queue. Is typically used by ns3::EdcaTxopN in order to perform correct MSDU aggregation (A-MSDU).
Definition at line 163 of file wifi-mac-queue.cc.
References Cleanup(), GetAddressForPacket(), m_queue, m_size, and NS_ASSERT.
Ptr< const Packet > ns3::WifiMacQueue::DequeueFirstAvailable | ( | WifiMacHeader * | hdr, |
Time & | tStamp, | ||
const QosBlockedDestinations * | blockedPackets | ||
) |
Returns first available packet for transmission. A packet could be no available if it's a QoS packet with a tid and an address1 fields equal to tid and addr respectively that index a pending agreement in the BlockAckManager object. So that packet must not be transmitted until reception of an ADDBA response frame from station addressed by addr. This method removes the packet from queue.
Definition at line 308 of file wifi-mac-queue.cc.
References Cleanup(), ns3::QosBlockedDestinations::IsBlocked(), m_queue, and m_size.
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
void ns3::WifiMacQueue::Enqueue | ( | Ptr< const Packet > | packet, |
const WifiMacHeader & | hdr | ||
) |
Definition at line 97 of file wifi-mac-queue.cc.
References Cleanup(), m_maxSize, m_queue, m_size, and ns3::Now().
Referenced by ns3::DcaTxop::Queue(), and ns3::EdcaTxopN::Queue().
void ns3::WifiMacQueue::Flush | ( | void | ) |
Definition at line 230 of file wifi-mac-queue.cc.
References m_queue, and m_size.
Referenced by ns3::EdcaTxopN::NotifyChannelSwitching(), ns3::DcaTxop::NotifyChannelSwitching(), and ~WifiMacQueue().
|
private |
Definition at line 237 of file wifi-mac-queue.cc.
References ns3::WifiMacHeader::ADDR1, ns3::WifiMacHeader::ADDR2, and ns3::WifiMacHeader::ADDR3.
Referenced by DequeueByTidAndAddress(), GetNPacketsByTidAndAddress(), and PeekByTidAndAddress().
Time ns3::WifiMacQueue::GetMaxDelay | ( | void | ) | const |
Definition at line 91 of file wifi-mac-queue.cc.
References m_maxDelay.
Referenced by ns3::EdcaTxopN::EdcaTxopN().
uint32_t ns3::WifiMacQueue::GetMaxSize | ( | void | ) | const |
Definition at line 85 of file wifi-mac-queue.cc.
References m_maxSize.
uint32_t ns3::WifiMacQueue::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.
Definition at line 284 of file wifi-mac-queue.cc.
References Cleanup(), GetAddressForPacket(), m_queue, and NS_ASSERT.
Referenced by ns3::BlockAckManager::ScheduleBlockAckReqIfNeeded(), ns3::EdcaTxopN::SetupBlockAckIfNeeded(), and ns3::BlockAckManager::SwitchToBlockAckIfNeeded().
uint32_t ns3::WifiMacQueue::GetSize | ( | void | ) |
Definition at line 224 of file wifi-mac-queue.cc.
References m_size.
|
static |
This method returns the TypeId associated to ns3::WifiMacQueue.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
Reimplemented from ns3::Object.
Definition at line 45 of file wifi-mac-queue.cc.
References m_maxDelay, m_maxSize, ns3::Seconds(), and ns3::TypeId::SetParent().
bool ns3::WifiMacQueue::IsEmpty | ( | void | ) |
Definition at line 217 of file wifi-mac-queue.cc.
References Cleanup(), and m_queue.
Referenced by ns3::EdcaTxopN::NeedsAccess(), ns3::DcaTxop::NeedsAccess(), ns3::EdcaTxopN::NotifyAccessGranted(), ns3::DcaTxop::NotifyAccessGranted(), ns3::EdcaTxopN::RestartAccessIfNeeded(), ns3::DcaTxop::RestartAccessIfNeeded(), ns3::EdcaTxopN::StartAccessIfNeeded(), and ns3::DcaTxop::StartAccessIfNeeded().
Ptr< const Packet > ns3::WifiMacQueue::Peek | ( | WifiMacHeader * | hdr | ) |
Definition at line 150 of file wifi-mac-queue.cc.
References Cleanup(), ns3::WifiMacQueue::Item::hdr, m_queue, and ns3::WifiMacQueue::Item::packet.
Ptr< const Packet > ns3::WifiMacQueue::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 equals to addr, and tid equals to tid. This method doesn't remove the packet from this queue. Is typically used by ns3::EdcaTxopN in order to perform correct MSDU aggregation (A-MSDU).
Definition at line 192 of file wifi-mac-queue.cc.
References Cleanup(), GetAddressForPacket(), m_queue, and NS_ASSERT.
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
Ptr< const Packet > ns3::WifiMacQueue::PeekFirstAvailable | ( | WifiMacHeader * | hdr, |
Time & | tStamp, | ||
const QosBlockedDestinations * | blockedPackets | ||
) |
Returns first available packet for transmission. The packet isn't removed from queue.
Definition at line 330 of file wifi-mac-queue.cc.
References Cleanup(), ns3::QosBlockedDestinations::IsBlocked(), and m_queue.
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
void ns3::WifiMacQueue::PushFront | ( | Ptr< const Packet > | packet, |
const WifiMacHeader & | hdr | ||
) |
Definition at line 271 of file wifi-mac-queue.cc.
References Cleanup(), m_maxSize, m_queue, m_size, and ns3::Now().
Referenced by ns3::EdcaTxopN::PushFront().
If exists, removes packet from queue and returns true. Otherwise it takes no effects and return false. Deletion of the packet is performed in linear time (O(n)).
Definition at line 255 of file wifi-mac-queue.cc.
References m_queue, and m_size.
Referenced by ns3::EdcaTxopN::NotifyAccessGranted().
void ns3::WifiMacQueue::SetMaxDelay | ( | Time | delay | ) |
Definition at line 79 of file wifi-mac-queue.cc.
References m_maxDelay.
void ns3::WifiMacQueue::SetMaxSize | ( | uint32_t | maxSize | ) |
Definition at line 73 of file wifi-mac-queue.cc.
References m_maxSize.
|
private |
Definition at line 147 of file wifi-mac-queue.h.
Referenced by Cleanup(), GetMaxDelay(), GetTypeId(), and SetMaxDelay().
|
private |
Definition at line 146 of file wifi-mac-queue.h.
Referenced by Enqueue(), GetMaxSize(), GetTypeId(), PushFront(), and SetMaxSize().
|
private |
Definition at line 144 of file wifi-mac-queue.h.
|
private |
Definition at line 143 of file wifi-mac-queue.h.
Referenced by Cleanup(), Dequeue(), DequeueByTidAndAddress(), DequeueFirstAvailable(), Enqueue(), Flush(), GetNPacketsByTidAndAddress(), IsEmpty(), Peek(), PeekByTidAndAddress(), PeekFirstAvailable(), PushFront(), and Remove().
|
private |
Definition at line 145 of file wifi-mac-queue.h.
Referenced by Cleanup(), Dequeue(), DequeueByTidAndAddress(), DequeueFirstAvailable(), Enqueue(), Flush(), GetSize(), PushFront(), and Remove().