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-manager.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_MANAGER_H
21
#define WIFI_PROTECTION_MANAGER_H
22
23
#include "
wifi-protection.h
"
24
25
#include "ns3/object.h"
26
27
#include <memory>
28
29
namespace
ns3
30
{
31
32
class
WifiTxParameters;
33
class
WifiMpdu;
34
class
WifiMac;
35
class
WifiRemoteStationManager;
36
37
/**
38
* \ingroup wifi
39
*
40
* WifiProtectionManager is an abstract base class. Each subclass defines a logic
41
* to select the protection method for a given frame.
42
*/
43
class
WifiProtectionManager
:
public
Object
44
{
45
public
:
46
/**
47
* \brief Get the type ID.
48
* \return the object TypeId
49
*/
50
static
TypeId
GetTypeId
();
51
WifiProtectionManager
();
52
~WifiProtectionManager
()
override
;
53
54
/**
55
* Set the MAC which is using this Protection Manager
56
*
57
* \param mac a pointer to the MAC
58
*/
59
void
SetWifiMac
(
Ptr<WifiMac>
mac);
60
/**
61
* Set the ID of the link this Protection Manager is associated with.
62
*
63
* \param linkId the ID of the link this Protection Manager is associated with
64
*/
65
void
SetLinkId
(uint8_t linkId);
66
67
/**
68
* Determine the protection method to use if the given MPDU is added to the current
69
* frame. Return a null pointer if the protection method is unchanged or the new
70
* protection method otherwise.
71
*
72
* \param mpdu the MPDU to be added to the current frame
73
* \param txParams the current TX parameters for the current frame
74
* \return a null pointer if the protection method is unchanged or the new
75
* protection method otherwise
76
*/
77
virtual
std::unique_ptr<WifiProtection>
TryAddMpdu
(
Ptr<const WifiMpdu>
mpdu,
78
const
WifiTxParameters
& txParams) = 0;
79
80
/**
81
* Determine the protection method to use if the given MSDU is aggregated to the
82
* current frame. Return a null pointer if the protection method is unchanged or
83
* the new protection method otherwise.
84
*
85
* \param msdu the MSDU to be aggregated to the current frame
86
* \param txParams the current TX parameters for the current frame
87
* \return a null pointer if the protection method is unchanged or the new
88
* protection method otherwise
89
*/
90
virtual
std::unique_ptr<WifiProtection>
TryAggregateMsdu
(
Ptr<const WifiMpdu>
msdu,
91
const
WifiTxParameters
& txParams) = 0;
92
93
protected
:
94
void
DoDispose
()
override
;
95
96
/**
97
* \return the remote station manager operating on our link
98
*/
99
Ptr<WifiRemoteStationManager>
GetWifiRemoteStationManager
()
const
;
100
101
/**
102
* Add a User Info field to the given MU-RTS Trigger Frame to solicit a CTS from
103
* the station with the given MAC address. The MU-RTS is intended to protect a data
104
* frame having the given TX width. The TX width of the solicited CTS is the minimum
105
* between the TX width of the protected data frame and the maximum width supported
106
* by the solicited station.
107
*
108
* \param muRts the MU-RTS Trigger Frame
109
* \param txWidth the TX width of the protected data frame
110
* \param receiver the MAC address of the solicited station
111
*/
112
void
AddUserInfoToMuRts
(
CtrlTriggerHeader
& muRts,
113
uint16_t txWidth,
114
const
Mac48Address
& receiver)
const
;
115
116
Ptr<WifiMac>
m_mac
;
//!< MAC which is using this Protection Manager
117
uint8_t
m_linkId
;
//!< ID of the link this Protection Manager is operating on
118
};
119
120
}
// namespace ns3
121
122
#endif
/* WIFI_PROTECTION_MANAGER_H */
ns3::CtrlTriggerHeader
Headers for Trigger frames.
Definition:
ctrl-headers.h:942
ns3::Mac48Address
an EUI-48 address
Definition:
mac48-address.h:46
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::WifiProtectionManager
WifiProtectionManager is an abstract base class.
Definition:
wifi-protection-manager.h:44
ns3::WifiProtectionManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
wifi-protection-manager.cc:54
ns3::WifiProtectionManager::WifiProtectionManager
WifiProtectionManager()
Definition:
wifi-protection-manager.cc:42
ns3::WifiProtectionManager::TryAggregateMsdu
virtual std::unique_ptr< WifiProtection > TryAggregateMsdu(Ptr< const WifiMpdu > msdu, const WifiTxParameters &txParams)=0
Determine the protection method to use if the given MSDU is aggregated to the current frame.
ns3::WifiProtectionManager::~WifiProtectionManager
~WifiProtectionManager() override
Definition:
wifi-protection-manager.cc:48
ns3::WifiProtectionManager::m_mac
Ptr< WifiMac > m_mac
MAC which is using this Protection Manager.
Definition:
wifi-protection-manager.h:116
ns3::WifiProtectionManager::AddUserInfoToMuRts
void AddUserInfoToMuRts(CtrlTriggerHeader &muRts, uint16_t txWidth, const Mac48Address &receiver) const
Add a User Info field to the given MU-RTS Trigger Frame to solicit a CTS from the station with the gi...
Definition:
wifi-protection-manager.cc:82
ns3::WifiProtectionManager::GetWifiRemoteStationManager
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
Definition:
wifi-protection-manager.cc:69
ns3::WifiProtectionManager::m_linkId
uint8_t m_linkId
ID of the link this Protection Manager is operating on.
Definition:
wifi-protection-manager.h:117
ns3::WifiProtectionManager::TryAddMpdu
virtual std::unique_ptr< WifiProtection > TryAddMpdu(Ptr< const WifiMpdu > mpdu, const WifiTxParameters &txParams)=0
Determine the protection method to use if the given MPDU is added to the current frame.
ns3::WifiProtectionManager::SetLinkId
void SetLinkId(uint8_t linkId)
Set the ID of the link this Protection Manager is associated with.
Definition:
wifi-protection-manager.cc:75
ns3::WifiProtectionManager::SetWifiMac
void SetWifiMac(Ptr< WifiMac > mac)
Set the MAC which is using this Protection Manager.
Definition:
wifi-protection-manager.cc:62
ns3::WifiProtectionManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
wifi-protection-manager.cc:35
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition:
wifi-tx-parameters.h:48
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
wifi-protection.h
src
wifi
model
wifi-protection-manager.h
Generated on Tue May 28 2024 23:40:42 for ns-3 by
1.9.6