A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
reduced-neighbor-report.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Universita' degli Studi di Napoli Federico II
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Stefano Avallone <stavallo@unina.it>
7 */
8
10
12
13#include "ns3/abort.h"
14#include "ns3/address-utils.h"
15
16#include <iterator>
17
18namespace ns3
19{
20
24
30
31std::size_t
36
37void
42
43void
45 const WifiPhyOperatingChannel& channel)
46{
47 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
48
49 uint8_t operatingClass = 0;
50 uint8_t channelNumber = channel.GetNumber();
51
52 // Information taken from Table E-4 of 802.11-2020
53 switch (channel.GetPhyBand())
54 {
56 if (channel.GetWidth() == 20)
57 {
58 operatingClass = 81;
59 }
60 else if (channel.GetWidth() == 40)
61 {
62 operatingClass = 83;
63 }
64 break;
66 if (channel.GetWidth() == 20)
67 {
68 if (channelNumber == 36 || channelNumber == 40 || channelNumber == 44 ||
69 channelNumber == 48)
70 {
71 operatingClass = 115;
72 }
73 else if (channelNumber == 52 || channelNumber == 56 || channelNumber == 60 ||
74 channelNumber == 64)
75 {
76 operatingClass = 118;
77 }
78 else if (channelNumber == 100 || channelNumber == 104 || channelNumber == 108 ||
79 channelNumber == 112 || channelNumber == 116 || channelNumber == 120 ||
80 channelNumber == 124 || channelNumber == 128 || channelNumber == 132 ||
81 channelNumber == 136 || channelNumber == 140 || channelNumber == 144)
82 {
83 operatingClass = 121;
84 }
85 else if (channelNumber == 149 || channelNumber == 153 || channelNumber == 157 ||
86 channelNumber == 161 || channelNumber == 165 || channelNumber == 169 ||
87 channelNumber == 173 || channelNumber == 177 || channelNumber == 181)
88 {
89 operatingClass = 125;
90 }
91 }
92 else if (channel.GetWidth() == 40)
93 {
94 if (channelNumber == 38 || channelNumber == 46)
95 {
96 operatingClass = 116;
97 }
98 else if (channelNumber == 54 || channelNumber == 62)
99 {
100 operatingClass = 119;
101 }
102 else if (channelNumber == 102 || channelNumber == 110 || channelNumber == 118 ||
103 channelNumber == 126 || channelNumber == 134 || channelNumber == 142)
104 {
105 operatingClass = 122;
106 }
107 else if (channelNumber == 151 || channelNumber == 159 || channelNumber == 167 ||
108 channelNumber == 175)
109 {
110 operatingClass = 126;
111 }
112 }
113 else if (channel.GetWidth() == 80)
114 {
115 if (channelNumber == 42 || channelNumber == 58 || channelNumber == 106 ||
116 channelNumber == 122 || channelNumber == 138 || channelNumber == 155 ||
117 channelNumber == 171)
118 {
119 operatingClass = 128;
120 }
121 }
122 else if (channel.GetWidth() == 160)
123 {
124 if (channelNumber == 50 || channelNumber == 114 || channelNumber == 163)
125 {
126 operatingClass = 129;
127 }
128 }
129 break;
131 if (channel.GetWidth() == 20)
132 {
133 operatingClass = 131;
134 }
135 else if (channel.GetWidth() == 40)
136 {
137 operatingClass = 132;
138 }
139 else if (channel.GetWidth() == 80)
140 {
141 operatingClass = 133;
142 }
143 else if (channel.GetWidth() == 160)
144 {
145 operatingClass = 134;
146 }
147 break;
149 default:
150 NS_ABORT_MSG("The provided channel has an unspecified PHY band");
151 break;
152 }
153
154 NS_ABORT_MSG_IF(operatingClass == 0,
155 "Operating class not found for channel number "
156 << channelNumber << " width " << channel.GetWidth() << " MHz "
157 << "band " << channel.GetPhyBand());
158
159 // find the primary channel number
160 MHz_u startingFreq = 0;
161
162 switch (channel.GetPhyBand())
163 {
165 startingFreq = 2407;
166 break;
168 startingFreq = 5000;
169 break;
171 startingFreq = 5950;
172 break;
174 default:
175 NS_ABORT_MSG("The provided channel has an unspecified PHY band");
176 break;
177 }
178
179 uint8_t primaryChannelNumber =
180 (channel.GetPrimaryChannelCenterFrequency(20) - startingFreq) / 5;
181
182 m_nbrApInfoFields.at(nbrApInfoId).operatingClass = operatingClass;
183 m_nbrApInfoFields.at(nbrApInfoId).channelNumber = primaryChannelNumber;
184}
185
187ReducedNeighborReport::GetOperatingChannel(std::size_t nbrApInfoId) const
188{
189 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
190
192 MHz_u width = 0;
193
194 switch (m_nbrApInfoFields.at(nbrApInfoId).operatingClass)
195 {
196 case 81:
198 width = 20;
199 break;
200 case 83:
202 width = 40;
203 break;
204 case 115:
205 case 118:
206 case 121:
207 case 125:
208 band = WIFI_PHY_BAND_5GHZ;
209 width = 20;
210 break;
211 case 116:
212 case 119:
213 case 122:
214 case 126:
215 band = WIFI_PHY_BAND_5GHZ;
216 width = 40;
217 break;
218 case 128:
219 band = WIFI_PHY_BAND_5GHZ;
220 width = 80;
221 break;
222 case 129:
223 band = WIFI_PHY_BAND_5GHZ;
224 width = 160;
225 break;
226 case 131:
227 band = WIFI_PHY_BAND_6GHZ;
228 width = 20;
229 break;
230 case 132:
231 band = WIFI_PHY_BAND_6GHZ;
232 width = 40;
233 break;
234 case 133:
235 band = WIFI_PHY_BAND_6GHZ;
236 width = 80;
237 break;
238 case 134:
239 band = WIFI_PHY_BAND_6GHZ;
240 width = 160;
241 break;
242 default:
243 break;
244 }
245
246 NS_ABORT_IF(band == WIFI_PHY_BAND_UNSPECIFIED || width == 0);
247
248 MHz_u startingFreq = 0;
249
250 switch (band)
251 {
253 startingFreq = 2407;
254 break;
256 startingFreq = 5000;
257 break;
259 startingFreq = 5950;
260 break;
262 default:
263 NS_ABORT_MSG("Unspecified band");
264 break;
265 }
266
267 uint8_t primaryChannelNumber = m_nbrApInfoFields.at(nbrApInfoId).channelNumber;
268 MHz_u primaryChannelCenterFrequency = startingFreq + primaryChannelNumber * 5;
269
270 uint8_t channelNumber = 0;
271 MHz_u frequency = 0;
272
273 for (const auto& channel : WifiPhyOperatingChannel::m_frequencyChannels)
274 {
275 if (channel.width == width && channel.type == FrequencyChannelType::OFDM &&
276 channel.band == band &&
277 primaryChannelCenterFrequency > (channel.frequency - (width / 2)) &&
278 primaryChannelCenterFrequency < (channel.frequency + (width / 2)))
279 {
280 // the center frequency of the primary channel falls into the frequency
281 // range of this channel
282 bool found = false;
283
284 if (band != WIFI_PHY_BAND_2_4GHZ)
285 {
286 found = true;
287 }
288 else
289 {
290 // frequency channels overlap in the 2.4 GHz band, hence we have to check
291 // that the given primary channel center frequency can be the center frequency
292 // of the primary20 channel of the channel under consideration
293 switch (static_cast<uint16_t>(width))
294 {
295 case 20:
296 if (channel.frequency == primaryChannelCenterFrequency)
297 {
298 found = true;
299 }
300 break;
301 case 40:
302 if ((channel.frequency == primaryChannelCenterFrequency + 10) ||
303 (channel.frequency == primaryChannelCenterFrequency - 10))
304 {
305 found = true;
306 }
307 break;
308 default:
309 NS_ABORT_MSG("No channel of width " << width << " MHz in the 2.4 GHz band");
310 }
311 }
312
313 if (found)
314 {
315 channelNumber = channel.number;
316 frequency = channel.frequency;
317 break;
318 }
319 }
320 }
321
322 NS_ABORT_IF(channelNumber == 0 || frequency == 0);
323
325 channel.Set({{channelNumber, frequency, width, band}}, WIFI_STANDARD_UNSPECIFIED);
326
327 MHz_u channelLowestFreq = frequency - width / 2;
328 MHz_u primaryChannelLowestFreq = primaryChannelCenterFrequency - 10;
329 channel.SetPrimary20Index((primaryChannelLowestFreq - channelLowestFreq) / 20);
330
331 return channel;
332}
333
334std::size_t
336{
337 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
338 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size();
339}
340
341void
343{
344 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
345 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.emplace_back();
346}
347
348void
350{
351 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
352
353 uint8_t length = 0; // reserved value
354
355 auto it = std::next(m_nbrApInfoFields.begin(), nbrApInfoId);
356
357 if (it->hasBssid && !it->hasShortSsid && !it->hasBssParams && !it->has20MHzPsd &&
358 !it->hasMldParams)
359 {
360 length = 7;
361 }
362 else if (it->hasBssid && it->hasShortSsid && it->hasBssParams && it->has20MHzPsd &&
363 it->hasMldParams)
364 {
365 length = 16;
366 }
367 else
368 {
369 NS_ABORT_MSG("Unsupported TBTT Information field contents");
370 }
371
372 // set the TBTT Information Length field
373 it->tbttInfoHdr.tbttInfoLength = length;
374}
375
376void
378{
379 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
380
381 auto it = std::next(m_nbrApInfoFields.begin(), nbrApInfoId);
382
383 switch (it->tbttInfoHdr.tbttInfoLength)
384 {
385 case 7:
386 it->hasBssid = true;
387 it->hasShortSsid = false;
388 it->hasBssParams = false;
389 it->has20MHzPsd = false;
390 it->hasMldParams = false;
391 break;
392 case 16:
393 it->hasBssid = true;
394 it->hasShortSsid = true;
395 it->hasBssParams = true;
396 it->has20MHzPsd = true;
397 it->hasMldParams = true;
398 break;
399 default:
401 "Unsupported TBTT Information Length value: " << it->tbttInfoHdr.tbttInfoLength);
402 }
403}
404
405void
406ReducedNeighborReport::SetBssid(std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid)
407{
408 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
409 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
410
411 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).bssid = bssid;
412
413 m_nbrApInfoFields.at(nbrApInfoId).hasBssid = true;
414}
415
416bool
417ReducedNeighborReport::HasBssid(std::size_t nbrApInfoId) const
418{
419 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
420
421 return m_nbrApInfoFields.at(nbrApInfoId).hasBssid;
422}
423
425ReducedNeighborReport::GetBssid(std::size_t nbrApInfoId, std::size_t index) const
426{
427 NS_ASSERT(HasBssid(nbrApInfoId));
428 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
429
430 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).bssid;
431}
432
433void
434ReducedNeighborReport::SetShortSsid(std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid)
435{
436 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
437 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
438
439 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).shortSsid = shortSsid;
440
441 m_nbrApInfoFields.at(nbrApInfoId).hasShortSsid = true;
442}
443
444bool
445ReducedNeighborReport::HasShortSsid(std::size_t nbrApInfoId) const
446{
447 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
448
449 return m_nbrApInfoFields.at(nbrApInfoId).hasShortSsid;
450}
451
453ReducedNeighborReport::GetShortSsid(std::size_t nbrApInfoId, std::size_t index) const
454{
455 NS_ASSERT(HasShortSsid(nbrApInfoId));
456 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
457
458 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).shortSsid;
459}
460
461void
463 std::size_t index,
464 uint8_t bssParameters)
465{
466 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
467 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
468
469 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).bssParameters = bssParameters;
470
471 m_nbrApInfoFields.at(nbrApInfoId).hasBssParams = true;
472}
473
474bool
475ReducedNeighborReport::HasBssParameters(std::size_t nbrApInfoId) const
476{
477 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
478
479 return m_nbrApInfoFields.at(nbrApInfoId).hasBssParams;
480}
481
482uint8_t
483ReducedNeighborReport::GetBssParameters(std::size_t nbrApInfoId, std::size_t index) const
484{
485 NS_ASSERT(HasBssParameters(nbrApInfoId));
486 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
487
488 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).bssParameters;
489}
490
491void
492ReducedNeighborReport::SetPsd20MHz(std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz)
493{
494 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
495 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
496
497 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).psd20MHz = psd20MHz;
498
499 m_nbrApInfoFields.at(nbrApInfoId).has20MHzPsd = true;
500}
501
502bool
503ReducedNeighborReport::HasPsd20MHz(std::size_t nbrApInfoId) const
504{
505 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
506
507 return m_nbrApInfoFields.at(nbrApInfoId).has20MHzPsd;
508}
509
510uint8_t
511ReducedNeighborReport::GetPsd20MHz(std::size_t nbrApInfoId, std::size_t index) const
512{
513 NS_ASSERT(HasPsd20MHz(nbrApInfoId));
514 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
515
516 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).psd20MHz;
517}
518
519void
521 std::size_t index,
522 uint8_t mldId,
523 uint8_t linkId,
524 uint8_t changeCount)
525{
526 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
527 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
528
529 auto it = std::next(m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.begin(), index);
530 it->mldParameters.mldId = mldId;
531 it->mldParameters.linkId = (linkId & 0x0f);
532 it->mldParameters.bssParamsChangeCount = changeCount;
533
534 m_nbrApInfoFields.at(nbrApInfoId).hasMldParams = true;
535}
536
537bool
538ReducedNeighborReport::HasMldParameters(std::size_t nbrApInfoId) const
539{
540 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
541
542 return m_nbrApInfoFields.at(nbrApInfoId).hasMldParams;
543}
544
545uint8_t
546ReducedNeighborReport::GetMldId(std::size_t nbrApInfoId, std::size_t index) const
547{
548 NS_ASSERT(HasMldParameters(nbrApInfoId));
549 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
550
551 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).mldParameters.mldId;
552}
553
554uint8_t
555ReducedNeighborReport::GetLinkId(std::size_t nbrApInfoId, std::size_t index) const
556{
557 NS_ASSERT(HasMldParameters(nbrApInfoId));
558 NS_ASSERT(index < m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size());
559
560 return m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.at(index).mldParameters.linkId &
561 0x0f;
562}
563
564void
566{
567 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
568 NS_ASSERT(!m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.empty());
569
570 // set the TBTT Information Count field
571 m_nbrApInfoFields.at(nbrApInfoId).tbttInfoHdr.tbttInfoCount =
572 m_nbrApInfoFields.at(nbrApInfoId).tbttInformationSet.size() - 1;
573}
574
575uint8_t
577{
578 NS_ASSERT(nbrApInfoId < m_nbrApInfoFields.size());
579
580 return 1 + m_nbrApInfoFields.at(nbrApInfoId).tbttInfoHdr.tbttInfoCount;
581}
582
583uint16_t
585{
586 uint16_t size = 0;
587
588 for (const auto& neighborApInfo : m_nbrApInfoFields)
589 {
590 size += 4;
591
592 size += 1 * neighborApInfo.tbttInformationSet.size();
593
594 if (neighborApInfo.hasBssid)
595 {
596 size += 6 * neighborApInfo.tbttInformationSet.size();
597 }
598 if (neighborApInfo.hasShortSsid)
599 {
600 size += 4 * neighborApInfo.tbttInformationSet.size();
601 }
602 if (neighborApInfo.hasBssParams)
603 {
604 size += 1 * neighborApInfo.tbttInformationSet.size();
605 }
606 if (neighborApInfo.has20MHzPsd)
607 {
608 size += 1 * neighborApInfo.tbttInformationSet.size();
609 }
610 if (neighborApInfo.hasMldParams)
611 {
612 size += 3 * neighborApInfo.tbttInformationSet.size();
613 }
614 }
615
616 return size;
617}
618
619void
621{
622 for (std::size_t id = 0; id < m_nbrApInfoFields.size(); ++id)
623 {
626 }
627
628 for (auto& neighborApInfo : m_nbrApInfoFields)
629 {
630 // serialize the TBTT Information Header
631 uint16_t tbttInfoHdr = 0;
632 tbttInfoHdr |= neighborApInfo.tbttInfoHdr.type;
633 tbttInfoHdr |= (neighborApInfo.tbttInfoHdr.filtered << 2);
634 tbttInfoHdr |= (neighborApInfo.tbttInfoHdr.tbttInfoCount << 4);
635 tbttInfoHdr |= (neighborApInfo.tbttInfoHdr.tbttInfoLength << 8);
636 start.WriteHtolsbU16(tbttInfoHdr);
637
638 start.WriteU8(neighborApInfo.operatingClass);
639 start.WriteU8(neighborApInfo.channelNumber);
640
641 for (const auto& tbttInformation : neighborApInfo.tbttInformationSet)
642 {
643 start.WriteU8(tbttInformation.neighborApTbttOffset);
644
645 if (neighborApInfo.hasBssid)
646 {
647 WriteTo(start, tbttInformation.bssid);
648 }
649 if (neighborApInfo.hasShortSsid)
650 {
651 start.WriteHtolsbU32(tbttInformation.shortSsid);
652 }
653 if (neighborApInfo.hasBssParams)
654 {
655 start.WriteU8(tbttInformation.bssParameters);
656 }
657 if (neighborApInfo.has20MHzPsd)
658 {
659 start.WriteU8(tbttInformation.psd20MHz);
660 }
661 if (neighborApInfo.hasMldParams)
662 {
663 start.WriteU8(tbttInformation.mldParameters.mldId);
664 uint16_t other = 0;
665 other |= (tbttInformation.mldParameters.linkId & 0x0f);
666 other |= (tbttInformation.mldParameters.bssParamsChangeCount << 4);
667 start.WriteHtolsbU16(other);
668 }
669 }
670 }
671}
672
673uint16_t
675{
676 Buffer::Iterator i = start;
677 uint16_t count = 0;
678
679 while (count < length)
680 {
682
683 auto tbttInfoHdr = i.ReadLsbtohU16();
684 m_nbrApInfoFields.back().tbttInfoHdr.type = tbttInfoHdr & 0x0003;
685 m_nbrApInfoFields.back().tbttInfoHdr.filtered = (tbttInfoHdr >> 2) & 0x0001;
686 m_nbrApInfoFields.back().tbttInfoHdr.tbttInfoCount = (tbttInfoHdr >> 4) & 0x000f;
687 m_nbrApInfoFields.back().tbttInfoHdr.tbttInfoLength = (tbttInfoHdr >> 8) & 0x00ff;
688
689 m_nbrApInfoFields.back().operatingClass = i.ReadU8();
690 m_nbrApInfoFields.back().channelNumber = i.ReadU8();
691 count += 4;
692
693 std::size_t neighborId = m_nbrApInfoFields.size() - 1;
694 ReadTbttInformationLength(neighborId);
695
696 for (uint8_t j = 0; j < ReadTbttInformationCount(neighborId); j++)
697 {
698 AddTbttInformationField(neighborId);
699
700 m_nbrApInfoFields.back().tbttInformationSet.back().neighborApTbttOffset = i.ReadU8();
701 count++;
702
703 if (m_nbrApInfoFields.back().hasBssid)
704 {
705 ReadFrom(i, m_nbrApInfoFields.back().tbttInformationSet.back().bssid);
706 count += 6;
707 }
708 if (m_nbrApInfoFields.back().hasShortSsid)
709 {
710 m_nbrApInfoFields.back().tbttInformationSet.back().shortSsid = i.ReadLsbtohU32();
711 count += 4;
712 }
713 if (m_nbrApInfoFields.back().hasBssParams)
714 {
715 m_nbrApInfoFields.back().tbttInformationSet.back().bssParameters = i.ReadU8();
716 count += 1;
717 }
718 if (m_nbrApInfoFields.back().has20MHzPsd)
719 {
720 m_nbrApInfoFields.back().tbttInformationSet.back().psd20MHz = i.ReadU8();
721 count += 1;
722 }
723 if (m_nbrApInfoFields.back().hasMldParams)
724 {
725 m_nbrApInfoFields.back().tbttInformationSet.back().mldParameters.mldId = i.ReadU8();
726 uint16_t other = i.ReadLsbtohU16();
727 count += 3;
728 m_nbrApInfoFields.back().tbttInformationSet.back().mldParameters.linkId =
729 other & 0x000f;
730 m_nbrApInfoFields.back()
731 .tbttInformationSet.back()
732 .mldParameters.bssParamsChangeCount = (other >> 4) & 0x00ff;
733 }
734 }
735 }
736
737 return count;
738}
739
740} // namespace ns3
iterator in a Buffer instance
Definition buffer.h:89
uint16_t ReadLsbtohU16()
Definition buffer.cc:1053
uint32_t ReadLsbtohU32()
Definition buffer.cc:1065
an EUI-48 address
void WriteTbttInformationLength(std::size_t nbrApInfoId) const
Set the TBTT Information Length field of the given Neighbor AP Information field based on the xxxPres...
Mac48Address GetBssid(std::size_t nbrApInfoId, std::size_t index) const
Get the BSSID field (must be present) in the i-th TBTT Information field of the given Neighbor AP Inf...
std::vector< NeighborApInformation > m_nbrApInfoFields
one or more Neighbor AP Information fields
void SerializeInformationField(Buffer::Iterator start) const override
Serialize information (i.e., the body of the IE, not including the Element ID and length octets)
bool HasShortSsid(std::size_t nbrApInfoId) const
Return true if the Short SSID field is present in all the TBTT Information fields of the given Neighb...
std::size_t GetNNbrApInfoFields() const
Get the number of Neighbor AP Information fields.
void WriteTbttInformationCount(std::size_t nbrApInfoId) const
Set the TBTT Information Count field of the given Neighbor AP Information field based on the size of ...
bool HasBssid(std::size_t nbrApInfoId) const
Return true if the BSSID field is present in all the TBTT Information fields of the given Neighbor AP...
uint8_t ReadTbttInformationCount(std::size_t nbrApInfoId) const
Get the TBTT Information Count field of the given Neighbor AP Information field.
void SetMldParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t mldId, uint8_t linkId, uint8_t changeSequence)
Set the MLD Parameters subfield of the i-th TBTT Information field of the given Neighbor AP Informati...
void SetShortSsid(std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid)
Set the Short SSID field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
uint32_t GetShortSsid(std::size_t nbrApInfoId, std::size_t index) const
Get the Short SSID field (must be present) in the i-th TBTT Information field of the given Neighbor A...
void SetBssid(std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid)
Set the BSSID field of the i-th TBTT Information field of the given Neighbor AP Information field.
std::size_t GetNTbttInformationFields(std::size_t nbrApInfoId) const
Get the number of TBTT Information fields included in the TBTT Information Set field of the given Nei...
uint8_t GetLinkId(std::size_t nbrApInfoId, std::size_t index) const
Get the Link ID value in the MLD Parameters subfield (must be present) in the i-th TBTT Information f...
uint8_t GetMldId(std::size_t nbrApInfoId, std::size_t index) const
Get the MLD ID value in the MLD Parameters subfield (must be present) in the i-th TBTT Information fi...
void SetPsd20MHz(std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz)
Set the 20 MHz PSD field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
WifiInformationElementId ElementId() const override
Get the wifi information element ID.
void AddNbrApInfoField()
Add a Neighbor AP Information field.
WifiPhyOperatingChannel GetOperatingChannel(std::size_t nbrApInfoId) const
Get the operating channel coded into the Operating Class and the Channel Number fields of the given N...
void SetBssParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t bssParameters)
Set the BSS Parameters field of the i-th TBTT Information field of the given Neighbor AP Information ...
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 GetPsd20MHz(std::size_t nbrApInfoId, std::size_t index) const
Get the 20 MHz PSD field (must be present) in the i-th TBTT Information field of the given Neighbor A...
bool HasMldParameters(std::size_t nbrApInfoId) const
Return true if the MLD Parameters subfield is present in all the TBTT Information fields of the given...
void AddTbttInformationField(std::size_t nbrApInfoId)
Add a TBTT Information fields to the TBTT Information Set field of the given Neighbor AP Information ...
void ReadTbttInformationLength(std::size_t nbrApInfoId)
Use the TBTT Information Length field of the given Neighbor AP Information field to set the xxxPresen...
bool HasBssParameters(std::size_t nbrApInfoId) const
Return true if the BSS Parameters field is present in all the TBTT Information fields of the given Ne...
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 SetOperatingChannel(std::size_t nbrApInfoId, const WifiPhyOperatingChannel &channel)
Set the Operating Class and the Channel Number fields of the given Neighbor AP Information field base...
bool HasPsd20MHz(std::size_t nbrApInfoId) const
Return true if the 20 MHz PSD field is present in all the TBTT Information fields of the given Neighb...
uint8_t GetBssParameters(std::size_t nbrApInfoId, std::size_t index) const
Get the BSS Parameters field (must be present) in the i-th TBTT Information field of the given Neighb...
Class that keeps track of all information about the current PHY operating channel.
static const std::set< FrequencyChannelInfo > m_frequencyChannels
Available frequency channels.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition abort.h:38
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition abort.h:97
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
Definition abort.h:65
WifiPhyBand
Identifies the PHY band.
@ WIFI_STANDARD_UNSPECIFIED
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_UNSPECIFIED
Unspecified.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
uint8_t WifiInformationElementId
This type is used to represent an Information Element ID.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
#define IE_REDUCED_NEIGHBOR_REPORT