A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mgt-action-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-action-headers.h"
23
24#include "addba-extension.h"
25
26#include "ns3/multi-link-element.h"
27#include "ns3/packet.h"
28#include "ns3/simulator.h"
29
30#include <vector>
31
32namespace ns3
33{
34
36{
37}
38
40{
41}
42
43void
46{
47 m_category = static_cast<uint8_t>(type);
48 switch (type)
49 {
51 break;
52 }
53 case QOS: {
54 m_actionValue = static_cast<uint8_t>(action.qos);
55 break;
56 }
57 case BLOCK_ACK: {
58 m_actionValue = static_cast<uint8_t>(action.blockAck);
59 break;
60 }
61 case PUBLIC: {
62 m_actionValue = static_cast<uint8_t>(action.publicAction);
63 break;
64 }
65 case RADIO_MEASUREMENT: {
66 m_actionValue = static_cast<uint8_t>(action.radioMeasurementAction);
67 break;
68 }
69 case MESH: {
70 m_actionValue = static_cast<uint8_t>(action.meshAction);
71 break;
72 }
73 case MULTIHOP: {
74 m_actionValue = static_cast<uint8_t>(action.multihopAction);
75 break;
76 }
77 case SELF_PROTECTED: {
78 m_actionValue = static_cast<uint8_t>(action.selfProtectedAction);
79 break;
80 }
81 case DMG: {
82 m_actionValue = static_cast<uint8_t>(action.dmgAction);
83 break;
84 }
85 case FST: {
86 m_actionValue = static_cast<uint8_t>(action.fstAction);
87 break;
88 }
89 case UNPROTECTED_DMG: {
90 m_actionValue = static_cast<uint8_t>(action.unprotectedDmgAction);
91 break;
92 }
93 case PROTECTED_EHT: {
94 m_actionValue = static_cast<uint8_t>(action.protectedEhtAction);
95 break;
96 }
98 break;
99 }
100 }
101}
102
105{
106 switch (m_category)
107 {
108 case QOS:
109 return QOS;
110 case BLOCK_ACK:
111 return BLOCK_ACK;
112 case PUBLIC:
113 return PUBLIC;
115 return RADIO_MEASUREMENT;
116 case MESH:
117 return MESH;
118 case MULTIHOP:
119 return MULTIHOP;
120 case SELF_PROTECTED:
121 return SELF_PROTECTED;
122 case DMG:
123 return DMG;
124 case FST:
125 return FST;
126 case UNPROTECTED_DMG:
127 return UNPROTECTED_DMG;
128 case PROTECTED_EHT:
129 return PROTECTED_EHT;
132 default:
133 NS_FATAL_ERROR("Unknown action value");
134 return SELF_PROTECTED;
135 }
136}
137
140{
141 ActionValue retval;
142 retval.selfProtectedAction =
143 PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases
144 switch (m_category)
145 {
146 case QOS:
147 switch (m_actionValue)
148 {
149 case ADDTS_REQUEST:
150 retval.qos = ADDTS_REQUEST;
151 break;
152 case ADDTS_RESPONSE:
153 retval.qos = ADDTS_RESPONSE;
154 break;
155 case DELTS:
156 retval.qos = DELTS;
157 break;
158 case SCHEDULE:
159 retval.qos = SCHEDULE;
160 break;
162 retval.qos = QOS_MAP_CONFIGURE;
163 break;
164 default:
165 NS_FATAL_ERROR("Unknown qos action code");
166 retval.qos = ADDTS_REQUEST; /* quiet compiler */
167 }
168 break;
169
170 case BLOCK_ACK:
171 switch (m_actionValue)
172 {
175 break;
178 break;
179 case BLOCK_ACK_DELBA:
180 retval.blockAck = BLOCK_ACK_DELBA;
181 break;
182 default:
183 NS_FATAL_ERROR("Unknown block ack action code");
184 retval.blockAck = BLOCK_ACK_ADDBA_REQUEST; /* quiet compiler */
185 }
186 break;
187
188 case PUBLIC:
189 switch (m_actionValue)
190 {
191 case QAB_REQUEST:
192 retval.publicAction = QAB_REQUEST;
193 break;
194 case QAB_RESPONSE:
195 retval.publicAction = QAB_RESPONSE;
196 break;
197 case FILS_DISCOVERY:
199 break;
200 default:
201 NS_FATAL_ERROR("Unknown public action code");
202 retval.publicAction = QAB_REQUEST; /* quiet compiler */
203 }
204 break;
205
207 switch (m_actionValue)
208 {
211 break;
214 break;
217 break;
220 break;
223 break;
226 break;
227 default:
228 NS_FATAL_ERROR("Unknown radio measurement action code");
229 retval.radioMeasurementAction = RADIO_MEASUREMENT_REQUEST; /* quiet compiler */
230 }
231 break;
232
233 case SELF_PROTECTED:
234 switch (m_actionValue)
235 {
236 case PEER_LINK_OPEN:
238 break;
241 break;
242 case PEER_LINK_CLOSE:
244 break;
245 case GROUP_KEY_INFORM:
247 break;
248 case GROUP_KEY_ACK:
250 break;
251 default:
252 NS_FATAL_ERROR("Unknown mesh peering management action code");
253 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
254 }
255 break;
256
257 case MESH:
258 switch (m_actionValue)
259 {
262 break;
263 case PATH_SELECTION:
264 retval.meshAction = PATH_SELECTION;
265 break;
268 break;
271 break;
274 break;
275 case MDA_SETUP_REPLY:
277 break;
280 break;
283 break;
286 break;
289 break;
292 break;
293 default:
294 NS_FATAL_ERROR("Unknown mesh peering management action code");
295 retval.meshAction = LINK_METRIC_REPORT; /* quiet compiler */
296 }
297 break;
298
299 case MULTIHOP: // not yet supported
300 switch (m_actionValue)
301 {
302 case PROXY_UPDATE: // not used so far
303 case PROXY_UPDATE_CONFIRMATION: // not used so far
305 break;
306 default:
307 NS_FATAL_ERROR("Unknown mesh peering management action code");
308 retval.multihopAction = PROXY_UPDATE; /* quiet compiler */
309 }
310 break;
311
312 case DMG:
313 switch (m_actionValue)
314 {
317 break;
320 break;
323 break;
326 break;
329 break;
332 break;
333 case DMG_DTP_REQUEST:
334 retval.dmgAction = DMG_DTP_REQUEST;
335 break;
336 case DMG_DTP_RESPONSE:
338 break;
341 break;
344 break;
347 break;
350 break;
351 case DMG_RLS_REQUEST:
352 retval.dmgAction = DMG_RLS_REQUEST;
353 break;
354 case DMG_RLS_RESPONSE:
356 break;
359 break;
360 case DMG_RLS_TEARDOWN:
362 break;
365 break;
368 break;
369 case DMG_TPA_REQUEST:
370 retval.dmgAction = DMG_TPA_REQUEST;
371 break;
372 case DMG_TPA_RESPONSE:
374 break;
375 case DMG_ROC_REQUEST:
376 retval.dmgAction = DMG_ROC_REQUEST;
377 break;
378 case DMG_ROC_RESPONSE:
380 break;
381 default:
382 NS_FATAL_ERROR("Unknown DMG management action code");
383 retval.dmgAction = DMG_POWER_SAVE_CONFIGURATION_REQUEST; /* quiet compiler */
384 }
385 break;
386
387 case FST:
388 switch (m_actionValue)
389 {
392 break;
395 break;
396 case FST_TEAR_DOWN:
397 retval.fstAction = FST_TEAR_DOWN;
398 break;
399 case FST_ACK_REQUEST:
400 retval.fstAction = FST_ACK_REQUEST;
401 break;
402 case FST_ACK_RESPONSE:
404 break;
407 break;
408 default:
409 NS_FATAL_ERROR("Unknown FST management action code");
410 retval.fstAction = FST_SETUP_REQUEST; /* quiet compiler */
411 }
412 break;
413
414 case UNPROTECTED_DMG:
415 switch (m_actionValue)
416 {
419 break;
422 break;
425 break;
428 break;
431 break;
434 break;
435 default:
436 NS_FATAL_ERROR("Unknown Unprotected DMG action code");
437 retval.unprotectedDmgAction = UNPROTECTED_DMG_ANNOUNCE; /* quiet compiler */
438 }
439 break;
440
441 case PROTECTED_EHT:
442 switch (m_actionValue)
443 {
446 break;
449 break;
452 break;
455 break;
458 break;
461 break;
464 break;
467 break;
470 break;
473 break;
474 default:
475 NS_FATAL_ERROR("Unknown Protected EHT action code");
476 retval.protectedEhtAction =
478 }
479 break;
480
481 default:
482 NS_FATAL_ERROR("Unsupported action");
483 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
484 }
485 return retval;
486}
487
488TypeId
490{
491 static TypeId tid = TypeId("ns3::WifiActionHeader")
492 .SetParent<Header>()
493 .SetGroupName("Wifi")
494 .AddConstructor<WifiActionHeader>();
495 return tid;
496}
497
498TypeId
500{
501 return GetTypeId();
502}
503
504std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
506{
507 WifiActionHeader actionHdr;
508 pkt->PeekHeader(actionHdr);
509 return {actionHdr.GetCategory(), actionHdr.GetAction()};
510}
511
512std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
514{
515 WifiActionHeader actionHdr;
516 pkt->RemoveHeader(actionHdr);
517 return {actionHdr.GetCategory(), actionHdr.GetAction()};
518}
519
520void
521WifiActionHeader::Print(std::ostream& os) const
522{
523#define CASE_ACTION_VALUE(x) \
524 case x: \
525 os << #x << "]"; \
526 break;
527
528 switch (m_category)
529 {
530 case QOS:
531 os << "QOS[";
532 switch (m_actionValue)
533 {
539 default:
540 NS_FATAL_ERROR("Unknown qos action code");
541 }
542 break;
543 case BLOCK_ACK:
544 os << "BLOCK_ACK[";
545 switch (m_actionValue)
546 {
550 default:
551 NS_FATAL_ERROR("Unknown block ack action code");
552 }
553 break;
554 case PUBLIC:
555 os << "PUBLIC[";
556 switch (m_actionValue)
557 {
561 default:
562 NS_FATAL_ERROR("Unknown public action code");
563 }
564 break;
566 os << "RADIO_MEASUREMENT[";
567 switch (m_actionValue)
568 {
575 default:
576 NS_FATAL_ERROR("Unknown radio measurement action code");
577 }
578 break;
579 case MESH:
580 os << "MESH[";
581 switch (m_actionValue)
582 {
594 default:
595 NS_FATAL_ERROR("Unknown mesh peering management action code");
596 }
597 break;
598 case MULTIHOP:
599 os << "MULTIHOP[";
600 switch (m_actionValue)
601 {
602 CASE_ACTION_VALUE(PROXY_UPDATE); // not used so far
604 default:
605 NS_FATAL_ERROR("Unknown mesh peering management action code");
606 }
607 break;
608 case SELF_PROTECTED:
609 os << "SELF_PROTECTED[";
610 switch (m_actionValue)
611 {
617 default:
618 NS_FATAL_ERROR("Unknown mesh peering management action code");
619 }
620 break;
621 case DMG:
622 os << "DMG[";
623 switch (m_actionValue)
624 {
647 default:
648 NS_FATAL_ERROR("Unknown DMG management action code");
649 }
650 break;
651 case FST:
652 os << "FST[";
653 switch (m_actionValue)
654 {
661 default:
662 NS_FATAL_ERROR("Unknown FST management action code");
663 }
664 break;
665 case UNPROTECTED_DMG:
666 os << "UNPROTECTED_DMG[";
667 switch (m_actionValue)
668 {
675 default:
676 NS_FATAL_ERROR("Unknown Unprotected DMG action code");
677 }
678 break;
679 case PROTECTED_EHT:
680 os << "PROTECTED_EHT[";
681 switch (m_actionValue)
682 {
693 default:
694 NS_FATAL_ERROR("Unknown Protected EHT action code");
695 }
696 break;
698 os << "VENDOR_SPECIFIC_ACTION";
699 break;
700 default:
701 NS_FATAL_ERROR("Unknown action value");
702 }
703#undef CASE_ACTION_VALUE
704}
705
708{
709 return 2;
710}
711
712void
714{
715 start.WriteU8(m_category);
716 start.WriteU8(m_actionValue);
717}
718
721{
722 Buffer::Iterator i = start;
723 m_category = i.ReadU8();
724 m_actionValue = i.ReadU8();
725 return i.GetDistanceFrom(start);
726}
727
728/***************************************************
729 * ADDBARequest
730 ****************************************************/
731
733
734TypeId
736{
737 static TypeId tid = TypeId("ns3::MgtAddBaRequestHeader")
738 .SetParent<Header>()
739 .SetGroupName("Wifi")
740 .AddConstructor<MgtAddBaRequestHeader>();
741 return tid;
742}
743
744TypeId
746{
747 return GetTypeId();
748}
749
750void
751MgtAddBaRequestHeader::Print(std::ostream& os) const
752{
753}
754
757{
758 uint32_t size = 0;
759 size += 1; // Dialog token
760 size += 2; // Block ack parameter set
761 size += 2; // Block ack timeout value
762 size += 2; // Starting sequence control
763 if (m_bufferSize >= 1024)
764 {
765 // an ADDBA Extension element has to be added
767 }
768 return size;
769}
770
771void
773{
774 Buffer::Iterator i = start;
779 if (m_bufferSize >= 1024)
780 {
781 AddbaExtension addbaExt;
782 addbaExt.m_extParamSet.extBufferSize = m_bufferSize / 1024;
783 i = addbaExt.Serialize(i);
784 }
785}
786
789{
790 Buffer::Iterator i = start;
791 m_dialogToken = i.ReadU8();
795 AddbaExtension addbaExt;
796 auto tmp = i;
797 i = addbaExt.DeserializeIfPresent(i);
798 if (i.GetDistanceFrom(tmp) != 0)
799 {
800 // the buffer size is Extended Buffer Size × 1024 + Buffer Size
801 // (Sec. 9.4.2.138 of 802.11be D4.0)
802 m_bufferSize += addbaExt.m_extParamSet.extBufferSize * 1024;
803 }
804 return i.GetDistanceFrom(start);
805}
806
807void
809{
810 m_policy = 0;
811}
812
813void
815{
816 m_policy = 1;
817}
818
819void
821{
822 NS_ASSERT(tid < 16);
823 m_tid = tid;
824}
825
826void
828{
830}
831
832void
834{
835 m_bufferSize = size;
836}
837
838void
840{
841 m_startingSeq = seq;
842}
843
844void
846{
847 m_startingSeq = (seqControl >> 4) & 0x0fff;
848}
849
850void
852{
853 m_amsduSupport = supported;
854}
855
856uint8_t
858{
859 return m_tid;
860}
861
862bool
864{
865 return m_policy == 1;
866}
867
868uint16_t
870{
871 return m_timeoutValue;
872}
873
874uint16_t
876{
877 return m_bufferSize;
878}
879
880bool
882{
883 return m_amsduSupport == 1;
884}
885
886uint16_t
888{
889 return m_startingSeq;
890}
891
892uint16_t
894{
895 return (m_startingSeq << 4) & 0xfff0;
896}
897
898uint16_t
900{
901 uint16_t res = 0;
902 res |= m_amsduSupport;
903 res |= m_policy << 1;
904 res |= m_tid << 2;
905 res |= (m_bufferSize % 1024) << 6;
906 return res;
907}
908
909void
911{
912 m_amsduSupport = params & 0x01;
913 m_policy = (params >> 1) & 0x01;
914 m_tid = (params >> 2) & 0x0f;
915 m_bufferSize = (params >> 6) & 0x03ff;
916}
917
918/***************************************************
919 * ADDBAResponse
920 ****************************************************/
921
923
924TypeId
926{
927 static TypeId tid = TypeId("ns3::MgtAddBaResponseHeader")
928 .SetParent<Header>()
929 .SetGroupName("Wifi")
930 .AddConstructor<MgtAddBaResponseHeader>();
931 return tid;
932}
933
934TypeId
936{
937 return GetTypeId();
938}
939
940void
941MgtAddBaResponseHeader::Print(std::ostream& os) const
942{
943 os << "status code=" << m_code;
944}
945
948{
949 uint32_t size = 0;
950 size += 1; // Dialog token
951 size += m_code.GetSerializedSize(); // Status code
952 size += 2; // Block ack parameter set
953 size += 2; // Block ack timeout value
954 if (m_bufferSize >= 1024)
955 {
956 // an ADDBA Extension element has to be added
958 }
959 return size;
960}
961
962void
964{
965 Buffer::Iterator i = start;
967 i = m_code.Serialize(i);
970 if (m_bufferSize >= 1024)
971 {
972 AddbaExtension addbaExt;
973 addbaExt.m_extParamSet.extBufferSize = m_bufferSize / 1024;
974 i = addbaExt.Serialize(i);
975 }
976}
977
980{
981 Buffer::Iterator i = start;
982 m_dialogToken = i.ReadU8();
983 i = m_code.Deserialize(i);
986 AddbaExtension addbaExt;
987 auto tmp = i;
988 i = addbaExt.DeserializeIfPresent(i);
989 if (i.GetDistanceFrom(tmp) != 0)
990 {
991 // the buffer size is Extended Buffer Size × 1024 + Buffer Size
992 // (Sec. 9.4.2.138 of 802.11be D4.0)
993 m_bufferSize += addbaExt.m_extParamSet.extBufferSize * 1024;
994 }
995 return i.GetDistanceFrom(start);
996}
997
998void
1000{
1001 m_policy = 0;
1002}
1003
1004void
1006{
1007 m_policy = 1;
1008}
1009
1010void
1012{
1013 NS_ASSERT(tid < 16);
1014 m_tid = tid;
1015}
1016
1017void
1019{
1021}
1022
1023void
1025{
1026 m_bufferSize = size;
1027}
1028
1029void
1031{
1032 m_code = code;
1033}
1034
1035void
1037{
1038 m_amsduSupport = supported;
1039}
1040
1043{
1044 return m_code;
1045}
1046
1047uint8_t
1049{
1050 return m_tid;
1051}
1052
1053bool
1055{
1056 return m_policy == 1;
1057}
1058
1059uint16_t
1061{
1062 return m_timeoutValue;
1063}
1064
1065uint16_t
1067{
1068 return m_bufferSize;
1069}
1070
1071bool
1073{
1074 return m_amsduSupport == 1;
1075}
1076
1077uint16_t
1079{
1080 uint16_t res = 0;
1081 res |= m_amsduSupport;
1082 res |= m_policy << 1;
1083 res |= m_tid << 2;
1084 res |= (m_bufferSize % 1024) << 6;
1085 return res;
1086}
1087
1088void
1090{
1091 m_amsduSupport = params & 0x01;
1092 m_policy = (params >> 1) & 0x01;
1093 m_tid = (params >> 2) & 0x0f;
1094 m_bufferSize = (params >> 6) & 0x03ff;
1095}
1096
1097/***************************************************
1098 * DelBa
1099 ****************************************************/
1100
1102
1103TypeId
1105{
1106 static TypeId tid = TypeId("ns3::MgtDelBaHeader")
1107 .SetParent<Header>()
1108 .SetGroupName("Wifi")
1109 .AddConstructor<MgtDelBaHeader>();
1110 return tid;
1111}
1112
1113TypeId
1115{
1116 return GetTypeId();
1117}
1118
1119void
1120MgtDelBaHeader::Print(std::ostream& os) const
1121{
1122}
1123
1126{
1127 uint32_t size = 0;
1128 size += 2; // DelBa parameter set
1129 size += 2; // Reason code
1130 return size;
1131}
1132
1133void
1135{
1136 Buffer::Iterator i = start;
1139}
1140
1143{
1144 Buffer::Iterator i = start;
1147 return i.GetDistanceFrom(start);
1148}
1149
1150bool
1152{
1153 return m_initiator == 1;
1154}
1155
1156uint8_t
1158{
1159 NS_ASSERT(m_tid < 16);
1160 auto tid = static_cast<uint8_t>(m_tid);
1161 return tid;
1162}
1163
1164void
1166{
1167 m_initiator = 1;
1168}
1169
1170void
1172{
1173 m_initiator = 0;
1174}
1175
1176void
1178{
1179 NS_ASSERT(tid < 16);
1180 m_tid = static_cast<uint16_t>(tid);
1181}
1182
1183uint16_t
1185{
1186 uint16_t res = 0;
1187 res |= m_initiator << 11;
1188 res |= m_tid << 12;
1189 return res;
1190}
1191
1192void
1194{
1195 m_initiator = (params >> 11) & 0x01;
1196 m_tid = (params >> 12) & 0x0f;
1197}
1198
1199/***************************************************
1200 * EMLSR Operating Mode Notification
1201 ****************************************************/
1202
1204
1205TypeId
1207{
1208 static TypeId tid = TypeId("ns3::MgtEmlOperatingModeNotification")
1209 .SetParent<Header>()
1210 .SetGroupName("Wifi")
1211 .AddConstructor<MgtEmlOmn>();
1212 return tid;
1213}
1214
1215TypeId
1217{
1218 return GetTypeId();
1219}
1220
1221void
1222MgtEmlOmn::Print(std::ostream& os) const
1223{
1224 os << "EMLSR Mode=" << +m_emlControl.emlsrMode << " EMLMR Mode=" << +m_emlControl.emlmrMode
1225 << " EMLSR Parameter Update Control=" << +m_emlControl.emlsrParamUpdateCtrl;
1227 {
1228 os << " Link bitmap=" << std::hex << *m_emlControl.linkBitmap << std::dec;
1229 }
1231 {
1232 os << " EMLSR Padding Delay="
1234 .As(Time::US)
1235 << " EMLSR Transition Delay="
1237 .As(Time::US);
1238 }
1239}
1240
1243{
1244 uint32_t size = 2; // Dialog Token (1) + first byte of EML Control
1246 {
1247 size += 2;
1248 }
1250 {
1251 size += 1;
1252 }
1253 // TODO add size of EMLMR Supported MCS And NSS Set subfield when implemented
1255 {
1256 size += 1; // EMLSR Parameter Update field
1257 }
1258 return size;
1259}
1260
1261void
1263{
1264 start.WriteU8(m_dialogToken);
1265
1267 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1268 uint8_t val = m_emlControl.emlsrMode | (m_emlControl.emlmrMode << 1) |
1270 start.WriteU8(val);
1271
1274 "The EMLSR/EMLMR Link Bitmap is present if and only if either of the EMLSR "
1275 "Mode and EMLMR Mode subfields are set to 1");
1277 {
1278 start.WriteHtolsbU16(*m_emlControl.linkBitmap);
1279 }
1280 // TODO serialize MCS Map Count Control and EMLMR Supported MCS And NSS Set subfields
1281 // when implemented
1282
1284 "The EMLSR Parameter Update field is present "
1285 << std::boolalpha << m_emlsrParamUpdate.has_value()
1286 << " if and only if the EMLSR "
1287 "Parameter Update Control subfield is set to 1 "
1290 {
1291 val = m_emlsrParamUpdate->paddingDelay | (m_emlsrParamUpdate->transitionDelay << 3);
1292 start.WriteU8(val);
1293 }
1294}
1295
1298{
1299 Buffer::Iterator i = start;
1300
1301 m_dialogToken = i.ReadU8();
1302
1303 uint8_t val = i.ReadU8();
1304 m_emlControl.emlsrMode = val & 0x01;
1305 m_emlControl.emlmrMode = (val >> 1) & 0x01;
1306 m_emlControl.emlsrParamUpdateCtrl = (val >> 2) & 0x01;
1307
1309 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1310
1312 {
1314 }
1315 // TODO deserialize MCS Map Count Control and EMLMR Supported MCS And NSS Set subfields
1316 // when implemented
1317
1319 {
1320 val = i.ReadU8();
1322 m_emlsrParamUpdate->paddingDelay = val & 0x07;
1323 m_emlsrParamUpdate->transitionDelay = (val >> 3) & 0x07;
1324 }
1325
1326 return i.GetDistanceFrom(start);
1327}
1328
1329void
1331{
1332 NS_ABORT_MSG_IF(linkId > 15, "Link ID must not exceed 15");
1334 {
1336 }
1338}
1339
1340std::list<uint8_t>
1342{
1343 std::list<uint8_t> list;
1344 NS_ASSERT_MSG(m_emlControl.linkBitmap.has_value(), "No link bitmap");
1345 uint16_t bitmap = *m_emlControl.linkBitmap;
1346 for (uint8_t linkId = 0; linkId < 16; linkId++)
1347 {
1348 if ((bitmap & 0x0001) == 1)
1349 {
1350 list.push_back(linkId);
1351 }
1352 bitmap >>= 1;
1353 }
1354 return list;
1355}
1356
1357/***************************************************
1358 * FILS Discovery
1359 ****************************************************/
1360
1362
1363TypeId
1365{
1366 static TypeId tid = TypeId("ns3::FilsDiscHeader")
1367 .SetParent<Header>()
1368 .SetGroupName("Wifi")
1369 .AddConstructor<FilsDiscHeader>();
1370 return tid;
1371}
1372
1373TypeId
1375{
1376 return GetTypeId();
1377}
1378
1380 : m_len(m_frameCtl.m_lenPresenceInd),
1381 m_fdCap(m_frameCtl.m_capPresenceInd),
1382 m_primaryCh(m_frameCtl.m_primChPresenceInd),
1383 m_apConfigSeqNum(m_frameCtl.m_apCsnPresenceInd),
1384 m_accessNetOpt(m_frameCtl.m_anoPresenceInd),
1385 m_chCntrFreqSeg1(m_frameCtl.m_chCntrFreqSeg1PresenceInd)
1386{
1387}
1388
1389void
1390FilsDiscHeader::SetSsid(const std::string& ssid)
1391{
1392 m_ssid = ssid;
1393 m_frameCtl.m_ssidLen = ssid.length() - 1;
1394}
1395
1396const std::string&
1398{
1399 return m_ssid;
1400}
1401
1404{
1405 auto size = GetSizeNonOptSubfields();
1406 size += m_len.has_value() ? 1 : 0;
1407 size += m_fdCap.has_value() ? 2 : 0;
1408 size += m_opClass.has_value() ? 1 : 0;
1409 size += m_primaryCh.has_value() ? 1 : 0;
1410 size += m_apConfigSeqNum.has_value() ? 1 : 0;
1411 size += m_accessNetOpt.has_value() ? 1 : 0;
1412 size += m_chCntrFreqSeg1.has_value() ? 1 : 0;
1413 return size;
1414}
1415
1418{
1419 auto size = GetInformationFieldSize();
1420 // Optional elements
1421 size += m_rnr.has_value() ? m_rnr->GetSerializedSize() : 0;
1422 size += m_tim.has_value() ? m_tim->GetSerializedSize() : 0;
1423 return size;
1424}
1425
1428{
1429 return 2 /* FILS Discovery Frame Control */
1430 + 8 /* Timestamp */
1431 + 2 /* Beacon Interval */
1432 + m_ssid.length(); /* SSID */
1433}
1434
1435void
1437{
1438 m_len.reset(); // so that Length size is not included by GetInformationFieldSize()
1439 auto infoFieldSize = GetInformationFieldSize();
1440 auto nonOptSubfieldsSize = GetSizeNonOptSubfields();
1441 NS_ABORT_MSG_IF(infoFieldSize < nonOptSubfieldsSize, "Length subfield is less than 0");
1442 m_len = infoFieldSize - nonOptSubfieldsSize;
1443}
1444
1445void
1446FilsDiscHeader::Print(std::ostream& os) const
1447{
1448 os << "Control=" << m_frameCtl << ", "
1449 << "Time Stamp=" << m_timeStamp << ", "
1450 << "Beacon Interval=" << m_beaconInt << ", "
1451 << "SSID=" << m_ssid << ", ";
1452 if (m_len.has_value())
1453 {
1454 os << "Length=" << *m_len << ", ";
1455 }
1456 if (m_fdCap.has_value())
1457 {
1458 os << "FD Capability=" << *m_fdCap << ", ";
1459 }
1460 if (m_opClass.has_value())
1461 {
1462 os << "Operating Class=" << *m_opClass << ", ";
1463 }
1464 if (m_primaryCh.has_value())
1465 {
1466 os << "Primary Channel=" << *m_primaryCh << ", ";
1467 }
1469 {
1470 os << "AP-CSN=" << *m_apConfigSeqNum << ", ";
1471 }
1473 {
1474 os << "ANO=" << *m_accessNetOpt << ", ";
1475 }
1477 {
1478 os << "Channel Center Frequency Seg 1=" << *m_chCntrFreqSeg1 << ", ";
1479 }
1480 if (m_tim.has_value())
1481 {
1482 os << "Traffic Indicator Map=" << *m_tim;
1483 }
1484}
1485
1486void
1488{
1489 Buffer::Iterator i = start;
1491 i.WriteHtolsbU64(Simulator::Now().GetMicroSeconds()); // Time stamp
1493 i.Write(reinterpret_cast<const uint8_t*>(m_ssid.data()), m_ssid.length());
1494 if (m_len.has_value())
1495 {
1496 i.WriteU8(*m_len);
1497 }
1498 if (m_fdCap.has_value())
1499 {
1500 m_fdCap->Serialize(i);
1501 }
1502 NS_ASSERT(m_opClass.has_value() == m_primaryCh.has_value());
1503 if (m_opClass.has_value())
1504 {
1505 i.WriteU8(*m_opClass);
1506 }
1507 if (m_primaryCh.has_value())
1508 {
1509 i.WriteU8(*m_primaryCh);
1510 }
1512 {
1514 }
1516 {
1518 }
1520 {
1522 }
1523 i = m_rnr.has_value() ? m_rnr->Serialize(i) : i;
1524 i = m_tim.has_value() ? m_tim->Serialize(i) : i;
1525}
1526
1529{
1530 Buffer::Iterator i = start;
1531 auto nOctets = m_frameCtl.Deserialize(i);
1532 i.Next(nOctets);
1535 std::vector<uint8_t> ssid(m_frameCtl.m_ssidLen + 2);
1536 i.Read(ssid.data(), m_frameCtl.m_ssidLen + 1);
1537 ssid[m_frameCtl.m_ssidLen + 1] = 0;
1538 m_ssid = std::string(reinterpret_cast<char*>(ssid.data()));
1539 // Optional subfields
1541 {
1542 m_len = i.ReadU8();
1543 }
1545 {
1546 nOctets = m_fdCap->Deserialize(i);
1547 i.Next(nOctets);
1548 }
1550 {
1551 m_opClass = i.ReadU8();
1552 m_primaryCh = i.ReadU8();
1553 }
1555 {
1557 }
1559 {
1560 m_accessNetOpt = i.ReadU8();
1561 }
1563 {
1565 }
1566 // Optional elements
1567 m_rnr.emplace();
1568 auto tmp = i;
1569 i = m_rnr->DeserializeIfPresent(i);
1570 if (i.GetDistanceFrom(tmp) == 0)
1571 {
1572 m_rnr.reset();
1573 }
1574
1575 m_tim.emplace();
1576 tmp = i;
1577 i = m_tim->DeserializeIfPresent(i);
1578 if (i.GetDistanceFrom(tmp) == 0)
1579 {
1580 m_tim.reset();
1581 }
1582
1583 return i.GetDistanceFrom(start);
1584}
1585
1586std::ostream&
1587operator<<(std::ostream& os, const FilsDiscHeader::FilsDiscFrameControl& control)
1588{
1589 os << "ssidLen:" << control.m_ssidLen << " capPresenceInd:" << control.m_capPresenceInd
1590 << " shortSsidInd:" << control.m_shortSsidInd
1591 << " apCsnPresenceInd:" << control.m_apCsnPresenceInd
1592 << " anoPresenceInd:" << control.m_anoPresenceInd
1593 << " chCntrFreqSeg1PresenceInd:" << control.m_chCntrFreqSeg1PresenceInd
1594 << " primChPresenceInd:" << control.m_primChPresenceInd
1595 << " rsnInfoPresenceInd:" << control.m_rsnInfoPresenceInd
1596 << " lenPresenceInd:" << control.m_lenPresenceInd
1597 << " mdPresenceInd:" << control.m_mdPresenceInd;
1598 return os;
1599}
1600
1601void
1603{
1604 uint16_t val = m_ssidLen | ((m_capPresenceInd ? 1 : 0) << 5) | (m_shortSsidInd << 6) |
1605 ((m_apCsnPresenceInd ? 1 : 0) << 7) | ((m_anoPresenceInd ? 1 : 0) << 8) |
1606 ((m_chCntrFreqSeg1PresenceInd ? 1 : 0) << 9) |
1607 ((m_primChPresenceInd ? 1 : 0) << 10) | (m_rsnInfoPresenceInd << 11) |
1608 ((m_lenPresenceInd ? 1 : 0) << 12) | (m_mdPresenceInd << 13);
1609 start.WriteHtolsbU16(val);
1610}
1611
1614{
1615 auto val = start.ReadLsbtohU16();
1616
1617 m_ssidLen = val & 0x001f;
1618 m_capPresenceInd = ((val >> 5) & 0x0001) == 1;
1619 m_shortSsidInd = (val >> 6) & 0x0001;
1620 m_apCsnPresenceInd = ((val >> 7) & 0x0001) == 1;
1621 m_anoPresenceInd = ((val >> 8) & 0x0001) == 1;
1622 m_chCntrFreqSeg1PresenceInd = ((val >> 9) & 0x0001) == 1;
1623 m_primChPresenceInd = ((val >> 10) & 0x0001) == 1;
1624 m_rsnInfoPresenceInd = (val >> 11) & 0x0001;
1625 m_lenPresenceInd = ((val >> 12) & 0x0001) == 1;
1626 m_mdPresenceInd = (val >> 13) & 0x0001;
1627
1628 return 2;
1629}
1630
1631std::ostream&
1632operator<<(std::ostream& os, const FilsDiscHeader::FdCapability& capability)
1633{
1634 os << "ess:" << capability.m_ess << " privacy:" << capability.m_privacy
1635 << " channelWidth:" << capability.m_chWidth << " maxNss:" << capability.m_maxNss
1636 << " multiBssidInd:" << capability.m_multiBssidPresenceInd
1637 << " phyIdx:" << capability.m_phyIdx << " minRate:" << capability.m_minRate;
1638 return os;
1639}
1640
1641void
1643{
1644 uint16_t val = m_ess | (m_privacy << 1) | (m_chWidth << 2) | (m_maxNss << 5) |
1645 (m_multiBssidPresenceInd << 9) | (m_phyIdx << 10) | (m_minRate << 13);
1646 start.WriteHtolsbU16(val);
1647}
1648
1651{
1652 auto val = start.ReadLsbtohU16();
1653
1654 m_ess = val & 0x0001;
1655 m_privacy = (val >> 1) & 0x0001;
1656 m_chWidth = (val >> 2) & 0x0007;
1657 m_maxNss = (val >> 5) & 0x0007;
1658 m_multiBssidPresenceInd = (val >> 9) & 0x0001;
1659 m_phyIdx = (val >> 10) & 0x0007;
1660 m_minRate = (val >> 13) & 0x0007;
1661
1662 return 2;
1663}
1664
1665void
1667{
1668 m_chWidth = (width == 20 || width == 22) ? 0
1669 : (width == 40) ? 1
1670 : (width == 80) ? 2
1671 : (width == 160) ? 3
1672 : 4;
1673}
1674
1675uint16_t
1677{
1678 switch (m_chWidth)
1679 {
1680 case 0:
1681 return m_phyIdx == 0 ? 22 : 20; // PHY Index 0 indicates 802.11b
1682 case 1:
1683 return 40;
1684 case 2:
1685 return 80;
1686 case 3:
1687 return 160;
1688 default:
1689 NS_ABORT_MSG("Reserved value: " << +m_chWidth);
1690 }
1691 return 0;
1692}
1693
1694void
1696{
1697 NS_ABORT_MSG_IF(maxNss < 1, "NSS is equal to 0");
1698 maxNss--;
1699 // 4 is the maximum value for the Maximum Number of Spatial Streams subfield
1700 m_maxNss = std::min<uint8_t>(maxNss, 4);
1701}
1702
1703uint8_t
1705{
1706 return m_maxNss + 1;
1707}
1708
1709void
1711{
1712 switch (standard)
1713 {
1715 m_phyIdx = 0;
1716 break;
1719 m_phyIdx = 1;
1720 break;
1722 m_phyIdx = 2;
1723 break;
1725 m_phyIdx = 3;
1726 break;
1728 m_phyIdx = 4;
1729 break;
1731 m_phyIdx = 5;
1732 break;
1733 default:
1734 NS_ABORT_MSG("Unsupported standard: " << standard);
1735 }
1736}
1737
1740{
1741 switch (m_phyIdx)
1742 {
1743 case 0:
1744 return WIFI_STANDARD_80211b;
1745 case 1:
1747 "Invalid PHY band (" << band << ") with PHY index of 1");
1749 case 2:
1750 return WIFI_STANDARD_80211n;
1751 case 3:
1752 return WIFI_STANDARD_80211ac;
1753 case 4:
1754 return WIFI_STANDARD_80211ax;
1755 case 5:
1756 return WIFI_STANDARD_80211be;
1757 default:
1758 NS_ABORT_MSG("Invalid PHY index: " << m_phyIdx);
1759 }
1760
1762}
1763
1764} // namespace ns3
The IEEE 802.11 ADDBA Extension Element (Sec.
ExtParamSet m_extParamSet
ADDBA Extended Parameter Set field.
iterator in a Buffer instance
Definition: buffer.h:100
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:902
uint8_t ReadU8()
Definition: buffer.h:1027
void WriteU8(uint8_t data)
Definition: buffer.h:881
void Write(const uint8_t *buffer, uint32_t size)
Definition: buffer.cc:948
uint16_t ReadLsbtohU16()
Definition: buffer.cc:1064
void Read(uint8_t *buffer, uint32_t size)
Definition: buffer.cc:1125
uint64_t ReadLsbtohU64()
Definition: buffer.cc:1094
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:920
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:780
void Next()
go forward by one byte
Definition: buffer.h:853
Implement the FILS (Fast Initial Link Setup) action frame.
uint16_t m_beaconInt
Beacon Interval in TU (1024 us)
std::optional< ReducedNeighborReport > m_rnr
Reduced Neighbor Report.
OptFieldWithPresenceInd< uint8_t > m_chCntrFreqSeg1
Channel Center Frequency Segment 1.
uint32_t GetSerializedSize() const override
OptFieldWithPresenceInd< uint8_t > m_primaryCh
Primary Channel.
OptFieldWithPresenceInd< uint8_t > m_accessNetOpt
Access Network Options.
const std::string & GetSsid() const
void SetSsid(const std::string &ssid)
Set the SSID field.
uint32_t Deserialize(Buffer::Iterator start) override
FilsDiscFrameControl m_frameCtl
FILS Discovery Frame Control.
OptFieldWithPresenceInd< FdCapability > m_fdCap
FD Capability.
std::optional< uint8_t > m_opClass
Operating Class.
void Print(std::ostream &os) const override
uint32_t GetSizeNonOptSubfields() const
OptFieldWithPresenceInd< uint8_t > m_len
Length.
uint32_t GetInformationFieldSize() const
uint64_t m_timeStamp
Timestamp.
void SetLengthSubfield()
sets value of Length subfield
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Serialize(Buffer::Iterator start) const override
std::string m_ssid
SSID.
OptFieldWithPresenceInd< uint8_t > m_apConfigSeqNum
AP Configuration Sequence Number (AP-CSN)
std::optional< Tim > m_tim
Traffic Indication Map element.
Protocol header serialization and deserialization.
Definition: header.h:44
Implement the header for management frames of type Add Block Ack request.
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t m_startingSeq
Starting sequence number.
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.
static TypeId GetTypeId()
Register this type.
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
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.
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.
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.
void SetTimeout(uint16_t timeout)
Set timeout.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint8_t m_policy
Block Ack policy.
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
Implement the header for management frames of type Add Block Ack response.
uint16_t m_bufferSize
Buffer size.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t GetSerializedSize() const override
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
uint8_t m_dialogToken
Not used for now.
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.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetBufferSize(uint16_t size)
Set buffer size.
void Print(std::ostream &os) const override
void SetStatusCode(StatusCode code)
Set the status code.
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.
Implement the header for management frames of type Delete Block Ack.
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
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.
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.
uint32_t GetSerializedSize() const override
void SetByOriginator()
Set the initiator bit in the DELBA.
Implement the header for Action frames of type EML Operating Mode Notification.
void Serialize(Buffer::Iterator start) const override
uint32_t GetSerializedSize() const override
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
EmlControl m_emlControl
EML Control field.
uint32_t Deserialize(Buffer::Iterator start) override
void Print(std::ostream &os) const override
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_dialogToken
Dialog Token.
std::list< uint8_t > GetLinkBitmap() const
static TypeId GetTypeId()
Register this type.
constexpr void reset()
Destroy the value (if any) contained in the optional field.
constexpr bool has_value() const
Check whether this object contains a value.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:208
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
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:415
@ US
microsecond
Definition: nstime.h:118
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:932
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
uint32_t GetSerializedSize() const override
CategoryValue
CategoryValue enumeration.
uint8_t m_category
Category of the action.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_actionValue
Action value.
uint32_t Deserialize(Buffer::Iterator start) override
static std::pair< CategoryValue, ActionValue > Peek(Ptr< const Packet > pkt)
Peek an Action header from the given packet.
void Print(std::ostream &os) const override
static std::pair< CategoryValue, ActionValue > Remove(Ptr< Packet > pkt)
Remove an Action header from the given packet.
static TypeId GetTypeId()
Register this type.
void SetAction(CategoryValue type, ActionValue action)
Set action for this Action header.
void Serialize(Buffer::Iterator start) const override
CategoryValue GetCategory() const
Return the category value.
ActionValue GetAction() const
Return the action value.
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 Serialize(Buffer::Iterator i) const
Serialize entire IE including Element ID and length fields.
Buffer::Iterator DeserializeIfPresent(Buffer::Iterator i)
Deserialize entire IE (which may possibly be fragmented into multiple elements) if it is present.
#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_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:86
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:179
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:49
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_UNSPECIFIED
@ WIFI_STANDARD_80211ac
@ WIFI_STANDARD_80211b
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
#define CASE_ACTION_VALUE(x)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:159
#define list
ns3::Time timeout
uint8_t extBufferSize
extended buffer size
static Time DecodeEmlsrTransitionDelay(uint8_t value)
static Time DecodeEmlsrPaddingDelay(uint8_t value)
FD Capability subfield of FILS Discovery Information field.
WifiStandard GetStandard(WifiPhyBand band) const
uint8_t GetMaxNss() const
Note that this function returns 5 if the maximum number of supported spatial streams is greater than ...
uint8_t m_minRate
FILS Minimum Rate.
void SetOpChannelWidth(uint16_t width)
Set the BSS Operating Channel Width field based on the operating channel width.
void SetMaxNss(uint8_t maxNss)
Set the Maximum Number of Spatial Streams field.
uint8_t m_chWidth
BSS Operating Channel Width.
uint8_t m_multiBssidPresenceInd
Multiple BSSIDs Presence Indicator.
uint8_t m_maxNss
Maximum Number of Spatial Streams.
void Serialize(Buffer::Iterator &start) const
serialize content to a given buffer
uint32_t Deserialize(Buffer::Iterator start)
read content from a given buffer
void SetStandard(WifiStandard standard)
Set the PHY Index field based on the given wifi standard.
FILS Discovery Frame Control subfield of FILS Discovery Information field.
bool m_apCsnPresenceInd
AP-CSN Presence Indicator.
bool m_chCntrFreqSeg1PresenceInd
Channel Center Frequency Segment 1 Presence Indicator.
uint8_t m_shortSsidInd
Short SSID Indicator (not supported)
bool m_anoPresenceInd
ANO Presence Indicator.
void Serialize(Buffer::Iterator &start) const
serialize content to a given buffer
uint8_t m_rsnInfoPresenceInd
RSN info Presence Indicator (not supported)
bool m_capPresenceInd
Capability Presence Indicator.
uint8_t m_mdPresenceInd
MD Presence Indicator (not supported)
uint32_t Deserialize(Buffer::Iterator start)
read content from a given buffer
bool m_lenPresenceInd
Length Presence Indicator.
bool m_primChPresenceInd
Primary Channel Presence Indicator.
std::optional< uint8_t > mcsMapCountCtrl
MCS Map Count Control.
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
std::optional< uint16_t > linkBitmap
EMLSR/EMLMR Link Bitmap.
EMLSR Parameter Update field.
typedef for union of different ActionValues
UnprotectedDmgActionValue unprotectedDmgAction
unprotected dmg
ProtectedEhtActionValue protectedEhtAction
protected eht
SelfProtectedActionValue selfProtectedAction
self protected
MultihopActionValue multihopAction
multi hop
RadioMeasurementActionValue radioMeasurementAction
radio measurement
PublicActionValue publicAction
public
BlockAckActionValue blockAck
block ack