author | Sébastien Deronne <sebastien.deronne@gmail.com> |
Wed, 08 Jul 2015 23:44:17 +0200 | |
changeset 11479 | a3dcf66928f3 |
parent 11238 | 96b5da288844 |
child 11628 | 243b71de25a0 |
permissions | -rwxr-xr-x |
7385
10beb0e53130
standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents:
7256
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
6009 | 2 |
/* |
3 |
* Copyright (c) 2009 CTTC |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
6009 | 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 |
* |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
18 |
* Authors: Nicola Baldo <nbaldo@cttc.es> |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
19 |
* Sébastien Deronne <sebastien.deronne@gmail.com> |
6009 | 20 |
*/ |
21 |
||
22 |
#include <iomanip> |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
7704
diff
changeset
|
23 |
#include <cmath> |
6009 | 24 |
#include "ns3/log.h" |
25 |
#include "radiotap-header.h" |
|
26 |
||
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
27 |
namespace ns3 { |
6009 | 28 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10652
diff
changeset
|
29 |
NS_LOG_COMPONENT_DEFINE ("RadiotapHeader"); |
6393
f7e1f9dfa08d
ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents:
6036
diff
changeset
|
30 |
|
10652
dc18deba4502
[doxygen] Revert r10410, r10411, r10412
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10410
diff
changeset
|
31 |
NS_OBJECT_ENSURE_REGISTERED (RadiotapHeader); |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
32 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
33 |
RadiotapHeader::RadiotapHeader () |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
34 |
: m_length (8), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
35 |
m_present (0), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
36 |
m_tsft (0), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
37 |
m_flags (FRAME_FLAG_NONE), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
38 |
m_rate (0), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
39 |
m_channelFreq (0), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
40 |
m_channelFlags (CHANNEL_FLAG_NONE), |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
41 |
m_antennaSignal (0), |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
42 |
m_antennaNoise (0), |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
43 |
m_ampduStatusRef (0), |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
44 |
m_ampduStatusFlags (0), |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
45 |
m_ampduStatusCRC (0) |
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
46 |
{ |
6009 | 47 |
NS_LOG_FUNCTION (this); |
48 |
} |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
49 |
|
6009 | 50 |
TypeId RadiotapHeader::GetTypeId (void) |
51 |
{ |
|
6393
f7e1f9dfa08d
ensure objects are regsitered
Josh Pelkey <jpelkey@gatech.edu>
parents:
6036
diff
changeset
|
52 |
static TypeId tid = TypeId ("ns3::RadiotapHeader") |
6009 | 53 |
.SetParent<Header> () |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
54 |
.SetGroupName ("Network") |
11238
96b5da288844
SetGroupName for network module
Mohit Goyal <mohit.bits2011@gmail.com>
parents:
10968
diff
changeset
|
55 |
|
6009 | 56 |
.AddConstructor<RadiotapHeader> () |
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
57 |
; |
6009 | 58 |
return tid; |
59 |
} |
|
60 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
61 |
TypeId |
6009 | 62 |
RadiotapHeader::GetInstanceTypeId (void) const |
63 |
{ |
|
64 |
return GetTypeId (); |
|
65 |
} |
|
66 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
67 |
uint32_t |
6009 | 68 |
RadiotapHeader::GetSerializedSize (void) const |
69 |
{ |
|
70 |
NS_LOG_FUNCTION (this); |
|
71 |
return m_length; |
|
72 |
} |
|
73 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
74 |
void |
6009 | 75 |
RadiotapHeader::Serialize (Buffer::Iterator start) const |
76 |
{ |
|
9144
6a15c50388bc
Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9063
diff
changeset
|
77 |
NS_LOG_FUNCTION (this << &start); |
6009 | 78 |
|
79 |
start.WriteU8 (0); // major version of radiotap header |
|
80 |
start.WriteU8 (0); // pad field |
|
81 |
start.WriteU16 (m_length); // entire length of radiotap data + header |
|
82 |
start.WriteU32 (m_present); // bits describing which fields follow header |
|
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
83 |
|
6009 | 84 |
// |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
85 |
// Time Synchronization Function Timer (when the first bit of the MPDU |
6009 | 86 |
// arrived at the MAC) |
87 |
// |
|
88 |
if (m_present & RADIOTAP_TSFT) // bit 0 |
|
89 |
{ |
|
90 |
start.WriteU64 (m_tsft); |
|
91 |
} |
|
92 |
||
93 |
// |
|
94 |
// Properties of transmitted and received frames. |
|
95 |
// |
|
96 |
if (m_present & RADIOTAP_FLAGS) // bit 1 |
|
97 |
{ |
|
98 |
start.WriteU8 (m_flags); |
|
99 |
} |
|
100 |
||
101 |
// |
|
102 |
// TX/RX data rate in units of 500 kbps |
|
103 |
// |
|
104 |
if (m_present & RADIOTAP_RATE) // bit 2 |
|
105 |
{ |
|
106 |
start.WriteU8 (m_rate); |
|
107 |
} |
|
108 |
||
109 |
// |
|
110 |
// Tx/Rx frequency in MHz, followed by flags. |
|
111 |
// |
|
112 |
if (m_present & RADIOTAP_CHANNEL) // bit 3 |
|
113 |
{ |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
114 |
start.WriteU8 (0, m_channelPad); |
6009 | 115 |
start.WriteU16 (m_channelFreq); |
116 |
start.WriteU16 (m_channelFlags); |
|
117 |
} |
|
118 |
||
119 |
// |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
120 |
// The hop set and pattern for frequency-hopping radios. We don't need it but |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
121 |
// still need to account for it. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
122 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
123 |
if (m_present & RADIOTAP_FHSS) // bit 4 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
124 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
125 |
start.WriteU8 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
126 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
127 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
128 |
// |
6009 | 129 |
// RF signal power at the antenna, decibel difference from an arbitrary, fixed |
130 |
// reference. |
|
131 |
// |
|
132 |
if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5 |
|
133 |
{ |
|
134 |
start.WriteU8 (m_antennaSignal); |
|
135 |
} |
|
136 |
||
137 |
// |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
138 |
// RF noise power at the antenna, decibel difference from an arbitrary, fixed |
6009 | 139 |
// reference. |
140 |
// |
|
141 |
if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6 |
|
142 |
{ |
|
143 |
start.WriteU8 (m_antennaNoise); |
|
144 |
} |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
145 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
146 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
147 |
// Quality of Barker code lock. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
148 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
149 |
if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
150 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
151 |
start.WriteU16 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
152 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
153 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
154 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
155 |
// Transmit power expressed as unitless distance from max power |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
156 |
// set at factory calibration (0 is max power). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
157 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
158 |
if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
159 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
160 |
start.WriteU16 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
161 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
162 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
163 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
164 |
// Transmit power expressed as decibel distance from max power |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
165 |
// set at factory calibration (0 is max power). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
166 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
167 |
if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
168 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
169 |
start.WriteU16 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
170 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
171 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
172 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
173 |
// Transmit power expressed as dBm (decibels from a 1 milliwatt reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
174 |
// This is the absolute power level measured at the antenna port. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
175 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
176 |
if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
177 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
178 |
start.WriteU8 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
179 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
180 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
181 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
182 |
// Unitless indication of the Rx/Tx antenna for this packet. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
183 |
// The first antenna is antenna 0. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
184 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
185 |
if (m_present & RADIOTAP_ANTENNA) // bit 11 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
186 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
187 |
start.WriteU8 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
188 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
189 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
190 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
191 |
// RF signal power at the antenna (decibel difference from an arbitrary fixed reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
192 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
193 |
if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
194 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
195 |
start.WriteU8 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
196 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
197 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
198 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
199 |
// RF noise power at the antenna (decibel difference from an arbitrary fixed reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
200 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
201 |
if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
202 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
203 |
start.WriteU8 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
204 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
205 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
206 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
207 |
// Properties of received frames. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
208 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
209 |
if (m_present & RADIOTAP_RX_FLAGS) // bit 14 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
210 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
211 |
start.WriteU16 (0); //not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
212 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
213 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
214 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
215 |
// MCS field. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
216 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
217 |
if (m_present & RADIOTAP_MCS) // bit 19 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
218 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
219 |
start.WriteU8 (m_mcsKnown); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
220 |
start.WriteU8 (m_mcsFlags); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
221 |
start.WriteU8 (m_mcsRate); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
222 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
223 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
224 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
225 |
// A-MPDU Status, information about the received or transmitted A-MPDU. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
226 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
227 |
if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
228 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
229 |
start.WriteU8 (0, m_ampduStatusPad); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
230 |
start.WriteU32 (m_ampduStatusRef); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
231 |
start.WriteU16 (m_ampduStatusFlags); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
232 |
start.WriteU8 (m_ampduStatusCRC); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
233 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
234 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
235 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
236 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
237 |
// Information about the received or transmitted VHT frame. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
238 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
239 |
if (m_present & RADIOTAP_VHT) // bit 21 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
240 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
241 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
242 |
start.WriteU16 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
243 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
244 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
245 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
246 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
247 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
248 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
249 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
250 |
start.WriteU8 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
251 |
start.WriteU16 (0); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
252 |
} |
6009 | 253 |
} |
254 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
255 |
uint32_t |
6009 | 256 |
RadiotapHeader::Deserialize (Buffer::Iterator start) |
257 |
{ |
|
9144
6a15c50388bc
Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9063
diff
changeset
|
258 |
NS_LOG_FUNCTION (this << &start); |
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
259 |
|
7704
aef733235832
Bug 1170: Formulate best practices for dealing with unused debug variables.
Andrey Mazo <mazo@iitp.ru>
parents:
7385
diff
changeset
|
260 |
uint8_t tmp = start.ReadU8 (); // major version of radiotap header |
6009 | 261 |
NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version"); |
262 |
start.ReadU8 (); // pad field |
|
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
263 |
|
6009 | 264 |
m_length = start.ReadU16 (); // entire length of radiotap data + header |
265 |
m_present = start.ReadU32 (); // bits describing which fields follow header |
|
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
266 |
|
6009 | 267 |
uint32_t bytesRead = 8; |
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
268 |
|
6009 | 269 |
// |
270 |
// Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC) |
|
271 |
// |
|
272 |
if (m_present & RADIOTAP_TSFT) // bit 0 |
|
273 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
274 |
m_tsft = start.ReadU64 (); |
6009 | 275 |
bytesRead += 8; |
276 |
} |
|
277 |
||
278 |
// |
|
279 |
// Properties of transmitted and received frames. |
|
280 |
// |
|
281 |
if (m_present & RADIOTAP_FLAGS) // bit 1 |
|
282 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
283 |
m_flags = start.ReadU8 (); |
6009 | 284 |
++bytesRead; |
285 |
} |
|
286 |
||
287 |
// |
|
288 |
// TX/RX data rate in units of 500 kbps |
|
289 |
// |
|
290 |
if (m_present & RADIOTAP_RATE) // bit 2 |
|
291 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
292 |
m_rate = start.ReadU8 (); |
6009 | 293 |
++bytesRead; |
294 |
} |
|
295 |
||
296 |
// |
|
297 |
// Tx/Rx frequency in MHz, followed by flags. |
|
298 |
// |
|
299 |
if (m_present & RADIOTAP_CHANNEL) // bit 3 |
|
300 |
{ |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
301 |
m_channelPad = ((2 - bytesRead % 2) % 2); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
302 |
start.Next (m_channelPad); |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
303 |
m_channelFreq = start.ReadU16 (); |
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
304 |
m_channelFlags = start.ReadU16 (); |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
305 |
bytesRead += (4 + m_channelPad); |
6009 | 306 |
} |
307 |
||
308 |
// |
|
309 |
// The hop set and pattern for frequency-hopping radios. We don't need it but |
|
310 |
// still need to account for it. |
|
311 |
// |
|
312 |
if (m_present & RADIOTAP_FHSS) // bit 4 |
|
313 |
{ |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
314 |
//not yet implemented |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
315 |
start.ReadU8 (); |
6009 | 316 |
++bytesRead; |
317 |
} |
|
318 |
||
319 |
// |
|
320 |
// RF signal power at the antenna, decibel difference from an arbitrary, fixed |
|
321 |
// reference. |
|
322 |
// |
|
323 |
if (m_present & RADIOTAP_DBM_ANTSIGNAL) // bit 5 |
|
324 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
325 |
m_antennaSignal = start.ReadU8 (); |
6009 | 326 |
++bytesRead; |
327 |
} |
|
328 |
||
329 |
// |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
330 |
// RF noise power at the antenna, decibel difference from an arbitrary, fixed |
6009 | 331 |
// reference. |
332 |
// |
|
333 |
if (m_present & RADIOTAP_DBM_ANTNOISE) // bit 6 |
|
334 |
{ |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
335 |
m_antennaNoise = start.ReadU8 (); |
6009 | 336 |
++bytesRead; |
337 |
} |
|
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
338 |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
339 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
340 |
// Quality of Barker code lock. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
341 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
342 |
if (m_present & RADIOTAP_LOCK_QUALITY) // bit 7 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
343 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
344 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
345 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
346 |
bytesRead += 2; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
347 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
348 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
349 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
350 |
// Transmit power expressed as unitless distance from max power |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
351 |
// set at factory calibration (0 is max power). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
352 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
353 |
if (m_present & RADIOTAP_TX_ATTENUATION) // bit 8 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
354 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
355 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
356 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
357 |
bytesRead += 2; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
358 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
359 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
360 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
361 |
// Transmit power expressed as decibel distance from max power |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
362 |
// set at factory calibration (0 is max power). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
363 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
364 |
if (m_present & RADIOTAP_DB_TX_ATTENUATION) // bit 9 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
365 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
366 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
367 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
368 |
bytesRead += 2; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
369 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
370 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
371 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
372 |
// Transmit power expressed as dBm (decibels from a 1 milliwatt reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
373 |
// This is the absolute power level measured at the antenna port. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
374 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
375 |
if (m_present & RADIOTAP_DBM_TX_POWER) // bit 10 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
376 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
377 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
378 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
379 |
++bytesRead; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
380 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
381 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
382 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
383 |
// Unitless indication of the Rx/Tx antenna for this packet. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
384 |
// The first antenna is antenna 0. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
385 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
386 |
if (m_present & RADIOTAP_ANTENNA) // bit 11 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
387 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
388 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
389 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
390 |
++bytesRead; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
391 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
392 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
393 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
394 |
// RF signal power at the antenna (decibel difference from an arbitrary fixed reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
395 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
396 |
if (m_present & RADIOTAP_DB_ANTSIGNAL) // bit 12 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
397 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
398 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
399 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
400 |
++bytesRead; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
401 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
402 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
403 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
404 |
// RF noise power at the antenna (decibel difference from an arbitrary fixed reference). |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
405 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
406 |
if (m_present & RADIOTAP_DB_ANTNOISE) // bit 13 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
407 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
408 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
409 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
410 |
++bytesRead; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
411 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
412 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
413 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
414 |
// Properties of received frames. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
415 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
416 |
if (m_present & RADIOTAP_RX_FLAGS) // bit 14 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
417 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
418 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
419 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
420 |
bytesRead += 2; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
421 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
422 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
423 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
424 |
// MCS field. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
425 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
426 |
if (m_present & RADIOTAP_MCS) // bit 19 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
427 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
428 |
m_mcsKnown = start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
429 |
m_mcsFlags = start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
430 |
m_mcsRate = start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
431 |
bytesRead += 3; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
432 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
433 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
434 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
435 |
// A-MPDU Status, information about the received or transmitted A-MPDU. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
436 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
437 |
if (m_present & RADIOTAP_AMPDU_STATUS) // bit 20 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
438 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
439 |
m_ampduStatusPad = ((4 - bytesRead % 4) % 4); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
440 |
start.Next (m_ampduStatusPad); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
441 |
m_ampduStatusRef = start.ReadU32 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
442 |
m_ampduStatusFlags = start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
443 |
m_ampduStatusCRC = start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
444 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
445 |
bytesRead += (8 + m_ampduStatusPad); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
446 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
447 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
448 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
449 |
// Information about the received or transmitted VHT frame. |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
450 |
// |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
451 |
if (m_present & RADIOTAP_VHT) // bit 21 |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
452 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
453 |
//not yet implemented |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
454 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
455 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
456 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
457 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
458 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
459 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
460 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
461 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
462 |
start.ReadU8 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
463 |
start.ReadU16 (); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
464 |
bytesRead += 12; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
465 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
466 |
|
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
467 |
NS_ASSERT_MSG (m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent"); |
6009 | 468 |
return bytesRead; |
469 |
} |
|
470 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
471 |
void |
6009 | 472 |
RadiotapHeader::Print (std::ostream &os) const |
473 |
{ |
|
9144
6a15c50388bc
Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9063
diff
changeset
|
474 |
NS_LOG_FUNCTION (this << &os); |
6009 | 475 |
os << " tsft=" << m_tsft |
476 |
<< " flags=" << std::hex << m_flags << std::dec |
|
477 |
<< " rate=" << (uint16_t) m_rate |
|
478 |
<< " freq=" << m_channelFreq |
|
479 |
<< " chflags=" << std::hex << (uint32_t)m_channelFlags << std::dec |
|
480 |
<< " signal=" << (int16_t) m_antennaSignal |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
481 |
<< " noise=" << (int16_t) m_antennaNoise |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
482 |
<< " mcsKnown=" << m_mcsKnown |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
483 |
<< " mcsFlags=" << m_mcsFlags |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
484 |
<< " mcsRate=" << m_mcsRate |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
485 |
<< " ampduStatusFlags=" << (int16_t) m_ampduStatusFlags; |
6009 | 486 |
} |
487 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
488 |
void |
6009 | 489 |
RadiotapHeader::SetTsft (uint64_t value) |
490 |
{ |
|
491 |
NS_LOG_FUNCTION (this << value); |
|
492 |
m_tsft = value; |
|
493 |
||
494 |
if (!(m_present & RADIOTAP_TSFT)) |
|
495 |
{ |
|
496 |
m_present |= RADIOTAP_TSFT; |
|
497 |
m_length += 8; |
|
498 |
} |
|
499 |
||
500 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
|
501 |
} |
|
502 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
503 |
uint64_t |
6009 | 504 |
RadiotapHeader::GetTsft () const |
505 |
{ |
|
506 |
NS_LOG_FUNCTION (this); |
|
507 |
return m_tsft; |
|
508 |
} |
|
509 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
510 |
void |
6009 | 511 |
RadiotapHeader::SetFrameFlags (uint8_t flags) |
512 |
{ |
|
9157
2d4305dd159a
Fix printing of uint8_t data in NS_LOG_FUNCTION introduced by 9144:6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9144
diff
changeset
|
513 |
NS_LOG_FUNCTION (this << static_cast<uint32_t> (flags)); |
6009 | 514 |
m_flags = flags; |
515 |
||
516 |
if (!(m_present & RADIOTAP_FLAGS)) |
|
517 |
{ |
|
518 |
m_present |= RADIOTAP_FLAGS; |
|
519 |
m_length += 1; |
|
520 |
} |
|
521 |
||
522 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
|
523 |
} |
|
524 |
||
525 |
uint8_t |
|
526 |
RadiotapHeader::GetFrameFlags (void) const |
|
527 |
{ |
|
528 |
NS_LOG_FUNCTION (this); |
|
529 |
return m_flags; |
|
530 |
} |
|
531 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
532 |
void |
6009 | 533 |
RadiotapHeader::SetRate (uint8_t rate) |
534 |
{ |
|
9157
2d4305dd159a
Fix printing of uint8_t data in NS_LOG_FUNCTION introduced by 9144:6a15c50388bc Clean up function logging of network module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9144
diff
changeset
|
535 |
NS_LOG_FUNCTION (this << static_cast<uint32_t> (rate)); |
6009 | 536 |
m_rate = rate; |
537 |
||
538 |
if (!(m_present & RADIOTAP_RATE)) |
|
539 |
{ |
|
540 |
m_present |= RADIOTAP_RATE; |
|
541 |
m_length += 1; |
|
542 |
} |
|
543 |
||
544 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
|
545 |
} |
|
546 |
||
547 |
uint8_t |
|
548 |
RadiotapHeader::GetRate (void) const |
|
549 |
{ |
|
550 |
NS_LOG_FUNCTION (this); |
|
551 |
return m_rate; |
|
552 |
} |
|
553 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
554 |
void |
6009 | 555 |
RadiotapHeader::SetChannelFrequencyAndFlags (uint16_t frequency, uint16_t flags) |
556 |
{ |
|
557 |
NS_LOG_FUNCTION (this << frequency << flags); |
|
558 |
m_channelFreq = frequency; |
|
559 |
m_channelFlags = flags; |
|
560 |
||
561 |
if (!(m_present & RADIOTAP_CHANNEL)) |
|
562 |
{ |
|
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
563 |
m_channelPad = ((2 - m_length % 2) % 2); |
6009 | 564 |
m_present |= RADIOTAP_CHANNEL; |
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
565 |
m_length += (4 + m_channelPad); |
6009 | 566 |
} |
567 |
||
568 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
|
569 |
} |
|
570 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
571 |
uint16_t |
6009 | 572 |
RadiotapHeader::GetChannelFrequency (void) const |
573 |
{ |
|
574 |
NS_LOG_FUNCTION (this); |
|
575 |
return m_channelFreq; |
|
576 |
} |
|
577 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
578 |
uint16_t |
6009 | 579 |
RadiotapHeader::GetChannelFlags (void) const |
580 |
{ |
|
581 |
NS_LOG_FUNCTION (this); |
|
582 |
return m_channelFlags; |
|
583 |
} |
|
584 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
585 |
void |
7027
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
586 |
RadiotapHeader::SetAntennaSignalPower (double signal) |
6009 | 587 |
{ |
588 |
NS_LOG_FUNCTION (this << signal); |
|
589 |
||
590 |
if (!(m_present & RADIOTAP_DBM_ANTSIGNAL)) |
|
591 |
{ |
|
592 |
m_present |= RADIOTAP_DBM_ANTSIGNAL; |
|
593 |
m_length += 1; |
|
594 |
} |
|
7027
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
595 |
if (signal > 127) |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
596 |
{ |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
597 |
m_antennaSignal = 127; |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
598 |
} |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
599 |
else if (signal < -128) |
6009 | 600 |
{ |
7027
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
601 |
m_antennaSignal = -128; |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
602 |
} |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
603 |
else |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
604 |
{ |
7256
b04ba6772f8c
rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents:
7182
diff
changeset
|
605 |
m_antennaSignal = static_cast<int8_t> (floor (signal + 0.5)); |
6009 | 606 |
} |
607 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
608 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
609 |
} |
6009 | 610 |
|
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
611 |
uint8_t |
6009 | 612 |
RadiotapHeader::GetAntennaSignalPower (void) const |
613 |
{ |
|
614 |
NS_LOG_FUNCTION (this); |
|
615 |
return m_antennaSignal; |
|
616 |
} |
|
617 |
||
7182
5ecfee5d17de
network coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
7027
diff
changeset
|
618 |
void |
7027
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
619 |
RadiotapHeader::SetAntennaNoisePower (double noise) |
6009 | 620 |
{ |
621 |
NS_LOG_FUNCTION (this << noise); |
|
622 |
||
623 |
if (!(m_present & RADIOTAP_DBM_ANTNOISE)) |
|
624 |
{ |
|
625 |
m_present |= RADIOTAP_DBM_ANTNOISE; |
|
626 |
m_length += 1; |
|
627 |
} |
|
7027
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
628 |
if (noise > 127.0) |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
629 |
{ |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
630 |
m_antennaNoise = 127; |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
631 |
} |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
632 |
else if (noise < -128.0) |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
633 |
{ |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
634 |
m_antennaNoise = -128; |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
635 |
} |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
636 |
else |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
637 |
{ |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
638 |
m_antennaNoise = static_cast<int8_t> (floor (noise + 0.5)); |
169e09e9428d
avoid ambiguous method overloads for python bindings
Mathieu Lacage <mathieu.lacage@inria.fr>
parents:
6823
diff
changeset
|
639 |
} |
6009 | 640 |
|
641 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
|
642 |
} |
|
643 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
644 |
uint8_t |
6009 | 645 |
RadiotapHeader::GetAntennaNoisePower (void) const |
646 |
{ |
|
647 |
NS_LOG_FUNCTION (this); |
|
648 |
return m_antennaNoise; |
|
649 |
} |
|
650 |
||
11479
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
651 |
void |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
652 |
RadiotapHeader::SetMcsFields (uint8_t known, uint8_t flags, uint8_t mcs) |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
653 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
654 |
NS_LOG_FUNCTION (this << known << flags << mcs); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
655 |
m_mcsKnown = known; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
656 |
m_mcsFlags = flags; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
657 |
m_mcsRate = mcs; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
658 |
if (!(m_present & RADIOTAP_MCS)) |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
659 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
660 |
m_present |= RADIOTAP_MCS; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
661 |
m_length += 3; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
662 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
663 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
664 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
665 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
666 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
667 |
uint8_t |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
668 |
RadiotapHeader::GetMcsKnown () const |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
669 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
670 |
NS_LOG_FUNCTION (this); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
671 |
return m_mcsKnown; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
672 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
673 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
674 |
uint8_t |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
675 |
RadiotapHeader::GetMcsFlags () const |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
676 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
677 |
NS_LOG_FUNCTION (this); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
678 |
return m_mcsFlags; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
679 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
680 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
681 |
uint8_t |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
682 |
RadiotapHeader::GetMcsRate () const |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
683 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
684 |
NS_LOG_FUNCTION (this); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
685 |
return m_mcsRate; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
686 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
687 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
688 |
void |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
689 |
RadiotapHeader::SetAmpduStatus (uint32_t referenceNumber, uint16_t flags, uint8_t crc) |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
690 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
691 |
NS_LOG_FUNCTION (this << referenceNumber << flags); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
692 |
m_ampduStatusRef = referenceNumber; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
693 |
m_ampduStatusFlags = flags; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
694 |
m_ampduStatusCRC = crc; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
695 |
if (!(m_present & RADIOTAP_AMPDU_STATUS)) |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
696 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
697 |
m_ampduStatusPad = ((4 - m_length % 4) % 4); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
698 |
m_present |= RADIOTAP_AMPDU_STATUS; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
699 |
m_length += (8 + m_ampduStatusPad); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
700 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
701 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
702 |
NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
703 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
704 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
705 |
uint32_t |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
706 |
RadiotapHeader::GetAmpduStatusRef () const |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
707 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
708 |
NS_LOG_FUNCTION (this); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
709 |
return m_ampduStatusRef; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
710 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
711 |
|
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
712 |
uint16_t |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
713 |
RadiotapHeader::GetAmpduStatusFlags () const |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
714 |
{ |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
715 |
NS_LOG_FUNCTION (this); |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
716 |
return m_ampduStatusFlags; |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
717 |
} |
a3dcf66928f3
add support for HT MCS and A-MPDU in radiotap headers
Sébastien Deronne <sebastien.deronne@gmail.com>
parents:
11238
diff
changeset
|
718 |
|
6009 | 719 |
} // namespace ns3 |