A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
extended-capabilities.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
10
11namespace ns3
12{
13
15 : m_20_40_bssCoexistenceManagementSupport(0),
16 m_extendedChannelSwitching(0),
17 m_psmpCapability(0),
18 m_spsmpSupport(0),
19 m_event(0),
20 m_diagnostics(0),
21 m_multicastDiagnostics(0),
22 m_locationTracking(0),
23 m_fms(0),
24 m_proxyArpService(0),
25 m_collocatedInterferenceReporting(0),
26 m_civicLocation(0),
27 m_geospatialLocation(0),
28 m_tfs(0),
29 m_wnmSleepMode(0),
30 m_timBroadcast(0),
31 m_bssTransition(0),
32 m_qosTrafficCapability(0),
33 m_acStationCount(0),
34 m_multipleBssid(0),
35 m_timingMeasurement(0),
36 m_channelUsage(0),
37 m_ssidList(0),
38 m_dms(0),
39 m_utcTsfOffset(0),
40 m_tpuBufferStaSupport(0),
41 m_tdlsPeerPsmSupport(0),
42 m_tdlsChannelSwitching(0),
43 m_interworking(0),
44 m_qosMap(0),
45 m_ebr(0),
46 m_sspnInterface(0),
47 m_msgcfCapability(0),
48 m_tdlsSupport(0),
49 m_tdlsProhibited(0),
50 m_tdlsChannelSwitchingProhibited(0),
51 m_rejectUnadmittedFrame(0),
52 m_serviceIntervalGranularity(0),
53 m_identifierLocation(0),
54 m_uapsdCoexistence(0),
55 m_wnmNotification(0),
56 m_qabCapability(0),
57 m_utf8Ssid(0),
58 m_qmfActivated(0),
59 m_qmfReconfigurationActivated(0),
60 m_robustAvStreaming(0),
61 m_advancedGcr(0),
62 m_meshGcr(0),
63 m_scs(0),
64 m_qloadReport(0),
65 m_alternateEdca(0),
66 m_unprotectedTxopNegotiation(0),
67 m_protectedTxopNegotiation(0),
68 m_protectedQloadReport(0),
69 m_tdlsWiderBandwidth(0),
70 m_operatingModeNotification(0),
71 m_maxNumberOfMsdusInAmsdu(0)
72{
73}
74
80
81void
82ExtendedCapabilities::Print(std::ostream& os) const
83{
84 os << "Extended Capabilities=" << +GetExtendedCapabilitiesByte1();
85}
86
87uint16_t
92
93void
95{
97 m_extendedChannelSwitching = (ctrl >> 2) & 0x01;
98 m_psmpCapability = (ctrl >> 4) & 0x01;
99 m_spsmpSupport = (ctrl >> 6) & 0x01;
100 m_event = (ctrl >> 7) & 0x01;
101}
102
103uint8_t
105{
106 uint8_t val = 0;
108 val |= (m_extendedChannelSwitching & 0x01) << 2;
109 val |= (m_psmpCapability & 0x01) << 4;
110 val |= (m_spsmpSupport & 0x01) << 6;
111 val |= (m_event & 0x01) << 7;
112 return val;
113}
114
115void
117{
118 m_diagnostics = ctrl & 0x01;
119 m_multicastDiagnostics = (ctrl >> 1) & 0x01;
120 m_locationTracking = (ctrl >> 2) & 0x01;
121 m_fms = (ctrl >> 3) & 0x01;
122 m_proxyArpService = (ctrl >> 4) & 0x01;
123 m_collocatedInterferenceReporting = (ctrl >> 5) & 0x01;
124 m_civicLocation = (ctrl >> 6) & 0x01;
125 m_geospatialLocation = (ctrl >> 7) & 0x01;
126}
127
128uint8_t
130{
131 uint8_t val = 0;
132 val |= m_diagnostics & 0x01;
133 val |= (m_multicastDiagnostics & 0x01) << 1;
134 val |= (m_locationTracking & 0x01) << 2;
135 val |= (m_fms & 0x01) << 3;
136 val |= (m_proxyArpService & 0x01) << 4;
137 val |= (m_collocatedInterferenceReporting & 0x01) << 5;
138 val |= (m_civicLocation & 0x01) << 6;
139 val |= (m_geospatialLocation & 0x01) << 7;
140 return val;
141}
142
143void
145{
146 m_tfs = ctrl & 0x01;
147 m_wnmSleepMode = (ctrl >> 1) & 0x01;
148 m_timBroadcast = (ctrl >> 2) & 0x01;
149 m_bssTransition = (ctrl >> 3) & 0x01;
150 m_qosTrafficCapability = (ctrl >> 4) & 0x01;
151 m_acStationCount = (ctrl >> 5) & 0x01;
152 m_multipleBssid = (ctrl >> 6) & 0x01;
153 m_timingMeasurement = (ctrl >> 7) & 0x01;
154}
155
156uint8_t
158{
159 uint8_t val = 0;
160 val |= m_tfs & 0x01;
161 val |= (m_wnmSleepMode & 0x01) << 1;
162 val |= (m_timBroadcast & 0x01) << 2;
163 val |= (m_bssTransition & 0x01) << 3;
164 val |= (m_qosTrafficCapability & 0x01) << 4;
165 val |= (m_acStationCount & 0x01) << 5;
166 val |= (m_multipleBssid & 0x01) << 6;
167 val |= (m_timingMeasurement & 0x01) << 7;
168 return val;
169}
170
171void
173{
174 m_channelUsage = ctrl & 0x01;
175 m_ssidList = (ctrl >> 1) & 0x01;
176 m_dms = (ctrl >> 2) & 0x01;
177 m_utcTsfOffset = (ctrl >> 3) & 0x01;
178 m_tpuBufferStaSupport = (ctrl >> 4) & 0x01;
179 m_tdlsPeerPsmSupport = (ctrl >> 5) & 0x01;
180 m_tdlsChannelSwitching = (ctrl >> 6) & 0x01;
181 m_interworking = (ctrl >> 7) & 0x01;
182}
183
184uint8_t
186{
187 uint8_t val = 0;
188 val |= m_channelUsage & 0x01;
189 val |= (m_ssidList & 0x01) << 1;
190 val |= (m_dms & 0x01) << 2;
191 val |= (m_utcTsfOffset & 0x01) << 3;
192 val |= (m_tpuBufferStaSupport & 0x01) << 4;
193 val |= (m_tdlsPeerPsmSupport & 0x01) << 5;
194 val |= (m_tdlsChannelSwitching & 0x01) << 6;
195 val |= (m_interworking & 0x01) << 7;
196 return val;
197}
198
199void
201{
202 m_qosMap = ctrl & 0x01;
203 m_ebr = (ctrl >> 1) & 0x01;
204 m_sspnInterface = (ctrl >> 2) & 0x01;
205 m_msgcfCapability = (ctrl >> 4) & 0x01;
206 m_tdlsSupport = (ctrl >> 5) & 0x01;
207 m_tdlsProhibited = (ctrl >> 6) & 0x01;
208 m_tdlsChannelSwitchingProhibited = (ctrl >> 7) & 0x01;
209}
210
211uint8_t
213{
214 uint8_t val = 0;
215 val |= m_qosMap & 0x01;
216 val |= (m_ebr & 0x01) << 1;
217 val |= (m_sspnInterface & 0x01) << 2;
218 val |= (m_msgcfCapability & 0x01) << 4;
219 val |= (m_tdlsSupport & 0x01) << 5;
220 val |= (m_tdlsProhibited & 0x01) << 6;
221 val |= (m_tdlsChannelSwitchingProhibited & 0x01) << 7;
222 return val;
223}
224
225void
227{
228 m_rejectUnadmittedFrame = ctrl & 0x01;
229 m_serviceIntervalGranularity = (ctrl >> 1) & 0x07;
230 m_identifierLocation = (ctrl >> 4) & 0x01;
231 m_uapsdCoexistence = (ctrl >> 5) & 0x01;
232 m_wnmNotification = (ctrl >> 6) & 0x01;
233 m_qabCapability = (ctrl >> 7) & 0x01;
234}
235
236uint8_t
238{
239 uint8_t val = 0;
240 val |= m_rejectUnadmittedFrame & 0x01;
241 val |= (m_serviceIntervalGranularity & 0x07) << 1;
242 val |= (m_identifierLocation & 0x01) << 4;
243 val |= (m_uapsdCoexistence & 0x01) << 5;
244 val |= (m_wnmNotification & 0x01) << 6;
245 val |= (m_qabCapability & 0x01) << 7;
246 return val;
247}
248
249void
251{
252 m_utf8Ssid = ctrl & 0x01;
253 m_qmfActivated = (ctrl >> 1) & 0x01;
254 m_qmfReconfigurationActivated = (ctrl >> 2) & 0x01;
255 m_robustAvStreaming = (ctrl >> 3) & 0x01;
256 m_advancedGcr = (ctrl >> 4) & 0x01;
257 m_meshGcr = (ctrl >> 5) & 0x01;
258 m_scs = (ctrl >> 6) & 0x01;
259 m_qloadReport = (ctrl >> 7) & 0x01;
260}
261
262uint8_t
264{
265 uint8_t val = 0;
266 val |= m_utf8Ssid & 0x01;
267 val |= (m_qmfActivated & 0x01) << 1;
268 val |= (m_qmfReconfigurationActivated & 0x01) << 2;
269 val |= (m_robustAvStreaming & 0x01) << 3;
270 val |= (m_advancedGcr & 0x01) << 4;
271 val |= (m_meshGcr & 0x01) << 5;
272 val |= (m_scs & 0x01) << 6;
273 val |= (m_qloadReport & 0x01) << 7;
274 return val;
275}
276
277void
279{
280 m_alternateEdca = ctrl & 0x01;
281 m_unprotectedTxopNegotiation = (ctrl >> 1) & 0x01;
282 m_protectedTxopNegotiation = (ctrl >> 2) & 0x01;
283 m_protectedQloadReport = (ctrl >> 3) & 0x01;
284 m_tdlsWiderBandwidth = (ctrl >> 4) & 0x01;
285 m_operatingModeNotification = (ctrl >> 5) & 0x01;
286 m_maxNumberOfMsdusInAmsdu = (ctrl >> 6) & 0x03;
287}
288
289uint8_t
291{
292 uint8_t val = 0;
293 val |= m_alternateEdca & 0x01;
294 val |= (m_unprotectedTxopNegotiation & 0x01) << 1;
295 val |= (m_protectedTxopNegotiation & 0x01) << 2;
296 val |= (m_protectedQloadReport & 0x01) << 3;
297 val |= (m_tdlsWiderBandwidth & 0x01) << 4;
298 val |= (m_operatingModeNotification & 0x01) << 5;
299 val |= (m_maxNumberOfMsdusInAmsdu & 0x03) << 6;
300 return val;
301}
302
303void
305{
306 // write the corresponding value for each bit
307 start.WriteU8(GetExtendedCapabilitiesByte1());
308 start.WriteU8(GetExtendedCapabilitiesByte2());
309 start.WriteU8(GetExtendedCapabilitiesByte3());
310 start.WriteU8(GetExtendedCapabilitiesByte4());
311 start.WriteU8(GetExtendedCapabilitiesByte5());
312 start.WriteU8(GetExtendedCapabilitiesByte6());
313 start.WriteU8(GetExtendedCapabilitiesByte7());
314 start.WriteU8(GetExtendedCapabilitiesByte8());
315}
316
317uint16_t
319{
320 Buffer::Iterator i = start;
321 uint8_t byte1 = i.ReadU8();
322 uint8_t byte2 = i.ReadU8();
323 uint8_t byte3 = i.ReadU8();
324 uint8_t byte4 = i.ReadU8();
325 uint8_t byte5 = i.ReadU8();
326 uint8_t byte6 = i.ReadU8();
327 uint8_t byte7 = i.ReadU8();
328 uint8_t byte8 = i.ReadU8();
337 return length;
338}
339
340} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint8_t m_tdlsWiderBandwidth
TDLS Wider Bandwidth.
uint8_t GetExtendedCapabilitiesByte7() const
Return the seventh byte in the Extended Capabilities information element.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t GetExtendedCapabilitiesByte8() const
Return the eighth byte in the Extended Capabilities information element.
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override
Deserialize information (i.e., the body of the IE, not including the Element ID and length octets)
uint8_t m_wnmNotification
WNM Notification.
uint8_t GetExtendedCapabilitiesByte1() const
Return the first byte in the Extended Capabilities information element.
uint8_t m_utcTsfOffset
UTC TSF Offset.
uint8_t GetExtendedCapabilitiesByte3() const
Return the third byte in the Extended Capabilities information element.
uint8_t m_unprotectedTxopNegotiation
Unprotected TXOP Negotiation.
uint8_t m_identifierLocation
Identifier Location.
void SetExtendedCapabilitiesByte3(uint8_t ctrl)
Set the third byte in the Extended Capabilities information element.
uint8_t m_multicastDiagnostics
Multicast Diagnostics.
uint8_t m_alternateEdca
Alternate EDCA.
uint8_t m_qmfActivated
QMFActivated.
uint8_t m_operatingModeNotification
Operating Mode Notification.
uint8_t m_extendedChannelSwitching
Extended Channel Switching.
void SetExtendedCapabilitiesByte8(uint8_t ctrl)
Set the eighth byte in the Extended Capabilities information element.
uint8_t m_wnmSleepMode
WNM Sleep Mode.
uint16_t GetInformationFieldSize() const override
Length of serialized information (i.e., the length of the body of the IE, not including the Element I...
void SetExtendedCapabilitiesByte1(uint8_t ctrl)
Set the first byte in the Extended Capabilities information element.
uint8_t m_proxyArpService
Proxy ARP Service.
uint8_t m_acStationCount
AC Station Count.
uint8_t m_msgcfCapability
MSGCF Capability.
uint8_t m_geospatialLocation
Geospatial Location.
uint8_t m_serviceIntervalGranularity
Service Interval Granularity.
void SetExtendedCapabilitiesByte2(uint8_t ctrl)
Set the second byte in the Extended Capabilities information element.
uint8_t m_qosTrafficCapability
QoS Traffic Capability.
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
uint8_t m_timingMeasurement
Timing Measurement.
uint8_t m_tdlsProhibited
TDLS Prohibited.
uint8_t m_channelUsage
Channel Usage.
uint8_t GetExtendedCapabilitiesByte4() const
Return the fourth byte in the Extended Capabilities information element.
uint8_t m_qloadReport
QLoad Report.
uint8_t m_bssTransition
BSS Transition.
uint8_t m_multipleBssid
Multiple BSSID.
uint8_t m_tdlsPeerPsmSupport
TDLS Peer PSM Support.
uint8_t m_interworking
Interworking.
uint8_t m_tdlsChannelSwitching
TDLS Channel Switching.
uint8_t m_timBroadcast
TIM Broadcast.
uint8_t m_protectedQloadReport
Protected QLoad Report.
uint8_t GetExtendedCapabilitiesByte5() const
Return the fifth byte in the Extended Capabilities information element.
void SetExtendedCapabilitiesByte6(uint8_t ctrl)
Set the sixth byte in the Extended Capabilities information element.
uint8_t m_tdlsChannelSwitchingProhibited
TDLS Channel Switching Prohibited.
uint8_t m_advancedGcr
Advanced GCR.
uint8_t m_locationTracking
Location Tracking.
void SetExtendedCapabilitiesByte4(uint8_t ctrl)
Set the fourth byte in the Extended Capabilities information element.
uint8_t GetExtendedCapabilitiesByte6() const
Return the sixth byte in the Extended Capabilities information element.
void SetExtendedCapabilitiesByte7(uint8_t ctrl)
Set the seventh byte in the Extended Capabilities information element.
uint8_t m_tdlsSupport
TDLS Support.
uint8_t m_psmpCapability
PSMP Capability.
uint8_t GetExtendedCapabilitiesByte2() const
Return the second byte in the Extended Capabilities information element.
uint8_t m_tpuBufferStaSupport
TPU Buffer STA Support.
uint8_t m_qmfReconfigurationActivated
QMFReconfigurationActivated.
uint8_t m_qabCapability
QAB Capability.
void SetExtendedCapabilitiesByte5(uint8_t ctrl)
Set the fifth byte in the Extended Capabilities information element.
void Print(std::ostream &os) const override
Generate human-readable form of IE.
uint8_t m_protectedTxopNegotiation
Protected TXOP Negotiation.
uint8_t m_rejectUnadmittedFrame
Reject Unadmitted Frame.
uint8_t m_sspnInterface
SSPN Interface.
uint8_t m_robustAvStreaming
Robust AV Streaming.
uint8_t m_spsmpSupport
S-PSMP Support.
uint8_t m_collocatedInterferenceReporting
Collocated Interference Reporting.
uint8_t m_maxNumberOfMsdusInAmsdu
Max Number Of MSDUs In A-MSDU.
uint8_t m_20_40_bssCoexistenceManagementSupport
20/40 BSS Coexistence Management Support
uint8_t m_civicLocation
Civic Location.
uint8_t m_uapsdCoexistence
U-APSD Coexistence.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
#define IE_EXTENDED_CAPABILITIES