A Discrete-Event Network Simulator
API
wifi-mac-header.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006, 2009 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/nstime.h"
24 #include "ns3/address-utils.h"
25 #include "wifi-mac-header.h"
26 
27 namespace ns3 {
28 
29 NS_OBJECT_ENSURE_REGISTERED (WifiMacHeader);
30 
32 enum
33 {
34  TYPE_MGT = 0,
35  TYPE_CTL = 1,
36  TYPE_DATA = 2
37 };
38 
40 enum
41 {
42  //Reserved: 0 - 1
44  //Reserved: 3
56 };
57 
59  : m_ctrlMoreFrag (0),
60  m_ctrlRetry (0),
61  m_ctrlMoreData (0),
62  m_ctrlWep (0),
63  m_ctrlOrder (0),
64  m_duration (0),
65  m_seqFrag (0),
66  m_seqSeq (0),
67  m_qosEosp (0),
68  m_qosAckPolicy (0), // Normal Ack
69  m_amsduPresent (0)
70 {
71 }
72 
74  : WifiMacHeader ()
75 {
76  SetType (type);
77 }
78 
80 {
81 }
82 
83 void
85 {
86  m_ctrlFromDs = 1;
87 }
88 
89 void
91 {
92  m_ctrlFromDs = 0;
93 }
94 
95 void
97 {
98  m_ctrlToDs = 1;
99 }
100 
101 void
103 {
104  m_ctrlToDs = 0;
105 }
106 
107 void
109 {
110  m_addr1 = address;
111 }
112 
113 void
115 {
116  m_addr2 = address;
117 }
118 
119 void
121 {
122  m_addr3 = address;
123 }
124 
125 void
127 {
128  m_addr4 = address;
129 }
130 
131 void
132 WifiMacHeader::SetType (WifiMacType type, bool resetToDsFromDs)
133 {
134  switch (type)
135  {
139  break;
143  break;
147  break;
151  break;
152  case WIFI_MAC_CTL_RTS:
155  break;
156  case WIFI_MAC_CTL_CTS:
159  break;
160  case WIFI_MAC_CTL_ACK:
163  break;
164  case WIFI_MAC_CTL_END:
167  break;
171  break;
174  m_ctrlSubtype = 0;
175  break;
178  m_ctrlSubtype = 1;
179  break;
182  m_ctrlSubtype = 2;
183  break;
186  m_ctrlSubtype = 3;
187  break;
190  m_ctrlSubtype = 4;
191  break;
194  m_ctrlSubtype = 5;
195  break;
196  case WIFI_MAC_MGT_BEACON:
198  m_ctrlSubtype = 8;
199  break;
202  m_ctrlSubtype = 10;
203  break;
206  m_ctrlSubtype = 11;
207  break;
210  m_ctrlSubtype = 12;
211  break;
212  case WIFI_MAC_MGT_ACTION:
214  m_ctrlSubtype = 13;
215  break;
218  m_ctrlSubtype = 14;
219  break;
222  m_ctrlSubtype = 15;
223  break;
224  case WIFI_MAC_DATA:
226  m_ctrlSubtype = 0;
227  break;
228  case WIFI_MAC_DATA_CFACK:
230  m_ctrlSubtype = 1;
231  break;
234  m_ctrlSubtype = 2;
235  break;
238  m_ctrlSubtype = 3;
239  break;
240  case WIFI_MAC_DATA_NULL:
242  m_ctrlSubtype = 4;
243  break;
246  m_ctrlSubtype = 5;
247  break;
250  m_ctrlSubtype = 6;
251  break;
254  m_ctrlSubtype = 7;
255  break;
256  case WIFI_MAC_QOSDATA:
258  m_ctrlSubtype = 8;
259  break;
262  m_ctrlSubtype = 9;
263  break;
266  m_ctrlSubtype = 10;
267  break;
270  m_ctrlSubtype = 11;
271  break;
274  m_ctrlSubtype = 12;
275  break;
278  m_ctrlSubtype = 14;
279  break;
282  m_ctrlSubtype = 15;
283  break;
284  }
285  if (resetToDsFromDs)
286  {
287  m_ctrlToDs = 0;
288  m_ctrlFromDs = 0;
289  }
290 }
291 
292 void
293 WifiMacHeader::SetRawDuration (uint16_t duration)
294 {
295  NS_ASSERT (duration <= 32768);
296  m_duration = duration;
297 }
298 
299 void
301 {
302  int64_t duration_us = static_cast<int64_t> (ceil (static_cast<double> (duration.GetNanoSeconds ()) / 1000));
303  NS_ASSERT (duration_us >= 0 && duration_us <= 0x7fff);
304  m_duration = static_cast<uint16_t> (duration_us);
305 }
306 
307 void WifiMacHeader::SetId (uint16_t id)
308 {
309  m_duration = id;
310 }
311 
313 {
314  m_seqSeq = seq;
315 }
316 
318 {
319  m_seqFrag = frag;
320 }
321 
323 {
324  m_ctrlMoreFrag = 0;
325 }
326 
328 {
329  m_ctrlMoreFrag = 1;
330 }
331 
333 {
334  m_ctrlOrder = 1;
335 }
336 
338 {
339  m_ctrlOrder = 0;
340 }
341 
343 {
344  m_ctrlRetry = 1;
345 }
346 
348 {
349  m_ctrlRetry = 0;
350 }
351 
352 void WifiMacHeader::SetQosTid (uint8_t tid)
353 {
354  m_qosTid = tid;
355 }
356 
358 {
359  m_qosEosp = 1;
360 }
361 
363 {
364  m_qosEosp = 0;
365 }
366 
368 {
369  switch (policy)
370  {
371  case NORMAL_ACK:
372  m_qosAckPolicy = 0;
373  break;
374  case NO_ACK:
375  m_qosAckPolicy = 1;
376  break;
377  case NO_EXPLICIT_ACK:
378  m_qosAckPolicy = 2;
379  break;
380  case BLOCK_ACK:
381  m_qosAckPolicy = 3;
382  break;
383  }
384 }
385 
387 {
388  m_amsduPresent = 1;
389 }
390 
392 {
393  m_amsduPresent = 0;
394 }
395 
397 {
398  m_qosStuff = txop;
399 }
400 
401 void
403 {
404  m_qosEosp = 1;
405  m_qosStuff = size;
406 }
407 
409 {
410  //Mark bit 0 of this variable instead of bit 8, since m_qosStuff is
411  //shifted by one byte when serialized
412  m_qosStuff = m_qosStuff | 0x01; //bit 8 of QoS Control Field
413 }
414 
416 {
417  //Clear bit 0 of this variable instead of bit 8, since m_qosStuff is
418  //shifted by one byte when serialized
419  m_qosStuff = m_qosStuff & 0xfe; //bit 8 of QoS Control Field
420 }
421 
422 
425 {
426  return m_addr1;
427 }
428 
431 {
432  return m_addr2;
433 }
434 
437 {
438  return m_addr3;
439 }
440 
443 {
444  return m_addr4;
445 }
446 
449 {
450  switch (m_ctrlType)
451  {
452  case TYPE_MGT:
453  switch (m_ctrlSubtype)
454  {
455  case 0:
457  case 1:
459  case 2:
461  case 3:
463  case 4:
465  case 5:
467  case 8:
468  return WIFI_MAC_MGT_BEACON;
469  case 10:
471  case 11:
473  case 12:
475  case 13:
476  return WIFI_MAC_MGT_ACTION;
477  case 14:
479  case 15:
481  }
482  break;
483  case TYPE_CTL:
484  switch (m_ctrlSubtype)
485  {
486  case SUBTYPE_CTL_TRIGGER:
487  return WIFI_MAC_CTL_TRIGGER;
488  case SUBTYPE_CTL_BACKREQ:
489  return WIFI_MAC_CTL_BACKREQ;
491  return WIFI_MAC_CTL_BACKRESP;
492  case SUBTYPE_CTL_RTS:
493  return WIFI_MAC_CTL_RTS;
494  case SUBTYPE_CTL_CTS:
495  return WIFI_MAC_CTL_CTS;
496  case SUBTYPE_CTL_ACK:
497  return WIFI_MAC_CTL_ACK;
498  case SUBTYPE_CTL_END:
499  return WIFI_MAC_CTL_END;
500  case SUBTYPE_CTL_END_ACK:
501  return WIFI_MAC_CTL_END_ACK;
502  }
503  break;
504  case TYPE_DATA:
505  switch (m_ctrlSubtype)
506  {
507  case 0:
508  return WIFI_MAC_DATA;
509  case 1:
510  return WIFI_MAC_DATA_CFACK;
511  case 2:
512  return WIFI_MAC_DATA_CFPOLL;
513  case 3:
515  case 4:
516  return WIFI_MAC_DATA_NULL;
517  case 5:
519  case 6:
521  case 7:
523  case 8:
524  return WIFI_MAC_QOSDATA;
525  case 9:
526  return WIFI_MAC_QOSDATA_CFACK;
527  case 10:
529  case 11:
531  case 12:
532  return WIFI_MAC_QOSDATA_NULL;
533  case 14:
535  case 15:
537  }
538  break;
539  }
540  // NOTREACHED
541  NS_ASSERT (false);
542  return (WifiMacType) - 1;
543 }
544 
545 bool
547 {
548  return m_ctrlFromDs == 1;
549 }
550 
551 bool
553 {
554  return m_ctrlToDs == 1;
555 }
556 
557 bool
559 {
560  return (m_ctrlType == TYPE_DATA);
561 
562 }
563 
564 bool
566 {
567  return (m_ctrlType == TYPE_DATA && (m_ctrlSubtype & 0x08));
568 }
569 
570 bool
572 {
573  return (m_ctrlType == TYPE_CTL);
574 }
575 
576 bool
578 {
579  return (m_ctrlType == TYPE_MGT);
580 }
581 
582 bool
584 {
585  switch (GetType ())
586  {
595  return true;
596  default:
597  return false;
598  }
599 }
600 
601 bool
603 {
604  switch (GetType ())
605  {
606  case WIFI_MAC_CTL_END:
608  return true;
609  default:
610  return false;
611  }
612 }
613 
614 bool
616 {
617  switch (GetType ())
618  {
619  case WIFI_MAC_DATA_CFACK:
624  return true;
625  default:
626  return false;
627  break;
628  }
629 }
630 
631 bool
633 {
634  switch (GetType ())
635  {
636  case WIFI_MAC_DATA:
637  case WIFI_MAC_DATA_CFACK:
640  case WIFI_MAC_QOSDATA:
644  return true;
645  default:
646  return false;
647  }
648 }
649 
650 bool
652 {
653  return (GetType () == WIFI_MAC_CTL_RTS);
654 }
655 
656 bool
658 {
659  return (GetType () == WIFI_MAC_CTL_CTS);
660 }
661 
662 bool
664 {
665  return (GetType () == WIFI_MAC_CTL_ACK);
666 }
667 
668 bool
670 {
672 }
673 
674 bool
676 {
678 }
679 
680 bool
682 {
684 }
685 
686 bool
688 {
690 }
691 
692 bool
694 {
695  return (GetType () == WIFI_MAC_MGT_PROBE_REQUEST);
696 }
697 
698 bool
700 {
701  return (GetType () == WIFI_MAC_MGT_PROBE_RESPONSE);
702 }
703 
704 bool
706 {
707  return (GetType () == WIFI_MAC_MGT_BEACON);
708 }
709 
710 bool
712 {
713  return (GetType () == WIFI_MAC_MGT_DISASSOCIATION);
714 }
715 
716 bool
718 {
719  return (GetType () == WIFI_MAC_MGT_AUTHENTICATION);
720 }
721 
722 bool
724 {
725  return (GetType () == WIFI_MAC_MGT_DEAUTHENTICATION);
726 }
727 
728 bool
730 {
731  return (GetType () == WIFI_MAC_MGT_ACTION);
732 }
733 
734 bool
736 {
737  return (GetType () == WIFI_MAC_MGT_MULTIHOP_ACTION);
738 }
739 
740 bool
742 {
743  return (GetType () == WIFI_MAC_CTL_BACKREQ) ? true : false;
744 }
745 
746 bool
748 {
749  return (GetType () == WIFI_MAC_CTL_BACKRESP) ? true : false;
750 }
751 
752 bool
754 {
755  return (GetType () == WIFI_MAC_CTL_TRIGGER) ? true : false;
756 }
757 
758 uint16_t
760 {
761  return m_duration;
762 }
763 
764 Time
766 {
767  return MicroSeconds (m_duration);
768 }
769 
770 uint16_t
772 {
773  return (m_seqSeq << 4) | m_seqFrag;
774 }
775 
776 uint16_t
778 {
779  return m_seqSeq;
780 }
781 
782 uint8_t
784 {
785  return m_seqFrag;
786 }
787 
788 bool
790 {
791  return (m_ctrlRetry == 1);
792 }
793 
794 bool
796 {
797  return (m_ctrlMoreFrag == 1);
798 }
799 
800 bool
802 {
803  NS_ASSERT (IsQosData ());
804  return (m_qosAckPolicy == 3);
805 }
806 
807 bool
809 {
810  NS_ASSERT (IsQosData ());
811  return (m_qosAckPolicy == 1);
812 }
813 
814 bool
816 {
817  NS_ASSERT (IsQosData ());
818  return (m_qosAckPolicy == 0);
819 }
820 
821 bool
823 {
824  NS_ASSERT (IsQosData ());
825  return (m_qosEosp == 1);
826 }
827 
830 {
831  NS_ASSERT (IsQosData ());
832  QosAckPolicy policy;
833 
834  switch (m_qosAckPolicy)
835  {
836  case 0:
837  policy = NORMAL_ACK;
838  break;
839  case 1:
840  policy = NO_ACK;
841  break;
842  case 2:
843  policy = NO_EXPLICIT_ACK;
844  break;
845  case 3:
846  policy = BLOCK_ACK;
847  break;
848  default:
849  NS_ABORT_MSG ("Unknown QoS Ack policy");
850  }
851  return policy;
852 }
853 
854 bool
856 {
857  NS_ASSERT (IsQosData ());
858  return (m_amsduPresent == 1);
859 }
860 
861 uint8_t
863 {
864  NS_ASSERT (IsQosData ());
865  return m_qosTid;
866 }
867 
868 uint8_t
870 {
871  NS_ASSERT (m_qosEosp == 1);
872  return m_qosStuff;
873 }
874 
875 uint16_t
877 {
878  uint16_t val = 0;
879  val |= (m_ctrlType << 2) & (0x3 << 2);
880  val |= (m_ctrlSubtype << 4) & (0xf << 4);
881  val |= (m_ctrlToDs << 8) & (0x1 << 8);
882  val |= (m_ctrlFromDs << 9) & (0x1 << 9);
883  val |= (m_ctrlMoreFrag << 10) & (0x1 << 10);
884  val |= (m_ctrlRetry << 11) & (0x1 << 11);
885  val |= (m_ctrlMoreData << 13) & (0x1 << 13);
886  val |= (m_ctrlWep << 14) & (0x1 << 14);
887  val |= (m_ctrlOrder << 15) & (0x1 << 15);
888  return val;
889 }
890 
891 uint16_t
893 {
894  uint16_t val = 0;
895  val |= m_qosTid;
896  val |= m_qosEosp << 4;
897  val |= m_qosAckPolicy << 5;
898  val |= m_amsduPresent << 7;
899  val |= m_qosStuff << 8;
900  return val;
901 }
902 
903 void
905 {
906  m_ctrlType = (ctrl >> 2) & 0x03;
907  m_ctrlSubtype = (ctrl >> 4) & 0x0f;
908  m_ctrlToDs = (ctrl >> 8) & 0x01;
909  m_ctrlFromDs = (ctrl >> 9) & 0x01;
910  m_ctrlMoreFrag = (ctrl >> 10) & 0x01;
911  m_ctrlRetry = (ctrl >> 11) & 0x01;
912  m_ctrlMoreData = (ctrl >> 13) & 0x01;
913  m_ctrlWep = (ctrl >> 14) & 0x01;
914  m_ctrlOrder = (ctrl >> 15) & 0x01;
915 }
916 void
918 {
919  m_seqFrag = seq & 0x0f;
920  m_seqSeq = (seq >> 4) & 0x0fff;
921 }
922 void
924 {
925  m_qosTid = qos & 0x000f;
926  m_qosEosp = (qos >> 4) & 0x0001;
927  m_qosAckPolicy = (qos >> 5) & 0x0003;
928  m_amsduPresent = (qos >> 7) & 0x0001;
929  m_qosStuff = (qos >> 8) & 0x00ff;
930 }
931 
932 uint32_t
934 {
935  uint32_t size = 0;
936  switch (m_ctrlType)
937  {
938  case TYPE_MGT:
939  size = 2 + 2 + 6 + 6 + 6 + 2;
940  break;
941  case TYPE_CTL:
942  switch (m_ctrlSubtype)
943  {
944  case SUBTYPE_CTL_RTS:
945  case SUBTYPE_CTL_BACKREQ:
947  case SUBTYPE_CTL_TRIGGER:
948  case SUBTYPE_CTL_END:
949  case SUBTYPE_CTL_END_ACK:
950  size = 2 + 2 + 6 + 6;
951  break;
952  case SUBTYPE_CTL_CTS:
953  case SUBTYPE_CTL_ACK:
954  size = 2 + 2 + 6;
955  break;
957  size = 2 + 2 + 6 + 2 + 4;
958  break;
959  }
960  break;
961  case TYPE_DATA:
962  size = 2 + 2 + 6 + 6 + 6 + 2;
963  if (m_ctrlToDs && m_ctrlFromDs)
964  {
965  size += 6;
966  }
967  if (m_ctrlSubtype & 0x08)
968  {
969  size += 2;
970  }
971  break;
972  }
973  return size;
974 }
975 
976 const char *
978 {
979 #define FOO(x) \
980 case WIFI_MAC_ ## x: \
981  return # x; \
982  break;
983 
984  switch (GetType ())
985  {
986  FOO (CTL_RTS);
987  FOO (CTL_CTS);
988  FOO (CTL_ACK);
989  FOO (CTL_BACKREQ);
990  FOO (CTL_BACKRESP);
991  FOO (CTL_END);
992  FOO (CTL_END_ACK);
993  FOO (CTL_TRIGGER);
994 
995  FOO (MGT_BEACON);
996  FOO (MGT_ASSOCIATION_REQUEST);
997  FOO (MGT_ASSOCIATION_RESPONSE);
998  FOO (MGT_DISASSOCIATION);
999  FOO (MGT_REASSOCIATION_REQUEST);
1000  FOO (MGT_REASSOCIATION_RESPONSE);
1001  FOO (MGT_PROBE_REQUEST);
1002  FOO (MGT_PROBE_RESPONSE);
1003  FOO (MGT_AUTHENTICATION);
1004  FOO (MGT_DEAUTHENTICATION);
1005  FOO (MGT_ACTION);
1006  FOO (MGT_ACTION_NO_ACK);
1007  FOO (MGT_MULTIHOP_ACTION);
1008 
1009  FOO (DATA);
1010  FOO (DATA_CFACK);
1011  FOO (DATA_CFPOLL);
1012  FOO (DATA_CFACK_CFPOLL);
1013  FOO (DATA_NULL);
1014  FOO (DATA_NULL_CFACK);
1015  FOO (DATA_NULL_CFPOLL);
1016  FOO (DATA_NULL_CFACK_CFPOLL);
1017  FOO (QOSDATA);
1018  FOO (QOSDATA_CFACK);
1019  FOO (QOSDATA_CFPOLL);
1020  FOO (QOSDATA_CFACK_CFPOLL);
1021  FOO (QOSDATA_NULL);
1022  FOO (QOSDATA_NULL_CFPOLL);
1023  FOO (QOSDATA_NULL_CFACK_CFPOLL);
1024  default:
1025  return "ERROR";
1026  }
1027 #undef FOO
1028 #ifndef _WIN32
1029  // needed to make gcc 4.0.1 ppc darwin happy.
1030  return "BIG_ERROR";
1031 #endif
1032 }
1033 
1034 TypeId
1036 {
1037  static TypeId tid = TypeId ("ns3::WifiMacHeader")
1038  .SetParent<Header> ()
1039  .SetGroupName ("Wifi")
1040  .AddConstructor<WifiMacHeader> ()
1041  ;
1042  return tid;
1043 }
1044 
1045 TypeId
1047 {
1048  return GetTypeId ();
1049 }
1050 
1051 void
1052 WifiMacHeader::PrintFrameControl (std::ostream &os) const
1053 {
1054  os << "ToDS=" << std::hex << (int) m_ctrlToDs << ", FromDS=" << std::hex << (int) m_ctrlFromDs
1055  << ", MoreFrag=" << std::hex << (int) m_ctrlMoreFrag << ", Retry=" << std::hex << (int) m_ctrlRetry
1056  << ", MoreData=" << std::hex << (int) m_ctrlMoreData << std::dec
1057  ;
1058 }
1059 
1060 void
1061 WifiMacHeader::Print (std::ostream &os) const
1062 {
1063  os << GetTypeString () << " ";
1064  switch (GetType ())
1065  {
1066  case WIFI_MAC_CTL_RTS:
1067  case WIFI_MAC_CTL_TRIGGER:
1068  os << "Duration/ID=" << m_duration << "us"
1069  << ", RA=" << m_addr1 << ", TA=" << m_addr2;
1070  break;
1071  case WIFI_MAC_CTL_CTS:
1072  case WIFI_MAC_CTL_ACK:
1073  os << "Duration/ID=" << m_duration << "us"
1074  << ", RA=" << m_addr1;
1075  break;
1076  case WIFI_MAC_MGT_BEACON:
1086  PrintFrameControl (os);
1087  os << " Duration/ID=" << m_duration << "us"
1088  << ", DA=" << m_addr1 << ", SA=" << m_addr2
1089  << ", BSSID=" << m_addr3 << ", FragNumber=" << std::hex << (int) m_seqFrag << std::dec
1090  << ", SeqNumber=" << m_seqSeq;
1091  break;
1092  case WIFI_MAC_MGT_ACTION:
1094  PrintFrameControl (os);
1095  os << " Duration/ID=" << m_duration << "us"
1096  << ", DA=" << m_addr1 << ", SA=" << m_addr2 << ", BSSID=" << m_addr3
1097  << ", FragNumber=" << std::hex << (int) m_seqFrag << std::dec << ", SeqNumber=" << m_seqSeq;
1098  break;
1100  os << " Duration/ID=" << m_duration << "us"
1101  << ", RA=" << m_addr1 << ", TA=" << m_addr2 << ", DA=" << m_addr3
1102  << ", FragNumber=" << std::hex << (int) m_seqFrag << std::dec << ", SeqNumber=" << m_seqSeq;
1103  break;
1104  case WIFI_MAC_DATA:
1105  PrintFrameControl (os);
1106  os << " Duration/ID=" << m_duration << "us";
1107  if (!m_ctrlToDs && !m_ctrlFromDs)
1108  {
1109  os << ", DA=" << m_addr1 << ", SA=" << m_addr2 << ", BSSID=" << m_addr3;
1110  }
1111  else if (!m_ctrlToDs && m_ctrlFromDs)
1112  {
1113  os << ", DA=" << m_addr1 << ", SA=" << m_addr3 << ", BSSID=" << m_addr2;
1114  }
1115  else if (m_ctrlToDs && !m_ctrlFromDs)
1116  {
1117  os << ", DA=" << m_addr3 << ", SA=" << m_addr2 << ", BSSID=" << m_addr1;
1118  }
1119  else if (m_ctrlToDs && m_ctrlFromDs)
1120  {
1121  os << ", DA=" << m_addr3 << ", SA=" << m_addr4 << ", RA=" << m_addr1 << ", TA=" << m_addr2;
1122  }
1123  else
1124  {
1125  NS_FATAL_ERROR ("Impossible ToDs and FromDs flags combination");
1126  }
1127  os << ", FragNumber=" << std::hex << (int) m_seqFrag << std::dec
1128  << ", SeqNumber=" << m_seqSeq;
1129  break;
1130  case WIFI_MAC_CTL_BACKREQ:
1131  case WIFI_MAC_CTL_BACKRESP:
1133  case WIFI_MAC_CTL_END:
1134  case WIFI_MAC_CTL_END_ACK:
1135  case WIFI_MAC_DATA_CFACK:
1136  case WIFI_MAC_DATA_CFPOLL:
1138  case WIFI_MAC_DATA_NULL:
1142  case WIFI_MAC_QOSDATA:
1146  case WIFI_MAC_QOSDATA_NULL:
1149  default:
1150  break;
1151  }
1152 }
1153 
1154 uint32_t
1156 {
1157  return GetSize ();
1158 }
1159 
1160 void
1162 {
1165  WriteTo (i, m_addr1);
1166  switch (m_ctrlType)
1167  {
1168  case TYPE_MGT:
1169  WriteTo (i, m_addr2);
1170  WriteTo (i, m_addr3);
1172  break;
1173  case TYPE_CTL:
1174  switch (m_ctrlSubtype)
1175  {
1176  case SUBTYPE_CTL_RTS:
1177  case SUBTYPE_CTL_TRIGGER:
1178  case SUBTYPE_CTL_BACKREQ:
1179  case SUBTYPE_CTL_BACKRESP:
1180  case SUBTYPE_CTL_END:
1181  case SUBTYPE_CTL_END_ACK:
1182  WriteTo (i, m_addr2);
1183  break;
1184  case SUBTYPE_CTL_CTS:
1185  case SUBTYPE_CTL_ACK:
1186  break;
1187  default:
1188  //NOTREACHED
1189  NS_ASSERT (false);
1190  break;
1191  }
1192  break;
1193  case TYPE_DATA:
1194  {
1195  WriteTo (i, m_addr2);
1196  WriteTo (i, m_addr3);
1198  if (m_ctrlToDs && m_ctrlFromDs)
1199  {
1200  WriteTo (i, m_addr4);
1201  }
1202  if (m_ctrlSubtype & 0x08)
1203  {
1205  }
1206  } break;
1207  default:
1208  //NOTREACHED
1209  NS_ASSERT (false);
1210  break;
1211  }
1212 }
1213 
1214 uint32_t
1216 {
1217  Buffer::Iterator i = start;
1218  uint16_t frame_control = i.ReadLsbtohU16 ();
1219  SetFrameControl (frame_control);
1220  m_duration = i.ReadLsbtohU16 ();
1221  ReadFrom (i, m_addr1);
1222  switch (m_ctrlType)
1223  {
1224  case TYPE_MGT:
1225  ReadFrom (i, m_addr2);
1226  ReadFrom (i, m_addr3);
1228  break;
1229  case TYPE_CTL:
1230  switch (m_ctrlSubtype)
1231  {
1232  case SUBTYPE_CTL_RTS:
1233  case SUBTYPE_CTL_TRIGGER:
1234  case SUBTYPE_CTL_BACKREQ:
1235  case SUBTYPE_CTL_BACKRESP:
1236  case SUBTYPE_CTL_END:
1237  case SUBTYPE_CTL_END_ACK:
1238  ReadFrom (i, m_addr2);
1239  break;
1240  case SUBTYPE_CTL_CTS:
1241  case SUBTYPE_CTL_ACK:
1242  break;
1243  }
1244  break;
1245  case TYPE_DATA:
1246  ReadFrom (i, m_addr2);
1247  ReadFrom (i, m_addr3);
1249  if (m_ctrlToDs && m_ctrlFromDs)
1250  {
1251  ReadFrom (i, m_addr4);
1252  }
1253  if (m_ctrlSubtype & 0x08)
1254  {
1256  }
1257  break;
1258  }
1259  return i.GetDistanceFrom (start);
1260 }
1261 
1262 } //namespace ns3
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::WifiMacHeader::SetQosNoEosp
void SetQosNoEosp()
Un-set the end of service period (EOSP) bit in the QoS control field.
Definition: wifi-mac-header.cc:362
ns3::WIFI_MAC_QOSDATA_NULL
@ WIFI_MAC_QOSDATA_NULL
Definition: wifi-mac-header.h:74
ns3::WifiMacHeader::m_ctrlMoreData
uint8_t m_ctrlMoreData
control more data
Definition: wifi-mac-header.h:639
ns3::WifiMacHeader::IsRts
bool IsRts(void) const
Return true if the header is a RTS header.
Definition: wifi-mac-header.cc:651
ns3::TYPE_MGT
@ TYPE_MGT
Definition: wifi-mac-header.cc:34
ns3::WifiMacHeader::~WifiMacHeader
virtual ~WifiMacHeader()
Definition: wifi-mac-header.cc:79
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT
#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
ns3::WifiMacHeader::SetNoMoreFragments
void SetNoMoreFragments(void)
Un-set the More Fragment bit in the Frame Control Field.
Definition: wifi-mac-header.cc:322
FOO
#define FOO(x)
ns3::WifiMacHeader::SetDuration
void SetDuration(Time duration)
Set the Duration/ID field with the given duration (Time object).
Definition: wifi-mac-header.cc:300
ns3::WifiMacHeader::SetMoreFragments
void SetMoreFragments(void)
Set the More Fragment bit in the Frame Control field.
Definition: wifi-mac-header.cc:327
ns3::WifiMacHeader::IsAck
bool IsAck(void) const
Return true if the header is an Ack header.
Definition: wifi-mac-header.cc:663
ns3::WifiMacHeader::IsToDs
bool IsToDs(void) const
Definition: wifi-mac-header.cc:552
ns3::Buffer::Iterator::WriteHtolsbU16
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:911
ns3::WifiMacHeader::GetSize
uint32_t GetSize(void) const
Return the size of the WifiMacHeader in octets.
Definition: wifi-mac-header.cc:933
ns3::WifiMacHeader::IsMultihopAction
bool IsMultihopAction(void) const
Check if the header is a Multihop action header.
Definition: wifi-mac-header.cc:735
ns3::WifiMacHeader::m_ctrlType
uint8_t m_ctrlType
control type
Definition: wifi-mac-header.h:633
ns3::WifiMacHeader::IsQosEosp
bool IsQosEosp(void) const
Return if the end of service period (EOSP) is set.
Definition: wifi-mac-header.cc:822
ns3::WifiMacHeader::GetQosQueueSize
uint8_t GetQosQueueSize(void) const
Get the Queue Size subfield in the QoS control field.
Definition: wifi-mac-header.cc:869
ns3::WifiMacHeader::IsBeacon
bool IsBeacon(void) const
Return true if the header is a Beacon header.
Definition: wifi-mac-header.cc:705
ns3::WifiMacHeader::IsData
bool IsData(void) const
Return true if the Type is DATA.
Definition: wifi-mac-header.cc:558
ns3::WifiMacHeader::m_addr4
Mac48Address m_addr4
address 4
Definition: wifi-mac-header.h:648
ns3::WifiMacHeader::SetFragmentNumber
void SetFragmentNumber(uint8_t frag)
Set the fragment number of the header.
Definition: wifi-mac-header.cc:317
ns3::WifiMacHeader::IsRetry
bool IsRetry(void) const
Return if the Retry bit is set.
Definition: wifi-mac-header.cc:789
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiMacHeader::GetSerializedSize
uint32_t GetSerializedSize(void) const override
Definition: wifi-mac-header.cc:1155
ns3::WifiMacHeader::SetRetry
void SetRetry(void)
Set the Retry bit in the Frame Control field.
Definition: wifi-mac-header.cc:342
ns3::WifiMacHeader::GetFrameControl
uint16_t GetFrameControl(void) const
Return the raw Frame Control field.
Definition: wifi-mac-header.cc:876
ns3::WifiMacHeader::SetDsTo
void SetDsTo(void)
Set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:96
ns3::Buffer::Iterator::GetDistanceFrom
uint32_t GetDistanceFrom(Iterator const &o) const
Definition: buffer.cc:788
ns3::WifiMacHeader::IsDisassociation
bool IsDisassociation(void) const
Return true if the header is a Disassociation header.
Definition: wifi-mac-header.cc:711
ns3::WifiMacHeader::SetSequenceNumber
void SetSequenceNumber(uint16_t seq)
Set the sequence number of the header.
Definition: wifi-mac-header.cc:312
ns3::WifiMacHeader::IsProbeResp
bool IsProbeResp(void) const
Return true if the header is a Probe Response header.
Definition: wifi-mac-header.cc:699
ns3::WIFI_MAC_DATA_CFACK_CFPOLL
@ WIFI_MAC_DATA_CFACK_CFPOLL
Definition: wifi-mac-header.h:65
ns3::WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
Definition: wifi-mac-header.h:49
ns3::WifiMacHeader::SetSequenceControl
void SetSequenceControl(uint16_t seq)
Set the Sequence Control field with the given raw value.
Definition: wifi-mac-header.cc:917
ns3::WifiMacHeader::BLOCK_ACK
@ BLOCK_ACK
Definition: wifi-mac-header.h:95
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ns3::WifiMacHeader::PrintFrameControl
void PrintFrameControl(std::ostream &os) const
Print the Frame Control field to the output stream.
Definition: wifi-mac-header.cc:1052
ns3::WifiMacHeader::IsTrigger
bool IsTrigger(void) const
Return true if the header is a Trigger header.
Definition: wifi-mac-header.cc:753
ns3::WIFI_MAC_MGT_REASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_REASSOCIATION_RESPONSE
Definition: wifi-mac-header.h:53
ns3::WIFI_MAC_CTL_END
@ WIFI_MAC_CTL_END
Definition: wifi-mac-header.h:45
ns3::WifiMacHeader::SetFrameControl
void SetFrameControl(uint16_t control)
Set the Frame Control field with the given raw value.
Definition: wifi-mac-header.cc:904
ns3::WifiMacHeader::IsQosNoAck
bool IsQosNoAck(void) const
Return if the QoS Ack policy is No Ack.
Definition: wifi-mac-header.cc:808
ns3::WifiMacHeader::m_qosTid
uint8_t m_qosTid
QoS TID.
Definition: wifi-mac-header.h:649
ns3::WifiMacHeader::SetDsNotFrom
void SetDsNotFrom(void)
Un-set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:90
ns3::WifiMacHeader::NO_ACK
@ NO_ACK
Definition: wifi-mac-header.h:93
ns3::WifiMacHeader::WifiMacHeader
WifiMacHeader()
Definition: wifi-mac-header.cc:58
ns3::WifiMacHeader::m_seqSeq
uint16_t m_seqSeq
sequence sequence
Definition: wifi-mac-header.h:647
ns3::WIFI_MAC_MGT_REASSOCIATION_REQUEST
@ WIFI_MAC_MGT_REASSOCIATION_REQUEST
Definition: wifi-mac-header.h:52
ns3::WIFI_MAC_CTL_END_ACK
@ WIFI_MAC_CTL_END_ACK
Definition: wifi-mac-header.h:46
ns3::WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
Definition: wifi-mac-header.h:50
ns3::WifiMacHeader::SetOrder
void SetOrder(void)
Set order bit in the frame control field.
Definition: wifi-mac-header.cc:332
ns3::WifiMacHeader::IsCfEnd
bool IsCfEnd(void) const
Return true if the header is a CF-End header.
Definition: wifi-mac-header.cc:602
ns3::WifiMacHeader::IsQosBlockAck
bool IsQosBlockAck(void) const
Return if the QoS Ack policy is Block Ack.
Definition: wifi-mac-header.cc:801
ns3::WifiMacHeader::IsCts
bool IsCts(void) const
Return true if the header is a CTS header.
Definition: wifi-mac-header.cc:657
ns3::Mac48Address
an EUI-48 address
Definition: mac48-address.h:44
ns3::WifiMacHeader::GetAddr3
Mac48Address GetAddr3(void) const
Return the address in the Address 3 field.
Definition: wifi-mac-header.cc:436
ns3::WifiMacHeader::SetQosAmsdu
void SetQosAmsdu(void)
Set that A-MSDU is present.
Definition: wifi-mac-header.cc:386
ns3::WifiMacHeader::SetNoRetry
void SetNoRetry(void)
Un-set the Retry bit in the Frame Control field.
Definition: wifi-mac-header.cc:347
ns3::WIFI_MAC_MGT_AUTHENTICATION
@ WIFI_MAC_MGT_AUTHENTICATION
Definition: wifi-mac-header.h:56
ns3::WifiMacHeader::m_addr3
Mac48Address m_addr3
address 3
Definition: wifi-mac-header.h:645
ns3::WifiMacHeader::m_qosAckPolicy
uint8_t m_qosAckPolicy
QoS Ack policy.
Definition: wifi-mac-header.h:651
ns3::WifiMacHeader::m_amsduPresent
uint8_t m_amsduPresent
A-MSDU present.
Definition: wifi-mac-header.h:652
ns3::WifiMacHeader::GetAddr1
Mac48Address GetAddr1(void) const
Return the address in the Address 1 field.
Definition: wifi-mac-header.cc:424
ns3::WifiMacHeader::SetQosQueueSize
void SetQosQueueSize(uint8_t size)
Set the Queue Size subfield in the QoS control field.
Definition: wifi-mac-header.cc:402
ns3::WIFI_MAC_CTL_CTS
@ WIFI_MAC_CTL_CTS
Definition: wifi-mac-header.h:41
ns3::SUBTYPE_CTL_BACKRESP
@ SUBTYPE_CTL_BACKRESP
Definition: wifi-mac-header.cc:50
ns3::WifiMacHeader::SetAddr3
void SetAddr3(Mac48Address address)
Fill the Address 3 field with the given address.
Definition: wifi-mac-header.cc:120
ns3::WifiMacHeader::m_ctrlMoreFrag
uint8_t m_ctrlMoreFrag
control more fragments
Definition: wifi-mac-header.h:637
ns3::WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL
@ WIFI_MAC_QOSDATA_NULL_CFACK_CFPOLL
Definition: wifi-mac-header.h:76
ns3::WifiMacHeader::GetSequenceControl
uint16_t GetSequenceControl(void) const
Return the raw Sequence Control field.
Definition: wifi-mac-header.cc:771
ns3::WIFI_MAC_MGT_MULTIHOP_ACTION
@ WIFI_MAC_MGT_MULTIHOP_ACTION
Definition: wifi-mac-header.h:60
ns3::TYPE_DATA
@ TYPE_DATA
Definition: wifi-mac-header.cc:36
ns3::WifiMacHeader::m_ctrlFromDs
uint8_t m_ctrlFromDs
control from DS
Definition: wifi-mac-header.h:636
ns3::WifiMacHeader::m_ctrlToDs
uint8_t m_ctrlToDs
control to DS
Definition: wifi-mac-header.h:635
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:923
wifi-mac-header.h
ns3::SUBTYPE_CTL_NDPANNOUNCE
@ SUBTYPE_CTL_NDPANNOUNCE
Definition: wifi-mac-header.cc:46
ns3::WifiMacHeader::SetAddr1
void SetAddr1(Mac48Address address)
Fill the Address 1 field with the given address.
Definition: wifi-mac-header.cc:108
ns3::WifiMacHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition: wifi-mac-header.cc:1161
ns3::WifiMacHeader::GetTypeString
const char * GetTypeString(void) const
Return a string corresponds to the header type.
Definition: wifi-mac-header.cc:977
ns3::WifiMacHeader::m_seqFrag
uint8_t m_seqFrag
sequence fragment
Definition: wifi-mac-header.h:646
ns3::DATA
@ DATA
Definition: ul-job.h:39
ns3::WifiMacHeader
Implements the IEEE 802.11 MAC header.
Definition: wifi-mac-header.h:85
ns3::WIFI_MAC_QOSDATA_CFPOLL
@ WIFI_MAC_QOSDATA_CFPOLL
Definition: wifi-mac-header.h:72
ns3::SUBTYPE_CTL_BACKREQ
@ SUBTYPE_CTL_BACKREQ
Definition: wifi-mac-header.cc:49
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
visualizer.core.start
def start()
Definition: core.py:1855
ns3::WifiMacHeader::SetQosAckPolicy
void SetQosAckPolicy(QosAckPolicy policy)
Set the QoS Ack policy in the QoS control field.
Definition: wifi-mac-header.cc:367
ns3::WifiMacHeader::IsBlockAckReq
bool IsBlockAckReq(void) const
Return true if the header is a BlockAckRequest header.
Definition: wifi-mac-header.cc:741
ns3::WifiMacHeader::GetType
WifiMacType GetType(void) const
Return the type (enum WifiMacType)
Definition: wifi-mac-header.cc:448
ns3::WifiMacHeader::GetQosControl
uint16_t GetQosControl(void) const
Return the raw QoS Control field.
Definition: wifi-mac-header.cc:892
ns3::WIFI_MAC_DATA_NULL
@ WIFI_MAC_DATA_NULL
Definition: wifi-mac-header.h:66
ns3::SUBTYPE_CTL_CTLWRAPPER
@ SUBTYPE_CTL_CTLWRAPPER
Definition: wifi-mac-header.cc:48
ns3::WifiMacHeader::IsFromDs
bool IsFromDs(void) const
Definition: wifi-mac-header.cc:546
ns3::WifiMacHeader::IsQosAmsdu
bool IsQosAmsdu(void) const
Check if the A-MSDU present bit is set in the QoS control field.
Definition: wifi-mac-header.cc:855
ns3::WIFI_MAC_QOSDATA_NULL_CFPOLL
@ WIFI_MAC_QOSDATA_NULL_CFPOLL
Definition: wifi-mac-header.h:75
ns3::WifiMacHeader::m_ctrlOrder
uint8_t m_ctrlOrder
control order (set to 1 for QoS Data and Management frames to signify that HT/VHT/HE control field is...
Definition: wifi-mac-header.h:641
ns3::WifiMacHeader::QosAckPolicy
QosAckPolicy
Ack policy for QoS frames.
Definition: wifi-mac-header.h:91
ns3::WifiMacHeader::SetId
void SetId(uint16_t id)
Set the Duration/ID field with the given ID.
Definition: wifi-mac-header.cc:307
ns3::WifiMacHeader::m_duration
uint16_t m_duration
duration
Definition: wifi-mac-header.h:642
ns3::WifiMacHeader::HasData
bool HasData(void) const
Return true if the header type is DATA and is not DATA_NULL.
Definition: wifi-mac-header.cc:632
ns3::WifiMacHeader::IsBlockAck
bool IsBlockAck(void) const
Return true if the header is a BlockAck header.
Definition: wifi-mac-header.cc:747
ns3::WifiMacHeader::NORMAL_ACK
@ NORMAL_ACK
Definition: wifi-mac-header.h:92
ns3::WifiMacHeader::m_ctrlRetry
uint8_t m_ctrlRetry
control retry
Definition: wifi-mac-header.h:638
ns3::SUBTYPE_CTL_CTS
@ SUBTYPE_CTL_CTS
Definition: wifi-mac-header.cc:52
ns3::WIFI_MAC_CTL_TRIGGER
@ WIFI_MAC_CTL_TRIGGER
Definition: wifi-mac-header.h:38
ns3::WifiMacHeader::IsQosData
bool IsQosData(void) const
Return true if the Type is DATA and Subtype is one of the possible values for QoS Data.
Definition: wifi-mac-header.cc:565
ns3::SUBTYPE_CTL_END
@ SUBTYPE_CTL_END
Definition: wifi-mac-header.cc:54
first.address
address
Definition: first.py:44
ns3::WifiMacHeader::SetNoOrder
void SetNoOrder(void)
Unset order bit in the frame control field.
Definition: wifi-mac-header.cc:337
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::WifiMacHeader::GetSequenceNumber
uint16_t GetSequenceNumber(void) const
Return the sequence number of the header.
Definition: wifi-mac-header.cc:777
ns3::Header
Protocol header serialization and deserialization.
Definition: header.h:43
ns3::WifiMacHeader::IsAssocReq
bool IsAssocReq(void) const
Return true if the header is an Association Request header.
Definition: wifi-mac-header.cc:669
ns3::WIFI_MAC_DATA_CFACK
@ WIFI_MAC_DATA_CFACK
Definition: wifi-mac-header.h:63
ns3::Time::GetNanoSeconds
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:392
ns3::WIFI_MAC_MGT_DISASSOCIATION
@ WIFI_MAC_MGT_DISASSOCIATION
Definition: wifi-mac-header.h:51
ns3::WifiMacHeader::SetQosMeshControlPresent
void SetQosMeshControlPresent()
Set the Mesh Control Present flag for the QoS header.
Definition: wifi-mac-header.cc:408
ns3::WifiMacHeader::GetQosAckPolicy
QosAckPolicy GetQosAckPolicy(void) const
Return the QoS Ack policy in the QoS control field.
Definition: wifi-mac-header.cc:829
ns3::WifiMacHeader::GetFragmentNumber
uint8_t GetFragmentNumber(void) const
Return the fragment number of the header.
Definition: wifi-mac-header.cc:783
ns3::WifiMacHeader::SetAddr4
void SetAddr4(Mac48Address address)
Fill the Address 4 field with the given address.
Definition: wifi-mac-header.cc:126
ns3::WIFI_MAC_CTL_ACK
@ WIFI_MAC_CTL_ACK
Definition: wifi-mac-header.h:42
ns3::WifiMacHeader::SetQosControl
void SetQosControl(uint16_t qos)
Set the QoS Control field with the given raw value.
Definition: wifi-mac-header.cc:923
ns3::Buffer::Iterator::ReadLsbtohU16
uint16_t ReadLsbtohU16(void)
Definition: buffer.cc:1066
ns3::SUBTYPE_CTL_TRIGGER
@ SUBTYPE_CTL_TRIGGER
Definition: wifi-mac-header.cc:43
ns3::WifiMacHeader::IsMgt
bool IsMgt(void) const
Return true if the Type is Management.
Definition: wifi-mac-header.cc:577
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::WIFI_MAC_DATA_NULL_CFACK_CFPOLL
@ WIFI_MAC_DATA_NULL_CFACK_CFPOLL
Definition: wifi-mac-header.h:69
ns3::WifiMacHeader::m_addr2
Mac48Address m_addr2
address 2
Definition: wifi-mac-header.h:644
ns3::WIFI_MAC_DATA_NULL_CFPOLL
@ WIFI_MAC_DATA_NULL_CFPOLL
Definition: wifi-mac-header.h:68
ns3::WIFI_MAC_MGT_ACTION
@ WIFI_MAC_MGT_ACTION
Definition: wifi-mac-header.h:58
ns3::WifiMacHeader::IsDeauthentication
bool IsDeauthentication(void) const
Return true if the header is a Deauthentication header.
Definition: wifi-mac-header.cc:723
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition: buffer.h:99
ns3::WifiMacHeader::SetAddr2
void SetAddr2(Mac48Address address)
Fill the Address 2 field with the given address.
Definition: wifi-mac-header.cc:114
ns3::WifiMacHeader::GetQosTid
uint8_t GetQosTid(void) const
Return the Traffic ID of a QoS header.
Definition: wifi-mac-header.cc:862
ns3::SUBTYPE_CTL_BEAMFORMINGRPOLL
@ SUBTYPE_CTL_BEAMFORMINGRPOLL
Definition: wifi-mac-header.cc:45
ns3::WifiMacHeader::m_qosEosp
uint8_t m_qosEosp
QoS EOSP.
Definition: wifi-mac-header.h:650
ns3::WIFI_MAC_CTL_BACKREQ
@ WIFI_MAC_CTL_BACKREQ
Definition: wifi-mac-header.h:43
ns3::WIFI_MAC_CTL_CTLWRAPPER
@ WIFI_MAC_CTL_CTLWRAPPER
Definition: wifi-mac-header.h:39
ns3::SUBTYPE_CTL_ACK
@ SUBTYPE_CTL_ACK
Definition: wifi-mac-header.cc:53
ns3::WifiMacHeader::IsReassocResp
bool IsReassocResp(void) const
Return true if the header is a Reassociation Response header.
Definition: wifi-mac-header.cc:687
ns3::TYPE_CTL
@ TYPE_CTL
Definition: wifi-mac-header.cc:35
ns3::WifiMacHeader::NO_EXPLICIT_ACK
@ NO_EXPLICIT_ACK
Definition: wifi-mac-header.h:94
ns3::WIFI_MAC_MGT_PROBE_REQUEST
@ WIFI_MAC_MGT_PROBE_REQUEST
Definition: wifi-mac-header.h:54
ns3::WifiMacHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: wifi-mac-header.cc:1035
ns3::WifiMacHeader::IsAuthentication
bool IsAuthentication(void) const
Return true if the header is an Authentication header.
Definition: wifi-mac-header.cc:717
ns3::WifiMacType
WifiMacType
Combination of valid MAC header type/subtype.
Definition: wifi-mac-header.h:37
ns3::WifiMacHeader::IsProbeReq
bool IsProbeReq(void) const
Return true if the header is a Probe Request header.
Definition: wifi-mac-header.cc:693
ns3::WIFI_MAC_DATA
@ WIFI_MAC_DATA
Definition: wifi-mac-header.h:62
ns3::WIFI_MAC_QOSDATA
@ WIFI_MAC_QOSDATA
Definition: wifi-mac-header.h:70
ns3::WifiMacHeader::IsCfAck
bool IsCfAck(void) const
Return true if the header is a CF-Ack header.
Definition: wifi-mac-header.cc:615
ns3::WifiMacHeader::SetQosTxopLimit
void SetQosTxopLimit(uint8_t txop)
Set TXOP limit in the QoS control field.
Definition: wifi-mac-header.cc:396
ns3::WriteTo
void WriteTo(Buffer::Iterator &i, Ipv4Address ad)
Write an Ipv4Address to a Buffer.
Definition: address-utils.cc:28
ns3::WifiMacHeader::m_qosStuff
uint8_t m_qosStuff
QoS stuff.
Definition: wifi-mac-header.h:653
ns3::WifiMacHeader::GetRawDuration
uint16_t GetRawDuration(void) const
Return the raw duration from the Duration/ID field.
Definition: wifi-mac-header.cc:759
ns3::SUBTYPE_CTL_CTLFRAMEEXT
@ SUBTYPE_CTL_CTLFRAMEEXT
Definition: wifi-mac-header.cc:47
ns3::WifiMacHeader::IsMoreFragments
bool IsMoreFragments(void) const
Return if the More Fragment bit is set.
Definition: wifi-mac-header.cc:795
ns3::WifiMacHeader::GetDuration
Time GetDuration(void) const
Return the duration from the Duration/ID field (Time object).
Definition: wifi-mac-header.cc:765
ns3::WifiMacHeader::SetQosEosp
void SetQosEosp()
Set the end of service period (EOSP) bit in the QoS control field.
Definition: wifi-mac-header.cc:357
ns3::WifiMacHeader::IsCtl
bool IsCtl(void) const
Return true if the Type is Control.
Definition: wifi-mac-header.cc:571
ns3::WIFI_MAC_MGT_ACTION_NO_ACK
@ WIFI_MAC_MGT_ACTION_NO_ACK
Definition: wifi-mac-header.h:59
ns3::WifiMacHeader::SetType
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
Definition: wifi-mac-header.cc:132
ns3::WIFI_MAC_MGT_PROBE_RESPONSE
@ WIFI_MAC_MGT_PROBE_RESPONSE
Definition: wifi-mac-header.h:55
ns3::WifiMacHeader::SetRawDuration
void SetRawDuration(uint16_t duration)
Set the Duration/ID field with the given raw uint16_t value.
Definition: wifi-mac-header.cc:293
ns3::WifiMacHeader::SetDsNotTo
void SetDsNotTo(void)
Un-set the To DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:102
ns3::WifiMacHeader::Print
void Print(std::ostream &os) const override
Definition: wifi-mac-header.cc:1061
ns3::WifiMacHeader::IsReassocReq
bool IsReassocReq(void) const
Return true if the header is a Reassociation Request header.
Definition: wifi-mac-header.cc:681
ns3::WifiMacHeader::IsCfPoll
bool IsCfPoll(void) const
Return true if the Type/Subtype is one of the possible CF-Poll headers.
Definition: wifi-mac-header.cc:583
ns3::WifiMacHeader::m_ctrlSubtype
uint8_t m_ctrlSubtype
control subtype
Definition: wifi-mac-header.h:634
ns3::WIFI_MAC_CTL_BACKRESP
@ WIFI_MAC_CTL_BACKRESP
Definition: wifi-mac-header.h:44
ns3::WIFI_MAC_QOSDATA_CFACK_CFPOLL
@ WIFI_MAC_QOSDATA_CFACK_CFPOLL
Definition: wifi-mac-header.h:73
ns3::WifiMacHeader::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: wifi-mac-header.cc:1046
ns3::WIFI_MAC_CTL_RTS
@ WIFI_MAC_CTL_RTS
Definition: wifi-mac-header.h:40
ns3::WifiMacHeader::SetQosTid
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
Definition: wifi-mac-header.cc:352
ns3::WifiMacHeader::GetAddr2
Mac48Address GetAddr2(void) const
Return the address in the Address 2 field.
Definition: wifi-mac-header.cc:430
ns3::WifiMacHeader::SetQosNoMeshControlPresent
void SetQosNoMeshControlPresent()
Clear the Mesh Control Present flag for the QoS header.
Definition: wifi-mac-header.cc:415
ns3::WIFI_MAC_MGT_BEACON
@ WIFI_MAC_MGT_BEACON
Definition: wifi-mac-header.h:48
ns3::WifiMacHeader::GetAddr4
Mac48Address GetAddr4(void) const
Return the address in the Address 4 field.
Definition: wifi-mac-header.cc:442
ns3::SUBTYPE_CTL_END_ACK
@ SUBTYPE_CTL_END_ACK
Definition: wifi-mac-header.cc:55
ns3::WIFI_MAC_DATA_NULL_CFACK
@ WIFI_MAC_DATA_NULL_CFACK
Definition: wifi-mac-header.h:67
ns3::SUBTYPE_CTL_RTS
@ SUBTYPE_CTL_RTS
Definition: wifi-mac-header.cc:51
ns3::WifiMacHeader::SetDsFrom
void SetDsFrom(void)
Set the From DS bit in the Frame Control field.
Definition: wifi-mac-header.cc:84
ns3::WIFI_MAC_DATA_CFPOLL
@ WIFI_MAC_DATA_CFPOLL
Definition: wifi-mac-header.h:64
ns3::WifiMacHeader::IsAction
bool IsAction(void) const
Return true if the header is an Action header.
Definition: wifi-mac-header.cc:729
ns3::WifiMacHeader::m_addr1
Mac48Address m_addr1
address 1
Definition: wifi-mac-header.h:643
ns3::WIFI_MAC_QOSDATA_CFACK
@ WIFI_MAC_QOSDATA_CFACK
Definition: wifi-mac-header.h:71
ns3::WifiMacHeader::SetQosNoAmsdu
void SetQosNoAmsdu(void)
Set that A-MSDU is not present.
Definition: wifi-mac-header.cc:391
ns3::WIFI_MAC_MGT_DEAUTHENTICATION
@ WIFI_MAC_MGT_DEAUTHENTICATION
Definition: wifi-mac-header.h:57
ns3::WifiMacHeader::IsAssocResp
bool IsAssocResp(void) const
Return true if the header is an Association Response header.
Definition: wifi-mac-header.cc:675
ns3::WifiMacHeader::IsQosAck
bool IsQosAck(void) const
Return if the QoS Ack policy is Normal Ack.
Definition: wifi-mac-header.cc:815
ns3::ReadFrom
void ReadFrom(Buffer::Iterator &i, Ipv4Address &ad)
Read an Ipv4Address from a Buffer.
Definition: address-utils.cc:70
NS_ABORT_MSG
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
ns3::WifiMacHeader::m_ctrlWep
uint8_t m_ctrlWep
control WEP
Definition: wifi-mac-header.h:640