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 "ns3/queue.h"
28 #include "wifi-mac-queue-item.h"
29 
30 
31 namespace ns3 {
32 
33 class QosBlockedDestinations;
34 
50 class WifiMacQueue : public Queue<WifiMacQueueItem>
51 {
52 public:
57  static TypeId GetTypeId (void);
58  WifiMacQueue ();
59  ~WifiMacQueue ();
60 
63  {
66  };
67 
73  void SetMaxDelay (Time delay);
79  Time GetMaxDelay (void) const;
80 
87  bool Enqueue (Ptr<WifiMacQueueItem> item);
94  bool PushFront (Ptr<WifiMacQueueItem> item);
116  Mac48Address addr);
134  Ptr<const WifiMacQueueItem> Peek (void) const;
150  Mac48Address addr);
174  bool Remove (Ptr<const Packet> packet);
185  uint32_t GetNPacketsByTidAndAddress (uint8_t tid,
187  Mac48Address addr);
188 
194  bool IsEmpty (void);
195 
201  uint32_t GetNPackets (void);
202 
208  uint32_t GetNBytes (void);
209 
210 private:
219  bool TtlExceeded (ConstIterator &it);
220 
223 
225 };
226 
227 } //namespace ns3
228 
229 #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 > PeekFirstAvailable(const Ptr< QosBlockedDestinations > blockedPackets)
Return first available packet for transmission.
uint32_t GetNPacketsByTidAndAddress(uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
Return the number of QoS packets having tid equal to tid and address specified by type equal to addr...
uint32_t GetNBytes(void)
Ptr< WifiMacQueueItem > Dequeue(void)
Dequeue the packet in the front of the queue.
Template class for packet Queues.
AddressType
Address types.
Ptr< WifiMacQueueItem > DequeueByTidAndAddress(uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
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.
Ptr< WifiMacQueueItem > DequeueFirstAvailable(const Ptr< QosBlockedDestinations > blockedPackets)
Return first available packet for transmission.
DropPolicy m_dropPolicy
Drop behavior of queue.
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.
Ptr< const WifiMacQueueItem > PeekByTidAndAddress(uint8_t tid, WifiMacHeader::AddressType type, Mac48Address addr)
Search and return, if present in the queue, the first packet having the address indicated by type equ...
bool TtlExceeded(ConstIterator &it)
Remove the item pointed to by the iterator it if it has been in the queue for too long...
Time GetMaxDelay(void) const
Return the maximum delay before the packet is discarded.
uint32_t GetNPackets(void)
a unique identifier for an interface.
Definition: type-id.h:58
DropPolicy
drop policy