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