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