A Discrete-Event Network Simulator
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 #include <memory>
28 
29 
30 namespace ns3 {
31 
40 {
45  enum Method
46  {
47  NONE = 0,
50  };
51 
57  virtual ~WifiProtection ();
58 
63  virtual std::unique_ptr<WifiProtection> Copy (void) const = 0;
64 
69  virtual void Print (std::ostream &os) const = 0;
70 
71  const Method method;
73 };
74 
75 
82 {
84 
85  std::unique_ptr<WifiProtection> Copy (void) const override;
86  void Print (std::ostream &os) const override;
87 };
88 
89 
96 {
98 
99  std::unique_ptr<WifiProtection> Copy (void) const override;
100  void Print (std::ostream &os) const override;
101 
104 };
105 
106 
113 {
115 
116  std::unique_ptr<WifiProtection> Copy (void) const override;
117  void Print (std::ostream &os) const override;
118 
120 };
121 
122 
130 std::ostream& operator<< (std::ostream& os, const WifiProtection* protection);
131 
132 } //namespace ns3
133 
134 #endif /* WIFI_PROTECTION_H */
ns3::WifiCtsToSelfProtection::WifiCtsToSelfProtection
WifiCtsToSelfProtection()
Definition: wifi-protection.cc:90
ns3::WifiNoProtection
WifiNoProtection specifies that no protection method is used.
Definition: wifi-protection.h:82
ns3::WifiRtsCtsProtection
WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
Definition: wifi-protection.h:96
ns3::WifiProtection::method
const Method method
protection method
Definition: wifi-protection.h:71
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiProtection::CTS_TO_SELF
@ CTS_TO_SELF
Definition: wifi-protection.h:49
ns3::WifiProtection::Print
virtual void Print(std::ostream &os) const =0
Print the object contents.
ns3::WifiProtection::Method
Method
Available protection methods.
Definition: wifi-protection.h:46
ns3::WifiRtsCtsProtection::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition: wifi-protection.h:103
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:71
ns3::WifiCtsToSelfProtection::ctsTxVector
WifiTxVector ctsTxVector
CTS TXVECTOR.
Definition: wifi-protection.h:119
ctrl-headers.h
ns3::WifiRtsCtsProtection::Copy
std::unique_ptr< WifiProtection > Copy(void) const override
Clone this object.
Definition: wifi-protection.cc:74
ns3::WifiProtection::NONE
@ NONE
Definition: wifi-protection.h:47
ns3::WifiProtection::protectionTime
Time protectionTime
time required by the protection method
Definition: wifi-protection.h:72
ns3::WifiProtection::WifiProtection
WifiProtection(Method m)
Constructor.
Definition: wifi-protection.cc:30
wifi-tx-vector.h
ns3::WifiRtsCtsProtection::rtsTxVector
WifiTxVector rtsTxVector
RTS TXVECTOR.
Definition: wifi-protection.h:102
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::WifiRtsCtsProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition: wifi-protection.cc:80
ns3::WifiProtection
WifiProtection is an abstract base struct.
Definition: wifi-protection.h:40
ns3::WifiProtection::~WifiProtection
virtual ~WifiProtection()
Definition: wifi-protection.cc:36
ns3::WifiNoProtection::WifiNoProtection
WifiNoProtection()
Definition: wifi-protection.cc:45
ns3::WifiRtsCtsProtection::WifiRtsCtsProtection
WifiRtsCtsProtection()
Definition: wifi-protection.cc:68
ns3::WifiProtection::Copy
virtual std::unique_ptr< WifiProtection > Copy(void) const =0
Clone this object.
ns3::WifiCtsToSelfProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition: wifi-protection.cc:102
ns3::WifiCtsToSelfProtection::Copy
std::unique_ptr< WifiProtection > Copy(void) const override
Clone this object.
Definition: wifi-protection.cc:96
ns3::WifiNoProtection::Copy
std::unique_ptr< WifiProtection > Copy(void) const override
Clone this object.
Definition: wifi-protection.cc:52
ns3::WifiNoProtection::Print
void Print(std::ostream &os) const override
Print the object contents.
Definition: wifi-protection.cc:58
ns3::WifiProtection::RTS_CTS
@ RTS_CTS
Definition: wifi-protection.h:48
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::WifiCtsToSelfProtection
WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
Definition: wifi-protection.h:113