summaryrefslogtreecommitdiff
path: root/src/transport/ieee80211_radiotap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/ieee80211_radiotap.h')
-rw-r--r--src/transport/ieee80211_radiotap.h60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/transport/ieee80211_radiotap.h b/src/transport/ieee80211_radiotap.h
index ed1cd69dd..f05449f18 100644
--- a/src/transport/ieee80211_radiotap.h
+++ b/src/transport/ieee80211_radiotap.h
@@ -40,7 +40,7 @@
40// #include <asm/unaligned.h> 40// #include <asm/unaligned.h>
41 41
42/* Base version of the radiotap packet header data */ 42/* Base version of the radiotap packet header data */
43#define PKTHDR_RADIOTAP_VERSION 0 43#define PKTHDR_RADIOTAP_VERSION 0
44 44
45/* A generic radio capture format is desirable. There is one for 45/* A generic radio capture format is desirable. There is one for
46 * Linux, but it is neither rigidly defined (there were not even 46 * Linux, but it is neither rigidly defined (there were not even
@@ -61,8 +61,7 @@
61 * The radio capture header precedes the 802.11 header. 61 * The radio capture header precedes the 802.11 header.
62 * All data in the header is little endian on all platforms. 62 * All data in the header is little endian on all platforms.
63 */ 63 */
64struct ieee80211_radiotap_header 64struct ieee80211_radiotap_header {
65{
66 u8 it_version; /* Version 0. Only increases 65 u8 it_version; /* Version 0. Only increases
67 * for drastic changes, 66 * for drastic changes,
68 * introduction of compatible 67 * introduction of compatible
@@ -180,8 +179,7 @@ struct ieee80211_radiotap_header
180 * Number of unicast retries a transmitted frame used. 179 * Number of unicast retries a transmitted frame used.
181 * 180 *
182 */ 181 */
183enum ieee80211_radiotap_type 182enum ieee80211_radiotap_type {
184{
185 IEEE80211_RADIOTAP_TSFT = 0, 183 IEEE80211_RADIOTAP_TSFT = 0,
186 IEEE80211_RADIOTAP_FLAGS = 1, 184 IEEE80211_RADIOTAP_FLAGS = 1,
187 IEEE80211_RADIOTAP_RATE = 2, 185 IEEE80211_RADIOTAP_RATE = 2,
@@ -208,68 +206,68 @@ enum ieee80211_radiotap_type
208}; 206};
209 207
210/* Channel flags. */ 208/* Channel flags. */
211#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ 209#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */
212#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ 210#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */
213#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ 211#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */
214#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ 212#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */
215#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ 213#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */
216#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ 214#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
217#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ 215#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
218#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ 216#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
219 217
220/* For IEEE80211_RADIOTAP_FLAGS */ 218/* For IEEE80211_RADIOTAP_FLAGS */
221#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received 219#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
222 * during CFP 220 * during CFP
223 */ 221 */
224#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received 222#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received
225 * with short 223 * with short
226 * preamble 224 * preamble
227 */ 225 */
228#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received 226#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received
229 * with WEP encryption 227 * with WEP encryption
230 */ 228 */
231#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received 229#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received
232 * with fragmentation 230 * with fragmentation
233 */ 231 */
234#define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ 232#define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */
235#define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between 233#define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between
236 * 802.11 header and payload 234 * 802.11 header and payload
237 * (to 32-bit boundary) 235 * (to 32-bit boundary)
238 */ 236 */
239#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* bad FCS */ 237#define IEEE80211_RADIOTAP_F_BADFCS 0x40 /* bad FCS */
240 238
241/* For IEEE80211_RADIOTAP_RX_FLAGS */ 239/* For IEEE80211_RADIOTAP_RX_FLAGS */
242#define IEEE80211_RADIOTAP_F_RX_BADPLCP 0x0002 /* frame has bad PLCP */ 240#define IEEE80211_RADIOTAP_F_RX_BADPLCP 0x0002 /* frame has bad PLCP */
243 241
244/* For IEEE80211_RADIOTAP_TX_FLAGS */ 242/* For IEEE80211_RADIOTAP_TX_FLAGS */
245#define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive 243#define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive
246 * retries */ 244 * retries */
247#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ 245#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
248#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ 246#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
249 247
250/* Ugly macro to convert literal channel numbers into their mhz equivalents 248/* Ugly macro to convert literal channel numbers into their mhz equivalents
251 * There are certianly some conditions that will break this (like feeding it '30') 249 * There are certianly some conditions that will break this (like feeding it '30')
252 * but they shouldn't arise since nothing talks on channel 30. */ 250 * but they shouldn't arise since nothing talks on channel 30. */
253#define ieee80211chan2mhz(x) \ 251#define ieee80211chan2mhz(x) \
254 (((x) <= 14) ? \ 252 (((x) <= 14) ? \
255 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ 253 (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \
256 ((x) + 1000) * 5) 254 ((x) + 1000) * 5)
257 255
258/* helpers */ 256/* helpers */
259static inline u16 257static inline u16
260get_unaligned_le16 (const u8 *p) 258get_unaligned_le16(const u8 *p)
261{ 259{
262 return p[0] | p[1] << 8; 260 return p[0] | p[1] << 8;
263} 261}
264 262
265 263
266static inline int 264static inline int
267ieee80211_get_radiotap_len (unsigned char *data) 265ieee80211_get_radiotap_len(unsigned char *data)
268{ 266{
269 struct ieee80211_radiotap_header *hdr = 267 struct ieee80211_radiotap_header *hdr =
270 (struct ieee80211_radiotap_header *) data; 268 (struct ieee80211_radiotap_header *)data;
271 269
272 return get_unaligned_le16 ((const u8 *) &hdr->it_len); 270 return get_unaligned_le16((const u8 *)&hdr->it_len);
273} 271}
274 272
275#endif /* IEEE80211_RADIOTAP_H */ 273#endif /* IEEE80211_RADIOTAP_H */