1 /* @(#) $Header: /tcpdump/master/tcpdump/ieee802_11.h,v 1.7 2003-02-04 05:53:21 guy Exp $ (LBL) */
4 * Fortress Technologies
5 * Charlie Lenahan ( clenahan@fortresstech.com )
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that: (1) source code distributions
9 * retain the above copyright notice and this paragraph in its entirety, (2)
10 * distributions including binary code include the above copyright notice and
11 * this paragraph in its entirety in the documentation or other materials
12 * provided with the distribution, and (3) all advertising materials mentioning
13 * features or use of this software display the following acknowledgement:
14 * ``This product includes software developed by the University of California,
15 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
16 * the University nor the names of its contributors may be used to endorse
17 * or promote products derived from this software without specific prior
19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24 #define IEEE802_11_FC_LEN 2
26 #define T_MGMT 0x0 /* management */
27 #define T_CTRL 0x1 /* control */
28 #define T_DATA 0x2 /* data */
29 #define T_RESV 0x3 /* reserved */
31 #define ST_ASSOC_REQUEST 0x0
32 #define ST_ASSOC_RESPONSE 0x1
33 #define ST_REASSOC_REQUEST 0x2
34 #define ST_REASSOC_RESPONSE 0x3
35 #define ST_PROBE_REQUEST 0x4
36 #define ST_PROBE_RESPONSE 0x5
41 #define ST_DISASSOC 0xA
49 #define CTRL_PS_POLL 0xA
53 #define CTRL_CF_END 0xE
54 #define CTRL_END_ACK 0xF
57 #define DATA_DATA_CF_ACK 0x1
58 #define DATA_DATA_CF_POLL 0x2
59 #define DATA_DATA_CF_ACK_POLL 0x3
60 #define DATA_NODATA 0x4
61 #define DATA_NODATA_CF_ACK 0x5
62 #define DATA_NODATA_CF_POLL 0x6
63 #define DATA_NODATA_CF_ACK_POLL 0x7
66 * Bits in the frame control field.
68 #define FC_VERSION(fc) ((fc) & 0x3)
69 #define FC_TYPE(fc) (((fc) >> 2) & 0x3)
70 #define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF)
71 #define FC_TO_DS(fc) ((fc) & 0x0100)
72 #define FC_FROM_DS(fc) ((fc) & 0x0200)
73 #define FC_MORE_FLAG(fc) ((fc) & 0x0400)
74 #define FC_RETRY(fc) ((fc) & 0x0800)
75 #define FC_POWER_MGMT(fc) ((fc) & 0x1000)
76 #define FC_MORE_DATA(fc) ((fc) & 0x2000)
77 #define FC_WEP(fc) ((fc) & 0x4000)
78 #define FC_ORDER(fc) ((fc) & 0x8000)
80 struct mgmt_header_t
{
89 #define MGMT_HEADER_LEN (2+2+6+6+6+2)
91 #define CAPABILITY_ESS(cap) ((cap) & 0x0001)
92 #define CAPABILITY_IBSS(cap) ((cap) & 0x0002)
93 #define CAPABILITY_CFP(cap) ((cap) & 0x0004)
94 #define CAPABILITY_CFP_REQ(cap) ((cap) & 0x0008)
95 #define CAPABILITY_PRIVACY(cap) ((cap) & 0x0010)
100 u_char ssid
[33]; /* 32 + 1 for null */
112 u_int8_t text
[254]; /* 1-253 + 1 for null */
117 u_int16_t dwell_time
;
119 u_int8_t hop_pattern
;
134 u_int16_t max_duration
;
135 u_int16_t dur_remaing
;
143 u_int8_t bitmap_control
;
144 u_int8_t bitmap
[251];
165 #define E_CHALLENGE 16
174 u_int8_t timestamp
[8];
175 u_int16_t beacon_interval
;
176 u_int16_t listen_interval
;
177 u_int16_t status_code
;
180 u_int16_t reason_code
;
182 u_int16_t auth_trans_seq_num
;
183 struct challenge_t challenge
;
184 u_int16_t capability_info
;
186 struct rates_t rates
;
201 #define CTRL_RTS_LEN (2+2+6+6+4)
210 #define CTRL_CTS_LEN (2+2+6+4)
219 #define CTRL_ACK_LEN (2+2+6+4)
221 struct ctrl_ps_poll_t
{
229 #define CTRL_PS_POLL_LEN (2+2+6+6+4)
239 #define CTRL_END_LEN (2+2+6+6+4)
241 struct ctrl_end_ack_t
{
249 #define CTRL_END_ACK_LEN (2+2+6+6+4)
251 #define IV_IV(iv) ((iv) & 0xFFFFFF)
252 #define IV_PAD(iv) (((iv) >> 24) & 0x3F)
253 #define IV_KEYID(iv) (((iv) >> 30) & 0x03)