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
default-emlsr-manager.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 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 "
default-emlsr-manager.h
"
21
22
#include "ns3/log.h"
23
#include "ns3/wifi-mpdu.h"
24
25
namespace
ns3
26
{
27
28
NS_LOG_COMPONENT_DEFINE
(
"DefaultEmlsrManager"
);
29
30
NS_OBJECT_ENSURE_REGISTERED
(DefaultEmlsrManager);
31
32
TypeId
33
DefaultEmlsrManager::GetTypeId
()
34
{
35
static
TypeId
tid =
TypeId
(
"ns3::DefaultEmlsrManager"
)
36
.
SetParent
<
EmlsrManager
>()
37
.SetGroupName(
"Wifi"
)
38
.AddConstructor<
DefaultEmlsrManager
>();
39
return
tid;
40
}
41
42
DefaultEmlsrManager::DefaultEmlsrManager
()
43
{
44
NS_LOG_FUNCTION
(
this
);
45
}
46
47
DefaultEmlsrManager::~DefaultEmlsrManager
()
48
{
49
NS_LOG_FUNCTION_NOARGS
();
50
}
51
52
void
53
DefaultEmlsrManager::DoNotifyMgtFrameReceived
(
Ptr<const WifiMpdu>
mpdu, uint8_t linkId)
54
{
55
NS_LOG_FUNCTION
(
this
<< *mpdu << linkId);
56
57
if
(mpdu->GetHeader().IsAssocResp() &&
GetStaMac
()->IsAssociated() &&
GetTransitionTimeout
())
58
{
59
m_assocLinkId
= linkId;
60
}
61
}
62
63
uint8_t
64
DefaultEmlsrManager::GetLinkToSendEmlNotification
()
65
{
66
NS_LOG_FUNCTION
(
this
);
67
NS_ASSERT_MSG
(
m_assocLinkId
,
"No recorded link on which Assoc Response was received"
);
68
return
*
m_assocLinkId
;
69
}
70
71
std::optional<uint8_t>
72
DefaultEmlsrManager::ResendNotification
(
Ptr<const WifiMpdu>
mpdu)
73
{
74
NS_LOG_FUNCTION
(
this
);
75
NS_ASSERT_MSG
(
m_assocLinkId
,
"No recorded link on which Assoc Response was received"
);
76
return
*
m_assocLinkId
;
77
}
78
79
void
80
DefaultEmlsrManager::NotifyEmlsrModeChanged
()
81
{
82
NS_LOG_FUNCTION
(
this
);
83
}
84
85
}
// namespace ns3
ns3::DefaultEmlsrManager
DefaultEmlsrManager is the default EMLSR manager.
Definition:
default-emlsr-manager.h:36
ns3::DefaultEmlsrManager::DoNotifyMgtFrameReceived
void DoNotifyMgtFrameReceived(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
Notify the subclass of the reception of a management frame addressed to us.
Definition:
default-emlsr-manager.cc:53
ns3::DefaultEmlsrManager::NotifyEmlsrModeChanged
void NotifyEmlsrModeChanged() override
Notify subclass that EMLSR mode changed.
Definition:
default-emlsr-manager.cc:80
ns3::DefaultEmlsrManager::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
default-emlsr-manager.cc:33
ns3::DefaultEmlsrManager::ResendNotification
std::optional< uint8_t > ResendNotification(Ptr< const WifiMpdu > mpdu) override
A previous EML Operating Mode Notification frame was dropped.
Definition:
default-emlsr-manager.cc:72
ns3::DefaultEmlsrManager::GetLinkToSendEmlNotification
uint8_t GetLinkToSendEmlNotification() override
Definition:
default-emlsr-manager.cc:64
ns3::DefaultEmlsrManager::DefaultEmlsrManager
DefaultEmlsrManager()
Definition:
default-emlsr-manager.cc:42
ns3::DefaultEmlsrManager::m_assocLinkId
std::optional< uint8_t > m_assocLinkId
ID of the link on which Association Response was received.
Definition:
default-emlsr-manager.h:55
ns3::DefaultEmlsrManager::~DefaultEmlsrManager
~DefaultEmlsrManager() override
Definition:
default-emlsr-manager.cc:47
ns3::EmlsrManager
EmlsrManager is an abstract base class defining the API that EHT non-AP MLDs with EMLSR activated can...
Definition:
emlsr-manager.h:44
ns3::EmlsrManager::GetTransitionTimeout
std::optional< Time > GetTransitionTimeout() const
Definition:
emlsr-manager.cc:132
ns3::EmlsrManager::GetStaMac
Ptr< StaWifiMac > GetStaMac() const
Definition:
emlsr-manager.cc:113
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:59
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition:
type-id.cc:936
default-emlsr-manager.h
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition:
assert.h:86
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:46
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
wifi
model
eht
default-emlsr-manager.cc
Generated on Sun Jul 2 2023 18:22:09 for ns-3 by
1.9.6