A Discrete-Event Network Simulator
API
radiotap-header.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 CTTC
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, Include., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #include <iomanip>
23 #include <cmath>
24 #include "ns3/log.h"
25 #include "radiotap-header.h"
26 
27 namespace ns3 {
28 
29 NS_LOG_COMPONENT_DEFINE ("RadiotapHeader");
30 
31 NS_OBJECT_ENSURE_REGISTERED (RadiotapHeader);
32 
34  : m_length (8),
35  m_present (0),
36  m_tsft (0),
37  m_flags (FRAME_FLAG_NONE),
38  m_rate (0),
39  m_channelFreq (0),
40  m_channelFlags (CHANNEL_FLAG_NONE),
41  m_antennaSignal (0),
42  m_antennaNoise (0),
43  m_ampduStatusRef (0),
44  m_ampduStatusFlags (0),
45  m_ampduStatusCRC (0),
46  m_vhtPad (0),
47  m_vhtKnown (0),
48  m_vhtFlags (0),
49  m_vhtBandwidth (0),
50  m_vhtCoding (0),
51  m_vhtGroupId (0),
52  m_vhtPartialAid (0)
53 {
54  NS_LOG_FUNCTION (this);
55 }
56 
58 {
59  static TypeId tid = TypeId ("ns3::RadiotapHeader")
60  .SetParent<Header> ()
61  .SetGroupName ("Network")
62 
63  .AddConstructor<RadiotapHeader> ()
64  ;
65  return tid;
66 }
67 
68 TypeId
70 {
71  return GetTypeId ();
72 }
73 
74 uint32_t
76 {
77  NS_LOG_FUNCTION (this);
78  return m_length;
79 }
80 
81 void
83 {
84  NS_LOG_FUNCTION (this << &start);
85 
86  start.WriteU8 (0); // major version of radiotap header
87  start.WriteU8 (0); // pad field
88  start.WriteU16 (m_length); // entire length of radiotap data + header
89  start.WriteU32 (m_present); // bits describing which fields follow header
90 
91  //
92  // Time Synchronization Function Timer (when the first bit of the MPDU
93  // arrived at the MAC)
94  //
95  if (m_present & RADIOTAP_TSFT) // bit 0
96  {
97  start.WriteU64 (m_tsft);
98  }
99 
100  //
101  // Properties of transmitted and received frames.
102  //
103  if (m_present & RADIOTAP_FLAGS) // bit 1
104  {
105  start.WriteU8 (m_flags);
106  }
107 
108  //
109  // TX/RX data rate in units of 500 kbps
110  //
111  if (m_present & RADIOTAP_RATE) // bit 2
112  {
113  start.WriteU8 (m_rate);
114  }
115 
116  //
117  // Tx/Rx frequency in MHz, followed by flags.
118  //
119  if (m_present & RADIOTAP_CHANNEL) // bit 3
120  {
121  start.WriteU8 (0, m_channelPad);
122  start.WriteU16 (m_channelFreq);
123  start.WriteU16 (m_channelFlags);
124  }
125 
126  //
127  // The hop set and pattern for frequency-hopping radios. We don't need it but
128  // still need to account for it.
129  //
130  if (m_present & RADIOTAP_FHSS) // bit 4
131  {
132  start.WriteU8 (0); //not yet implemented
133  }
134 
135  //
136  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
137  // reference.
138  //
139  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
140  {
141  start.WriteU8 (m_antennaSignal);
142  }
143 
144  //
145  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
146  // reference.
147  //
148  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
149  {
150  start.WriteU8 (m_antennaNoise);
151  }
152 
153  //
154  // Quality of Barker code lock.
155  //
156  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
157  {
158  start.WriteU16 (0); //not yet implemented
159  }
160 
161  //
162  // Transmit power expressed as unitless distance from max power
163  // set at factory calibration (0 is max power).
164  //
165  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
166  {
167  start.WriteU16 (0); //not yet implemented
168  }
169 
170  //
171  // Transmit power expressed as decibel distance from max power
172  // set at factory calibration (0 is max power).
173  //
174  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
175  {
176  start.WriteU16 (0); //not yet implemented
177  }
178 
179  //
180  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
181  // This is the absolute power level measured at the antenna port.
182  //
183  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
184  {
185  start.WriteU8 (0); //not yet implemented
186  }
187 
188  //
189  // Unitless indication of the Rx/Tx antenna for this packet.
190  // The first antenna is antenna 0.
191  //
192  if (m_present & RADIOTAP_ANTENNA) // bit 11
193  {
194  start.WriteU8 (0); //not yet implemented
195  }
196 
197  //
198  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
199  //
200  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
201  {
202  start.WriteU8 (0); //not yet implemented
203  }
204 
205  //
206  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
207  //
208  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
209  {
210  start.WriteU8 (0); //not yet implemented
211  }
212 
213  //
214  // Properties of received frames.
215  //
216  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
217  {
218  start.WriteU16 (0); //not yet implemented
219  }
220 
221  //
222  // MCS field.
223  //
224  if (m_present & RADIOTAP_MCS) // bit 19
225  {
226  start.WriteU8 (m_mcsKnown);
227  start.WriteU8 (m_mcsFlags);
228  start.WriteU8 (m_mcsRate);
229  }
230 
231  //
232  // A-MPDU Status, information about the received or transmitted A-MPDU.
233  //
234  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
235  {
236  start.WriteU8 (0, m_ampduStatusPad);
237  start.WriteU32 (m_ampduStatusRef);
239  start.WriteU8 (m_ampduStatusCRC);
240  start.WriteU8 (0);
241  }
242 
243  //
244  // Information about the received or transmitted VHT frame.
245  //
246  if (m_present & RADIOTAP_VHT) // bit 21
247  {
248  start.WriteU8 (0, m_vhtPad);
249  start.WriteU16 (m_vhtKnown);
250  start.WriteU8 (m_vhtFlags);
251  start.WriteU8 (m_vhtBandwidth);
252  for (uint8_t i = 0; i < 4; i++)
253  {
254  start.WriteU8 (m_vhtMcsNss[i]);
255  }
256  start.WriteU8 (m_vhtCoding);
257  start.WriteU8 (m_vhtGroupId);
258  start.WriteU16 (m_vhtPartialAid);
259  }
260 }
261 
262 uint32_t
264 {
265  NS_LOG_FUNCTION (this << &start);
266 
267  uint8_t tmp = start.ReadU8 (); // major version of radiotap header
268  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
269  start.ReadU8 (); // pad field
270 
271  m_length = start.ReadU16 (); // entire length of radiotap data + header
272  m_present = start.ReadU32 (); // bits describing which fields follow header
273 
274  uint32_t bytesRead = 8;
275 
276  //
277  // Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
278  //
279  if (m_present & RADIOTAP_TSFT) // bit 0
280  {
281  m_tsft = start.ReadU64 ();
282  bytesRead += 8;
283  }
284 
285  //
286  // Properties of transmitted and received frames.
287  //
288  if (m_present & RADIOTAP_FLAGS) // bit 1
289  {
290  m_flags = start.ReadU8 ();
291  ++bytesRead;
292  }
293 
294  //
295  // TX/RX data rate in units of 500 kbps
296  //
297  if (m_present & RADIOTAP_RATE) // bit 2
298  {
299  m_rate = start.ReadU8 ();
300  ++bytesRead;
301  }
302 
303  //
304  // Tx/Rx frequency in MHz, followed by flags.
305  //
306  if (m_present & RADIOTAP_CHANNEL) // bit 3
307  {
308  m_channelPad = ((2 - bytesRead % 2) % 2);
309  start.Next (m_channelPad);
310  m_channelFreq = start.ReadU16 ();
311  m_channelFlags = start.ReadU16 ();
312  bytesRead += (4 + m_channelPad);
313  }
314 
315  //
316  // The hop set and pattern for frequency-hopping radios. We don't need it but
317  // still need to account for it.
318  //
319  if (m_present & RADIOTAP_FHSS) // bit 4
320  {
321  //not yet implemented
322  start.ReadU8 ();
323  ++bytesRead;
324  }
325 
326  //
327  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
328  // reference.
329  //
330  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
331  {
332  m_antennaSignal = start.ReadU8 ();
333  ++bytesRead;
334  }
335 
336  //
337  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
338  // reference.
339  //
340  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
341  {
342  m_antennaNoise = start.ReadU8 ();
343  ++bytesRead;
344  }
345 
346  //
347  // Quality of Barker code lock.
348  //
349  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
350  {
351  //not yet implemented
352  start.ReadU16 ();
353  bytesRead += 2;
354  }
355 
356  //
357  // Transmit power expressed as unitless distance from max power
358  // set at factory calibration (0 is max power).
359  //
360  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
361  {
362  //not yet implemented
363  start.ReadU16 ();
364  bytesRead += 2;
365  }
366 
367  //
368  // Transmit power expressed as decibel distance from max power
369  // set at factory calibration (0 is max power).
370  //
371  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
372  {
373  //not yet implemented
374  start.ReadU16 ();
375  bytesRead += 2;
376  }
377 
378  //
379  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
380  // This is the absolute power level measured at the antenna port.
381  //
382  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
383  {
384  //not yet implemented
385  start.ReadU8 ();
386  ++bytesRead;
387  }
388 
389  //
390  // Unitless indication of the Rx/Tx antenna for this packet.
391  // The first antenna is antenna 0.
392  //
393  if (m_present & RADIOTAP_ANTENNA) // bit 11
394  {
395  //not yet implemented
396  start.ReadU8 ();
397  ++bytesRead;
398  }
399 
400  //
401  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
402  //
403  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
404  {
405  //not yet implemented
406  start.ReadU8 ();
407  ++bytesRead;
408  }
409 
410  //
411  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
412  //
413  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
414  {
415  //not yet implemented
416  start.ReadU8 ();
417  ++bytesRead;
418  }
419 
420  //
421  // Properties of received frames.
422  //
423  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
424  {
425  //not yet implemented
426  start.ReadU16 ();
427  bytesRead += 2;
428  }
429 
430  //
431  // MCS field.
432  //
433  if (m_present & RADIOTAP_MCS) // bit 19
434  {
435  m_mcsKnown = start.ReadU8 ();
436  m_mcsFlags = start.ReadU8 ();
437  m_mcsRate = start.ReadU8 ();
438  bytesRead += 3;
439  }
440 
441  //
442  // A-MPDU Status, information about the received or transmitted A-MPDU.
443  //
444  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
445  {
446  m_ampduStatusPad = ((4 - bytesRead % 4) % 4);
447  start.Next (m_ampduStatusPad);
448  m_ampduStatusRef = start.ReadU32 ();
449  m_ampduStatusFlags = start.ReadU16 ();
450  m_ampduStatusCRC = start.ReadU8 ();
451  start.ReadU8 ();
452  bytesRead += (8 + m_ampduStatusPad);
453  }
454 
455  //
456  // Information about the received or transmitted VHT frame.
457  //
458  if (m_present & RADIOTAP_VHT) // bit 21
459  {
460  m_vhtPad = ((2 - bytesRead % 2) % 2);
461  start.Next (m_vhtPad);
462  m_vhtKnown = start.ReadU16 ();
463  m_vhtFlags = start.ReadU8 ();
464  m_vhtBandwidth = start.ReadU8 ();
465  for (uint8_t i = 0; i < 4; i++)
466  {
467  m_vhtMcsNss[i] = start.ReadU8 ();
468  }
469  m_vhtCoding = start.ReadU8 ();
470  m_vhtGroupId = start.ReadU8 ();
471  m_vhtPartialAid = start.ReadU16 ();
472  bytesRead += (12 + m_vhtPad);
473  }
474 
475  NS_ASSERT_MSG (m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent");
476  return bytesRead;
477 }
478 
479 void
480 RadiotapHeader::Print (std::ostream &os) const
481 {
482  NS_LOG_FUNCTION (this << &os);
483  os << " tsft=" << m_tsft
484  << " flags=" << std::hex << m_flags << std::dec
485  << " rate=" << (uint16_t) m_rate
486  << " freq=" << m_channelFreq
487  << " chflags=" << std::hex << (uint32_t)m_channelFlags << std::dec
488  << " signal=" << (int16_t) m_antennaSignal
489  << " noise=" << (int16_t) m_antennaNoise
490  << " mcsKnown=" << m_mcsKnown
491  << " mcsFlags=" << m_mcsFlags
492  << " mcsRate=" << m_mcsRate
493  << " ampduStatusFlags=" << (int16_t) m_ampduStatusFlags
494  << " vhtKnown=" << m_vhtKnown
495  << " vhtFlags=" << m_vhtFlags
496  << " vhtBandwidth=" << m_vhtBandwidth
497  << " vhtMcsNss for user 1=" << m_vhtMcsNss[0]
498  << " vhtMcsNss for user 2=" << m_vhtMcsNss[1]
499  << " vhtMcsNss for user 3=" << m_vhtMcsNss[2]
500  << " vhtMcsNss for user 4=" << m_vhtMcsNss[3]
501  << " vhtCoding=" << m_vhtCoding
502  << " vhtGroupId=" << m_vhtGroupId
503  << " vhtPartialAid=" << m_vhtPartialAid;
504 }
505 
506 void
507 RadiotapHeader::SetTsft (uint64_t value)
508 {
509  NS_LOG_FUNCTION (this << value);
510  m_tsft = value;
511 
512  if (!(m_present & RADIOTAP_TSFT))
513  {
515  m_length += 8;
516  }
517 
518  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
519 }
520 
521 uint64_t
523 {
524  NS_LOG_FUNCTION (this);
525  return m_tsft;
526 }
527 
528 void
530 {
531  NS_LOG_FUNCTION (this << static_cast<uint32_t> (flags));
532  m_flags = flags;
533 
534  if (!(m_present & RADIOTAP_FLAGS))
535  {
537  m_length += 1;
538  }
539 
540  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
541 }
542 
543 uint8_t
545 {
546  NS_LOG_FUNCTION (this);
547  return m_flags;
548 }
549 
550 void
552 {
553  NS_LOG_FUNCTION (this << static_cast<uint32_t> (rate));
554  m_rate = rate;
555 
556  if (!(m_present & RADIOTAP_RATE))
557  {
559  m_length += 1;
560  }
561 
562  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
563 }
564 
565 uint8_t
567 {
568  NS_LOG_FUNCTION (this);
569  return m_rate;
570 }
571 
572 void
573 RadiotapHeader::SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags)
574 {
575  NS_LOG_FUNCTION (this << frequency << flags);
576  m_channelFreq = frequency;
577  m_channelFlags = flags;
578 
579  if (!(m_present & RADIOTAP_CHANNEL))
580  {
581  m_channelPad = ((2 - m_length % 2) % 2);
583  m_length += (4 + m_channelPad);
584  }
585 
586  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
587 }
588 
589 uint16_t
591 {
592  NS_LOG_FUNCTION (this);
593  return m_channelFreq;
594 }
595 
596 uint16_t
598 {
599  NS_LOG_FUNCTION (this);
600  return m_channelFlags;
601 }
602 
603 void
605 {
606  NS_LOG_FUNCTION (this << signal);
607 
609  {
611  m_length += 1;
612  }
613  if (signal > 127)
614  {
615  m_antennaSignal = 127;
616  }
617  else if (signal < -128)
618  {
619  m_antennaSignal = -128;
620  }
621  else
622  {
623  m_antennaSignal = static_cast<int8_t> (floor (signal + 0.5));
624  }
625 
626  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
627 }
628 
629 uint8_t
631 {
632  NS_LOG_FUNCTION (this);
633  return m_antennaSignal;
634 }
635 
636 void
638 {
639  NS_LOG_FUNCTION (this << noise);
640 
642  {
644  m_length += 1;
645  }
646  if (noise > 127.0)
647  {
648  m_antennaNoise = 127;
649  }
650  else if (noise < -128.0)
651  {
652  m_antennaNoise = -128;
653  }
654  else
655  {
656  m_antennaNoise = static_cast<int8_t> (floor (noise + 0.5));
657  }
658 
659  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
660 }
661 
662 uint8_t
664 {
665  NS_LOG_FUNCTION (this);
666  return m_antennaNoise;
667 }
668 
669 void
670 RadiotapHeader::SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs)
671 {
672  NS_LOG_FUNCTION (this << known << flags << mcs);
673  m_mcsKnown = known;
674  m_mcsFlags = flags;
675  m_mcsRate = mcs;
676  if (!(m_present & RADIOTAP_MCS))
677  {
679  m_length += 3;
680  }
681 
682  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
683 }
684 
685 uint8_t
687 {
688  NS_LOG_FUNCTION (this);
689  return m_mcsKnown;
690 }
691 
692 uint8_t
694 {
695  NS_LOG_FUNCTION (this);
696  return m_mcsFlags;
697 }
698 
699 uint8_t
701 {
702  NS_LOG_FUNCTION (this);
703  return m_mcsRate;
704 }
705 
706 void
707 RadiotapHeader::SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc)
708 {
709  NS_LOG_FUNCTION (this << referenceNumber << flags);
710  m_ampduStatusRef = referenceNumber;
711  m_ampduStatusFlags = flags;
712  m_ampduStatusCRC = crc;
714  {
715  m_ampduStatusPad = ((4 - m_length % 4) % 4);
717  m_length += (8 + m_ampduStatusPad);
718  }
719 
720  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
721 }
722 
723 uint32_t
725 {
726  NS_LOG_FUNCTION (this);
727  return m_ampduStatusRef;
728 }
729 
730 uint16_t
732 {
733  NS_LOG_FUNCTION (this);
734  return m_ampduStatusFlags;
735 }
736 
737 void
738 RadiotapHeader::SetVhtFields (uint16_t known, uint8_t flags, uint8_t bandwidth, uint8_t mcs_nss[4], uint8_t coding, uint8_t group_id, uint16_t partial_aid)
739 {
740  NS_LOG_FUNCTION (this << known << flags << mcs_nss[0] << mcs_nss[1] << mcs_nss[2] << mcs_nss[3] << coding << group_id << partial_aid);
741  m_vhtKnown = known;
742  m_vhtFlags = flags;
743  m_vhtBandwidth = bandwidth;
744  for (uint8_t i = 0; i < 4; i++)
745  {
746  m_vhtMcsNss[i] = mcs_nss[i];
747  }
748  m_vhtCoding = coding;
749  m_vhtGroupId = group_id;
750  m_vhtPartialAid = partial_aid;
751  if (!(m_present & RADIOTAP_VHT))
752  {
753  m_vhtPad = ((2 - m_length % 2) % 2);
755  m_length += (12 + m_vhtPad);
756  }
757 
758  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
759 }
760 
761 uint16_t
763 {
764  NS_LOG_FUNCTION (this);
765  return m_vhtKnown;
766 }
767 
768 uint8_t
770 {
771  NS_LOG_FUNCTION (this);
772  return m_vhtFlags;
773 }
774 
775 uint8_t
777 {
778  NS_LOG_FUNCTION (this);
779  return m_vhtBandwidth;
780 }
781 
782 uint8_t
784 {
785  NS_LOG_FUNCTION (this);
786  return m_vhtMcsNss[0];
787 }
788 
789 uint8_t
791 {
792  NS_LOG_FUNCTION (this);
793  return m_vhtMcsNss[1];
794 }
795 
796 uint8_t
798 {
799  NS_LOG_FUNCTION (this);
800  return m_vhtMcsNss[2];
801 }
802 
803 uint8_t
805 {
806  NS_LOG_FUNCTION (this);
807  return m_vhtMcsNss[3];
808 }
809 
810 uint8_t
812 {
813  NS_LOG_FUNCTION (this);
814  return m_vhtCoding;
815 }
816 
817 uint8_t
819 {
820  NS_LOG_FUNCTION (this);
821  return m_vhtGroupId;
822 }
823 
824 uint8_t
826 {
827  NS_LOG_FUNCTION (this);
828  return m_vhtPartialAid;
829 }
830 
831 } // namespace ns3
uint16_t ReadU16(void)
Definition: buffer.h:1028
Protocol header serialization and deserialization.
Definition: header.h:42
uint8_t m_channelPad
Tx/Rx channel padding.
uint8_t m_mcsKnown
MCS Flags, known information field.
uint32_t ReadU32(void)
Definition: buffer.cc:972
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint16_t GetVhtKnown(void) const
Get the VHT known bitmap.
uint8_t m_vhtPad
VHT padding.
uint8_t m_ampduStatusCRC
A-MPDU Status Flags, delimiter CRC value.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
Radiotap header implementation.
uint16_t m_ampduStatusFlags
A-MPDU Status Flags, information about the received A-MPDU.
uint64_t GetTsft(void) const
Get the Time Synchronization Function Timer (TSFT) value.
virtual void Print(std::ostream &os) const
This method is used by Packet::Print to print the content of the header as ascii data to a C++ output...
uint8_t GetRate(void) const
Get the transmit/receive channel frequency in units of megahertz.
def start()
Definition: core.py:1482
virtual uint32_t Deserialize(Buffer::Iterator start)
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet...
virtual uint32_t GetSerializedSize(void) const
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet...
uint8_t GetVhtGroupId(void) const
Get the VHT group_id field value.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
uint16_t m_channelFreq
Tx/Rx frequency in MHz.
uint8_t m_mcsFlags
MCS Flags, flags field.
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
uint32_t GetAmpduStatusRef(void) const
Get the A-MPDU reference number.
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference...
uint8_t GetAntennaNoisePower(void) const
Get the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference...
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value.
static TypeId GetTypeId(void)
Get the type ID.
iterator in a Buffer instance
Definition: buffer.h:98
uint8_t m_vhtMcsNss[4]
VHT mcs_nss field.
uint8_t m_vhtCoding
VHT coding field.
uint8_t GetVhtMcsNssUser3() const
Get the VHT mcs_nss field value for user 3.
void SetChannelFrequencyAndFlags(uint16_t frequency, uint16_t flags)
Set the transmit/receive channel frequency and flags.
uint64_t m_tsft
Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC) ...
void WriteU16(uint16_t data)
Definition: buffer.cc:870
uint8_t m_vhtFlags
VHT flags field.
uint8_t m_mcsRate
MCS Flags, mcs rate index.
int8_t m_antennaNoise
RF noise power at the antenna, dB difference from an arbitrary, fixed reference.
void Next(void)
go forward by one byte
Definition: buffer.h:844
uint8_t GetVhtFlags(void) const
Get the VHT flags.
uint8_t m_vhtBandwidth
VHT bandwidth field.
void WriteU64(uint64_t data)
Definition: buffer.cc:890
uint8_t GetVhtMcsNssUser4() const
Get the VHT mcs_nss field value for user 4.
uint16_t m_channelFlags
Tx/Rx channel flags.
uint8_t m_ampduStatusPad
A-MPDU Status Flags, padding before A-MPDU Status Field.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
int8_t m_antennaSignal
RF signal power at the antenna, dB difference from an arbitrary, fixed reference. ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t GetMcsKnown(void) const
Get the MCS known bitmap.
uint8_t GetVhtPartialAid(void) const
Get the VHT partial_aid field value.
uint8_t m_flags
Properties of transmitted and received frames.
uint8_t GetFrameFlags(void) const
Get the frame flags of the transmitted or received frame.
uint16_t GetChannelFlags(void) const
Get the channel flags of the transmitted or received frame.
void SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs)
Set the MCS fields.
uint8_t GetVhtBandwidth(void) const
Get the VHT bandwidth field value.
uint32_t m_present
bits describing which fields follow header
uint64_t ReadU64(void)
Definition: buffer.cc:989
uint8_t m_vhtGroupId
VHT group_id field.
#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:90
uint16_t m_vhtPartialAid
VHT partial_aid field.
uint8_t GetAntennaSignalPower(void) const
Get the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...
void SetVhtFields(uint16_t known, uint8_t flags, uint8_t bandwidth, uint8_t mcs_nss[4], uint8_t coding, uint8_t group_id, uint16_t partial_aid)
Set the VHT fields.
void WriteU8(uint8_t data)
Definition: buffer.h:868
uint16_t GetAmpduStatusFlags(void) const
Get the A-MPDU status flags.
uint16_t m_vhtKnown
VHT known field.
uint8_t GetMcsRate(void) const
Get the MCS index value.
uint8_t GetMcsFlags(void) const
Get the MCS flags.
uint8_t GetVhtCoding(void) const
Get the VHT coding field value.
uint8_t ReadU8(void)
Definition: buffer.h:1020
uint16_t m_length
entire length of radiotap data + header
uint8_t GetVhtMcsNssUser2() const
Get the VHT mcs_nss field value for user 2.
uint8_t GetVhtMcsNssUser1() const
Get the VHT mcs_nss field value for user 1.
uint8_t m_rate
TX/RX data rate in units of 500 kbps.
virtual void Serialize(Buffer::Iterator start) const
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet...
uint32_t m_ampduStatusRef
A-MPDU Status Flags, reference number.
void WriteU32(uint32_t data)
Definition: buffer.cc:878
void SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc)
Set the A-MPDU status fields.
uint16_t GetChannelFrequency(void) const
Get the transmit/receive data rate in units of 500 kbps.
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:904
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...