A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
wifi
model
infrastructure-wifi-mac.cc
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2017
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: Sébastien Deronne <sebastien.deronne@gmail.com>
19
*/
20
21
#include "
infrastructure-wifi-mac.h
"
22
#include "ns3/log.h"
23
24
namespace
ns3
{
25
26
NS_LOG_COMPONENT_DEFINE
(
"InfrastructureWifiMac"
);
27
28
NS_OBJECT_ENSURE_REGISTERED
(InfrastructureWifiMac);
29
30
31
TypeId
32
InfrastructureWifiMac::GetTypeId
(
void
)
33
{
34
static
TypeId
tid =
TypeId
(
"ns3::InfrastructureWifiMac"
)
35
.
SetParent
<
RegularWifiMac
> ()
36
.SetGroupName (
"Wifi"
)
37
.AddAttribute (
"PcfSupported"
,
38
"This Boolean attribute is set to enable PCF support at this STA"
,
39
BooleanValue
(
false
),
40
MakeBooleanAccessor
(&
InfrastructureWifiMac::SetPcfSupported
,
41
&
InfrastructureWifiMac::GetPcfSupported
),
42
MakeBooleanChecker
())
43
;
44
return
tid;
45
}
46
47
InfrastructureWifiMac::InfrastructureWifiMac
()
48
: m_pcfSupported (0)
49
{
50
NS_LOG_FUNCTION
(
this
);
51
}
52
53
InfrastructureWifiMac::~InfrastructureWifiMac
()
54
{
55
NS_LOG_FUNCTION
(
this
);
56
}
57
58
void
59
InfrastructureWifiMac::SetQosSupported
(
bool
enable)
60
{
61
NS_ASSERT_MSG
(!(
GetPcfSupported
() && enable),
"QoS cannot be enabled when PCF support is activated (not supported)"
);
62
RegularWifiMac::SetQosSupported
(enable);
63
}
64
65
void
66
InfrastructureWifiMac::SetPcfSupported
(
bool
enable)
67
{
68
NS_LOG_FUNCTION
(
this
<< enable);
69
NS_ASSERT_MSG
(!(
GetQosSupported
() && enable),
"PCF cannot be enabled when QoS support is activated (not supported)"
);
70
m_pcfSupported
= enable;
71
if
(
m_stationManager
!= 0)
72
{
73
m_stationManager
->
SetPcfSupported
(enable);
74
}
75
}
76
77
bool
78
InfrastructureWifiMac::GetPcfSupported
()
const
79
{
80
return
m_pcfSupported
;
81
}
82
83
}
//namespace ns3
ns3::RegularWifiMac::SetQosSupported
virtual void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Definition:
regular-wifi-mac.cc:568
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Definition:
log-macros-enabled.h:213
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:36
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
NS_ASSERT_MSG
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
ns3::RegularWifiMac::GetQosSupported
bool GetQosSupported() const
Return whether the device supports QoS.
Definition:
regular-wifi-mac.cc:575
ns3::MakeBooleanAccessor
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition:
boolean.h:84
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
ns3::InfrastructureWifiMac::SetQosSupported
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Definition:
infrastructure-wifi-mac.cc:59
ns3::InfrastructureWifiMac::GetPcfSupported
bool GetPcfSupported() const
Return whether the device supports PCF.
Definition:
infrastructure-wifi-mac.cc:78
ns3::WifiRemoteStationManager::SetPcfSupported
virtual void SetPcfSupported(bool enable)
Enable or disable PCF capability support.
Definition:
wifi-remote-station-manager.cc:566
infrastructure-wifi-mac.h
ns3::RegularWifiMac
base class for all MAC-level wifi objects.
Definition:
regular-wifi-mac.h:44
ns3::InfrastructureWifiMac::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition:
infrastructure-wifi-mac.cc:32
ns3::InfrastructureWifiMac::~InfrastructureWifiMac
virtual ~InfrastructureWifiMac()
Definition:
infrastructure-wifi-mac.cc:53
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MakeBooleanChecker
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition:
boolean.cc:121
ns3::InfrastructureWifiMac::m_pcfSupported
bool m_pcfSupported
This Boolean is set true iff this WifiMac support PCF.
Definition:
infrastructure-wifi-mac.h:79
ns3::InfrastructureWifiMac::SetPcfSupported
void SetPcfSupported(bool enable)
Enable or disable PCF support for the device.
Definition:
infrastructure-wifi-mac.cc:66
ns3::InfrastructureWifiMac::InfrastructureWifiMac
InfrastructureWifiMac()
Definition:
infrastructure-wifi-mac.cc:47
ns3::RegularWifiMac::m_stationManager
Ptr< WifiRemoteStationManager > m_stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
Definition:
regular-wifi-mac.h:295
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:58
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:915
Generated on Wed Nov 7 2018 10:02:13 for ns-3 by
1.8.14