A Discrete-Event Network Simulator
API
wifi-mac-queue.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005, 2009 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Mirko Banchi <mk.banchi@gmail.com>
21  * Stefano Avallone <stavallo@unina.it>
22  */
23 
24 #ifndef WIFI_MAC_QUEUE_H
25 #define WIFI_MAC_QUEUE_H
26 
27 #include "wifi-mac-queue-item.h"
28 
29 namespace ns3 {
30 
31 class QosBlockedDestinations;
32 
48 class WifiMacQueue : public Queue<WifiMacQueueItem>
49 {
50 public:
55  static TypeId GetTypeId (void);
56  WifiMacQueue ();
57  ~WifiMacQueue ();
58 
61  {
64  };
65 
71  void SetMaxDelay (Time delay);
77  Time GetMaxDelay (void) const;
78 
85  bool Enqueue (Ptr<WifiMacQueueItem> item);
92  bool PushFront (Ptr<WifiMacQueueItem> item);
123  Mac48Address dest);
141  Ptr<const WifiMacQueueItem> Peek (void) const;
155  Mac48Address dest);
179  bool Remove (Ptr<const Packet> packet);
188  uint32_t GetNPacketsByAddress (Mac48Address dest);
198  uint32_t GetNPacketsByTidAndAddress (uint8_t tid, Mac48Address dest);
199 
205  bool IsEmpty (void);
206 
212  uint32_t GetNPackets (void);
213 
219  uint32_t GetNBytes (void);
220 
221 private:
230  bool TtlExceeded (ConstIterator &it);
231 
234 
236 };
237 
238 } //namespace ns3
239 
240 #endif /* WIFI_MAC_QUEUE_H */
Time m_maxDelay
Time to live for packets in the queue.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetMaxDelay(Time delay)
Set the maximum delay before the packet is discarded.
Ptr< const WifiMacQueueItem > PeekByTidAndAddress(uint8_t tid, Mac48Address dest)
Search and return, if present in the queue, the first packet having the address indicated by type equ...
Ptr< const WifiMacQueueItem > PeekFirstAvailable(const Ptr< QosBlockedDestinations > blockedPackets)
Return first available packet for transmission.
uint32_t GetNBytes(void)
uint32_t GetNPacketsByTidAndAddress(uint8_t tid, Mac48Address dest)
Return the number of QoS packets having tid equal to tid and destination address equal to dest...
Ptr< WifiMacQueueItem > Dequeue(void)
Dequeue the packet in the front of the queue.
Template class for packet Queues.
Ptr< WifiMacQueueItem > DequeueByAddress(Mac48Address dest)
Search and return, if present in the queue, the first packet having the address indicated by type equ...
Ptr< const WifiMacQueueItem > Peek(void) const
Peek the packet in the front of the queue.
static TypeId GetTypeId(void)
Get the type ID.
Time GetMaxDelay(void) const
Return the maximum delay before the packet is discarded.
Ptr< WifiMacQueueItem > DequeueFirstAvailable(const Ptr< QosBlockedDestinations > blockedPackets)
Return first available packet for transmission.
DropPolicy m_dropPolicy
Drop behavior of queue.
uint32_t GetNPacketsByAddress(Mac48Address dest)
Return the number of packets having destination address specified by dest.
DropPolicy
drop policy
Every class exported by the ns3 library is enclosed in the ns3 namespace.
an EUI-48 address
Definition: mac48-address.h:43
bool Enqueue(Ptr< WifiMacQueueItem > item)
Enqueue the given Wifi MAC queue item at the end of the queue.
This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" pa...
Ptr< WifiMacQueueItem > Remove(void)
Remove the packet in the front of the queue.
NS_LOG_TEMPLATE_DECLARE
redefinition of the log component
bool PushFront(Ptr< WifiMacQueueItem > item)
Enqueue the given Wifi MAC queue item at the front of the queue.
bool TtlExceeded(ConstIterator &it)
Remove the item pointed to by the iterator it if it has been in the queue for too long...
Ptr< WifiMacQueueItem > DequeueByTidAndAddress(uint8_t tid, Mac48Address dest)
Search and return, if present in the queue, the first packet having the address indicated by type equ...
uint32_t GetNPackets(void)
a unique identifier for an interface.
Definition: type-id.h:58