A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
radiotap-header.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009 CTTC
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Nicola Baldo <nbaldo@cttc.es>
7
* Sébastien Deronne <sebastien.deronne@gmail.com>
8
*/
9
10
#include "
radiotap-header.h
"
11
12
#include "ns3/log.h"
13
14
#include <bit>
15
#include <cmath>
16
#include <iomanip>
17
18
namespace
ns3
19
{
20
21
NS_LOG_COMPONENT_DEFINE
(
"RadiotapHeader"
);
22
23
NS_OBJECT_ENSURE_REGISTERED
(RadiotapHeader);
24
25
RadiotapHeader::RadiotapHeader
()
26
{
27
NS_LOG_FUNCTION
(
this
);
28
}
29
30
TypeId
31
RadiotapHeader::GetTypeId
()
32
{
33
static
TypeId
tid =
TypeId
(
"ns3::RadiotapHeader"
)
34
.
SetParent
<
Header
>()
35
.SetGroupName(
"Network"
)
36
37
.AddConstructor<
RadiotapHeader
>();
38
return
tid;
39
}
40
41
TypeId
42
RadiotapHeader::GetInstanceTypeId
()
const
43
{
44
return
GetTypeId
();
45
}
46
47
uint32_t
48
RadiotapHeader::GetSerializedSize
()
const
49
{
50
NS_LOG_FUNCTION
(
this
);
51
return
m_length
;
52
}
53
54
void
55
RadiotapHeader::Serialize
(
Buffer::Iterator
start)
const
56
{
57
NS_LOG_FUNCTION
(
this
<< &start);
58
59
start.WriteU8(0);
// major version of radiotap header
60
start.WriteU8(0);
// pad field
61
start.WriteU16(
m_length
);
// entire length of radiotap data + header
62
NS_ASSERT
(!
m_present
.empty());
63
for
(
const
auto
present :
m_present
)
64
{
65
start.WriteU32(present);
// bits describing which fields follow header
66
}
67
68
//
69
// Time Synchronization Function Timer (when the first bit of the MPDU
70
// arrived at the MAC)
71
// Reference: https://www.radiotap.org/fields/TSFT.html
72
//
73
if
(
m_present
.at(0) &
RADIOTAP_TSFT
)
// bit 0
74
{
75
SerializeTsft
(start);
76
}
77
78
//
79
// Properties of transmitted and received frames.
80
// Reference: https://www.radiotap.org/fields/Flags.html
81
//
82
if
(
m_present
.at(0) &
RADIOTAP_FLAGS
)
// bit 1
83
{
84
start.WriteU8(
m_flags
);
85
}
86
87
//
88
// TX/RX data rate in units of 500 kbps
89
// Reference: https://www.radiotap.org/fields/Rate.html
90
//
91
if
(
m_present
.at(0) &
RADIOTAP_RATE
)
// bit 2
92
{
93
start.WriteU8(
m_rate
);
94
}
95
96
//
97
// Tx/Rx frequency in MHz, followed by flags.
98
// Reference: https://www.radiotap.org/fields/Channel.html
99
//
100
if
(
m_present
.at(0) &
RADIOTAP_CHANNEL
)
// bit 3
101
{
102
SerializeChannel
(start);
103
}
104
105
//
106
// The hop set and pattern for frequency-hopping radios. We don't need it but
107
// still need to account for it.
108
// Reference: https://www.radiotap.org/fields/FHSS.html
109
//
110
if
(
m_present
.at(0) &
RADIOTAP_FHSS
)
// bit 4
111
{
112
NS_ASSERT
(
false
);
// not yet implemented
113
}
114
115
//
116
// RF signal power at the antenna, decibel difference from an arbitrary, fixed
117
// reference.
118
// Reference: https://www.radiotap.org/fields/Antenna%20signal.html
119
//
120
if
(
m_present
.at(0) &
RADIOTAP_DBM_ANTSIGNAL
)
// bit 5
121
{
122
start.WriteU8(
m_antennaSignal
);
123
}
124
125
//
126
// RF noise power at the antenna, decibel difference from an arbitrary, fixed
127
// reference.
128
// Reference: https://www.radiotap.org/fields/Antenna%20noise.html
129
//
130
if
(
m_present
.at(0) &
RADIOTAP_DBM_ANTNOISE
)
// bit 6
131
{
132
start.WriteU8(
m_antennaNoise
);
133
}
134
135
//
136
// Quality of Barker code lock.
137
// Reference: https://www.radiotap.org/fields/Lock%20quality.html
138
//
139
if
(
m_present
.at(0) &
RADIOTAP_LOCK_QUALITY
)
// bit 7
140
{
141
NS_ASSERT
(
false
);
// not yet implemented
142
}
143
144
//
145
// Transmit power expressed as unitless distance from max power
146
// set at factory calibration (0 is max power).
147
// Reference: https://www.radiotap.org/fields/TX%20attenuation.html
148
//
149
if
(
m_present
.at(0) &
RADIOTAP_TX_ATTENUATION
)
// bit 8
150
{
151
NS_ASSERT
(
false
);
// not yet implemented
152
}
153
154
//
155
// Transmit power expressed as decibel distance from max power
156
// set at factory calibration (0 is max power).
157
// Reference: https://www.radiotap.org/fields/dB%20TX%20attenuation.html
158
//
159
if
(
m_present
.at(0) &
RADIOTAP_DB_TX_ATTENUATION
)
// bit 9
160
{
161
NS_ASSERT
(
false
);
// not yet implemented
162
}
163
164
//
165
// Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
166
// This is the absolute power level measured at the antenna port.
167
// Reference: https://www.radiotap.org/fields/dBm%20TX%20power.html
168
//
169
if
(
m_present
.at(0) &
RADIOTAP_DBM_TX_POWER
)
// bit 10
170
{
171
NS_ASSERT
(
false
);
// not yet implemented
172
}
173
174
//
175
// Unitless indication of the Rx/Tx antenna for this packet.
176
// The first antenna is antenna 0.
177
// Reference: https://www.radiotap.org/fields/Antenna.html
178
//
179
if
(
m_present
.at(0) &
RADIOTAP_ANTENNA
)
// bit 11
180
{
181
NS_ASSERT
(
false
);
// not yet implemented
182
}
183
184
//
185
// RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
186
// Reference: https://www.radiotap.org/fields/dB%20antenna%20signal.html
187
//
188
if
(
m_present
.at(0) &
RADIOTAP_DB_ANTSIGNAL
)
// bit 12
189
{
190
NS_ASSERT
(
false
);
// not yet implemented
191
}
192
193
//
194
// RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
195
// Reference: https://www.radiotap.org/fields/dB%20antenna%20noise.html
196
//
197
if
(
m_present
.at(0) &
RADIOTAP_DB_ANTNOISE
)
// bit 13
198
{
199
NS_ASSERT
(
false
);
// not yet implemented
200
}
201
202
//
203
// Properties of received frames.
204
// Reference: https://www.radiotap.org/fields/RX%20flags.html
205
//
206
if
(
m_present
.at(0) &
RADIOTAP_RX_FLAGS
)
// bit 14
207
{
208
NS_ASSERT
(
false
);
// not yet implemented
209
}
210
211
//
212
// MCS field.
213
// Reference: https://www.radiotap.org/fields/MCS.html
214
//
215
if
(
m_present
.at(0) &
RADIOTAP_MCS
)
// bit 19
216
{
217
SerializeMcs
(start);
218
}
219
220
//
221
// A-MPDU Status, information about the received or transmitted A-MPDU.
222
// Reference: https://www.radiotap.org/fields/A-MPDU%20status.html
223
//
224
if
(
m_present
.at(0) &
RADIOTAP_AMPDU_STATUS
)
// bit 20
225
{
226
SerializeAmpduStatus
(start);
227
}
228
229
//
230
// Information about the received or transmitted VHT frame.
231
// Reference: https://www.radiotap.org/fields/VHT.html
232
//
233
if
(
m_present
.at(0) &
RADIOTAP_VHT
)
// bit 21
234
{
235
SerializeVht
(start);
236
}
237
238
//
239
// HE field.
240
// Reference: https://www.radiotap.org/fields/HE.html
241
//
242
if
(
m_present
.at(0) &
RADIOTAP_HE
)
// bit 23
243
{
244
SerializeHe
(start);
245
}
246
247
//
248
// HE MU field.
249
// Reference: https://www.radiotap.org/fields/HE-MU.html
250
//
251
if
(
m_present
.at(0) &
RADIOTAP_HE_MU
)
// bit 24
252
{
253
SerializeHeMu
(start);
254
}
255
256
//
257
// HE MU other user field.
258
// Reference: https://www.radiotap.org/fields/HE-MU-other-user.html
259
//
260
if
(
m_present
.at(0) &
RADIOTAP_HE_MU_OTHER_USER
)
// bit 25
261
{
262
SerializeHeMuOtherUser
(start);
263
}
264
265
//
266
// U-SIG field.
267
// Reference: https://www.radiotap.org/fields/U-SIG.html
268
//
269
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_USIG
)
// bit 33
270
{
271
SerializeUsig
(start);
272
}
273
274
//
275
// EHT field.
276
// Reference: https://www.radiotap.org/fields/EHT.html
277
//
278
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_EHT_SIG
)
// bit 34
279
{
280
SerializeEht
(start);
281
}
282
}
283
284
uint32_t
285
RadiotapHeader::Deserialize
(
Buffer::Iterator
start)
286
{
287
NS_LOG_FUNCTION
(
this
<< &start);
288
289
uint8_t tmp = start.ReadU8();
// major version of radiotap header
290
NS_ASSERT_MSG
(tmp == 0x00,
"RadiotapHeader::Deserialize(): Unexpected major version"
);
291
start.ReadU8();
// pad field
292
293
m_length
= start.ReadU16();
// entire length of radiotap data + header
294
m_present
.emplace_back(start.ReadU32());
// bits describing which fields follow header
295
uint32_t
bytesRead =
MIN_HEADER_SIZE
;
296
297
std::size_t index{0};
298
while
(
m_present
.at(index++) &
RADIOTAP_EXT
)
299
{
300
// If bit 31 of the it_present field is set, another it_present bitmask is present.
301
m_present
.emplace_back(start.ReadU32());
302
bytesRead += 4;
303
}
304
305
//
306
// Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
307
// Reference: https://www.radiotap.org/fields/TSFT.html
308
//
309
if
(
m_present
.at(0) &
RADIOTAP_TSFT
)
// bit 0
310
{
311
bytesRead +=
DeserializeTsft
(start, bytesRead);
312
}
313
314
//
315
// Properties of transmitted and received frames.
316
// Reference: https://www.radiotap.org/fields/Flags.html
317
//
318
if
(
m_present
.at(0) &
RADIOTAP_FLAGS
)
// bit 1
319
{
320
m_flags
= start.ReadU8();
321
++bytesRead;
322
}
323
324
//
325
// TX/RX data rate in units of 500 kbps
326
// Reference: https://www.radiotap.org/fields/Rate.html
327
//
328
if
(
m_present
.at(0) &
RADIOTAP_RATE
)
// bit 2
329
{
330
m_rate
= start.ReadU8();
331
++bytesRead;
332
}
333
334
//
335
// Tx/Rx frequency in MHz, followed by flags.
336
// Reference: https://www.radiotap.org/fields/Channel.html
337
//
338
if
(
m_present
.at(0) &
RADIOTAP_CHANNEL
)
// bit 3
339
{
340
bytesRead +=
DeserializeChannel
(start, bytesRead);
341
}
342
343
//
344
// The hop set and pattern for frequency-hopping radios. We don't need it but
345
// still need to account for it.
346
// Reference: https://www.radiotap.org/fields/FHSS.html
347
//
348
if
(
m_present
.at(0) &
RADIOTAP_FHSS
)
// bit 4
349
{
350
NS_ASSERT
(
false
);
// not yet implemented
351
}
352
353
//
354
// RF signal power at the antenna, decibel difference from an arbitrary, fixed
355
// reference.
356
// Reference: https://www.radiotap.org/fields/Antenna%20signal.html
357
//
358
if
(
m_present
.at(0) &
RADIOTAP_DBM_ANTSIGNAL
)
// bit 5
359
{
360
m_antennaSignal
= start.ReadU8();
361
++bytesRead;
362
}
363
364
//
365
// RF noise power at the antenna, decibel difference from an arbitrary, fixed
366
// reference.
367
// Reference: https://www.radiotap.org/fields/Antenna%20noise.html
368
//
369
if
(
m_present
.at(0) &
RADIOTAP_DBM_ANTNOISE
)
// bit 6
370
{
371
m_antennaNoise
= start.ReadU8();
372
++bytesRead;
373
}
374
375
//
376
// Quality of Barker code lock.
377
// Reference: https://www.radiotap.org/fields/Lock%20quality.html
378
//
379
if
(
m_present
.at(0) &
RADIOTAP_LOCK_QUALITY
)
// bit 7
380
{
381
NS_ASSERT
(
false
);
// not yet implemented
382
}
383
384
//
385
// Transmit power expressed as unitless distance from max power
386
// set at factory calibration (0 is max power).
387
// Reference: https://www.radiotap.org/fields/TX%20attenuation.html
388
//
389
if
(
m_present
.at(0) &
RADIOTAP_TX_ATTENUATION
)
// bit 8
390
{
391
NS_ASSERT
(
false
);
// not yet implemented
392
}
393
394
//
395
// Transmit power expressed as decibel distance from max power
396
// set at factory calibration (0 is max power).
397
// Reference: https://www.radiotap.org/fields/dB%20TX%20attenuation.html
398
//
399
if
(
m_present
.at(0) &
RADIOTAP_DB_TX_ATTENUATION
)
// bit 9
400
{
401
NS_ASSERT
(
false
);
// not yet implemented
402
}
403
404
//
405
// Transmit power expressed as dBm (decibels from a 1 milliwatt reference).
406
// This is the absolute power level measured at the antenna port.
407
// Reference: https://www.radiotap.org/fields/dBm%20TX%20power.html
408
//
409
if
(
m_present
.at(0) &
RADIOTAP_DBM_TX_POWER
)
// bit 10
410
{
411
NS_ASSERT
(
false
);
// not yet implemented
412
}
413
414
//
415
// Unitless indication of the Rx/Tx antenna for this packet.
416
// The first antenna is antenna 0.
417
// Reference: https://www.radiotap.org/fields/Antenna.html
418
//
419
if
(
m_present
.at(0) &
RADIOTAP_ANTENNA
)
// bit 11
420
{
421
NS_ASSERT
(
false
);
// not yet implemented
422
}
423
424
//
425
// RF signal power at the antenna (decibel difference from an arbitrary fixed reference).
426
// Reference: https://www.radiotap.org/fields/dB%20antenna%20signal.html
427
//
428
if
(
m_present
.at(0) &
RADIOTAP_DB_ANTSIGNAL
)
// bit 12
429
{
430
NS_ASSERT
(
false
);
// not yet implemented
431
}
432
433
//
434
// RF noise power at the antenna (decibel difference from an arbitrary fixed reference).
435
// Reference: https://www.radiotap.org/fields/dB%20antenna%20noise.html
436
//
437
if
(
m_present
.at(0) &
RADIOTAP_DB_ANTNOISE
)
// bit 13
438
{
439
NS_ASSERT
(
false
);
// not yet implemented
440
}
441
442
//
443
// Properties of received frames.
444
// Reference: https://www.radiotap.org/fields/RX%20flags.html
445
//
446
if
(
m_present
.at(0) &
RADIOTAP_RX_FLAGS
)
// bit 14
447
{
448
NS_ASSERT
(
false
);
// not yet implemented
449
}
450
451
//
452
// MCS field.
453
// Reference: https://www.radiotap.org/fields/MCS.html
454
//
455
if
(
m_present
.at(0) &
RADIOTAP_MCS
)
// bit 19
456
{
457
bytesRead +=
DeserializeMcs
(start, bytesRead);
458
}
459
460
//
461
// A-MPDU Status, information about the received or transmitted A-MPDU.
462
// Reference: https://www.radiotap.org/fields/A-MPDU%20status.html
463
//
464
if
(
m_present
.at(0) &
RADIOTAP_AMPDU_STATUS
)
465
{
466
bytesRead +=
DeserializeAmpduStatus
(start, bytesRead);
467
}
468
469
//
470
// Information about the received or transmitted VHT frame.
471
// Reference: https://www.radiotap.org/fields/VHT.html
472
//
473
if
(
m_present
.at(0) &
RADIOTAP_VHT
)
// bit 21
474
{
475
bytesRead +=
DeserializeVht
(start, bytesRead);
476
}
477
478
//
479
// HE field.
480
// Reference: https://www.radiotap.org/fields/HE.html
481
//
482
if
(
m_present
.at(0) &
RADIOTAP_HE
)
// bit 23
483
{
484
bytesRead +=
DeserializeHe
(start, bytesRead);
485
}
486
487
//
488
// HE MU field.
489
// Reference: https://www.radiotap.org/fields/HE-MU.html
490
//
491
if
(
m_present
.at(0) &
RADIOTAP_HE_MU
)
// bit 24
492
{
493
bytesRead +=
DeserializeHeMu
(start, bytesRead);
494
}
495
496
//
497
// HE MU other user field.
498
// Reference: https://www.radiotap.org/fields/HE-MU-other-user.html
499
//
500
if
(
m_present
.at(0) &
RADIOTAP_HE_MU_OTHER_USER
)
// bit 25
501
{
502
bytesRead +=
DeserializeHeMuOtherUser
(start, bytesRead);
503
}
504
505
//
506
// U-SIG field.
507
// Reference: https://www.radiotap.org/fields/U-SIG.html
508
//
509
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_USIG
)
// bit 33
510
{
511
bytesRead +=
DeserializeUsig
(start, bytesRead);
512
}
513
514
//
515
// EHT field.
516
// Reference: https://www.radiotap.org/fields/EHT.html
517
//
518
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_EHT_SIG
)
// bit 34
519
{
520
bytesRead +=
DeserializeEht
(start, bytesRead);
521
}
522
523
NS_ASSERT_MSG
(
m_length
== bytesRead,
524
"RadiotapHeader::Deserialize(): expected and actual lengths inconsistent"
);
525
return
bytesRead;
526
}
527
528
void
529
RadiotapHeader::Print
(std::ostream& os)
const
530
{
531
NS_LOG_FUNCTION
(
this
<< &os);
532
os <<
" tsft="
<<
m_tsft
<<
" flags="
<< std::hex <<
m_flags
<< std::dec <<
" rate="
<< +
m_rate
;
533
if
(
m_present
.at(0) &
RADIOTAP_CHANNEL
)
534
{
535
PrintChannel
(os);
536
}
537
os << std::dec <<
" signal="
<< +
m_antennaSignal
<<
" noise="
<< +
m_antennaNoise
;
538
if
(
m_present
.at(0) &
RADIOTAP_MCS
)
539
{
540
PrintMcs
(os);
541
}
542
if
(
m_present
.at(0) &
RADIOTAP_AMPDU_STATUS
)
543
{
544
PrintAmpduStatus
(os);
545
}
546
if
(
m_present
.at(0) &
RADIOTAP_VHT
)
547
{
548
PrintVht
(os);
549
}
550
if
(
m_present
.at(0) &
RADIOTAP_HE
)
551
{
552
PrintHe
(os);
553
}
554
if
(
m_present
.at(0) &
RADIOTAP_HE_MU
)
555
{
556
PrintHeMu
(os);
557
}
558
if
(
m_present
.at(0) &
RADIOTAP_HE_MU_OTHER_USER
)
559
{
560
PrintHeMuOtherUser
(os);
561
}
562
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_USIG
)
563
{
564
PrintUsig
(os);
565
}
566
if
((
m_present
.size() > 1) &&
m_present
.at(1) &
RADIOTAP_EHT_SIG
)
567
{
568
PrintEht
(os);
569
}
570
}
571
572
void
573
RadiotapHeader::SetWifiHeader
(std::size_t numPresentWords)
574
{
575
NS_LOG_FUNCTION
(
this
<< numPresentWords);
576
NS_ASSERT_MSG
(numPresentWords > 0,
577
"RadiotapHeader::SetWifiHeader() requires at least one it_present word"
);
578
NS_ASSERT_MSG
(
m_length
==
MIN_HEADER_SIZE
,
579
"RadiotapHeader::SetWifiHeader() should be called before any other Set* method"
);
580
NS_ASSERT_MSG
(
m_present
.size() == 1,
"RadiotapHeader::SetWifiHeader() should be called once"
);
581
for
(std::size_t i = 0; i < (numPresentWords - 1); ++i)
582
{
583
m_present
.at(i) |=
RADIOTAP_EXT
;
584
m_present
.emplace_back(0);
585
m_length
+=
sizeof
(
RadiotapExtFlags
);
586
}
587
}
588
589
void
590
RadiotapHeader::SetTsft
(uint64_t value)
591
{
592
NS_LOG_FUNCTION
(
this
<< value);
593
594
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_TSFT
),
"TSFT radiotap field already present"
);
595
m_tsftPad
= ((8 -
m_length
% 8) % 8);
596
m_present
.at(0) |=
RADIOTAP_TSFT
;
597
m_length
+= 8 +
m_tsftPad
;
598
m_tsft
= value;
599
600
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
601
<< std::dec);
602
}
603
604
void
605
RadiotapHeader::SerializeTsft
(
Buffer::Iterator
& start)
const
606
{
607
start.WriteU8(0,
m_tsftPad
);
608
start.WriteU64(
m_tsft
);
609
}
610
611
uint32_t
612
RadiotapHeader::DeserializeTsft
(
Buffer::Iterator
start,
uint32_t
bytesRead)
613
{
614
m_tsftPad
= ((8 - bytesRead % 8) % 8);
615
start.Next(
m_tsftPad
);
616
m_tsft
= start.ReadU64();
617
return
sizeof
(
m_tsft
) +
m_tsftPad
;
618
}
619
620
void
621
RadiotapHeader::SetFrameFlags
(uint8_t flags)
622
{
623
NS_LOG_FUNCTION
(
this
<< +flags);
624
625
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_FLAGS
),
"Flags radiotap field already present"
);
626
m_present
.at(0) |=
RADIOTAP_FLAGS
;
627
m_length
+= 1;
628
m_flags
= flags;
629
630
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
631
<< std::dec);
632
}
633
634
void
635
RadiotapHeader::SetRate
(uint8_t rate)
636
{
637
NS_LOG_FUNCTION
(
this
<< +rate);
638
639
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_RATE
),
"Rate radiotap field already present"
);
640
m_present
.at(0) |=
RADIOTAP_RATE
;
641
m_length
+= 1;
642
m_rate
= rate;
643
644
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
645
<< std::dec);
646
}
647
648
void
649
RadiotapHeader::SetChannelFields
(
const
ChannelFields
& channelFields)
650
{
651
NS_LOG_FUNCTION
(
this
<< channelFields.
frequency
<< channelFields.
flags
);
652
653
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_CHANNEL
),
"Channel radiotap field already present"
);
654
m_channelPad
= ((2 -
m_length
% 2) % 2);
655
m_present
.at(0) |=
RADIOTAP_CHANNEL
;
656
m_length
+= (
sizeof
(
ChannelFields
) +
m_channelPad
);
657
m_channelFields
= channelFields;
658
659
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
660
<< std::dec);
661
}
662
663
void
664
RadiotapHeader::SerializeChannel
(
Buffer::Iterator
& start)
const
665
{
666
start.WriteU8(0,
m_channelPad
);
667
start.WriteU16(
m_channelFields
.
frequency
);
668
start.WriteU16(
m_channelFields
.
flags
);
669
}
670
671
uint32_t
672
RadiotapHeader::DeserializeChannel
(
Buffer::Iterator
start,
uint32_t
bytesRead)
673
{
674
m_channelPad
= ((2 - bytesRead % 2) % 2);
675
start.Next(
m_channelPad
);
676
m_channelFields
.
frequency
= start.ReadU16();
677
m_channelFields
.
flags
= start.ReadU16();
678
return
sizeof
(
ChannelFields
) +
m_channelPad
;
679
}
680
681
void
682
RadiotapHeader::PrintChannel
(std::ostream& os)
const
683
{
684
os <<
" channel.frequency="
<<
m_channelFields
.
frequency
<<
" channel.flags=0x"
<< std::hex
685
<<
m_channelFields
.
flags
<< std::dec;
686
}
687
688
void
689
RadiotapHeader::SetAntennaSignalPower
(
double
signal)
690
{
691
NS_LOG_FUNCTION
(
this
<< signal);
692
693
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_DBM_ANTSIGNAL
),
694
"Antenna signal radiotap field already present"
);
695
m_present
.at(0) |=
RADIOTAP_DBM_ANTSIGNAL
;
696
m_length
+= 1;
697
698
if
(signal > 127)
699
{
700
m_antennaSignal
= 127;
701
}
702
else
if
(signal < -128)
703
{
704
m_antennaSignal
= -128;
705
}
706
else
707
{
708
m_antennaSignal
=
static_cast<
int8_t
>
(floor(signal + 0.5));
709
}
710
711
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
712
<< std::dec);
713
}
714
715
void
716
RadiotapHeader::SetAntennaNoisePower
(
double
noise)
717
{
718
NS_LOG_FUNCTION
(
this
<< noise);
719
720
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_DBM_ANTNOISE
),
721
"Antenna noise radiotap field already present"
);
722
m_present
.at(0) |=
RADIOTAP_DBM_ANTNOISE
;
723
m_length
+= 1;
724
725
if
(noise > 127.0)
726
{
727
m_antennaNoise
= 127;
728
}
729
else
if
(noise < -128.0)
730
{
731
m_antennaNoise
= -128;
732
}
733
else
734
{
735
m_antennaNoise
=
static_cast<
int8_t
>
(floor(noise + 0.5));
736
}
737
738
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
739
<< std::dec);
740
}
741
742
void
743
RadiotapHeader::SetMcsFields
(
const
McsFields
& mcsFields)
744
{
745
NS_LOG_FUNCTION
(
this
<< +mcsFields.
known
<< +mcsFields.
flags
<< +mcsFields.
mcs
);
746
747
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_MCS
),
"MCS radiotap field already present"
);
748
m_present
.at(0) |=
RADIOTAP_MCS
;
749
m_length
+=
sizeof
(
McsFields
);
750
m_mcsFields
= mcsFields;
751
752
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
753
<< std::dec);
754
}
755
756
void
757
RadiotapHeader::SerializeMcs
(
Buffer::Iterator
& start)
const
758
{
759
start.WriteU8(
m_mcsFields
.
known
);
760
start.WriteU8(
m_mcsFields
.
flags
);
761
start.WriteU8(
m_mcsFields
.
mcs
);
762
}
763
764
uint32_t
765
RadiotapHeader::DeserializeMcs
(
Buffer::Iterator
start,
uint32_t
bytesRead)
766
{
767
m_mcsFields
.
known
= start.ReadU8();
768
m_mcsFields
.
flags
= start.ReadU8();
769
m_mcsFields
.
mcs
= start.ReadU8();
770
return
sizeof
(
McsFields
);
771
}
772
773
void
774
RadiotapHeader::PrintMcs
(std::ostream& os)
const
775
{
776
os <<
" mcs.known=0x"
<< std::hex << +
m_mcsFields
.
known
<<
" mcs.flags0x="
<< +
m_mcsFields
.
flags
777
<<
" mcsRate="
<< std::dec << +
m_mcsFields
.
mcs
;
778
}
779
780
void
781
RadiotapHeader::SetAmpduStatus
(
const
AmpduStatusFields
& ampduStatusFields)
782
{
783
NS_LOG_FUNCTION
(
this
<< ampduStatusFields.
referenceNumber
<< ampduStatusFields.
flags
);
784
785
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_AMPDU_STATUS
),
786
"A-MPDU status radiotap field already present"
);
787
m_ampduStatusPad
= ((4 -
m_length
% 4) % 4);
788
m_present
.at(0) |=
RADIOTAP_AMPDU_STATUS
;
789
m_length
+= (
sizeof
(ampduStatusFields) +
m_ampduStatusPad
);
790
m_ampduStatusFields
= ampduStatusFields;
791
792
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
793
<< std::dec);
794
}
795
796
void
797
RadiotapHeader::SerializeAmpduStatus
(
Buffer::Iterator
& start)
const
798
{
799
start.WriteU8(0,
m_ampduStatusPad
);
800
start.WriteU32(
m_ampduStatusFields
.
referenceNumber
);
801
start.WriteU16(
m_ampduStatusFields
.
flags
);
802
start.WriteU8(
m_ampduStatusFields
.
crc
);
803
start.WriteU8(
m_ampduStatusFields
.
reserved
);
804
}
805
806
uint32_t
807
RadiotapHeader::DeserializeAmpduStatus
(
Buffer::Iterator
start,
uint32_t
bytesRead)
808
{
809
m_ampduStatusPad
= ((4 - bytesRead % 4) % 4);
810
start.Next(
m_ampduStatusPad
);
811
m_ampduStatusFields
.
referenceNumber
= start.ReadU32();
812
m_ampduStatusFields
.
flags
= start.ReadU16();
813
m_ampduStatusFields
.
crc
= start.ReadU8();
814
m_ampduStatusFields
.
reserved
= start.ReadU8();
815
return
sizeof
(
AmpduStatusFields
) +
m_ampduStatusPad
;
816
}
817
818
void
819
RadiotapHeader::PrintAmpduStatus
(std::ostream& os)
const
820
{
821
os <<
" ampduStatus.flags=0x"
<< std::hex <<
m_ampduStatusFields
.
flags
<< std::dec;
822
}
823
824
void
825
RadiotapHeader::SetVhtFields
(
const
VhtFields
& vhtFields)
826
{
827
NS_LOG_FUNCTION
(
this
<< vhtFields.
known
<< vhtFields.
flags
<< +vhtFields.
mcsNss
.at(0)
828
<< +vhtFields.
mcsNss
.at(1) << +vhtFields.
mcsNss
.at(2)
829
<< +vhtFields.
mcsNss
.at(3) << +vhtFields.
coding
<< +vhtFields.
groupId
830
<< +vhtFields.
partialAid
);
831
832
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_VHT
),
"VHT radiotap field already present"
);
833
m_vhtPad
= ((2 -
m_length
% 2) % 2);
834
m_present
.at(0) |=
RADIOTAP_VHT
;
835
m_length
+= (
sizeof
(
VhtFields
) +
m_vhtPad
);
836
m_vhtFields
= vhtFields;
837
838
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
839
<< std::dec);
840
}
841
842
void
843
RadiotapHeader::SerializeVht
(
Buffer::Iterator
& start)
const
844
{
845
start.WriteU8(0,
m_vhtPad
);
846
start.WriteU16(
m_vhtFields
.
known
);
847
start.WriteU8(
m_vhtFields
.
flags
);
848
start.WriteU8(
m_vhtFields
.
bandwidth
);
849
for
(
const
auto
mcsNss :
m_vhtFields
.
mcsNss
)
850
{
851
start.WriteU8(mcsNss);
852
}
853
start.WriteU8(
m_vhtFields
.
coding
);
854
start.WriteU8(
m_vhtFields
.
groupId
);
855
start.WriteU16(
m_vhtFields
.
partialAid
);
856
}
857
858
uint32_t
859
RadiotapHeader::DeserializeVht
(
Buffer::Iterator
start,
uint32_t
bytesRead)
860
{
861
m_vhtPad
= ((2 - bytesRead % 2) % 2);
862
start.Next(
m_vhtPad
);
863
m_vhtFields
.
known
= start.ReadU16();
864
m_vhtFields
.
flags
= start.ReadU8();
865
m_vhtFields
.
bandwidth
= start.ReadU8();
866
for
(
auto
& mcsNss :
m_vhtFields
.
mcsNss
)
867
{
868
mcsNss = start.ReadU8();
869
}
870
m_vhtFields
.
coding
= start.ReadU8();
871
m_vhtFields
.
groupId
= start.ReadU8();
872
m_vhtFields
.
partialAid
= start.ReadU16();
873
return
sizeof
(
VhtFields
) +
m_vhtPad
;
874
}
875
876
void
877
RadiotapHeader::PrintVht
(std::ostream& os)
const
878
{
879
os <<
" vht.known=0x"
<<
m_vhtFields
.
known
<<
" vht.flags=0x"
<<
m_vhtFields
.
flags
880
<<
" vht.bandwidth="
<< std::dec <<
m_vhtFields
.
bandwidth
881
<<
" vht.mcsNss[0]="
<< +
m_vhtFields
.
mcsNss
.at(0)
882
<<
" vht.mcsNss[1]="
<< +
m_vhtFields
.
mcsNss
.at(1)
883
<<
" vht.mcsNss[2]="
<< +
m_vhtFields
.
mcsNss
.at(2)
884
<<
" vht.mcsNss[3]="
<< +
m_vhtFields
.
mcsNss
.at(3) <<
" vht.coding="
<<
m_vhtFields
.
coding
885
<<
" vht.groupId="
<<
m_vhtFields
.
groupId
<<
" vht.partialAid="
<<
m_vhtFields
.
partialAid
;
886
}
887
888
void
889
RadiotapHeader::SetHeFields
(
const
HeFields
& heFields)
890
{
891
NS_LOG_FUNCTION
(
this
<< heFields.
data1
<< heFields.
data2
<< heFields.
data3
<< heFields.
data4
892
<< heFields.
data5
<< heFields.
data6
);
893
894
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_HE
),
"HE radiotap field already present"
);
895
m_hePad
= ((2 -
m_length
% 2) % 2);
896
m_present
.at(0) |=
RADIOTAP_HE
;
897
m_length
+= (
sizeof
(heFields) +
m_hePad
);
898
m_heFields
= heFields;
899
900
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
901
<< std::dec);
902
}
903
904
void
905
RadiotapHeader::SerializeHe
(
Buffer::Iterator
& start)
const
906
{
907
start.WriteU8(0,
m_hePad
);
908
start.WriteU16(
m_heFields
.
data1
);
909
start.WriteU16(
m_heFields
.
data2
);
910
start.WriteU16(
m_heFields
.
data3
);
911
start.WriteU16(
m_heFields
.
data4
);
912
start.WriteU16(
m_heFields
.
data5
);
913
start.WriteU16(
m_heFields
.
data6
);
914
}
915
916
uint32_t
917
RadiotapHeader::DeserializeHe
(
Buffer::Iterator
start,
uint32_t
bytesRead)
918
{
919
m_hePad
= ((2 - bytesRead % 2) % 2);
920
start.Next(
m_hePad
);
921
m_heFields
.
data1
= start.ReadU16();
922
m_heFields
.
data2
= start.ReadU16();
923
m_heFields
.
data3
= start.ReadU16();
924
m_heFields
.
data4
= start.ReadU16();
925
m_heFields
.
data5
= start.ReadU16();
926
m_heFields
.
data6
= start.ReadU16();
927
return
sizeof
(
HeFields
) +
m_hePad
;
928
}
929
930
void
931
RadiotapHeader::PrintHe
(std::ostream& os)
const
932
{
933
os <<
" he.data1=0x"
<< std::hex <<
m_heFields
.
data1
<<
" he.data2=0x"
<< std::hex
934
<<
m_heFields
.
data2
<<
" he.data3=0x"
<< std::hex <<
m_heFields
.
data3
<<
" he.data4=0x"
935
<< std::hex <<
m_heFields
.
data4
<<
" he.data5=0x"
<< std::hex <<
m_heFields
.
data5
936
<<
" he.data6=0x"
<< std::hex <<
m_heFields
.
data6
<< std::dec;
937
}
938
939
void
940
RadiotapHeader::SetHeMuFields
(
const
HeMuFields
& heMuFields)
941
{
942
NS_LOG_FUNCTION
(
this
<< heMuFields.
flags1
<< heMuFields.
flags2
);
943
944
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_HE_MU
),
"HE-MU radiotap field already present"
);
945
m_heMuPad
= ((2 -
m_length
% 2) % 2);
946
m_present
.at(0) |=
RADIOTAP_HE_MU
;
947
m_length
+= (
sizeof
(heMuFields) +
m_heMuPad
);
948
m_heMuFields
= heMuFields;
949
950
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
951
<< std::dec);
952
}
953
954
void
955
RadiotapHeader::SerializeHeMu
(
Buffer::Iterator
& start)
const
956
{
957
start.WriteU8(0,
m_heMuPad
);
958
start.WriteU16(
m_heMuFields
.
flags1
);
959
start.WriteU16(
m_heMuFields
.
flags2
);
960
for
(
const
auto
ruChannel :
m_heMuFields
.
ruChannel1
)
961
{
962
start.WriteU8(ruChannel);
963
}
964
for
(
const
auto
ruChannel :
m_heMuFields
.
ruChannel2
)
965
{
966
start.WriteU8(ruChannel);
967
}
968
}
969
970
uint32_t
971
RadiotapHeader::DeserializeHeMu
(
Buffer::Iterator
start,
uint32_t
bytesRead)
972
{
973
m_heMuPad
= ((2 - bytesRead % 2) % 2);
974
start.Next(
m_heMuPad
);
975
m_heMuFields
.
flags1
= start.ReadU16();
976
m_heMuFields
.
flags2
= start.ReadU16();
977
for
(
auto
& ruChannel :
m_heMuFields
.
ruChannel1
)
978
{
979
ruChannel = start.ReadU8();
980
}
981
for
(
auto
& ruChannel :
m_heMuFields
.
ruChannel2
)
982
{
983
ruChannel = start.ReadU8();
984
}
985
return
sizeof
(
HeMuFields
) +
m_heMuPad
;
986
}
987
988
void
989
RadiotapHeader::PrintHeMu
(std::ostream& os)
const
990
{
991
os <<
" heMu.flags1=0x"
<< std::hex <<
m_heMuFields
.
flags1
<<
" heMu.flags2=0x"
992
<<
m_heMuFields
.
flags2
<< std::dec;
993
}
994
995
void
996
RadiotapHeader::SetHeMuOtherUserFields
(
const
HeMuOtherUserFields
& heMuOtherUserFields)
997
{
998
NS_LOG_FUNCTION
(
this
<< heMuOtherUserFields.
perUser1
<< heMuOtherUserFields.
perUser2
999
<< +heMuOtherUserFields.
perUserPosition
1000
<< +heMuOtherUserFields.
perUserKnown
);
1001
1002
NS_ASSERT_MSG
(!(
m_present
.at(0) &
RADIOTAP_HE_MU_OTHER_USER
),
1003
"HE-MU-other-user radiotap field already present"
);
1004
m_heMuOtherUserPad
= ((2 -
m_length
% 2) % 2);
1005
m_present
.at(0) |=
RADIOTAP_HE_MU_OTHER_USER
;
1006
m_length
+= (
sizeof
(
HeMuOtherUserFields
) +
m_heMuOtherUserPad
);
1007
m_heMuOtherUserFields
= heMuOtherUserFields;
1008
1009
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present=0x"
<< std::hex <<
m_present
.at(0)
1010
<< std::dec);
1011
}
1012
1013
void
1014
RadiotapHeader::SerializeHeMuOtherUser
(
Buffer::Iterator
& start)
const
1015
{
1016
start.WriteU8(0,
m_heMuOtherUserPad
);
1017
start.WriteU16(
m_heMuOtherUserFields
.
perUser1
);
1018
start.WriteU16(
m_heMuOtherUserFields
.
perUser2
);
1019
start.WriteU8(
m_heMuOtherUserFields
.
perUserPosition
);
1020
start.WriteU8(
m_heMuOtherUserFields
.
perUserKnown
);
1021
}
1022
1023
uint32_t
1024
RadiotapHeader::DeserializeHeMuOtherUser
(
Buffer::Iterator
start,
uint32_t
bytesRead)
1025
{
1026
m_heMuOtherUserPad
= ((2 - bytesRead % 2) % 2);
1027
start.Next(
m_heMuOtherUserPad
);
1028
m_heMuOtherUserFields
.
perUser1
= start.ReadU16();
1029
m_heMuOtherUserFields
.
perUser2
= start.ReadU16();
1030
m_heMuOtherUserFields
.
perUserPosition
= start.ReadU8();
1031
m_heMuOtherUserFields
.
perUserKnown
= start.ReadU8();
1032
return
sizeof
(
HeMuOtherUserFields
) +
m_heMuOtherUserPad
;
1033
}
1034
1035
void
1036
RadiotapHeader::PrintHeMuOtherUser
(std::ostream& os)
const
1037
{
1038
os <<
" heMuOtherUser.perUser1="
<<
m_heMuOtherUserFields
.
perUser1
1039
<<
" heMuOtherUser.perUser2="
<<
m_heMuOtherUserFields
.
perUser2
1040
<<
" heMuOtherUser.perUserPosition="
<<
m_heMuOtherUserFields
.
perUserPosition
1041
<<
" heMuOtherUser.perUserKnown=0x"
<< std::hex <<
m_heMuOtherUserFields
.
perUserKnown
1042
<< std::dec;
1043
}
1044
1045
void
1046
RadiotapHeader::SetUsigFields
(
const
UsigFields
& usigFields)
1047
{
1048
NS_LOG_FUNCTION
(
this
<< usigFields.
common
<< usigFields.
mask
<< usigFields.
value
);
1049
NS_ASSERT_MSG
(
m_present
.size() >= 2,
1050
"Number of it_present words ("
<<
m_present
.size() <<
") is incorrect"
);
1051
m_present
.at(0) |=
RADIOTAP_TLV
;
1052
1053
NS_ASSERT_MSG
(!(
m_present
.at(1) &
RADIOTAP_USIG
),
"U-SIG radiotap field already present"
);
1054
m_present
.at(1) |=
RADIOTAP_USIG
;
1055
1056
m_usigTlvPad
= ((8 -
m_length
% 8) % 8);
1057
m_usigTlv
.
type
= 32 + std::countr_zero<uint16_t>(
RADIOTAP_USIG
);
1058
m_usigTlv
.
length
=
sizeof
(
UsigFields
);
1059
m_length
+=
sizeof
(
TlvFields
) +
m_usigTlvPad
;
1060
1061
m_usigPad
= ((4 -
m_length
% 4) % 4);
1062
m_usigFields
= usigFields;
1063
m_length
+=
m_usigTlv
.
length
+
m_usigPad
;
1064
1065
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present[0]=0x"
<< std::hex
1066
<<
m_present
.at(0) <<
" m_present[1]=0x"
<<
m_present
.at(1) << std::dec);
1067
}
1068
1069
void
1070
RadiotapHeader::SerializeUsig
(
Buffer::Iterator
& start)
const
1071
{
1072
start.WriteU8(0,
m_usigTlvPad
);
1073
start.WriteU16(
m_usigTlv
.
type
);
1074
start.WriteU16(
m_usigTlv
.
length
);
1075
start.WriteU8(0,
m_usigPad
);
1076
start.WriteU32(
m_usigFields
.
common
);
1077
start.WriteU32(
m_usigFields
.
value
);
1078
start.WriteU32(
m_usigFields
.
mask
);
1079
}
1080
1081
uint32_t
1082
RadiotapHeader::DeserializeUsig
(
Buffer::Iterator
start,
uint32_t
bytesRead)
1083
{
1084
const
auto
startBytesRead = bytesRead;
1085
m_usigTlvPad
= ((8 - bytesRead % 8) % 8);
1086
start.Next(
m_usigTlvPad
);
1087
bytesRead +=
m_usigTlvPad
;
1088
m_usigTlv
.
type
= start.ReadU16();
1089
m_usigTlv
.
length
= start.ReadU16();
1090
bytesRead +=
sizeof
(
TlvFields
);
1091
m_usigPad
= ((4 - bytesRead % 4) % 4);
1092
start.Next(
m_usigPad
);
1093
bytesRead +=
m_usigPad
;
1094
m_usigFields
.
common
= start.ReadU32();
1095
m_usigFields
.
value
= start.ReadU32();
1096
m_usigFields
.
mask
= start.ReadU32();
1097
bytesRead +=
sizeof
(
UsigFields
);
1098
return
bytesRead - startBytesRead;
1099
}
1100
1101
void
1102
RadiotapHeader::PrintUsig
(std::ostream& os)
const
1103
{
1104
os <<
" usig.common=0x"
<< std::hex <<
m_usigFields
.
common
<<
" usig.value=0x"
1105
<<
m_usigFields
.
value
<<
" usig.mask=0x"
<<
m_usigFields
.
mask
<< std::dec;
1106
}
1107
1108
void
1109
RadiotapHeader::SetEhtFields
(
const
EhtFields
& ehtFields)
1110
{
1111
NS_LOG_FUNCTION
(
this
<< ehtFields.
known
);
1112
NS_ASSERT_MSG
(
m_present
.size() >= 2,
1113
"Number of it_present words ("
<<
m_present
.size() <<
") is incorrect"
);
1114
m_present
.at(0) |=
RADIOTAP_TLV
;
1115
1116
NS_ASSERT_MSG
(!(
m_present
.at(1) &
RADIOTAP_EHT_SIG
),
"EHT radiotap field already present"
);
1117
m_present
.at(1) |=
RADIOTAP_EHT_SIG
;
1118
1119
m_ehtTlvPad
= ((8 -
m_length
% 8) % 8);
1120
m_ehtTlv
.
type
= 32 + std::countr_zero<uint16_t>(
RADIOTAP_EHT_SIG
);
1121
m_ehtTlv
.
length
= (40 + ehtFields.
userInfo
.size() * 4);
1122
m_length
+=
sizeof
(
TlvFields
) +
m_ehtTlvPad
;
1123
1124
m_ehtPad
= ((4 -
m_length
% 4) % 4);
1125
m_ehtFields
= ehtFields;
1126
m_length
+=
m_ehtTlv
.
length
+
m_ehtPad
;
1127
1128
NS_LOG_LOGIC
(
this
<<
" m_length="
<<
m_length
<<
" m_present[0]=0x"
<< std::hex
1129
<<
m_present
.at(0) <<
" m_present[1]=0x"
<<
m_present
.at(1) << std::dec);
1130
}
1131
1132
void
1133
RadiotapHeader::SerializeEht
(
Buffer::Iterator
& start)
const
1134
{
1135
start.WriteU8(0,
m_ehtTlvPad
);
1136
start.WriteU16(
m_ehtTlv
.
type
);
1137
start.WriteU16(
m_ehtTlv
.
length
);
1138
start.WriteU8(0,
m_ehtPad
);
1139
start.WriteU32(
m_ehtFields
.
known
);
1140
for
(
const
auto
dataField :
m_ehtFields
.
data
)
1141
{
1142
start.WriteU32(dataField);
1143
}
1144
for
(
const
auto
userInfoField :
m_ehtFields
.
userInfo
)
1145
{
1146
start.WriteU32(userInfoField);
1147
}
1148
}
1149
1150
uint32_t
1151
RadiotapHeader::DeserializeEht
(
Buffer::Iterator
start,
uint32_t
bytesRead)
1152
{
1153
const
auto
startBytesRead = bytesRead;
1154
1155
m_ehtTlvPad
= ((8 - bytesRead % 8) % 8);
1156
start.Next(
m_ehtTlvPad
);
1157
bytesRead +=
m_ehtTlvPad
;
1158
m_ehtTlv
.
type
= start.ReadU16();
1159
m_ehtTlv
.
length
= start.ReadU16();
1160
bytesRead +=
sizeof
(
TlvFields
);
1161
1162
m_ehtPad
= ((4 - bytesRead % 4) % 4);
1163
start.Next(
m_ehtPad
);
1164
bytesRead +=
m_ehtPad
;
1165
m_ehtFields
.
known
= start.ReadU32();
1166
bytesRead += 4;
1167
for
(
auto
& dataField :
m_ehtFields
.
data
)
1168
{
1169
dataField = start.ReadU32();
1170
bytesRead += 4;
1171
}
1172
const
auto
userInfosBytes =
m_ehtTlv
.
length
- bytesRead -
m_ehtTlvPad
;
1173
NS_ASSERT
(userInfosBytes % 4 == 0);
1174
const
std::size_t numUsers = userInfosBytes / 4;
1175
for
(std::size_t i = 0; i < numUsers; ++i)
1176
{
1177
m_ehtFields
.
userInfo
.push_back(start.ReadU32());
1178
bytesRead += 4;
1179
}
1180
1181
return
bytesRead - startBytesRead;
1182
}
1183
1184
void
1185
RadiotapHeader::PrintEht
(std::ostream& os)
const
1186
{
1187
os <<
" eht.known=0x"
<< std::hex <<
m_ehtFields
.
known
;
1188
std::size_t index = 0;
1189
for
(
const
auto
dataField :
m_ehtFields
.
data
)
1190
{
1191
os <<
" eht.data"
<< index++ <<
"=0x"
<< dataField;
1192
}
1193
index = 0;
1194
for
(
const
auto
userInfoField :
m_ehtFields
.
userInfo
)
1195
{
1196
os <<
" eht.userInfo"
<< index++ <<
"=0x"
<< userInfoField;
1197
}
1198
os << std::dec;
1199
}
1200
1201
}
// namespace ns3
int8_t
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::Header
Protocol header serialization and deserialization.
Definition
header.h:33
ns3::RadiotapHeader
Radiotap header implementation.
Definition
radiotap-header.h:31
ns3::RadiotapHeader::SerializeMcs
void SerializeMcs(Buffer::Iterator &start) const
Serialize the MCS radiotap header.
Definition
radiotap-header.cc:757
ns3::RadiotapHeader::m_heMuFields
HeMuFields m_heMuFields
HE MU fields.
Definition
radiotap-header.h:1092
ns3::RadiotapHeader::DeserializeHe
uint32_t DeserializeHe(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE radiotap header.
Definition
radiotap-header.cc:917
ns3::RadiotapHeader::PrintHeMu
void PrintHeMu(std::ostream &os) const
Add HE-MU subfield/value pairs to the output stream.
Definition
radiotap-header.cc:989
ns3::RadiotapHeader::SerializeHe
void SerializeHe(Buffer::Iterator &start) const
Serialize the HE radiotap header.
Definition
radiotap-header.cc:905
ns3::RadiotapHeader::m_rate
uint8_t m_rate
TX/RX data rate in units of 500 kbps.
Definition
radiotap-header.h:1070
ns3::RadiotapHeader::PrintMcs
void PrintMcs(std::ostream &os) const
Add MCS subfield/value pairs to the output stream.
Definition
radiotap-header.cc:774
ns3::RadiotapHeader::SetAmpduStatus
void SetAmpduStatus(const AmpduStatusFields &duStatusFields)
Set the subfields of the A-MPDU status field.
Definition
radiotap-header.cc:781
ns3::RadiotapHeader::DeserializeUsig
uint32_t DeserializeUsig(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the U-SIG radiotap header.
Definition
radiotap-header.cc:1082
ns3::RadiotapHeader::PrintEht
void PrintEht(std::ostream &os) const
Add EHT subfield/value pairs to the output stream.
Definition
radiotap-header.cc:1185
ns3::RadiotapHeader::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
radiotap-header.cc:31
ns3::RadiotapHeader::m_ampduStatusPad
uint8_t m_ampduStatusPad
A-MPDU Status Flags, padding before A-MPDU Status Field.
Definition
radiotap-header.h:1082
ns3::RadiotapHeader::PrintHeMuOtherUser
void PrintHeMuOtherUser(std::ostream &os) const
Add HE-MU-other-user subfield/value pairs to the output stream.
Definition
radiotap-header.cc:1036
ns3::RadiotapHeader::SetHeMuOtherUserFields
void SetHeMuOtherUserFields(const HeMuOtherUserFields &heMuOtherUserFields)
Set the subfields of the HE-MU-other-user field.
Definition
radiotap-header.cc:996
ns3::RadiotapHeader::m_ehtPad
uint8_t m_ehtPad
EHT padding.
Definition
radiotap-header.h:1104
ns3::RadiotapHeader::m_heFields
HeFields m_heFields
HE fields.
Definition
radiotap-header.h:1089
ns3::RadiotapHeader::m_heMuPad
uint8_t m_heMuPad
HE MU padding.
Definition
radiotap-header.h:1091
ns3::RadiotapHeader::Print
void Print(std::ostream &os) const override
This method is used by Packet::Print to print the content of the header as ascii data to a C++ output...
Definition
radiotap-header.cc:529
ns3::RadiotapHeader::m_usigPad
uint8_t m_usigPad
U-SIG padding.
Definition
radiotap-header.h:1099
ns3::RadiotapHeader::m_heMuOtherUserPad
uint8_t m_heMuOtherUserPad
HE MU other user padding.
Definition
radiotap-header.h:1094
ns3::RadiotapHeader::SetHeFields
void SetHeFields(const HeFields &heFields)
Set the subfields of the HE field.
Definition
radiotap-header.cc:889
ns3::RadiotapHeader::m_hePad
uint8_t m_hePad
HE padding.
Definition
radiotap-header.h:1088
ns3::RadiotapHeader::SerializeHeMuOtherUser
void SerializeHeMuOtherUser(Buffer::Iterator &start) const
Serialize the HE-MU-other-user radiotap header.
Definition
radiotap-header.cc:1014
ns3::RadiotapHeader::m_ehtFields
EhtFields m_ehtFields
EHT fields.
Definition
radiotap-header.h:1105
ns3::RadiotapHeader::SetMcsFields
void SetMcsFields(const McsFields &mcsFields)
Set the subfields of the MCS field.
Definition
radiotap-header.cc:743
ns3::RadiotapHeader::m_tsftPad
uint8_t m_tsftPad
TSFT padding.
Definition
radiotap-header.h:1064
ns3::RadiotapHeader::SetRate
void SetRate(uint8_t rate)
Set the transmit/receive channel frequency in units of megahertz.
Definition
radiotap-header.cc:635
ns3::RadiotapHeader::m_ehtTlvPad
uint8_t m_ehtTlvPad
EHT TLV padding.
Definition
radiotap-header.h:1102
ns3::RadiotapHeader::m_antennaSignal
int8_t m_antennaSignal
RF signal power at the antenna, dB difference from an arbitrary, fixed reference.
Definition
radiotap-header.h:1075
ns3::RadiotapHeader::SetAntennaSignalPower
void SetAntennaSignalPower(double signal)
Set the RF signal power at the antenna as a decibel difference from an arbitrary, fixed reference.
Definition
radiotap-header.cc:689
ns3::RadiotapHeader::DeserializeAmpduStatus
uint32_t DeserializeAmpduStatus(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the A-MPDU Status radiotap header.
Definition
radiotap-header.cc:807
ns3::RadiotapHeader::DeserializeVht
uint32_t DeserializeVht(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the VHT radiotap header.
Definition
radiotap-header.cc:859
ns3::RadiotapHeader::DeserializeHeMuOtherUser
uint32_t DeserializeHeMuOtherUser(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE-MU-other-user radiotap header.
Definition
radiotap-header.cc:1024
ns3::RadiotapHeader::SetTsft
void SetTsft(uint64_t tsft)
Set the Time Synchronization Function Timer (TSFT) value.
Definition
radiotap-header.cc:590
ns3::RadiotapHeader::PrintHe
void PrintHe(std::ostream &os) const
Add HE subfield/value pairs to the output stream.
Definition
radiotap-header.cc:931
ns3::RadiotapHeader::m_usigTlv
TlvFields m_usigTlv
U-SIG TLV fields.
Definition
radiotap-header.h:1098
ns3::RadiotapHeader::m_length
uint16_t m_length
entire length of radiotap data + header
Definition
radiotap-header.h:1061
ns3::RadiotapHeader::Serialize
void Serialize(Buffer::Iterator start) const override
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
Definition
radiotap-header.cc:55
ns3::RadiotapHeader::SerializeTsft
void SerializeTsft(Buffer::Iterator &start) const
Serialize the TSFT radiotap header.
Definition
radiotap-header.cc:605
ns3::RadiotapHeader::SetUsigFields
void SetUsigFields(const UsigFields &usigFields)
Set the subfields of the U-SIG field.
Definition
radiotap-header.cc:1046
ns3::RadiotapHeader::MIN_HEADER_SIZE
static constexpr int MIN_HEADER_SIZE
the minimum size of the radiotap header
Definition
radiotap-header.h:784
ns3::RadiotapHeader::SerializeUsig
void SerializeUsig(Buffer::Iterator &start) const
Serialize the U-SIG radiotap header.
Definition
radiotap-header.cc:1070
ns3::RadiotapHeader::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
This method is used by Packet::RemoveHeader to re-create a header from the byte buffer of a packet.
Definition
radiotap-header.cc:285
ns3::RadiotapHeader::PrintUsig
void PrintUsig(std::ostream &os) const
Add U-SIG subfield/value pairs to the output stream.
Definition
radiotap-header.cc:1102
ns3::RadiotapHeader::PrintChannel
void PrintChannel(std::ostream &os) const
Add Channel subfield/value pairs to the output stream.
Definition
radiotap-header.cc:682
ns3::RadiotapHeader::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
radiotap-header.cc:42
ns3::RadiotapHeader::DeserializeMcs
uint32_t DeserializeMcs(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the MCS radiotap header.
Definition
radiotap-header.cc:765
ns3::RadiotapHeader::SerializeHeMu
void SerializeHeMu(Buffer::Iterator &start) const
Serialize the HE-MU radiotap header.
Definition
radiotap-header.cc:955
ns3::RadiotapHeader::m_mcsFields
McsFields m_mcsFields
MCS fields.
Definition
radiotap-header.h:1080
ns3::RadiotapHeader::SerializeAmpduStatus
void SerializeAmpduStatus(Buffer::Iterator &start) const
Serialize the A-MPDU Status radiotap header.
Definition
radiotap-header.cc:797
ns3::RadiotapHeader::SetVhtFields
void SetVhtFields(const VhtFields &vhtFields)
Set the subfields of the VHT field.
Definition
radiotap-header.cc:825
ns3::RadiotapHeader::SerializeEht
void SerializeEht(Buffer::Iterator &start) const
Serialize the EHT radiotap header.
Definition
radiotap-header.cc:1133
ns3::RadiotapHeader::DeserializeChannel
uint32_t DeserializeChannel(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the Channel radiotap header.
Definition
radiotap-header.cc:672
ns3::RadiotapHeader::m_usigFields
UsigFields m_usigFields
U-SIG fields.
Definition
radiotap-header.h:1100
ns3::RadiotapHeader::RadiotapExtFlags
RadiotapExtFlags
Radiotap extended flags.
Definition
radiotap-header.h:1055
ns3::RadiotapHeader::RADIOTAP_USIG
@ RADIOTAP_USIG
Definition
radiotap-header.h:1057
ns3::RadiotapHeader::RADIOTAP_EHT_SIG
@ RADIOTAP_EHT_SIG
Definition
radiotap-header.h:1058
ns3::RadiotapHeader::SerializeChannel
void SerializeChannel(Buffer::Iterator &start) const
Serialize the Channel radiotap header.
Definition
radiotap-header.cc:664
ns3::RadiotapHeader::RADIOTAP_DB_ANTNOISE
@ RADIOTAP_DB_ANTNOISE
Definition
radiotap-header.h:1037
ns3::RadiotapHeader::RADIOTAP_HE_MU_OTHER_USER
@ RADIOTAP_HE_MU_OTHER_USER
Definition
radiotap-header.h:1044
ns3::RadiotapHeader::RADIOTAP_AMPDU_STATUS
@ RADIOTAP_AMPDU_STATUS
Definition
radiotap-header.h:1040
ns3::RadiotapHeader::RADIOTAP_DBM_ANTSIGNAL
@ RADIOTAP_DBM_ANTSIGNAL
Definition
radiotap-header.h:1029
ns3::RadiotapHeader::RADIOTAP_RX_FLAGS
@ RADIOTAP_RX_FLAGS
Definition
radiotap-header.h:1038
ns3::RadiotapHeader::RADIOTAP_VHT
@ RADIOTAP_VHT
Definition
radiotap-header.h:1041
ns3::RadiotapHeader::RADIOTAP_RATE
@ RADIOTAP_RATE
Definition
radiotap-header.h:1026
ns3::RadiotapHeader::RADIOTAP_HE
@ RADIOTAP_HE
Definition
radiotap-header.h:1042
ns3::RadiotapHeader::RADIOTAP_HE_MU
@ RADIOTAP_HE_MU
Definition
radiotap-header.h:1043
ns3::RadiotapHeader::RADIOTAP_CHANNEL
@ RADIOTAP_CHANNEL
Definition
radiotap-header.h:1027
ns3::RadiotapHeader::RADIOTAP_TSFT
@ RADIOTAP_TSFT
Definition
radiotap-header.h:1024
ns3::RadiotapHeader::RADIOTAP_DBM_TX_POWER
@ RADIOTAP_DBM_TX_POWER
Definition
radiotap-header.h:1034
ns3::RadiotapHeader::RADIOTAP_FLAGS
@ RADIOTAP_FLAGS
Definition
radiotap-header.h:1025
ns3::RadiotapHeader::RADIOTAP_DB_ANTSIGNAL
@ RADIOTAP_DB_ANTSIGNAL
Definition
radiotap-header.h:1036
ns3::RadiotapHeader::RADIOTAP_DB_TX_ATTENUATION
@ RADIOTAP_DB_TX_ATTENUATION
Definition
radiotap-header.h:1033
ns3::RadiotapHeader::RADIOTAP_ANTENNA
@ RADIOTAP_ANTENNA
Definition
radiotap-header.h:1035
ns3::RadiotapHeader::RADIOTAP_TLV
@ RADIOTAP_TLV
Definition
radiotap-header.h:1047
ns3::RadiotapHeader::RADIOTAP_TX_ATTENUATION
@ RADIOTAP_TX_ATTENUATION
Definition
radiotap-header.h:1032
ns3::RadiotapHeader::RADIOTAP_MCS
@ RADIOTAP_MCS
Definition
radiotap-header.h:1039
ns3::RadiotapHeader::RADIOTAP_FHSS
@ RADIOTAP_FHSS
Definition
radiotap-header.h:1028
ns3::RadiotapHeader::RADIOTAP_DBM_ANTNOISE
@ RADIOTAP_DBM_ANTNOISE
Definition
radiotap-header.h:1030
ns3::RadiotapHeader::RADIOTAP_EXT
@ RADIOTAP_EXT
Definition
radiotap-header.h:1048
ns3::RadiotapHeader::RADIOTAP_LOCK_QUALITY
@ RADIOTAP_LOCK_QUALITY
Definition
radiotap-header.h:1031
ns3::RadiotapHeader::SetAntennaNoisePower
void SetAntennaNoisePower(double noise)
Set the RF noise power at the antenna as a decibel difference from an arbitrary, fixed reference.
Definition
radiotap-header.cc:716
ns3::RadiotapHeader::RadiotapHeader
RadiotapHeader()
Definition
radiotap-header.cc:25
ns3::RadiotapHeader::m_present
std::vector< uint32_t > m_present
bits describing which fields follow header
Definition
radiotap-header.h:1062
ns3::RadiotapHeader::PrintVht
void PrintVht(std::ostream &os) const
Add VHT subfield/value pairs to the output stream.
Definition
radiotap-header.cc:877
ns3::RadiotapHeader::GetSerializedSize
uint32_t GetSerializedSize() const override
This method is used by Packet::AddHeader to store the header into the byte buffer of a packet.
Definition
radiotap-header.cc:48
ns3::RadiotapHeader::m_ehtTlv
TlvFields m_ehtTlv
EHT TLV fields.
Definition
radiotap-header.h:1103
ns3::RadiotapHeader::SetEhtFields
void SetEhtFields(const EhtFields &ehtFields)
Set the subfields of the EHT-SIG field.
Definition
radiotap-header.cc:1109
ns3::RadiotapHeader::m_channelFields
ChannelFields m_channelFields
Channel fields.
Definition
radiotap-header.h:1073
ns3::RadiotapHeader::m_usigTlvPad
uint8_t m_usigTlvPad
U-SIG TLV padding.
Definition
radiotap-header.h:1097
ns3::RadiotapHeader::m_channelPad
uint8_t m_channelPad
Channel padding.
Definition
radiotap-header.h:1072
ns3::RadiotapHeader::DeserializeHeMu
uint32_t DeserializeHeMu(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the HE-MU radiotap header.
Definition
radiotap-header.cc:971
ns3::RadiotapHeader::m_vhtPad
uint8_t m_vhtPad
VHT padding.
Definition
radiotap-header.h:1085
ns3::RadiotapHeader::m_ampduStatusFields
AmpduStatusFields m_ampduStatusFields
A-MPDU Status fields.
Definition
radiotap-header.h:1083
ns3::RadiotapHeader::SerializeVht
void SerializeVht(Buffer::Iterator &start) const
Serialize the VHT radiotap header.
Definition
radiotap-header.cc:843
ns3::RadiotapHeader::PrintAmpduStatus
void PrintAmpduStatus(std::ostream &os) const
Add A-MPDU Status subfield/value pairs to the output stream.
Definition
radiotap-header.cc:819
ns3::RadiotapHeader::SetWifiHeader
void SetWifiHeader(std::size_t numPresentWords)
Set the ieee80211_radiotap_header.
Definition
radiotap-header.cc:573
ns3::RadiotapHeader::DeserializeTsft
uint32_t DeserializeTsft(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the TSFT radiotap header.
Definition
radiotap-header.cc:612
ns3::RadiotapHeader::m_flags
uint8_t m_flags
Properties of transmitted and received frames.
Definition
radiotap-header.h:1068
ns3::RadiotapHeader::SetHeMuFields
void SetHeMuFields(const HeMuFields &heMuFields)
Set the subfields of the HE-MU field.
Definition
radiotap-header.cc:940
ns3::RadiotapHeader::SetChannelFields
void SetChannelFields(const ChannelFields &channelFields)
Set the subfields of the Channel field.
Definition
radiotap-header.cc:649
ns3::RadiotapHeader::m_heMuOtherUserFields
HeMuOtherUserFields m_heMuOtherUserFields
HE MU other user fields.
Definition
radiotap-header.h:1095
ns3::RadiotapHeader::SetFrameFlags
void SetFrameFlags(uint8_t flags)
Set the frame flags of the transmitted or received frame.
Definition
radiotap-header.cc:621
ns3::RadiotapHeader::m_vhtFields
VhtFields m_vhtFields
VHT fields.
Definition
radiotap-header.h:1086
ns3::RadiotapHeader::m_tsft
uint64_t m_tsft
Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC)
Definition
radiotap-header.h:1065
ns3::RadiotapHeader::DeserializeEht
uint32_t DeserializeEht(Buffer::Iterator start, uint32_t bytesRead)
Deserialize the EHT radiotap header.
Definition
radiotap-header.cc:1151
ns3::RadiotapHeader::m_antennaNoise
int8_t m_antennaNoise
RF noise power at the antenna, dB difference from an arbitrary, fixed reference.
Definition
radiotap-header.h:1077
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:49
ns3::TypeId::SetParent
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition
type-id.cc:1001
uint32_t
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition
assert.h:55
NS_ASSERT_MSG
#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:75
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition
log.h:271
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition
log-macros-enabled.h:229
NS_OBJECT_ENSURE_REGISTERED
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition
object-base.h:35
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
radiotap-header.h
ns3::RadiotapHeader::AmpduStatusFields
structure that contains the subfields of the A-MPDU status field.
Definition
radiotap-header.h:255
ns3::RadiotapHeader::AmpduStatusFields::referenceNumber
uint32_t referenceNumber
A-MPDU reference number to identify all subframes belonging to the same A-MPDU.
Definition
radiotap-header.h:256
ns3::RadiotapHeader::AmpduStatusFields::crc
uint8_t crc
CRC field.
Definition
radiotap-header.h:259
ns3::RadiotapHeader::AmpduStatusFields::reserved
uint8_t reserved
Reserved field.
Definition
radiotap-header.h:260
ns3::RadiotapHeader::AmpduStatusFields::flags
uint16_t flags
flags field
Definition
radiotap-header.h:258
ns3::RadiotapHeader::ChannelFields
structure that contains the subfields of the Channel field.
Definition
radiotap-header.h:152
ns3::RadiotapHeader::ChannelFields::flags
uint16_t flags
flags field (
Definition
radiotap-header.h:154
ns3::RadiotapHeader::ChannelFields::frequency
uint16_t frequency
Tx/Rx frequency in MHz.
Definition
radiotap-header.h:153
ns3::RadiotapHeader::EhtFields
structure that contains the subfields of the EHT field.
Definition
radiotap-header.h:608
ns3::RadiotapHeader::EhtFields::userInfo
std::vector< uint32_t > userInfo
user info fields.
Definition
radiotap-header.h:611
ns3::RadiotapHeader::EhtFields::data
std::array< uint32_t, 9 > data
data fields.
Definition
radiotap-header.h:610
ns3::RadiotapHeader::EhtFields::known
uint32_t known
known field.
Definition
radiotap-header.h:609
ns3::RadiotapHeader::HeFields
structure that contains the subfields of the HE field.
Definition
radiotap-header.h:406
ns3::RadiotapHeader::HeFields::data1
uint16_t data1
data1 field
Definition
radiotap-header.h:407
ns3::RadiotapHeader::HeFields::data6
uint16_t data6
data6 field
Definition
radiotap-header.h:412
ns3::RadiotapHeader::HeFields::data4
uint16_t data4
data4 field
Definition
radiotap-header.h:410
ns3::RadiotapHeader::HeFields::data2
uint16_t data2
data2 field
Definition
radiotap-header.h:408
ns3::RadiotapHeader::HeFields::data3
uint16_t data3
data3 field
Definition
radiotap-header.h:409
ns3::RadiotapHeader::HeFields::data5
uint16_t data5
data5 field
Definition
radiotap-header.h:411
ns3::RadiotapHeader::HeMuFields
structure that contains the subfields of the HE-MU field.
Definition
radiotap-header.h:462
ns3::RadiotapHeader::HeMuFields::flags1
uint16_t flags1
flags1 field
Definition
radiotap-header.h:463
ns3::RadiotapHeader::HeMuFields::ruChannel2
std::array< uint8_t, 4 > ruChannel2
RU_channel2 field.
Definition
radiotap-header.h:466
ns3::RadiotapHeader::HeMuFields::flags2
uint16_t flags2
flags2 field
Definition
radiotap-header.h:464
ns3::RadiotapHeader::HeMuFields::ruChannel1
std::array< uint8_t, 4 > ruChannel1
RU_channel1 field.
Definition
radiotap-header.h:465
ns3::RadiotapHeader::HeMuOtherUserFields
structure that contains the subfields of the HE-MU-other-user field.
Definition
radiotap-header.h:495
ns3::RadiotapHeader::HeMuOtherUserFields::perUserKnown
uint8_t perUserKnown
per_user_known field
Definition
radiotap-header.h:499
ns3::RadiotapHeader::HeMuOtherUserFields::perUser2
uint16_t perUser2
per_user_2 field
Definition
radiotap-header.h:497
ns3::RadiotapHeader::HeMuOtherUserFields::perUserPosition
uint8_t perUserPosition
per_user_position field
Definition
radiotap-header.h:498
ns3::RadiotapHeader::HeMuOtherUserFields::perUser1
uint16_t perUser1
per_user_1 field
Definition
radiotap-header.h:496
ns3::RadiotapHeader::McsFields
structure that contains the subfields of the MCS field.
Definition
radiotap-header.h:221
ns3::RadiotapHeader::McsFields::flags
uint8_t flags
flags field
Definition
radiotap-header.h:223
ns3::RadiotapHeader::McsFields::mcs
uint8_t mcs
MCS index value.
Definition
radiotap-header.h:224
ns3::RadiotapHeader::McsFields::known
uint8_t known
known flags
Definition
radiotap-header.h:222
ns3::RadiotapHeader::TlvFields
structure that contains the subfields of the TLV fields.
Definition
radiotap-header.h:513
ns3::RadiotapHeader::TlvFields::length
uint16_t length
length field.
Definition
radiotap-header.h:515
ns3::RadiotapHeader::TlvFields::type
uint16_t type
type field.
Definition
radiotap-header.h:514
ns3::RadiotapHeader::UsigFields
structure that contains the subfields of the U-SIG field.
Definition
radiotap-header.h:522
ns3::RadiotapHeader::UsigFields::mask
uint32_t mask
mask field.
Definition
radiotap-header.h:525
ns3::RadiotapHeader::UsigFields::value
uint32_t value
value field.
Definition
radiotap-header.h:524
ns3::RadiotapHeader::UsigFields::common
uint32_t common
common field.
Definition
radiotap-header.h:523
ns3::RadiotapHeader::VhtFields
structure that contains the subfields of the VHT field.
Definition
radiotap-header.h:312
ns3::RadiotapHeader::VhtFields::coding
uint8_t coding
coding field
Definition
radiotap-header.h:317
ns3::RadiotapHeader::VhtFields::flags
uint8_t flags
flags field
Definition
radiotap-header.h:314
ns3::RadiotapHeader::VhtFields::groupId
uint8_t groupId
group_id field
Definition
radiotap-header.h:318
ns3::RadiotapHeader::VhtFields::bandwidth
uint8_t bandwidth
bandwidth field
Definition
radiotap-header.h:315
ns3::RadiotapHeader::VhtFields::mcsNss
std::array< uint8_t, 4 > mcsNss
mcs_nss field
Definition
radiotap-header.h:316
ns3::RadiotapHeader::VhtFields::partialAid
uint16_t partialAid
partial_aid field
Definition
radiotap-header.h:319
ns3::RadiotapHeader::VhtFields::known
uint16_t known
known flags field
Definition
radiotap-header.h:313
src
network
utils
radiotap-header.cc
Generated on Fri Aug 22 2025 18:20:56 for ns-3 by
1.11.0