A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
mgt-headers.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 INRIA
3 * Copyright (c) 2009 MIRKO BANCHI
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19 * Mirko Banchi <mk.banchi@gmail.com>
20 */
21
22#include "mgt-headers.h"
23
24#include "ns3/address-utils.h"
25#include "ns3/packet.h"
26#include "ns3/simulator.h"
27
28namespace ns3
29{
30
31/***********************************************************
32 * Probe Request
33 ***********************************************************/
34
35NS_OBJECT_ENSURE_REGISTERED(MgtProbeRequestHeader);
36
37TypeId
39{
40 static TypeId tid = TypeId("ns3::MgtProbeRequestHeader")
42 .SetGroupName("Wifi")
43 .AddConstructor<MgtProbeRequestHeader>();
44 return tid;
45}
46
49{
50 return GetTypeId();
51}
52
53/***********************************************************
54 * Probe Response
55 ***********************************************************/
56
58
61{
62 static TypeId tid = TypeId("ns3::MgtProbeResponseHeader")
64 .SetGroupName("Wifi")
65 .AddConstructor<MgtProbeResponseHeader>();
66 return tid;
67}
68
71{
72 return GetTypeId();
73}
74
75uint64_t
77{
78 return m_beaconInterval;
79}
80
81void
83{
85}
86
89{
90 return m_capability;
91}
92
95{
96 return m_capability;
97}
98
99uint64_t
101{
102 return m_timestamp;
103}
104
107{
108 uint32_t size = 8 /* timestamp */ + 2 /* beacon interval */;
111 return size;
112}
113
114void
116{
117 Buffer::Iterator i = start;
118 i.WriteHtolsbU64(Simulator::Now().GetMicroSeconds());
119 i.WriteHtolsbU16(static_cast<uint16_t>(m_beaconInterval / 1024));
120 i = m_capability.Serialize(i);
122}
123
126{
127 Buffer::Iterator i = start;
130 m_beaconInterval *= 1024;
132 auto distance = i.GetDistanceFrom(start);
134}
135
136/***********************************************************
137 * Beacons
138 ***********************************************************/
139
141
142/* static */
143TypeId
145{
146 static TypeId tid = TypeId("ns3::MgtBeaconHeader")
148 .SetGroupName("Wifi")
149 .AddConstructor<MgtBeaconHeader>();
150 return tid;
151}
152
153/***********************************************************
154 * Assoc Request
155 ***********************************************************/
156
158
159TypeId
161{
162 static TypeId tid = TypeId("ns3::MgtAssocRequestHeader")
163 .SetParent<Header>()
164 .SetGroupName("Wifi")
165 .AddConstructor<MgtAssocRequestHeader>();
166 return tid;
167}
168
169TypeId
171{
172 return GetTypeId();
173}
174
175uint16_t
177{
178 return m_listenInterval;
179}
180
181void
183{
184 m_listenInterval = interval;
185}
186
189{
190 return m_capability;
191}
192
195{
196 return m_capability;
197}
198
201{
202 SetMleContainingFrame();
203
204 uint32_t size = 0;
206 size += 2; // listen interval
208 return size;
209}
210
213 const MgtAssocRequestHeader& frame) const
214{
215 uint32_t size = 0;
217 size +=
220 return size;
221}
222
223void
225{
226 SetMleContainingFrame();
227
228 Buffer::Iterator i = start;
229 i = m_capability.Serialize(i);
232}
233
234void
236 const MgtAssocRequestHeader& frame) const
237{
238 Buffer::Iterator i = start;
239 i = m_capability.Serialize(i);
242}
243
246{
247 Buffer::Iterator i = start;
250 auto distance = i.GetDistanceFrom(start) +
252 if (auto& mle = Get<MultiLinkElement>())
253 {
254 for (std::size_t id = 0; id < mle->GetNPerStaProfileSubelements(); id++)
255 {
256 auto& perStaProfile = mle->GetPerStaProfile(id);
257 if (perStaProfile.HasAssocRequest())
258 {
259 auto& frameInPerStaProfile =
260 std::get<std::reference_wrapper<MgtAssocRequestHeader>>(
261 perStaProfile.GetAssocRequest())
262 .get();
263 frameInPerStaProfile.CopyIesFromContainingFrame(*this);
264 }
265 }
266 }
267 return distance;
268}
269
272 uint16_t length,
273 const MgtAssocRequestHeader& frame)
274{
275 Buffer::Iterator i = start;
278 auto distance = i.GetDistanceFrom(start);
279 NS_ASSERT_MSG(distance <= length,
280 "Bytes read (" << distance << ") exceed expected number (" << length << ")");
282 DeserializeFromPerStaProfileImpl(i, length - distance, frame);
283}
284
285/***********************************************************
286 * Ressoc Request
287 ***********************************************************/
288
290
291TypeId
293{
294 static TypeId tid = TypeId("ns3::MgtReassocRequestHeader")
295 .SetParent<Header>()
296 .SetGroupName("Wifi")
297 .AddConstructor<MgtReassocRequestHeader>();
298 return tid;
299}
300
301TypeId
303{
304 return GetTypeId();
305}
306
307uint16_t
309{
310 return m_listenInterval;
311}
312
313void
315{
316 m_listenInterval = interval;
317}
318
321{
322 return m_capability;
323}
324
327{
328 return m_capability;
329}
330
331void
333{
334 m_currentApAddr = currentApAddr;
335}
336
339{
340 SetMleContainingFrame();
341
342 uint32_t size = 0;
344 size += 2; // listen interval
345 size += 6; // current AP address
347 return size;
348}
349
352 const MgtReassocRequestHeader& frame) const
353{
354 uint32_t size = 0;
356 size +=
359 return size;
360}
361
362void
364{
365 os << "current AP address=" << m_currentApAddr << ", ";
367}
368
369void
371{
372 SetMleContainingFrame();
373
374 Buffer::Iterator i = start;
375 i = m_capability.Serialize(i);
379}
380
381void
383 const MgtReassocRequestHeader& frame) const
384{
385 Buffer::Iterator i = start;
386 i = m_capability.Serialize(i);
389}
390
393{
394 Buffer::Iterator i = start;
398 auto distance = i.GetDistanceFrom(start) +
400 if (auto& mle = Get<MultiLinkElement>())
401 {
402 for (std::size_t id = 0; id < mle->GetNPerStaProfileSubelements(); id++)
403 {
404 auto& perStaProfile = mle->GetPerStaProfile(id);
405 if (perStaProfile.HasReassocRequest())
406 {
407 auto& frameInPerStaProfile =
408 std::get<std::reference_wrapper<MgtReassocRequestHeader>>(
409 perStaProfile.GetAssocRequest())
410 .get();
411 frameInPerStaProfile.CopyIesFromContainingFrame(*this);
412 }
413 }
414 }
415 return distance;
416}
417
420 uint16_t length,
421 const MgtReassocRequestHeader& frame)
422{
423 Buffer::Iterator i = start;
427 auto distance = i.GetDistanceFrom(start);
428 NS_ASSERT_MSG(distance <= length,
429 "Bytes read (" << distance << ") exceed expected number (" << length << ")");
431 DeserializeFromPerStaProfileImpl(i, length - distance, frame);
432}
433
434/***********************************************************
435 * Assoc/Reassoc Response
436 ***********************************************************/
437
439
440TypeId
442{
443 static TypeId tid = TypeId("ns3::MgtAssocResponseHeader")
444 .SetParent<Header>()
445 .SetGroupName("Wifi")
446 .AddConstructor<MgtAssocResponseHeader>();
447 return tid;
448}
449
450TypeId
452{
453 return GetTypeId();
454}
455
458{
459 return m_code;
460}
461
462void
464{
465 m_code = code;
466}
467
470{
471 return m_capability;
472}
473
476{
477 return m_capability;
478}
479
480void
482{
483 m_aid = aid;
484}
485
486uint16_t
488{
489 return m_aid;
490}
491
494{
495 SetMleContainingFrame();
496
497 uint32_t size = 0;
499 size += m_code.GetSerializedSize();
500 size += 2; // aid
502 return size;
503}
504
507 const MgtAssocResponseHeader& frame) const
508{
509 uint32_t size = 0;
511 size += m_code.GetSerializedSize();
512 size +=
515 return size;
516}
517
518void
520{
521 os << "status code=" << m_code << ", "
522 << "aid=" << m_aid << ", ";
524}
525
526void
528{
529 SetMleContainingFrame();
530
531 Buffer::Iterator i = start;
532 i = m_capability.Serialize(i);
533 i = m_code.Serialize(i);
536}
537
538void
540 const MgtAssocResponseHeader& frame) const
541{
542 Buffer::Iterator i = start;
543 i = m_capability.Serialize(i);
544 i = m_code.Serialize(i);
547}
548
551{
552 Buffer::Iterator i = start;
554 i = m_code.Deserialize(i);
555 m_aid = i.ReadLsbtohU16();
556 auto distance = i.GetDistanceFrom(start) +
558 if (auto& mle = Get<MultiLinkElement>())
559 {
560 for (std::size_t id = 0; id < mle->GetNPerStaProfileSubelements(); id++)
561 {
562 auto& perStaProfile = mle->GetPerStaProfile(id);
563 if (perStaProfile.HasAssocResponse())
564 {
565 auto& frameInPerStaProfile = perStaProfile.GetAssocResponse();
566 frameInPerStaProfile.CopyIesFromContainingFrame(*this);
567 }
568 }
569 }
570 return distance;
571}
572
575 uint16_t length,
576 const MgtAssocResponseHeader& frame)
577{
578 Buffer::Iterator i = start;
580 i = m_code.Deserialize(i);
581 m_aid = frame.m_aid;
582 auto distance = i.GetDistanceFrom(start);
583 NS_ASSERT_MSG(distance <= length,
584 "Bytes read (" << distance << ") exceed expected number (" << length << ")");
586 DeserializeFromPerStaProfileImpl(i, length - distance, frame);
587}
588
589/**********************************************************
590 * ActionFrame
591 **********************************************************/
593{
594}
595
597{
598}
599
600void
603{
604 m_category = static_cast<uint8_t>(type);
605 switch (type)
606 {
607 case QOS: {
608 m_actionValue = static_cast<uint8_t>(action.qos);
609 break;
610 }
611 case BLOCK_ACK: {
612 m_actionValue = static_cast<uint8_t>(action.blockAck);
613 break;
614 }
615 case PUBLIC: {
616 m_actionValue = static_cast<uint8_t>(action.publicAction);
617 break;
618 }
619 case RADIO_MEASUREMENT: {
620 m_actionValue = static_cast<uint8_t>(action.radioMeasurementAction);
621 break;
622 }
623 case MESH: {
624 m_actionValue = static_cast<uint8_t>(action.meshAction);
625 break;
626 }
627 case MULTIHOP: {
628 m_actionValue = static_cast<uint8_t>(action.multihopAction);
629 break;
630 }
631 case SELF_PROTECTED: {
632 m_actionValue = static_cast<uint8_t>(action.selfProtectedAction);
633 break;
634 }
635 case DMG: {
636 m_actionValue = static_cast<uint8_t>(action.dmgAction);
637 break;
638 }
639 case FST: {
640 m_actionValue = static_cast<uint8_t>(action.fstAction);
641 break;
642 }
643 case UNPROTECTED_DMG: {
644 m_actionValue = static_cast<uint8_t>(action.unprotectedDmgAction);
645 break;
646 }
647 case PROTECTED_EHT: {
648 m_actionValue = static_cast<uint8_t>(action.protectedEhtAction);
649 break;
650 }
652 break;
653 }
654 }
655}
656
659{
660 switch (m_category)
661 {
662 case QOS:
663 return QOS;
664 case BLOCK_ACK:
665 return BLOCK_ACK;
666 case PUBLIC:
667 return PUBLIC;
669 return RADIO_MEASUREMENT;
670 case MESH:
671 return MESH;
672 case MULTIHOP:
673 return MULTIHOP;
674 case SELF_PROTECTED:
675 return SELF_PROTECTED;
676 case DMG:
677 return DMG;
678 case FST:
679 return FST;
680 case UNPROTECTED_DMG:
681 return UNPROTECTED_DMG;
682 case PROTECTED_EHT:
683 return PROTECTED_EHT;
686 default:
687 NS_FATAL_ERROR("Unknown action value");
688 return SELF_PROTECTED;
689 }
690}
691
694{
695 ActionValue retval;
696 retval.selfProtectedAction =
697 PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases
698 switch (m_category)
699 {
700 case QOS:
701 switch (m_actionValue)
702 {
703 case ADDTS_REQUEST:
704 retval.qos = ADDTS_REQUEST;
705 break;
706 case ADDTS_RESPONSE:
707 retval.qos = ADDTS_RESPONSE;
708 break;
709 case DELTS:
710 retval.qos = DELTS;
711 break;
712 case SCHEDULE:
713 retval.qos = SCHEDULE;
714 break;
716 retval.qos = QOS_MAP_CONFIGURE;
717 break;
718 default:
719 NS_FATAL_ERROR("Unknown qos action code");
720 retval.qos = ADDTS_REQUEST; /* quiet compiler */
721 }
722 break;
723
724 case BLOCK_ACK:
725 switch (m_actionValue)
726 {
729 break;
732 break;
733 case BLOCK_ACK_DELBA:
734 retval.blockAck = BLOCK_ACK_DELBA;
735 break;
736 default:
737 NS_FATAL_ERROR("Unknown block ack action code");
738 retval.blockAck = BLOCK_ACK_ADDBA_REQUEST; /* quiet compiler */
739 }
740 break;
741
742 case PUBLIC:
743 switch (m_actionValue)
744 {
745 case QAB_REQUEST:
746 retval.publicAction = QAB_REQUEST;
747 break;
748 case QAB_RESPONSE:
749 retval.publicAction = QAB_RESPONSE;
750 break;
751 default:
752 NS_FATAL_ERROR("Unknown public action code");
753 retval.publicAction = QAB_REQUEST; /* quiet compiler */
754 }
755 break;
756
758 switch (m_actionValue)
759 {
762 break;
765 break;
768 break;
771 break;
774 break;
777 break;
778 default:
779 NS_FATAL_ERROR("Unknown radio measurement action code");
780 retval.radioMeasurementAction = RADIO_MEASUREMENT_REQUEST; /* quiet compiler */
781 }
782 break;
783
784 case SELF_PROTECTED:
785 switch (m_actionValue)
786 {
787 case PEER_LINK_OPEN:
789 break;
792 break;
793 case PEER_LINK_CLOSE:
795 break;
796 case GROUP_KEY_INFORM:
798 break;
799 case GROUP_KEY_ACK:
801 break;
802 default:
803 NS_FATAL_ERROR("Unknown mesh peering management action code");
804 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
805 }
806 break;
807
808 case MESH:
809 switch (m_actionValue)
810 {
813 break;
814 case PATH_SELECTION:
815 retval.meshAction = PATH_SELECTION;
816 break;
819 break;
822 break;
825 break;
826 case MDA_SETUP_REPLY:
828 break;
831 break;
834 break;
837 break;
840 break;
843 break;
844 default:
845 NS_FATAL_ERROR("Unknown mesh peering management action code");
846 retval.meshAction = LINK_METRIC_REPORT; /* quiet compiler */
847 }
848 break;
849
850 case MULTIHOP: // not yet supported
851 switch (m_actionValue)
852 {
853 case PROXY_UPDATE: // not used so far
855 break;
856 case PROXY_UPDATE_CONFIRMATION: // not used so far
858 break;
859 default:
860 NS_FATAL_ERROR("Unknown mesh peering management action code");
861 retval.multihopAction = PROXY_UPDATE; /* quiet compiler */
862 }
863 break;
864
865 case DMG:
866 switch (m_actionValue)
867 {
870 break;
873 break;
876 break;
879 break;
882 break;
885 break;
886 case DMG_DTP_REQUEST:
887 retval.dmgAction = DMG_DTP_REQUEST;
888 break;
889 case DMG_DTP_RESPONSE:
891 break;
894 break;
897 break;
900 break;
903 break;
904 case DMG_RLS_REQUEST:
905 retval.dmgAction = DMG_RLS_REQUEST;
906 break;
907 case DMG_RLS_RESPONSE:
909 break;
912 break;
913 case DMG_RLS_TEARDOWN:
915 break;
918 break;
921 break;
922 case DMG_TPA_REQUEST:
923 retval.dmgAction = DMG_TPA_REQUEST;
924 break;
925 case DMG_TPA_RESPONSE:
927 break;
928 case DMG_ROC_REQUEST:
929 retval.dmgAction = DMG_ROC_REQUEST;
930 break;
931 case DMG_ROC_RESPONSE:
933 break;
934 default:
935 NS_FATAL_ERROR("Unknown DMG management action code");
936 retval.dmgAction = DMG_POWER_SAVE_CONFIGURATION_REQUEST; /* quiet compiler */
937 }
938 break;
939
940 case FST:
941 switch (m_actionValue)
942 {
945 break;
948 break;
949 case FST_TEAR_DOWN:
950 retval.fstAction = FST_TEAR_DOWN;
951 break;
952 case FST_ACK_REQUEST:
953 retval.fstAction = FST_ACK_REQUEST;
954 break;
955 case FST_ACK_RESPONSE:
957 break;
960 break;
961 default:
962 NS_FATAL_ERROR("Unknown FST management action code");
963 retval.fstAction = FST_SETUP_REQUEST; /* quiet compiler */
964 }
965 break;
966
967 case UNPROTECTED_DMG:
968 switch (m_actionValue)
969 {
972 break;
975 break;
978 break;
981 break;
984 break;
987 break;
988 default:
989 NS_FATAL_ERROR("Unknown Unprotected DMG action code");
990 retval.unprotectedDmgAction = UNPROTECTED_DMG_ANNOUNCE; /* quiet compiler */
991 }
992 break;
993
994 case PROTECTED_EHT:
995 switch (m_actionValue)
996 {
999 break;
1002 break;
1005 break;
1008 break;
1011 break;
1014 break;
1017 break;
1020 break;
1023 break;
1026 break;
1027 default:
1028 NS_FATAL_ERROR("Unknown Protected EHT action code");
1029 retval.protectedEhtAction =
1030 PROTECTED_EHT_TID_TO_LINK_MAPPING_REQUEST; /* quiet compiler */
1031 }
1032 break;
1033
1034 default:
1035 NS_FATAL_ERROR("Unsupported action");
1036 retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
1037 }
1038 return retval;
1039}
1040
1041TypeId
1043{
1044 static TypeId tid = TypeId("ns3::WifiActionHeader")
1045 .SetParent<Header>()
1046 .SetGroupName("Wifi")
1047 .AddConstructor<WifiActionHeader>();
1048 return tid;
1049}
1050
1051TypeId
1053{
1054 return GetTypeId();
1055}
1056
1057std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
1059{
1060 WifiActionHeader actionHdr;
1061 pkt->PeekHeader(actionHdr);
1062 return {actionHdr.GetCategory(), actionHdr.GetAction()};
1063}
1064
1065std::pair<WifiActionHeader::CategoryValue, WifiActionHeader::ActionValue>
1067{
1068 WifiActionHeader actionHdr;
1069 pkt->RemoveHeader(actionHdr);
1070 return {actionHdr.GetCategory(), actionHdr.GetAction()};
1071}
1072
1073void
1074WifiActionHeader::Print(std::ostream& os) const
1075{
1076#define CASE_ACTION_VALUE(x) \
1077 case x: \
1078 os << #x << "]"; \
1079 break;
1080
1081 switch (m_category)
1082 {
1083 case QOS:
1084 os << "QOS[";
1085 switch (m_actionValue)
1086 {
1092 default:
1093 NS_FATAL_ERROR("Unknown qos action code");
1094 }
1095 break;
1096 case BLOCK_ACK:
1097 os << "BLOCK_ACK[";
1098 switch (m_actionValue)
1099 {
1103 default:
1104 NS_FATAL_ERROR("Unknown block ack action code");
1105 }
1106 break;
1107 case PUBLIC:
1108 os << "PUBLIC[";
1109 switch (m_actionValue)
1110 {
1113 default:
1114 NS_FATAL_ERROR("Unknown public action code");
1115 }
1116 break;
1117 case RADIO_MEASUREMENT:
1118 os << "RADIO_MEASUREMENT[";
1119 switch (m_actionValue)
1120 {
1127 default:
1128 NS_FATAL_ERROR("Unknown radio measurement action code");
1129 }
1130 break;
1131 case MESH:
1132 os << "MESH[";
1133 switch (m_actionValue)
1134 {
1146 default:
1147 NS_FATAL_ERROR("Unknown mesh peering management action code");
1148 }
1149 break;
1150 case MULTIHOP:
1151 os << "MULTIHOP[";
1152 switch (m_actionValue)
1153 {
1154 CASE_ACTION_VALUE(PROXY_UPDATE); // not used so far
1155 CASE_ACTION_VALUE(PROXY_UPDATE_CONFIRMATION); // not used so far
1156 default:
1157 NS_FATAL_ERROR("Unknown mesh peering management action code");
1158 }
1159 break;
1160 case SELF_PROTECTED:
1161 os << "SELF_PROTECTED[";
1162 switch (m_actionValue)
1163 {
1169 default:
1170 NS_FATAL_ERROR("Unknown mesh peering management action code");
1171 }
1172 break;
1173 case DMG:
1174 os << "DMG[";
1175 switch (m_actionValue)
1176 {
1199 default:
1200 NS_FATAL_ERROR("Unknown DMG management action code");
1201 }
1202 break;
1203 case FST:
1204 os << "FST[";
1205 switch (m_actionValue)
1206 {
1213 default:
1214 NS_FATAL_ERROR("Unknown FST management action code");
1215 }
1216 break;
1217 case UNPROTECTED_DMG:
1218 os << "UNPROTECTED_DMG[";
1219 switch (m_actionValue)
1220 {
1227 default:
1228 NS_FATAL_ERROR("Unknown Unprotected DMG action code");
1229 }
1230 break;
1231 case PROTECTED_EHT:
1232 os << "PROTECTED_EHT[";
1233 switch (m_actionValue)
1234 {
1245 default:
1246 NS_FATAL_ERROR("Unknown Protected EHT action code");
1247 }
1248 break;
1250 os << "VENDOR_SPECIFIC_ACTION";
1251 break;
1252 default:
1253 NS_FATAL_ERROR("Unknown action value");
1254 }
1255#undef CASE_ACTION_VALUE
1256}
1257
1260{
1261 return 2;
1262}
1263
1264void
1266{
1267 start.WriteU8(m_category);
1268 start.WriteU8(m_actionValue);
1269}
1270
1273{
1274 Buffer::Iterator i = start;
1275 m_category = i.ReadU8();
1276 m_actionValue = i.ReadU8();
1277 return i.GetDistanceFrom(start);
1278}
1279
1280/***************************************************
1281 * ADDBARequest
1282 ****************************************************/
1283
1285
1287 : m_dialogToken(1),
1288 m_amsduSupport(1),
1289 m_bufferSize(0)
1290{
1291}
1292
1293TypeId
1295{
1296 static TypeId tid = TypeId("ns3::MgtAddBaRequestHeader")
1297 .SetParent<Header>()
1298 .SetGroupName("Wifi")
1299 .AddConstructor<MgtAddBaRequestHeader>();
1300 return tid;
1301}
1302
1303TypeId
1305{
1306 return GetTypeId();
1307}
1308
1309void
1310MgtAddBaRequestHeader::Print(std::ostream& os) const
1311{
1312}
1313
1316{
1317 uint32_t size = 0;
1318 size += 1; // Dialog token
1319 size += 2; // Block ack parameter set
1320 size += 2; // Block ack timeout value
1321 size += 2; // Starting sequence control
1322 return size;
1323}
1324
1325void
1327{
1328 Buffer::Iterator i = start;
1333}
1334
1337{
1338 Buffer::Iterator i = start;
1339 m_dialogToken = i.ReadU8();
1343 return i.GetDistanceFrom(start);
1344}
1345
1346void
1348{
1349 m_policy = 0;
1350}
1351
1352void
1354{
1355 m_policy = 1;
1356}
1357
1358void
1360{
1361 NS_ASSERT(tid < 16);
1362 m_tid = tid;
1363}
1364
1365void
1367{
1369}
1370
1371void
1373{
1374 m_bufferSize = size;
1375}
1376
1377void
1379{
1380 m_startingSeq = seq;
1381}
1382
1383void
1385{
1386 m_startingSeq = (seqControl >> 4) & 0x0fff;
1387}
1388
1389void
1391{
1392 m_amsduSupport = supported;
1393}
1394
1395uint8_t
1397{
1398 return m_tid;
1399}
1400
1401bool
1403{
1404 return m_policy == 1;
1405}
1406
1407uint16_t
1409{
1410 return m_timeoutValue;
1411}
1412
1413uint16_t
1415{
1416 return m_bufferSize;
1417}
1418
1419bool
1421{
1422 return m_amsduSupport == 1;
1423}
1424
1425uint16_t
1427{
1428 return m_startingSeq;
1429}
1430
1431uint16_t
1433{
1434 return (m_startingSeq << 4) & 0xfff0;
1435}
1436
1437uint16_t
1439{
1440 uint16_t res = 0;
1441 res |= m_amsduSupport;
1442 res |= m_policy << 1;
1443 res |= m_tid << 2;
1444 res |= m_bufferSize << 6;
1445 return res;
1446}
1447
1448void
1450{
1451 m_amsduSupport = (params)&0x01;
1452 m_policy = (params >> 1) & 0x01;
1453 m_tid = (params >> 2) & 0x0f;
1454 m_bufferSize = (params >> 6) & 0x03ff;
1455}
1456
1457/***************************************************
1458 * ADDBAResponse
1459 ****************************************************/
1460
1462
1464 : m_dialogToken(1),
1465 m_amsduSupport(1),
1466 m_bufferSize(0)
1467{
1468}
1469
1470TypeId
1472{
1473 static TypeId tid = TypeId("ns3::MgtAddBaResponseHeader")
1474 .SetParent<Header>()
1475 .SetGroupName("Wifi")
1476 .AddConstructor<MgtAddBaResponseHeader>();
1477 return tid;
1478}
1479
1480TypeId
1482{
1483 return GetTypeId();
1484}
1485
1486void
1487MgtAddBaResponseHeader::Print(std::ostream& os) const
1488{
1489 os << "status code=" << m_code;
1490}
1491
1494{
1495 uint32_t size = 0;
1496 size += 1; // Dialog token
1497 size += m_code.GetSerializedSize(); // Status code
1498 size += 2; // Block ack parameter set
1499 size += 2; // Block ack timeout value
1500 return size;
1501}
1502
1503void
1505{
1506 Buffer::Iterator i = start;
1508 i = m_code.Serialize(i);
1511}
1512
1515{
1516 Buffer::Iterator i = start;
1517 m_dialogToken = i.ReadU8();
1518 i = m_code.Deserialize(i);
1521 return i.GetDistanceFrom(start);
1522}
1523
1524void
1526{
1527 m_policy = 0;
1528}
1529
1530void
1532{
1533 m_policy = 1;
1534}
1535
1536void
1538{
1539 NS_ASSERT(tid < 16);
1540 m_tid = tid;
1541}
1542
1543void
1545{
1547}
1548
1549void
1551{
1552 m_bufferSize = size;
1553}
1554
1555void
1557{
1558 m_code = code;
1559}
1560
1561void
1563{
1564 m_amsduSupport = supported;
1565}
1566
1569{
1570 return m_code;
1571}
1572
1573uint8_t
1575{
1576 return m_tid;
1577}
1578
1579bool
1581{
1582 return m_policy == 1;
1583}
1584
1585uint16_t
1587{
1588 return m_timeoutValue;
1589}
1590
1591uint16_t
1593{
1594 return m_bufferSize;
1595}
1596
1597bool
1599{
1600 return m_amsduSupport == 1;
1601}
1602
1603uint16_t
1605{
1606 uint16_t res = 0;
1607 res |= m_amsduSupport;
1608 res |= m_policy << 1;
1609 res |= m_tid << 2;
1610 res |= m_bufferSize << 6;
1611 return res;
1612}
1613
1614void
1616{
1617 m_amsduSupport = (params)&0x01;
1618 m_policy = (params >> 1) & 0x01;
1619 m_tid = (params >> 2) & 0x0f;
1620 m_bufferSize = (params >> 6) & 0x03ff;
1621}
1622
1623/***************************************************
1624 * DelBa
1625 ****************************************************/
1626
1628
1630 : m_reasonCode(1)
1631{
1632}
1633
1634TypeId
1636{
1637 static TypeId tid = TypeId("ns3::MgtDelBaHeader")
1638 .SetParent<Header>()
1639 .SetGroupName("Wifi")
1640 .AddConstructor<MgtDelBaHeader>();
1641 return tid;
1642}
1643
1644TypeId
1646{
1647 return GetTypeId();
1648}
1649
1650void
1651MgtDelBaHeader::Print(std::ostream& os) const
1652{
1653}
1654
1657{
1658 uint32_t size = 0;
1659 size += 2; // DelBa parameter set
1660 size += 2; // Reason code
1661 return size;
1662}
1663
1664void
1666{
1667 Buffer::Iterator i = start;
1670}
1671
1674{
1675 Buffer::Iterator i = start;
1678 return i.GetDistanceFrom(start);
1679}
1680
1681bool
1683{
1684 return m_initiator == 1;
1685}
1686
1687uint8_t
1689{
1690 NS_ASSERT(m_tid < 16);
1691 uint8_t tid = static_cast<uint8_t>(m_tid);
1692 return tid;
1693}
1694
1695void
1697{
1698 m_initiator = 1;
1699}
1700
1701void
1703{
1704 m_initiator = 0;
1705}
1706
1707void
1709{
1710 NS_ASSERT(tid < 16);
1711 m_tid = static_cast<uint16_t>(tid);
1712}
1713
1714uint16_t
1716{
1717 uint16_t res = 0;
1718 res |= m_initiator << 11;
1719 res |= m_tid << 12;
1720 return res;
1721}
1722
1723void
1725{
1726 m_initiator = (params >> 11) & 0x01;
1727 m_tid = (params >> 12) & 0x0f;
1728}
1729
1730/***************************************************
1731 * EMLSR Operating Mode Notification
1732 ****************************************************/
1733
1735
1736TypeId
1738{
1739 static TypeId tid = TypeId("ns3::MgtEmlOperatingModeNotification")
1740 .SetParent<Header>()
1741 .SetGroupName("Wifi")
1742 .AddConstructor<MgtEmlOperatingModeNotification>();
1743 return tid;
1744}
1745
1746TypeId
1748{
1749 return GetTypeId();
1750}
1751
1752void
1754{
1755 os << "EMLSR Mode=" << +m_emlControl.emlsrMode << " EMLMR Mode=" << +m_emlControl.emlmrMode
1756 << " EMLSR Parameter Update Control=" << +m_emlControl.emlsrParamUpdateCtrl;
1758 {
1759 os << " Link bitmap=" << std::hex << *m_emlControl.linkBitmap << std::dec;
1760 }
1762 {
1763 os << " EMLSR Padding Delay="
1765 .As(Time::US)
1766 << " EMLSR Transition Delay="
1768 .As(Time::US);
1769 }
1770}
1771
1774{
1775 uint32_t size = 2; // Dialog Token (1) + first byte of EML Control
1777 {
1778 size += 2;
1779 }
1781 {
1782 size += 1;
1783 }
1784 // TODO add size of EMLMR Supported MCS And NSS Set subfield when implemented
1786 {
1787 size += 1; // EMLSR Parameter Update field
1788 }
1789 return size;
1790}
1791
1792void
1794{
1795 start.WriteU8(m_dialogToken);
1796
1798 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1799 uint8_t val = m_emlControl.emlsrMode | (m_emlControl.emlmrMode << 1) |
1801 start.WriteU8(val);
1802
1805 "The EMLSR/EMLMR Link Bitmap is present if and only if either of the EMLSR "
1806 "Mode and EMLMR Mode subfields are set to 1");
1808 {
1809 start.WriteHtolsbU16(*m_emlControl.linkBitmap);
1810 }
1811 // TODO serialize MCS Map Count Control and EMLMR Supported MCS And NSS Set subfields
1812 // when implemented
1813
1815 "The EMLSR Parameter Update field is present "
1816 << std::boolalpha << m_emlsrParamUpdate.has_value()
1817 << " if and only if the EMLSR "
1818 "Parameter Update Control subfield is set to 1 "
1821 {
1822 val = m_emlsrParamUpdate->paddingDelay | (m_emlsrParamUpdate->transitionDelay << 3);
1823 start.WriteU8(val);
1824 }
1825}
1826
1829{
1830 Buffer::Iterator i = start;
1831
1832 m_dialogToken = i.ReadU8();
1833
1834 uint8_t val = i.ReadU8();
1835 m_emlControl.emlsrMode = val & 0x01;
1836 m_emlControl.emlmrMode = (val >> 1) & 0x01;
1837 m_emlControl.emlsrParamUpdateCtrl = (val >> 2) & 0x01;
1838
1840 "EMLSR Mode and EMLMR Mode cannot be both set to 1");
1841
1843 {
1845 }
1846 // TODO deserialize MCS Map Count Control and EMLMR Supported MCS And NSS Set subfields
1847 // when implemented
1848
1850 {
1851 val = i.ReadU8();
1853 m_emlsrParamUpdate->paddingDelay = val & 0x07;
1854 m_emlsrParamUpdate->transitionDelay = (val >> 3) & 0x07;
1855 }
1856
1857 return i.GetDistanceFrom(start);
1858}
1859
1860void
1862{
1863 NS_ABORT_MSG_IF(linkId > 15, "Link ID must not exceed 15");
1865 {
1867 }
1869}
1870
1871std::list<uint8_t>
1873{
1874 std::list<uint8_t> list;
1875 NS_ASSERT_MSG(m_emlControl.linkBitmap.has_value(), "No link bitmap");
1876 uint16_t bitmap = *m_emlControl.linkBitmap;
1877 for (uint8_t linkId = 0; linkId < 16; linkId++)
1878 {
1879 if ((bitmap & 0x0001) == 1)
1880 {
1881 list.push_back(linkId);
1882 }
1883 bitmap >>= 1;
1884 }
1885 return list;
1886}
1887
1888} // namespace ns3
iterator in a Buffer instance
Definition: buffer.h:100
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:908
uint8_t ReadU8()
Definition: buffer.h:1027
void WriteU8(uint8_t data)
Definition: buffer.h:881
uint16_t ReadLsbtohU16()
Definition: buffer.cc:1070
uint64_t ReadLsbtohU64()
Definition: buffer.cc:1100
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:926
uint32_t GetDistanceFrom(const Iterator &o) const
Definition: buffer.cc:786
uint32_t GetSerializedSize() const
Return the serialized size of capability information.
Buffer::Iterator Serialize(Buffer::Iterator start) const
Serialize capability information to the given buffer.
Buffer::Iterator Deserialize(Buffer::Iterator start)
Deserialize capability information from the given buffer.
Protocol header serialization and deserialization.
Definition: header.h:44
an EUI-48 address
Definition: mac48-address.h:46
Implement the header for management frames of type Add Block Ack request.
Definition: mgt-headers.h:795
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:918
void Serialize(Buffer::Iterator start) const override
uint16_t GetStartingSequenceControl() const
Return the raw sequence control.
void SetStartingSequenceControl(uint16_t seqControl)
Set sequence control with the given raw value.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:915
static TypeId GetTypeId()
Register this type.
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:913
void SetBufferSize(uint16_t size)
Set buffer size.
void Print(std::ostream &os) const override
void SetDelayedBlockAck()
Enable delayed BlockAck.
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:912
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
void SetImmediateBlockAck()
Enable immediate BlockAck.
uint16_t GetBufferSize() const
Return the buffer size.
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:916
uint16_t GetTimeout() const
Return the timeout.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t GetStartingSequence() const
Return the starting sequence number.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetSerializedSize() const override
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:917
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:914
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
Implement the header for management frames of type Add Block Ack response.
Definition: mgt-headers.h:926
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:1036
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t GetSerializedSize() const override
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:1033
uint8_t m_dialogToken
Not used for now.
Definition: mgt-headers.h:1031
void Serialize(Buffer::Iterator start) const override
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
uint16_t GetBufferSize() const
Return the buffer size.
bool IsAmsduSupported() const
Return whether A-MSDU capability is supported.
StatusCode GetStatusCode() const
Return the status code.
void SetTimeout(uint16_t timeout)
Set timeout.
uint8_t m_policy
Block ACK policy.
Definition: mgt-headers.h:1034
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void SetBufferSize(uint16_t size)
Set buffer size.
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:1037
void Print(std::ostream &os) const override
void SetStatusCode(StatusCode code)
Set the status code.
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:1035
uint8_t GetTid() const
Return the Traffic ID (TID).
bool IsImmediateBlockAck() const
Return whether the Block Ack policy is immediate Block Ack.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
uint16_t GetParameterSet() const
Return the raw parameter set.
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t GetTimeout() const
Return the timeout.
void SetDelayedBlockAck()
Enable delayed BlockAck.
void SetImmediateBlockAck()
Enable immediate BlockAck.
static TypeId GetTypeId()
Register this type.
StatusCode m_code
Status code.
Definition: mgt-headers.h:1032
Implement the header for management frames of type association request.
Definition: mgt-headers.h:161
uint32_t GetSerializedSizeImpl() const
Definition: mgt-headers.cc:200
uint32_t DeserializeImpl(Buffer::Iterator start)
Definition: mgt-headers.cc:245
CapabilityInformation & Capabilities()
Definition: mgt-headers.cc:194
uint32_t DeserializeFromPerStaProfileImpl(Buffer::Iterator start, uint16_t length, const MgtAssocRequestHeader &frame)
Deserialize this header from a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:271
void SerializeImpl(Buffer::Iterator start) const
Definition: mgt-headers.cc:224
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:235
void SerializeInPerStaProfileImpl(Buffer::Iterator start, const MgtAssocRequestHeader &frame) const
Serialize this header into a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:235
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:182
uint16_t GetListenInterval() const
Return the listen interval.
Definition: mgt-headers.cc:176
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:236
uint32_t GetSerializedSizeInPerStaProfileImpl(const MgtAssocRequestHeader &frame) const
Definition: mgt-headers.cc:212
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:160
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:170
Implement the header for management frames of type association and reassociation response.
Definition: mgt-headers.h:338
CapabilityInformation & Capabilities()
Definition: mgt-headers.cc:475
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:441
StatusCode GetStatusCode()
Return the status code.
Definition: mgt-headers.cc:457
uint32_t GetSerializedSizeImpl() const
Definition: mgt-headers.cc:493
uint32_t DeserializeFromPerStaProfileImpl(Buffer::Iterator start, uint16_t length, const MgtAssocResponseHeader &frame)
Deserialize this header from a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:574
uint32_t DeserializeImpl(Buffer::Iterator start)
Definition: mgt-headers.cc:550
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:463
uint32_t GetSerializedSizeInPerStaProfileImpl(const MgtAssocResponseHeader &frame) const
Definition: mgt-headers.cc:506
void SetAssociationId(uint16_t aid)
Set the association ID.
Definition: mgt-headers.cc:481
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:426
void SerializeImpl(Buffer::Iterator start) const
Definition: mgt-headers.cc:527
void PrintImpl(std::ostream &os) const
Definition: mgt-headers.cc:519
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:451
void SerializeInPerStaProfileImpl(Buffer::Iterator start, const MgtAssocResponseHeader &frame) const
Serialize this header into a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:539
uint16_t GetAssociationId() const
Return the association ID.
Definition: mgt-headers.cc:487
StatusCode m_code
Status code.
Definition: mgt-headers.h:427
Implement the header for management frames of type beacon.
Definition: mgt-headers.h:516
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:144
Implement the header for management frames of type Delete Block Ack.
Definition: mgt-headers.h:1045
static TypeId GetTypeId()
Register this type.
void SetTid(uint8_t tid)
Set Traffic ID (TID).
uint32_t Deserialize(Buffer::Iterator start) override
void SetByRecipient()
Un-set the initiator bit in the DELBA.
void Print(std::ostream &os) const override
uint16_t m_initiator
initiator
Definition: mgt-headers.h:1103
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t GetTid() const
Return the Traffic ID (TID).
uint16_t m_reasonCode
Not used for now.
Definition: mgt-headers.h:1105
bool IsByOriginator() const
Check if the initiator bit in the DELBA is set.
uint16_t GetParameterSet() const
Return the raw parameter set.
void Serialize(Buffer::Iterator start) const override
uint16_t m_tid
Traffic ID.
Definition: mgt-headers.h:1104
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.
Definition: mgt-headers.h:1113
void SetLinkIdInBitmap(uint8_t linkId)
Set the bit position in the link bitmap corresponding to the given link.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint8_t m_dialogToken
Dialog Token.
Definition: mgt-headers.h:1162
EmlControl m_emlControl
EML Control field.
Definition: mgt-headers.h:1163
uint32_t Deserialize(Buffer::Iterator start) override
static TypeId GetTypeId()
Register this type.
std::list< uint8_t > GetLinkBitmap() const
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
Definition: mgt-headers.h:1164
void Print(std::ostream &os) const override
uint32_t GetSerializedSize() const override
void Serialize(Buffer::Iterator start) const override
Implement the header for management frames that can be included in a Per-STA Profile subelement of a ...
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:436
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:38
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:48
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:455
uint64_t GetTimestamp() const
Return the time stamp.
Definition: mgt-headers.cc:100
uint64_t m_beaconInterval
Beacon interval.
Definition: mgt-headers.h:507
uint32_t GetSerializedSizeImpl() const
Definition: mgt-headers.cc:106
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:60
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:70
uint32_t DeserializeImpl(Buffer::Iterator start)
Definition: mgt-headers.cc:125
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:82
uint64_t GetBeaconIntervalUs() const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:76
void SerializeImpl(Buffer::Iterator start) const
Definition: mgt-headers.cc:115
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:508
uint64_t m_timestamp
Timestamp.
Definition: mgt-headers.h:506
CapabilityInformation & Capabilities()
Definition: mgt-headers.cc:94
Implement the header for management frames of type reassociation request.
Definition: mgt-headers.h:245
Mac48Address m_currentApAddr
Address of the current access point.
Definition: mgt-headers.h:327
uint16_t m_listenInterval
listen interval
Definition: mgt-headers.h:329
uint16_t GetListenInterval() const
Return the listen interval.
Definition: mgt-headers.cc:308
static TypeId GetTypeId()
Register this type.
Definition: mgt-headers.cc:292
CapabilityInformation & Capabilities()
Definition: mgt-headers.cc:326
void PrintImpl(std::ostream &os) const
Definition: mgt-headers.cc:363
void SerializeInPerStaProfileImpl(Buffer::Iterator start, const MgtReassocRequestHeader &frame) const
Serialize this header into a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:382
uint32_t DeserializeImpl(Buffer::Iterator start)
Definition: mgt-headers.cc:392
void SerializeImpl(Buffer::Iterator start) const
Definition: mgt-headers.cc:370
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:314
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:328
uint32_t GetSerializedSizeInPerStaProfileImpl(const MgtReassocRequestHeader &frame) const
Definition: mgt-headers.cc:351
uint32_t DeserializeFromPerStaProfileImpl(Buffer::Iterator start, uint16_t length, const MgtReassocRequestHeader &frame)
Deserialize this header from a Per-STA Profile subelement of a Multi-Link Element.
Definition: mgt-headers.cc:419
uint32_t GetSerializedSizeImpl() const
Definition: mgt-headers.cc:338
void SetCurrentApAddress(Mac48Address currentApAddr)
Set the address of the current access point.
Definition: mgt-headers.cc:332
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:302
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
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:417
@ 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:936
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:539
uint32_t GetSerializedSize() const override
uint8_t m_category
Category of the action.
Definition: mgt-headers.h:786
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
CategoryValue
CategoryValue enumeration.
Definition: mgt-headers.h:551
uint8_t m_actionValue
Action value.
Definition: mgt-headers.h:787
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.
Definition: mgt-headers.cc:601
~WifiActionHeader() override
Definition: mgt-headers.cc:596
void Serialize(Buffer::Iterator start) const override
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REQUEST
Definition: mgt-headers.h:659
@ DMG_MULTI_RELAY_CHANNEL_MEASUREMENT_REPORT
Definition: mgt-headers.h:660
CategoryValue GetCategory() const
Return the category value.
Definition: mgt-headers.cc:658
ActionValue GetAction() const
Return the action value.
Definition: mgt-headers.cc:693
@ PROTECTED_EHT_EML_OPERATING_MODE_NOTIFICATION
Definition: mgt-headers.h:714
@ PROTECTED_EHT_EPCS_PRIORITY_ACCESS_TEARDOWN
Definition: mgt-headers.h:713
@ PROTECTED_EHT_TID_TO_LINK_MAPPING_TEARDOWN
Definition: mgt-headers.h:710
@ PROTECTED_EHT_TID_TO_LINK_MAPPING_RESPONSE
Definition: mgt-headers.h:709
@ PROTECTED_EHT_EPCS_PRIORITY_ACCESS_ENABLE_RESPONSE
Definition: mgt-headers.h:712
@ PROTECTED_EHT_MULTI_LINK_OPERATION_UPDATE_RESPONSE
Definition: mgt-headers.h:717
@ PROTECTED_EHT_TID_TO_LINK_MAPPING_REQUEST
Definition: mgt-headers.h:708
@ PROTECTED_EHT_EPCS_PRIORITY_ACCESS_ENABLE_REQUEST
Definition: mgt-headers.h:711
@ PROTECTED_EHT_MULTI_LINK_OPERATION_UPDATE_REQUEST
Definition: mgt-headers.h:716
Implement the header for management frames.
#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_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
#define CASE_ACTION_VALUE(x)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::tuple< Ssid, SupportedRates, std::optional< ExtendedSupportedRatesIE >, std::optional< HtCapabilities >, std::optional< ExtendedCapabilities >, std::optional< VhtCapabilities >, std::optional< HeCapabilities >, std::optional< MultiLinkElement >, std::optional< EhtCapabilities >, std::optional< TidToLinkMapping > > AssocRequestElems
List of Information Elements included in Association Request frames.
Definition: mgt-headers.h:136
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.
std::tuple< SupportedRates, std::optional< ExtendedSupportedRatesIE >, std::optional< EdcaParameterSet >, std::optional< HtCapabilities >, std::optional< HtOperation >, std::optional< ExtendedCapabilities >, std::optional< VhtCapabilities >, std::optional< VhtOperation >, std::optional< HeCapabilities >, std::optional< HeOperation >, std::optional< MuEdcaParameterSet >, std::optional< MultiLinkElement >, std::optional< EhtCapabilities >, std::optional< EhtOperation >, std::optional< TidToLinkMapping > > AssocResponseElems
List of Information Elements included in Association Response frames.
Definition: mgt-headers.h:153
#define list
ns3::Time timeout
static Time DecodeEmlsrTransitionDelay(uint8_t value)
static Time DecodeEmlsrPaddingDelay(uint8_t value)
std::optional< uint8_t > mcsMapCountCtrl
MCS Map Count Control.
Definition: mgt-headers.h:1138
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
Definition: mgt-headers.h:1135
std::optional< uint16_t > linkBitmap
EMLSR/EMLMR Link Bitmap.
Definition: mgt-headers.h:1137
typedef for union of different ActionValues
Definition: mgt-headers.h:723
UnprotectedDmgActionValue unprotectedDmgAction
unprotected dmg
Definition: mgt-headers.h:733
ProtectedEhtActionValue protectedEhtAction
protected eht
Definition: mgt-headers.h:734
SelfProtectedActionValue selfProtectedAction
self protected
Definition: mgt-headers.h:728
MultihopActionValue multihopAction
multi hop
Definition: mgt-headers.h:729
RadioMeasurementActionValue radioMeasurementAction
radio measurement
Definition: mgt-headers.h:726
PublicActionValue publicAction
public
Definition: mgt-headers.h:727
MeshActionValue meshAction
mesh
Definition: mgt-headers.h:730
BlockAckActionValue blockAck
block ack
Definition: mgt-headers.h:725