|
26 |
|
26 |
|
27 |
namespace ns3 { |
27 |
namespace ns3 { |
28 |
|
28 |
|
|
|
29 |
void |
30 |
MgtCommonHeader::AddWifiInformationElement (Ptr<WifiInformationElement> element) |
31 |
{ |
32 |
m_map[element->ElementId ()] = element; |
33 |
} |
34 |
|
35 |
Ptr<WifiInformationElement> |
36 |
MgtCommonHeader::GetInformationElement (WifiInformationElementId id) |
37 |
{ |
38 |
WifiInformationElementMap::const_iterator it = m_map.find (id); |
39 |
if (it != m_map.end()) |
40 |
{ |
41 |
return it->second; |
42 |
} |
43 |
else |
44 |
{ |
45 |
return 0; |
46 |
} |
47 |
} |
48 |
|
49 |
uint32_t |
50 |
MgtCommonHeader::GetInformationElementsSerializedSize (void) const |
51 |
{ |
52 |
Ptr<WifiInformationElement> element; |
53 |
uint32_t size = 0; |
54 |
for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end (); elem++) |
55 |
{ |
56 |
element = elem->second; |
57 |
size += element->GetSerializedSize (); |
58 |
} |
59 |
return size; |
60 |
} |
61 |
|
62 |
WifiInformationElementMap |
63 |
MgtCommonHeader::GetListOfInformationElement (void) const |
64 |
{ |
65 |
return m_map; |
66 |
} |
67 |
|
68 |
void |
69 |
MgtCommonHeader::PrintInformationElements (std::ostream &os) const |
70 |
{ |
71 |
Ptr<WifiInformationElement> element; |
72 |
for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end ();) |
73 |
{ |
74 |
switch (elem->first) |
75 |
{ |
76 |
case IE_HT_CAPABILITIES: |
77 |
os << "HT Capabilities="; |
78 |
break; |
79 |
case IE_VHT_CAPABILITIES: |
80 |
os << "VHT Capabilities="; |
81 |
break; |
82 |
case IE_HE_CAPABILITIES: |
83 |
os << "HE Capabilities="; |
84 |
break; |
85 |
case IE_EXTENDED_CAPABILITIES: |
86 |
os << "Extended Capabilities="; |
87 |
break; |
88 |
case IE_HT_OPERATION: |
89 |
os << "HT Operation="; |
90 |
break; |
91 |
case IE_VHT_OPERATION: |
92 |
os << "VHT Operation="; |
93 |
break; |
94 |
case IE_HE_OPERATION: |
95 |
os << "HE Operation="; |
96 |
break; |
97 |
case IE_ERP_INFORMATION: |
98 |
os << "ERP information="; |
99 |
break; |
100 |
case IE_EDCA_PARAMETER_SET: |
101 |
os << "EDCA parameter set="; |
102 |
break; |
103 |
case IE_DSSS_PARAMETER_SET: |
104 |
os << "DSSS parameter set="; |
105 |
break; |
106 |
case IE_CF_PARAMETER_SET: |
107 |
os << "CF parameter set="; |
108 |
break; |
109 |
default: |
110 |
os << "Unknown IE="; |
111 |
break; |
112 |
} |
113 |
elem->second->Print (os); |
114 |
++elem; |
115 |
if (elem != m_map.end ()) |
116 |
{ |
117 |
os << " , "; |
118 |
} |
119 |
} |
120 |
} |
121 |
|
122 |
Buffer::Iterator |
123 |
MgtCommonHeader::SerializeInformationElements (Buffer::Iterator start) const |
124 |
{ |
125 |
Buffer::Iterator i = start; |
126 |
Ptr<WifiInformationElement> element; |
127 |
for (WifiInformationElementMap::const_iterator elem = m_map.begin (); elem != m_map.end (); elem++) |
128 |
{ |
129 |
element = elem->second; |
130 |
i = element->Serialize (i); |
131 |
} |
132 |
return i; |
133 |
} |
134 |
|
135 |
Buffer::Iterator |
136 |
MgtCommonHeader::DeserializeInformationElements (Buffer::Iterator start) |
137 |
{ |
138 |
Buffer::Iterator i = start; |
139 |
Ptr<WifiInformationElement> element; |
140 |
uint8_t id, length; |
141 |
while ((!i.IsEnd ()) && (i.GetRemainingSize() > 2)) |
142 |
{ |
143 |
id = i.ReadU8 (); |
144 |
length = i.ReadU8 (); |
145 |
switch (id) |
146 |
{ |
147 |
case IE_HT_CAPABILITIES: |
148 |
element = Create<HtCapabilities> (); |
149 |
break; |
150 |
case IE_VHT_CAPABILITIES: |
151 |
element = Create<VhtCapabilities> (); |
152 |
break; |
153 |
case IE_HE_CAPABILITIES: |
154 |
element = Create<HeCapabilities> (); |
155 |
break; |
156 |
case IE_EXTENDED_CAPABILITIES: |
157 |
element = Create<ExtendedCapabilities> (); |
158 |
break; |
159 |
case IE_HT_OPERATION: |
160 |
element = Create<HtOperation> (); |
161 |
break; |
162 |
case IE_VHT_OPERATION: |
163 |
element = Create<VhtOperation> (); |
164 |
break; |
165 |
case IE_HE_OPERATION: |
166 |
element = Create<HeOperation> (); |
167 |
break; |
168 |
case IE_ERP_INFORMATION: |
169 |
element = Create<ErpInformation> (); |
170 |
break; |
171 |
case IE_EDCA_PARAMETER_SET: |
172 |
element = Create<EdcaParameterSet> (); |
173 |
break; |
174 |
case IE_DSSS_PARAMETER_SET: |
175 |
element = Create<DsssParameterSet> (); |
176 |
break; |
177 |
case IE_CF_PARAMETER_SET: |
178 |
element = Create<CfParameterSet> (); |
179 |
break; |
180 |
default: |
181 |
// We peeked at the ID and length, so we need to back up the |
182 |
// pointer before deferring to our parent. |
183 |
i.Prev (2); |
184 |
return i; |
185 |
} |
186 |
i = element->DeserializeElementBody (i, length); |
187 |
m_map[id] = element; |
188 |
} |
189 |
return i; |
190 |
} |
191 |
|
29 |
/*********************************************************** |
192 |
/*********************************************************** |
30 |
* Probe Request |
193 |
* Probe Request |
31 |
***********************************************************/ |
194 |
***********************************************************/ |
32 |
|
195 |
|
33 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader); |
196 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader); |
|
60 |
m_rates = rates; |
223 |
m_rates = rates; |
61 |
} |
224 |
} |
62 |
|
225 |
|
63 |
void |
|
|
64 |
MgtProbeRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities) |
65 |
{ |
66 |
m_extendedCapability = extendedcapabilities; |
67 |
} |
68 |
|
69 |
ExtendedCapabilities |
70 |
MgtProbeRequestHeader::GetExtendedCapabilities (void) const |
71 |
{ |
72 |
return m_extendedCapability; |
73 |
} |
74 |
|
75 |
void |
76 |
MgtProbeRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities) |
77 |
{ |
78 |
m_htCapability = htcapabilities; |
79 |
} |
80 |
|
81 |
HtCapabilities |
82 |
MgtProbeRequestHeader::GetHtCapabilities (void) const |
83 |
{ |
84 |
return m_htCapability; |
85 |
} |
86 |
|
87 |
void |
88 |
MgtProbeRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities) |
89 |
{ |
90 |
m_vhtCapability = vhtcapabilities; |
91 |
} |
92 |
|
93 |
VhtCapabilities |
94 |
MgtProbeRequestHeader::GetVhtCapabilities (void) const |
95 |
{ |
96 |
return m_vhtCapability; |
97 |
} |
98 |
|
99 |
void |
100 |
MgtProbeRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities) |
101 |
{ |
102 |
m_heCapability = hecapabilities; |
103 |
} |
104 |
|
105 |
HeCapabilities |
106 |
MgtProbeRequestHeader::GetHeCapabilities (void) const |
107 |
{ |
108 |
return m_heCapability; |
109 |
} |
110 |
|
111 |
SupportedRates |
226 |
SupportedRates |
112 |
MgtProbeRequestHeader::GetSupportedRates (void) const |
227 |
MgtProbeRequestHeader::GetSupportedRates (void) const |
113 |
{ |
228 |
{ |
|
121 |
size += m_ssid.GetSerializedSize (); |
236 |
size += m_ssid.GetSerializedSize (); |
122 |
size += m_rates.GetSerializedSize (); |
237 |
size += m_rates.GetSerializedSize (); |
123 |
size += m_rates.extended.GetSerializedSize (); |
238 |
size += m_rates.extended.GetSerializedSize (); |
124 |
size += m_extendedCapability.GetSerializedSize (); |
239 |
size += GetInformationElementsSerializedSize (); |
125 |
size += m_htCapability.GetSerializedSize (); |
|
|
126 |
size += m_vhtCapability.GetSerializedSize (); |
127 |
size += m_heCapability.GetSerializedSize (); |
128 |
return size; |
240 |
return size; |
129 |
} |
241 |
} |
130 |
|
242 |
|
|
149 |
MgtProbeRequestHeader::Print (std::ostream &os) const |
261 |
MgtProbeRequestHeader::Print (std::ostream &os) const |
150 |
{ |
262 |
{ |
151 |
os << "ssid=" << m_ssid << ", " |
263 |
os << "ssid=" << m_ssid << ", " |
152 |
<< "rates=" << m_rates << ", " |
264 |
<< "rates=" << m_rates << ", "; |
153 |
<< "Extended Capabilities=" << m_extendedCapability << " , " |
265 |
PrintInformationElements (os); |
154 |
<< "HT Capabilities=" << m_htCapability << " , " |
|
|
155 |
<< "VHT Capabilities=" << m_vhtCapability << " , " |
156 |
<< "HE Capabilities=" << m_heCapability; |
157 |
} |
266 |
} |
158 |
|
267 |
|
159 |
void |
268 |
void |
|
163 |
i = m_ssid.Serialize (i); |
272 |
i = m_ssid.Serialize (i); |
164 |
i = m_rates.Serialize (i); |
273 |
i = m_rates.Serialize (i); |
165 |
i = m_rates.extended.Serialize (i); |
274 |
i = m_rates.extended.Serialize (i); |
166 |
i = m_extendedCapability.Serialize (i); |
275 |
i = SerializeInformationElements (i); |
167 |
i = m_htCapability.Serialize (i); |
|
|
168 |
i = m_vhtCapability.Serialize (i); |
169 |
i = m_heCapability.Serialize (i); |
170 |
} |
276 |
} |
171 |
|
277 |
|
172 |
uint32_t |
278 |
uint32_t |
|
176 |
i = m_ssid.Deserialize (i); |
282 |
i = m_ssid.Deserialize (i); |
177 |
i = m_rates.Deserialize (i); |
283 |
i = m_rates.Deserialize (i); |
178 |
i = m_rates.extended.DeserializeIfPresent (i); |
284 |
i = m_rates.extended.DeserializeIfPresent (i); |
179 |
i = m_extendedCapability.DeserializeIfPresent (i); |
285 |
i = DeserializeInformationElements (i); |
180 |
i = m_htCapability.DeserializeIfPresent (i); |
|
|
181 |
i = m_vhtCapability.DeserializeIfPresent (i); |
182 |
i = m_heCapability.DeserializeIfPresent (i); |
183 |
return i.GetDistanceFrom (start); |
286 |
return i.GetDistanceFrom (start); |
184 |
} |
287 |
} |
185 |
|
288 |
|
186 |
|
289 |
|
187 |
/*********************************************************** |
290 |
/*********************************************************** |
188 |
* Probe Response |
291 |
* Probe Response |
189 |
***********************************************************/ |
292 |
***********************************************************/ |
190 |
|
293 |
|
191 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader); |
294 |
NS_OBJECT_ENSURE_REGISTERED (MgtProbeResponseHeader); |
|
235 |
} |
338 |
} |
236 |
|
339 |
|
237 |
void |
340 |
void |
238 |
MgtProbeResponseHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities) |
|
|
239 |
{ |
240 |
m_extendedCapability = extendedcapabilities; |
241 |
} |
242 |
|
243 |
ExtendedCapabilities |
244 |
MgtProbeResponseHeader::GetExtendedCapabilities (void) const |
245 |
{ |
246 |
return m_extendedCapability; |
247 |
} |
248 |
|
249 |
void |
250 |
MgtProbeResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities) |
251 |
{ |
252 |
m_htCapability = htcapabilities; |
253 |
} |
254 |
|
255 |
HtCapabilities |
256 |
MgtProbeResponseHeader::GetHtCapabilities (void) const |
257 |
{ |
258 |
return m_htCapability; |
259 |
} |
260 |
|
261 |
void |
262 |
MgtProbeResponseHeader::SetHtOperation (HtOperation htoperation) |
263 |
{ |
264 |
m_htOperation = htoperation; |
265 |
} |
266 |
|
267 |
HtOperation |
268 |
MgtProbeResponseHeader::GetHtOperation (void) const |
269 |
{ |
270 |
return m_htOperation; |
271 |
} |
272 |
|
273 |
void |
274 |
MgtProbeResponseHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities) |
275 |
{ |
276 |
m_vhtCapability = vhtcapabilities; |
277 |
} |
278 |
|
279 |
VhtCapabilities |
280 |
MgtProbeResponseHeader::GetVhtCapabilities (void) const |
281 |
{ |
282 |
return m_vhtCapability; |
283 |
} |
284 |
|
285 |
void |
286 |
MgtProbeResponseHeader::SetVhtOperation (VhtOperation vhtoperation) |
287 |
{ |
288 |
m_vhtOperation = vhtoperation; |
289 |
} |
290 |
|
291 |
VhtOperation |
292 |
MgtProbeResponseHeader::GetVhtOperation (void) const |
293 |
{ |
294 |
return m_vhtOperation; |
295 |
} |
296 |
|
297 |
void |
298 |
MgtProbeResponseHeader::SetHeCapabilities (HeCapabilities hecapabilities) |
299 |
{ |
300 |
m_heCapability = hecapabilities; |
301 |
} |
302 |
|
303 |
HeCapabilities |
304 |
MgtProbeResponseHeader::GetHeCapabilities (void) const |
305 |
{ |
306 |
return m_heCapability; |
307 |
} |
308 |
|
309 |
void |
310 |
MgtProbeResponseHeader::SetHeOperation (HeOperation heoperation) |
311 |
{ |
312 |
m_heOperation = heoperation; |
313 |
} |
314 |
|
315 |
HeOperation |
316 |
MgtProbeResponseHeader::GetHeOperation (void) const |
317 |
{ |
318 |
return m_heOperation; |
319 |
} |
320 |
|
321 |
void |
322 |
MgtProbeResponseHeader::SetCfParameterSet (CfParameterSet cfparameterset) |
323 |
{ |
324 |
m_cfParameterSet = cfparameterset; |
325 |
} |
326 |
|
327 |
CfParameterSet |
328 |
MgtProbeResponseHeader::GetCfParameterSet (void) const |
329 |
{ |
330 |
return m_cfParameterSet; |
331 |
} |
332 |
|
333 |
void |
334 |
MgtProbeResponseHeader::SetSsid (Ssid ssid) |
341 |
MgtProbeResponseHeader::SetSsid (Ssid ssid) |
335 |
{ |
342 |
{ |
336 |
m_ssid = ssid; |
343 |
m_ssid = ssid; |
|
348 |
m_rates = rates; |
355 |
m_rates = rates; |
349 |
} |
356 |
} |
350 |
|
357 |
|
351 |
void |
|
|
352 |
MgtProbeResponseHeader::SetDsssParameterSet (DsssParameterSet dsssParameterSet) |
353 |
{ |
354 |
m_dsssParameterSet = dsssParameterSet; |
355 |
} |
356 |
|
357 |
DsssParameterSet |
358 |
MgtProbeResponseHeader::GetDsssParameterSet (void) const |
359 |
{ |
360 |
return m_dsssParameterSet; |
361 |
} |
362 |
|
363 |
void |
364 |
MgtProbeResponseHeader::SetErpInformation (ErpInformation erpInformation) |
365 |
{ |
366 |
m_erpInformation = erpInformation; |
367 |
} |
368 |
|
369 |
ErpInformation |
370 |
MgtProbeResponseHeader::GetErpInformation (void) const |
371 |
{ |
372 |
return m_erpInformation; |
373 |
} |
374 |
|
375 |
void |
376 |
MgtProbeResponseHeader::SetEdcaParameterSet (EdcaParameterSet edcaparameters) |
377 |
{ |
378 |
m_edcaParameterSet = edcaparameters; |
379 |
} |
380 |
|
381 |
EdcaParameterSet |
382 |
MgtProbeResponseHeader::GetEdcaParameterSet (void) const |
383 |
{ |
384 |
return m_edcaParameterSet; |
385 |
} |
386 |
|
387 |
TypeId |
358 |
TypeId |
388 |
MgtProbeResponseHeader::GetTypeId (void) |
359 |
MgtProbeResponseHeader::GetTypeId (void) |
389 |
{ |
360 |
{ |
|
410 |
size += m_capability.GetSerializedSize (); |
381 |
size += m_capability.GetSerializedSize (); |
411 |
size += m_ssid.GetSerializedSize (); |
382 |
size += m_ssid.GetSerializedSize (); |
412 |
size += m_rates.GetSerializedSize (); |
383 |
size += m_rates.GetSerializedSize (); |
413 |
size += m_cfParameterSet.GetSerializedSize (); |
|
|
414 |
size += m_dsssParameterSet.GetSerializedSize (); |
415 |
size += m_erpInformation.GetSerializedSize (); |
416 |
size += m_rates.extended.GetSerializedSize (); |
384 |
size += m_rates.extended.GetSerializedSize (); |
417 |
size += m_edcaParameterSet.GetSerializedSize (); |
385 |
size += GetInformationElementsSerializedSize (); |
418 |
size += m_extendedCapability.GetSerializedSize (); |
|
|
419 |
size += m_htCapability.GetSerializedSize (); |
420 |
size += m_htOperation.GetSerializedSize (); |
421 |
size += m_vhtCapability.GetSerializedSize (); |
422 |
size += m_vhtOperation.GetSerializedSize (); |
423 |
size += m_heCapability.GetSerializedSize (); |
424 |
size += m_heOperation.GetSerializedSize (); |
425 |
return size; |
386 |
return size; |
426 |
} |
387 |
} |
427 |
|
388 |
|
428 |
void |
389 |
void |
429 |
MgtProbeResponseHeader::Print (std::ostream &os) const |
390 |
MgtProbeResponseHeader::Print (std::ostream &os) const |
430 |
{ |
391 |
{ |
431 |
os << "ssid=" << m_ssid << ", " |
392 |
os << "Timestamp=" << m_timestamp << ", " << |
432 |
<< "rates=" << m_rates << ", " |
393 |
"BeaconInterval=" << m_beaconInterval << ", " << |
433 |
<< "ERP information=" << m_erpInformation << ", " |
394 |
"rates=" << m_rates << ", " |
434 |
<< "Extended Capabilities=" << m_extendedCapability << " , " |
395 |
"ssid=" << m_ssid << ", "; |
435 |
<< "HT Capabilities=" << m_htCapability << " , " |
396 |
PrintInformationElements (os); |
436 |
<< "HT Operation=" << m_htOperation << " , " |
|
|
437 |
<< "VHT Capabilities=" << m_vhtCapability << " , " |
438 |
<< "VHT Operation=" << m_vhtOperation << " , " |
439 |
<< "HE Capabilities=" << m_heCapability << " , " |
440 |
<< "HE Operation=" << m_heOperation; |
441 |
} |
397 |
} |
442 |
|
398 |
|
443 |
void |
399 |
void |
|
448 |
//capability information |
404 |
//capability information |
449 |
//ssid |
405 |
//ssid |
450 |
//supported rates |
406 |
//supported rates |
451 |
//fh parameter set |
|
|
452 |
//ds parameter set |
453 |
//cf parameter set |
454 |
//ibss parameter set |
455 |
Buffer::Iterator i = start; |
407 |
Buffer::Iterator i = start; |
456 |
i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ()); |
408 |
i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ()); |
457 |
i.WriteHtolsbU16 (static_cast<uint16_t> (m_beaconInterval / 1024)); |
409 |
i.WriteHtolsbU16 (static_cast<uint16_t> (m_beaconInterval / 1024)); |
458 |
i = m_capability.Serialize (i); |
410 |
i = m_capability.Serialize (i); |
459 |
i = m_ssid.Serialize (i); |
411 |
i = m_ssid.Serialize (i); |
460 |
i = m_rates.Serialize (i); |
412 |
i = m_rates.Serialize (i); |
461 |
i = m_cfParameterSet.Serialize (i); |
|
|
462 |
i = m_dsssParameterSet.Serialize (i); |
463 |
i = m_erpInformation.Serialize (i); |
464 |
i = m_rates.extended.Serialize (i); |
413 |
i = m_rates.extended.Serialize (i); |
465 |
i = m_edcaParameterSet.Serialize (i); |
414 |
i = SerializeInformationElements (i); |
466 |
i = m_extendedCapability.Serialize (i); |
|
|
467 |
i = m_htCapability.Serialize (i); |
468 |
i = m_htOperation.Serialize (i); |
469 |
i = m_vhtCapability.Serialize (i); |
470 |
i = m_vhtOperation.Serialize (i); |
471 |
i = m_heCapability.Serialize (i); |
472 |
i = m_heOperation.Serialize (i); |
473 |
} |
415 |
} |
474 |
|
416 |
|
475 |
uint32_t |
417 |
uint32_t |
|
482 |
i = m_capability.Deserialize (i); |
424 |
i = m_capability.Deserialize (i); |
483 |
i = m_ssid.Deserialize (i); |
425 |
i = m_ssid.Deserialize (i); |
484 |
i = m_rates.Deserialize (i); |
426 |
i = m_rates.Deserialize (i); |
485 |
i = m_cfParameterSet.DeserializeIfPresent (i); |
|
|
486 |
i = m_dsssParameterSet.DeserializeIfPresent (i); |
487 |
i = m_erpInformation.DeserializeIfPresent (i); |
488 |
i = m_rates.extended.DeserializeIfPresent (i); |
427 |
i = m_rates.extended.DeserializeIfPresent (i); |
489 |
i = m_edcaParameterSet.DeserializeIfPresent (i); |
428 |
i = DeserializeInformationElements (i); |
490 |
i = m_extendedCapability.DeserializeIfPresent (i); |
|
|
491 |
i = m_htCapability.DeserializeIfPresent (i); |
492 |
i = m_htOperation.DeserializeIfPresent (i); |
493 |
i = m_vhtCapability.DeserializeIfPresent (i); |
494 |
i = m_vhtOperation.DeserializeIfPresent (i); |
495 |
i = m_heCapability.DeserializeIfPresent (i); |
496 |
i = m_heOperation.DeserializeIfPresent (i); |
497 |
return i.GetDistanceFrom (start); |
429 |
return i.GetDistanceFrom (start); |
498 |
} |
430 |
} |
499 |
|
431 |
|
|
518 |
|
450 |
|
519 |
|
451 |
|
520 |
/*********************************************************** |
452 |
/*********************************************************** |
521 |
* Assoc Request |
453 |
* Assoc Request |
522 |
***********************************************************/ |
454 |
***********************************************************/ |
523 |
|
455 |
|
524 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader); |
456 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocRequestHeader); |
|
562 |
return m_capability; |
494 |
return m_capability; |
563 |
} |
495 |
} |
564 |
|
496 |
|
565 |
void |
|
|
566 |
MgtAssocRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities) |
567 |
{ |
568 |
m_extendedCapability = extendedcapabilities; |
569 |
} |
570 |
|
571 |
ExtendedCapabilities |
572 |
MgtAssocRequestHeader::GetExtendedCapabilities (void) const |
573 |
{ |
574 |
return m_extendedCapability; |
575 |
} |
576 |
|
577 |
void |
578 |
MgtAssocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities) |
579 |
{ |
580 |
m_htCapability = htcapabilities; |
581 |
} |
582 |
|
583 |
HtCapabilities |
584 |
MgtAssocRequestHeader::GetHtCapabilities (void) const |
585 |
{ |
586 |
return m_htCapability; |
587 |
} |
588 |
|
589 |
void |
590 |
MgtAssocRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities) |
591 |
{ |
592 |
m_vhtCapability = vhtcapabilities; |
593 |
} |
594 |
|
595 |
VhtCapabilities |
596 |
MgtAssocRequestHeader::GetVhtCapabilities (void) const |
597 |
{ |
598 |
return m_vhtCapability; |
599 |
} |
600 |
|
601 |
void |
602 |
MgtAssocRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities) |
603 |
{ |
604 |
m_heCapability = hecapabilities; |
605 |
} |
606 |
|
607 |
HeCapabilities |
608 |
MgtAssocRequestHeader::GetHeCapabilities (void) const |
609 |
{ |
610 |
return m_heCapability; |
611 |
} |
612 |
|
613 |
Ssid |
497 |
Ssid |
614 |
MgtAssocRequestHeader::GetSsid (void) const |
498 |
MgtAssocRequestHeader::GetSsid (void) const |
615 |
{ |
499 |
{ |
|
654 |
size += m_ssid.GetSerializedSize (); |
538 |
size += m_ssid.GetSerializedSize (); |
655 |
size += m_rates.GetSerializedSize (); |
539 |
size += m_rates.GetSerializedSize (); |
656 |
size += m_rates.extended.GetSerializedSize (); |
540 |
size += m_rates.extended.GetSerializedSize (); |
657 |
size += m_extendedCapability.GetSerializedSize (); |
541 |
size += GetInformationElementsSerializedSize (); |
658 |
size += m_htCapability.GetSerializedSize (); |
|
|
659 |
size += m_vhtCapability.GetSerializedSize (); |
660 |
size += m_heCapability.GetSerializedSize (); |
661 |
return size; |
542 |
return size; |
662 |
} |
543 |
} |
663 |
|
544 |
|
664 |
void |
545 |
void |
665 |
MgtAssocRequestHeader::Print (std::ostream &os) const |
546 |
MgtAssocRequestHeader::Print (std::ostream &os) const |
666 |
{ |
547 |
{ |
667 |
os << "ssid=" << m_ssid << ", " |
548 |
os << "ssid=" << m_ssid << ", " |
668 |
<< "rates=" << m_rates << ", " |
549 |
<< "rates=" << m_rates << ", "; |
669 |
<< "Extended Capabilities=" << m_extendedCapability << " , " |
550 |
PrintInformationElements (os); |
670 |
<< "HT Capabilities=" << m_htCapability << " , " |
|
|
671 |
<< "VHT Capabilities=" << m_vhtCapability << " , " |
672 |
<< "HE Capabilities=" << m_heCapability; |
673 |
} |
551 |
} |
674 |
|
552 |
|
675 |
void |
553 |
void |
|
681 |
i = m_ssid.Serialize (i); |
559 |
i = m_ssid.Serialize (i); |
682 |
i = m_rates.Serialize (i); |
560 |
i = m_rates.Serialize (i); |
683 |
i = m_rates.extended.Serialize (i); |
561 |
i = m_rates.extended.Serialize (i); |
684 |
i = m_extendedCapability.Serialize (i); |
562 |
i = SerializeInformationElements (i); |
685 |
i = m_htCapability.Serialize (i); |
|
|
686 |
i = m_vhtCapability.Serialize (i); |
687 |
i = m_heCapability.Serialize (i); |
688 |
} |
563 |
} |
689 |
|
564 |
|
690 |
uint32_t |
565 |
uint32_t |
|
696 |
i = m_ssid.Deserialize (i); |
571 |
i = m_ssid.Deserialize (i); |
697 |
i = m_rates.Deserialize (i); |
572 |
i = m_rates.Deserialize (i); |
698 |
i = m_rates.extended.DeserializeIfPresent (i); |
573 |
i = m_rates.extended.DeserializeIfPresent (i); |
699 |
i = m_extendedCapability.DeserializeIfPresent (i); |
574 |
i = DeserializeInformationElements (i); |
700 |
i = m_htCapability.DeserializeIfPresent (i); |
|
|
701 |
i = m_vhtCapability.DeserializeIfPresent (i); |
702 |
i = m_heCapability.DeserializeIfPresent (i); |
703 |
return i.GetDistanceFrom (start); |
575 |
return i.GetDistanceFrom (start); |
704 |
} |
576 |
} |
705 |
|
577 |
|
706 |
|
578 |
|
707 |
/*********************************************************** |
579 |
/*********************************************************** |
708 |
* Ressoc Request |
580 |
* Ressoc Request |
709 |
***********************************************************/ |
581 |
***********************************************************/ |
710 |
|
582 |
|
711 |
NS_OBJECT_ENSURE_REGISTERED (MgtReassocRequestHeader); |
583 |
NS_OBJECT_ENSURE_REGISTERED (MgtReassocRequestHeader); |
|
749 |
return m_capability; |
621 |
return m_capability; |
750 |
} |
622 |
} |
751 |
|
623 |
|
752 |
void |
|
|
753 |
MgtReassocRequestHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities) |
754 |
{ |
755 |
m_extendedCapability = extendedcapabilities; |
756 |
} |
757 |
|
758 |
ExtendedCapabilities |
759 |
MgtReassocRequestHeader::GetExtendedCapabilities (void) const |
760 |
{ |
761 |
return m_extendedCapability; |
762 |
} |
763 |
|
764 |
void |
765 |
MgtReassocRequestHeader::SetHtCapabilities (HtCapabilities htcapabilities) |
766 |
{ |
767 |
m_htCapability = htcapabilities; |
768 |
} |
769 |
|
770 |
HtCapabilities |
771 |
MgtReassocRequestHeader::GetHtCapabilities (void) const |
772 |
{ |
773 |
return m_htCapability; |
774 |
} |
775 |
|
776 |
void |
777 |
MgtReassocRequestHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities) |
778 |
{ |
779 |
m_vhtCapability = vhtcapabilities; |
780 |
} |
781 |
|
782 |
VhtCapabilities |
783 |
MgtReassocRequestHeader::GetVhtCapabilities (void) const |
784 |
{ |
785 |
return m_vhtCapability; |
786 |
} |
787 |
|
788 |
void |
789 |
MgtReassocRequestHeader::SetHeCapabilities (HeCapabilities hecapabilities) |
790 |
{ |
791 |
m_heCapability = hecapabilities; |
792 |
} |
793 |
|
794 |
HeCapabilities |
795 |
MgtReassocRequestHeader::GetHeCapabilities (void) const |
796 |
{ |
797 |
return m_heCapability; |
798 |
} |
799 |
|
800 |
Ssid |
624 |
Ssid |
801 |
MgtReassocRequestHeader::GetSsid (void) const |
625 |
MgtReassocRequestHeader::GetSsid (void) const |
802 |
{ |
626 |
{ |
|
848 |
size += m_ssid.GetSerializedSize (); |
672 |
size += m_ssid.GetSerializedSize (); |
849 |
size += m_rates.GetSerializedSize (); |
673 |
size += m_rates.GetSerializedSize (); |
850 |
size += m_rates.extended.GetSerializedSize (); |
674 |
size += m_rates.extended.GetSerializedSize (); |
851 |
size += m_extendedCapability.GetSerializedSize (); |
675 |
size += GetInformationElementsSerializedSize (); |
852 |
size += m_htCapability.GetSerializedSize (); |
|
|
853 |
size += m_vhtCapability.GetSerializedSize (); |
854 |
size += m_heCapability.GetSerializedSize (); |
855 |
return size; |
676 |
return size; |
856 |
} |
677 |
} |
857 |
|
678 |
|
|
860 |
{ |
681 |
{ |
861 |
os << "current AP address=" << m_currentApAddr << ", " |
682 |
os << "current AP address=" << m_currentApAddr << ", " |
862 |
<< "ssid=" << m_ssid << ", " |
683 |
<< "ssid=" << m_ssid << ", " |
863 |
<< "rates=" << m_rates << ", " |
684 |
<< "rates=" << m_rates << ", "; |
864 |
<< "Extended Capabilities=" << m_extendedCapability << " , " |
685 |
PrintInformationElements (os); |
865 |
<< "HT Capabilities=" << m_htCapability << " , " |
|
|
866 |
<< "VHT Capabilities=" << m_vhtCapability << " , " |
867 |
<< "HE Capabilities=" << m_heCapability; |
868 |
} |
686 |
} |
869 |
|
687 |
|
870 |
void |
688 |
void |
|
877 |
i = m_ssid.Serialize (i); |
695 |
i = m_ssid.Serialize (i); |
878 |
i = m_rates.Serialize (i); |
696 |
i = m_rates.Serialize (i); |
879 |
i = m_rates.extended.Serialize (i); |
697 |
i = m_rates.extended.Serialize (i); |
880 |
i = m_extendedCapability.Serialize (i); |
698 |
i = SerializeInformationElements (i); |
881 |
i = m_htCapability.Serialize (i); |
|
|
882 |
i = m_vhtCapability.Serialize (i); |
883 |
i = m_heCapability.Serialize (i); |
884 |
} |
699 |
} |
885 |
|
700 |
|
886 |
uint32_t |
701 |
uint32_t |
|
893 |
i = m_ssid.Deserialize (i); |
708 |
i = m_ssid.Deserialize (i); |
894 |
i = m_rates.Deserialize (i); |
709 |
i = m_rates.Deserialize (i); |
895 |
i = m_rates.extended.DeserializeIfPresent (i); |
710 |
i = m_rates.extended.DeserializeIfPresent (i); |
896 |
i = m_extendedCapability.DeserializeIfPresent (i); |
711 |
i = DeserializeInformationElements (i); |
897 |
i = m_htCapability.DeserializeIfPresent (i); |
|
|
898 |
i = m_vhtCapability.DeserializeIfPresent (i); |
899 |
i = m_heCapability.DeserializeIfPresent (i); |
900 |
return i.GetDistanceFrom (start); |
712 |
return i.GetDistanceFrom (start); |
901 |
} |
713 |
} |
902 |
|
714 |
|
903 |
|
715 |
|
904 |
/*********************************************************** |
716 |
/*********************************************************** |
905 |
* Assoc/Reassoc Response |
717 |
* Assoc/Reassoc Response |
906 |
***********************************************************/ |
718 |
***********************************************************/ |
907 |
|
719 |
|
908 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader); |
720 |
NS_OBJECT_ENSURE_REGISTERED (MgtAssocResponseHeader); |
|
952 |
return m_capability; |
764 |
return m_capability; |
953 |
} |
765 |
} |
954 |
|
766 |
|
955 |
void |
|
|
956 |
MgtAssocResponseHeader::SetExtendedCapabilities (ExtendedCapabilities extendedcapabilities) |
957 |
{ |
958 |
m_extendedCapability = extendedcapabilities; |
959 |
} |
960 |
|
961 |
ExtendedCapabilities |
962 |
MgtAssocResponseHeader::GetExtendedCapabilities (void) const |
963 |
{ |
964 |
return m_extendedCapability; |
965 |
} |
966 |
|
967 |
void |
968 |
MgtAssocResponseHeader::SetHtCapabilities (HtCapabilities htcapabilities) |
969 |
{ |
970 |
m_htCapability = htcapabilities; |
971 |
} |
972 |
|
973 |
HtCapabilities |
974 |
MgtAssocResponseHeader::GetHtCapabilities (void) const |
975 |
{ |
976 |
return m_htCapability; |
977 |
} |
978 |
|
979 |
void |
980 |
MgtAssocResponseHeader::SetHtOperation (HtOperation htoperation) |
981 |
{ |
982 |
m_htOperation = htoperation; |
983 |
} |
984 |
|
985 |
HtOperation |
986 |
MgtAssocResponseHeader::GetHtOperation (void) const |
987 |
{ |
988 |
return m_htOperation; |
989 |
} |
990 |
|
991 |
void |
992 |
MgtAssocResponseHeader::SetVhtCapabilities (VhtCapabilities vhtcapabilities) |
993 |
{ |
994 |
m_vhtCapability = vhtcapabilities; |
995 |
} |
996 |
|
997 |
VhtCapabilities |
998 |
MgtAssocResponseHeader::GetVhtCapabilities (void) const |
999 |
{ |
1000 |
return m_vhtCapability; |
1001 |
} |
1002 |
|
1003 |
void |
1004 |
MgtAssocResponseHeader::SetVhtOperation (VhtOperation vhtoperation) |
1005 |
{ |
1006 |
m_vhtOperation = vhtoperation; |
1007 |
} |
1008 |
|
1009 |
VhtOperation |
1010 |
MgtAssocResponseHeader::GetVhtOperation (void) const |
1011 |
{ |
1012 |
return m_vhtOperation; |
1013 |
} |
1014 |
|
1015 |
void |
1016 |
MgtAssocResponseHeader::SetHeCapabilities (HeCapabilities hecapabilities) |
1017 |
{ |
1018 |
m_heCapability = hecapabilities; |
1019 |
} |
1020 |
|
1021 |
HeCapabilities |
1022 |
MgtAssocResponseHeader::GetHeCapabilities (void) const |
1023 |
{ |
1024 |
return m_heCapability; |
1025 |
} |
1026 |
|
1027 |
void |
1028 |
MgtAssocResponseHeader::SetHeOperation (HeOperation heoperation) |
1029 |
{ |
1030 |
m_heOperation = heoperation; |
1031 |
} |
1032 |
|
1033 |
HeOperation |
1034 |
MgtAssocResponseHeader::GetHeOperation (void) const |
1035 |
{ |
1036 |
return m_heOperation; |
1037 |
} |
1038 |
|
1039 |
void |
1040 |
MgtAssocResponseHeader::SetErpInformation (ErpInformation erpInformation) |
1041 |
{ |
1042 |
m_erpInformation = erpInformation; |
1043 |
} |
1044 |
|
1045 |
ErpInformation |
1046 |
MgtAssocResponseHeader::GetErpInformation (void) const |
1047 |
{ |
1048 |
return m_erpInformation; |
1049 |
} |
1050 |
|
1051 |
void |
1052 |
MgtAssocResponseHeader::SetEdcaParameterSet (EdcaParameterSet edcaparameters) |
1053 |
{ |
1054 |
m_edcaParameterSet = edcaparameters; |
1055 |
} |
1056 |
|
1057 |
EdcaParameterSet |
1058 |
MgtAssocResponseHeader::GetEdcaParameterSet (void) const |
1059 |
{ |
1060 |
return m_edcaParameterSet; |
1061 |
} |
1062 |
|
1063 |
TypeId |
767 |
TypeId |
1064 |
MgtAssocResponseHeader::GetTypeId (void) |
768 |
MgtAssocResponseHeader::GetTypeId (void) |
1065 |
{ |
769 |
{ |
|
1085 |
size += m_code.GetSerializedSize (); |
789 |
size += m_code.GetSerializedSize (); |
1086 |
size += 2; //aid |
790 |
size += 2; //aid |
1087 |
size += m_rates.GetSerializedSize (); |
791 |
size += m_rates.GetSerializedSize (); |
1088 |
size += m_erpInformation.GetSerializedSize (); |
|
|
1089 |
size += m_rates.extended.GetSerializedSize (); |
792 |
size += m_rates.extended.GetSerializedSize (); |
1090 |
size += m_edcaParameterSet.GetSerializedSize (); |
793 |
size += GetInformationElementsSerializedSize (); |
1091 |
size += m_extendedCapability.GetSerializedSize (); |
|
|
1092 |
size += m_htCapability.GetSerializedSize (); |
1093 |
size += m_htOperation.GetSerializedSize (); |
1094 |
size += m_vhtCapability.GetSerializedSize (); |
1095 |
size += m_vhtOperation.GetSerializedSize (); |
1096 |
size += m_heCapability.GetSerializedSize (); |
1097 |
size += m_heOperation.GetSerializedSize (); |
1098 |
return size; |
794 |
return size; |
1099 |
} |
795 |
} |
1100 |
|
796 |
|
|
1103 |
{ |
799 |
{ |
1104 |
os << "status code=" << m_code << ", " |
800 |
os << "status code=" << m_code << ", " |
1105 |
<< "aid=" << m_aid << ", " |
801 |
<< "aid=" << m_aid << ", " |
1106 |
<< "rates=" << m_rates << ", " |
802 |
<< "rates=" << m_rates << ", "; |
1107 |
<< "ERP information=" << m_erpInformation << ", " |
803 |
PrintInformationElements (os); |
1108 |
<< "Extended Capabilities=" << m_extendedCapability << " , " |
|
|
1109 |
<< "HT Capabilities=" << m_htCapability << " , " |
1110 |
<< "HT Operation=" << m_htOperation << " , " |
1111 |
<< "VHT Capabilities=" << m_vhtCapability << " , " |
1112 |
<< "VHT Operation=" << m_vhtOperation << " , " |
1113 |
<< "HE Capabilities=" << m_heCapability << " , " |
1114 |
<< "HE Operation=" << m_heOperation; |
1115 |
} |
804 |
} |
1116 |
|
805 |
|
1117 |
void |
806 |
void |
|
1122 |
i = m_code.Serialize (i); |
811 |
i = m_code.Serialize (i); |
1123 |
i.WriteHtolsbU16 (m_aid); |
812 |
i.WriteHtolsbU16 (m_aid); |
1124 |
i = m_rates.Serialize (i); |
813 |
i = m_rates.Serialize (i); |
1125 |
i = m_erpInformation.Serialize (i); |
|
|
1126 |
i = m_rates.extended.Serialize (i); |
814 |
i = m_rates.extended.Serialize (i); |
1127 |
i = m_edcaParameterSet.Serialize (i); |
815 |
i = SerializeInformationElements (i); |
1128 |
i = m_extendedCapability.Serialize (i); |
|
|
1129 |
i = m_htCapability.Serialize (i); |
1130 |
i = m_htOperation.Serialize (i); |
1131 |
i = m_vhtCapability.Serialize (i); |
1132 |
i = m_vhtOperation.Serialize (i); |
1133 |
i = m_heCapability.Serialize (i); |
1134 |
i = m_heOperation.Serialize (i); |
1135 |
} |
816 |
} |
1136 |
|
817 |
|
1137 |
uint32_t |
818 |
uint32_t |
|
1142 |
i = m_code.Deserialize (i); |
823 |
i = m_code.Deserialize (i); |
1143 |
m_aid = i.ReadLsbtohU16 (); |
824 |
m_aid = i.ReadLsbtohU16 (); |
1144 |
i = m_rates.Deserialize (i); |
825 |
i = m_rates.Deserialize (i); |
1145 |
i = m_erpInformation.DeserializeIfPresent (i); |
|
|
1146 |
i = m_rates.extended.DeserializeIfPresent (i); |
826 |
i = m_rates.extended.DeserializeIfPresent (i); |
1147 |
i = m_edcaParameterSet.DeserializeIfPresent (i); |
827 |
i = DeserializeInformationElements (i); |
1148 |
i = m_extendedCapability.DeserializeIfPresent (i); |
|
|
1149 |
i = m_htCapability.DeserializeIfPresent (i); |
1150 |
i = m_htOperation.DeserializeIfPresent (i); |
1151 |
i = m_vhtCapability.DeserializeIfPresent (i); |
1152 |
i = m_vhtOperation.DeserializeIfPresent (i); |
1153 |
i = m_heCapability.DeserializeIfPresent (i); |
1154 |
i = m_heOperation.DeserializeIfPresent (i); |
1155 |
return i.GetDistanceFrom (start); |
828 |
return i.GetDistanceFrom (start); |
1156 |
} |
829 |
} |
1157 |
|
830 |
|
1158 |
|
831 |
|
1159 |
/********************************************************** |
832 |
/********************************************************** |
1160 |
* ActionFrame |
833 |
* ActionFrame |
1161 |
**********************************************************/ |
834 |
**********************************************************/ |
1162 |
WifiActionHeader::WifiActionHeader () |
835 |
WifiActionHeader::WifiActionHeader () |
1163 |
{ |
836 |
{ |