A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
wifi-protection-manager.cc
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
#include "
wifi-protection-manager.h
"
21
22
#include "
wifi-mac.h
"
23
24
#include "ns3/log.h"
25
26
namespace
ns3
27
{
28
29
NS_LOG_COMPONENT_DEFINE
(
"WifiProtectionManager"
);
30
31
NS_OBJECT_ENSURE_REGISTERED
(WifiProtectionManager);
32
33
TypeId
34
WifiProtectionManager::GetTypeId
()
35
{
36
static
TypeId
tid =
37
TypeId
(
"ns3::WifiProtectionManager"
).
SetParent
<
Object
>().SetGroupName(
"Wifi"
);
38
return
tid;
39
}
40
41
WifiProtectionManager::WifiProtectionManager
()
42
: m_linkId(0)
43
{
44
NS_LOG_FUNCTION
(
this
);
45
}
46
47
WifiProtectionManager::~WifiProtectionManager
()
48
{
49
NS_LOG_FUNCTION_NOARGS
();
50
}
51
52
void
53
WifiProtectionManager::DoDispose
()
54
{
55
NS_LOG_FUNCTION
(
this
);
56
m_mac
=
nullptr
;
57
Object::DoDispose
();
58
}
59
60
void
61
WifiProtectionManager::SetWifiMac
(
Ptr<WifiMac>
mac
)
62
{
63
NS_LOG_FUNCTION
(
this
<<
mac
);
64
m_mac
=
mac
;
65
}
66
67
Ptr<WifiRemoteStationManager>
68
WifiProtectionManager::GetWifiRemoteStationManager
()
const
69
{
70
return
m_mac
->GetWifiRemoteStationManager(
m_linkId
);
71
}
72
73
void
74
WifiProtectionManager::SetLinkId
(uint8_t linkId)
75
{
76
NS_LOG_FUNCTION
(
this
<< +linkId);
77
m_linkId
= linkId;
78
}
79
80
}
// namespace ns3
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Object::DoDispose
virtual void DoDispose()
Destructor implementation.
Definition:
object.cc:353
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:78
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:60
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:935
ns3::WifiProtectionManager::DoDispose
void DoDispose() override
Destructor implementation.
Definition:
wifi-protection-manager.cc:53
ns3::WifiProtectionManager::WifiProtectionManager
WifiProtectionManager()
Definition:
wifi-protection-manager.cc:41
ns3::WifiProtectionManager::~WifiProtectionManager
~WifiProtectionManager() override
Definition:
wifi-protection-manager.cc:47
ns3::WifiProtectionManager::m_mac
Ptr< WifiMac > m_mac
MAC which is using this Protection Manager.
Definition:
wifi-protection-manager.h:101
ns3::WifiProtectionManager::GetWifiRemoteStationManager
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
Definition:
wifi-protection-manager.cc:68
ns3::WifiProtectionManager::m_linkId
uint8_t m_linkId
ID of the link this Protection Manager is operating on.
Definition:
wifi-protection-manager.h:102
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:74
ns3::WifiProtectionManager::SetWifiMac
void SetWifiMac(Ptr< WifiMac > mac)
Set the MAC which is using this Protection Manager.
Definition:
wifi-protection-manager.cc:61
ns3::WifiProtectionManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
wifi-protection-manager.cc:34
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition:
log.h:202
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition:
log-macros-enabled.h:204
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition:
log-macros-enabled.h:238
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition:
object-base.h:45
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
third.mac
mac
Definition:
third.py:85
wifi-mac.h
wifi-protection-manager.h
src
wifi
model
wifi-protection-manager.cc
Generated on Tue Nov 1 2022 23:00:49 for ns-3 by
1.9.3