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
common-info-probe-req-mle.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Sharan Naribole <sharan.naribole@gmail.com>
7
*/
8
9
#include "
common-info-probe-req-mle.h
"
10
11
#include "ns3/abort.h"
12
13
namespace
ns3
14
{
15
16
uint16_t
17
CommonInfoProbeReqMle::GetPresenceBitmap
()
const
18
{
19
// IEEE 802.11be D5.0 Figure 9-1072q
20
return
(
m_apMldId
.has_value() ? 0x0001 : 0x0);
21
}
22
23
uint8_t
24
CommonInfoProbeReqMle::GetSize
()
const
25
{
26
uint8_t size = 1;
// Common Info Length
27
size += (
m_apMldId
.has_value() ? 1 : 0);
28
return
size;
29
}
30
31
void
32
CommonInfoProbeReqMle::Serialize
(
Buffer::Iterator
& start)
const
33
{
34
start.WriteU8(
GetSize
());
// Common Info Length
35
if
(
m_apMldId
.has_value())
36
{
37
start.WriteU8(*
m_apMldId
);
38
}
39
}
40
41
uint8_t
42
CommonInfoProbeReqMle::Deserialize
(
Buffer::Iterator
start, uint16_t presence)
43
{
44
auto
i = start;
45
auto
length = i.ReadU8();
46
uint8_t count = 1;
47
48
if
(presence & 0x1)
49
{
50
m_apMldId
= i.ReadU8();
51
count++;
52
}
53
NS_ABORT_MSG_IF
(count != length,
54
"Common Info Length ("
<< +length
55
<<
") differs "
56
"from actual number of bytes read ("
57
<< +count <<
")"
);
58
return
count;
59
}
60
61
}
// namespace ns3
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
common-info-probe-req-mle.h
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition
abort.h:97
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::CommonInfoProbeReqMle::m_apMldId
std::optional< uint8_t > m_apMldId
AP MLD ID.
Definition
common-info-probe-req-mle.h:26
ns3::CommonInfoProbeReqMle::Serialize
void Serialize(Buffer::Iterator &start) const
Serialize the Common Info field.
Definition
common-info-probe-req-mle.cc:32
ns3::CommonInfoProbeReqMle::GetPresenceBitmap
uint16_t GetPresenceBitmap() const
Get the Presence Bitmap subfield of the Common Info field.
Definition
common-info-probe-req-mle.cc:17
ns3::CommonInfoProbeReqMle::Deserialize
uint8_t Deserialize(Buffer::Iterator start, uint16_t presence)
Deserialize the Common Info field.
Definition
common-info-probe-req-mle.cc:42
ns3::CommonInfoProbeReqMle::GetSize
uint8_t GetSize() const
Get the size of the serialized Common Info field.
Definition
common-info-probe-req-mle.cc:24
src
wifi
model
eht
common-info-probe-req-mle.cc
Generated on Wed Mar 19 2025 09:20:56 for ns-3 by
1.11.0