diff options
Diffstat (limited to 'src/transport/wlan/ieee80211_radiotap.h')
-rw-r--r-- | src/transport/wlan/ieee80211_radiotap.h | 150 |
1 files changed, 76 insertions, 74 deletions
diff --git a/src/transport/wlan/ieee80211_radiotap.h b/src/transport/wlan/ieee80211_radiotap.h index b132d402d..f3afbecce 100644 --- a/src/transport/wlan/ieee80211_radiotap.h +++ b/src/transport/wlan/ieee80211_radiotap.h | |||
@@ -66,25 +66,26 @@ | |||
66 | /* The radio capture header precedes the 802.11 header. | 66 | /* The radio capture header precedes the 802.11 header. |
67 | * All data in the header is little endian on all platforms. | 67 | * All data in the header is little endian on all platforms. |
68 | */ | 68 | */ |
69 | struct ieee80211_radiotap_header { | 69 | struct ieee80211_radiotap_header |
70 | u8 it_version; /* Version 0. Only increases | 70 | { |
71 | * for drastic changes, | 71 | u8 it_version; /* Version 0. Only increases |
72 | * introduction of compatible | 72 | * for drastic changes, |
73 | * new fields does not count. | 73 | * introduction of compatible |
74 | */ | 74 | * new fields does not count. |
75 | u8 it_pad; | 75 | */ |
76 | u16 it_len; /* length of the whole | 76 | u8 it_pad; |
77 | * header in bytes, including | 77 | u16 it_len; /* length of the whole |
78 | * it_version, it_pad, | 78 | * header in bytes, including |
79 | * it_len, and data fields. | 79 | * it_version, it_pad, |
80 | */ | 80 | * it_len, and data fields. |
81 | u32 it_present; /* A bitmap telling which | 81 | */ |
82 | * fields are present. Set bit 31 | 82 | u32 it_present; /* A bitmap telling which |
83 | * (0x80000000) to extend the | 83 | * fields are present. Set bit 31 |
84 | * bitmap by another 32 bits. | 84 | * (0x80000000) to extend the |
85 | * Additional extensions are made | 85 | * bitmap by another 32 bits. |
86 | * by setting bit 31. | 86 | * Additional extensions are made |
87 | */ | 87 | * by setting bit 31. |
88 | */ | ||
88 | }; | 89 | }; |
89 | 90 | ||
90 | #define IEEE80211_RADIOTAP_PRESENT_EXTEND_MASK 0x80000000 | 91 | #define IEEE80211_RADIOTAP_PRESENT_EXTEND_MASK 0x80000000 |
@@ -186,68 +187,69 @@ struct ieee80211_radiotap_header { | |||
186 | * Number of unicast retries a transmitted frame used. | 187 | * Number of unicast retries a transmitted frame used. |
187 | * | 188 | * |
188 | */ | 189 | */ |
189 | enum ieee80211_radiotap_type { | 190 | enum ieee80211_radiotap_type |
190 | IEEE80211_RADIOTAP_TSFT = 0, | 191 | { |
191 | IEEE80211_RADIOTAP_FLAGS = 1, | 192 | IEEE80211_RADIOTAP_TSFT = 0, |
192 | IEEE80211_RADIOTAP_RATE = 2, | 193 | IEEE80211_RADIOTAP_FLAGS = 1, |
193 | IEEE80211_RADIOTAP_CHANNEL = 3, | 194 | IEEE80211_RADIOTAP_RATE = 2, |
194 | IEEE80211_RADIOTAP_FHSS = 4, | 195 | IEEE80211_RADIOTAP_CHANNEL = 3, |
195 | IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, | 196 | IEEE80211_RADIOTAP_FHSS = 4, |
196 | IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, | 197 | IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, |
197 | IEEE80211_RADIOTAP_LOCK_QUALITY = 7, | 198 | IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, |
198 | IEEE80211_RADIOTAP_TX_ATTENUATION = 8, | 199 | IEEE80211_RADIOTAP_LOCK_QUALITY = 7, |
199 | IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, | 200 | IEEE80211_RADIOTAP_TX_ATTENUATION = 8, |
200 | IEEE80211_RADIOTAP_DBM_TX_POWER = 10, | 201 | IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, |
201 | IEEE80211_RADIOTAP_ANTENNA = 11, | 202 | IEEE80211_RADIOTAP_DBM_TX_POWER = 10, |
202 | IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, | 203 | IEEE80211_RADIOTAP_ANTENNA = 11, |
203 | IEEE80211_RADIOTAP_DB_ANTNOISE = 13, | 204 | IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, |
204 | IEEE80211_RADIOTAP_RX_FLAGS = 14, | 205 | IEEE80211_RADIOTAP_DB_ANTNOISE = 13, |
205 | IEEE80211_RADIOTAP_TX_FLAGS = 15, | 206 | IEEE80211_RADIOTAP_RX_FLAGS = 14, |
206 | IEEE80211_RADIOTAP_RTS_RETRIES = 16, | 207 | IEEE80211_RADIOTAP_TX_FLAGS = 15, |
207 | IEEE80211_RADIOTAP_DATA_RETRIES = 17, | 208 | IEEE80211_RADIOTAP_RTS_RETRIES = 16, |
208 | IEEE80211_RADIOTAP_EXT = 31 | 209 | IEEE80211_RADIOTAP_DATA_RETRIES = 17, |
210 | IEEE80211_RADIOTAP_EXT = 31 | ||
209 | }; | 211 | }; |
210 | 212 | ||
211 | /* Channel flags. */ | 213 | /* Channel flags. */ |
212 | #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ | 214 | #define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ |
213 | #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ | 215 | #define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ |
214 | #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ | 216 | #define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ |
215 | #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ | 217 | #define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ |
216 | #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ | 218 | #define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ |
217 | #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ | 219 | #define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ |
218 | #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ | 220 | #define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ |
219 | #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ | 221 | #define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ |
220 | 222 | ||
221 | /* For IEEE80211_RADIOTAP_FLAGS */ | 223 | /* For IEEE80211_RADIOTAP_FLAGS */ |
222 | #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received | 224 | #define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received |
223 | * during CFP | 225 | * during CFP |
224 | */ | 226 | */ |
225 | #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received | 227 | #define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received |
226 | * with short | 228 | * with short |
227 | * preamble | 229 | * preamble |
228 | */ | 230 | */ |
229 | #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received | 231 | #define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received |
230 | * with WEP encryption | 232 | * with WEP encryption |
231 | */ | 233 | */ |
232 | #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received | 234 | #define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received |
233 | * with fragmentation | 235 | * with fragmentation |
234 | */ | 236 | */ |
235 | #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ | 237 | #define IEEE80211_RADIOTAP_F_FCS 0x10 /* frame includes FCS */ |
236 | #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between | 238 | #define IEEE80211_RADIOTAP_F_DATAPAD 0x20 /* frame has padding between |
237 | * 802.11 header and payload | 239 | * 802.11 header and payload |
238 | * (to 32-bit boundary) | 240 | * (to 32-bit boundary) |
239 | */ | 241 | */ |
240 | /* For IEEE80211_RADIOTAP_RX_FLAGS */ | 242 | /* For IEEE80211_RADIOTAP_RX_FLAGS */ |
241 | #define IEEE80211_RADIOTAP_F_RX_BADFCS 0x0001 /* frame failed crc check */ | 243 | #define IEEE80211_RADIOTAP_F_RX_BADFCS 0x0001 /* frame failed crc check */ |
242 | 244 | ||
243 | /* For IEEE80211_RADIOTAP_TX_FLAGS */ | 245 | /* For IEEE80211_RADIOTAP_TX_FLAGS */ |
244 | #define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive | 246 | #define IEEE80211_RADIOTAP_F_TX_FAIL 0x0001 /* failed due to excessive |
245 | * retries */ | 247 | * retries */ |
246 | #define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ | 248 | #define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ |
247 | #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ | 249 | #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ |
248 | #define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* frame should not be ACKed */ | 250 | #define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* frame should not be ACKed */ |
249 | #define IEEE80211_RADIOTAP_F_TX_NOSEQ 0x0010 /* sequence number handled | 251 | #define IEEE80211_RADIOTAP_F_TX_NOSEQ 0x0010 /* sequence number handled |
250 | * by userspace */ | 252 | * by userspace */ |
251 | 253 | ||
252 | /* Ugly macro to convert literal channel numbers into their mhz equivalents | 254 | /* Ugly macro to convert literal channel numbers into their mhz equivalents |
253 | * There are certianly some conditions that will break this (like feeding it '30') | 255 | * There are certianly some conditions that will break this (like feeding it '30') |
@@ -257,4 +259,4 @@ enum ieee80211_radiotap_type { | |||
257 | (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ | 259 | (((x) == 14) ? 2484 : ((x) * 5) + 2407) : \ |
258 | ((x) + 1000) * 5) | 260 | ((x) + 1000) * 5) |
259 | 261 | ||
260 | #endif /* IEEE80211_RADIOTAP_H */ | 262 | #endif /* IEEE80211_RADIOTAP_H */ |