A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
wifi-protection.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
4
*
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation;
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*
18
* Author: Stefano Avallone <stavallo@unina.it>
19
*/
20
21
#ifndef WIFI_PROTECTION_H
22
#define WIFI_PROTECTION_H
23
24
#include "ns3/nstime.h"
25
#include "
wifi-tx-vector.h
"
26
#include "
ctrl-headers.h
"
27
28
29
namespace
ns3
{
30
38
struct
WifiProtection
39
{
44
enum
Method
45
{
46
NONE
= 0,
47
RTS_CTS
,
48
CTS_TO_SELF
49
};
50
55
WifiProtection
(
Method
m);
56
virtual
~WifiProtection
();
57
62
virtual
void
Print
(std::ostream &os)
const
= 0;
63
64
const
Method
method
;
65
Time
protectionTime
;
66
};
67
68
74
struct
WifiNoProtection
:
public
WifiProtection
75
{
76
WifiNoProtection
();
77
78
// Overridden from WifiProtection
79
void
Print
(std::ostream &os)
const override
;
80
};
81
82
88
struct
WifiRtsCtsProtection
:
public
WifiProtection
89
{
90
WifiRtsCtsProtection
();
91
92
// Overridden from WifiProtection
93
void
Print
(std::ostream &os)
const override
;
94
95
WifiTxVector
rtsTxVector
;
96
WifiTxVector
ctsTxVector
;
97
};
98
99
105
struct
WifiCtsToSelfProtection
:
public
WifiProtection
106
{
107
WifiCtsToSelfProtection
();
108
109
// Overridden from WifiProtection
110
void
Print
(std::ostream &os)
const override
;
111
112
WifiTxVector
ctsTxVector
;
113
};
114
115
123
std::ostream&
operator<<
(std::ostream& os,
const
WifiProtection
* protection);
124
125
}
//namespace ns3
126
127
#endif
/* WIFI_PROTECTION_H */
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition:
nstime.h:103
ns3::WifiProtection::NONE
Definition:
wifi-protection.h:46
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:70
ns3::WifiCtsToSelfProtection::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition:
wifi-protection.h:112
ns3::WifiProtection::WifiProtection
WifiProtection(Method m)
Constructor.
Definition:
wifi-protection.cc:30
ns3::WifiNoProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:52
ns3::WifiProtection::~WifiProtection
virtual ~WifiProtection()
Definition:
wifi-protection.cc:36
ns3::WifiRtsCtsProtection::WifiRtsCtsProtection
WifiRtsCtsProtection()
Definition:
wifi-protection.cc:62
ns3::WifiRtsCtsProtection::rtsTxVector
WifiTxVector rtsTxVector
RTS TXVECTOR.
Definition:
wifi-protection.h:95
ctrl-headers.h
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition:
angles.cc:137
ns3::WifiRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:68
ns3::WifiProtection::RTS_CTS
Definition:
wifi-protection.h:47
ns3::WifiCtsToSelfProtection::WifiCtsToSelfProtection
WifiCtsToSelfProtection()
Definition:
wifi-protection.cc:78
ns3::WifiProtection::protectionTime
Time protectionTime
time required by the protection method
Definition:
wifi-protection.h:65
ns3::WifiProtection
WifiProtection is an abstract base struct.
Definition:
wifi-protection.h:38
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiRtsCtsProtection
WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
Definition:
wifi-protection.h:88
ns3::WifiProtection::Print
virtual void Print(std::ostream &os) const =0
Print the object contents.
ns3::WifiCtsToSelfProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition:
wifi-protection.cc:84
ns3::WifiRtsCtsProtection::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition:
wifi-protection.h:96
wifi-tx-vector.h
ns3::WifiNoProtection::WifiNoProtection
WifiNoProtection()
Definition:
wifi-protection.cc:45
ns3::WifiCtsToSelfProtection
WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
Definition:
wifi-protection.h:105
ns3::WifiNoProtection
WifiNoProtection specifies that no protection method is used.
Definition:
wifi-protection.h:74
ns3::WifiProtection::method
const Method method
protection method
Definition:
wifi-protection.h:64
ns3::WifiProtection::CTS_TO_SELF
Definition:
wifi-protection.h:48
ns3::WifiProtection::Method
Method
Available protection methods.
Definition:
wifi-protection.h:44
src
wifi
model
wifi-protection.h
Generated on Sun Apr 18 2021 18:21:38 for ns-3 by
1.8.14