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
57bool
59{
60 return Is(0);
61}
62
63bool
65{
66 return Is(1);
67}
68
69bool
71{
72 return Is(5);
73}
74
75bool
77{
78 return Is(10);
79}
80
81bool
83{
84 return Is(2);
85}
86
87void
89{
90 uint32_t mask = 1 << n;
91 m_capability |= mask;
92}
93
94void
96{
97 uint32_t mask = 1 << n;
98 m_capability &= ~mask;
99}
100
101bool
103{
104 uint32_t mask = 1 << n;
105 return (m_capability & mask) == mask;
106}
107
110{
111 return 2;
112}
113
116{
118 return start;
119}
120
123{
124 m_capability = start.ReadLsbtohU16();
125 return start;
126}
127
128} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
void WriteHtolsbU16(uint16_t data)
Definition buffer.cc:891
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.
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.