A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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-header.h
"
29
30
namespace
ns3
{
31
class
QosBlockedDestinations;
32
39
class
WifiMacQueueItem
:
public
SimpleRefCount
<WifiMacQueueItem>
40
{
41
public
:
47
WifiMacQueueItem
(
Ptr<const Packet>
p,
const
WifiMacHeader
& header);
48
49
virtual
~WifiMacQueueItem
();
50
55
Ptr<const Packet>
GetPacket
(
void
)
const
;
56
61
const
WifiMacHeader
&
GetHeader
(
void
)
const
;
62
68
Mac48Address
GetAddress
(
enum
WifiMacHeader::AddressType
type)
const
;
69
74
Time
GetTimeStamp
(
void
)
const
;
75
81
uint32_t
GetSize
(
void
)
const
;
82
83
private
:
89
WifiMacQueueItem
();
95
WifiMacQueueItem
(
const
WifiMacQueueItem
&);
102
WifiMacQueueItem
&
operator =
(
const
WifiMacQueueItem
&);
103
104
Ptr<const Packet>
m_packet
;
105
WifiMacHeader
m_header
;
106
Time
m_tstamp
;
107
};
108
109
110
// The following explicit template instantiation declaration prevents modules
111
// including this header file from implicitly instantiating Queue<WifiMacQueueItem>.
112
// This would cause python examples using wifi to crash at runtime with the
113
// following error message: "Trying to allocate twice the same uid:
114
// ns3::Queue<WifiMacQueueItem>"
115
extern
template
class
Queue<WifiMacQueueItem>
;
116
117
133
class
WifiMacQueue
:
public
Queue<WifiMacQueueItem>
134
{
135
public
:
140
static
TypeId
GetTypeId (
void
);
141
WifiMacQueue
();
142
~
WifiMacQueue
();
143
145
enum
DropPolicy
146
{
147
DROP_NEWEST
,
148
DROP_OLDEST
149
};
150
156
void
SetMaxDelay (
Time
delay);
162
Time
GetMaxDelay (
void
)
const
;
163
170
bool
Enqueue (
Ptr<WifiMacQueueItem>
item);
177
bool
PushFront (
Ptr<WifiMacQueueItem>
item);
183
Ptr<WifiMacQueueItem>
Dequeue (
void
);
197
Ptr<WifiMacQueueItem>
DequeueByTidAndAddress (uint8_t tid,
198
WifiMacHeader::AddressType
type,
199
Mac48Address
addr);
211
Ptr<WifiMacQueueItem>
DequeueFirstAvailable (
const
Ptr<QosBlockedDestinations>
blockedPackets);
217
Ptr<const WifiMacQueueItem>
Peek (
void
)
const
;
231
Ptr<const WifiMacQueueItem>
PeekByTidAndAddress (uint8_t tid,
232
WifiMacHeader::AddressType
type,
233
Mac48Address
addr);
241
Ptr<const WifiMacQueueItem>
PeekFirstAvailable (
const
Ptr<QosBlockedDestinations>
blockedPackets);
247
Ptr<WifiMacQueueItem>
Remove (
void
);
257
bool
Remove (
Ptr<const Packet>
packet);
268
uint32_t GetNPacketsByTidAndAddress (uint8_t tid,
269
WifiMacHeader::AddressType
type,
270
Mac48Address
addr);
271
277
bool
IsEmpty (
void
);
278
284
uint32_t GetNPackets (
void
);
285
291
uint32_t GetNBytes (
void
);
292
293
private
:
302
bool
TtlExceeded (ConstIterator &it);
303
304
Time
m_maxDelay
;
305
DropPolicy
m_dropPolicy
;
306
307
NS_LOG_TEMPLATE_DECLARE
;
308
};
309
310
}
//namespace ns3
311
312
#endif
/* WIFI_MAC_QUEUE_H */
ns3::WifiMacQueue::m_maxDelay
Time m_maxDelay
Time to live for packets in the queue.
Definition:
wifi-mac-queue.h:304
ns3::WifiMacQueueItem::GetPacket
Ptr< const Packet > GetPacket(void) const
Get the packet stored in this item.
Definition:
wifi-mac-queue.cc:47
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:102
ns3::Ptr< const Packet >
ns3::WifiMacQueueItem::GetAddress
Mac48Address GetAddress(enum WifiMacHeader::AddressType type) const
Return the requested address present in the header.
Definition:
wifi-mac-queue.cc:59
ns3::Queue< WifiMacQueueItem >
Introspection did not find any typical Config paths.
ns3::WifiMacQueueItem::GetTimeStamp
Time GetTimeStamp(void) const
Get the timestamp included in this item.
Definition:
wifi-mac-queue.cc:77
ns3::WifiMacQueue::DROP_NEWEST
Definition:
wifi-mac-queue.h:147
ns3::WifiMacQueueItem::m_packet
Ptr< const Packet > m_packet
The packet contained in this queue item.
Definition:
wifi-mac-queue.h:104
ns3::WifiMacQueueItem
WifiMacQueueItem stores (const) packets along with their Wifi MAC headers and the time when they were...
Definition:
wifi-mac-queue.h:39
ns3::WifiMacQueueItem::m_tstamp
Time m_tstamp
timestamp when the packet arrived at the queue
Definition:
wifi-mac-queue.h:106
ns3::WifiMacHeader::AddressType
AddressType
Address types.
Definition:
wifi-mac-header.h:97
ns3::WifiMacQueueItem::WifiMacQueueItem
WifiMacQueueItem()
Default constructor.
wifi-mac-header.h
ns3::WifiMacQueueItem::m_header
WifiMacHeader m_header
Wifi MAC header associated with the packet.
Definition:
wifi-mac-queue.h:105
ns3::WifiMacQueue::m_dropPolicy
DropPolicy m_dropPolicy
Drop behavior of queue.
Definition:
wifi-mac-queue.h:305
ns3::WifiMacQueueItem::~WifiMacQueueItem
virtual ~WifiMacQueueItem()
Definition:
wifi-mac-queue.cc:42
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiMacQueueItem::GetHeader
const WifiMacHeader & GetHeader(void) const
Get the header stored in this item.
Definition:
wifi-mac-queue.cc:53
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
ns3::WifiMacQueue
This queue implements the timeout procedure described in (Section 9.19.2.6 "Retransmit procedures" pa...
Definition:
wifi-mac-queue.h:133
ns3::WifiMacQueueItem::operator=
WifiMacQueueItem & operator=(const WifiMacQueueItem &)
Assignment operator.
ns3::WifiMacQueue::NS_LOG_TEMPLATE_DECLARE
NS_LOG_TEMPLATE_DECLARE
redefinition of the log component
Definition:
wifi-mac-queue.h:307
ns3::WifiMacQueueItem::GetSize
uint32_t GetSize(void) const
Return the size of the packet included in this item.
Definition:
wifi-mac-queue.cc:83
ns3::SimpleRefCount
A template-based reference counting class.
Definition:
simple-ref-count.h:72
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition:
wifi-mac-header.h:80
ns3::WifiMacQueue::DropPolicy
DropPolicy
drop policy
Definition:
wifi-mac-queue.h:145
src
wifi
model
wifi-mac-queue.h
Generated on Wed Oct 11 2017 16:39:36 for ns-3 by
1.8.9.1