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.h
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
#ifndef WIFI_PROTECTION_H
21
#define WIFI_PROTECTION_H
22
23
#include "
ctrl-headers.h
"
24
#include "
wifi-tx-vector.h
"
25
26
#include "ns3/nstime.h"
27
28
#include <memory>
29
#include <optional>
30
31
namespace
ns3
32
{
33
34
/**
35
* \ingroup wifi
36
*
37
* WifiProtection is an abstract base struct. Each derived struct defines a protection
38
* method and stores the information needed to perform protection according to
39
* that method.
40
*/
41
struct
WifiProtection
42
{
43
/**
44
* \enum Method
45
* \brief Available protection methods
46
*/
47
enum
Method
48
{
49
NONE
= 0,
50
RTS_CTS
,
51
CTS_TO_SELF
,
52
MU_RTS_CTS
53
};
54
55
/**
56
* Constructor.
57
* \param m the protection method for this object
58
*/
59
WifiProtection
(
Method
m);
60
virtual
~WifiProtection
();
61
62
/**
63
* Clone this object.
64
* \return a pointer to the cloned object
65
*/
66
virtual
std::unique_ptr<WifiProtection>
Copy
()
const
= 0;
67
68
/**
69
* \brief Print the object contents.
70
* \param os output stream in which the data should be printed.
71
*/
72
virtual
void
Print
(std::ostream& os)
const
= 0;
73
74
const
Method
method
;
//!< protection method
75
std::optional<Time>
protectionTime
;
//!< time required by the protection method
76
};
77
78
/**
79
* \ingroup wifi
80
*
81
* WifiNoProtection specifies that no protection method is used.
82
*/
83
struct
WifiNoProtection
:
public
WifiProtection
84
{
85
WifiNoProtection
();
86
87
std::unique_ptr<WifiProtection>
Copy
()
const override
;
88
void
Print
(std::ostream& os)
const override
;
89
};
90
91
/**
92
* \ingroup wifi
93
*
94
* WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
95
*/
96
struct
WifiRtsCtsProtection
:
public
WifiProtection
97
{
98
WifiRtsCtsProtection
();
99
100
std::unique_ptr<WifiProtection>
Copy
()
const override
;
101
void
Print
(std::ostream& os)
const override
;
102
103
WifiTxVector
rtsTxVector
;
//!< RTS TXVECTOR
104
WifiTxVector
ctsTxVector
;
//!< CTS TXVECTOR
105
};
106
107
/**
108
* \ingroup wifi
109
*
110
* WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
111
*/
112
struct
WifiCtsToSelfProtection
:
public
WifiProtection
113
{
114
WifiCtsToSelfProtection
();
115
116
std::unique_ptr<WifiProtection>
Copy
()
const override
;
117
void
Print
(std::ostream& os)
const override
;
118
119
WifiTxVector
ctsTxVector
;
//!< CTS TXVECTOR
120
};
121
122
/**
123
* \ingroup wifi
124
*
125
* WifiMuRtsCtsProtection specifies that MU-RTS/CTS protection method is used.
126
*/
127
struct
WifiMuRtsCtsProtection
:
public
WifiProtection
128
{
129
WifiMuRtsCtsProtection
();
130
131
// Overridden from WifiProtection
132
std::unique_ptr<WifiProtection>
Copy
()
const override
;
133
void
Print
(std::ostream& os)
const override
;
134
135
CtrlTriggerHeader
muRts
;
//!< MU-RTS
136
WifiTxVector
muRtsTxVector
;
//!< MU-RTS TXVECTOR
137
};
138
139
/**
140
* \brief Stream insertion operator.
141
*
142
* \param os the output stream
143
* \param protection the protection method
144
* \returns a reference to the stream
145
*/
146
std::ostream&
operator<<
(std::ostream& os,
const
WifiProtection
* protection);
147
148
}
// namespace ns3
149
150
#endif
/* WIFI_PROTECTION_H */
ns3::CtrlTriggerHeader
Headers for Trigger frames.
Definition:
ctrl-headers.h:942
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition:
wifi-tx-vector.h:111
ctrl-headers.h
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
WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
Definition:
wifi-protection.h:113
ns3::WifiCtsToSelfProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:93
ns3::WifiCtsToSelfProtection::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition:
wifi-protection.h:119
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 specifies that MU-RTS/CTS protection method is used.
Definition:
wifi-protection.h:128
ns3::WifiMuRtsCtsProtection::muRts
CtrlTriggerHeader muRts
MU-RTS.
Definition:
wifi-protection.h:135
ns3::WifiMuRtsCtsProtection::muRtsTxVector
WifiTxVector muRtsTxVector
MU-RTS TXVECTOR.
Definition:
wifi-protection.h:136
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
WifiNoProtection specifies that no protection method is used.
Definition:
wifi-protection.h:84
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::Copy
virtual std::unique_ptr< WifiProtection > Copy() const =0
Clone this object.
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::NONE
@ NONE
Definition:
wifi-protection.h:49
ns3::WifiProtection::CTS_TO_SELF
@ CTS_TO_SELF
Definition:
wifi-protection.h:51
ns3::WifiProtection::RTS_CTS
@ RTS_CTS
Definition:
wifi-protection.h:50
ns3::WifiProtection::MU_RTS_CTS
@ MU_RTS_CTS
Definition:
wifi-protection.h:52
ns3::WifiProtection::Print
virtual void Print(std::ostream &os) const =0
Print the object contents.
ns3::WifiProtection::method
const Method method
protection method
Definition:
wifi-protection.h:74
ns3::WifiRtsCtsProtection
WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
Definition:
wifi-protection.h:97
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::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition:
wifi-protection.h:104
ns3::WifiRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy() const override
Clone this object.
Definition:
wifi-protection.cc:72
ns3::WifiRtsCtsProtection::rtsTxVector
WifiTxVector rtsTxVector
RTS TXVECTOR.
Definition:
wifi-protection.h:103
wifi-tx-vector.h
src
wifi
model
wifi-protection.h
Generated on Tue May 28 2024 23:40:42 for ns-3 by
1.9.6