A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
capability-information.h
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
9#ifndef CAPABILITY_INFORMATION_H
10#define CAPABILITY_INFORMATION_H
11
12#include "ns3/buffer.h"
13
14namespace ns3
15{
16
17/**
18 * \ingroup wifi
19 *
20 * Capability information
21 */
23{
24 public:
26
27 /**
28 * Set the Extended Service Set (ESS) bit
29 * in the capability information field.
30 */
31 void SetEss();
32 /**
33 * Set the Independent BSS (IBSS) bit
34 * in the capability information field.
35 */
36 void SetIbss();
37 /**
38 * Set the short preamble bit
39 * in the capability information field.
40 *
41 * \param shortPreamble the short preamble bit
42 *
43 */
44 void SetShortPreamble(bool shortPreamble);
45 /**
46 * Set the short slot time bit
47 * in the capability information field.
48 *
49 * \param shortSlotTime the short preamble bit
50 *
51 */
52 void SetShortSlotTime(bool shortSlotTime);
53 /**
54 * Set the CF-Pollable bit
55 * in the capability information field.
56 */
57 void SetCfPollable();
58
59 /**
60 * Check if the Extended Service Set (ESS) bit
61 * in the capability information field is set to 1.
62 *
63 * \return ESS bit in the capability information
64 * field is set to 1
65 */
66 bool IsEss() const;
67 /**
68 * Check if the Independent BSS (IBSS) bit
69 * in the capability information field is set to 1.
70 *
71 * \return IBSS bit in the capability information
72 * field is set to 1
73 */
74 bool IsIbss() const;
75 /**
76 * Check if the short preamble bit
77 * in the capability information field is set to 1.
78 *
79 * \return short preamble bit in the capability information
80 * field is set to 1
81 */
82 bool IsShortPreamble() const;
83 /**
84 * Check if the short slot time
85 * in the capability information field is set to 1.
86 *
87 * \return short slot time bit in the capability information
88 * field is set to 1
89 */
90 bool IsShortSlotTime() const;
91 /**
92 * Check if the CF-Pollable bit
93 * in the capability information field is set to 1.
94 *
95 * \return CF-Pollable bit in the capability information
96 * field is set to 1
97 */
98 bool IsCfPollable() const;
99
100 /**
101 * Return the serialized size of capability
102 * information.
103 *
104 * \return the serialized size
105 */
107 /**
108 * Serialize capability information to the given buffer.
109 *
110 * \param start an iterator to a buffer
111 * \return an iterator to a buffer after capability information
112 * was serialized
113 */
115 /**
116 * Deserialize capability information from the given buffer.
117 *
118 * \param start an iterator to a buffer
119 * \return an iterator to a buffer after capability information
120 * was deserialized
121 */
123
124 private:
125 /**
126 * Check if bit n is set to 1.
127 *
128 * \param n the bit position
129 *
130 * \return true if bit n is set to 1,
131 * false otherwise
132 */
133 bool Is(uint8_t n) const;
134 /**
135 * Set bit n to 1.
136 *
137 * \param n the bit position
138 */
139 void Set(uint8_t n);
140 /**
141 * Set bit n to 0.
142 *
143 * \param n the bit position
144 */
145 void Clear(uint8_t n);
146
147 uint16_t m_capability; ///< capability
148};
149
150} // namespace ns3
151
152#endif /* CAPABILITY_INFORMATION_H */
iterator in a Buffer instance
Definition buffer.h:89
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.