A Discrete-Event Network Simulator
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
13namespace ns3
14{
15
16/*
17 * WifiProtection
18 */
19
21 : method(m)
22{
23}
24
28
29/*
30 * WifiNoProtection
31 */
32
38
39std::unique_ptr<WifiProtection>
41{
42 return std::make_unique<WifiNoProtection>(*this);
43}
44
45void
46WifiNoProtection::Print(std::ostream& os) const
47{
48 os << "NONE";
49}
50
51/*
52 * WifiRtsCtsProtection
53 */
54
59
60std::unique_ptr<WifiProtection>
62{
63 return std::make_unique<WifiRtsCtsProtection>(*this);
64}
65
66void
67WifiRtsCtsProtection::Print(std::ostream& os) const
68{
69 os << "RTS_CTS";
70}
71
72/*
73 * WifiCtsToSelfProtection
74 */
75
80
81std::unique_ptr<WifiProtection>
83{
84 return std::make_unique<WifiCtsToSelfProtection>(*this);
85}
86
87void
88WifiCtsToSelfProtection::Print(std::ostream& os) const
89{
90 os << "CTS_TO_SELF";
91}
92
93/*
94 * WifiMuRtsCtsProtection
95 */
96
101
102std::unique_ptr<WifiProtection>
104{
105 return std::make_unique<WifiMuRtsCtsProtection>(*this);
106}
107
108void
109WifiMuRtsCtsProtection::Print(std::ostream& os) const
110{
111 os << "MU_RTS_CTS";
112}
113
114std::ostream&
115operator<<(std::ostream& os, const WifiProtection* protection)
116{
117 protection->Print(os);
118 return os;
119}
120
121} // namespace ns3
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition angles.cc:148
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
void Print(std::ostream &os) const override
Print the object contents.
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
void Print(std::ostream &os) const override
Print the object contents.
void Print(std::ostream &os) const override
Print the object contents.
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
WifiProtection is an abstract base struct.
std::optional< Time > protectionTime
time required by the protection method
Method
Available protection methods.
virtual void Print(std::ostream &os) const =0
Print the object contents.
WifiProtection(Method m)
Constructor.
void Print(std::ostream &os) const override
Print the object contents.
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.