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
19
20void
21ExtendedCapabilities::Print(std::ostream& os) const
22{
23 os << "Extended Capabilities=";
24 // TODO: print useful capabilities
25}
26
27uint16_t
32
33void
35{
36 uint8_t byte = 0;
38 byte |= (m_extendedChannelSwitching & 0x01) << 2;
39 byte |= (m_psmpCapability & 0x01) << 4;
40 byte |= (m_spsmpSupport & 0x01) << 6;
41 byte |= (m_event & 0x01) << 7;
42 start.WriteU8(byte);
43
44 byte = 0;
45 byte |= m_diagnostics & 0x01;
46 byte |= (m_multicastDiagnostics & 0x01) << 1;
47 byte |= (m_locationTracking & 0x01) << 2;
48 byte |= (m_fms & 0x01) << 3;
49 byte |= (m_proxyArpService & 0x01) << 4;
50 byte |= (m_collocatedInterferenceReporting & 0x01) << 5;
51 byte |= (m_civicLocation & 0x01) << 6;
52 byte |= (m_geospatialLocation & 0x01) << 7;
53 start.WriteU8(byte);
54
55 byte = 0;
56 byte |= m_tfs & 0x01;
57 byte |= (m_wnmSleepMode & 0x01) << 1;
58 byte |= (m_timBroadcast & 0x01) << 2;
59 byte |= (m_bssTransition & 0x01) << 3;
60 byte |= (m_qosTrafficCapability & 0x01) << 4;
61 byte |= (m_acStationCount & 0x01) << 5;
62 byte |= (m_multipleBssid & 0x01) << 6;
63 byte |= (m_timingMeasurement & 0x01) << 7;
64 start.WriteU8(byte);
65
66 byte = 0;
67 byte |= m_channelUsage & 0x01;
68 byte |= (m_ssidList & 0x01) << 1;
69 byte |= (m_dms & 0x01) << 2;
70 byte |= (m_utcTsfOffset & 0x01) << 3;
71 byte |= (m_tpuBufferStaSupport & 0x01) << 4;
72 byte |= (m_tdlsPeerPsmSupport & 0x01) << 5;
73 byte |= (m_tdlsChannelSwitching & 0x01) << 6;
74 byte |= (m_interworking & 0x01) << 7;
75 start.WriteU8(byte);
76
77 byte = 0;
78 byte |= m_qosMap & 0x01;
79 byte |= (m_ebr & 0x01) << 1;
80 byte |= (m_sspnInterface & 0x01) << 2;
81 byte |= (m_msgcfCapability & 0x01) << 4;
82 byte |= (m_tdlsSupport & 0x01) << 5;
83 byte |= (m_tdlsProhibited & 0x01) << 6;
84 byte |= (m_tdlsChannelSwitchingProhibited & 0x01) << 7;
85 start.WriteU8(byte);
86
87 byte = 0;
88 byte |= m_rejectUnadmittedFrame & 0x01;
89 byte |= (m_serviceIntervalGranularity & 0x07) << 1;
90 byte |= (m_identifierLocation & 0x01) << 4;
91 byte |= (m_uapsdCoexistence & 0x01) << 5;
92 byte |= (m_wnmNotification & 0x01) << 6;
93 byte |= (m_qabCapability & 0x01) << 7;
94 start.WriteU8(byte);
95
96 byte = 0;
97 byte |= m_utf8Ssid & 0x01;
98 byte |= (m_qmfActivated & 0x01) << 1;
99 byte |= (m_qmfReconfigurationActivated & 0x01) << 2;
100 byte |= (m_robustAvStreaming & 0x01) << 3;
101 byte |= (m_advancedGcr & 0x01) << 4;
102 byte |= (m_meshGcr & 0x01) << 5;
103 byte |= (m_scs & 0x01) << 6;
104 byte |= (m_qloadReport & 0x01) << 7;
105 start.WriteU8(byte);
106
107 byte = 0;
108 byte |= m_alternateEdca & 0x01;
109 byte |= (m_unprotectedTxopNegotiation & 0x01) << 1;
110 byte |= (m_protectedTxopNegotiation & 0x01) << 2;
111 byte |= (m_protectedQloadReport & 0x01) << 3;
112 byte |= (m_tdlsWiderBandwidth & 0x01) << 4;
113 byte |= (m_operatingModeNotification & 0x01) << 5;
114 byte |= (m_maxNumberOfMsdusInAmsdu & 0x03) << 6;
115 start.WriteU8(byte);
116}
117
118uint16_t
120{
121 Buffer::Iterator i = start;
122
123 auto byte = i.ReadU8();
125 m_extendedChannelSwitching = (byte >> 2) & 0x01;
126 m_psmpCapability = (byte >> 4) & 0x01;
127 m_spsmpSupport = (byte >> 6) & 0x01;
128 m_event = (byte >> 7) & 0x01;
129
130 byte = i.ReadU8();
131 m_diagnostics = byte & 0x01;
132 m_multicastDiagnostics = (byte >> 1) & 0x01;
133 m_locationTracking = (byte >> 2) & 0x01;
134 m_fms = (byte >> 3) & 0x01;
135 m_proxyArpService = (byte >> 4) & 0x01;
136 m_collocatedInterferenceReporting = (byte >> 5) & 0x01;
137 m_civicLocation = (byte >> 6) & 0x01;
138 m_geospatialLocation = (byte >> 7) & 0x01;
139
140 byte = i.ReadU8();
141 m_tfs = byte & 0x01;
142 m_wnmSleepMode = (byte >> 1) & 0x01;
143 m_timBroadcast = (byte >> 2) & 0x01;
144 m_bssTransition = (byte >> 3) & 0x01;
145 m_qosTrafficCapability = (byte >> 4) & 0x01;
146 m_acStationCount = (byte >> 5) & 0x01;
147 m_multipleBssid = (byte >> 6) & 0x01;
148 m_timingMeasurement = (byte >> 7) & 0x01;
149
150 byte = i.ReadU8();
151 m_channelUsage = byte & 0x01;
152 m_ssidList = (byte >> 1) & 0x01;
153 m_dms = (byte >> 2) & 0x01;
154 m_utcTsfOffset = (byte >> 3) & 0x01;
155 m_tpuBufferStaSupport = (byte >> 4) & 0x01;
156 m_tdlsPeerPsmSupport = (byte >> 5) & 0x01;
157 m_tdlsChannelSwitching = (byte >> 6) & 0x01;
158 m_interworking = (byte >> 7) & 0x01;
159
160 byte = i.ReadU8();
161 m_qosMap = byte & 0x01;
162 m_ebr = (byte >> 1) & 0x01;
163 m_sspnInterface = (byte >> 2) & 0x01;
164 m_msgcfCapability = (byte >> 4) & 0x01;
165 m_tdlsSupport = (byte >> 5) & 0x01;
166 m_tdlsProhibited = (byte >> 6) & 0x01;
167 m_tdlsChannelSwitchingProhibited = (byte >> 7) & 0x01;
168
169 byte = i.ReadU8();
170 m_rejectUnadmittedFrame = byte & 0x01;
171 m_serviceIntervalGranularity = (byte >> 1) & 0x07;
172 m_identifierLocation = (byte >> 4) & 0x01;
173 m_uapsdCoexistence = (byte >> 5) & 0x01;
174 m_wnmNotification = (byte >> 6) & 0x01;
175 m_qabCapability = (byte >> 7) & 0x01;
176
177 byte = i.ReadU8();
178 m_utf8Ssid = byte & 0x01;
179 m_qmfActivated = (byte >> 1) & 0x01;
180 m_qmfReconfigurationActivated = (byte >> 2) & 0x01;
181 m_robustAvStreaming = (byte >> 3) & 0x01;
182 m_advancedGcr = (byte >> 4) & 0x01;
183 m_meshGcr = (byte >> 5) & 0x01;
184 m_scs = (byte >> 6) & 0x01;
185 m_qloadReport = (byte >> 7) & 0x01;
186
187 byte = i.ReadU8();
188 m_alternateEdca = byte & 0x01;
189 m_unprotectedTxopNegotiation = (byte >> 1) & 0x01;
190 m_protectedTxopNegotiation = (byte >> 2) & 0x01;
191 m_protectedQloadReport = (byte >> 3) & 0x01;
192 m_tdlsWiderBandwidth = (byte >> 4) & 0x01;
193 m_operatingModeNotification = (byte >> 5) & 0x01;
194 m_maxNumberOfMsdusInAmsdu = (byte >> 6) & 0x03;
195
196 return length;
197}
198
199} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint8_t m_tdlsWiderBandwidth
TDLS Wider Bandwidth.
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
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 m_utcTsfOffset
UTC TSF Offset.
uint8_t m_unprotectedTxopNegotiation
Unprotected TXOP Negotiation.
uint8_t m_identifierLocation
Identifier Location.
uint8_t m_diagnostics
Diagnostics.
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.
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...
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.
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 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 m_tdlsChannelSwitchingProhibited
TDLS Channel Switching Prohibited.
uint8_t m_advancedGcr
Advanced GCR.
uint8_t m_locationTracking
Location Tracking.
uint8_t m_tdlsSupport
TDLS Support.
uint8_t m_psmpCapability
PSMP Capability.
uint8_t m_tpuBufferStaSupport
TPU Buffer STA Support.
uint8_t m_qmfReconfigurationActivated
QMFReconfigurationActivated.
uint8_t m_qabCapability
QAB Capability.
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