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 #ifndef RADIOTAP_HEADER_H
23 #define RADIOTAP_HEADER_H
24 
25 #include <ns3/header.h>
26 
27 namespace ns3 {
28 
29 /**
30  * @brief Radiotap header implementation
31  *
32  * Radiotap is a de facto standard for 802.11 frame injection and reception.
33  * The radiotap header format is a mechanism to supply additional information
34  * about frames, from the driver to userspace applications such as libpcap, and
35  * from a userspace application to the driver for transmission.
36  */
37 class RadiotapHeader : public Header
38 {
39 public:
40   RadiotapHeader ();
41   /**
42    * @brief Get the type ID.
43    * @returns the object TypeId
44    */
45   static TypeId GetTypeId (void);
46   virtual TypeId GetInstanceTypeId (void) const;
47 
48   /**
49    * This method is used by Packet::AddHeader to store the header into the byte
50    * buffer of a packet.  This method returns the number of bytes which are
51    * needed to store the header data during a Serialize.
52    *
53    * @returns The expected size of the header.
54    */
55   virtual uint32_t GetSerializedSize (void) const;
56 
57   /**
58    * This method is used by Packet::AddHeader to store the header into the byte
59    * buffer of a packet.  The data written is expected to match bit-for-bit the
60    * representation of this header in a real network.
61    *
62    * @param start An iterator which points to where the header should
63    *              be written.
64    */
65   virtual void Serialize (Buffer::Iterator start) const;
66 
67   /**
68    * This method is used by Packet::RemoveHeader to re-create a header from the
69    * byte buffer of a packet.  The data read is expected to match bit-for-bit
70    * the representation of this header in real networks.
71    *
72    * @param start An iterator which points to where the header should
73    *              written.
74    * @returns The number of bytes read.
75    */
76   virtual uint32_t Deserialize (Buffer::Iterator start);
77 
78   /**
79    * This method is used by Packet::Print to print the content of the header as
80    * ascii data to a C++ output stream.  Although the header is free to format
81    * its output as it wishes, it is recommended to follow a few rules to integrate
82    * with the packet pretty printer: start with flags, small field
83    * values located between a pair of parens. Values should be separated
84    * by whitespace. Follow the parens with the important fields,
85    * separated by whitespace.
86    *
87    * eg: (field1 val1 field2 val2 field3 val3) field4 val4 field5 val5
88    *
89    * @param os The output stream
90    */
91   virtual void Print (std::ostream &os) const;
92 
93   /**
94    * @brief Set the Time Synchronization Function Timer (TSFT) value.  Valid for
95    * received frames only.
96    *
97    * @param tsft Value in microseconds of the MAC's 64-bit 802.11 Time
98    *             Synchronization Function timer when the first bit of the MPDU
99    *             arrived at the MAC.
100    */
101   void SetTsft (uint64_t tsft);
102 
103   /**
104    * @brief Frame flags.
105    */
106   enum FrameFlag
107   {
108     FRAME_FLAG_NONE           = 0x00, /**< No flags set */
109     FRAME_FLAG_CFP            = 0x01, /**< Frame sent/received during CFP */
110     FRAME_FLAG_SHORT_PREAMBLE = 0x02, /**< Frame sent/received with short preamble */
111     FRAME_FLAG_WEP            = 0x04, /**< Frame sent/received with WEP encryption */
112     FRAME_FLAG_FRAGMENTED     = 0x08, /**< Frame sent/received with fragmentation */
113     FRAME_FLAG_FCS_INCLUDED   = 0x10, /**< Frame includes FCS */
114     FRAME_FLAG_DATA_PADDING   = 0x20, /**< Frame has padding between 802.11 header and payload (to 32-bit boundary) */
115     FRAME_FLAG_BAD_FCS        = 0x40, /**< Frame failed FCS check */
116     FRAME_FLAG_SHORT_GUARD    = 0x80  /**< Frame used short guard interval (HT) */
117   };
118 
119   /**
120    * @brief Set the frame flags of the transmitted or received frame.
121    * @param flags flags to set.
122    */
123   void SetFrameFlags (uint8_t flags);
124 
125   /**
126    * @brief Set the transmit/receive channel frequency in units of megahertz
127    * @param rate the transmit/receive channel frequency in units of megahertz.
128    */
129   void SetRate (uint8_t rate);
130 
131   /**
132    * @brief Channel flags.
133    */
134   enum ChannelFlags
135   {
136     CHANNEL_FLAG_NONE          = 0x0000, /**< No flags set */
137     CHANNEL_FLAG_TURBO         = 0x0010, /**< Turbo Channel */
138     CHANNEL_FLAG_CCK           = 0x0020, /**< CCK channel */
139     CHANNEL_FLAG_OFDM          = 0x0040, /**< OFDM channel */
140     CHANNEL_FLAG_SPECTRUM_2GHZ = 0x0080, /**< 2 GHz spectrum channel */
141     CHANNEL_FLAG_SPECTRUM_5GHZ = 0x0100, /**< 5 GHz spectrum channel */
142     CHANNEL_FLAG_PASSIVE       = 0x0200, /**< Only passive scan allowed */
143     CHANNEL_FLAG_DYNAMIC       = 0x0400, /**< Dynamic CCK-OFDM channel */
144     CHANNEL_FLAG_GFSK          = 0x0800  /**< GFSK channel (FHSS PHY) */
145   };
146 
147   /**
148    * @brief Set the transmit/receive channel frequency and flags
149    * @param frequency The transmit/receive data rate in units of 500 kbps.
150    * @param flags The flags to set.
151    * @see ChannelFlags
152    */
153   void SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags);
154 
155   /**
156    * @brief Set the RF signal power at the antenna as a decibel difference
157    * from an arbitrary, fixed reference.
158    *
159    * @param signal The RF signal power at the antenna as a decibel difference
160    *               from an arbitrary, fixed reference;
161    */
162   void SetAntennaSignalPower (double signal);
163 
164   /**
165    * @brief Set the RF noise power at the antenna as a decibel difference
166    * from an arbitrary, fixed reference.
167    *
168    * @param noise The RF noise power at the antenna as a decibel difference
169    *              from an arbitrary, fixed reference.
170    */
171   void SetAntennaNoisePower (double noise);
172 
173   /**
174    * @brief MCS known bits.
175    */
176   enum McsKnown
177   {
178     MCS_KNOWN_NONE           = 0x00, /**< No flags set */
179     MCS_KNOWN_BANDWIDTH      = 0x01, /**< Bandwidth */
180     MCS_KNOWN_INDEX          = 0x02, /**< MCS index known */
181     MCS_KNOWN_GUARD_INTERVAL = 0x04, /**< Guard interval */
182     MCS_KNOWN_HT_FORMAT      = 0x08, /**< HT format */
183     MCS_KNOWN_FEC_TYPE       = 0x10, /**< FEC type */
184     MCS_KNOWN_STBC           = 0x20, /**< STBC known */
185     MCS_KNOWN_NESS           = 0x40, /**< Ness known (Number of extension spatial streams) */
186     MCS_KNOWN_NESS_BIT_1     = 0x80, /**< Ness data - bit 1 (MSB) of Number of extension spatial streams */
187   };
188 
189   /**
190    * @brief MCS flags.
191    */
192   enum McsFlags
193   {
194     MCS_FLAGS_NONE           = 0x00, /**< Default: 20 MHz, long guard interval, mixed HT format and BCC FEC type */
195     MCS_FLAGS_BANDWIDTH_40   = 0x01, /**< 40 MHz */
196     MCS_FLAGS_BANDWIDTH_20L  = 0x02, /**< 20L (20 MHz in lower half of 40 MHz channel) */
197     MCS_FLAGS_BANDWIDTH_20U  = 0x03, /**< 20U (20 MHz in upper half of 40 MHz channel) */
198     MCS_FLAGS_GUARD_INTERVAL = 0x04, /**< Short guard interval */
199     MCS_FLAGS_HT_GREENFIELD  = 0x08, /**< Greenfield HT format */
200     MCS_FLAGS_FEC_TYPE       = 0x10, /**< LDPC FEC type */
201     MCS_FLAGS_STBC_STREAMS   = 0x60, /**< STBC enabled */
202     MCS_FLAGS_NESS_BIT_0     = 0x80, /**< Ness - bit 0 (LSB) of Number of extension spatial streams */
203   };
204 
205   /**
206    * @brief Set the MCS fields
207    *
208    * @param known The kwown flags.
209    * @param flags The flags to set.
210    * @param mcs The MCS index value.
211    */
212   void SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs);
213 
214   /**
215    * @brief A-MPDU status flags.
216    */
217   enum AmpduFlags
218   {
219     A_MPDU_STATUS_NONE                = 0x00, /**< No flags set */
220     A_MPDU_STATUS_REPORT_ZERO_LENGTH  = 0x01, /**< Driver reports 0-length subframes */
221     A_MPDU_STATUS_IS_ZERO_LENGTH      = 0x02, /**< Frame is 0-length subframe (valid only if 0x0001 is set) */
222     A_MPDU_STATUS_LAST_KNOWN          = 0x04, /**< Last subframe is known (should be set for all subframes in an A-MPDU) */
223     A_MPDU_STATUS_LAST                = 0x08, /**< This frame is the last subframe */
224     A_MPDU_STATUS_DELIMITER_CRC_ERROR = 0x10, /**< Delimiter CRC error */
225     A_MPDU_STATUS_DELIMITER_CRC_KNOWN = 0x20  /**< Delimiter CRC value known: the delimiter CRC value field is valid */
226   };
227 
228   /**
229    * @brief Set the A-MPDU status fields
230    *
231    * @param referenceNumber The A-MPDU reference number to identify all subframes belonging to the same A-MPDU.
232    * @param flags The flags to set.
233    * @param crc The CRC value value.
234    */
235   void SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc);
236 
237   /**
238    * @brief VHT known bits.
239    */
240   enum VhtKnown
241   {
242     VHT_KNOWN_NONE                         = 0x0000, /**< No flags set */
243     VHT_KNOWN_STBC                         = 0x0001, /**< Space-time block coding (1 if all spatial streams of all users have STBC, 0 otherwise). */
244     VHT_KNOWN_TXOP_PS_NOT_ALLOWED          = 0x0002, /**< TXOP_PS_NOT_ALLOWED known */
245     VHT_KNOWN_GUARD_INTERVAL               = 0x0004, /**< Guard interval */
246     VHT_KNOWN_SHORT_GI_NSYM_DISAMBIGUATION = 0x0008, /**< Short GI NSYM disambiguation known */
247     VHT_KNOWN_LDPC_EXTRA_OFDM_SYMBOL       = 0x0010, /**< LDPC extra OFDM symbol known */
248     VHT_KNOWN_BEAMFORMED                   = 0x0020, /**< Beamformed known/applicable (this flag should be set to zero for MU PPDUs). */
249     VHT_KNOWN_BANDWIDTH                    = 0x0040, /**< Bandwidth known */
250     VHT_KNOWN_GROUP_ID                     = 0x0080, /**< Group ID known */
251     VHT_KNOWN_PARTIAL_AID                  = 0x0100, /**< Partial AID known/applicable */
252   };
253 
254   /**
255    * @brief VHT flags.
256    */
257   enum VhtFlags
258   {
259     VHT_FLAGS_NONE                         = 0x00, /**< No flags set */
260     VHT_FLAGS_STBC                         = 0x01, /**< Set if all spatial streams of all users have space-time block coding */
261     VHT_FLAGS_TXOP_PS_NOT_ALLOWED          = 0x02, /**< Set if STAs may not doze during TXOP (valid only for AP transmitters). */
262     VHT_FLAGS_GUARD_INTERVAL               = 0x04, /**< Short guard interval */
263     VHT_FLAGS_SHORT_GI_NSYM_DISAMBIGUATION = 0x08, /**< Set if NSYM mod 10 = 9 (valid only if short GI is used).*/
264     VHT_FLAGS_LDPC_EXTRA_OFDM_SYMBOL       = 0x10, /**< Set if one or more users are using LDPC and the encoding process resulted in extra OFDM symbol(s) */
265     VHT_FLAGS_BEAMFORMED                   = 0x20, /**< Set if beamforming is used (valid for SU PPDUs only). */
266   };
267 
268   /**
269    * @brief Set the VHT fields
270    *
271    * @param known The kwown flags.
272    * @param flags The flags to set.
273    * @param bandwidth The bandwidth value.
274    * @param mcs_nss The mcs_nss value.
275    * @param coding The coding value.
276    * @param group_id The group_id value.
277    * @param partial_aid The partial_aid value.
278    */
279   void SetVhtFields (uint16_t known, uint8_t flags,
280                      uint8_t bandwidth, uint8_t mcs_nss [4],
281                      uint8_t coding, uint8_t group_id,
282                      uint16_t partial_aid);
283 
284   /**
285    * @brief HE data1.
286    */
287   enum HeData1
288   {
289     HE_DATA1_FORMAT_EXT_SU      = 0x0001, /**< HE EXT SU PPDU format */
290     HE_DATA1_FORMAT_MU          = 0x0002, /**< HE MU PPDU format */
291     HE_DATA1_FORMAT_TRIG        = 0x0003, /**< HE TRIG PPDU format */
292     HE_DATA1_BSS_COLOR_KNOWN    = 0x0004, /**< BSS Color known */
293     HE_DATA1_BEAM_CHANGE_KNOWN  = 0x0008, /**< Beam Change known */
294     HE_DATA1_UL_DL_KNOWN        = 0x0010, /**< UL/DL known */
295     HE_DATA1_DATA_MCS_KNOWN     = 0x0020, /**< data MCS known */
296     HE_DATA1_DATA_DCM_KNOWN     = 0x0040, /**< data DCM known */
297     HE_DATA1_CODING_KNOWN       = 0x0080, /**< Coding known */
298     HE_DATA1_LDPC_XSYMSEG_KNOWN = 0x0100, /**< LDPC extra symbol segment known */
299     HE_DATA1_STBC_KNOWN         = 0x0200, /**< STBC known */
300     HE_DATA1_SPTL_REUSE_KNOWN   = 0x0400, /**< Spatial Reuse known (Spatial Reuse 1 for HE TRIG PPDU format) */
301     HE_DATA1_SPTL_REUSE2_KNOWN  = 0x0800, /**< Spatial Reuse 2 known (HE TRIG PPDU format), STA-ID known (HE MU PPDU format) */
302     HE_DATA1_SPTL_REUSE3_KNOWN  = 0x1000, /**< Spatial Reuse 3 known (HE TRIG PPDU format) */
303     HE_DATA1_SPTL_REUSE4_KNOWN  = 0x2000, /**< Spatial Reuse 4 known (HE TRIG PPDU format) */
304     HE_DATA1_BW_RU_ALLOC_KNOWN  = 0x4000, /**< data BW/RU allocation known */
305     HE_DATA1_DOPPLER_KNOWN      = 0x8000, /**< Doppler known */
306   };
307 
308   /**
309    * @brief HE data2.
310    */
311   enum HeData2
312   {
313     HE_DATA2_PRISEC_80_KNOWN    = 0x0001, /**< pri/sec 80 MHz known */
314     HE_DATA2_GI_KNOWN           = 0x0002, /**< GI known */
315     HE_DATA2_NUM_LTF_SYMS_KNOWN = 0x0004, /**< number of LTF symbols known */
316     HE_DATA2_PRE_FEC_PAD_KNOWN  = 0x0008, /**< Pre-FEC Padding Factor known */
317     HE_DATA2_TXBF_KNOWN         = 0x0010, /**< TxBF known */
318     HE_DATA2_PE_DISAMBIG_KNOWN  = 0x0020, /**< PE Disambiguity known */
319     HE_DATA2_TXOP_KNOWN         = 0x0040, /**< TXOP known */
320     HE_DATA2_MIDAMBLE_KNOWN     = 0x0080, /**< midamble periodicity known */
321     HE_DATA2_RU_OFFSET          = 0x3f00, /**< RU allocation offset */
322     HE_DATA2_RU_OFFSET_KNOWN    = 0x4000, /**< RU allocation offset known */
323     HE_DATA2_PRISEC_80_SEC      = 0x8000, /**< pri/sec 80 MHz */
324   };
325 
326   /**
327    * @brief HE data5.
328    */
329   enum HeData5
330   {
331     HE_DATA5_DATA_BW_RU_ALLOC_40MHZ  = 0x0001, /**< 40 MHz data Bandwidth */
332     HE_DATA5_DATA_BW_RU_ALLOC_80MHZ  = 0x0002, /**< 80 MHz data Bandwidth */
333     HE_DATA5_DATA_BW_RU_ALLOC_160MHZ = 0x0003, /**< 160 MHz data Bandwidth */
334     HE_DATA5_DATA_BW_RU_ALLOC_26T    = 0x0004, /**< 26-tone RU allocation */
335     HE_DATA5_DATA_BW_RU_ALLOC_52T    = 0x0005, /**< 52-tone RU allocation */
336     HE_DATA5_DATA_BW_RU_ALLOC_106T   = 0x0006, /**< 106-tone RU allocation */
337     HE_DATA5_DATA_BW_RU_ALLOC_242T   = 0x0007, /**< 242-tone RU allocation */
338     HE_DATA5_DATA_BW_RU_ALLOC_484T   = 0x0008, /**< 484-tone RU allocation */
339     HE_DATA5_DATA_BW_RU_ALLOC_996T   = 0x0009, /**< 996-tone RU allocation */
340     HE_DATA5_DATA_BW_RU_ALLOC_2x996T = 0x000a, /**< 2x996-tone RU allocation */
341     HE_DATA5_GI_1_6                  = 0x0010, /**< 1.6us GI */
342     HE_DATA5_GI_3_2                  = 0x0020, /**< 3.2us GI */
343     HE_DATA5_LTF_SYM_SIZE            = 0x00c0, /**< LTF symbol size */
344     HE_DATA5_NUM_LTF_SYMS            = 0x0700, /**< number of LTF symbols */
345     HE_DATA5_PRE_FEC_PAD             = 0x3000, /**< Pre-FEC Padding Factor */
346     HE_DATA5_TXBF                    = 0x4000, /**< TxBF */
347     HE_DATA5_PE_DISAMBIG             = 0x8000, /**< PE Disambiguity */
348   };
349 
350   /**
351    * @brief Set the HE fields
352    *
353    * @param data1 The data1 field.
354    * @param data2 The data2 field.
355    * @param data3 The data3 field.
356    * @param data4 The data4 field.
357    * @param data5 The data5 field.
358    * @param data6 The data6 field.
359    */
360   void SetHeFields (uint16_t data1,
361                     uint16_t data2,
362                     uint16_t data3,
363                     uint16_t data4,
364                     uint16_t data5,
365                     uint16_t data6);
366 
367   /**
368    * @brief HE MU flags1.
369    */
370   enum HeMuFlags1
371   {
372     HE_MU_FLAGS1_SIGB_MCS                = 0x000f, /**< SIG-B MCS (from SIG-A) */
373     HE_MU_FLAGS1_SIGB_MCS_KNOWN          = 0x0010, /**< SIG-B MCS known */
374     HE_MU_FLAGS1_SIGB_DCM                = 0x0020, /**< SIG-B DCM (from SIG-A) */
375     HE_MU_FLAGS1_SIGB_DCM_KNOWN          = 0x0040, /**< SIG-B DCM known */
376     HE_MU_FLAGS1_CH2_CENTER_26T_RU_KNOWN = 0x0080, /**< (Channel 2) Center 26-tone RU bit known */
377     HE_MU_FLAGS1_CH1_RUS_KNOWN           = 0x0100, /**< Channel 1 RUs known (which depends on BW) */
378     HE_MU_FLAGS1_CH2_RUS_KNOWN           = 0x0200, /**< Channel 2 RUs known (which depends on BW) */
379     HE_MU_FLAGS1_CH1_CENTER_26T_RU_KNOWN = 0x1000, /**< (Channel 1) Center 26-tone RU bit known */
380     HE_MU_FLAGS1_CH1_CENTER_26T_RU       = 0x2000, /**< (Channel 1) Center 26-tone RU value */
381     HE_MU_FLAGS1_SIGB_COMPRESSION_KNOWN  = 0x4000, /**< SIG-B Compression known */
382     HE_MU_FLAGS1_NUM_SIGB_SYMBOLS_KNOWN  = 0x8000, /**< # of HE-SIG-B Symbols/MU-MIMO Users known */
383   };
384 
385   /**
386    * @brief HE MU flags2.
387    */
388   enum HeMuFlags2
389   {
390     HE_MU_FLAGS2_BW_FROM_SIGA                                 = 0x0003, /**< Bandwidth from Bandwidth field in HE-SIG-A */
391     HE_MU_FLAGS2_BW_FROM_SIGA_KNOWN                           = 0x0004, /**< Bandwidth from Bandwidth field in HE-SIG-A known */
392     HE_MU_FLAGS2_SIGB_COMPRESSION_FROM_SIGA                   = 0x0008, /**< SIG-B compression from SIG-A */
393     HE_MU_FLAGS2_NUM_SIGB_SYMBOLS_FROM_SIGA                   = 0x00f0, /**< # of HE-SIG-B Symbols - 1 or # of MU-MIMO Users - 1 from SIG-A */
394     HE_MU_FLAGS2_PREAMBLE_PUNCTURING_FROM_SIGA_BW_FIELD       = 0x0300, /**< Preamble puncturing from Bandwidth field in HE-SIG-A */
395     HE_MU_FLAGS2_PREAMBLE_PUNCTURING_FROM_SIGA_BW_FIELD_KNOWN = 0x0400, /**< Preamble puncturing from Bandwidth field in HE-SIG-A known */
396     HE_MU_FLAGS2_CH2_CENTER_26T_RU                            = 0x0800, /**< (Channel 2) Center 26-tone RU value */
397   };
398 
399   /**
400    * @brief Set the HE MU fields
401    *
402    * @param flags1 The flags1 field.
403    * @param flags2 The flags2 field.
404    * @param ruChannel1 The RU_channel1 field.
405    * @param ruChannel2 The RU_channel2 field.
406    */
407   void SetHeMuFields (uint16_t flags1, uint16_t flags2, const std::array<uint8_t, 4> &ruChannel1, const std::array<uint8_t, 4> &ruChannel2);
408 
409   /**
410    * @brief HE MU per_user_known.
411    */
412   enum HeMuPerUserKnown
413   {
414     HE_MU_PER_USER_POSITION_KNOWN              = 0x01, /**< User field position known */
415     HE_MU_PER_USER_STA_ID_KNOWN                = 0x02, /**< STA-ID known */
416     HE_MU_PER_USER_NSTS_KNOWN                  = 0x04, /**< NSTS known */
417     HE_MU_PER_USER_TX_BF_KNOWN                 = 0x08, /**< Tx Beamforming known */
418     HE_MU_PER_USER_SPATIAL_CONFIGURATION_KNOWN = 0x10, /**< Spatial Configuration known */
419     HE_MU_PER_USER_MCS_KNOWN                   = 0x20, /**< MCS known */
420     HE_MU_PER_USER_DCM_KNOWN                   = 0x40, /**< DCM known */
421     HE_MU_PER_USER_CODING_KNOWN                = 0x80, /**< Coding known */
422   };
423 
424   /**
425    * @brief Set the HE MU per user fields
426    *
427    * @param perUser1 The per_user_1 field.
428    * @param perUser2 The per_user_2 field.
429    * @param perUserPosition The per_user_position field.
430    * @param perUserKnown The per_user_known field.
431    */
432   void SetHeMuPerUserFields (uint16_t perUser1, uint16_t perUser2, uint8_t perUserPosition, uint8_t perUserKnown);
433 
434 private:
435   /**
436    * @brief Radiotap flags.
437    */
438   enum RadiotapFlags
439   {
440     RADIOTAP_TSFT              = 0x00000001,
441     RADIOTAP_FLAGS             = 0x00000002,
442     RADIOTAP_RATE              = 0x00000004,
443     RADIOTAP_CHANNEL           = 0x00000008,
444     RADIOTAP_FHSS              = 0x00000010,
445     RADIOTAP_DBM_ANTSIGNAL     = 0x00000020,
446     RADIOTAP_DBM_ANTNOISE      = 0x00000040,
447     RADIOTAP_LOCK_QUALITY      = 0x00000080,
448     RADIOTAP_TX_ATTENUATION    = 0x00000100,
449     RADIOTAP_DB_TX_ATTENUATION = 0x00000200,
450     RADIOTAP_DBM_TX_POWER      = 0x00000400,
451     RADIOTAP_ANTENNA           = 0x00000800,
452     RADIOTAP_DB_ANTSIGNAL      = 0x00001000,
453     RADIOTAP_DB_ANTNOISE       = 0x00002000,
454     RADIOTAP_RX_FLAGS          = 0x00004000,
455     RADIOTAP_MCS               = 0x00080000,
456     RADIOTAP_AMPDU_STATUS      = 0x00100000,
457     RADIOTAP_VHT               = 0x00200000,
458     RADIOTAP_HE                = 0x00800000,
459     RADIOTAP_HE_MU             = 0x01000000,
460     RADIOTAP_HE_MU_OTHER_USER  = 0x02000000,
461     RADIOTAP_ZERO_LEN_PSDU     = 0x04000000,
462     RADIOTAP_LSIG              = 0x08000000,
463     RADIOTAP_EXT               = 0x80000000
464   };
465 
466   uint16_t m_length;        //!< entire length of radiotap data + header
467   uint32_t m_present;       //!< bits describing which fields follow header
468 
469   uint64_t m_tsft;          //!< Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
470   uint8_t m_flags;          //!< Properties of transmitted and received frames.
471   uint8_t m_rate;           //!< TX/RX data rate in units of 500 kbps
472   uint8_t m_channelPad;     //!< Tx/Rx channel padding.
473   uint16_t m_channelFreq;   //!< Tx/Rx frequency in MHz.
474   uint16_t m_channelFlags;  //!< Tx/Rx channel flags.
475   int8_t m_antennaSignal;   //!< RF signal power at the antenna, dB difference from an arbitrary, fixed reference.
476   int8_t m_antennaNoise;    //!< RF noise power at the antenna, dB difference from an arbitrary, fixed reference.
477 
478   uint8_t m_mcsKnown; //!< MCS Flags, known information field.
479   uint8_t m_mcsFlags; //!< MCS Flags, flags field.
480   uint8_t m_mcsRate;  //!< MCS Flags, mcs rate index.
481 
482   uint8_t m_ampduStatusPad;       //!< A-MPDU Status Flags, padding before A-MPDU Status Field.
483   uint32_t m_ampduStatusRef;      //!< A-MPDU Status Flags, reference number.
484   uint16_t m_ampduStatusFlags;    //!< A-MPDU Status Flags, information about the received A-MPDU.
485   uint8_t m_ampduStatusCRC;       //!< A-MPDU Status Flags, delimiter CRC value.
486 
487   uint8_t m_vhtPad;         //!< VHT padding.
488   uint16_t m_vhtKnown;      //!< VHT known field.
489   uint8_t m_vhtFlags;       //!< VHT flags field.
490   uint8_t m_vhtBandwidth;   //!< VHT bandwidth field.
491   uint8_t m_vhtMcsNss[4];   //!< VHT mcs_nss field.
492   uint8_t m_vhtCoding;      //!< VHT coding field.
493   uint8_t m_vhtGroupId;     //!< VHT group_id field.
494   uint16_t m_vhtPartialAid; //!< VHT partial_aid field.
495 
496   uint8_t m_hePad;         //!< HE padding.
497   uint16_t m_heData1;      //!< HE data1 field.
498   uint16_t m_heData2;      //!< HE data2 field.
499   uint16_t m_heData3;      //!< HE data3 field.
500   uint16_t m_heData4;      //!< HE data4 field.
501   uint16_t m_heData5;      //!< HE data5 field.
502   uint16_t m_heData6;      //!< HE data6 field.
503 
504   uint8_t m_heMuPad;       //!< HE MU padding.
505   uint16_t m_heMuFlags1;   //!< HE MU flags1 field.
506   uint16_t m_heMuFlags2;   //!< HE MU flags2 field.
507 
508   uint8_t m_heMuOtherUserPad;    //!< HE MU other user padding.
509   uint16_t m_heMuPerUser1;       //!< HE MU per_user_1 field.
510   uint16_t m_heMuPerUser2;       //!< HE MU per_user_2 field.
511   uint8_t m_heMuPerUserPosition; //!< HE MU per_user_position field.
512   uint8_t m_heMuPerUserKnown;    //!< HE MU per_user_known field.
513 };
514 
515 } // namespace ns3
516 
517 #endif /*  RADIOTAP_HEADER_H */
518