ieee802_11.h (170533) | ieee802_11.h (172686) |
---|---|
1/* $FreeBSD: head/contrib/tcpdump/ieee802_11.h 170533 2007-06-11 04:04:30Z sam $ */ 2/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9 2003/07/22 17:36:57 guy Exp $ (LBL) */ | 1/* $FreeBSD: head/contrib/tcpdump/ieee802_11.h 172686 2007-10-16 02:31:48Z mlaier $ */ 2/* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.9.4.3 2007/07/22 20:01:16 guy Exp $ (LBL) */ |
3/* 4 * Copyright (c) 2001 5 * Fortress Technologies 6 * Charlie Lenahan ( clenahan@fortresstech.com ) 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that: (1) source code distributions 10 * retain the above copyright notice and this paragraph in its entirety, (2) --- 66 unchanged lines hidden (view full) --- 77#define CTRL_BAR 0x8 78#define CTRL_PS_POLL 0xA 79#define CTRL_RTS 0xB 80#define CTRL_CTS 0xC 81#define CTRL_ACK 0xD 82#define CTRL_CF_END 0xE 83#define CTRL_END_ACK 0xF 84 | 3/* 4 * Copyright (c) 2001 5 * Fortress Technologies 6 * Charlie Lenahan ( clenahan@fortresstech.com ) 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that: (1) source code distributions 10 * retain the above copyright notice and this paragraph in its entirety, (2) --- 66 unchanged lines hidden (view full) --- 77#define CTRL_BAR 0x8 78#define CTRL_PS_POLL 0xA 79#define CTRL_RTS 0xB 80#define CTRL_CTS 0xC 81#define CTRL_ACK 0xD 82#define CTRL_CF_END 0xE 83#define CTRL_END_ACK 0xF 84 |
85#define DATA_DATA 0x0 86#define DATA_DATA_CF_ACK 0x1 87#define DATA_DATA_CF_POLL 0x2 88#define DATA_DATA_CF_ACK_POLL 0x3 89#define DATA_NODATA 0x4 90#define DATA_NODATA_CF_ACK 0x5 91#define DATA_NODATA_CF_POLL 0x6 92#define DATA_NODATA_CF_ACK_POLL 0x7 | 85#define DATA_DATA 0x0 86#define DATA_DATA_CF_ACK 0x1 87#define DATA_DATA_CF_POLL 0x2 88#define DATA_DATA_CF_ACK_POLL 0x3 89#define DATA_NODATA 0x4 90#define DATA_NODATA_CF_ACK 0x5 91#define DATA_NODATA_CF_POLL 0x6 92#define DATA_NODATA_CF_ACK_POLL 0x7 |
93 | 93 |
94#define DATA_QOS_DATA 0x8 95#define DATA_QOS_DATA_CF_ACK 0x9 96#define DATA_QOS_DATA_CF_POLL 0xA 97#define DATA_QOS_DATA_CF_ACK_POLL 0xB 98#define DATA_QOS_NODATA 0xC 99#define DATA_QOS_CF_POLL_NODATA 0xE 100#define DATA_QOS_CF_ACK_POLL_NODATA 0xF 101 |
|
94/* | 102/* |
103 * The subtype field of a data frame is, in effect, composed of 4 flag 104 * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have 105 * any data), and QoS. 106 */ 107#define DATA_FRAME_IS_CF_ACK(x) ((x) & 0x01) 108#define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02) 109#define DATA_FRAME_IS_NULL(x) ((x) & 0x04) 110#define DATA_FRAME_IS_QOS(x) ((x) & 0x08) 111 112/* |
|
95 * Bits in the frame control field. 96 */ 97#define FC_VERSION(fc) ((fc) & 0x3) 98#define FC_TYPE(fc) (((fc) >> 2) & 0x3) 99#define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF) 100#define FC_TO_DS(fc) ((fc) & 0x0100) 101#define FC_FROM_DS(fc) ((fc) & 0x0200) 102#define FC_MORE_FLAG(fc) ((fc) & 0x0400) --- 17 unchanged lines hidden (view full) --- 120 IEEE802_11_BSSID_LEN+IEEE802_11_SEQ_LEN) 121 122#define CAPABILITY_ESS(cap) ((cap) & 0x0001) 123#define CAPABILITY_IBSS(cap) ((cap) & 0x0002) 124#define CAPABILITY_CFP(cap) ((cap) & 0x0004) 125#define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008) 126#define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010) 127 | 113 * Bits in the frame control field. 114 */ 115#define FC_VERSION(fc) ((fc) & 0x3) 116#define FC_TYPE(fc) (((fc) >> 2) & 0x3) 117#define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF) 118#define FC_TO_DS(fc) ((fc) & 0x0100) 119#define FC_FROM_DS(fc) ((fc) & 0x0200) 120#define FC_MORE_FLAG(fc) ((fc) & 0x0400) --- 17 unchanged lines hidden (view full) --- 138 IEEE802_11_BSSID_LEN+IEEE802_11_SEQ_LEN) 139 140#define CAPABILITY_ESS(cap) ((cap) & 0x0001) 141#define CAPABILITY_IBSS(cap) ((cap) & 0x0002) 142#define CAPABILITY_CFP(cap) ((cap) & 0x0004) 143#define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008) 144#define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010) 145 |
146typedef enum { 147 NOT_PRESENT, 148 PRESENT, 149 TRUNCATED 150} elem_status_t; 151 |
|
128struct ssid_t { 129 u_int8_t element_id; 130 u_int8_t length; 131 u_char ssid[33]; /* 32 + 1 for null */ 132}; 133 134struct rates_t { 135 u_int8_t element_id; 136 u_int8_t length; | 152struct ssid_t { 153 u_int8_t element_id; 154 u_int8_t length; 155 u_char ssid[33]; /* 32 + 1 for null */ 156}; 157 158struct rates_t { 159 u_int8_t element_id; 160 u_int8_t length; |
137 u_int8_t rate[8]; | 161 u_int8_t rate[16]; |
138}; 139 140struct challenge_t { 141 u_int8_t element_id; 142 u_int8_t length; 143 u_int8_t text[254]; /* 1-253 + 1 for null */ 144}; | 162}; 163 164struct challenge_t { 165 u_int8_t element_id; 166 u_int8_t length; 167 u_int8_t text[254]; /* 1-253 + 1 for null */ 168}; |
169 |
|
145struct fh_t { 146 u_int8_t element_id; 147 u_int8_t length; 148 u_int16_t dwell_time; 149 u_int8_t hop_set; 150 u_int8_t hop_pattern; 151 u_int8_t hop_index; 152}; --- 44 unchanged lines hidden (view full) --- 197/* reserved 17 */ 198/* reserved 18 */ 199/* reserved 19 */ 200/* reserved 16 */ 201/* reserved 16 */ 202 203 204struct mgmt_body_t { | 170struct fh_t { 171 u_int8_t element_id; 172 u_int8_t length; 173 u_int16_t dwell_time; 174 u_int8_t hop_set; 175 u_int8_t hop_pattern; 176 u_int8_t hop_index; 177}; --- 44 unchanged lines hidden (view full) --- 222/* reserved 17 */ 223/* reserved 18 */ 224/* reserved 19 */ 225/* reserved 16 */ 226/* reserved 16 */ 227 228 229struct mgmt_body_t { |
205 u_int8_t timestamp[8]; | 230 u_int8_t timestamp[IEEE802_11_TSTAMP_LEN]; |
206 u_int16_t beacon_interval; 207 u_int16_t listen_interval; 208 u_int16_t status_code; 209 u_int16_t aid; | 231 u_int16_t beacon_interval; 232 u_int16_t listen_interval; 233 u_int16_t status_code; 234 u_int16_t aid; |
210 u_char ap[6]; | 235 u_char ap[IEEE802_11_AP_LEN]; |
211 u_int16_t reason_code; 212 u_int16_t auth_alg; 213 u_int16_t auth_trans_seq_num; | 236 u_int16_t reason_code; 237 u_int16_t auth_alg; 238 u_int16_t auth_trans_seq_num; |
239 elem_status_t challenge_status; |
|
214 struct challenge_t challenge; 215 u_int16_t capability_info; | 240 struct challenge_t challenge; 241 u_int16_t capability_info; |
242 elem_status_t ssid_status; |
|
216 struct ssid_t ssid; | 243 struct ssid_t ssid; |
244 elem_status_t rates_status; |
|
217 struct rates_t rates; | 245 struct rates_t rates; |
246 elem_status_t ds_status; |
|
218 struct ds_t ds; | 247 struct ds_t ds; |
248 elem_status_t cf_status; |
|
219 struct cf_t cf; | 249 struct cf_t cf; |
250 elem_status_t fh_status; |
|
220 struct fh_t fh; | 251 struct fh_t fh; |
252 elem_status_t tim_status; |
|
221 struct tim_t tim; 222}; 223 224struct ctrl_rts_t { 225 u_int16_t fc; 226 u_int16_t duration; 227 u_int8_t ra[6]; 228 u_int8_t ta[6]; --- 74 unchanged lines hidden --- | 253 struct tim_t tim; 254}; 255 256struct ctrl_rts_t { 257 u_int16_t fc; 258 u_int16_t duration; 259 u_int8_t ra[6]; 260 u_int8_t ta[6]; --- 74 unchanged lines hidden --- |