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  m_hePad (0),
54  m_heData1 (0),
55  m_heData2 (0),
56  m_heData3 (0),
57  m_heData5 (0)
58 {
59  NS_LOG_FUNCTION (this);
60 }
61 
63 {
64  static TypeId tid = TypeId ("ns3::RadiotapHeader")
65  .SetParent<Header> ()
66  .SetGroupName ("Network")
67 
68  .AddConstructor<RadiotapHeader> ()
69  ;
70  return tid;
71 }
72 
73 TypeId
75 {
76  return GetTypeId ();
77 }
78 
79 uint32_t
81 {
82  NS_LOG_FUNCTION (this);
83  return m_length;
84 }
85 
86 void
88 {
89  NS_LOG_FUNCTION (this << &start);
90 
91  start.WriteU8 (0); // major version of radiotap header
92  start.WriteU8 (0); // pad field
93  start.WriteU16 (m_length); // entire length of radiotap data + header
94  start.WriteU32 (m_present); // bits describing which fields follow header
95 
96  //
97  // Time Synchronization Function Timer (when the first bit of the MPDU
98  // arrived at the MAC)
99  //
100  if (m_present & RADIOTAP_TSFT) // bit 0
101  {
102  start.WriteU64 (m_tsft);
103  }
104 
105  //
106  // Properties of transmitted and received frames.
107  //
108  if (m_present & RADIOTAP_FLAGS) // bit 1
109  {
110  start.WriteU8 (m_flags);
111  }
112 
113  //
114  // TX/RX data rate in units of 500 kbps
115  //
116  if (m_present & RADIOTAP_RATE) // bit 2
117  {
118  start.WriteU8 (m_rate);
119  }
120 
121  //
122  // Tx/Rx frequency in MHz, followed by flags.
123  //
124  if (m_present & RADIOTAP_CHANNEL) // bit 3
125  {
126  start.WriteU8 (0, m_channelPad);
127  start.WriteU16 (m_channelFreq);
128  start.WriteU16 (m_channelFlags);
129  }
130 
131  //
132  // The hop set and pattern for frequency-hopping radios. We don't need it but
133  // still need to account for it.
134  //
135  if (m_present & RADIOTAP_FHSS) // bit 4
136  {
137  start.WriteU8 (0); //not yet implemented
138  }
139 
140  //
141  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
142  // reference.
143  //
144  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
145  {
146  start.WriteU8 (m_antennaSignal);
147  }
148 
149  //
150  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
151  // reference.
152  //
153  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
154  {
155  start.WriteU8 (m_antennaNoise);
156  }
157 
158  //
159  // Quality of Barker code lock.
160  //
161  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
162  {
163  start.WriteU16 (0); //not yet implemented
164  }
165 
166  //
167  // Transmit power expressed as unitless distance from max power
168  // set at factory calibration (0 is max power).
169  //
170  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
171  {
172  start.WriteU16 (0); //not yet implemented
173  }
174 
175  //
176  // Transmit power expressed as decibel distance from max power
177  // set at factory calibration (0 is max power).
178  //
179  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
180  {
181  start.WriteU16 (0); //not yet implemented
182  }
183 
184  //
185  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
186  // This is the absolute power level measured at the antenna port.
187  //
188  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
189  {
190  start.WriteU8 (0); //not yet implemented
191  }
192 
193  //
194  // Unitless indication of the Rx/Tx antenna for this packet.
195  // The first antenna is antenna 0.
196  //
197  if (m_present & RADIOTAP_ANTENNA) // bit 11
198  {
199  start.WriteU8 (0); //not yet implemented
200  }
201 
202  //
203  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
204  //
205  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
206  {
207  start.WriteU8 (0); //not yet implemented
208  }
209 
210  //
211  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
212  //
213  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
214  {
215  start.WriteU8 (0); //not yet implemented
216  }
217 
218  //
219  // Properties of received frames.
220  //
221  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
222  {
223  start.WriteU16 (0); //not yet implemented
224  }
225 
226  //
227  // MCS field.
228  //
229  if (m_present & RADIOTAP_MCS) // bit 19
230  {
231  start.WriteU8 (m_mcsKnown);
232  start.WriteU8 (m_mcsFlags);
233  start.WriteU8 (m_mcsRate);
234  }
235 
236  //
237  // A-MPDU Status, information about the received or transmitted A-MPDU.
238  //
239  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
240  {
241  start.WriteU8 (0, m_ampduStatusPad);
242  start.WriteU32 (m_ampduStatusRef);
243  start.WriteU16 (m_ampduStatusFlags);
244  start.WriteU8 (m_ampduStatusCRC);
245  start.WriteU8 (0);
246  }
247 
248  //
249  // Information about the received or transmitted VHT frame.
250  //
251  if (m_present & RADIOTAP_VHT) // bit 21
252  {
253  start.WriteU8 (0, m_vhtPad);
254  start.WriteU16 (m_vhtKnown);
255  start.WriteU8 (m_vhtFlags);
256  start.WriteU8 (m_vhtBandwidth);
257  for (uint8_t i = 0; i < 4; i++)
258  {
259  start.WriteU8 (m_vhtMcsNss[i]);
260  }
261  start.WriteU8 (m_vhtCoding);
262  start.WriteU8 (m_vhtGroupId);
263  start.WriteU16 (m_vhtPartialAid);
264  }
265 
266  //
267  // HE field.
268  //
269  if (m_present & RADIOTAP_HE) // bit 23
270  {
271  start.WriteU8 (0, m_hePad);
272  start.WriteU16 (m_heData1);
273  start.WriteU16 (m_heData2);
274  start.WriteU16 (m_heData3);
275  start.WriteU16 (0); //HE data4 field
276  start.WriteU16 (m_heData5);
277  start.WriteU16 (0); //HE data6 field
278  }
279 }
280 
281 uint32_t
283 {
284  NS_LOG_FUNCTION (this << &start);
285 
286  uint8_t tmp = start.ReadU8 (); // major version of radiotap header
287  NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version");
288  start.ReadU8 (); // pad field
289 
290  m_length = start.ReadU16 (); // entire length of radiotap data + header
291  m_present = start.ReadU32 (); // bits describing which fields follow header
292 
293  uint32_t bytesRead = 8;
294 
295  //
296  // Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
297  //
298  if (m_present & RADIOTAP_TSFT) // bit 0
299  {
300  m_tsft = start.ReadU64 ();
301  bytesRead += 8;
302  }
303 
304  //
305  // Properties of transmitted and received frames.
306  //
307  if (m_present & RADIOTAP_FLAGS) // bit 1
308  {
309  m_flags = start.ReadU8 ();
310  ++bytesRead;
311  }
312 
313  //
314  // TX/RX data rate in units of 500 kbps
315  //
316  if (m_present & RADIOTAP_RATE) // bit 2
317  {
318  m_rate = start.ReadU8 ();
319  ++bytesRead;
320  }
321 
322  //
323  // Tx/Rx frequency in MHz, followed by flags.
324  //
325  if (m_present & RADIOTAP_CHANNEL) // bit 3
326  {
327  m_channelPad = ((2 - bytesRead % 2) % 2);
328  start.Next (m_channelPad);
329  m_channelFreq = start.ReadU16 ();
330  m_channelFlags = start.ReadU16 ();
331  bytesRead += (4 + m_channelPad);
332  }
333 
334  //
335  // The hop set and pattern for frequency-hopping radios. We don't need it but
336  // still need to account for it.
337  //
338  if (m_present & RADIOTAP_FHSS) // bit 4
339  {
340  //not yet implemented
341  start.ReadU8 ();
342  ++bytesRead;
343  }
344 
345  //
346  // RF signal power at the antenna, decibel difference from an arbitrary, fixed
347  // reference.
348  //
349  if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5
350  {
351  m_antennaSignal = start.ReadU8 ();
352  ++bytesRead;
353  }
354 
355  //
356  // RF noise power at the antenna, decibel difference from an arbitrary, fixed
357  // reference.
358  //
359  if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6
360  {
361  m_antennaNoise = start.ReadU8 ();
362  ++bytesRead;
363  }
364 
365  //
366  // Quality of Barker code lock.
367  //
368  if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7
369  {
370  //not yet implemented
371  start.ReadU16 ();
372  bytesRead += 2;
373  }
374 
375  //
376  // Transmit power expressed as unitless distance from max power
377  // set at factory calibration (0 is max power).
378  //
379  if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8
380  {
381  //not yet implemented
382  start.ReadU16 ();
383  bytesRead += 2;
384  }
385 
386  //
387  // Transmit power expressed as decibel distance from max power
388  // set at factory calibration (0 is max power).
389  //
390  if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9
391  {
392  //not yet implemented
393  start.ReadU16 ();
394  bytesRead += 2;
395  }
396 
397  //
398  // Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
399  // This is the absolute power level measured at the antenna port.
400  //
401  if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10
402  {
403  //not yet implemented
404  start.ReadU8 ();
405  ++bytesRead;
406  }
407 
408  //
409  // Unitless indication of the Rx/Tx antenna for this packet.
410  // The first antenna is antenna 0.
411  //
412  if (m_present & RADIOTAP_ANTENNA) // bit 11
413  {
414  //not yet implemented
415  start.ReadU8 ();
416  ++bytesRead;
417  }
418 
419  //
420  // RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
421  //
422  if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12
423  {
424  //not yet implemented
425  start.ReadU8 ();
426  ++bytesRead;
427  }
428 
429  //
430  // RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
431  //
432  if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13
433  {
434  //not yet implemented
435  start.ReadU8 ();
436  ++bytesRead;
437  }
438 
439  //
440  // Properties of received frames.
441  //
442  if (m_present & RADIOTAP_RX_FLAGS) // bit 14
443  {
444  //not yet implemented
445  start.ReadU16 ();
446  bytesRead += 2;
447  }
448 
449  //
450  // MCS field.
451  //
452  if (m_present & RADIOTAP_MCS) // bit 19
453  {
454  m_mcsKnown = start.ReadU8 ();
455  m_mcsFlags = start.ReadU8 ();
456  m_mcsRate = start.ReadU8 ();
457  bytesRead += 3;
458  }
459 
460  //
461  // A-MPDU Status, information about the received or transmitted A-MPDU.
462  //
463  if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20
464  {
465  m_ampduStatusPad = ((4 - bytesRead % 4) % 4);
466  start.Next (m_ampduStatusPad);
467  m_ampduStatusRef = start.ReadU32 ();
468  m_ampduStatusFlags = start.ReadU16 ();
469  m_ampduStatusCRC = start.ReadU8 ();
470  start.ReadU8 ();
471  bytesRead += (8 + m_ampduStatusPad);
472  }
473 
474  //
475  // Information about the received or transmitted VHT frame.
476  //
477  if (m_present & RADIOTAP_VHT) // bit 21
478  {
479  m_vhtPad = ((2 - bytesRead % 2) % 2);
480  start.Next (m_vhtPad);
481  m_vhtKnown = start.ReadU16 ();
482  m_vhtFlags = start.ReadU8 ();
483  m_vhtBandwidth = start.ReadU8 ();
484  for (uint8_t i = 0; i < 4; i++)
485  {
486  m_vhtMcsNss[i] = start.ReadU8 ();
487  }
488  m_vhtCoding = start.ReadU8 ();
489  m_vhtGroupId = start.ReadU8 ();
490  m_vhtPartialAid = start.ReadU16 ();
491  bytesRead += (12 + m_vhtPad);
492  }
493 
494  //
495  // HE field.
496  //
497  if (m_present & RADIOTAP_HE) // bit 23
498  {
499  m_hePad = ((2 - bytesRead % 2) % 2);
500  start.Next (m_hePad);
501  m_heData1 = start.ReadU16 ();
502  m_heData2 = start.ReadU16 ();
503  m_heData3 = start.ReadU16 ();
504  start.ReadU16 (); //HE data4 field
505  m_heData5 = start.ReadU16 ();
506  start.ReadU16 (); //HE data6 field
507  bytesRead += (12 + m_hePad);
508  }
509 
510  NS_ASSERT_MSG (m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent");
511  return bytesRead;
512 }
513 
514 void
515 RadiotapHeader::Print (std::ostream &os) const
516 {
517  NS_LOG_FUNCTION (this << &os);
518  os << " tsft=" << m_tsft
519  << " flags=" << std::hex << m_flags << std::dec
520  << " rate=" << +m_rate
521  << " freq=" << m_channelFreq
522  << " chflags=" << std::hex << +m_channelFlags << std::dec
523  << " signal=" << +m_antennaSignal
524  << " noise=" << +m_antennaNoise
525  << " mcsKnown=" << m_mcsKnown
526  << " mcsFlags=" << m_mcsFlags
527  << " mcsRate=" << m_mcsRate
528  << " ampduStatusFlags=" << +m_ampduStatusFlags
529  << " vhtKnown=" << m_vhtKnown
530  << " vhtFlags=" << m_vhtFlags
531  << " vhtBandwidth=" << m_vhtBandwidth
532  << " vhtMcsNss for user 1=" << m_vhtMcsNss[0]
533  << " vhtMcsNss for user 2=" << m_vhtMcsNss[1]
534  << " vhtMcsNss for user 3=" << m_vhtMcsNss[2]
535  << " vhtMcsNss for user 4=" << m_vhtMcsNss[3]
536  << " vhtCoding=" << m_vhtCoding
537  << " vhtGroupId=" << m_vhtGroupId
538  << " vhtPartialAid=" << m_vhtPartialAid
539  << " heData1=" << m_heData1
540  << " heData2=" << m_heData2
541  << " heData3=" << m_heData3
542  << " heData5=" << m_heData5;
543 }
544 
545 void
546 RadiotapHeader::SetTsft (uint64_t value)
547 {
548  NS_LOG_FUNCTION (this << value);
549  m_tsft = value;
550 
551  if (!(m_present & RADIOTAP_TSFT))
552  {
554  m_length += 8;
555  }
556 
557  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
558 }
559 
560 void
562 {
563  NS_LOG_FUNCTION (this << +flags);
564  m_flags = flags;
565 
566  if (!(m_present & RADIOTAP_FLAGS))
567  {
569  m_length += 1;
570  }
571 
572  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
573 }
574 
575 void
577 {
578  NS_LOG_FUNCTION (this << +rate);
579  m_rate = rate;
580 
581  if (!(m_present & RADIOTAP_RATE))
582  {
584  m_length += 1;
585  }
586 
587  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
588 }
589 
590 void
591 RadiotapHeader::SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags)
592 {
593  NS_LOG_FUNCTION (this << frequency << flags);
594  m_channelFreq = frequency;
595  m_channelFlags = flags;
596 
597  if (!(m_present & RADIOTAP_CHANNEL))
598  {
599  m_channelPad = ((2 - m_length % 2) % 2);
601  m_length += (4 + m_channelPad);
602  }
603 
604  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
605 }
606 
607 void
609 {
610  NS_LOG_FUNCTION (this << signal);
611 
613  {
615  m_length += 1;
616  }
617  if (signal > 127)
618  {
619  m_antennaSignal = 127;
620  }
621  else if (signal < -128)
622  {
623  m_antennaSignal = -128;
624  }
625  else
626  {
627  m_antennaSignal = static_cast<int8_t> (floor (signal + 0.5));
628  }
629 
630  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
631 }
632 
633 void
635 {
636  NS_LOG_FUNCTION (this << noise);
637 
639  {
641  m_length += 1;
642  }
643  if (noise > 127.0)
644  {
645  m_antennaNoise = 127;
646  }
647  else if (noise < -128.0)
648  {
649  m_antennaNoise = -128;
650  }
651  else
652  {
653  m_antennaNoise = static_cast<int8_t> (floor (noise + 0.5));
654  }
655 
656  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
657 }
658 
659 void
660 RadiotapHeader::SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs)
661 {
662  NS_LOG_FUNCTION (this << known << +flags << +mcs);
663  m_mcsKnown = known;
664  m_mcsFlags = flags;
665  m_mcsRate = mcs;
666  if (!(m_present & RADIOTAP_MCS))
667  {
669  m_length += 3;
670  }
671 
672  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
673 }
674 
675 void
676 RadiotapHeader::SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc)
677 {
678  NS_LOG_FUNCTION (this << referenceNumber << flags);
679  m_ampduStatusRef = referenceNumber;
680  m_ampduStatusFlags = flags;
681  m_ampduStatusCRC = crc;
683  {
684  m_ampduStatusPad = ((4 - m_length % 4) % 4);
686  m_length += (8 + m_ampduStatusPad);
687  }
688 
689  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
690 }
691 
692 void
693 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)
694 {
695  NS_LOG_FUNCTION (this << known << flags << +mcs_nss[0] << +mcs_nss[1] << +mcs_nss[2] << +mcs_nss[3] << +coding << +group_id << +partial_aid);
696  m_vhtKnown = known;
697  m_vhtFlags = flags;
698  m_vhtBandwidth = bandwidth;
699  for (uint8_t i = 0; i < 4; i++)
700  {
701  m_vhtMcsNss[i] = mcs_nss[i];
702  }
703  m_vhtCoding = coding;
704  m_vhtGroupId = group_id;
705  m_vhtPartialAid = partial_aid;
706  if (!(m_present & RADIOTAP_VHT))
707  {
708  m_vhtPad = ((2 - m_length % 2) % 2);
710  m_length += (12 + m_vhtPad);
711  }
712 
713  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
714 }
715 
716 void
717 RadiotapHeader::SetHeFields (uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data5)
718 {
719  NS_LOG_FUNCTION (this << data1 << data2 << data3 << data5);
720  m_heData1 = data1;
721  m_heData2 = data2;
722  m_heData3 = data3;
723  m_heData5 = data5;
724  if (!(m_present & RADIOTAP_HE))
725  {
726  m_hePad = ((2 - m_length % 2) % 2);
728  m_length += 12;
729  }
730 
731  NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);
732 }
733 
734 } // namespace ns3
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.
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.
virtual uint32_t GetSerializedSize(void) const
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
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:45
Radiotap header implementation.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
uint16_t m_ampduStatusFlags
A-MPDU Status Flags, information about the received A-MPDU.
uint16_t m_heData5
HE data5 field.
def start()
Definition: core.py:1855
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...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
uint16_t m_channelFreq
Tx/Rx frequency in MHz.
uint8_t m_mcsFlags
MCS Flags, flags field.
uint8_t m_hePad
HE padding.
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...
void SetAntennaNoisePower(double noise)
Set 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.
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) ...
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.
uint8_t m_vhtBandwidth
VHT bandwidth field.
uint16_t m_channelFlags
Tx/Rx channel flags.
uint8_t m_ampduStatusPad
A-MPDU Status Flags, padding before A-MPDU Status Field.
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. ...
uint16_t m_heData2
HE data2 field.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint8_t m_flags
Properties of transmitted and received frames.
void SetMcsFields(uint8_t known, uint8_t flags, uint8_t mcs)
Set the MCS fields.
uint32_t m_present
bits describing which fields follow header
uint8_t m_vhtGroupId
VHT group_id field.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
uint16_t m_vhtPartialAid
VHT partial_aid field.
uint16_t m_vhtKnown
VHT known field.
uint16_t m_length
entire length of radiotap data + header
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...
uint8_t m_rate
TX/RX data rate in units of 500 kbps.
uint16_t m_heData3
HE data3 field.
uint16_t m_heData1
HE data1 field.
uint32_t m_ampduStatusRef
A-MPDU Status Flags, reference number.
void SetAmpduStatus(uint32_t referenceNumber, uint16_t flags, uint8_t crc)
Set the A-MPDU status fields.
void SetHeFields(uint16_t data1, uint16_t data2, uint16_t data3, uint16_t data5)
Set the HE fields.
a unique identifier for an interface.
Definition: type-id.h:58
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference...