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
nqos-wifi-mac-helper.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2009 MIRKO BANCHI
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Mirko Banchi <mk.banchi@gmail.com>
19
*/
20
#include "
nqos-wifi-mac-helper.h
"
21
#include "ns3/wifi-mac.h"
22
#include "ns3/pointer.h"
23
#include "ns3/boolean.h"
24
#include "ns3/dca-txop.h"
25
26
namespace
ns3 {
27
28
NqosWifiMacHelper::NqosWifiMacHelper
()
29
{
30
}
31
32
NqosWifiMacHelper::~NqosWifiMacHelper
()
33
{
34
}
35
36
NqosWifiMacHelper
37
NqosWifiMacHelper::Default
(
void
)
38
{
39
NqosWifiMacHelper
helper;
40
// We're making non QoS-enabled Wi-Fi MACs here, so we set the
41
// necessary attribute. I've carefully positioned this here so that
42
// someone who knows what they're doing can override with explicit
43
// attributes.
44
helper.
SetType
(
"ns3::AdhocWifiMac"
,
45
"QosSupported"
,
BooleanValue
(
false
));
46
return
helper;
47
}
48
49
void
50
NqosWifiMacHelper::SetType
(std::string type,
51
std::string n0,
const
AttributeValue
&v0,
52
std::string n1,
const
AttributeValue
&v1,
53
std::string n2,
const
AttributeValue
&v2,
54
std::string n3,
const
AttributeValue
&v3,
55
std::string n4,
const
AttributeValue
&v4,
56
std::string n5,
const
AttributeValue
&v5,
57
std::string n6,
const
AttributeValue
&v6,
58
std::string n7,
const
AttributeValue
&v7)
59
{
60
m_mac
.
SetTypeId
(type);
61
m_mac
.
Set
(n0, v0);
62
m_mac
.
Set
(n1, v1);
63
m_mac
.
Set
(n2, v2);
64
m_mac
.
Set
(n3, v3);
65
m_mac
.
Set
(n4, v4);
66
m_mac
.
Set
(n5, v5);
67
m_mac
.
Set
(n6, v6);
68
m_mac
.
Set
(n7, v7);
69
}
70
71
Ptr<WifiMac>
72
NqosWifiMacHelper::Create
(
void
)
const
73
{
74
Ptr<WifiMac>
mac =
m_mac
.
Create
<
WifiMac
> ();
75
return
mac;
76
}
77
78
}
// namespace ns3
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::BooleanValue
Hold a bool native type.
Definition:
boolean.h:38
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:56
ns3::NqosWifiMacHelper::SetType
virtual void SetType(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Definition:
nqos-wifi-mac-helper.cc:50
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Definition:
object-factory.cc:41
ns3::NqosWifiMacHelper::NqosWifiMacHelper
NqosWifiMacHelper()
Create a NqosWifiMacHelper to make life easier for people who want to work with non-QOS Wifi MAC laye...
Definition:
nqos-wifi-mac-helper.cc:28
ns3::ObjectFactory::Create
Ptr< Object > Create(void) const
Definition:
object-factory.cc:90
ns3::WifiMac
base class for all MAC-level wifi objects.
Definition:
wifi-mac.h:44
ns3::NqosWifiMacHelper::Default
static NqosWifiMacHelper Default(void)
Create a mac helper in a default working state.
Definition:
nqos-wifi-mac-helper.cc:37
ns3::NqosWifiMacHelper
create non QoS-enabled MAC layers for a ns3::WifiNetDevice.
Definition:
nqos-wifi-mac-helper.h:33
nqos-wifi-mac-helper.h
ns3::NqosWifiMacHelper::~NqosWifiMacHelper
virtual ~NqosWifiMacHelper()
Definition:
nqos-wifi-mac-helper.cc:32
ns3::NqosWifiMacHelper::m_mac
ObjectFactory m_mac
Definition:
nqos-wifi-mac-helper.h:85
ns3::NqosWifiMacHelper::Create
virtual Ptr< WifiMac > Create(void) const
Definition:
nqos-wifi-mac-helper.cc:72
ns3::ObjectFactory::Set
void Set(std::string name, const AttributeValue &value)
Definition:
object-factory.cc:59
src
wifi
helper
nqos-wifi-mac-helper.cc
Generated on Sat Apr 19 2014 14:07:10 for ns-3 by
1.8.6