A Discrete-Event Network Simulator
API
mgt-headers.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2006 INRIA
4 * Copyright (c) 2009 MIRKO BANCHI
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation;
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20 * Mirko Banchi <mk.banchi@gmail.com>
21 */
22
23#include "ns3/simulator.h"
24#include "ns3/address-utils.h"
25#include "mgt-headers.h"
26
27namespace ns3 {
28
29/***********************************************************
30 * Probe Request
31 ***********************************************************/
32
33NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader);
34
36{
37}
38
39void
41{
42 m_ssid = ssid;
43}
44
45void
47{
48 m_ssid = std::move (ssid);
49}
50
51const Ssid&
53{
54 return m_ssid;
55}
56
57void
59{
60 m_rates = rates;
61}
62
63void
65{
66 m_rates = std::move (rates);
67}
68
69void
71{
72 m_extendedCapability = extendedCapabilities;
73}
74
75void
77{
78 m_extendedCapability = std::move (extendedCapabilities);
79}
80
81const std::optional<ExtendedCapabilities>&
83{
85}
86
87void
89{
90 m_htCapability = htCapabilities;
91}
92
93void
95{
96 m_htCapability = std::move (htCapabilities);
97}
98
99const std::optional<HtCapabilities>&
101{
102 return m_htCapability;
103}
104
105void
107{
108 m_vhtCapability = vhtCapabilities;
109}
110
111void
113{
114 m_vhtCapability = std::move (vhtCapabilities);
115}
116
117const std::optional<VhtCapabilities>&
119{
120 return m_vhtCapability;
121}
122
123void
125{
126 m_heCapability = heCapabilities;
127}
128
129void
131{
132 m_heCapability = std::move (heCapabilities);
133}
134
135const std::optional<HeCapabilities>&
137{
138 return m_heCapability;
139}
140
141void
143{
144 m_ehtCapability = ehtCapabilities;
145}
146
147void
149{
150 m_ehtCapability = std::move (ehtCapabilities);
151}
152
153const std::optional<EhtCapabilities>&
155{
156 return m_ehtCapability;
157}
158
159const SupportedRates&
161{
162 return m_rates;
163}
164
167{
168 uint32_t size = 0;
169 size += m_ssid.GetSerializedSize ();
170 size += m_rates.GetSerializedSize ();
171 if (m_rates.GetNRates () > 8) size += m_rates.extended->GetSerializedSize ();
172 if (m_extendedCapability.has_value ()) size += m_extendedCapability->GetSerializedSize ();
173 if (m_htCapability.has_value ()) size += m_htCapability->GetSerializedSize ();
174 if (m_vhtCapability.has_value ()) size += m_vhtCapability->GetSerializedSize ();
175 if (m_heCapability.has_value ()) size += m_heCapability->GetSerializedSize ();
176 if (m_ehtCapability.has_value ()) size += m_ehtCapability->GetSerializedSize ();
177 return size;
178}
179
180TypeId
182{
183 static TypeId tid = TypeId ("ns3::MgtProbeRequestHeader")
184 .SetParent<Header> ()
185 .SetGroupName ("Wifi")
186 .AddConstructor<MgtProbeRequestHeader> ()
187 ;
188 return tid;
189}
190
191TypeId
193{
194 return GetTypeId ();
195}
196
197void
198MgtProbeRequestHeader::Print (std::ostream &os) const
199{
200 os << "ssid=" << m_ssid << ", "
201 << "rates=" << m_rates << ", ";
202 if (m_extendedCapability.has_value ()) os << "Extended Capabilities=" << *m_extendedCapability << " , ";
203 if (m_htCapability.has_value ()) os << "HT Capabilities=" << *m_htCapability << " , ";
204 if (m_vhtCapability.has_value ()) os << "VHT Capabilities=" << *m_vhtCapability << " , ";
205 if (m_heCapability.has_value ()) os << "HE Capabilities=" << *m_heCapability << " , ";
206 if (m_ehtCapability.has_value ()) os << "EHT Capabilities=" << *m_ehtCapability;
207}
208
209void
211{
213 i = m_ssid.Serialize (i);
214 i = m_rates.Serialize (i);
215 if (m_rates.GetNRates () > 8) i = m_rates.extended->Serialize (i);
216 if (m_extendedCapability.has_value ()) i = m_extendedCapability->Serialize (i);
217 if (m_htCapability.has_value ()) i = m_htCapability->Serialize (i);
218 if (m_vhtCapability.has_value ()) i = m_vhtCapability->Serialize (i);
219 if (m_heCapability.has_value ()) i = m_heCapability->Serialize (i);
220 if (m_ehtCapability.has_value ()) i = m_ehtCapability->Serialize (i);
221}
222
225{
227 i = m_ssid.Deserialize (i);
228 i = m_rates.Deserialize (i);
235 return i.GetDistanceFrom (start);
236}
237
238
239/***********************************************************
240 * Probe Response
241 ***********************************************************/
242
244
246{
247}
248
250{
251}
252
253uint64_t
255{
256 return m_timestamp;
257}
258
259const Ssid&
261{
262 return m_ssid;
263}
264
265uint64_t
267{
268 return m_beaconInterval;
269}
270
271const SupportedRates&
273{
274 return m_rates;
275}
276
277void
279{
280 m_capability = capabilities;
281}
282
283void
285{
286 m_capability = std::move (capabilities);
287}
288
291{
292 return m_capability;
293}
294
295void
297{
298 m_extendedCapability = extendedCapabilities;
299}
300
301void
303{
304 m_extendedCapability = std::move (extendedCapabilities);
305}
306
307const std::optional<ExtendedCapabilities>&
309{
311}
312
313void
315{
316 m_htCapability = htCapabilities;
317}
318
319void
321{
322 m_htCapability = std::move (htCapabilities);
323}
324
325const std::optional<HtCapabilities>&
327{
328 return m_htCapability;
329}
330
331void
333{
334 m_htOperation = htOperation;
335}
336
337void
339{
340 m_htOperation = std::move (htOperation);
341}
342
343const std::optional<HtOperation>&
345{
346 return m_htOperation;
347}
348
349void
351{
352 m_vhtCapability = vhtCapabilities;
353}
354
355void
357{
358 m_vhtCapability = std::move (vhtCapabilities);
359}
360
361const std::optional<VhtCapabilities>&
363{
364 return m_vhtCapability;
365}
366
367void
369{
370 m_vhtOperation = vhtOperation;
371}
372
373void
375{
376 m_vhtOperation = std::move (vhtOperation);
377}
378
379const std::optional<VhtOperation>&
381{
382 return m_vhtOperation;
383}
384
385void
387{
388 m_heCapability = heCapabilities;
389}
390
391void
393{
394 m_heCapability = std::move (heCapabilities);
395}
396
397const std::optional<HeCapabilities>&
399{
400 return m_heCapability;
401}
402
403void
405{
406 m_heOperation = heOperation;
407}
408
409void
411{
412 m_heOperation = std::move (heOperation);
413}
414
415const std::optional<HeOperation>&
417{
418 return m_heOperation;
419}
420
421void
423{
424 m_ehtCapability = ehtCapabilities;
425}
426
427void
429{
430 m_ehtCapability = std::move (ehtCapabilities);
431}
432
433const std::optional<EhtCapabilities>&
435{
436 return m_ehtCapability;
437}
438
439void
441{
442 m_ssid = ssid;
443}
444
445void
447{
448 m_ssid = std::move (ssid);
449}
450
451void
453{
454 m_beaconInterval = us;
455}
456
457void
459{
460 m_rates = rates;
461}
462
463void
465{
466 m_rates = std::move (rates);
467}
468
469void
471{
472 m_dsssParameterSet = dsssParameterSet;
473}
474
475void
477{
478 m_dsssParameterSet = std::move (dsssParameterSet);
479}
480
481const std::optional<DsssParameterSet>&
483{
484 return m_dsssParameterSet;
485}
486
487void
489{
490 m_erpInformation = erpInformation;
491}
492
493void
495{
496 m_erpInformation = std::move (erpInformation);
497}
498
499const std::optional<ErpInformation>&
501{
502 return m_erpInformation;
503}
504
505void
507{
508 m_edcaParameterSet = edcaParameters;
509}
510
511void
513{
514 m_edcaParameterSet = std::move (edcaParameters);
515}
516
517void
519{
520 m_muEdcaParameterSet = muEdcaParameters;
521}
522
523void
525{
526 m_muEdcaParameterSet = std::move (muEdcaParameters);
527}
528
529void
531{
532 m_reducedNeighborReport = reducedNeighborReport;
533}
534
535void
537{
538 m_reducedNeighborReport = std::move (reducedNeighborReport);
539}
540
541void
543{
544 m_multiLinkElement = multiLinkElement;
545}
546
547void
549{
550 m_multiLinkElement = std::move (multiLinkElement);
551}
552
553const std::optional<EdcaParameterSet>&
555{
556 return m_edcaParameterSet;
557}
558
559const std::optional<MuEdcaParameterSet>&
561{
563}
564
565const std::optional<ReducedNeighborReport>&
567{
569}
570
571const std::optional<MultiLinkElement>&
573{
574 return m_multiLinkElement;
575}
576
577TypeId
579{
580 static TypeId tid = TypeId ("ns3::MgtProbeResponseHeader")
581 .SetParent<Header> ()
582 .SetGroupName ("Wifi")
583 .AddConstructor<MgtProbeResponseHeader> ()
584 ;
585 return tid;
586}
587
588TypeId
590{
591 return GetTypeId ();
592}
593
596{
597 uint32_t size = 0;
598 size += 8; //timestamp
599 size += 2; //beacon interval
601 size += m_ssid.GetSerializedSize ();
602 size += m_rates.GetSerializedSize ();
603 if (m_dsssParameterSet.has_value ()) size += m_dsssParameterSet->GetSerializedSize ();
604 if (m_erpInformation.has_value ()) size += m_erpInformation->GetSerializedSize ();
605 if (m_rates.GetNRates () > 8) size += m_rates.extended->GetSerializedSize ();
606 if (m_edcaParameterSet.has_value ()) size += m_edcaParameterSet->GetSerializedSize ();
607 if (m_extendedCapability.has_value ()) size += m_extendedCapability->GetSerializedSize ();
608 if (m_htCapability.has_value ()) size += m_htCapability->GetSerializedSize ();
609 if (m_htOperation.has_value ()) size += m_htOperation->GetSerializedSize ();
610 if (m_vhtCapability.has_value ()) size += m_vhtCapability->GetSerializedSize ();
611 if (m_vhtOperation.has_value ()) size += m_vhtOperation->GetSerializedSize ();
612 if (m_reducedNeighborReport.has_value ()) size += m_reducedNeighborReport->GetSerializedSize ();
613 if (m_heCapability.has_value ()) size += m_heCapability->GetSerializedSize ();
614 if (m_heOperation.has_value ()) size += m_heOperation->GetSerializedSize ();
615 if (m_muEdcaParameterSet.has_value ()) size += m_muEdcaParameterSet->GetSerializedSize ();
616 if (m_multiLinkElement.has_value ()) size += m_multiLinkElement->GetSerializedSize ();
617 if (m_ehtCapability.has_value ()) size += m_ehtCapability->GetSerializedSize ();
618 return size;
619}
620
621void
622MgtProbeResponseHeader::Print (std::ostream &os) const
623{
624 os << "ssid=" << m_ssid << ", "
625 << "rates=" << m_rates << ", ";
626 if (m_erpInformation.has_value ()) os << "ERP information=" << *m_erpInformation << ", ";
627 if (m_extendedCapability.has_value ()) os << "Extended Capabilities=" << *m_extendedCapability << " , ";
628 if (m_htCapability.has_value ()) os << "HT Capabilities=" << *m_htCapability << " , ";
629 if (m_htOperation.has_value ()) os << "HT Operation=" << *m_htOperation << " , ";
630 if (m_vhtCapability.has_value ()) os << "VHT Capabilities=" << *m_vhtCapability << " , ";
631 if (m_vhtOperation.has_value ()) os << "VHT Operation=" << *m_vhtOperation << " , ";
632 if (m_heCapability.has_value ()) os << "HE Capabilities=" << *m_heCapability << " , ";
633 if (m_heOperation.has_value ()) os << "HE Operation=" << *m_heOperation << " , ";
634 if (m_ehtCapability.has_value ()) os << "EHT Capabilities=" << *m_ehtCapability;
635}
636
637void
639{
641 i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ());
642 i.WriteHtolsbU16 (static_cast<uint16_t> (m_beaconInterval / 1024));
643 i = m_capability.Serialize (i);
644 i = m_ssid.Serialize (i);
645 i = m_rates.Serialize (i);
646 if (m_dsssParameterSet.has_value ()) i = m_dsssParameterSet->Serialize (i);
647 if (m_erpInformation.has_value ()) i = m_erpInformation->Serialize (i);
648 if (m_rates.GetNRates () > 8) i = m_rates.extended->Serialize (i);
649 if (m_edcaParameterSet.has_value ()) i = m_edcaParameterSet->Serialize (i);
650 if (m_extendedCapability.has_value ()) i = m_extendedCapability->Serialize (i);
651 if (m_htCapability.has_value ()) i = m_htCapability->Serialize (i);
652 if (m_htOperation.has_value ()) i = m_htOperation->Serialize (i);
653 if (m_vhtCapability.has_value ()) i = m_vhtCapability->Serialize (i);
654 if (m_vhtOperation.has_value ()) i = m_vhtOperation->Serialize (i);
655 if (m_reducedNeighborReport.has_value ()) i = m_reducedNeighborReport->Serialize (i);
656 if (m_heCapability.has_value ()) i = m_heCapability->Serialize (i);
657 if (m_heOperation.has_value ()) i = m_heOperation->Serialize (i);
658 if (m_muEdcaParameterSet.has_value ()) i = m_muEdcaParameterSet->Serialize (i);
659 if (m_multiLinkElement.has_value ()) i = m_multiLinkElement->Serialize (i);
660 if (m_ehtCapability.has_value ()) i = m_ehtCapability->Serialize (i);
661}
662
665{
666 Buffer::Iterator tmp, i = start;
669 m_beaconInterval *= 1024;
671 i = m_ssid.Deserialize (i);
672 i = m_rates.Deserialize (i);
688
689 return i.GetDistanceFrom (start);
690}
691
692
693/***********************************************************
694 * Beacons
695 ***********************************************************/
696
698
699/* static */
700TypeId
702{
703 static TypeId tid = TypeId ("ns3::MgtBeaconHeader")
705 .SetGroupName ("Wifi")
706 .AddConstructor<MgtBeaconHeader> ()
707 ;
708 return tid;
709}
710
711
712/***********************************************************
713 * Assoc Request
714 ***********************************************************/
715
717
719 : m_listenInterval (0)
720{
721}
722
724{
725}
726
727void
729{
730 m_ssid = ssid;
731}
732
733void
735{
736 m_ssid = std::move (ssid);
737}
738
739void
741{
742 m_rates = rates;
743}
744
745void
747{
748 m_rates = std::move (rates);
749}
750
751void
753{
754 m_listenInterval = interval;
755}
756
757void
759{
760 m_capability = capabilities;
761}
762
763void
765{
766 m_capability = std::move (capabilities);
767}
768
771{
772 return m_capability;
773}
774
775void
777{
778 m_extendedCapability = extendedCapabilities;
779}
780
781void
783{
784 m_extendedCapability = std::move (extendedCapabilities);
785}
786
787const std::optional<ExtendedCapabilities>&
789{
791}
792
793void
795{
796 m_htCapability = htCapabilities;
797}
798
799void
801{
802 m_htCapability = std::move (htCapabilities);
803}
804
805const std::optional<HtCapabilities>&
807{
808 return m_htCapability;
809}
810
811void
813{
814 m_vhtCapability = vhtCapabilities;
815}
816
817void
819{
820 m_vhtCapability = std::move (vhtCapabilities);
821}
822
823const std::optional<VhtCapabilities>&
825{
826 return m_vhtCapability;
827}
828
829void
831{
832 m_heCapability = heCapabilities;
833}
834
835void
837{
838 m_heCapability = std::move (heCapabilities);
839}
840
841const std::optional<HeCapabilities>&
843{
844 return m_heCapability;
845}
846
847void
849{
850 m_ehtCapability = ehtCapabilities;
851}
852
853void
855{
856 m_ehtCapability = std::move (ehtCapabilities);
857}
858
859const std::optional<EhtCapabilities>&
861{
862 return m_ehtCapability;
863}
864
865void
867{
868 m_multiLinkElement = multiLinkElement;
869}
870
871void
873{
874 m_multiLinkElement = std::move (multiLinkElement);
875}
876
877const std::optional<MultiLinkElement>&
879{
880 return m_multiLinkElement;
881}
882
883const Ssid&
885{
886 return m_ssid;
887}
888
889const SupportedRates&
891{
892 return m_rates;
893}
894
895uint16_t
897{
898 return m_listenInterval;
899}
900
901TypeId
903{
904 static TypeId tid = TypeId ("ns3::MgtAssocRequestHeader")
905 .SetParent<Header> ()
906 .SetGroupName ("Wifi")
907 .AddConstructor<MgtAssocRequestHeader> ()
908 ;
909 return tid;
910}
911
912TypeId
914{
915 return GetTypeId ();
916}
917
920{
921 uint32_t size = 0;
923 size += 2;
924 size += m_ssid.GetSerializedSize ();
925 size += m_rates.GetSerializedSize ();
926 if (m_rates.GetNRates () > 8) size += m_rates.extended->GetSerializedSize ();
927 if (m_extendedCapability.has_value ()) size += m_extendedCapability->GetSerializedSize ();
928 if (m_htCapability.has_value ()) size += m_htCapability->GetSerializedSize ();
929 if (m_vhtCapability.has_value ()) size += m_vhtCapability->GetSerializedSize ();
930 if (m_heCapability.has_value ()) size += m_heCapability->GetSerializedSize ();
931 if (m_multiLinkElement.has_value ()) size += m_multiLinkElement->GetSerializedSize ();
932 if (m_ehtCapability.has_value ()) size += m_ehtCapability->GetSerializedSize ();
933 return size;
934}
935
936void
937MgtAssocRequestHeader::Print (std::ostream &os) const
938{
939 os << "ssid=" << m_ssid << ", "
940 << "rates=" << m_rates << ", ";
941 if (m_extendedCapability.has_value ()) os << "Extended Capabilities=" << *m_extendedCapability << " , ";
942 if (m_htCapability.has_value ()) os << "HT Capabilities=" << *m_htCapability << " , ";
943 if (m_vhtCapability.has_value ()) os << "VHT Capabilities=" << *m_vhtCapability << " , ";
944 if (m_heCapability.has_value ()) os << "HE Capabilities=" << *m_heCapability << " , ";
945 if (m_ehtCapability.has_value ()) os << "EHT Capabilities=" << *m_ehtCapability;
946}
947
948void
950{
952 i = m_capability.Serialize (i);
954 i = m_ssid.Serialize (i);
955 i = m_rates.Serialize (i);
956 if (m_rates.GetNRates () > 8) i = m_rates.extended->Serialize (i);
957 if (m_extendedCapability.has_value ()) i = m_extendedCapability->Serialize (i);
958 if (m_htCapability.has_value ()) i = m_htCapability->Serialize (i);
959 if (m_vhtCapability.has_value ()) i = m_vhtCapability->Serialize (i);
960 if (m_heCapability.has_value ()) i = m_heCapability->Serialize (i);
961 if (m_multiLinkElement.has_value ()) i = m_multiLinkElement->Serialize (i);
962 if (m_ehtCapability.has_value ()) i = m_ehtCapability->Serialize (i);
963}
964
967{
968 Buffer::Iterator tmp, i = start;
971 i = m_ssid.Deserialize (i);
972 i = m_rates.Deserialize (i);
981 return i.GetDistanceFrom (start);
982}
983
984
985/***********************************************************
986 * Ressoc Request
987 ***********************************************************/
988
990
992 : m_currentApAddr (Mac48Address ())
993{
994}
995
997{
998}
999
1000void
1002{
1003 m_ssid = ssid;
1004}
1005
1006void
1008{
1009 m_ssid = std::move (ssid);
1010}
1011
1012void
1014{
1015 m_rates = rates;
1016}
1017
1018void
1020{
1021 m_rates = std::move (rates);
1022}
1023
1024void
1026{
1027 m_listenInterval = interval;
1028}
1029
1030void
1032{
1033 m_capability = capabilities;
1034}
1035
1036void
1038{
1039 m_capability = std::move (capabilities);
1040}
1041
1044{
1045 return m_capability;
1046}
1047
1048void
1050{
1051 m_extendedCapability = extendedCapabilities;
1052}
1053
1054void
1056{
1057 m_extendedCapability = std::move (extendedCapabilities);
1058}
1059
1060const std::optional<ExtendedCapabilities>&
1062{
1063 return m_extendedCapability;
1064}
1065
1066void
1068{
1069 m_htCapability = htCapabilities;
1070}
1071
1072void
1074{
1075 m_htCapability = std::move (htCapabilities);
1076}
1077
1078const std::optional<HtCapabilities>&
1080{
1081 return m_htCapability;
1082}
1083
1084void
1086{
1087 m_vhtCapability = vhtCapabilities;
1088}
1089
1090void
1092{
1093 m_vhtCapability = std::move (vhtCapabilities);
1094}
1095
1096const std::optional<VhtCapabilities>&
1098{
1099 return m_vhtCapability;
1100}
1101
1102void
1104{
1105 m_heCapability = heCapabilities;
1106}
1107
1108void
1110{
1111 m_heCapability = std::move (heCapabilities);
1112}
1113
1114const std::optional<HeCapabilities>&
1116{
1117 return m_heCapability;
1118}
1119
1120void
1122{
1123 m_ehtCapability = ehtCapabilities;
1124}
1125
1126void
1128{
1129 m_ehtCapability = std::move (ehtCapabilities);
1130}
1131
1132const std::optional<EhtCapabilities>&
1134{
1135 return m_ehtCapability;
1136}
1137
1138void
1140{
1141 m_multiLinkElement = multiLinkElement;
1142}
1143
1144void
1146{
1147 m_multiLinkElement = std::move (multiLinkElement);
1148}
1149
1150const std::optional<MultiLinkElement>&
1152{
1153 return m_multiLinkElement;
1154}
1155
1156const Ssid&
1158{
1159 return m_ssid;
1160}
1161
1162const SupportedRates&
1164{
1165 return m_rates;
1166}
1167
1168uint16_t
1170{
1171 return m_listenInterval;
1172}
1173
1174void
1176{
1177 m_currentApAddr = currentApAddr;
1178}
1179
1180TypeId
1182{
1183 static TypeId tid = TypeId ("ns3::MgtReassocRequestHeader")
1184 .SetParent<Header> ()
1185 .SetGroupName ("Wifi")
1186 .AddConstructor<MgtReassocRequestHeader> ()
1187 ;
1188 return tid;
1189}
1190
1191TypeId
1193{
1194 return GetTypeId ();
1195}
1196
1199{
1200 uint32_t size = 0;
1202 size += 2; //listen interval
1203 size += 6; //current AP address
1204 size += m_ssid.GetSerializedSize ();
1205 size += m_rates.GetSerializedSize ();
1206 if (m_rates.GetNRates () > 8) size += m_rates.extended->GetSerializedSize ();
1207 if (m_extendedCapability.has_value ()) size += m_extendedCapability->GetSerializedSize ();
1208 if (m_htCapability.has_value ()) size += m_htCapability->GetSerializedSize ();
1209 if (m_vhtCapability.has_value ()) size += m_vhtCapability->GetSerializedSize ();
1210 if (m_heCapability.has_value ()) size += m_heCapability->GetSerializedSize ();
1211 if (m_multiLinkElement.has_value ()) size += m_multiLinkElement->GetSerializedSize ();
1212 if (m_ehtCapability.has_value ()) size += m_ehtCapability->GetSerializedSize ();
1213 return size;
1214}
1215
1216void
1217MgtReassocRequestHeader::Print (std::ostream &os) const
1218{
1219 os << "current AP address=" << m_currentApAddr << ", "
1220 << "ssid=" << m_ssid << ", "
1221 << "rates=" << m_rates << ", ";
1222 if (m_extendedCapability.has_value ()) os << "Extended Capabilities=" << *m_extendedCapability << " , ";
1223 if (m_htCapability.has_value ()) os << "HT Capabilities=" << *m_htCapability << " , ";
1224 if (m_vhtCapability.has_value ()) os << "VHT Capabilities=" << *m_vhtCapability << " , ";
1225 if (m_heCapability.has_value ()) os << "HE Capabilities=" << *m_heCapability << " , ";
1226 if (m_ehtCapability.has_value ()) os << "EHT Capabilities=" << *m_ehtCapability;
1227}
1228
1229void
1231{
1233 i = m_capability.Serialize (i);
1236 i = m_ssid.Serialize (i);
1237 i = m_rates.Serialize (i);
1238 if (m_rates.GetNRates () > 8) i = m_rates.extended->Serialize (i);
1239 if (m_extendedCapability.has_value ()) i = m_extendedCapability->Serialize (i);
1240 if (m_htCapability.has_value ()) i = m_htCapability->Serialize (i);
1241 if (m_vhtCapability.has_value ()) i = m_vhtCapability->Serialize (i);
1242 if (m_heCapability.has_value ()) i = m_heCapability->Serialize (i);
1243 if (m_multiLinkElement.has_value ()) i = m_multiLinkElement->Serialize (i);
1244 if (m_ehtCapability.has_value ()) i = m_ehtCapability->Serialize (i);
1245}
1246
1249{
1250 Buffer::Iterator tmp, i = start;
1251 i = m_capability.Deserialize (i);
1254 i = m_ssid.Deserialize (i);
1255 i = m_rates.Deserialize (i);
1264 return i.GetDistanceFrom (start);
1265}
1266
1267
1268/***********************************************************
1269 * Assoc/Reassoc Response
1270 ***********************************************************/
1271
1273
1275 : m_aid (0)
1276{
1277}
1278
1280{
1281}
1282
1285{
1286 return m_code;
1287}
1288
1289const SupportedRates&
1291{
1292 return m_rates;
1293}
1294
1295void
1297{
1298 m_code = code;
1299}
1300
1301void
1303{
1304 m_rates = rates;
1305}
1306
1307void
1309{
1310 m_rates = std::move (rates);
1311}
1312
1313void
1315{
1316 m_capability = capabilities;
1317}
1318
1319void
1321{
1322 m_capability = std::move (capabilities);
1323}
1324
1327{
1328 return m_capability;
1329}
1330
1331void
1333{
1334 m_extendedCapability = extendedCapabilities;
1335}
1336
1337void
1339{
1340 m_extendedCapability = std::move (extendedCapabilities);
1341}
1342
1343const std::optional<ExtendedCapabilities>&
1345{
1346 return m_extendedCapability;
1347}
1348
1349void
1351{
1352 m_htCapability = htCapabilities;
1353}
1354
1355void
1357{
1358 m_htCapability = std::move (htCapabilities);
1359}
1360
1361const std::optional<HtCapabilities>&
1363{
1364 return m_htCapability;
1365}
1366
1367void
1369{
1370 m_htOperation = htOperation;
1371}
1372
1373void
1375{
1376 m_htOperation = std::move (htOperation);
1377}
1378
1379const std::optional<HtOperation>&
1381{
1382 return m_htOperation;
1383}
1384
1385void
1387{
1388 m_vhtCapability = vhtCapabilities;
1389}
1390
1391void
1393{
1394 m_vhtCapability = std::move (vhtCapabilities);
1395}
1396
1397const std::optional<VhtCapabilities>&
1399{
1400 return m_vhtCapability;
1401}
1402
1403void
1405{
1406 m_vhtOperation = vhtOperation;
1407}
1408
1409void
1411{
1412 m_vhtOperation = std::move (vhtOperation);
1413}
1414
1415const std::optional<VhtOperation>&
1417{
1418 return m_vhtOperation;
1419}
1420
1421void
1423{
1424 m_heCapability = heCapabilities;
1425}
1426
1427void
1429{
1430 m_heCapability = std::move (heCapabilities);
1431}
1432
1433const std::optional<HeCapabilities>&
1435{
1436 return m_heCapability;
1437}
1438
1439void
1441{
1442 m_heOperation = heOperation;
1443}
1444
1445void
1447{
1448 m_heOperation = std::move (heOperation);
1449}
1450
1451const std::optional<HeOperation>&
1453{
1454 return m_heOperation;
1455}
1456
1457void
1459{
1460 m_ehtCapability = ehtCapabilities;
1461}
1462
1463void
1465{
1466 m_ehtCapability = std::move (ehtCapabilities);
1467}
1468
1469const std::optional<EhtCapabilities>&
1471{
1472 return m_ehtCapability;
1473}
1474
1475void
1477{
1478 m_multiLinkElement = multiLinkElement;
1479}
1480
1481void
1483{
1484 m_multiLinkElement = std::move (multiLinkElement);
1485}
1486
1487const std::optional<MultiLinkElement>&
1489{
1490 return m_multiLinkElement;
1491}
1492
1493void
1495{
1496 m_aid = aid;
1497}
1498
1499uint16_t
1501{
1502 return m_aid;
1503}
1504
1505void
1507{
1508 m_erpInformation = erpInformation;
1509}
1510
1511void
1513{
1514 m_erpInformation = std::move (erpInformation);
1515}
1516
1517const std::optional<ErpInformation>&
1519{
1520 return m_erpInformation;
1521}
1522
1523void
1525{
1526 m_edcaParameterSet = edcaparameters;
1527}
1528
1529void
1531{
1532 m_edcaParameterSet = std::move (edcaparameters);
1533}
1534
1535void
1537{
1538 m_muEdcaParameterSet = muEdcaParameters;
1539}
1540
1541void
1543{
1544 m_muEdcaParameterSet = std::move (muEdcaParameters);
1545}
1546
1547const std::optional<EdcaParameterSet>&
1549{
1550 return m_edcaParameterSet;
1551}
1552
1553const std::optional<MuEdcaParameterSet>&
1555{
1556 return m_muEdcaParameterSet;
1557}
1558
1559TypeId
1561{
1562 static TypeId tid = TypeId ("ns3::MgtAssocResponseHeader")
1563 .SetParent<Header> ()
1564 .SetGroupName ("Wifi")
1565 .AddConstructor<MgtAssocResponseHeader> ()
1566 ;
1567 return tid;
1568}
1569
1570TypeId
1572{
1573 return GetTypeId ();
1574}
1575
1578{
1579 uint32_t size = 0;
1581 size += m_code.GetSerializedSize ();
1582 size += 2; //aid
1583 size += m_rates.GetSerializedSize ();
1584 if (m_erpInformation.has_value ()) size += m_erpInformation->GetSerializedSize ();
1585 if (m_rates.GetNRates () > 8) size += m_rates.extended->GetSerializedSize ();
1586 if (m_edcaParameterSet.has_value ()) size += m_edcaParameterSet->GetSerializedSize ();
1587 if (m_extendedCapability.has_value ()) size += m_extendedCapability->GetSerializedSize ();
1588 if (m_htCapability.has_value ()) size += m_htCapability->GetSerializedSize ();
1589 if (m_htOperation.has_value ()) size += m_htOperation->GetSerializedSize ();
1590 if (m_vhtCapability.has_value ()) size += m_vhtCapability->GetSerializedSize ();
1591 if (m_vhtOperation.has_value ()) size += m_vhtOperation->GetSerializedSize ();
1592 if (m_heCapability.has_value ()) size += m_heCapability->GetSerializedSize ();
1593 if (m_heOperation.has_value ()) size += m_heOperation->GetSerializedSize ();
1594 if (m_muEdcaParameterSet.has_value ()) size += m_muEdcaParameterSet->GetSerializedSize ();
1595 if (m_multiLinkElement.has_value ()) size += m_multiLinkElement->GetSerializedSize ();
1596 if (m_ehtCapability.has_value ()) size += m_ehtCapability->GetSerializedSize ();
1597 return size;
1598}
1599
1600void
1601MgtAssocResponseHeader::Print (std::ostream &os) const
1602{
1603 os << "status code=" << m_code << ", "
1604 << "aid=" << m_aid << ", "
1605 << "rates=" << m_rates << ", ";
1606 if (m_erpInformation.has_value ()) os << "ERP information=" << *m_erpInformation << ", ";
1607 if (m_extendedCapability.has_value ()) os << "Extended Capabilities=" << *m_extendedCapability << " , ";
1608 if (m_htCapability.has_value ()) os << "HT Capabilities=" << *m_htCapability << " , ";
1609 if (m_htOperation.has_value ()) os << "HT Operation=" << *m_htOperation << " , ";
1610 if (m_vhtCapability.has_value ()) os << "VHT Capabilities=" << *m_vhtCapability << " , ";
1611 if (m_vhtOperation.has_value ()) os << "VHT Operation=" << *m_vhtOperation << " , ";
1612 if (m_heCapability.has_value ()) os << "HE Capabilities=" << *m_heCapability << " , ";
1613 if (m_heOperation.has_value ()) os << "HE Operation=" << *m_heOperation << " , ";
1614 if (m_ehtCapability.has_value ()) os << "EHT Capabilities=" << *m_ehtCapability;
1615}
1616
1617void
1619{
1621 i = m_capability.Serialize (i);
1622 i = m_code.Serialize (i);
1624 i = m_rates.Serialize (i);
1625 if (m_erpInformation.has_value ()) i = m_erpInformation->Serialize (i);
1626 if (m_rates.GetNRates () > 8) i = m_rates.extended->Serialize (i);
1627 if (m_edcaParameterSet.has_value ()) i = m_edcaParameterSet->Serialize (i);
1628 if (m_extendedCapability.has_value ()) i = m_extendedCapability->Serialize (i);
1629 if (m_htCapability.has_value ()) i = m_htCapability->Serialize (i);
1630 if (m_htOperation.has_value ()) i = m_htOperation->Serialize (i);
1631 if (m_vhtCapability.has_value ()) i = m_vhtCapability->Serialize (i);
1632 if (m_vhtOperation.has_value ()) i = m_vhtOperation->Serialize (i);
1633 if (m_heCapability.has_value ()) i = m_heCapability->Serialize (i);
1634 if (m_heOperation.has_value ()) i = m_heOperation->Serialize (i);
1635 if (m_muEdcaParameterSet.has_value ()) i = m_muEdcaParameterSet->Serialize (i);
1636 if (m_multiLinkElement.has_value ()) i = m_multiLinkElement->Serialize (i);
1637 if (m_ehtCapability.has_value ()) i = m_ehtCapability->Serialize (i);
1638}
1639
1642{
1643 Buffer::Iterator tmp, i = start;
1644 i = m_capability.Deserialize (i);
1645 i = m_code.Deserialize (i);
1646 m_aid = i.ReadLsbtohU16 ();
1647 i = m_rates.Deserialize (i);
1662 return i.GetDistanceFrom (start);
1663}
1664
1665
1666/**********************************************************
1667 * ActionFrame
1668 **********************************************************/
1670{
1671}
1672
1674{
1675}
1676
1677void
1680{
1681 m_category = static_cast<uint8_t> (type);
1682 switch (type)
1683 {
1684 case QOS:
1685 {
1686 m_actionValue = static_cast<uint8_t> (action.qos);
1687 break;
1688 }
1689 case BLOCK_ACK:
1690 {
1691 m_actionValue = static_cast<uint8_t> (action.blockAck);
1692 break;
1693 }
1694 case PUBLIC:
1695 {
1696 m_actionValue = static_cast<uint8_t> (action.publicAction);
1697 break;
1698 }
1699 case RADIO_MEASUREMENT:
1700 {
1701 m_actionValue = static_cast<uint8_t> (action.radioMeasurementAction);
1702 break;
1703 }
1704 case MESH:
1705 {
1706 m_actionValue = static_cast<uint8_t> (action.meshAction);
1707 break;
1708 }
1709 case MULTIHOP:
1710 {
1711 m_actionValue = static_cast<uint8_t> (action.multihopAction);
1712 break;
1713 }
1714 case SELF_PROTECTED:
1715 {
1716 m_actionValue = static_cast<uint8_t> (action.selfProtectedAction);
1717 break;
1718 }
1719 case DMG:
1720 {
1721 m_actionValue = static_cast<uint8_t> (action.dmgAction);
1722 break;
1723 }
1724 case FST:
1725 {
1726 m_actionValue = static_cast<uint8_t> (action.fstAction);
1727 break;
1728 }
1729 case UNPROTECTED_DMG:
1730 {
1731 m_actionValue = static_cast<uint8_t> (action.unprotectedDmgAction);
1732 break;
1733 }
1735 {
1736 break;
1737 }
1738 }
1739}
1740
1743{
1744 switch (m_category)
1745 {
1746 case QOS:
1747 return QOS;
1748 case BLOCK_ACK:
1749 return BLOCK_ACK;
1750 case PUBLIC:
1751 return PUBLIC;
1752 case RADIO_MEASUREMENT:
1753 return RADIO_MEASUREMENT;
1754 case MESH:
1755 return MESH;
1756 case MULTIHOP:
1757 return MULTIHOP;
1758 case SELF_PROTECTED:
1759 return SELF_PROTECTED;
1760 case DMG:
1761 return DMG;
1762 case FST:
1763 return FST;
1764 case UNPROTECTED_DMG:
1765 return UNPROTECTED_DMG;
1768 default:
1769 NS_FATAL_ERROR ("Unknown action value");
1770 return SELF_PROTECTED;
1771 }
1772}
1773
1776{
1777 ActionValue retval;
1778 retval.selfProtectedAction = PEER_LINK_OPEN; //Needs to be initialized to something to quiet valgrind in default cases
1779 switch (m_category)
1780 {
1781 case QOS:
1782 switch (m_actionValue)
1783 {
1784 case ADDTS_REQUEST:
1785 retval.qos = ADDTS_REQUEST;
1786 break;
1787 case ADDTS_RESPONSE:
1788 retval.qos = ADDTS_RESPONSE;
1789 break;
1790 case DELTS:
1791 retval.qos = DELTS;
1792 break;
1793 case SCHEDULE:
1794 retval.qos = SCHEDULE;
1795 break;
1796 case QOS_MAP_CONFIGURE:
1797 retval.qos = QOS_MAP_CONFIGURE;
1798 break;
1799 default:
1800 NS_FATAL_ERROR ("Unknown qos action code");
1801 retval.qos = ADDTS_REQUEST; /* quiet compiler */
1802 }
1803 break;
1804
1805 case BLOCK_ACK:
1806 switch (m_actionValue)
1807 {
1810 break;
1813 break;
1814 case BLOCK_ACK_DELBA:
1815 retval.blockAck = BLOCK_ACK_DELBA;
1816 break;
1817 default:
1818 NS_FATAL_ERROR ("Unknown block ack action code");
1819 retval.blockAck = BLOCK_ACK_ADDBA_REQUEST; /* quiet compiler */
1820 }
1821 break;
1822
1823 case PUBLIC:
1824 switch (m_actionValue)
1825 {
1826 case QAB_REQUEST:
1827 retval.publicAction = QAB_REQUEST;
1828 break;
1829 case QAB_RESPONSE:
1830 retval.publicAction = QAB_RESPONSE;
1831 break;
1832 default:
1833 NS_FATAL_ERROR ("Unknown public action code");
1834 retval.publicAction = QAB_REQUEST; /* quiet compiler */
1835 }
1836 break;
1837
1838 case RADIO_MEASUREMENT:
1839 switch (m_actionValue)
1840 {
1843 break;
1846 break;
1849 break;
1852 break;
1855 break;
1858 break;
1859 default:
1860 NS_FATAL_ERROR ("Unknown radio measurement action code");
1861 retval.radioMeasurementAction = RADIO_MEASUREMENT_REQUEST; /* quiet compiler */
1862 }
1863 break;
1864
1865 case SELF_PROTECTED:
1866 switch (m_actionValue)
1867 {
1868 case PEER_LINK_OPEN:
1870 break;
1871 case PEER_LINK_CONFIRM:
1873 break;
1874 case PEER_LINK_CLOSE:
1876 break;
1877 case GROUP_KEY_INFORM:
1879 break;
1880 case GROUP_KEY_ACK:
1882 break;
1883 default:
1884 NS_FATAL_ERROR ("Unknown mesh peering management action code");
1885 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
1886 }
1887 break;
1888
1889 case MESH:
1890 switch (m_actionValue)
1891 {
1892 case LINK_METRIC_REPORT:
1894 break;
1895 case PATH_SELECTION:
1896 retval.meshAction = PATH_SELECTION;
1897 break;
1900 break;
1903 break;
1904 case MDA_SETUP_REQUEST:
1906 break;
1907 case MDA_SETUP_REPLY:
1908 retval.meshAction = MDA_SETUP_REPLY;
1909 break;
1912 break;
1915 break;
1916 case MDAOP_SET_TEARDOWN:
1918 break;
1921 break;
1924 break;
1925 default:
1926 NS_FATAL_ERROR ("Unknown mesh peering management action code");
1927 retval.meshAction = LINK_METRIC_REPORT; /* quiet compiler */
1928 }
1929 break;
1930
1931 case MULTIHOP: //not yet supported
1932 switch (m_actionValue)
1933 {
1934 case PROXY_UPDATE: //not used so far
1936 break;
1937 case PROXY_UPDATE_CONFIRMATION: //not used so far
1939 break;
1940 default:
1941 NS_FATAL_ERROR ("Unknown mesh peering management action code");
1942 retval.multihopAction = PROXY_UPDATE; /* quiet compiler */
1943 }
1944 break;
1945
1946 case DMG:
1947 switch (m_actionValue)
1948 {
1951 break;
1954 break;
1957 break;
1960 break;
1963 break;
1966 break;
1967 case DMG_DTP_REQUEST:
1968 retval.dmgAction = DMG_DTP_REQUEST;
1969 break;
1970 case DMG_DTP_RESPONSE:
1971 retval.dmgAction = DMG_DTP_RESPONSE;
1972 break;
1975 break;
1978 break;
1981 break;
1984 break;
1985 case DMG_RLS_REQUEST:
1986 retval.dmgAction = DMG_RLS_REQUEST;
1987 break;
1988 case DMG_RLS_RESPONSE:
1989 retval.dmgAction = DMG_RLS_RESPONSE;
1990 break;
1993 break;
1994 case DMG_RLS_TEARDOWN:
1995 retval.dmgAction = DMG_RLS_TEARDOWN;
1996 break;
1999 break;
2002 break;
2003 case DMG_TPA_REQUEST:
2004 retval.dmgAction = DMG_TPA_REQUEST;
2005 break;
2006 case DMG_TPA_RESPONSE:
2007 retval.dmgAction = DMG_TPA_RESPONSE;
2008 break;
2009 case DMG_ROC_REQUEST:
2010 retval.dmgAction = DMG_ROC_REQUEST;
2011 break;
2012 case DMG_ROC_RESPONSE:
2013 retval.dmgAction = DMG_ROC_RESPONSE;
2014 break;
2015 default:
2016 NS_FATAL_ERROR ("Unknown DMG management action code");
2017 retval.dmgAction = DMG_POWER_SAVE_CONFIGURATION_REQUEST; /* quiet compiler */
2018 }
2019 break;
2020
2021 case FST:
2022 switch (m_actionValue)
2023 {
2024 case FST_SETUP_REQUEST:
2026 break;
2027 case FST_SETUP_RESPONSE:
2029 break;
2030 case FST_TEAR_DOWN:
2031 retval.fstAction = FST_TEAR_DOWN;
2032 break;
2033 case FST_ACK_REQUEST:
2034 retval.fstAction = FST_ACK_REQUEST;
2035 break;
2036 case FST_ACK_RESPONSE:
2037 retval.fstAction = FST_ACK_RESPONSE;
2038 break;
2041 break;
2042 default:
2043 NS_FATAL_ERROR ("Unknown FST management action code");
2044 retval.fstAction = FST_SETUP_REQUEST; /* quiet compiler */
2045 }
2046 break;
2047
2048 case UNPROTECTED_DMG:
2049 switch (m_actionValue)
2050 {
2053 break;
2056 break;
2059 break;
2062 break;
2065 break;
2068 break;
2069 default:
2070 NS_FATAL_ERROR ("Unknown Unprotected DMG action code");
2071 retval.unprotectedDmgAction = UNPROTECTED_DMG_ANNOUNCE; /* quiet compiler */
2072 }
2073 break;
2074
2075 default:
2076 NS_FATAL_ERROR ("Unsupported action");
2077 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
2078 }
2079 return retval;
2080}
2081
2082TypeId
2084{
2085 static TypeId tid = TypeId ("ns3::WifiActionHeader")
2086 .SetParent<Header> ()
2087 .SetGroupName ("Wifi")
2088 .AddConstructor<WifiActionHeader> ()
2089 ;
2090 return tid;
2091}
2092
2093TypeId
2095{
2096 return GetTypeId ();
2097}
2098
2099std::string
2101{
2102 switch (value)
2103 {
2104 case QOS:
2105 return "QoS";
2106 case BLOCK_ACK:
2107 return "BlockAck";
2108 case PUBLIC:
2109 return "Public";
2110 case RADIO_MEASUREMENT:
2111 return "RadioMeasurement";
2112 case MESH:
2113 return "Mesh";
2114 case MULTIHOP:
2115 return "Multihop";
2116 case SELF_PROTECTED:
2117 return "SelfProtected";
2118 case DMG:
2119 return "Dmg";
2120 case FST:
2121 return "Fst";
2122 case UNPROTECTED_DMG:
2123 return "UnprotectedDmg";
2125 return "VendorSpecificAction";
2126 default:
2127 std::ostringstream convert;
2128 convert << value;
2129 return convert.str ();
2130 }
2131}
2132
2133std::string
2135{
2136 if (value == PEER_LINK_OPEN)
2137 {
2138 return "PeerLinkOpen";
2139 }
2140 else if (value == PEER_LINK_CONFIRM)
2141 {
2142 return "PeerLinkConfirm";
2143 }
2144 else if (value == PEER_LINK_CLOSE)
2145 {
2146 return "PeerLinkClose";
2147 }
2148 else if (value == GROUP_KEY_INFORM)
2149 {
2150 return "GroupKeyInform";
2151 }
2152 else if (value == GROUP_KEY_ACK)
2153 {
2154 return "GroupKeyAck";
2155 }
2156 else
2157 {
2158 std::ostringstream convert;
2159 convert << value;
2160 return convert.str ();
2161 }
2162}
2163
2164void
2165WifiActionHeader::Print (std::ostream &os) const
2166{
2167 os << "category=" << CategoryValueToString ((CategoryValue) m_category)
2169}
2170
2173{
2174 return 2;
2175}
2176
2177void
2179{
2180 start.WriteU8 (m_category);
2181 start.WriteU8 (m_actionValue);
2182}
2183
2186{
2188 m_category = i.ReadU8 ();
2189 m_actionValue = i.ReadU8 ();
2190 return i.GetDistanceFrom (start);
2191}
2192
2193
2194/***************************************************
2195* ADDBARequest
2196****************************************************/
2197
2199
2201 : m_dialogToken (1),
2202 m_amsduSupport (1),
2203 m_bufferSize (0)
2204{
2205}
2206
2207TypeId
2209{
2210 static TypeId tid = TypeId ("ns3::MgtAddBaRequestHeader")
2211 .SetParent<Header> ()
2212 .SetGroupName ("Wifi")
2213 .AddConstructor<MgtAddBaRequestHeader> ()
2214 ;
2215 return tid;
2216}
2217
2218TypeId
2220{
2221 return GetTypeId ();
2222}
2223
2224void
2225MgtAddBaRequestHeader::Print (std::ostream &os) const
2226{
2227}
2228
2231{
2232 uint32_t size = 0;
2233 size += 1; //Dialog token
2234 size += 2; //Block ack parameter set
2235 size += 2; //Block ack timeout value
2236 size += 2; //Starting sequence control
2237 return size;
2238}
2239
2240void
2242{
2248}
2249
2252{
2254 m_dialogToken = i.ReadU8 ();
2258 return i.GetDistanceFrom (start);
2259}
2260
2261void
2263{
2264 m_policy = 0;
2265}
2266
2267void
2269{
2270 m_policy = 1;
2271}
2272
2273void
2275{
2276 NS_ASSERT (tid < 16);
2277 m_tid = tid;
2278}
2279
2280void
2282{
2284}
2285
2286void
2288{
2289 m_bufferSize = size;
2290}
2291
2292void
2294{
2295 m_startingSeq = seq;
2296}
2297
2298void
2300{
2301 m_startingSeq = (seqControl >> 4) & 0x0fff;
2302}
2303
2304void
2306{
2307 m_amsduSupport = supported;
2308}
2309
2310uint8_t
2312{
2313 return m_tid;
2314}
2315
2316bool
2318{
2319 return m_policy == 1;
2320}
2321
2322uint16_t
2324{
2325 return m_timeoutValue;
2326}
2327
2328uint16_t
2330{
2331 return m_bufferSize;
2332}
2333
2334bool
2336{
2337 return m_amsduSupport == 1;
2338}
2339
2340uint16_t
2342{
2343 return m_startingSeq;
2344}
2345
2346uint16_t
2348{
2349 return (m_startingSeq << 4) & 0xfff0;
2350}
2351
2352uint16_t
2354{
2355 uint16_t res = 0;
2356 res |= m_amsduSupport;
2357 res |= m_policy << 1;
2358 res |= m_tid << 2;
2359 res |= m_bufferSize << 6;
2360 return res;
2361}
2362
2363void
2365{
2366 m_amsduSupport = (params) & 0x01;
2367 m_policy = (params >> 1) & 0x01;
2368 m_tid = (params >> 2) & 0x0f;
2369 m_bufferSize = (params >> 6) & 0x03ff;
2370}
2371
2372
2373/***************************************************
2374* ADDBAResponse
2375****************************************************/
2376
2378
2380 : m_dialogToken (1),
2381 m_amsduSupport (1),
2382 m_bufferSize (0)
2383{
2384}
2385
2386TypeId
2388{
2389 static TypeId tid = TypeId ("ns3::MgtAddBaResponseHeader")
2390 .SetParent<Header> ()
2391 .SetGroupName ("Wifi")
2392 .AddConstructor<MgtAddBaResponseHeader> ()
2393 ;
2394 return tid;
2395}
2396
2397TypeId
2399{
2400 return GetTypeId ();
2401}
2402
2403void
2404MgtAddBaResponseHeader::Print (std::ostream &os) const
2405{
2406 os << "status code=" << m_code;
2407}
2408
2411{
2412 uint32_t size = 0;
2413 size += 1; //Dialog token
2414 size += m_code.GetSerializedSize (); //Status code
2415 size += 2; //Block ack parameter set
2416 size += 2; //Block ack timeout value
2417 return size;
2418}
2419
2420void
2422{
2425 i = m_code.Serialize (i);
2428}
2429
2432{
2434 m_dialogToken = i.ReadU8 ();
2435 i = m_code.Deserialize (i);
2438 return i.GetDistanceFrom (start);
2439}
2440
2441void
2443{
2444 m_policy = 0;
2445}
2446
2447void
2449{
2450 m_policy = 1;
2451}
2452
2453void
2455{
2456 NS_ASSERT (tid < 16);
2457 m_tid = tid;
2458}
2459
2460void
2462{
2464}
2465
2466void
2468{
2469 m_bufferSize = size;
2470}
2471
2472void
2474{
2475 m_code = code;
2476}
2477
2478void
2480{
2481 m_amsduSupport = supported;
2482}
2483
2486{
2487 return m_code;
2488}
2489
2490uint8_t
2492{
2493 return m_tid;
2494}
2495
2496bool
2498{
2499 return m_policy == 1;
2500}
2501
2502uint16_t
2504{
2505 return m_timeoutValue;
2506}
2507
2508uint16_t
2510{
2511 return m_bufferSize;
2512}
2513
2514bool
2516{
2517 return m_amsduSupport == 1;
2518}
2519
2520uint16_t
2522{
2523 uint16_t res = 0;
2524 res |= m_amsduSupport;
2525 res |= m_policy << 1;
2526 res |= m_tid << 2;
2527 res |= m_bufferSize << 6;
2528 return res;
2529}
2530
2531void
2533{
2534 m_amsduSupport = (params) & 0x01;
2535 m_policy = (params >> 1) & 0x01;
2536 m_tid = (params >> 2) & 0x0f;
2537 m_bufferSize = (params >> 6) & 0x03ff;
2538}
2539
2540
2541/***************************************************
2542* DelBa
2543****************************************************/
2544
2546
2548 : m_reasonCode (1)
2549{
2550}
2551
2552TypeId
2554{
2555 static TypeId tid = TypeId ("ns3::MgtDelBaHeader")
2556 .SetParent<Header> ()
2557 .SetGroupName ("Wifi")
2558 .AddConstructor<MgtDelBaHeader> ()
2559 ;
2560 return tid;
2561}
2562
2563TypeId
2565{
2566 return GetTypeId ();
2567}
2568
2569void
2570MgtDelBaHeader::Print (std::ostream &os) const
2571{
2572}
2573
2576{
2577 uint32_t size = 0;
2578 size += 2; //DelBa parameter set
2579 size += 2; //Reason code
2580 return size;
2581}
2582
2583void
2585{
2589}
2590
2593{
2597 return i.GetDistanceFrom (start);
2598}
2599
2600bool
2602{
2603 return m_initiator == 1;
2604}
2605
2606uint8_t
2608{
2609 NS_ASSERT (m_tid < 16);
2610 uint8_t tid = static_cast<uint8_t> (m_tid);
2611 return tid;
2612}
2613
2614void
2616{
2617 m_initiator = 1;
2618}
2619
2620void
2622{
2623 m_initiator = 0;
2624}
2625
2626void
2628{
2629 NS_ASSERT (tid < 16);
2630 m_tid = static_cast<uint16_t> (tid);
2631}
2632
2633uint16_t
2635{
2636 uint16_t res = 0;
2637 res |= m_initiator << 11;
2638 res |= m_tid << 12;
2639 return res;
2640}
2641
2642void
2644{
2645 m_initiator = (params >> 11) & 0x01;
2646 m_tid = (params >> 12) & 0x0f;
2647}
2648
2649} //namespace ns3
iterator in a Buffer instance
Definition: buffer.h:99
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:911
void WriteU8(uint8_t data)
Definition: buffer.h:869
uint8_t ReadU8(void)
Definition: buffer.h:1021
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:927
uint16_t ReadLsbtohU16(void)
Definition: buffer.cc:1066
uint64_t ReadLsbtohU64(void)
Definition: buffer.cc:1094
uint32_t GetDistanceFrom(Iterator const &o) const
Definition: buffer.cc:788
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.
uint32_t GetSerializedSize(void) const
Return the serialized size of capability information.
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:43
The HT Capabilities Information Element.
The HT Operation Information Element.
Definition: ht-operation.h:51
an EUI-48 address
Definition: mac48-address.h:44
Implement the header for management frames of type Add Block Ack request.
Definition: mgt-headers.h:1484
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:1607
void Serialize(Buffer::Iterator start) const
uint16_t GetTimeout(void) const
Return the timeout.
uint32_t Deserialize(Buffer::Iterator start)
void SetStartingSequenceControl(uint16_t seqControl)
Set sequence control with the given raw value.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:1604
bool IsImmediateBlockAck(void) const
Return whether the Block Ack policy is immediate Block Ack.
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:1602
void SetBufferSize(uint16_t size)
Set buffer size.
void SetDelayedBlockAck()
Enable delayed BlockAck.
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:1601
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
void SetImmediateBlockAck()
Enable immediate BlockAck.
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:1605
uint16_t GetBufferSize(void) const
Return the buffer size.
uint32_t GetSerializedSize(void) const
uint16_t GetStartingSequenceControl(void) const
Return the raw sequence control.
void Print(std::ostream &os) const
static TypeId GetTypeId(void)
Register this type.
uint8_t GetTid(void) const
Return the Traffic ID (TID).
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:1606
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:1603
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
uint16_t GetParameterSet(void) const
Return the raw parameter set.
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:1616
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:1727
void SetTid(uint8_t tid)
Set Traffic ID (TID).
void Print(std::ostream &os) const
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:1724
static TypeId GetTypeId(void)
Register this type.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const
bool IsImmediateBlockAck(void) const
Return whether the Block Ack policy is immediate Block Ack.
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:1722
uint16_t GetBufferSize(void) const
Return the buffer size.
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t GetParameterSet(void) const
Return the raw parameter set.
uint16_t GetTimeout(void) const
Return the timeout.
void SetTimeout(uint16_t timeout)
Set timeout.
uint8_t m_policy
Block ACK policy.
Definition: mgt-headers.h:1725
void SetBufferSize(uint16_t size)
Set buffer size.
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:1728
void SetStatusCode(StatusCode code)
Set the status code.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:1726
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint8_t GetTid(void) const
Return the Traffic ID (TID).
uint32_t Deserialize(Buffer::Iterator start)
void SetDelayedBlockAck()
Enable delayed BlockAck.
StatusCode GetStatusCode(void) const
Return the status code.
void SetImmediateBlockAck()
Enable immediate BlockAck.
uint32_t GetSerializedSize(void) const
StatusCode m_code
Status code.
Definition: mgt-headers.h:1723
Implement the header for management frames of type association request.
Definition: mgt-headers.h:53
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:231
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:235
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
Definition: mgt-headers.cc:866
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:830
static TypeId GetTypeId(void)
Register this type.
Definition: mgt-headers.cc:902
const std::optional< EhtCapabilities > & GetEhtCapabilities(void) const
Return the EHT capabilities, if present.
Definition: mgt-headers.cc:860
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:913
const Ssid & GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:884
uint32_t Deserialize(Buffer::Iterator start) override
Definition: mgt-headers.cc:966
const std::optional< HtCapabilities > & GetHtCapabilities(void) const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:806
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:232
const CapabilityInformation & GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:770
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the Extended Capabilities.
Definition: mgt-headers.cc:776
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:740
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
Definition: mgt-headers.cc:848
std::optional< ExtendedCapabilities > m_extendedCapability
Extended capabilities.
Definition: mgt-headers.h:233
const std::optional< HeCapabilities > & GetHeCapabilities(void) const
Return the HE capabilities, if present.
Definition: mgt-headers.cc:842
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:794
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:752
void Print(std::ostream &os) const override
Definition: mgt-headers.cc:937
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities(void) const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:788
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:812
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:237
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:230
const SupportedRates & GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:890
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< MultiLinkElement > & GetMultiLinkElement(void) const
Return the Multi-Link Element information element, if present.
Definition: mgt-headers.cc:878
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
Definition: mgt-headers.cc:758
uint32_t GetSerializedSize(void) const override
Definition: mgt-headers.cc:919
const std::optional< VhtCapabilities > & GetVhtCapabilities(void) const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:824
void Serialize(Buffer::Iterator start) const override
Definition: mgt-headers.cc:949
uint16_t GetListenInterval(void) const
Return the listen interval.
Definition: mgt-headers.cc:896
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:728
Implement the header for management frames of type association and reassociation response.
Definition: mgt-headers.h:449
uint32_t Deserialize(Buffer::Iterator start)
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
const std::optional< ErpInformation > & GetErpInformation(void) const
Return the ERP information, if present.
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:724
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.
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities(void) const
Return the extended capabilities, if present.
std::optional< HeOperation > m_heOperation
HE operation.
Definition: mgt-headers.h:729
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
void SetStatusCode(StatusCode code)
Set the status code.
const std::optional< HeOperation > & GetHeOperation(void) const
Return the HE operation, if present.
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:717
void SetVhtOperation(const VhtOperation &vhtOperation)
Set the VHT operation.
const std::optional< VhtCapabilities > & GetVhtCapabilities(void) const
Return the VHT capabilities, if present.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void SetHeOperation(const HeOperation &heOperation)
Set the HE operation.
const std::optional< EdcaParameterSet > & GetEdcaParameterSet(void) const
Return the EDCA Parameter Set, if present.
const std::optional< HeCapabilities > & GetHeCapabilities(void) const
Return the HE capabilities, if present.
void SetAssociationId(uint16_t aid)
Set the association ID.
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
uint32_t GetSerializedSize(void) const
void Print(std::ostream &os) const
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:718
std::optional< MuEdcaParameterSet > m_muEdcaParameterSet
MU EDCA Parameter Set.
Definition: mgt-headers.h:730
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:722
const std::optional< MultiLinkElement > & GetMultiLinkElement(void) const
Return the Multi-Link Element information element, if present.
const std::optional< VhtOperation > & GetVhtOperation(void) const
Return the VHT operation, if present.
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:721
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:731
std::optional< VhtOperation > m_vhtOperation
VHT operation.
Definition: mgt-headers.h:725
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:732
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
const std::optional< HtCapabilities > & GetHtCapabilities(void) const
Return the HT capabilities, if present.
const SupportedRates & GetSupportedRates(void) const
Return the supported rates.
StatusCode GetStatusCode(void)
Return the status code.
const CapabilityInformation & GetCapabilities(void) const
Return the Capability information.
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
static TypeId GetTypeId(void)
Register this type.
void Serialize(Buffer::Iterator start) const
std::optional< EdcaParameterSet > m_edcaParameterSet
EDCA Parameter Set.
Definition: mgt-headers.h:727
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
const std::optional< MuEdcaParameterSet > & GetMuEdcaParameterSet(void) const
Return the MU EDCA Parameter Set, if present.
uint16_t GetAssociationId(void) const
Return the association ID.
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
std::optional< ErpInformation > m_erpInformation
ERP information.
Definition: mgt-headers.h:726
const std::optional< HtOperation > & GetHtOperation(void) const
Return the HT operation, if present.
void SetErpInformation(const ErpInformation &erpInformation)
Set the ERP information.
const std::optional< EhtCapabilities > & GetEhtCapabilities(void) const
Return the EHT capabilities, if present.
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:728
std::optional< HtOperation > m_htOperation
HT operation.
Definition: mgt-headers.h:723
StatusCode m_code
Status code.
Definition: mgt-headers.h:719
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:1230
static TypeId GetTypeId(void)
Register this type.
Definition: mgt-headers.cc:701
Implement the header for management frames of type Delete Block Ack.
Definition: mgt-headers.h:1737
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint8_t GetTid(void) const
Return the Traffic ID (TID).
void Serialize(Buffer::Iterator start) const
uint16_t GetParameterSet(void) const
Return the raw parameter set.
uint16_t m_initiator
initiator
Definition: mgt-headers.h:1796
void SetByOriginator(void)
Set the initiator bit in the DELBA.
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is set.
uint32_t Deserialize(Buffer::Iterator start)
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
void Print(std::ostream &os) const
static TypeId GetTypeId(void)
Register this type.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint16_t m_reasonCode
Not used for now.
Definition: mgt-headers.h:1798
void SetByRecipient(void)
Un-set the initiator bit in the DELBA.
uint16_t m_tid
Traffic ID.
Definition: mgt-headers.h:1797
uint32_t GetSerializedSize(void) const
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:741
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:40
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:881
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:882
void Print(std::ostream &os) const
Definition: mgt-headers.cc:198
const Ssid & GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:52
void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:210
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:877
const std::optional< EhtCapabilities > & GetEhtCapabilities(void) const
Return the EHT capabilities, if present.
Definition: mgt-headers.cc:154
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:192
uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:224
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:58
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
Definition: mgt-headers.cc:142
uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:166
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:878
static TypeId GetTypeId(void)
Register this type.
Definition: mgt-headers.cc:181
const SupportedRates & GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:160
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:106
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:879
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities(void) const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:82
const std::optional< HtCapabilities > & GetHtCapabilities(void) const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:100
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:883
const std::optional< HeCapabilities > & GetHeCapabilities(void) const
Return the HE capabilities, if present.
Definition: mgt-headers.cc:136
const std::optional< VhtCapabilities > & GetVhtCapabilities(void) const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:118
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:124
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:880
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:88
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:70
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:892
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities(void) const
Return the extended capabilities, if present.
Definition: mgt-headers.cc:308
uint64_t m_beaconInterval
Beacon interval.
Definition: mgt-headers.h:1205
uint64_t GetTimestamp()
Return the time stamp.
Definition: mgt-headers.cc:254
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:1214
void SetVhtOperation(const VhtOperation &vhtOperation)
Set the VHT operation.
Definition: mgt-headers.cc:368
std::optional< HeOperation > m_heOperation
HE operation.
Definition: mgt-headers.h:1215
std::optional< EdcaParameterSet > m_edcaParameterSet
EDCA Parameter Set.
Definition: mgt-headers.h:1217
void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:638
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:1219
const std::optional< DsssParameterSet > & GetDsssParameterSet(void) const
Return the DSSS Parameter Set, if present.
Definition: mgt-headers.cc:482
const std::optional< EdcaParameterSet > & GetEdcaParameterSet(void) const
Return the EDCA Parameter Set, if present.
Definition: mgt-headers.cc:554
void SetHtOperation(const HtOperation &htOperation)
Set the HT operation.
Definition: mgt-headers.cc:332
std::optional< ReducedNeighborReport > m_reducedNeighborReport
Reduced Neighbor Report information.
Definition: mgt-headers.h:1220
std::optional< HtOperation > m_htOperation
HT operation.
Definition: mgt-headers.h:1211
void SetDsssParameterSet(const DsssParameterSet &dsssParameterSet)
Set the DSSS Parameter Set.
Definition: mgt-headers.cc:470
static TypeId GetTypeId(void)
Register this type.
Definition: mgt-headers.cc:578
Ssid m_ssid
Service set ID (SSID)
Definition: mgt-headers.h:1204
const std::optional< ReducedNeighborReport > & GetReducedNeighborReport(void) const
Return the Reduced Neighbor Report information element, if present.
Definition: mgt-headers.cc:566
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
Definition: mgt-headers.cc:278
std::optional< VhtOperation > m_vhtOperation
VHT operation.
Definition: mgt-headers.h:1213
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:1221
void SetReducedNeighborReport(const ReducedNeighborReport &reducedNeighborReport)
Set the Reduced Neighbor Report information element.
Definition: mgt-headers.cc:530
const CapabilityInformation & GetCapabilities(void) const
Return the Capability information.
Definition: mgt-headers.cc:290
const Ssid & GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:260
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:1206
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
Definition: mgt-headers.cc:422
const std::optional< HeCapabilities > & GetHeCapabilities(void) const
Return the HE capabilities, if present.
Definition: mgt-headers.cc:398
void Print(std::ostream &os) const
Definition: mgt-headers.cc:622
const std::optional< HtCapabilities > & GetHtCapabilities(void) const
Return the HT capabilities, if present.
Definition: mgt-headers.cc:326
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
Definition: mgt-headers.cc:350
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:589
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:314
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:440
std::optional< ErpInformation > m_erpInformation
ERP information.
Definition: mgt-headers.h:1216
std::optional< DsssParameterSet > m_dsssParameterSet
DSSS Parameter Set.
Definition: mgt-headers.h:1208
const std::optional< HeOperation > & GetHeOperation(void) const
Return the HE operation, if present.
Definition: mgt-headers.cc:416
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
Definition: mgt-headers.cc:458
const SupportedRates & GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:272
void SetHeOperation(const HeOperation &heOperation)
Set the HE operation.
Definition: mgt-headers.cc:404
const std::optional< MuEdcaParameterSet > & GetMuEdcaParameterSet(void) const
Return the MU EDCA Parameter Set, if present.
Definition: mgt-headers.cc:560
void SetErpInformation(const ErpInformation &erpInformation)
Set the ERP information.
Definition: mgt-headers.cc:488
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the extended capabilities.
Definition: mgt-headers.cc:296
std::optional< MuEdcaParameterSet > m_muEdcaParameterSet
MU EDCA Parameter Set.
Definition: mgt-headers.h:1218
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:452
uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:595
const std::optional< MultiLinkElement > & GetMultiLinkElement(void) const
Return the Multi-Link Element information element, if present.
Definition: mgt-headers.cc:572
void SetEdcaParameterSet(const EdcaParameterSet &edcaParameterSet)
Set the EDCA Parameter Set.
Definition: mgt-headers.cc:506
const std::optional< HtOperation > & GetHtOperation(void) const
Return the HT operation, if present.
Definition: mgt-headers.cc:344
const std::optional< ErpInformation > & GetErpInformation(void) const
Return the ERP information, if present.
Definition: mgt-headers.cc:500
uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:664
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
Definition: mgt-headers.cc:386
std::optional< ExtendedCapabilities > m_extendedCapability
extended capabilities
Definition: mgt-headers.h:1209
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:266
void SetMuEdcaParameterSet(const MuEdcaParameterSet &muEdcaParameterSet)
Set the MU EDCA Parameter Set.
Definition: mgt-headers.cc:518
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:1207
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:1212
const std::optional< VhtOperation > & GetVhtOperation(void) const
Return the VHT operation, if present.
Definition: mgt-headers.cc:380
uint64_t m_timestamp
Timestamp.
Definition: mgt-headers.h:1203
const std::optional< VhtCapabilities > & GetVhtCapabilities(void) const
Return the VHT capabilities, if present.
Definition: mgt-headers.cc:362
const std::optional< EhtCapabilities > & GetEhtCapabilities(void) const
Return the EHT capabilities, if present.
Definition: mgt-headers.cc:434
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:1210
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
Definition: mgt-headers.cc:542
Implement the header for management frames of type reassociation request.
Definition: mgt-headers.h:248
Mac48Address m_currentApAddr
Address of the current access point.
Definition: mgt-headers.h:430
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:438
uint32_t Deserialize(Buffer::Iterator start)
std::optional< MultiLinkElement > m_multiLinkElement
Multi-Link Element.
Definition: mgt-headers.h:440
std::optional< ExtendedCapabilities > m_extendedCapability
Extended capabilities.
Definition: mgt-headers.h:434
uint16_t GetListenInterval(void) const
Return the listen interval.
const std::optional< EhtCapabilities > & GetEhtCapabilities(void) const
Return the EHT capabilities, if present.
void SetEhtCapabilities(const EhtCapabilities &ehtCapabilities)
Set the EHT capabilities.
std::optional< EhtCapabilities > m_ehtCapability
EHT capabilities.
Definition: mgt-headers.h:439
std::optional< VhtCapabilities > m_vhtCapability
VHT capabilities.
Definition: mgt-headers.h:436
void SetExtendedCapabilities(const ExtendedCapabilities &extendedCapabilities)
Set the Extended Capabilities.
static TypeId GetTypeId(void)
Register this type.
std::optional< HeCapabilities > m_heCapability
HE capabilities.
Definition: mgt-headers.h:437
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:432
void SetMultiLinkElement(const MultiLinkElement &multiLinkElement)
Set the Multi-Link Element information element.
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:431
void Serialize(Buffer::Iterator start) const
void SetCapabilities(const CapabilityInformation &capabilities)
Set the Capability information.
const std::optional< HtCapabilities > & GetHtCapabilities(void) const
Return the HT capabilities, if present.
void SetListenInterval(uint16_t interval)
Set the listen interval.
const SupportedRates & GetSupportedRates(void) const
Return the supported rates.
void Print(std::ostream &os) const
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:433
const CapabilityInformation & GetCapabilities(void) const
Return the Capability information.
void SetSupportedRates(const SupportedRates &rates)
Set the supported rates.
const std::optional< MultiLinkElement > & GetMultiLinkElement(void) const
Return the Multi-Link Element information element, if present.
const std::optional< HeCapabilities > & GetHeCapabilities(void) const
Return the HE capabilities, if present.
void SetVhtCapabilities(const VhtCapabilities &vhtCapabilities)
Set the VHT capabilities.
const std::optional< ExtendedCapabilities > & GetExtendedCapabilities(void) const
Return the extended capabilities, if present.
void SetHtCapabilities(const HtCapabilities &htCapabilities)
Set the HT capabilities.
const std::optional< VhtCapabilities > & GetVhtCapabilities(void) const
Return the VHT capabilities, if present.
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
const Ssid & GetSsid(void) const
Return the Service Set Identifier (SSID).
std::optional< HtCapabilities > m_htCapability
HT capabilities.
Definition: mgt-headers.h:435
void SetSsid(const Ssid &ssid)
Set the Service Set Identifier (SSID).
void SetCurrentApAddress(Mac48Address currentApAddr)
Set the address of the current access point.
uint32_t GetSerializedSize(void) const
void SetHeCapabilities(const HeCapabilities &heCapabilities)
Set the HE capabilities.
The MU EDCA Parameter Set.
The Reduced Neighbor Report element.
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
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(void) const
Definition: status-code.cc:48
The Supported Rates Information Element.
uint8_t GetNRates(void) 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:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
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:1253
SelfProtectedActionValue
SelfProtectedActionValue enumeration.
Definition: mgt-headers.h:1345
uint8_t m_category
Category of the action.
Definition: mgt-headers.h:1474
uint32_t Deserialize(Buffer::Iterator start)
void Print(std::ostream &os) const
void Serialize(Buffer::Iterator start) const
std::string CategoryValueToString(CategoryValue value) const
Category value to string function.
CategoryValue
CategoryValue enumeration.
Definition: mgt-headers.h:1265
std::string SelfProtectedActionValueToString(SelfProtectedActionValue value) const
Self protected action value to string function.
uint32_t GetSerializedSize() const
uint8_t m_actionValue
Action value.
Definition: mgt-headers.h:1475
CategoryValue GetCategory()
Return the category value.
ActionValue GetAction()
Return the action value.
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REQUEST
Definition: mgt-headers.h:1369
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REPORT
Definition: mgt-headers.h:1370
static TypeId GetTypeId(void)
Register this type.
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:67
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#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.
ssid
Definition: third.py:88
def start()
Definition: core.py:1852
ns3::Time timeout
typedef for union of different ActionValues
Definition: mgt-headers.h:1416
UnprotectedDmgActionValue unprotectedDmgAction
unprotected dmg
Definition: mgt-headers.h:1426
SelfProtectedActionValue selfProtectedAction
self protected
Definition: mgt-headers.h:1421
MultihopActionValue multihopAction
multi hop
Definition: mgt-headers.h:1422
RadioMeasurementActionValue radioMeasurementAction
radio measurement
Definition: mgt-headers.h:1419
PublicActionValue publicAction
public
Definition: mgt-headers.h:1420
BlockAckActionValue blockAck
block ack
Definition: mgt-headers.h:1418