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
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20
* Author: Mirko Banchi <mk.banchi@gmail.com>
21
*/
22
#ifndef WIFI_MAC_QUEUE_H
23
#define WIFI_MAC_QUEUE_H
24
25
#include <list>
26
#include <utility>
27
#include "ns3/packet.h"
28
#include "ns3/nstime.h"
29
#include "ns3/object.h"
30
#include "
wifi-mac-header.h
"
31
32
namespace
ns3 {
33
34
class
WifiMacParameters;
35
class
QosBlockedDestinations;
36
52
class
WifiMacQueue
:
public
Object
53
{
54
public
:
55
static
TypeId
GetTypeId
(
void
);
56
WifiMacQueue
();
57
~WifiMacQueue
();
58
59
void
SetMaxSize
(uint32_t maxSize);
60
void
SetMaxDelay
(
Time
delay);
61
uint32_t
GetMaxSize
(
void
)
const
;
62
Time
GetMaxDelay
(
void
)
const
;
63
64
void
Enqueue
(
Ptr<const Packet>
packet,
const
WifiMacHeader
&hdr);
65
void
PushFront
(
Ptr<const Packet>
packet,
const
WifiMacHeader
&hdr);
66
Ptr<const Packet>
Dequeue
(
WifiMacHeader
*hdr);
67
Ptr<const Packet>
Peek
(
WifiMacHeader
*hdr);
75
Ptr<const Packet>
DequeueByTidAndAddress
(
WifiMacHeader
*hdr,
76
uint8_t tid,
77
WifiMacHeader::AddressType
type,
78
Mac48Address
addr);
86
Ptr<const Packet>
PeekByTidAndAddress
(
WifiMacHeader
*hdr,
87
uint8_t tid,
88
WifiMacHeader::AddressType
type,
89
Mac48Address
addr);
95
bool
Remove
(
Ptr<const Packet>
packet);
100
uint32_t
GetNPacketsByTidAndAddress
(uint8_t tid,
101
WifiMacHeader::AddressType
type,
102
Mac48Address
addr);
110
Ptr<const Packet>
DequeueFirstAvailable
(
WifiMacHeader
*hdr,
111
Time
&tStamp,
112
const
QosBlockedDestinations
*blockedPackets);
116
Ptr<const Packet>
PeekFirstAvailable
(
WifiMacHeader
*hdr,
117
Time
&tStamp,
118
const
QosBlockedDestinations
*blockedPackets);
119
void
Flush
(
void
);
120
121
bool
IsEmpty
(
void
);
122
uint32_t
GetSize
(
void
);
123
private
:
124
struct
Item
;
125
126
typedef
std::list<struct Item>
PacketQueue
;
127
typedef
std::list<struct Item>::reverse_iterator
PacketQueueRI
;
128
typedef
std::list<struct Item>::iterator
PacketQueueI
;
129
130
void
Cleanup
(
void
);
131
Mac48Address
GetAddressForPacket
(
enum
WifiMacHeader::AddressType
type,
PacketQueueI
);
132
133
struct
Item
134
{
135
Item
(
Ptr<const Packet>
packet,
136
const
WifiMacHeader
&hdr,
137
Time
tstamp
);
138
Ptr<const Packet>
packet
;
139
WifiMacHeader
hdr
;
140
Time
tstamp
;
141
};
142
143
PacketQueue
m_queue
;
144
WifiMacParameters *
m_parameters
;
145
uint32_t
m_size
;
146
uint32_t
m_maxSize
;
147
Time
m_maxDelay
;
148
};
149
150
}
// namespace ns3
151
152
#endif
/* WIFI_MAC_QUEUE_H */
src
wifi
model
wifi-mac-queue.h
Generated on Tue Oct 9 2012 16:45:49 for ns-3 by
1.8.1.2