A Discrete-Event Network Simulator
API
mgt-headers.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Mirko Banchi <mk.banchi@gmail.com>
20 */
21
22#include "mgt-headers.h"
23
24#include "ns3/address-utils.h"
25#include "ns3/simulator.h"
26
27namespace ns3
28{
29
30/***********************************************************
31 * Probe Request
32 ***********************************************************/
33
34NS_OBJECT_ENSURE_REGISTERED(MgtProbeRequestHeader);
35
37{
38}
39
40void
42{
43 m_ssid = ssid;
44}
45
46void
48{
49 m_ssid = std::move(ssid);
50}
51
52const Ssid&
54{
55 return m_ssid;
56}
57
58void
60{
61 m_rates = rates;
62}
63
64void
66{
67 m_rates = std::move(rates);
68}
69
70void
72{
73 m_extendedCapability = extendedCapabilities;
74}
75
76void
78{
79 m_extendedCapability = std::move(extendedCapabilities);
80}
81
82const std::optional<ExtendedCapabilities>&
84{
86}
87
88void
90{
91 m_htCapability = htCapabilities;
92}
93
94void
96{
97 m_htCapability = std::move(htCapabilities);
98}
99
100const std::optional<HtCapabilities>&
102{
103 return m_htCapability;
104}
105
106void
108{
109 m_vhtCapability = vhtCapabilities;
110}
111
112void
114{
115 m_vhtCapability = std::move(vhtCapabilities);
116}
117
118const std::optional<VhtCapabilities>&
120{
121 return m_vhtCapability;
122}
123
124void
126{
127 m_heCapability = heCapabilities;
128}
129
130void
132{
133 m_heCapability = std::move(heCapabilities);
134}
135
136const std::optional<HeCapabilities>&
138{
139 return m_heCapability;
140}
141
142void
144{
145 m_ehtCapability = ehtCapabilities;
146}
147
148void
150{
151 m_ehtCapability = std::move(ehtCapabilities);
152}
153
154const std::optional<EhtCapabilities>&
156{
157 return m_ehtCapability;
158}
159
160const SupportedRates&
162{
163 return m_rates;
164}
165
168{
169 uint32_t size = 0;
170 size += m_ssid.GetSerializedSize();
171 size += m_rates.GetSerializedSize();
172 if (m_rates.GetNRates() > 8)
173 {
174 size += m_rates.extended->GetSerializedSize();
175 }
176 if (m_extendedCapability.has_value())
177 {
178 size += m_extendedCapability->GetSerializedSize();
179 }
180 if (m_htCapability.has_value())
181 {
182 size += m_htCapability->GetSerializedSize();
183 }
184 if (m_vhtCapability.has_value())
185 {
186 size += m_vhtCapability->GetSerializedSize();
187 }
188 if (m_heCapability.has_value())
189 {
190 size += m_heCapability->GetSerializedSize();
191 }
192 if (m_ehtCapability.has_value())
193 {
194 size += m_ehtCapability->GetSerializedSize();
195 }
196 return size;
197}
198
199TypeId
201{
202 static TypeId tid = TypeId("ns3::MgtProbeRequestHeader")
203 .SetParent<Header>()
204 .SetGroupName("Wifi")
205 .AddConstructor<MgtProbeRequestHeader>();
206 return tid;
207}
208
209TypeId
211{
212 return GetTypeId();
213}
214
215void
216MgtProbeRequestHeader::Print(std::ostream& os) const
217{
218 os << "ssid=" << m_ssid << ", "
219 << "rates=" << m_rates << ", ";
220 if (m_extendedCapability.has_value())
221 {
222 os << "Extended Capabilities=" << *m_extendedCapability << " , ";
223 }
224 if (m_htCapability.has_value())
225 {
226 os << "HT Capabilities=" << *m_htCapability << " , ";
227 }
228 if (m_vhtCapability.has_value())
229 {
230 os << "VHT Capabilities=" << *m_vhtCapability << " , ";
231 }
232 if (m_heCapability.has_value())
233 {
234 os << "HE Capabilities=" << *m_heCapability << " , ";
235 }
236 if (m_ehtCapability.has_value())
237 {
238 os << "EHT Capabilities=" << *m_ehtCapability;
239 }
240}
241
242void
244{
246 i = m_ssid.Serialize(i);
247 i = m_rates.Serialize(i);
248 if (m_rates.GetNRates() > 8)
249 {
250 i = m_rates.extended->Serialize(i);
251 }
252 if (m_extendedCapability.has_value())
253 {
254 i = m_extendedCapability->Serialize(i);
255 }
256 if (m_htCapability.has_value())
257 {
258 i = m_htCapability->Serialize(i);
259 }
260 if (m_vhtCapability.has_value())
261 {
262 i = m_vhtCapability->Serialize(i);
263 }
264 if (m_heCapability.has_value())
265 {
266 i = m_heCapability->Serialize(i);
267 }
268 if (m_ehtCapability.has_value())
269 {
270 i = m_ehtCapability->Serialize(i);
271 }
272}
273
276{
278 i = m_ssid.Deserialize(i);
279 i = m_rates.Deserialize(i);
286 return i.GetDistanceFrom(start);
287}
288
289/***********************************************************
290 * Probe Response
291 ***********************************************************/
292
294
296{
297}
298
300{
301}
302
303uint64_t
305{
306 return m_timestamp;
307}
308
309const Ssid&
311{
312 return m_ssid;
313}
314
315uint64_t
317{
318 return m_beaconInterval;
319}
320
321const SupportedRates&
323{
324 return m_rates;
325}
326
327void
329{
330 m_capability = capabilities;
331}
332
333void
335{
336 m_capability = std::move(capabilities);
337}
338
341{
342 return m_capability;
343}
344
345void
347{
348 m_extendedCapability = extendedCapabilities;
349}
350
351void
353{
354 m_extendedCapability = std::move(extendedCapabilities);
355}
356
357const std::optional<ExtendedCapabilities>&
359{
361}
362
363void
365{
366 m_htCapability = htCapabilities;
367}
368
369void
371{
372 m_htCapability = std::move(htCapabilities);
373}
374
375const std::optional<HtCapabilities>&
377{
378 return m_htCapability;
379}
380
381void
383{
384 m_htOperation = htOperation;
385}
386
387void
389{
390 m_htOperation = std::move(htOperation);
391}
392
393const std::optional<HtOperation>&
395{
396 return m_htOperation;
397}
398
399void
401{
402 m_vhtCapability = vhtCapabilities;
403}
404
405void
407{
408 m_vhtCapability = std::move(vhtCapabilities);
409}
410
411const std::optional<VhtCapabilities>&
413{
414 return m_vhtCapability;
415}
416
417void
419{
420 m_vhtOperation = vhtOperation;
421}
422
423void
425{
426 m_vhtOperation = std::move(vhtOperation);
427}
428
429const std::optional<VhtOperation>&
431{
432 return m_vhtOperation;
433}
434
435void
437{
438 m_heCapability = heCapabilities;
439}
440
441void
443{
444 m_heCapability = std::move(heCapabilities);
445}
446
447const std::optional<HeCapabilities>&
449{
450 return m_heCapability;
451}
452
453void
455{
456 m_heOperation = heOperation;
457}
458
459void
461{
462 m_heOperation = std::move(heOperation);
463}
464
465const std::optional<HeOperation>&
467{
468 return m_heOperation;
469}
470
471void
473{
474 m_ehtCapability = ehtCapabilities;
475}
476
477void
479{
480 m_ehtCapability = std::move(ehtCapabilities);
481}
482
483const std::optional<EhtCapabilities>&
485{
486 return m_ehtCapability;
487}
488
489void
491{
492 m_ssid = ssid;
493}
494
495void
497{
498 m_ssid = std::move(ssid);
499}
500
501void
503{
504 m_beaconInterval = us;
505}
506
507void
509{
510 m_rates = rates;
511}
512
513void
515{
516 m_rates = std::move(rates);
517}
518
519void
521{
522 m_dsssParameterSet = dsssParameterSet;
523}
524
525void
527{
528 m_dsssParameterSet = std::move(dsssParameterSet);
529}
530
531const std::optional<DsssParameterSet>&
533{
534 return m_dsssParameterSet;
535}
536
537void
539{
540 m_erpInformation = erpInformation;
541}
542
543void
545{
546 m_erpInformation = std::move(erpInformation);
547}
548
549const std::optional<ErpInformation>&
551{
552 return m_erpInformation;
553}
554
555void
557{
558 m_edcaParameterSet = edcaParameters;
559}
560
561void
563{
564 m_edcaParameterSet = std::move(edcaParameters);
565}
566
567void
569{
570 m_muEdcaParameterSet = muEdcaParameters;
571}
572
573void
575{
576 m_muEdcaParameterSet = std::move(muEdcaParameters);
577}
578
579void
581{
582 m_reducedNeighborReport = reducedNeighborReport;
583}
584
585void
587{
588 m_reducedNeighborReport = std::move(reducedNeighborReport);
589}
590
591void
593{
594 m_multiLinkElement = multiLinkElement;
595}
596
597void
599{
600 m_multiLinkElement = std::move(multiLinkElement);
601}
602
603const std::optional<EdcaParameterSet>&
605{
606 return m_edcaParameterSet;
607}
608
609const std::optional<MuEdcaParameterSet>&
611{
613}
614
615const std::optional<ReducedNeighborReport>&
617{
619}
620
621const std::optional<MultiLinkElement>&
623{
624 return m_multiLinkElement;
625}
626
627TypeId
629{
630 static TypeId tid = TypeId("ns3::MgtProbeResponseHeader")
631 .SetParent<Header>()
632 .SetGroupName("Wifi")
633 .AddConstructor<MgtProbeResponseHeader>();
634 return tid;
635}
636
637TypeId
639{
640 return GetTypeId();
641}
642
645{
646 uint32_t size = 0;
647 size += 8; // timestamp
648 size += 2; // beacon interval
650 size += m_ssid.GetSerializedSize();
651 size += m_rates.GetSerializedSize();
652 if (m_dsssParameterSet.has_value())
653 {
654 size += m_dsssParameterSet->GetSerializedSize();
655 }
656 if (m_erpInformation.has_value())
657 {
658 size += m_erpInformation->GetSerializedSize();
659 }
660 if (m_rates.GetNRates() > 8)
661 {
662 size += m_rates.extended->GetSerializedSize();
663 }
664 if (m_edcaParameterSet.has_value())
665 {
666 size += m_edcaParameterSet->GetSerializedSize();
667 }
668 if (m_extendedCapability.has_value())
669 {
670 size += m_extendedCapability->GetSerializedSize();
671 }
672 if (m_htCapability.has_value())
673 {
674 size += m_htCapability->GetSerializedSize();
675 }
676 if (m_htOperation.has_value())
677 {
678 size += m_htOperation->GetSerializedSize();
679 }
680 if (m_vhtCapability.has_value())
681 {
682 size += m_vhtCapability->GetSerializedSize();
683 }
684 if (m_vhtOperation.has_value())
685 {
686 size += m_vhtOperation->GetSerializedSize();
687 }
688 if (m_reducedNeighborReport.has_value())
689 {
690 size += m_reducedNeighborReport->GetSerializedSize();
691 }
692 if (m_heCapability.has_value())
693 {
694 size += m_heCapability->GetSerializedSize();
695 }
696 if (m_heOperation.has_value())
697 {
698 size += m_heOperation->GetSerializedSize();
699 }
700 if (m_muEdcaParameterSet.has_value())
701 {
702 size += m_muEdcaParameterSet->GetSerializedSize();
703 }
704 if (m_multiLinkElement.has_value())
705 {
706 size += m_multiLinkElement->GetSerializedSize();
707 }
708 if (m_ehtCapability.has_value())
709 {
710 size += m_ehtCapability->GetSerializedSize();
711 }
712 return size;
713}
714
715void
716MgtProbeResponseHeader::Print(std::ostream& os) const
717{
718 os << "ssid=" << m_ssid << ", "
719 << "rates=" << m_rates << ", ";
720 if (m_erpInformation.has_value())
721 {
722 os << "ERP information=" << *m_erpInformation << ", ";
723 }
724 if (m_extendedCapability.has_value())
725 {
726 os << "Extended Capabilities=" << *m_extendedCapability << " , ";
727 }
728 if (m_htCapability.has_value())
729 {
730 os << "HT Capabilities=" << *m_htCapability << " , ";
731 }
732 if (m_htOperation.has_value())
733 {
734 os << "HT Operation=" << *m_htOperation << " , ";
735 }
736 if (m_vhtCapability.has_value())
737 {
738 os << "VHT Capabilities=" << *m_vhtCapability << " , ";
739 }
740 if (m_vhtOperation.has_value())
741 {
742 os << "VHT Operation=" << *m_vhtOperation << " , ";
743 }
744 if (m_heCapability.has_value())
745 {
746 os << "HE Capabilities=" << *m_heCapability << " , ";
747 }
748 if (m_heOperation.has_value())
749 {
750 os << "HE Operation=" << *m_heOperation << " , ";
751 }
752 if (m_ehtCapability.has_value())
753 {
754 os << "EHT Capabilities=" << *m_ehtCapability;
755 }
756}
757
758void
760{
762 i.WriteHtolsbU64(Simulator::Now().GetMicroSeconds());
763 i.WriteHtolsbU16(static_cast<uint16_t>(m_beaconInterval / 1024));
764 i = m_capability.Serialize(i);
765 i = m_ssid.Serialize(i);
766 i = m_rates.Serialize(i);
767 if (m_dsssParameterSet.has_value())
768 {
769 i = m_dsssParameterSet->Serialize(i);
770 }
771 if (m_erpInformation.has_value())
772 {
773 i = m_erpInformation->Serialize(i);
774 }
775 if (m_rates.GetNRates() > 8)
776 {
777 i = m_rates.extended->Serialize(i);
778 }
779 if (m_edcaParameterSet.has_value())
780 {
781 i = m_edcaParameterSet->Serialize(i);
782 }
783 if (m_extendedCapability.has_value())
784 {
785 i = m_extendedCapability->Serialize(i);
786 }
787 if (m_htCapability.has_value())
788 {
789 i = m_htCapability->Serialize(i);
790 }
791 if (m_htOperation.has_value())
792 {
793 i = m_htOperation->Serialize(i);
794 }
795 if (m_vhtCapability.has_value())
796 {
797 i = m_vhtCapability->Serialize(i);
798 }
799 if (m_vhtOperation.has_value())
800 {
801 i = m_vhtOperation->Serialize(i);
802 }
803 if (m_reducedNeighborReport.has_value())
804 {
805 i = m_reducedNeighborReport->Serialize(i);
806 }
807 if (m_heCapability.has_value())
808 {
809 i = m_heCapability->Serialize(i);
810 }
811 if (m_heOperation.has_value())
812 {
813 i = m_heOperation->Serialize(i);
814 }
815 if (m_muEdcaParameterSet.has_value())
816 {
817 i = m_muEdcaParameterSet->Serialize(i);
818 }
819 if (m_multiLinkElement.has_value())
820 {
821 i = m_multiLinkElement->Serialize(i);
822 }
823 if (m_ehtCapability.has_value())
824 {
825 i = m_ehtCapability->Serialize(i);
826 }
827}
828
831{
836 m_beaconInterval *= 1024;
838 i = m_ssid.Deserialize(i);
839 i = m_rates.Deserialize(i);
855
856 return i.GetDistanceFrom(start);
857}
858
859/***********************************************************
860 * Beacons
861 ***********************************************************/
862
864
865/* static */
866TypeId
868{
869 static TypeId tid = TypeId("ns3::MgtBeaconHeader")
871 .SetGroupName("Wifi")
872 .AddConstructor<MgtBeaconHeader>();
873 return tid;
874}
875
876/***********************************************************
877 * Assoc Request
878 ***********************************************************/
879
881
883 : m_listenInterval(0)
884{
885}
886
888{
889}
890
891void
893{
894 m_ssid = ssid;
895}
896
897void
899{
900 m_ssid = std::move(ssid);
901}
902
903void
905{
906 m_rates = rates;
907}
908
909void
911{
912 m_rates = std::move(rates);
913}
914
915void
917{
918 m_listenInterval = interval;
919}
920
921void
923{
924 m_capability = capabilities;
925}
926
927void
929{
930 m_capability = std::move(capabilities);
931}
932
935{
936 return m_capability;
937}
938
939void
941{
942 m_extendedCapability = extendedCapabilities;
943}
944
945void
947{
948 m_extendedCapability = std::move(extendedCapabilities);
949}
950
951const std::optional<ExtendedCapabilities>&
953{
955}
956
957void
959{
960 m_htCapability = htCapabilities;
961}
962
963void
965{
966 m_htCapability = std::move(htCapabilities);
967}
968
969const std::optional<HtCapabilities>&
971{
972 return m_htCapability;
973}
974
975void
977{
978 m_vhtCapability = vhtCapabilities;
979}
980
981void
983{
984 m_vhtCapability = std::move(vhtCapabilities);
985}
986
987const std::optional<VhtCapabilities>&
989{
990 return m_vhtCapability;
991}
992
993void
995{
996 m_heCapability = heCapabilities;
997}
998
999void
1001{
1002 m_heCapability = std::move(heCapabilities);
1003}
1004
1005const std::optional<HeCapabilities>&
1007{
1008 return m_heCapability;
1009}
1010
1011void
1013{
1014 m_ehtCapability = ehtCapabilities;
1015}
1016
1017void
1019{
1020 m_ehtCapability = std::move(ehtCapabilities);
1021}
1022
1023const std::optional<EhtCapabilities>&
1025{
1026 return m_ehtCapability;
1027}
1028
1029void
1031{
1032 m_multiLinkElement = multiLinkElement;
1033}
1034
1035void
1037{
1038 m_multiLinkElement = std::move(multiLinkElement);
1039}
1040
1041const std::optional<MultiLinkElement>&
1043{
1044 return m_multiLinkElement;
1045}
1046
1047const Ssid&
1049{
1050 return m_ssid;
1051}
1052
1053const SupportedRates&
1055{
1056 return m_rates;
1057}
1058
1059uint16_t
1061{
1062 return m_listenInterval;
1063}
1064
1065TypeId
1067{
1068 static TypeId tid = TypeId("ns3::MgtAssocRequestHeader")
1069 .SetParent<Header>()
1070 .SetGroupName("Wifi")
1071 .AddConstructor<MgtAssocRequestHeader>();
1072 return tid;
1073}
1074
1075TypeId
1077{
1078 return GetTypeId();
1079}
1080
1083{
1084 uint32_t size = 0;
1086 size += 2;
1087 size += m_ssid.GetSerializedSize();
1088 size += m_rates.GetSerializedSize();
1089 if (m_rates.GetNRates() > 8)
1090 {
1091 size += m_rates.extended->GetSerializedSize();
1092 }
1093 if (m_extendedCapability.has_value())
1094 {
1095 size += m_extendedCapability->GetSerializedSize();
1096 }
1097 if (m_htCapability.has_value())
1098 {
1099 size += m_htCapability->GetSerializedSize();
1100 }
1101 if (m_vhtCapability.has_value())
1102 {
1103 size += m_vhtCapability->GetSerializedSize();
1104 }
1105 if (m_heCapability.has_value())
1106 {
1107 size += m_heCapability->GetSerializedSize();
1108 }
1109 if (m_multiLinkElement.has_value())
1110 {
1111 size += m_multiLinkElement->GetSerializedSize();
1112 }
1113 if (m_ehtCapability.has_value())
1114 {
1115 size += m_ehtCapability->GetSerializedSize();
1116 }
1117 return size;
1118}
1119
1120void
1121MgtAssocRequestHeader::Print(std::ostream& os) const
1122{
1123 os << "ssid=" << m_ssid << ", "
1124 << "rates=" << m_rates << ", ";
1125 if (m_extendedCapability.has_value())
1126 {
1127 os << "Extended Capabilities=" << *m_extendedCapability << " , ";
1128 }
1129 if (m_htCapability.has_value())
1130 {
1131 os << "HT Capabilities=" << *m_htCapability << " , ";
1132 }
1133 if (m_vhtCapability.has_value())
1134 {
1135 os << "VHT Capabilities=" << *m_vhtCapability << " , ";
1136 }
1137 if (m_heCapability.has_value())
1138 {
1139 os << "HE Capabilities=" << *m_heCapability << " , ";
1140 }
1141 if (m_ehtCapability.has_value())
1142 {
1143 os << "EHT Capabilities=" << *m_ehtCapability;
1144 }
1145}
1146
1147void
1149{
1151 i = m_capability.Serialize(i);
1153 i = m_ssid.Serialize(i);
1154 i = m_rates.Serialize(i);
1155 if (m_rates.GetNRates() > 8)
1156 {
1157 i = m_rates.extended->Serialize(i);
1158 }
1159 if (m_extendedCapability.has_value())
1160 {
1161 i = m_extendedCapability->Serialize(i);
1162 }
1163 if (m_htCapability.has_value())
1164 {
1165 i = m_htCapability->Serialize(i);
1166 }
1167 if (m_vhtCapability.has_value())
1168 {
1169 i = m_vhtCapability->Serialize(i);
1170 }
1171 if (m_heCapability.has_value())
1172 {
1173 i = m_heCapability->Serialize(i);
1174 }
1175 if (m_multiLinkElement.has_value())
1176 {
1177 i = m_multiLinkElement->Serialize(i);
1178 }
1179 if (m_ehtCapability.has_value())
1180 {
1181 i = m_ehtCapability->Serialize(i);
1182 }
1183}
1184
1187{
1188 Buffer::Iterator tmp;
1192 i = m_ssid.Deserialize(i);
1193 i = m_rates.Deserialize(i);
1200 i,
1203 return i.GetDistanceFrom(start);
1204}
1205
1206/***********************************************************
1207 * Ressoc Request
1208 ***********************************************************/
1209
1211
1213 : m_currentApAddr(Mac48Address())
1214{
1215}
1216
1218{
1219}
1220
1221void
1223{
1224 m_ssid = ssid;
1225}
1226
1227void
1229{
1230 m_ssid = std::move(ssid);
1231}
1232
1233void
1235{
1236 m_rates = rates;
1237}
1238
1239void
1241{
1242 m_rates = std::move(rates);
1243}
1244
1245void
1247{
1248 m_listenInterval = interval;
1249}
1250
1251void
1253{
1254 m_capability = capabilities;
1255}
1256
1257void
1259{
1260 m_capability = std::move(capabilities);
1261}
1262
1265{
1266 return m_capability;
1267}
1268
1269void
1271{
1272 m_extendedCapability = extendedCapabilities;
1273}
1274
1275void
1277{
1278 m_extendedCapability = std::move(extendedCapabilities);
1279}
1280
1281const std::optional<ExtendedCapabilities>&
1283{
1284 return m_extendedCapability;
1285}
1286
1287void
1289{
1290 m_htCapability = htCapabilities;
1291}
1292
1293void
1295{
1296 m_htCapability = std::move(htCapabilities);
1297}
1298
1299const std::optional<HtCapabilities>&
1301{
1302 return m_htCapability;
1303}
1304
1305void
1307{
1308 m_vhtCapability = vhtCapabilities;
1309}
1310
1311void
1313{
1314 m_vhtCapability = std::move(vhtCapabilities);
1315}
1316
1317const std::optional<VhtCapabilities>&
1319{
1320 return m_vhtCapability;
1321}
1322
1323void
1325{
1326 m_heCapability = heCapabilities;
1327}
1328
1329void
1331{
1332 m_heCapability = std::move(heCapabilities);
1333}
1334
1335const std::optional<HeCapabilities>&
1337{
1338 return m_heCapability;
1339}
1340
1341void
1343{
1344 m_ehtCapability = ehtCapabilities;
1345}
1346
1347void
1349{
1350 m_ehtCapability = std::move(ehtCapabilities);
1351}
1352
1353const std::optional<EhtCapabilities>&
1355{
1356 return m_ehtCapability;
1357}
1358
1359void
1361{
1362 m_multiLinkElement = multiLinkElement;
1363}
1364
1365void
1367{
1368 m_multiLinkElement = std::move(multiLinkElement);
1369}
1370
1371const std::optional<MultiLinkElement>&
1373{
1374 return m_multiLinkElement;
1375}
1376
1377const Ssid&
1379{
1380 return m_ssid;
1381}
1382
1383const SupportedRates&
1385{
1386 return m_rates;
1387}
1388
1389uint16_t
1391{
1392 return m_listenInterval;
1393}
1394
1395void
1397{
1398 m_currentApAddr = currentApAddr;
1399}
1400
1401TypeId
1403{
1404 static TypeId tid = TypeId("ns3::MgtReassocRequestHeader")
1405 .SetParent<Header>()
1406 .SetGroupName("Wifi")
1407 .AddConstructor<MgtReassocRequestHeader>();
1408 return tid;
1409}
1410
1411TypeId
1413{
1414 return GetTypeId();
1415}
1416
1419{
1420 uint32_t size = 0;
1422 size += 2; // listen interval
1423 size += 6; // current AP address
1424 size += m_ssid.GetSerializedSize();
1425 size += m_rates.GetSerializedSize();
1426 if (m_rates.GetNRates() > 8)
1427 {
1428 size += m_rates.extended->GetSerializedSize();
1429 }
1430 if (m_extendedCapability.has_value())
1431 {
1432 size += m_extendedCapability->GetSerializedSize();
1433 }
1434 if (m_htCapability.has_value())
1435 {
1436 size += m_htCapability->GetSerializedSize();
1437 }
1438 if (m_vhtCapability.has_value())
1439 {
1440 size += m_vhtCapability->GetSerializedSize();
1441 }
1442 if (m_heCapability.has_value())
1443 {
1444 size += m_heCapability->GetSerializedSize();
1445 }
1446 if (m_multiLinkElement.has_value())
1447 {
1448 size += m_multiLinkElement->GetSerializedSize();
1449 }
1450 if (m_ehtCapability.has_value())
1451 {
1452 size += m_ehtCapability->GetSerializedSize();
1453 }
1454 return size;
1455}
1456
1457void
1458MgtReassocRequestHeader::Print(std::ostream& os) const
1459{
1460 os << "current AP address=" << m_currentApAddr << ", "
1461 << "ssid=" << m_ssid << ", "
1462 << "rates=" << m_rates << ", ";
1463 if (m_extendedCapability.has_value())
1464 {
1465 os << "Extended Capabilities=" << *m_extendedCapability << " , ";
1466 }
1467 if (m_htCapability.has_value())
1468 {
1469 os << "HT Capabilities=" << *m_htCapability << " , ";
1470 }
1471 if (m_vhtCapability.has_value())
1472 {
1473 os << "VHT Capabilities=" << *m_vhtCapability << " , ";
1474 }
1475 if (m_heCapability.has_value())
1476 {
1477 os << "HE Capabilities=" << *m_heCapability << " , ";
1478 }
1479 if (m_ehtCapability.has_value())
1480 {
1481 os << "EHT Capabilities=" << *m_ehtCapability;
1482 }
1483}
1484
1485void
1487{
1489 i = m_capability.Serialize(i);
1492 i = m_ssid.Serialize(i);
1493 i = m_rates.Serialize(i);
1494 if (m_rates.GetNRates() > 8)
1495 {
1496 i = m_rates.extended->Serialize(i);
1497 }
1498 if (m_extendedCapability.has_value())
1499 {
1500 i = m_extendedCapability->Serialize(i);
1501 }
1502 if (m_htCapability.has_value())
1503 {
1504 i = m_htCapability->Serialize(i);
1505 }
1506 if (m_vhtCapability.has_value())
1507 {
1508 i = m_vhtCapability->Serialize(i);
1509 }
1510 if (m_heCapability.has_value())
1511 {
1512 i = m_heCapability->Serialize(i);
1513 }
1514 if (m_multiLinkElement.has_value())
1515 {
1516 i = m_multiLinkElement->Serialize(i);
1517 }
1518 if (m_ehtCapability.has_value())
1519 {
1520 i = m_ehtCapability->Serialize(i);
1521 }
1522}
1523
1526{
1527 Buffer::Iterator tmp;
1532 i = m_ssid.Deserialize(i);
1533 i = m_rates.Deserialize(i);
1540 i,
1543 return i.GetDistanceFrom(start);
1544}
1545
1546/***********************************************************
1547 * Assoc/Reassoc Response
1548 ***********************************************************/
1549
1551
1553 : m_aid(0)
1554{
1555}
1556
1558{
1559}
1560
1563{
1564 return m_code;
1565}
1566
1567const SupportedRates&
1569{
1570 return m_rates;
1571}
1572
1573void
1575{
1576 m_code = code;
1577}
1578
1579void
1581{
1582 m_rates = rates;
1583}
1584
1585void
1587{
1588 m_rates = std::move(rates);
1589}
1590
1591void
1593{
1594 m_capability = capabilities;
1595}
1596
1597void
1599{
1600 m_capability = std::move(capabilities);
1601}
1602
1605{
1606 return m_capability;
1607}
1608
1609void
1611{
1612 m_extendedCapability = extendedCapabilities;
1613}
1614
1615void
1617{
1618 m_extendedCapability = std::move(extendedCapabilities);
1619}
1620
1621const std::optional<ExtendedCapabilities>&
1623{
1624 return m_extendedCapability;
1625}
1626
1627void
1629{
1630 m_htCapability = htCapabilities;
1631}
1632
1633void
1635{
1636 m_htCapability = std::move(htCapabilities);
1637}
1638
1639const std::optional<HtCapabilities>&
1641{
1642 return m_htCapability;
1643}
1644
1645void
1647{
1648 m_htOperation = htOperation;
1649}
1650
1651void
1653{
1654 m_htOperation = std::move(htOperation);
1655}
1656
1657const std::optional<HtOperation>&
1659{
1660 return m_htOperation;
1661}
1662
1663void
1665{
1666 m_vhtCapability = vhtCapabilities;
1667}
1668
1669void
1671{
1672 m_vhtCapability = std::move(vhtCapabilities);
1673}
1674
1675const std::optional<VhtCapabilities>&
1677{
1678 return m_vhtCapability;
1679}
1680
1681void
1683{
1684 m_vhtOperation = vhtOperation;
1685}
1686
1687void
1689{
1690 m_vhtOperation = std::move(vhtOperation);
1691}
1692
1693const std::optional<VhtOperation>&
1695{
1696 return m_vhtOperation;
1697}
1698
1699void
1701{
1702 m_heCapability = heCapabilities;
1703}
1704
1705void
1707{
1708 m_heCapability = std::move(heCapabilities);
1709}
1710
1711const std::optional<HeCapabilities>&
1713{
1714 return m_heCapability;
1715}
1716
1717void
1719{
1720 m_heOperation = heOperation;
1721}
1722
1723void
1725{
1726 m_heOperation = std::move(heOperation);
1727}
1728
1729const std::optional<HeOperation>&
1731{
1732 return m_heOperation;
1733}
1734
1735void
1737{
1738 m_ehtCapability = ehtCapabilities;
1739}
1740
1741void
1743{
1744 m_ehtCapability = std::move(ehtCapabilities);
1745}
1746
1747const std::optional<EhtCapabilities>&
1749{
1750 return m_ehtCapability;
1751}
1752
1753void
1755{
1756 m_multiLinkElement = multiLinkElement;
1757}
1758
1759void
1761{
1762 m_multiLinkElement = std::move(multiLinkElement);
1763}
1764
1765const std::optional<MultiLinkElement>&
1767{
1768 return m_multiLinkElement;
1769}
1770
1771void
1773{
1774 m_aid = aid;
1775}
1776
1777uint16_t
1779{
1780 return m_aid;
1781}
1782
1783void
1785{
1786 m_erpInformation = erpInformation;
1787}
1788
1789void
1791{
1792 m_erpInformation = std::move(erpInformation);
1793}
1794
1795const std::optional<ErpInformation>&
1797{
1798 return m_erpInformation;
1799}
1800
1801void
1803{
1804 m_edcaParameterSet = edcaparameters;
1805}
1806
1807void
1809{
1810 m_edcaParameterSet = std::move(edcaparameters);
1811}
1812
1813void
1815{
1816 m_muEdcaParameterSet = muEdcaParameters;
1817}
1818
1819void
1821{
1822 m_muEdcaParameterSet = std::move(muEdcaParameters);
1823}
1824
1825const std::optional<EdcaParameterSet>&
1827{
1828 return m_edcaParameterSet;
1829}
1830
1831const std::optional<MuEdcaParameterSet>&
1833{
1834 return m_muEdcaParameterSet;
1835}
1836
1837TypeId
1839{
1840 static TypeId tid = TypeId("ns3::MgtAssocResponseHeader")
1841 .SetParent<Header>()
1842 .SetGroupName("Wifi")
1843 .AddConstructor<MgtAssocResponseHeader>();
1844 return tid;
1845}
1846
1847TypeId
1849{
1850 return GetTypeId();
1851}
1852
1855{
1856 uint32_t size = 0;
1858 size += m_code.GetSerializedSize();
1859 size += 2; // aid
1860 size += m_rates.GetSerializedSize();
1861 if (m_erpInformation.has_value())
1862 {
1863 size += m_erpInformation->GetSerializedSize();
1864 }
1865 if (m_rates.GetNRates() > 8)
1866 {
1867 size += m_rates.extended->GetSerializedSize();
1868 }
1869 if (m_edcaParameterSet.has_value())
1870 {
1871 size += m_edcaParameterSet->GetSerializedSize();
1872 }
1873 if (m_extendedCapability.has_value())
1874 {
1875 size += m_extendedCapability->GetSerializedSize();
1876 }
1877 if (m_htCapability.has_value())
1878 {
1879 size += m_htCapability->GetSerializedSize();
1880 }
1881 if (m_htOperation.has_value())
1882 {
1883 size += m_htOperation->GetSerializedSize();
1884 }
1885 if (m_vhtCapability.has_value())
1886 {
1887 size += m_vhtCapability->GetSerializedSize();
1888 }
1889 if (m_vhtOperation.has_value())
1890 {
1891 size += m_vhtOperation->GetSerializedSize();
1892 }
1893 if (m_heCapability.has_value())
1894 {
1895 size += m_heCapability->GetSerializedSize();
1896 }
1897 if (m_heOperation.has_value())
1898 {
1899 size += m_heOperation->GetSerializedSize();
1900 }
1901 if (m_muEdcaParameterSet.has_value())
1902 {
1903 size += m_muEdcaParameterSet->GetSerializedSize();
1904 }
1905 if (m_multiLinkElement.has_value())
1906 {
1907 size += m_multiLinkElement->GetSerializedSize();
1908 }
1909 if (m_ehtCapability.has_value())
1910 {
1911 size += m_ehtCapability->GetSerializedSize();
1912 }
1913 return size;
1914}
1915
1916void
1917MgtAssocResponseHeader::Print(std::ostream& os) const
1918{
1919 os << "status code=" << m_code << ", "
1920 << "aid=" << m_aid << ", "
1921 << "rates=" << m_rates << ", ";
1922 if (m_erpInformation.has_value())
1923 {
1924 os << "ERP information=" << *m_erpInformation << ", ";
1925 }
1926 if (m_extendedCapability.has_value())
1927 {
1928 os << "Extended Capabilities=" << *m_extendedCapability << " , ";
1929 }
1930 if (m_htCapability.has_value())
1931 {
1932 os << "HT Capabilities=" << *m_htCapability << " , ";
1933 }
1934 if (m_htOperation.has_value())
1935 {
1936 os << "HT Operation=" << *m_htOperation << " , ";
1937 }
1938 if (m_vhtCapability.has_value())
1939 {
1940 os << "VHT Capabilities=" << *m_vhtCapability << " , ";
1941 }
1942 if (m_vhtOperation.has_value())
1943 {
1944 os << "VHT Operation=" << *m_vhtOperation << " , ";
1945 }
1946 if (m_heCapability.has_value())
1947 {
1948 os << "HE Capabilities=" << *m_heCapability << " , ";
1949 }
1950 if (m_heOperation.has_value())
1951 {
1952 os << "HE Operation=" << *m_heOperation << " , ";
1953 }
1954 if (m_ehtCapability.has_value())
1955 {
1956 os << "EHT Capabilities=" << *m_ehtCapability;
1957 }
1958}
1959
1960void
1962{
1964 i = m_capability.Serialize(i);
1965 i = m_code.Serialize(i);
1967 i = m_rates.Serialize(i);
1968 if (m_erpInformation.has_value())
1969 {
1970 i = m_erpInformation->Serialize(i);
1971 }
1972 if (m_rates.GetNRates() > 8)
1973 {
1974 i = m_rates.extended->Serialize(i);
1975 }
1976 if (m_edcaParameterSet.has_value())
1977 {
1978 i = m_edcaParameterSet->Serialize(i);
1979 }
1980 if (m_extendedCapability.has_value())
1981 {
1982 i = m_extendedCapability->Serialize(i);
1983 }
1984 if (m_htCapability.has_value())
1985 {
1986 i = m_htCapability->Serialize(i);
1987 }
1988 if (m_htOperation.has_value())
1989 {
1990 i = m_htOperation->Serialize(i);
1991 }
1992 if (m_vhtCapability.has_value())
1993 {
1994 i = m_vhtCapability->Serialize(i);
1995 }
1996 if (m_vhtOperation.has_value())
1997 {
1998 i = m_vhtOperation->Serialize(i);
1999 }
2000 if (m_heCapability.has_value())
2001 {
2002 i = m_heCapability->Serialize(i);
2003 }
2004 if (m_heOperation.has_value())
2005 {
2006 i = m_heOperation->Serialize(i);
2007 }
2008 if (m_muEdcaParameterSet.has_value())
2009 {
2010 i = m_muEdcaParameterSet->Serialize(i);
2011 }
2012 if (m_multiLinkElement.has_value())
2013 {
2014 i = m_multiLinkElement->Serialize(i);
2015 }
2016 if (m_ehtCapability.has_value())
2017 {
2018 i = m_ehtCapability->Serialize(i);
2019 }
2020}
2021
2024{
2025 Buffer::Iterator tmp;
2028 i = m_code.Deserialize(i);
2029 m_aid = i.ReadLsbtohU16();
2030 i = m_rates.Deserialize(i);
2043 i,
2046 return i.GetDistanceFrom(start);
2047}
2048
2049/**********************************************************
2050 * ActionFrame
2051 **********************************************************/
2053{
2054}
2055
2057{
2058}
2059
2060void
2063{
2064 m_category = static_cast<uint8_t>(type);
2065 switch (type)
2066 {
2067 case QOS: {
2068 m_actionValue = static_cast<uint8_t>(action.qos);
2069 break;
2070 }
2071 case BLOCK_ACK: {
2072 m_actionValue = static_cast<uint8_t>(action.blockAck);
2073 break;
2074 }
2075 case PUBLIC: {
2076 m_actionValue = static_cast<uint8_t>(action.publicAction);
2077 break;
2078 }
2079 case RADIO_MEASUREMENT: {
2080 m_actionValue = static_cast<uint8_t>(action.radioMeasurementAction);
2081 break;
2082 }
2083 case MESH: {
2084 m_actionValue = static_cast<uint8_t>(action.meshAction);
2085 break;
2086 }
2087 case MULTIHOP: {
2088 m_actionValue = static_cast<uint8_t>(action.multihopAction);
2089 break;
2090 }
2091 case SELF_PROTECTED: {
2092 m_actionValue = static_cast<uint8_t>(action.selfProtectedAction);
2093 break;
2094 }
2095 case DMG: {
2096 m_actionValue = static_cast<uint8_t>(action.dmgAction);
2097 break;
2098 }
2099 case FST: {
2100 m_actionValue = static_cast<uint8_t>(action.fstAction);
2101 break;
2102 }
2103 case UNPROTECTED_DMG: {
2104 m_actionValue = static_cast<uint8_t>(action.unprotectedDmgAction);
2105 break;
2106 }
2108 break;
2109 }
2110 }
2111}
2112
2115{
2116 switch (m_category)
2117 {
2118 case QOS:
2119 return QOS;
2120 case BLOCK_ACK:
2121 return BLOCK_ACK;
2122 case PUBLIC:
2123 return PUBLIC;
2124 case RADIO_MEASUREMENT:
2125 return RADIO_MEASUREMENT;
2126 case MESH:
2127 return MESH;
2128 case MULTIHOP:
2129 return MULTIHOP;
2130 case SELF_PROTECTED:
2131 return SELF_PROTECTED;
2132 case DMG:
2133 return DMG;
2134 case FST:
2135 return FST;
2136 case UNPROTECTED_DMG:
2137 return UNPROTECTED_DMG;
2140 default:
2141 NS_FATAL_ERROR("Unknown action value");
2142 return SELF_PROTECTED;
2143 }
2144}
2145
2148{
2149 ActionValue retval;
2150 retval.selfProtectedAction =
2151 PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases
2152 switch (m_category)
2153 {
2154 case QOS:
2155 switch (m_actionValue)
2156 {
2157 case ADDTS_REQUEST:
2158 retval.qos = ADDTS_REQUEST;
2159 break;
2160 case ADDTS_RESPONSE:
2161 retval.qos = ADDTS_RESPONSE;
2162 break;
2163 case DELTS:
2164 retval.qos = DELTS;
2165 break;
2166 case SCHEDULE:
2167 retval.qos = SCHEDULE;
2168 break;
2169 case QOS_MAP_CONFIGURE:
2170 retval.qos = QOS_MAP_CONFIGURE;
2171 break;
2172 default:
2173 NS_FATAL_ERROR("Unknown qos action code");
2174 retval.qos = ADDTS_REQUEST; /* quiet compiler */
2175 }
2176 break;
2177
2178 case BLOCK_ACK:
2179 switch (m_actionValue)
2180 {
2183 break;
2186 break;
2187 case BLOCK_ACK_DELBA:
2188 retval.blockAck = BLOCK_ACK_DELBA;
2189 break;
2190 default:
2191 NS_FATAL_ERROR("Unknown block ack action code");
2192 retval.blockAck = BLOCK_ACK_ADDBA_REQUEST; /* quiet compiler */
2193 }
2194 break;
2195
2196 case PUBLIC:
2197 switch (m_actionValue)
2198 {
2199 case QAB_REQUEST:
2200 retval.publicAction = QAB_REQUEST;
2201 break;
2202 case QAB_RESPONSE:
2203 retval.publicAction = QAB_RESPONSE;
2204 break;
2205 default:
2206 NS_FATAL_ERROR("Unknown public action code");
2207 retval.publicAction = QAB_REQUEST; /* quiet compiler */
2208 }
2209 break;
2210
2211 case RADIO_MEASUREMENT:
2212 switch (m_actionValue)
2213 {
2216 break;
2219 break;
2222 break;
2225 break;
2228 break;
2231 break;
2232 default:
2233 NS_FATAL_ERROR("Unknown radio measurement action code");
2234 retval.radioMeasurementAction = RADIO_MEASUREMENT_REQUEST; /* quiet compiler */
2235 }
2236 break;
2237
2238 case SELF_PROTECTED:
2239 switch (m_actionValue)
2240 {
2241 case PEER_LINK_OPEN:
2243 break;
2244 case PEER_LINK_CONFIRM:
2246 break;
2247 case PEER_LINK_CLOSE:
2249 break;
2250 case GROUP_KEY_INFORM:
2252 break;
2253 case GROUP_KEY_ACK:
2255 break;
2256 default:
2257 NS_FATAL_ERROR("Unknown mesh peering management action code");
2258 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
2259 }
2260 break;
2261
2262 case MESH:
2263 switch (m_actionValue)
2264 {
2265 case LINK_METRIC_REPORT:
2267 break;
2268 case PATH_SELECTION:
2269 retval.meshAction = PATH_SELECTION;
2270 break;
2273 break;
2276 break;
2277 case MDA_SETUP_REQUEST:
2279 break;
2280 case MDA_SETUP_REPLY:
2281 retval.meshAction = MDA_SETUP_REPLY;
2282 break;
2285 break;
2288 break;
2289 case MDAOP_SET_TEARDOWN:
2291 break;
2294 break;
2297 break;
2298 default:
2299 NS_FATAL_ERROR("Unknown mesh peering management action code");
2300 retval.meshAction = LINK_METRIC_REPORT; /* quiet compiler */
2301 }
2302 break;
2303
2304 case MULTIHOP: // not yet supported
2305 switch (m_actionValue)
2306 {
2307 case PROXY_UPDATE: // not used so far
2309 break;
2310 case PROXY_UPDATE_CONFIRMATION: // not used so far
2312 break;
2313 default:
2314 NS_FATAL_ERROR("Unknown mesh peering management action code");
2315 retval.multihopAction = PROXY_UPDATE; /* quiet compiler */
2316 }
2317 break;
2318
2319 case DMG:
2320 switch (m_actionValue)
2321 {
2324 break;
2327 break;
2330 break;
2333 break;
2336 break;
2339 break;
2340 case DMG_DTP_REQUEST:
2341 retval.dmgAction = DMG_DTP_REQUEST;
2342 break;
2343 case DMG_DTP_RESPONSE:
2344 retval.dmgAction = DMG_DTP_RESPONSE;
2345 break;
2348 break;
2351 break;
2354 break;
2357 break;
2358 case DMG_RLS_REQUEST:
2359 retval.dmgAction = DMG_RLS_REQUEST;
2360 break;
2361 case DMG_RLS_RESPONSE:
2362 retval.dmgAction = DMG_RLS_RESPONSE;
2363 break;
2366 break;
2367 case DMG_RLS_TEARDOWN:
2368 retval.dmgAction = DMG_RLS_TEARDOWN;
2369 break;
2372 break;
2375 break;
2376 case DMG_TPA_REQUEST:
2377 retval.dmgAction = DMG_TPA_REQUEST;
2378 break;
2379 case DMG_TPA_RESPONSE:
2380 retval.dmgAction = DMG_TPA_RESPONSE;
2381 break;
2382 case DMG_ROC_REQUEST:
2383 retval.dmgAction = DMG_ROC_REQUEST;
2384 break;
2385 case DMG_ROC_RESPONSE:
2386 retval.dmgAction = DMG_ROC_RESPONSE;
2387 break;
2388 default:
2389 NS_FATAL_ERROR("Unknown DMG management action code");
2390 retval.dmgAction = DMG_POWER_SAVE_CONFIGURATION_REQUEST; /* quiet compiler */
2391 }
2392 break;
2393
2394 case FST:
2395 switch (m_actionValue)
2396 {
2397 case FST_SETUP_REQUEST:
2399 break;
2400 case FST_SETUP_RESPONSE:
2402 break;
2403 case FST_TEAR_DOWN:
2404 retval.fstAction = FST_TEAR_DOWN;
2405 break;
2406 case FST_ACK_REQUEST:
2407 retval.fstAction = FST_ACK_REQUEST;
2408 break;
2409 case FST_ACK_RESPONSE:
2410 retval.fstAction = FST_ACK_RESPONSE;
2411 break;
2414 break;
2415 default:
2416 NS_FATAL_ERROR("Unknown FST management action code");
2417 retval.fstAction = FST_SETUP_REQUEST; /* quiet compiler */
2418 }
2419 break;
2420
2421 case UNPROTECTED_DMG:
2422 switch (m_actionValue)
2423 {
2426 break;
2429 break;
2432 break;
2435 break;
2438 break;
2441 break;
2442 default:
2443 NS_FATAL_ERROR("Unknown Unprotected DMG action code");
2444 retval.unprotectedDmgAction = UNPROTECTED_DMG_ANNOUNCE; /* quiet compiler */
2445 }
2446 break;
2447
2448 default:
2449 NS_FATAL_ERROR("Unsupported action");
2450 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
2451 }
2452 return retval;
2453}
2454
2455TypeId
2457{
2458 static TypeId tid = TypeId("ns3::WifiActionHeader")
2459 .SetParent<Header>()
2460 .SetGroupName("Wifi")
2461 .AddConstructor<WifiActionHeader>();
2462 return tid;
2463}
2464
2465TypeId
2467{
2468 return GetTypeId();
2469}
2470
2471std::string
2473{
2474 switch (value)
2475 {
2476 case QOS:
2477 return "QoS";
2478 case BLOCK_ACK:
2479 return "BlockAck";
2480 case PUBLIC:
2481 return "Public";
2482 case RADIO_MEASUREMENT:
2483 return "RadioMeasurement";
2484 case MESH:
2485 return "Mesh";
2486 case MULTIHOP:
2487 return "Multihop";
2488 case SELF_PROTECTED:
2489 return "SelfProtected";
2490 case DMG:
2491 return "Dmg";
2492 case FST:
2493 return "Fst";
2494 case UNPROTECTED_DMG:
2495 return "UnprotectedDmg";
2497 return "VendorSpecificAction";
2498 default:
2499 std::ostringstream convert;
2500 convert << value;
2501 return convert.str();
2502 }
2503}
2504
2505std::string
2507{
2508 if (value == PEER_LINK_OPEN)
2509 {
2510 return "PeerLinkOpen";
2511 }
2512 else if (value == PEER_LINK_CONFIRM)
2513 {
2514 return "PeerLinkConfirm";
2515 }
2516 else if (value == PEER_LINK_CLOSE)
2517 {
2518 return "PeerLinkClose";
2519 }
2520 else if (value == GROUP_KEY_INFORM)
2521 {
2522 return "GroupKeyInform";
2523 }
2524 else if (value == GROUP_KEY_ACK)
2525 {
2526 return "GroupKeyAck";
2527 }
2528 else
2529 {
2530 std::ostringstream convert;
2531 convert << value;
2532 return convert.str();
2533 }
2534}
2535
2536void
2537WifiActionHeader::Print(std::ostream& os) const
2538{
2539 os << "category=" << CategoryValueToString((CategoryValue)m_category)
2541}
2542
2545{
2546 return 2;
2547}
2548
2549void
2551{
2552 start.WriteU8(m_category);
2553 start.WriteU8(m_actionValue);
2554}
2555
2558{
2560 m_category = i.ReadU8();
2561 m_actionValue = i.ReadU8();
2562 return i.GetDistanceFrom(start);
2563}
2564
2565/***************************************************
2566 * ADDBARequest
2567 ****************************************************/
2568
2570
2572 : m_dialogToken(1),
2573 m_amsduSupport(1),
2574 m_bufferSize(0)
2575{
2576}
2577
2578TypeId
2580{
2581 static TypeId tid = TypeId("ns3::MgtAddBaRequestHeader")
2582 .SetParent<Header>()
2583 .SetGroupName("Wifi")
2584 .AddConstructor<MgtAddBaRequestHeader>();
2585 return tid;
2586}
2587
2588TypeId
2590{
2591 return GetTypeId();
2592}
2593
2594void
2595MgtAddBaRequestHeader::Print(std::ostream& os) const
2596{
2597}
2598
2601{
2602 uint32_t size = 0;
2603 size += 1; // Dialog token
2604 size += 2; // Block ack parameter set
2605 size += 2; // Block ack timeout value
2606 size += 2; // Starting sequence control
2607 return size;
2608}
2609
2610void
2612{
2618}
2619
2622{
2624 m_dialogToken = i.ReadU8();
2628 return i.GetDistanceFrom(start);
2629}
2630
2631void
2633{
2634 m_policy = 0;
2635}
2636
2637void
2639{
2640 m_policy = 1;
2641}
2642
2643void
2645{
2646 NS_ASSERT(tid < 16);
2647 m_tid = tid;
2648}
2649
2650void
2652{
2654}
2655
2656void
2658{
2659 m_bufferSize = size;
2660}
2661
2662void
2664{
2665 m_startingSeq = seq;
2666}
2667
2668void
2670{
2671 m_startingSeq = (seqControl >> 4) & 0x0fff;
2672}
2673
2674void
2676{
2677 m_amsduSupport = supported;
2678}
2679
2680uint8_t
2682{
2683 return m_tid;
2684}
2685
2686bool
2688{
2689 return m_policy == 1;
2690}
2691
2692uint16_t
2694{
2695 return m_timeoutValue;
2696}
2697
2698uint16_t
2700{
2701 return m_bufferSize;
2702}
2703
2704bool
2706{
2707 return m_amsduSupport == 1;
2708}
2709
2710uint16_t
2712{
2713 return m_startingSeq;
2714}
2715
2716uint16_t
2718{
2719 return (m_startingSeq << 4) & 0xfff0;
2720}
2721
2722uint16_t
2724{
2725 uint16_t res = 0;
2726 res |= m_amsduSupport;
2727 res |= m_policy << 1;
2728 res |= m_tid << 2;
2729 res |= m_bufferSize << 6;
2730 return res;
2731}
2732
2733void
2735{
2736 m_amsduSupport = (params)&0x01;
2737 m_policy = (params >> 1) & 0x01;
2738 m_tid = (params >> 2) & 0x0f;
2739 m_bufferSize = (params >> 6) & 0x03ff;
2740}
2741
2742/***************************************************
2743 * ADDBAResponse
2744 ****************************************************/
2745
2747
2749 : m_dialogToken(1),
2750 m_amsduSupport(1),
2751 m_bufferSize(0)
2752{
2753}
2754
2755TypeId
2757{
2758 static TypeId tid = TypeId("ns3::MgtAddBaResponseHeader")
2759 .SetParent<Header>()
2760 .SetGroupName("Wifi")
2761 .AddConstructor<MgtAddBaResponseHeader>();
2762 return tid;
2763}
2764
2765TypeId
2767{
2768 return GetTypeId();
2769}
2770
2771void
2772MgtAddBaResponseHeader::Print(std::ostream& os) const
2773{
2774 os << "status code=" << m_code;
2775}
2776
2779{
2780 uint32_t size = 0;
2781 size += 1; // Dialog token
2782 size += m_code.GetSerializedSize(); // Status code
2783 size += 2; // Block ack parameter set
2784 size += 2; // Block ack timeout value
2785 return size;
2786}
2787
2788void
2790{
2793 i = m_code.Serialize(i);
2796}
2797
2800{
2802 m_dialogToken = i.ReadU8();
2803 i = m_code.Deserialize(i);
2806 return i.GetDistanceFrom(start);
2807}
2808
2809void
2811{
2812 m_policy = 0;
2813}
2814
2815void
2817{
2818 m_policy = 1;
2819}
2820
2821void
2823{
2824 NS_ASSERT(tid < 16);
2825 m_tid = tid;
2826}
2827
2828void
2830{
2832}
2833
2834void
2836{
2837 m_bufferSize = size;
2838}
2839
2840void
2842{
2843 m_code = code;
2844}
2845
2846void
2848{
2849 m_amsduSupport = supported;
2850}
2851
2854{
2855 return m_code;
2856}
2857
2858uint8_t
2860{
2861 return m_tid;
2862}
2863
2864bool
2866{
2867 return m_policy == 1;
2868}
2869
2870uint16_t
2872{
2873 return m_timeoutValue;
2874}
2875
2876uint16_t
2878{
2879 return m_bufferSize;
2880}
2881
2882bool
2884{
2885 return m_amsduSupport == 1;
2886}
2887
2888uint16_t
2890{
2891 uint16_t res = 0;
2892 res |= m_amsduSupport;
2893 res |= m_policy << 1;
2894 res |= m_tid << 2;
2895 res |= m_bufferSize << 6;
2896 return res;
2897}
2898
2899void
2901{
2902 m_amsduSupport = (params)&0x01;
2903 m_policy = (params >> 1) & 0x01;
2904 m_tid = (params >> 2) & 0x0f;
2905 m_bufferSize = (params >> 6) & 0x03ff;
2906}
2907
2908/***************************************************
2909 * DelBa
2910 ****************************************************/
2911
2913
2915 : m_reasonCode(1)
2916{
2917}
2918
2919TypeId
2921{
2922 static TypeId tid = TypeId("ns3::MgtDelBaHeader")
2923 .SetParent<Header>()
2924 .SetGroupName("Wifi")
2925 .AddConstructor<MgtDelBaHeader>();
2926 return tid;
2927}
2928
2929TypeId
2931{
2932 return GetTypeId();
2933}
2934
2935void
2936MgtDelBaHeader::Print(std::ostream& os) const
2937{
2938}
2939
2942{
2943 uint32_t size = 0;
2944 size += 2; // DelBa parameter set
2945 size += 2; // Reason code
2946 return size;
2947}
2948
2949void
2951{
2955}
2956
2959{
2963 return i.GetDistanceFrom(start);
2964}
2965
2966bool
2968{
2969 return m_initiator == 1;
2970}
2971
2972uint8_t
2974{
2975 NS_ASSERT(m_tid < 16);
2976 uint8_t tid = static_cast<uint8_t>(m_tid);
2977 return tid;
2978}
2979
2980void
2982{
2983 m_initiator = 1;
2984}
2985
2986void
2988{
2989 m_initiator = 0;
2990}
2991
2992void
2994{
2995 NS_ASSERT(tid < 16);
2996 m_tid = static_cast<uint16_t>(tid);
2997}
2998
2999uint16_t
3001{
3002 uint16_t res = 0;
3003 res |= m_initiator << 11;
3004 res |= m_tid << 12;
3005 return res;
3006}
3007
3008void
3010{
3011 m_initiator = (params >> 11) & 0x01;
3012 m_tid = (params >> 12) & 0x0f;
3013}
3014
3015} // namespace ns3
iterator in a Buffer instance
Definition: buffer.h:100
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:905
uint8_t ReadU8()
Definition: buffer.h:1027
void WriteU8(uint8_t data)
Definition: buffer.h:881
uint16_t ReadLsbtohU16()
Definition: buffer.cc:1067
uint64_t ReadLsbtohU64()
Definition: buffer.cc:1097
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:923
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:783
uint32_t GetSerializedSize() const
Return the serialized size of capability information.
Buffer::Iterator Serialize(Buffer::Iterator start) const
Serialize capability information to the given buffer.
Buffer::Iterator Deserialize(Buffer::Iterator start)
Deserialize capability information from the given buffer.
The DSSS Parameter Set.
The EDCA Parameter Set.
The IEEE 802.11be EHT Capabilities.
The ErpInformation Information Element.
The Extended Capabilities Information Element.
The IEEE 802.11ax HE Capabilities.
The HE Operation Information Element.
Definition: he-operation.h:36
Protocol header serialization and deserialization.
Definition: header.h:44
The HT Capabilities Information Element.
The HT Operation Information Element.
Definition: ht-operation.h:51
an EUI-48 address
Definition: mac48-address.h:46
Implement the header for management frames of type Add Block Ack request.
Definition: mgt-headers.h:1476
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t m_startingSeq
Starting sequence number.
Definition: mgt-headers.h:1599
void Serialize(Buffer::Iterator start) const override
uint16_t GetStartingSequenceControl() const
Return the raw sequence control.
void SetStartingSequenceControl(uint16_t seqControl)
Set sequence control with the given raw value.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:1596
static TypeId GetTypeId()
Register this type.
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:1594
void SetBufferSize(uint16_t size)
Set buffer size.
void Print(std::ostream &os) const override
void SetDelayedBlockAck()
Enable delayed BlockAck.
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:1593
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
void SetImmediateBlockAck()
Enable immediate BlockAck.
uint16_t GetBufferSize() const
Return the buffer size.
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:1597
uint16_t GetTimeout() const
Return the timeout.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t GetStartingSequence() const
Return the starting sequence number.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetSerializedSize() const override
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:1598
void SetTimeout(uint16_t timeout)
Set timeout.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint8_t m_policy
Block Ack policy.
Definition: mgt-headers.h:1595
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:1607
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:1717
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t GetSerializedSize() const override
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:1714
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:1712
void Serialize(Buffer::Iterator start) const override
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t GetBufferSize() const
Return the buffer size.
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
StatusCode GetStatusCode() const
Return the status code.
void SetTimeout(uint16_t timeout)
Set timeout.
uint8_t m_policy
Block ACK policy.
Definition: mgt-headers.h:1715
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetBufferSize(uint16_t size)
Set buffer size.
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:1718
void Print(std::ostream &os) const override
void SetStatusCode(StatusCode code)
Set the status code.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:1716
uint8_t GetTid() const
Return the Traffic ID (TID).
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t GetTimeout() const
Return the timeout.
void SetDelayedBlockAck()
Enable delayed BlockAck.
void SetImmediateBlockAck()
Enable immediate BlockAck.
static TypeId GetTypeId()
Register this type.
StatusCode m_code
Status code.
Definition: mgt-headers.h:1713
Implement the header for management frames of type association request.
Definition: mgt-headers.h:54
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:231
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities() const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:952
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:235
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
const SupportedRates & GetSupportedRates() const
Return the supported rates.
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:994
uint32_t Deserialize(Buffer::Iterator start) override
const CapabilityInformation & GetCapabilities() const
Return the Capability information.
Definition: mgt-headers.cc:934
const std::optional< HeCapabilities > & GetHeCapabilities() const
Return the HE capabilities, if present.
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:232
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the Extended Capabilities.
Definition: mgt-headers.cc:940
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:904
const std::optional< MultiLinkElement > & GetMultiLinkElement() const
Return the Multi-Link Element information element, if present.
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
std::optional< ExtendedCapabilities > m_extendedCapability
Extended capabilities.
Definition: mgt-headers.h:233
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:958
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:916
uint16_t GetListenInterval() const
Return the listen interval.
uint32_t GetSerializedSize() const override
void Print(std::ostream &os) const override
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:236
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:976
const std::optional< EhtCapabilities > & GetEhtCapabilities() const
Return the EHT capabilities, if present.
const std::optional< HtCapabilities > & GetHtCapabilities() const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:970
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:237
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:230
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:234
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:239
const std::optional< VhtCapabilities > & GetVhtCapabilities() const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:988
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
Definition: mgt-headers.cc:922
static TypeId GetTypeId()
Register this type.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const override
const Ssid & GetSsid() const
Return the Service Set Identifier (SSID).
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:238
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:892
Implement the header for management frames of type association and reassociation response.
Definition: mgt-headers.h:446
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:720
static TypeId GetTypeId()
Register this type.
const std::optional< MultiLinkElement > & GetMultiLinkElement() const
Return the Multi-Link Element information element, if present.
StatusCode GetStatusCode()
Return the status code.
void SetHtOperation(const HtOperation &htOperation)
Set the HT operation.
void SetMuEdcaParameterSet(const MuEdcaParameterSet &muEdcaParameterSet)
Set the MU EDCA Parameter Set.
void SetEdcaParameterSet(const EdcaParameterSet &edcaParameterSet)
Set the EDCA Parameter Set.
std::optional< HeOperation > m_heOperation
HE operation.
Definition: mgt-headers.h:725
void Serialize(Buffer::Iterator start) const override
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
void SetStatusCode(StatusCode code)
Set the status code.
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:713
void SetVhtOperation(const VhtOperation &vhtOperation)
Set the VHT operation.
void SetHeOperation(const HeOperation &heOperation)
Set the HE operation.
void SetAssociationId(uint16_t aid)
Set the association ID.
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
const std::optional< MuEdcaParameterSet > & GetMuEdcaParameterSet() const
Return the MU EDCA Parameter Set, if present.
const std::optional< VhtOperation > & GetVhtOperation() const
Return the VHT operation, if present.
uint32_t Deserialize(Buffer::Iterator start) override
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:714
std::optional< MuEdcaParameterSet > m_muEdcaParameterSet
MU EDCA Parameter Set.
Definition: mgt-headers.h:726
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:718
const std::optional< EdcaParameterSet > & GetEdcaParameterSet() const
Return the EDCA Parameter Set, if present.
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:717
const std::optional< ErpInformation > & GetErpInformation() const
Return the ERP information, if present.
const std::optional< HeCapabilities > & GetHeCapabilities() const
Return the HE capabilities, if present.
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:727
std::optional< VhtOperation > m_vhtOperation
VHT operation.
Definition: mgt-headers.h:721
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities() const
Return the extended capabilities, if present.
const std::optional< VhtCapabilities > & GetVhtCapabilities() const
Return the VHT capabilities, if present.
const std::optional< HtCapabilities > & GetHtCapabilities() const
Return the HT capabilities, if present.
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:728
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Print(std::ostream &os) const override
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
const std::optional< HeOperation > & GetHeOperation() const
Return the HE operation, if present.
const std::optional< EhtCapabilities > & GetEhtCapabilities() const
Return the EHT capabilities, if present.
const std::optional< HtOperation > & GetHtOperation() const
Return the HT operation, if present.
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
uint32_t GetSerializedSize() const override
const SupportedRates & GetSupportedRates() const
Return the supported rates.
uint16_t GetAssociationId() const
Return the association ID.
std::optional< EdcaParameterSet > m_edcaParameterSet
EDCA Parameter Set.
Definition: mgt-headers.h:723
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
std::optional< ErpInformation > m_erpInformation
ERP information.
Definition: mgt-headers.h:722
const CapabilityInformation & GetCapabilities() const
Return the Capability information.
void SetErpInformation(const ErpInformation &erpInformation)
Set the ERP information.
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:724
std::optional< HtOperation > m_htOperation
HT operation.
Definition: mgt-headers.h:719
StatusCode m_code
Status code.
Definition: mgt-headers.h:715
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:1222
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:867
Implement the header for management frames of type Delete Block Ack.
Definition: mgt-headers.h:1726
static TypeId GetTypeId()
Register this type.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t Deserialize(Buffer::Iterator start) override
void SetByRecipient()
Un-set the initiator bit in the DELBA.
void Print(std::ostream &os) const override
uint16_t m_initiator
initiator
Definition: mgt-headers.h:1784
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t m_reasonCode
Not used for now.
Definition: mgt-headers.h:1786
bool IsByOriginator() const
Check if the initiator bit in the DELBA is set.
uint16_t GetParameterSet() const
Return the raw parameter set.
void Serialize(Buffer::Iterator start) const override
uint16_t m_tid
Traffic ID.
Definition: mgt-headers.h:1785
uint32_t GetSerializedSize() const override
void SetByOriginator()
Set the initiator bit in the DELBA.
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:736
const Ssid & GetSsid() const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:53
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:41
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:875
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:876
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:871
const std::optional< EhtCapabilities > & GetEhtCapabilities() const
Return the EHT capabilities, if present.
Definition: mgt-headers.cc:155
uint32_t GetSerializedSize() const override
Definition: mgt-headers.cc:167
const SupportedRates & GetSupportedRates() const
Return the supported rates.
Definition: mgt-headers.cc:161
~MgtProbeRequestHeader() override
Definition: mgt-headers.cc:36
const std::optional< VhtCapabilities > & GetVhtCapabilities() const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:119
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:59
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
Definition: mgt-headers.cc:143
void Serialize(Buffer::Iterator start) const override
Definition: mgt-headers.cc:243
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:872
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:107
const std::optional< HeCapabilities > & GetHeCapabilities() const
Return the HE capabilities, if present.
Definition: mgt-headers.cc:137
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:200
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities() const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:83
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:873
uint32_t Deserialize(Buffer::Iterator start) override
Definition: mgt-headers.cc:275
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:877
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:125
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:210
void Print(std::ostream &os) const override
Definition: mgt-headers.cc:216
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:874
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:89
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:71
const std::optional< HtCapabilities > & GetHtCapabilities() const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:101
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:885
uint64_t m_beaconInterval
Beacon interval.
Definition: mgt-headers.h:1197
uint64_t GetTimestamp()
Return the time stamp.
Definition: mgt-headers.cc:304
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:1206
void SetVhtOperation(const VhtOperation &vhtOperation)
Set the VHT operation.
Definition: mgt-headers.cc:418
std::optional< HeOperation > m_heOperation
HE operation.
Definition: mgt-headers.h:1207
const std::optional< DsssParameterSet > & GetDsssParameterSet() const
Return the DSSS Parameter Set, if present.
Definition: mgt-headers.cc:532
std::optional< EdcaParameterSet > m_edcaParameterSet
EDCA Parameter Set.
Definition: mgt-headers.h:1209
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:1211
const std::optional< VhtCapabilities > & GetVhtCapabilities() const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:412
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:628
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:638
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities() const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:358
void Print(std::ostream &os) const override
Definition: mgt-headers.cc:716
void SetHtOperation(const HtOperation &htOperation)
Set the HT operation.
Definition: mgt-headers.cc:382
uint32_t Deserialize(Buffer::Iterator start) override
Definition: mgt-headers.cc:830
const std::optional< MuEdcaParameterSet > & GetMuEdcaParameterSet() const
Return the MU EDCA Parameter Set, if present.
Definition: mgt-headers.cc:610
std::optional< ReducedNeighborReport > m_reducedNeighborReport
Reduced Neighbor Report information.
Definition: mgt-headers.h:1213
std::optional< HtOperation > m_htOperation
HT operation.
Definition: mgt-headers.h:1203
const Ssid & GetSsid() const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:310
void SetDsssParameterSet(const DsssParameterSet &dsssParameterSet)
Set the DSSS Parameter Set.
Definition: mgt-headers.cc:520
Ssid m_ssid
Service set ID (SSID)
Definition: mgt-headers.h:1196
const std::optional< ErpInformation > & GetErpInformation() const
Return the ERP information, if present.
Definition: mgt-headers.cc:550
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
Definition: mgt-headers.cc:328
std::optional< VhtOperation > m_vhtOperation
VHT operation.
Definition: mgt-headers.h:1205
const std::optional< HeOperation > & GetHeOperation() const
Return the HE operation, if present.
Definition: mgt-headers.cc:466
const std::optional< HtOperation > & GetHtOperation() const
Return the HT operation, if present.
Definition: mgt-headers.cc:394
const std::optional< EdcaParameterSet > & GetEdcaParameterSet() const
Return the EDCA Parameter Set, if present.
Definition: mgt-headers.cc:604
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:1214
const std::optional< ReducedNeighborReport > & GetReducedNeighborReport() const
Return the Reduced Neighbor Report information element, if present.
Definition: mgt-headers.cc:616
void SetReducedNeighborReport(const ReducedNeighborReport &reducedNeighborReport)
Set the Reduced Neighbor Report information element.
Definition: mgt-headers.cc:580
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:1198
const CapabilityInformation & GetCapabilities() const
Return the Capability information.
Definition: mgt-headers.cc:340
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
Definition: mgt-headers.cc:472
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:400
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:364
const std::optional< MultiLinkElement > & GetMultiLinkElement() const
Return the Multi-Link Element information element, if present.
Definition: mgt-headers.cc:622
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:490
std::optional< ErpInformation > m_erpInformation
ERP information.
Definition: mgt-headers.h:1208
std::optional< DsssParameterSet > m_dsssParameterSet
DSSS Parameter Set.
Definition: mgt-headers.h:1200
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:508
void SetHeOperation(const HeOperation &heOperation)
Set the HE operation.
Definition: mgt-headers.cc:454
void SetErpInformation(const ErpInformation &erpInformation)
Set the ERP information.
Definition: mgt-headers.cc:538
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:346
const std::optional< EhtCapabilities > & GetEhtCapabilities() const
Return the EHT capabilities, if present.
Definition: mgt-headers.cc:484
std::optional< MuEdcaParameterSet > m_muEdcaParameterSet
MU EDCA Parameter Set.
Definition: mgt-headers.h:1210
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:502
uint64_t GetBeaconIntervalUs() const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:316
void Serialize(Buffer::Iterator start) const override
Definition: mgt-headers.cc:759
void SetEdcaParameterSet(const EdcaParameterSet &edcaParameterSet)
Set the EDCA Parameter Set.
Definition: mgt-headers.cc:556
uint32_t GetSerializedSize() const override
Definition: mgt-headers.cc:644
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:436
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:1201
void SetMuEdcaParameterSet(const MuEdcaParameterSet &muEdcaParameterSet)
Set the MU EDCA Parameter Set.
Definition: mgt-headers.cc:568
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:1199
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:1204
const std::optional< HtCapabilities > & GetHtCapabilities() const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:376
const std::optional< VhtOperation > & GetVhtOperation() const
Return the VHT operation, if present.
Definition: mgt-headers.cc:430
uint64_t m_timestamp
Timestamp.
Definition: mgt-headers.h:1195
const SupportedRates & GetSupportedRates() const
Return the supported rates.
Definition: mgt-headers.cc:322
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:1202
const std::optional< HeCapabilities > & GetHeCapabilities() const
Return the HE capabilities, if present.
Definition: mgt-headers.cc:448
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
Definition: mgt-headers.cc:592
Implement the header for management frames of type reassociation request.
Definition: mgt-headers.h:247
const CapabilityInformation & GetCapabilities() const
Return the Capability information.
Mac48Address m_currentApAddr
Address of the current access point.
Definition: mgt-headers.h:428
void Serialize(Buffer::Iterator start) const override
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:436
uint16_t GetListenInterval() const
Return the listen interval.
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:438
const SupportedRates & GetSupportedRates() const
Return the supported rates.
std::optional< ExtendedCapabilities > m_extendedCapability
Extended capabilities.
Definition: mgt-headers.h:432
uint32_t GetSerializedSize() const override
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
static TypeId GetTypeId()
Register this type.
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:437
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:434
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the Extended Capabilities.
void Print(std::ostream &os) const override
const std::optional< MultiLinkElement > & GetMultiLinkElement() const
Return the Multi-Link Element information element, if present.
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:435
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:430
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:429
const std::optional< EhtCapabilities > & GetEhtCapabilities() const
Return the EHT capabilities, if present.
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
const std::optional< HtCapabilities > & GetHtCapabilities() const
Return the HT capabilities, if present.
const std::optional< VhtCapabilities > & GetVhtCapabilities() const
Return the VHT capabilities, if present.
void SetListenInterval(uint16_t interval)
Set the listen interval.
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:431
const std::optional< HeCapabilities > & GetHeCapabilities() const
Return the HE capabilities, if present.
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
const Ssid & GetSsid() const
Return the Service Set Identifier (SSID).
uint32_t Deserialize(Buffer::Iterator start) override
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:433
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
void SetCurrentApAddress(Mac48Address currentApAddr)
Set the address of the current access point.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities() const
Return the extended capabilities, if present.
The MU EDCA Parameter Set.
The Reduced Neighbor Report element.
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:36
Status code for association response.
Definition: status-code.h:32
Buffer::Iterator Serialize(Buffer::Iterator start) const
Definition: status-code.cc:54
Buffer::Iterator Deserialize(Buffer::Iterator start)
Definition: status-code.cc:61
uint32_t GetSerializedSize() const
Definition: status-code.cc:48
The Supported Rates Information Element.
uint8_t GetNRates() const
Return the number of supported rates.
std::optional< ExtendedSupportedRatesIE > extended
extended supported rates info element
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
The IEEE 802.11ac VHT Capabilities.
The VHT Operation Information Element.
Definition: vht-operation.h:36
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:1244
uint32_t GetSerializedSize() const override
SelfProtectedActionValue
SelfProtectedActionValue enumeration.
Definition: mgt-headers.h:1339
uint8_t m_category
Category of the action.
Definition: mgt-headers.h:1467
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
std::string CategoryValueToString(CategoryValue value) const
Category value to string function.
CategoryValue
CategoryValue enumeration.
Definition: mgt-headers.h:1256
std::string SelfProtectedActionValueToString(SelfProtectedActionValue value) const
Self protected action value to string function.
uint8_t m_actionValue
Action value.
Definition: mgt-headers.h:1468
CategoryValue GetCategory()
Return the category value.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
ActionValue GetAction()
Return the action value.
static TypeId GetTypeId()
Register this type.
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
~WifiActionHeader() override
void Serialize(Buffer::Iterator start) const override
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REQUEST
Definition: mgt-headers.h:1363
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REPORT
Definition: mgt-headers.h:1364
uint16_t GetSerializedSize() const
Get the size of the serialized IE including Element ID and length fields (for every element this IE i...
Buffer::Iterator Deserialize(Buffer::Iterator i)
Deserialize entire IE (which may possibly be fragmented into multiple elements), which must be presen...
static Buffer::Iterator DeserializeIfPresent(std::optional< IE > &optElem, Buffer::Iterator i, Args &&... args)
Deserialize an entire IE (which may possibly be fragmented into multiple elements) that is optionally...
Buffer::Iterator Serialize(Buffer::Iterator i) const
Serialize entire IE including Element ID and length fields.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:160
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Every class exported by the ns3 library is enclosed in the ns3 namespace.
@ WIFI_MAC_MGT_BEACON
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_MGT_REASSOCIATION_REQUEST
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
value
Definition: second.py:41
ssid
Definition: third.py:86
def start()
Definition: core.py:1861
ns3::Time timeout
typedef for union of different ActionValues
Definition: mgt-headers.h:1409
UnprotectedDmgActionValue unprotectedDmgAction
unprotected dmg
Definition: mgt-headers.h:1419
SelfProtectedActionValue selfProtectedAction
self protected
Definition: mgt-headers.h:1414
MultihopActionValue multihopAction
multi hop
Definition: mgt-headers.h:1415
RadioMeasurementActionValue radioMeasurementAction
radio measurement
Definition: mgt-headers.h:1412
PublicActionValue publicAction
public
Definition: mgt-headers.h:1413
BlockAckActionValue blockAck
block ack
Definition: mgt-headers.h:1411