A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
capability-information.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
10
11namespace ns3
12{
13
15 : m_capability(0)
16{
17}
18
19void
21{
22 Set(0);
23 Clear(1);
24}
25
26void
32
33void
35{
36 if (shortPreamble)
37 {
38 Set(5);
39 }
40}
41
42void
44{
45 if (shortSlotTime)
46 {
47 Set(10);
48 }
49}
50
51void
56
57void
59{
60 if (flag)
61 {
62 Set(6);
63 }
64}
65
66bool
68{
69 return Is(0);
70}
71
72bool
74{
75 return Is(1);
76}
77
78bool
80{
81 return Is(5);
82}
83
84bool
86{
87 return Is(10);
88}
89
90bool
92{
93 return Is(2);
94}
95
96bool
98{
99 return Is(6);
100}
101
102void
104{
105 uint32_t mask = 1 << n;
106 m_capability |= mask;
107}
108
109void
111{
112 uint32_t mask = 1 << n;
113 m_capability &= ~mask;
114}
115
116bool
118{
119 uint32_t mask = 1 << n;
120 return (m_capability & mask) == mask;
121}
122
125{
126 return 2;
127}
128
131{
133 return start;
134}
135
138{
139 m_capability = start.ReadLsbtohU16();
140 return start;
141}
142
143} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
void WriteHtolsbU16(uint16_t data)
Definition buffer.cc:891
void SetCriticalUpdate(bool flag)
Set Critical Update flag (see IEEE 802.11be D5.0 9.4.1.4)
void SetEss()
Set the Extended Service Set (ESS) bit in the capability information field.
bool IsShortSlotTime() const
Check if the short slot time in the capability information field is set to 1.
uint32_t GetSerializedSize() const
Return the serialized size of capability information.
void SetCfPollable()
Set the CF-Pollable bit in the capability information field.
bool IsCriticalUpdate() const
Check if Critical Update bit is set to 1.
Buffer::Iterator Serialize(Buffer::Iterator start) const
Serialize capability information to the given buffer.
void Set(uint8_t n)
Set bit n to 1.
void SetShortSlotTime(bool shortSlotTime)
Set the short slot time bit in the capability information field.
bool IsEss() const
Check if the Extended Service Set (ESS) bit in the capability information field is set to 1.
bool IsIbss() const
Check if the Independent BSS (IBSS) bit in the capability information field is set to 1.
void Clear(uint8_t n)
Set bit n to 0.
void SetShortPreamble(bool shortPreamble)
Set the short preamble bit in the capability information field.
bool Is(uint8_t n) const
Check if bit n is set to 1.
void SetIbss()
Set the Independent BSS (IBSS) bit in the capability information field.
Buffer::Iterator Deserialize(Buffer::Iterator start)
Deserialize capability information from the given buffer.
bool IsCfPollable() const
Check if the CF-Pollable bit in the capability information field is set to 1.
bool IsShortPreamble() const
Check if the short preamble bit in the capability information field is set to 1.
Every class exported by the ns3 library is enclosed in the ns3 namespace.