A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
wifi-protection.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Stefano Avallone <stavallo@unina.it>
18
*/
19
20
#include "
wifi-protection.h
"
21
22
#include "
wifi-utils.h
"
23
24
namespace
ns3
25
{
26
27
/*
28
* WifiProtection
29
*/
30
31
WifiProtection::WifiProtection
(
Method
m
)
32
: method(
m
),
33
protectionTime(
Time
::
Min
())
// uninitialized
34
{
35
}
36
37
WifiProtection::~WifiProtection
()
38
{
39
}
40
41
/*
42
* WifiNoProtection
43
*/
44
45
WifiNoProtection::WifiNoProtection
()
46
:
WifiProtection
(
NONE
)
47
{
48
protectionTime
=
Seconds
(0);
49
}
50
51
std::unique_ptr<WifiProtection>
52
WifiNoProtection::Copy
()
const
53
{
54
return
std::make_unique<WifiNoProtection>(*
this
);
55
}
56
57
void
58
WifiNoProtection::Print
(std::ostream& os)
const
59
{
60
os <<
"NONE"
;
61
}
62
63
/*
64
* WifiRtsCtsProtection
65
*/
66
67
WifiRtsCtsProtection::WifiRtsCtsProtection
()
68
:
WifiProtection
(RTS_CTS)
69
{
70
}
71
72
std::unique_ptr<WifiProtection>
73
WifiRtsCtsProtection::Copy
()
const
74
{
75
return
std::make_unique<WifiRtsCtsProtection>(*
this
);
76
}
77
78
void
79
WifiRtsCtsProtection::Print
(std::ostream& os)
const
80
{
81
os <<
"RTS_CTS"
;
82
}
83
84
/*
85
* WifiCtsToSelfProtection
86
*/
87
88
WifiCtsToSelfProtection::WifiCtsToSelfProtection
()
89
:
WifiProtection
(CTS_TO_SELF)
90
{
91
}
92
93
std::unique_ptr<WifiProtection>
94
WifiCtsToSelfProtection::Copy
()
const
95
{
96
return
std::make_unique<WifiCtsToSelfProtection>(*
this
);
97
}
98
99
void
100
WifiCtsToSelfProtection::Print
(std::ostream& os)
const
101
{
102
os <<
"CTS_TO_SELF"
;
103
}
104
105
/*
106
* WifiMuRtsCtsProtection
107
*/
108
109
WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
()
110
:
WifiProtection
(MU_RTS_CTS)
111
{
112
}
113
114
std::unique_ptr<WifiProtection>
115
WifiMuRtsCtsProtection::Copy
()
const
116
{
117
return
std::make_unique<WifiMuRtsCtsProtection>(*
this
);
118
}
119
120
void
121
WifiMuRtsCtsProtection::Print
(std::ostream& os)
const
122
{
123
os <<
"MU_RTS_CTS"
;
124
}
125
126
std::ostream&
127
operator<<
(std::ostream& os,
const
WifiProtection
* protection)
128
{
129
protection->
Print
(os);
130
return
os;
131
}
132
133
}
// namespace ns3
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:105
ns3::Min
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
Definition:
int64x64.h:229
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1326
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MessageParserState::NONE
@ NONE
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
two-ray-to-three-gpp-ch-calibration.m
m
Definition:
two-ray-to-three-gpp-ch-calibration.py:591
ns3::WifiCtsToSelfProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:94
ns3::WifiCtsToSelfProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:100
ns3::WifiCtsToSelfProtection::WifiCtsToSelfProtection
WifiCtsToSelfProtection()
Definition:
wifi-protection.cc:88
ns3::WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
WifiMuRtsCtsProtection()
Definition:
wifi-protection.cc:109
ns3::WifiMuRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:115
ns3::WifiMuRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:121
ns3::WifiNoProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:58
ns3::WifiNoProtection::WifiNoProtection
WifiNoProtection()
Definition:
wifi-protection.cc:45
ns3::WifiNoProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:52
ns3::WifiProtection
WifiProtection is an abstract base struct.
Definition:
wifi-protection.h:41
ns3::WifiProtection::protectionTime
Time protectionTime
time required by the protection method
Definition:
wifi-protection.h:74
ns3::WifiProtection::~WifiProtection
virtual ~WifiProtection()
Definition:
wifi-protection.cc:37
ns3::WifiProtection::Method
Method
Available protection methods.
Definition:
wifi-protection.h:47
ns3::WifiProtection::Print
virtual void Print(std::ostream &os) const =0
Print the object contents.
ns3::WifiProtection::WifiProtection
WifiProtection(Method m)
Constructor.
Definition:
wifi-protection.cc:31
ns3::WifiRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:79
ns3::WifiRtsCtsProtection::WifiRtsCtsProtection
WifiRtsCtsProtection()
Definition:
wifi-protection.cc:67
ns3::WifiRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:73
wifi-protection.h
wifi-utils.h
src
wifi
model
wifi-protection.cc
Generated on Sun Mar 3 2024 17:11:12 for ns-3 by
1.9.1