A Discrete-Event Network Simulator
API
mgt-headers.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006 INRIA
4  * Copyright (c) 2009 MIRKO BANCHI
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
20  * Author: Mirko Banchi <mk.banchi@gmail.com>
21  */
22 #include "mgt-headers.h"
23 #include "ns3/simulator.h"
24 #include "ns3/assert.h"
25 
26 namespace ns3 {
27 
28 /***********************************************************
29  * Probe Request
30  ***********************************************************/
31 
32 NS_OBJECT_ENSURE_REGISTERED (MgtProbeRequestHeader);
33 
35 {
36 }
37 
38 void
40 {
41  m_ssid = ssid;
42 }
43 Ssid
45 {
46  return m_ssid;
47 }
48 void
50 {
51  m_rates = rates;
52 }
53 void
55 {
56  m_htCapability=htcapabilities;
57 }
58 
61 {
62  return m_htCapability;
63 }
66 {
67  return m_rates;
68 }
69 uint32_t
71 {
72  uint32_t size = 0;
73  size += m_ssid.GetSerializedSize ();
74  size += m_rates.GetSerializedSize ();
77  return size;
78 }
79 TypeId
81 {
82  static TypeId tid = TypeId ("ns3::MgtProbeRequestHeader")
83  .SetParent<Header> ()
84  .SetGroupName ("Wifi")
85  .AddConstructor<MgtProbeRequestHeader> ()
86  ;
87  return tid;
88 }
89 TypeId
91 {
92  return GetTypeId ();
93 }
94 void
95 MgtProbeRequestHeader::Print (std::ostream &os) const
96 {
97  os << "ssid=" << m_ssid << ", "
98  << "rates=" << m_rates << ", "
99  << "HT Capabilities=" << m_htCapability;
100 }
101 void
103 {
105  i = m_ssid.Serialize (i);
106  i = m_rates.Serialize (i);
107  i = m_rates.extended.Serialize (i);
108  i = m_htCapability.Serialize(i);
109 }
110 uint32_t
112 {
114  i = m_ssid.Deserialize (i);
115  i = m_rates.Deserialize (i);
118  return i.GetDistanceFrom (start);
119 }
120 
121 
122 /***********************************************************
123  * Probe Response
124  ***********************************************************/
125 
127 
129 {
130 }
132 {
133 }
134 uint64_t
136 {
137  return m_timestamp;
138 }
139 Ssid
141 {
142  return m_ssid;
143 }
144 uint64_t
146 {
147  return m_beaconInterval;
148 }
151 {
152  return m_rates;
153 }
154 void
156 {
157  m_htCapability=htcapabilities;
158 }
159 
162 {
163  return m_htCapability;
164 }
165 void
167 {
168  m_ssid = ssid;
169 }
170 void
172 {
173  m_beaconInterval = us;
174 }
175 void
177 {
178  m_rates = rates;
179 }
180 TypeId
182 {
183  static TypeId tid = TypeId ("ns3::MgtProbeResponseHeader")
184  .SetParent<Header> ()
185  .SetGroupName ("Wifi")
186  .AddConstructor<MgtProbeResponseHeader> ()
187  ;
188  return tid;
189 }
190 TypeId
192 {
193  return GetTypeId ();
194 }
195 uint32_t
197 {
198  uint32_t size = 0;
199  size += 8; // timestamp
200  size += 2; // beacon interval
201  size += m_capability.GetSerializedSize ();
202  size += m_ssid.GetSerializedSize ();
203  size += m_rates.GetSerializedSize ();
204  //size += 3; // ds parameter set
207  // xxx
208  return size;
209 }
210 void
211 MgtProbeResponseHeader::Print (std::ostream &os) const
212 {
213  os << "ssid=" << m_ssid << ", "
214  << "rates=" << m_rates << ", "
215  << "HT Capabilities=" << m_htCapability;
216 }
217 void
219 {
220  // timestamp
221  // beacon interval
222  // capability information
223  // ssid
224  // supported rates
225  // fh parameter set
226  // ds parameter set
227  // cf parameter set
228  // ibss parameter set
229  //XXX
231  i.WriteHtolsbU64 (Simulator::Now ().GetMicroSeconds ());
232  i.WriteHtolsbU16 (m_beaconInterval / 1024);
233  i = m_capability.Serialize (i);
234  i = m_ssid.Serialize (i);
235  i = m_rates.Serialize (i);
236  //i.WriteU8 (0, 3); // ds parameter set.
237  i = m_rates.extended.Serialize (i);
238  i = m_htCapability.Serialize(i);
239 }
240 uint32_t
242 {
244  m_timestamp = i.ReadLsbtohU64 ();
246  m_beaconInterval *= 1024;
247  i = m_capability.Deserialize (i);
248  i = m_ssid.Deserialize (i);
249  i = m_rates.Deserialize (i);
250  //i.Next (3); // ds parameter set
253  return i.GetDistanceFrom (start);
254 }
255 
256 /***********************************************************
257  * Assoc Request
258  ***********************************************************/
259 
261 
263  : m_listenInterval (0)
264 {
265 }
267 {
268 }
269 
270 void
272 {
273  m_ssid = ssid;
274 }
275 void
277 {
278  m_rates = rates;
279 }
280 void
282 {
283  m_htCapability = htcapabilities;
284 }
285 void
287 {
288  m_listenInterval = interval;
289 }
292 {
293  return m_htCapability;
294 }
295 Ssid
297 {
298  return m_ssid;
299 }
302 {
303  return m_rates;
304 }
305 uint16_t
307 {
308  return m_listenInterval;
309 }
310 
311 TypeId
313 {
314  static TypeId tid = TypeId ("ns3::MgtAssocRequestHeader")
315  .SetParent<Header> ()
316  .SetGroupName ("Wifi")
317  .AddConstructor<MgtAssocRequestHeader> ()
318  ;
319  return tid;
320 }
321 TypeId
323 {
324  return GetTypeId ();
325 }
326 uint32_t
328 {
329  uint32_t size = 0;
330  size += m_capability.GetSerializedSize ();
331  size += 2;
332  size += m_ssid.GetSerializedSize ();
333  size += m_rates.GetSerializedSize ();
336  return size;
337 }
338 void
339 MgtAssocRequestHeader::Print (std::ostream &os) const
340 {
341  os << "ssid=" << m_ssid << ", "
342  << "rates=" << m_rates<< ", "
343  << "HT Capabilities=" << m_htCapability;
344 }
345 void
347 {
349  i = m_capability.Serialize (i);
351  i = m_ssid.Serialize (i);
352  i = m_rates.Serialize (i);
353  i = m_rates.extended.Serialize (i);
354  i = m_htCapability.Serialize(i);
355 }
356 uint32_t
358 {
360  i = m_capability.Deserialize (i);
362  i = m_ssid.Deserialize (i);
363  i = m_rates.Deserialize (i);
366  return i.GetDistanceFrom (start);
367 }
368 
369 /***********************************************************
370  * Assoc Response
371  ***********************************************************/
372 
374 
376  : m_aid (0)
377 {
378 }
380 {
381 }
382 
385 {
386  return m_code;
387 }
390 {
391  return m_rates;
392 }
393 void
395 {
396  m_code = code;
397 }
398 void
400 {
401  m_rates = rates;
402 }
403 void
405 {
406  m_htCapability=htcapabilities;
407 }
408 
411 {
412  return m_htCapability;
413 }
414 TypeId
416 {
417  static TypeId tid = TypeId ("ns3::MgtAssocResponseHeader")
418  .SetParent<Header> ()
419  .SetGroupName ("Wifi")
420  .AddConstructor<MgtAssocResponseHeader> ()
421  ;
422  return tid;
423 }
424 TypeId
426 {
427  return GetTypeId ();
428 }
429 uint32_t
431 {
432  uint32_t size = 0;
433  size += m_capability.GetSerializedSize ();
434  size += m_code.GetSerializedSize ();
435  size += 2; // aid
436  size += m_rates.GetSerializedSize ();
439  return size;
440 }
441 
442 void
443 MgtAssocResponseHeader::Print (std::ostream &os) const
444 {
445  os << "status code=" << m_code << ", "
446  << "rates=" << m_rates << ", "
447  << "HT Capabilities=" << m_htCapability;
448 }
449 void
451 {
453  i = m_capability.Serialize (i);
454  i = m_code.Serialize (i);
455  i.WriteHtolsbU16 (m_aid);
456  i = m_rates.Serialize (i);
457  i = m_rates.extended.Serialize (i);
458  i = m_htCapability.Serialize(i);
459 }
460 uint32_t
462 {
464  i = m_capability.Deserialize (i);
465  i = m_code.Deserialize (i);
466  m_aid = i.ReadLsbtohU16 ();
467  i = m_rates.Deserialize (i);
470  return i.GetDistanceFrom (start);
471 }
472 /**********************************************************
473  * ActionFrame
474  **********************************************************/
476 {
477 }
479 {
480 }
481 void
484 {
485  m_category = type;
486  switch (type)
487  {
488  case BLOCK_ACK:
489  {
490  m_actionValue = action.blockAck;
491  break;
492  }
493  case MESH:
494  {
495  m_actionValue = action.meshAction;
496  break;
497  }
498  case MULTIHOP:
499  {
500  m_actionValue = action.multihopAction;
501  break;
502  }
503  case SELF_PROTECTED:
504  {
506  break;
507  }
509  {
510  break;
511  }
512  }
513 }
516 {
517  switch (m_category)
518  {
519  case BLOCK_ACK:
520  return BLOCK_ACK;
521  case MESH:
522  return MESH;
523  case MULTIHOP:
524  return MULTIHOP;
525  case SELF_PROTECTED:
526  return SELF_PROTECTED;
528  return VENDOR_SPECIFIC_ACTION;
529  default:
530  NS_FATAL_ERROR ("Unknown action value");
531  return SELF_PROTECTED;
532  }
533 }
536 {
537  ActionValue retval;
538  retval.selfProtectedAction = PEER_LINK_OPEN; // Needs to be initialized to something to quiet valgrind in default cases
539 
540  switch (m_category)
541  {
542  case BLOCK_ACK:
543  switch (m_actionValue)
544  {
547  break ;
550  break ;
551  case BLOCK_ACK_DELBA:
552  retval.blockAck = BLOCK_ACK_DELBA;
553  break ;
554  }
555  break ;
556  case SELF_PROTECTED:
557  switch (m_actionValue)
558  {
559  case PEER_LINK_OPEN:
561  break;
562  case PEER_LINK_CONFIRM:
564  break;
565  case PEER_LINK_CLOSE:
567  break;
568  case GROUP_KEY_INFORM:
570  break;
571  case GROUP_KEY_ACK:
573  break;
574  default:
575  NS_FATAL_ERROR ("Unknown mesh peering management action code");
576  retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
577  }
578  break ;
579 
580  case MESH:
581  switch (m_actionValue)
582  {
583  case LINK_METRIC_REPORT:
585  break;
586  case PATH_SELECTION:
587  retval.meshAction = PATH_SELECTION;
588  break;
589  case PORTAL_ANNOUNCEMENT:
591  break;
594  break;
595  case MDA_SETUP_REQUEST:
596  retval.meshAction = MDA_SETUP_REQUEST;
597  break;
598  case MDA_SETUP_REPLY:
599  retval.meshAction = MDA_SETUP_REPLY;
600  break;
603  break;
604  case MDAOP_ADVERTISMENTS:
606  break;
607  case MDAOP_SET_TEARDOWN:
609  break;
612  break;
615  break;
616  default:
617  NS_FATAL_ERROR ("Unknown mesh peering management action code");
618  retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
619  }
620  break;
621 
622  case MULTIHOP: //not yet supported
623  switch (m_actionValue)
624  {
625  case PROXY_UPDATE: //(not used so far)
626  retval.multihopAction = PROXY_UPDATE;
627  break;
628  case PROXY_UPDATE_CONFIRMATION: //(not used so far)
629  retval.multihopAction = PROXY_UPDATE;
630  break;
631  default:
632  NS_FATAL_ERROR ("Unknown mesh peering management action code");
633  retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
634  }
635  break;
636  default:
637  NS_FATAL_ERROR ("Unsupported mesh action");
638  retval.selfProtectedAction = PEER_LINK_OPEN; /* quiet compiler */
639  }
640  return retval;
641 }
642 TypeId
644 {
645  static TypeId tid = TypeId ("ns3::WifiActionHeader")
646  .SetParent<Header> ()
647  .SetGroupName ("Wifi")
648  .AddConstructor<WifiActionHeader> ();
649  return tid;
650 }
651 TypeId
653 {
654  return GetTypeId ();
655 }
656 void
657 WifiActionHeader::Print (std::ostream &os) const
658 {
659 }
660 uint32_t
662 {
663  return 2;
664 }
665 void
667 {
668  start.WriteU8 (m_category);
669  start.WriteU8 (m_actionValue);
670 }
671 uint32_t
673 {
675  m_category = i.ReadU8 ();
676  m_actionValue = i.ReadU8 ();
677  return i.GetDistanceFrom (start);
678 }
679 
680 /***************************************************
681 * ADDBARequest
682 ****************************************************/
683 
685 
687  : m_dialogToken (1),
688  m_amsduSupport (1),
689  m_bufferSize (0)
690 {
691 }
692 
693 TypeId
695 {
696  static TypeId tid = TypeId ("ns3::MgtAddBaRequestHeader")
697  .SetParent<Header> ()
698  .SetGroupName ("Wifi")
699  .AddConstructor<MgtAddBaRequestHeader> ();
700  return tid;
701 }
702 
703 TypeId
705 {
706  return GetTypeId ();
707 }
708 
709 void
710 MgtAddBaRequestHeader::Print (std::ostream &os) const
711 {
712 }
713 
714 uint32_t
716 {
717  uint32_t size = 0;
718  size += 1; //Dialog token
719  size += 2; //Block ack parameter set
720  size += 2; //Block ack timeout value
721  size += 2; //Starting sequence control
722  return size;
723 }
724 
725 void
727 {
733 }
734 
735 uint32_t
737 {
739  m_dialogToken = i.ReadU8 ();
743  return i.GetDistanceFrom (start);
744 }
745 
746 void
748 {
749  m_policy = 0;
750 }
751 
752 void
754 {
755  m_policy = 1;
756 }
757 
758 void
760 {
761  NS_ASSERT (tid < 16);
762  m_tid = tid;
763 }
764 
765 void
767 {
769 }
770 
771 void
773 {
774  m_bufferSize = size;
775 }
776 
777 void
779 {
780  m_startingSeq = seq;
781 }
782 
783 void
785 {
786  m_amsduSupport = supported;
787 }
788 
789 uint8_t
791 {
792  return m_tid;
793 }
794 
795 bool
797 {
798  return (m_policy == 1) ? true : false;
799 }
800 
801 uint16_t
803 {
804  return m_timeoutValue;
805 }
806 
807 uint16_t
809 {
810  return m_bufferSize;
811 }
812 
813 bool
815 {
816  return (m_amsduSupport == 1) ? true : false;
817 }
818 
819 uint16_t
821 {
822  return m_startingSeq;
823 }
824 
825 uint16_t
827 {
828  return (m_startingSeq << 4) & 0xfff0;
829 }
830 
831 void
833 {
834  m_startingSeq = (seqControl >> 4) & 0x0fff;
835 }
836 
837 uint16_t
839 {
840  uint16_t res = 0;
841  res |= m_amsduSupport;
842  res |= m_policy << 1;
843  res |= m_tid << 2;
844  res |= m_bufferSize << 6;
845  return res;
846 }
847 
848 void
850 {
851  m_amsduSupport = (params) & 0x01;
852  m_policy = (params >> 1) & 0x01;
853  m_tid = (params >> 2) & 0x0f;
854  m_bufferSize = (params >> 6) & 0x03ff;
855 }
856 
857 /***************************************************
858 * ADDBAResponse
859 ****************************************************/
860 
862 
864  : m_dialogToken (1),
865  m_amsduSupport (1),
866  m_bufferSize (0)
867 {
868 }
869 
870 TypeId
872 {
873  static TypeId tid = TypeId ("ns3::MgtAddBaResponseHeader")
874  .SetParent<Header> ()
875  .SetGroupName ("Wifi")
876  .AddConstructor<MgtAddBaResponseHeader> ()
877  ;
878  return tid;
879 }
880 
881 TypeId
883 {
884  return GetTypeId ();
885 }
886 
887 void
888 MgtAddBaResponseHeader::Print (std::ostream &os) const
889 {
890  os << "status code=" << m_code;
891 }
892 
893 uint32_t
895 {
896  uint32_t size = 0;
897  size += 1; //Dialog token
898  size += m_code.GetSerializedSize (); //Status code
899  size += 2; //Block ack parameter set
900  size += 2; //Block ack timeout value
901  return size;
902 }
903 
904 void
906 {
909  i = m_code.Serialize (i);
912 }
913 
914 uint32_t
916 {
918  m_dialogToken = i.ReadU8 ();
919  i = m_code.Deserialize (i);
922  return i.GetDistanceFrom (start);
923 }
924 
925 void
927 {
928  m_policy = 0;
929 }
930 
931 void
933 {
934  m_policy = 1;
935 }
936 
937 void
939 {
940  NS_ASSERT (tid < 16);
941  m_tid = tid;
942 }
943 
944 void
946 {
948 }
949 
950 void
952 {
953  m_bufferSize = size;
954 }
955 
956 void
958 {
959  m_code = code;
960 }
961 
962 void
964 {
965  m_amsduSupport = supported;
966 }
967 
970 {
971  return m_code;
972 }
973 
974 uint8_t
976 {
977  return m_tid;
978 }
979 
980 bool
982 {
983  return (m_policy == 1) ? true : false;
984 }
985 
986 uint16_t
988 {
989  return m_timeoutValue;
990 }
991 
992 uint16_t
994 {
995  return m_bufferSize;
996 }
997 
998 bool
1000 {
1001  return (m_amsduSupport == 1) ? true : false;
1002 }
1003 
1004 uint16_t
1006 {
1007  uint16_t res = 0;
1008  res |= m_amsduSupport;
1009  res |= m_policy << 1;
1010  res |= m_tid << 2;
1011  res |= m_bufferSize << 6;
1012  return res;
1013 }
1014 
1015 void
1017 {
1018  m_amsduSupport = (params) & 0x01;
1019  m_policy = (params >> 1) & 0x01;
1020  m_tid = (params >> 2) & 0x0f;
1021  m_bufferSize = (params >> 6) & 0x03ff;
1022 }
1023 
1024 /***************************************************
1025 * DelBa
1026 ****************************************************/
1027 
1029 
1031  : m_reasonCode (1)
1032 {
1033 }
1034 
1035 TypeId
1037 {
1038  static TypeId tid = TypeId ("ns3::MgtDelBaHeader")
1039  .SetParent<Header> ()
1040  .SetGroupName ("Wifi")
1041  .AddConstructor<MgtDelBaHeader> ()
1042  ;
1043  return tid;
1044 }
1045 
1046 TypeId
1048 {
1049  return GetTypeId ();
1050 }
1051 
1052 void
1053 MgtDelBaHeader::Print (std::ostream &os) const
1054 {
1055 }
1056 
1057 uint32_t
1059 {
1060  uint32_t size = 0;
1061  size += 2; //DelBa parameter set
1062  size += 2; //Reason code
1063  return size;
1064 }
1065 
1066 void
1068 {
1069  Buffer::Iterator i = start;
1072 }
1073 
1074 uint32_t
1076 {
1077  Buffer::Iterator i = start;
1079  m_reasonCode = i.ReadLsbtohU16 ();
1080  return i.GetDistanceFrom (start);
1081 }
1082 
1083 bool
1085 {
1086  return (m_initiator == 1) ? true : false;
1087 }
1088 
1089 uint8_t
1091 {
1092  NS_ASSERT (m_tid < 16);
1093  uint8_t tid = static_cast<uint8_t> (m_tid);
1094  return tid;
1095 }
1096 
1097 void
1099 {
1100  m_initiator = 1;
1101 }
1102 
1103 void
1105 {
1106  m_initiator = 0;
1107 }
1108 
1109 void
1111 {
1112  NS_ASSERT (tid < 16);
1113  m_tid = static_cast<uint16_t> (tid);
1114 }
1115 
1116 uint16_t
1118 {
1119  uint16_t res = 0;
1120  res |= m_initiator << 11;
1121  res |= m_tid << 12;
1122  return res;
1123 }
1124 
1125 void
1127 {
1128  m_initiator = (params >> 11) & 0x01;
1129  m_tid = (params >> 12) & 0x0f;
1130 }
1131 
1132 } // namespace ns3
Protocol header serialization and deserialization.
Definition: header.h:42
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:871
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:736
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:65
uint16_t GetBufferSize(void) const
Return the buffer size.
Definition: mgt-headers.cc:993
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:450
StatusCode m_code
Status code.
Definition: mgt-headers.h:675
virtual uint32_t GetSerializedSize(void) const
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:150
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:322
Implement the header for management frames of type association request.
Definition: mgt-headers.h:40
uint8_t m_policy
Block ACK policy.
Definition: mgt-headers.h:677
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:657
Buffer::Iterator Deserialize(Buffer::Iterator start)
Deserialize capability information from the given buffer.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:191
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:140
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:168
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:312
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:563
See IEEE 802.11 chapter 7.3.1.11 Header format: | category: 1 | action value: 1 |.
Definition: mgt-headers.h:336
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:710
HtCapabilities m_htCapability
HT capabilities.
Definition: mgt-headers.h:231
uint64_t GetBeaconIntervalUs(void) const
Return the beacon interval in microseconds unit.
Definition: mgt-headers.cc:145
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:105
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:80
void SetImmediateBlockAck()
Enable immediate Block ACK.
Definition: mgt-headers.cc:753
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:311
def start()
Definition: core.py:1482
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:169
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:312
uint16_t GetSerializedSize() const
Return the serialized size of this supported rates information element.
void SetBufferSize(uint16_t size)
Set buffer size.
Definition: mgt-headers.cc:772
Implement the header for management frames of type add block ack request.
Definition: mgt-headers.h:444
bool IsImmediateBlockAck(void) const
Return whether the Block ACK policy is immediate Block ACK.
Definition: mgt-headers.cc:981
HtCapabilities m_htCapability
HT capabilities.
Definition: mgt-headers.h:107
#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
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:327
The HT Capabilities Information ElementThis class knows how to serialise and deserialise the HT Capab...
void SetHtCapabilities(HtCapabilities htcapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:281
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:271
uint32_t GetSerializedSize(void) const
Definition: status-code.cc:47
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:888
uint16_t m_startingSeq
Starting sequence number.
Definition: mgt-headers.h:564
void SetAction(enum CategoryValue type, ActionValue action)
Set action for this Action header.
Definition: mgt-headers.cc:482
Buffer::Iterator Serialize(Buffer::Iterator start) const
Serialize capability information to the given buffer.
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
uint16_t GetBufferSize(void) const
Return the buffer size.
Definition: mgt-headers.cc:808
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:882
CategoryValue GetCategory()
Return the category value.
Definition: mgt-headers.cc:515
void SetDelayedBlockAck()
Enable delayed Block ACK.
Definition: mgt-headers.cc:926
ns3::Time timeout
void SetTid(uint8_t)
Set Traffic ID (TID).
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:957
The Supported Rates Information ElementThis class knows how to serialise and deserialise the Supporte...
CapabilityInformation m_capability
Capability information.
Definition: mgt-headers.h:106
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:562
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:90
void SetTimeout(uint16_t timeout)
Set timeout.
Definition: mgt-headers.cc:945
Buffer::Iterator Deserialize(Buffer::Iterator i)
Deserialize entire IE, which must be present.
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:44
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:49
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
Definition: mgt-headers.cc:784
uint32_t GetDistanceFrom(Iterator const &o) const
Definition: buffer.cc:811
uint16_t GetSerializedSize() const
Get the size of the serialized IE including Element ID and length fields.
Ssid GetSsid(void) const
Return the Service Set Identifier (SSID).
Definition: mgt-headers.cc:296
iterator in a Buffer instance
Definition: buffer.h:98
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:276
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
Definition: mgt-headers.cc:999
uint16_t GetStartingSequenceControl(void) const
Return the raw sequence control.
Definition: mgt-headers.cc:826
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:905
void SetTid(uint8_t tid)
Set Traffic ID (TID).
Definition: mgt-headers.cc:938
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:211
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:218
ExtendedSupportedRatesIE extended
SupportedRates GetSupportedRates(void) const
Return the supported rates.
Definition: mgt-headers.cc:301
void SetListenInterval(uint16_t interval)
Set the listen interval.
Definition: mgt-headers.cc:286
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:643
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:676
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:704
virtual TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:652
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
Definition: mgt-headers.cc:849
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:561
SupportedRates m_rates
List of supported rates.
Definition: mgt-headers.h:230
enum MultihopActionValue multihopAction
Definition: mgt-headers.h:405
virtual uint32_t GetSerializedSize() const
Definition: mgt-headers.cc:661
void SetStartingSequenceControl(uint16_t seqControl)
Set sequence control with the given raw value.
Definition: mgt-headers.cc:832
void SetImmediateBlockAck()
Enable immediate Block ACK.
Definition: mgt-headers.cc:932
Buffer::Iterator Serialize(Buffer::Iterator start) const
This information element is a bit special in that it is only included if there are more than 8 rates...
void SetTid(uint8_t tid)
Set Traffic ID (TID).
Definition: mgt-headers.cc:759
uint16_t GetListenInterval(void) const
Return the listen interval.
Definition: mgt-headers.cc:306
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
enum MeshActionValue meshAction
Definition: mgt-headers.h:404
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:95
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:111
enum BlockAckActionValue blockAck
Definition: mgt-headers.h:407
uint8_t m_amsduSupport
Flag if A-MSDU is supported.
Definition: mgt-headers.h:559
Buffer::Iterator DeserializeIfPresent(Buffer::Iterator i)
Deserialize entire IE if it is present.
void SetStartingSequence(uint16_t seq)
Set the starting sequence number.
Definition: mgt-headers.cc:778
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:726
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Definition: mgt-headers.cc:790
SupportedRates GetSupportedRates(void)
Return the supported rates.
Definition: mgt-headers.cc:389
uint64_t m_timestamp
Timestamp.
Definition: mgt-headers.h:308
void SetHtCapabilities(HtCapabilities htcapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:54
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: mgt-headers.cc:425
uint64_t GetTimestamp()
Return the time stamp.
Definition: mgt-headers.cc:135
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:715
Buffer::Iterator Serialize(Buffer::Iterator start) const
Definition: status-code.cc:52
void SetByOriginator(void)
Set the initiator bit in the DELBA.
Status code for association response.
Definition: status-code.h:32
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:166
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:339
void SetByRecipient(void)
Un-set the initiator bit in the DELBA.
bool IsAmsduSupported(void) const
Return whether A-MSDU capability is supported.
Definition: mgt-headers.cc:814
static TypeId GetTypeId(void)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:894
void SetBeaconIntervalUs(uint64_t us)
Set the beacon interval in microseconds unit.
Definition: mgt-headers.cc:171
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:181
void SetBufferSize(uint16_t size)
Set buffer size.
Definition: mgt-headers.cc:951
Buffer::Iterator Deserialize(Buffer::Iterator start)
Definition: status-code.cc:58
uint8_t GetTid(void) const
Return the Traffic ID (TID).
virtual void Serialize(Buffer::Iterator start) const
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:672
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:161
StatusCode GetStatusCode(void) const
Return the status code.
Definition: mgt-headers.cc:969
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:60
bool IsByOriginator(void) const
Check if the initiator bit in the DELBA is setted.
HtCapabilities m_htCapability
HT capabilities.
Definition: mgt-headers.h:313
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:241
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
uint8_t m_tid
Traffic ID.
Definition: mgt-headers.h:678
virtual void Print(std::ostream &os) const
Definition: mgt-headers.cc:443
uint16_t GetTimeout(void) const
Return the timeout.
Definition: mgt-headers.cc:987
uint8_t GetTid(void) const
Return the Traffic ID (TID).
Definition: mgt-headers.cc:975
uint8_t m_actionValue
Action value.
Definition: mgt-headers.h:437
The IEEE 802.11 SSID Information Element.
Definition: ssid.h:37
Implement the header for management frames of type probe request.
Definition: mgt-headers.h:180
bool IsImmediateBlockAck(void) const
Return whether the Block ACK policy is immediate Block ACK.
Definition: mgt-headers.cc:796
enum SelfProtectedActionValue selfProtectedAction
Definition: mgt-headers.h:406
void WriteHtolsbU16(uint16_t data)
Definition: buffer.cc:939
Implement the header for management frames of type association response.
Definition: mgt-headers.h:116
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:915
StatusCode m_code
Status code.
Definition: mgt-headers.h:170
uint16_t GetStartingSequence(void) const
Return the starting sequence number.
Definition: mgt-headers.cc:820
uint16_t m_tid
Traffic ID.
Definition: mgt-headers.h:743
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:694
void WriteU8(uint8_t data)
Definition: buffer.h:876
void WriteHtolsbU64(uint64_t data)
Definition: buffer.cc:955
static TypeId GetTypeId(void)
Definition: mgt-headers.cc:415
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:399
uint16_t GetParameterSet(void) const
Return the raw parameter set.
uint32_t GetSerializedSize(void) const
Return the serialized size of capability information.
Implement the header for management frames of type add block ack response.
Definition: mgt-headers.h:572
Implement the header for management frames of type del block ack.
Definition: mgt-headers.h:688
typedef for union of different ActionValues
Definition: mgt-headers.h:402
uint8_t ReadU8(void)
Definition: buffer.h:1028
uint8_t m_policy
Block ACK policy.
Definition: mgt-headers.h:560
HtCapabilities m_htCapability
HT capabilities.
Definition: mgt-headers.h:172
void SetSupportedRates(SupportedRates rates)
Set the supported rates.
Definition: mgt-headers.cc:176
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:229
void SetHtCapabilities(HtCapabilities htcapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:404
uint16_t ReadLsbtohU16(void)
Definition: buffer.cc:1094
void SetSsid(Ssid ssid)
Set the Service Set Identifier (SSID).
Definition: mgt-headers.cc:39
void SetStatusCode(StatusCode code)
Set the status code.
Definition: mgt-headers.cc:394
void SetParameterSet(uint16_t params)
Set the parameter set from the given raw value.
void SetAmsduSupport(bool supported)
Enable or disable A-MSDU support.
Definition: mgt-headers.cc:963
uint8_t m_category
Category of the action.
Definition: mgt-headers.h:436
void SetDelayedBlockAck()
Enable delayed Block ACK.
Definition: mgt-headers.cc:747
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:357
void SetTimeout(uint16_t timeout)
Set timeout.
Definition: mgt-headers.cc:766
Implement the header for management frames of type probe response.
Definition: mgt-headers.h:239
uint64_t ReadLsbtohU64(void)
Definition: buffer.cc:1122
uint16_t GetSerializedSize() const
Return the serialized size of this HT capability information element.
uint16_t GetParameterSet(void) const
Return the raw parameter set.
Definition: mgt-headers.cc:838
ActionValue GetAction()
Return the action value.
Definition: mgt-headers.cc:535
uint16_t m_bufferSize
Buffer size.
Definition: mgt-headers.h:679
uint16_t GetParameterSet(void) const
Return the raw parameter set.
uint64_t m_beaconInterval
Beacon interval.
Definition: mgt-headers.h:310
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:70
Buffer::Iterator Serialize(Buffer::Iterator start) const
This information element is a bit special in that it is only included if the STA is an HT STA...
uint16_t m_timeoutValue
Timeout.
Definition: mgt-headers.h:680
Ssid m_ssid
Service Set ID (SSID)
Definition: mgt-headers.h:104
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:291
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:196
a unique identifier for an interface.
Definition: type-id.h:57
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:102
TypeId SetParent(TypeId tid)
Definition: type-id.cc:638
void SetHtCapabilities(HtCapabilities htcapabilities)
Set the HT capabilities.
Definition: mgt-headers.cc:155
Buffer::Iterator Serialize(Buffer::Iterator i) const
Serialize entire IE including Element ID and length fields.
virtual uint32_t Deserialize(Buffer::Iterator start)
Definition: mgt-headers.cc:461
virtual uint32_t GetSerializedSize(void) const
Definition: mgt-headers.cc:430
StatusCode GetStatusCode(void)
Return the status code.
Definition: mgt-headers.cc:384
Ssid m_ssid
Service set ID (SSID)
Definition: mgt-headers.h:309
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:666
virtual uint32_t Deserialize(Buffer::Iterator start)
uint16_t GetTimeout(void) const
Return the timeout.
Definition: mgt-headers.cc:802
HtCapabilities GetHtCapabilities(void) const
Return the HT capabilities.
Definition: mgt-headers.cc:410
virtual void Print(std::ostream &os) const
virtual void Serialize(Buffer::Iterator start) const
Definition: mgt-headers.cc:346