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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Stefano Avallone <stavallo@unina.it>
7
*/
8
9
#include "
wifi-protection.h
"
10
11
#include "
wifi-utils.h
"
12
13
namespace
ns3
14
{
15
16
/*
17
* WifiProtection
18
*/
19
20
WifiProtection::WifiProtection
(
Method
m)
21
: method(m)
22
{
23
}
24
25
WifiProtection::~WifiProtection
()
26
{
27
}
28
29
/*
30
* WifiNoProtection
31
*/
32
33
WifiNoProtection::WifiNoProtection
()
34
:
WifiProtection
(NONE)
35
{
36
protectionTime
=
Seconds
(0);
37
}
38
39
std::unique_ptr<WifiProtection>
40
WifiNoProtection::Copy
()
const
41
{
42
return
std::make_unique<WifiNoProtection>(*
this
);
43
}
44
45
void
46
WifiNoProtection::Print
(std::ostream& os)
const
47
{
48
os <<
"NONE"
;
49
}
50
51
/*
52
* WifiRtsCtsProtection
53
*/
54
55
WifiRtsCtsProtection::WifiRtsCtsProtection
()
56
:
WifiProtection
(RTS_CTS)
57
{
58
}
59
60
std::unique_ptr<WifiProtection>
61
WifiRtsCtsProtection::Copy
()
const
62
{
63
return
std::make_unique<WifiRtsCtsProtection>(*
this
);
64
}
65
66
void
67
WifiRtsCtsProtection::Print
(std::ostream& os)
const
68
{
69
os <<
"RTS_CTS"
;
70
}
71
72
/*
73
* WifiCtsToSelfProtection
74
*/
75
76
WifiCtsToSelfProtection::WifiCtsToSelfProtection
()
77
:
WifiProtection
(CTS_TO_SELF)
78
{
79
}
80
81
std::unique_ptr<WifiProtection>
82
WifiCtsToSelfProtection::Copy
()
const
83
{
84
return
std::make_unique<WifiCtsToSelfProtection>(*
this
);
85
}
86
87
void
88
WifiCtsToSelfProtection::Print
(std::ostream& os)
const
89
{
90
os <<
"CTS_TO_SELF"
;
91
}
92
93
/*
94
* WifiMuRtsCtsProtection
95
*/
96
97
WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
()
98
:
WifiProtection
(MU_RTS_CTS)
99
{
100
}
101
102
std::unique_ptr<WifiProtection>
103
WifiMuRtsCtsProtection::Copy
()
const
104
{
105
return
std::make_unique<WifiMuRtsCtsProtection>(*
this
);
106
}
107
108
void
109
WifiMuRtsCtsProtection::Print
(std::ostream& os)
const
110
{
111
os <<
"MU_RTS_CTS"
;
112
}
113
114
std::ostream&
115
operator<<
(std::ostream& os,
const
WifiProtection
* protection)
116
{
117
protection->
Print
(os);
118
return
os;
119
}
120
121
}
// namespace ns3
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition
nstime.h:1308
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:148
ns3::WifiCtsToSelfProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition
wifi-protection.cc:82
ns3::WifiCtsToSelfProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition
wifi-protection.cc:88
ns3::WifiCtsToSelfProtection::WifiCtsToSelfProtection
WifiCtsToSelfProtection()
Definition
wifi-protection.cc:76
ns3::WifiMuRtsCtsProtection::WifiMuRtsCtsProtection
WifiMuRtsCtsProtection()
Definition
wifi-protection.cc:97
ns3::WifiMuRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition
wifi-protection.cc:103
ns3::WifiMuRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition
wifi-protection.cc:109
ns3::WifiNoProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition
wifi-protection.cc:46
ns3::WifiNoProtection::WifiNoProtection
WifiNoProtection()
Definition
wifi-protection.cc:33
ns3::WifiNoProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition
wifi-protection.cc:40
ns3::WifiProtection
WifiProtection is an abstract base struct.
Definition
wifi-protection.h:31
ns3::WifiProtection::~WifiProtection
virtual ~WifiProtection()
Definition
wifi-protection.cc:25
ns3::WifiProtection::protectionTime
std::optional< Time > protectionTime
time required by the protection method
Definition
wifi-protection.h:64
ns3::WifiProtection::Method
Method
Available protection methods.
Definition
wifi-protection.h:37
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:20
ns3::WifiRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition
wifi-protection.cc:67
ns3::WifiRtsCtsProtection::WifiRtsCtsProtection
WifiRtsCtsProtection()
Definition
wifi-protection.cc:55
ns3::WifiRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition
wifi-protection.cc:61
wifi-protection.h
wifi-utils.h
src
wifi
model
wifi-protection.cc
Generated on Fri Nov 8 2024 13:59:08 for ns-3 by
1.11.0