This documentation is not the
Latest Release
.
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
qos-blocked-destinations.cc
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: Mirko Banchi <mk.banchi@gmail.com>
20
*/
21
22
#include "
qos-blocked-destinations.h
"
23
24
namespace
ns3
{
25
26
QosBlockedDestinations::QosBlockedDestinations
()
27
{
28
}
29
30
QosBlockedDestinations::~QosBlockedDestinations
()
31
{
32
}
33
34
bool
35
QosBlockedDestinations::IsBlocked
(
Mac48Address
dest, uint8_t tid)
const
36
{
37
for
(
BlockedPacketsCI
i =
m_blockedQosPackets
.begin (); i !=
m_blockedQosPackets
.end (); i++)
38
{
39
if
(i->first == dest && i->second == tid)
40
{
41
return
true
;
42
}
43
}
44
return
false
;
45
}
46
47
void
48
QosBlockedDestinations::Block
(
Mac48Address
dest, uint8_t tid)
49
{
50
if
(!
IsBlocked
(dest, tid))
51
{
52
m_blockedQosPackets
.push_back (std::make_pair (dest, tid));
53
}
54
}
55
56
void
57
QosBlockedDestinations::Unblock
(
Mac48Address
dest, uint8_t tid)
58
{
59
for
(
BlockedPacketsI
i =
m_blockedQosPackets
.begin (); i !=
m_blockedQosPackets
.end (); i++)
60
{
61
if
(i->first == dest && i->second == tid)
62
{
63
m_blockedQosPackets
.erase (i);
64
break
;
65
}
66
}
67
}
68
69
}
//namespace ns3
ns3::QosBlockedDestinations::BlockedPacketsI
std::list< std::pair< Mac48Address, uint8_t > >::iterator BlockedPacketsI
typedef for an iterator of BlockedPackets
Definition:
qos-blocked-destinations.h:77
qos-blocked-destinations.h
ns3::QosBlockedDestinations::~QosBlockedDestinations
~QosBlockedDestinations()
Definition:
qos-blocked-destinations.cc:30
ns3::QosBlockedDestinations::m_blockedQosPackets
BlockedPackets m_blockedQosPackets
Definition:
qos-blocked-destinations.h:82
ns3::QosBlockedDestinations::QosBlockedDestinations
QosBlockedDestinations()
Definition:
qos-blocked-destinations.cc:26
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::QosBlockedDestinations::BlockedPacketsCI
std::list< std::pair< Mac48Address, uint8_t > >::const_iterator BlockedPacketsCI
typedef for a constan iterator of BlockedPackets
Definition:
qos-blocked-destinations.h:81
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:43
ns3::QosBlockedDestinations::Unblock
void Unblock(Mac48Address dest, uint8_t tid)
Un-block the given destination address and TID (e.g.
Definition:
qos-blocked-destinations.cc:57
ns3::QosBlockedDestinations::Block
void Block(Mac48Address dest, uint8_t tid)
Block the given destination address and TID from sending (e.g.
Definition:
qos-blocked-destinations.cc:48
ns3::QosBlockedDestinations::IsBlocked
bool IsBlocked(Mac48Address dest, uint8_t tid) const
Check if the given destination address and TID are blocked from sending (e.g.
Definition:
qos-blocked-destinations.cc:35
src
wifi
model
qos-blocked-destinations.cc
Generated on Wed Nov 11 2015 20:00:52 for ns-3 by
1.8.9.1