author | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
---|---|---|
committer | mjm <mjm> | 2002-11-27 22:06:43 (UTC) |
commit | 31a16f8dc73d79178a4840d9e7aa4a07bfd65a26 (patch) (unidiff) | |
tree | 25ca113de74febde5d72a46d09315bd9d329ef8f /noncore/net/wellenreiter/daemon/source/ieee802_11.hh | |
parent | 2a84b561e50f8fd7973b56b3b0a87471f6b5f18c (diff) | |
download | opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.zip opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.gz opie-31a16f8dc73d79178a4840d9e7aa4a07bfd65a26.tar.bz2 |
moved cardmode and sniffer to library to provide a generic lib.
Diffstat (limited to 'noncore/net/wellenreiter/daemon/source/ieee802_11.hh') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/daemon/source/ieee802_11.hh | 250 |
1 files changed, 0 insertions, 250 deletions
diff --git a/noncore/net/wellenreiter/daemon/source/ieee802_11.hh b/noncore/net/wellenreiter/daemon/source/ieee802_11.hh deleted file mode 100644 index 3cc5343..0000000 --- a/noncore/net/wellenreiter/daemon/source/ieee802_11.hh +++ b/dev/null | |||
@@ -1,250 +0,0 @@ | |||
1 | /* $Id$ */ | ||
2 | /* | ||
3 | * Copyright (c) 2001 | ||
4 | *Fortress Technologies | ||
5 | * Charlie Lenahan ( clenahan@fortresstech.com ) | ||
6 | * | ||
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 | ||
18 | * written permission. | ||
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. | ||
22 | */ | ||
23 | |||
24 | #ifndef IEEE802_11_HH | ||
25 | #define IEEE802_11_HH | ||
26 | |||
27 | #define IEEE802_11_FC_LEN2 | ||
28 | |||
29 | #define T_MGMT 0x0 /* management */ | ||
30 | #define T_CTRL 0x1 /* control */ | ||
31 | #define T_DATA 0x2 /* data */ | ||
32 | #define T_RESV 0x3 /* reserved */ | ||
33 | |||
34 | #define ST_ASSOC_REQUEST 0x0 | ||
35 | #define ST_ASSOC_RESPONSE 0x1 | ||
36 | #define ST_REASSOC_REQUEST 0x2 | ||
37 | #define ST_REASSOC_RESPONSE 0x3 | ||
38 | #define ST_PROBE_REQUEST 0x4 | ||
39 | #define ST_PROBE_RESPONSE 0x5 | ||
40 | /* RESERVED 0x6 */ | ||
41 | /* RESERVED 0x7 */ | ||
42 | #define ST_BEACON 0x8 | ||
43 | #define ST_ATIM 0x9 | ||
44 | #define ST_DISASSOC 0xA | ||
45 | #define ST_AUTH 0xB | ||
46 | #define ST_DEAUTH 0xC | ||
47 | /* RESERVED 0xD */ | ||
48 | /* RESERVED 0xE */ | ||
49 | /* RESERVED 0xF */ | ||
50 | |||
51 | |||
52 | #define CTRL_PS_POLL0xA | ||
53 | #define CTRL_RTS0xB | ||
54 | #define CTRL_CTS0xC | ||
55 | #define CTRL_ACK0xD | ||
56 | #define CTRL_CF_END0xE | ||
57 | #define CTRL_END_ACK0xF | ||
58 | |||
59 | /* | ||
60 | * Bits in the frame control field. | ||
61 | */ | ||
62 | #define FC_VERSION(fc) ((fc) & 0x3) | ||
63 | #define FC_TYPE(fc) (((fc) >> 2) & 0x3) | ||
64 | #define FC_SUBTYPE(fc) (((fc) >> 4) & 0xF) | ||
65 | #define FC_TO_DS(fc) ((fc) & 0x0100) | ||
66 | #define FC_FROM_DS(fc) ((fc) & 0x0200) | ||
67 | #define FC_MORE_FLAG(fc)((fc) & 0x0400) | ||
68 | #define FC_RETRY(fc) ((fc) & 0x0800) | ||
69 | #define FC_POWER_MGMT(fc)((fc) & 0x1000) | ||
70 | #define FC_MORE_DATA(fc)((fc) & 0x2000) | ||
71 | #define FC_WEP(fc) ((fc) & 0x4000) | ||
72 | #define FC_ORDER(fc) ((fc) & 0x8000) | ||
73 | |||
74 | struct mgmt_header_t { | ||
75 | u_int16_tfc; | ||
76 | u_int16_t duration; | ||
77 | u_int8_tda[6]; | ||
78 | u_int8_tsa[6]; | ||
79 | u_int8_tbssid[6]; | ||
80 | u_int16_tseq_ctrl; | ||
81 | }; | ||
82 | |||
83 | #define MGMT_HEADER_LEN(2+2+6+6+6+2) | ||
84 | |||
85 | #define CAPABILITY_ESS(cap)((cap) & 0x0001) | ||
86 | #define CAPABILITY_IBSS(cap)((cap) & 0x0002) | ||
87 | #define CAPABILITY_CFP(cap)((cap) & 0x0004) | ||
88 | #define CAPABILITY_CFP_REQ(cap)((cap) & 0x0008) | ||
89 | #define CAPABILITY_PRIVACY(cap)((cap) & 0x0010) | ||
90 | |||
91 | struct ssid_t { | ||
92 | u_int8_telement_id; | ||
93 | u_int8_tlength; | ||
94 | u_char ssid[33]; /* 32 + 1 for null */ | ||
95 | } ; | ||
96 | |||
97 | struct rates_t { | ||
98 | u_int8_telement_id; | ||
99 | u_int8_tlength; | ||
100 | u_int8_trate[8]; | ||
101 | }; | ||
102 | |||
103 | struct challenge_t { | ||
104 | u_int8_telement_id; | ||
105 | u_int8_tlength; | ||
106 | u_int8_ttext[254]; /* 1-253 + 1 for null */ | ||
107 | }; | ||
108 | struct fh_t { | ||
109 | u_int8_telement_id; | ||
110 | u_int8_tlength; | ||
111 | u_int16_tdwell_time; | ||
112 | u_int8_thop_set; | ||
113 | u_int8_t hop_pattern; | ||
114 | u_int8_thop_index; | ||
115 | }; | ||
116 | |||
117 | struct ds_t { | ||
118 | u_int8_telement_id; | ||
119 | u_int8_tlength; | ||
120 | u_int8_tchannel; | ||
121 | }; | ||
122 | |||
123 | struct cf_t { | ||
124 | u_int8_telement_id; | ||
125 | u_int8_tlength; | ||
126 | u_int8_tcount; | ||
127 | u_int8_tperiod; | ||
128 | u_int16_tmax_duration; | ||
129 | u_int16_tdur_remaing; | ||
130 | }; | ||
131 | |||
132 | struct tim_t { | ||
133 | u_int8_telement_id; | ||
134 | u_int8_tlength; | ||
135 | u_int8_tcount; | ||
136 | u_int8_tperiod; | ||
137 | u_int8_tbitmap_control; | ||
138 | u_int8_tbitmap[251]; | ||
139 | }; | ||
140 | |||
141 | #define E_SSID 0 | ||
142 | #define E_RATES 1 | ||
143 | #define E_FH 2 | ||
144 | #define E_DS 3 | ||
145 | #define E_CF 4 | ||
146 | #define E_TIM 5 | ||
147 | #define E_IBSS 6 | ||
148 | #define E_CISCO 133 | ||
149 | /* reserved 7 */ | ||
150 | /* reserved 8 */ | ||
151 | /* reserved 9 */ | ||
152 | /* reserved 10 */ | ||
153 | /* reserved 11 */ | ||
154 | /* reserved 12 */ | ||
155 | /* reserved 13 */ | ||
156 | /* reserved 14 */ | ||
157 | /* reserved 15 */ | ||
158 | /* reserved 16 */ | ||
159 | |||
160 | #define E_CHALLENGE 16 | ||
161 | /* reserved 17 */ | ||
162 | /* reserved 18 */ | ||
163 | /* reserved 19 */ | ||
164 | /* reserved 16 */ | ||
165 | /* reserved 16 */ | ||
166 | |||
167 | |||
168 | struct mgmt_body_t { | ||
169 | u_int8_t timestamp[8]; | ||
170 | u_int16_t beacon_interval; | ||
171 | u_int16_t listen_interval; | ||
172 | u_int16_t status_code; | ||
173 | u_int16_t aid; | ||
174 | u_char ap[6]; | ||
175 | u_int16_treason_code; | ||
176 | u_int16_tauth_alg; | ||
177 | u_int16_tauth_trans_seq_num; | ||
178 | struct challenge_t challenge; | ||
179 | u_int16_tcapability_info; | ||
180 | struct ssid_tssid; | ||
181 | struct rates_t rates; | ||
182 | struct ds_tds; | ||
183 | struct cf_tcf; | ||
184 | struct fh_tfh; | ||
185 | struct tim_ttim; | ||
186 | }; | ||
187 | |||
188 | struct ctrl_rts_t { | ||
189 | u_int16_tfc; | ||
190 | u_int16_tduration; | ||
191 | u_int8_tra[6]; | ||
192 | u_int8_tta[6]; | ||
193 | u_int8_tfcs[4]; | ||
194 | }; | ||
195 | |||
196 | #define CTRL_RTS_LEN(2+2+6+6+4) | ||
197 | |||
198 | struct ctrl_cts_t { | ||
199 | u_int16_tfc; | ||
200 | u_int16_tduration; | ||
201 | u_int8_tra[6]; | ||
202 | u_int8_tfcs[4]; | ||
203 | }; | ||
204 | |||
205 | #define CTRL_CTS_LEN(2+2+6+4) | ||
206 | |||
207 | struct ctrl_ack_t { | ||
208 | u_int16_tfc; | ||
209 | u_int16_tduration; | ||
210 | u_int8_tra[6]; | ||
211 | u_int8_tfcs[4]; | ||
212 | }; | ||
213 | |||
214 | #define CTRL_ACK_LEN(2+2+6+4) | ||
215 | |||
216 | struct ctrl_ps_poll_t { | ||
217 | u_int16_tfc; | ||
218 | u_int16_taid; | ||
219 | u_int8_tbssid[6]; | ||
220 | u_int8_tta[6]; | ||
221 | u_int8_tfcs[4]; | ||
222 | }; | ||
223 | |||
224 | #define CTRL_PS_POLL_LEN(2+2+6+6+4) | ||
225 | |||
226 | struct ctrl_end_t { | ||
227 | u_int16_tfc; | ||
228 | u_int16_tduration; | ||
229 | u_int8_tra[6]; | ||
230 | u_int8_tbssid[6]; | ||
231 | u_int8_tfcs[4]; | ||
232 | }; | ||
233 | |||
234 | #define CTRL_END_LEN(2+2+6+6+4) | ||
235 | |||
236 | struct ctrl_end_ack_t { | ||
237 | u_int16_tfc; | ||
238 | u_int16_tduration; | ||
239 | u_int8_tra[6]; | ||
240 | u_int8_tbssid[6]; | ||
241 | u_int8_tfcs[4]; | ||
242 | }; | ||
243 | |||
244 | #define CTRL_END_ACK_LEN(2+2+6+6+4) | ||
245 | |||
246 | #define IV_IV(iv)((iv) & 0xFFFFFF) | ||
247 | #define IV_PAD(iv)(((iv) >> 24) & 0x3F) | ||
248 | #define IV_KEYID(iv)(((iv) >> 30) & 0x03) | ||
249 | |||
250 | #endif /* IEEE802_11_HH */ | ||