A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
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
{
34
}
35
36
WifiProtection::~WifiProtection
()
37
{
38
}
39
40
/*
41
* WifiNoProtection
42
*/
43
44
WifiNoProtection::WifiNoProtection
()
45
:
WifiProtection
(NONE)
46
{
47
protectionTime
=
Seconds
(0);
48
}
49
50
std::unique_ptr<WifiProtection>
51
WifiNoProtection::Copy
()
const
52
{
53
return
std::make_unique<WifiNoProtection>(*
this
);
54
}
55
56
void
57
WifiNoProtection::Print
(std::ostream& os)
const
58
{
59
os <<
"NONE"
;
60
}
61
62
/*
63
* WifiRtsCtsProtection
64
*/
65
66
WifiRtsCtsProtection::WifiRtsCtsProtection
()
67
:
WifiProtection
(RTS_CTS)
68
{
69
}
70
71
std::unique_ptr<WifiProtection>
72
WifiRtsCtsProtection::Copy
()
const
73
{
74
return
std::make_unique<WifiRtsCtsProtection>(*
this
);
75
}
76
77
void
78
WifiRtsCtsProtection::Print
(std::ostream& os)
const
79
{
80
os <<
"RTS_CTS"
;
81
}
82
83
/*
84
* WifiCtsToSelfProtection
85
*/
86
87
WifiCtsToSelfProtection::WifiCtsToSelfProtection
()
88
:
WifiProtection
(CTS_TO_SELF)
89
{
90
}
91
92
std::unique_ptr<WifiProtection>
93
WifiCtsToSelfProtection::Copy
()
const
94
{
95
return
std::make_unique<WifiCtsToSelfProtection>(*
this
);
96
}
97
98
void
99
WifiCtsToSelfProtection::Print
(std::ostream& os)
const
100
{
101
os <<
"CTS_TO_SELF"
;
102
}
103
104
/*
105
* WifiMuRtsCtsProtection
106
*/
107
108
WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
()
109
:
WifiProtection
(MU_RTS_CTS)
110
{
111
}
112
113
std::unique_ptr<WifiProtection>
114
WifiMuRtsCtsProtection::Copy
()
const
115
{
116
return
std::make_unique<WifiMuRtsCtsProtection>(*
this
);
117
}
118
119
void
120
WifiMuRtsCtsProtection::Print
(std::ostream& os)
const
121
{
122
os <<
"MU_RTS_CTS"
;
123
}
124
125
std::ostream&
126
operator<<
(std::ostream& os,
const
WifiProtection
* protection)
127
{
128
protection->
Print
(os);
129
return
os;
130
}
131
132
}
// namespace ns3
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1319
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:159
ns3::WifiCtsToSelfProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:93
ns3::WifiCtsToSelfProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:99
ns3::WifiCtsToSelfProtection::WifiCtsToSelfProtection
WifiCtsToSelfProtection()
Definition:
wifi-protection.cc:87
ns3::WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
WifiMuRtsCtsProtection()
Definition:
wifi-protection.cc:108
ns3::WifiMuRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:114
ns3::WifiMuRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:120
ns3::WifiNoProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:57
ns3::WifiNoProtection::WifiNoProtection
WifiNoProtection()
Definition:
wifi-protection.cc:44
ns3::WifiNoProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:51
ns3::WifiProtection
WifiProtection is an abstract base struct.
Definition:
wifi-protection.h:42
ns3::WifiProtection::~WifiProtection
virtual ~WifiProtection()
Definition:
wifi-protection.cc:36
ns3::WifiProtection::protectionTime
std::optional< Time > protectionTime
time required by the protection method
Definition:
wifi-protection.h:75
ns3::WifiProtection::Method
Method
Available protection methods.
Definition:
wifi-protection.h:48
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:78
ns3::WifiRtsCtsProtection::WifiRtsCtsProtection
WifiRtsCtsProtection()
Definition:
wifi-protection.cc:66
ns3::WifiRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:72
wifi-protection.h
wifi-utils.h
src
wifi
model
wifi-protection.cc
Generated on Tue May 28 2024 23:40:42 for ns-3 by
1.9.6