1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #ifndef _NET80211_IEEE80211_IOCTL_H_
34 #define _NET80211_IEEE80211_IOCTL_H_
35
36
37
38
39
40
41 struct ieee80211_stats {
42 u_int32_t is_rx_badversion;
43 u_int32_t is_rx_tooshort;
44 u_int32_t is_rx_wrongbss;
45 u_int32_t is_rx_dup;
46 u_int32_t is_rx_wrongdir;
47 u_int32_t is_rx_mcastecho;
48 u_int32_t is_rx_notassoc;
49 u_int32_t is_rx_nowep;
50 u_int32_t is_rx_unencrypted;
51 u_int32_t is_rx_wepfail;
52 u_int32_t is_rx_decap;
53 u_int32_t is_rx_mgtdiscard;
54 u_int32_t is_rx_ctl;
55 u_int32_t is_rx_rstoobig;
56 u_int32_t is_rx_elem_missing;
57 u_int32_t is_rx_elem_toobig;
58 u_int32_t is_rx_elem_toosmall;
59 u_int32_t is_rx_elem_unknown;
60 u_int32_t is_rx_badchan;
61 u_int32_t is_rx_chanmismatch;
62 u_int32_t is_rx_nodealloc;
63 u_int32_t is_rx_ssidmismatch;
64 u_int32_t is_rx_auth_unsupported;
65 u_int32_t is_rx_auth_fail;
66 u_int32_t is_rx_assoc_bss;
67 u_int32_t is_rx_assoc_notauth;
68 u_int32_t is_rx_assoc_capmismatch;
69 u_int32_t is_rx_assoc_norate;
70 u_int32_t is_rx_deauth;
71 u_int32_t is_rx_disassoc;
72 u_int32_t is_rx_badsubtype;
73 u_int32_t is_rx_nombuf;
74 u_int32_t is_rx_decryptcrc;
75 u_int32_t is_rx_ahdemo_mgt;
76 u_int32_t is_rx_bad_auth;
77 u_int32_t is_tx_nombuf;
78 u_int32_t is_tx_nonode;
79 u_int32_t is_tx_unknownmgt;
80 u_int32_t is_scan_active;
81 u_int32_t is_scan_passive;
82 u_int32_t is_node_timeout;
83 u_int32_t is_crypto_nomem;
84 u_int32_t is_rx_assoc_badrsnie;
85 };
86
87 #define SIOCG80211STATS _IOWR('i', 242, struct ifreq)
88
89
90 struct ieee80211_nwid {
91 u_int8_t i_len;
92 u_int8_t i_nwid[IEEE80211_NWID_LEN];
93 };
94
95 #define SIOCS80211NWID _IOWR('i', 230, struct ifreq)
96 #define SIOCG80211NWID _IOWR('i', 231, struct ifreq)
97
98
99 struct ieee80211_nwkey {
100 char i_name[IFNAMSIZ];
101 int i_wepon;
102 int i_defkid;
103 struct {
104 int i_keylen;
105 u_int8_t *i_keydat;
106 } i_key[IEEE80211_WEP_NKID];
107 };
108
109 #define IEEE80211_NWKEY_OPEN 0
110 #define IEEE80211_NWKEY_WEP 1
111 #define IEEE80211_NWKEY_EAP 2
112 #define IEEE80211_NWKEY_PERSIST 0x100
113
114 #define SIOCS80211NWKEY _IOW('i', 232, struct ieee80211_nwkey)
115 #define SIOCG80211NWKEY _IOWR('i', 233, struct ieee80211_nwkey)
116
117
118 struct ieee80211_power {
119 char i_name[IFNAMSIZ];
120 int i_enabled;
121 int i_maxsleep;
122 };
123 #define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
124 #define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
125
126
127 struct ieee80211_auth {
128 char i_name[IFNAMSIZ];
129 int i_authtype;
130 };
131
132 #define IEEE80211_AUTH_NONE 0
133 #define IEEE80211_AUTH_OPEN 1
134 #define IEEE80211_AUTH_SHARED 2
135
136 #define SIOCS80211AUTH _IOW('i', 236, struct ieee80211_auth)
137 #define SIOCG80211AUTH _IOWR('i', 237, struct ieee80211_auth)
138
139
140 struct ieee80211chanreq {
141 char i_name[IFNAMSIZ];
142 u_int16_t i_channel;
143 };
144
145 #ifndef IEEE80211_CHAN_ANY
146 #define IEEE80211_CHAN_ANY 0xffff
147 #endif
148
149 #define SIOCS80211CHANNEL _IOW('i', 238, struct ieee80211chanreq)
150 #define SIOCG80211CHANNEL _IOWR('i', 239, struct ieee80211chanreq)
151
152
153 struct ieee80211_bssid {
154 char i_name[IFNAMSIZ];
155 u_int8_t i_bssid[IEEE80211_ADDR_LEN];
156 };
157
158 #define SIOCS80211BSSID _IOW('i', 240, struct ieee80211_bssid)
159 #define SIOCG80211BSSID _IOWR('i', 241, struct ieee80211_bssid)
160
161
162 struct ieee80211_txpower {
163 char i_name[IFNAMSIZ];
164 int i_mode;
165 int16_t i_val;
166 };
167
168 #define SIOCS80211TXPOWER _IOW('i', 243, struct ieee80211_txpower)
169 #define SIOCG80211TXPOWER _IOWR('i', 244, struct ieee80211_txpower)
170
171 #define IEEE80211_TXPOWER_MODE_FIXED 0
172 #define IEEE80211_TXPOWER_MODE_AUTO 1
173
174
175 #define IEEE80211_SCAN_TIMEOUT 30
176
177 #define SIOCS80211SCAN _IOW('i', 210, struct ifreq)
178
179
180 struct ieee80211_nodereq {
181 char nr_ifname[IFNAMSIZ];
182
183
184 u_int8_t nr_macaddr[IEEE80211_ADDR_LEN];
185 u_int8_t nr_bssid[IEEE80211_ADDR_LEN];
186 u_int8_t nr_nwid_len;
187 u_int8_t nr_nwid[IEEE80211_NWID_LEN];
188
189
190 u_int16_t nr_channel;
191 u_int16_t nr_chan_flags;
192 u_int8_t nr_nrates;
193 u_int8_t nr_rates[IEEE80211_RATE_MAXSIZE];
194
195
196 u_int8_t nr_rssi;
197 u_int8_t nr_max_rssi;
198 u_int8_t nr_tstamp[8];
199 u_int16_t nr_intval;
200 u_int16_t nr_capinfo;
201 u_int16_t nr_fhdwell;
202 u_int8_t nr_fhindex;
203 u_int8_t nr_erp;
204 u_int8_t nr_pwrsave;
205 u_int16_t nr_associd;
206 u_int16_t nr_txseq;
207 u_int16_t nr_rxseq;
208 u_int32_t nr_fails;
209 u_int32_t nr_inact;
210 u_int8_t nr_txrate;
211 u_int16_t nr_state;
212
213
214 u_int8_t nr_flags;
215 };
216
217 #define IEEE80211_NODEREQ_STATE(_s) (1 << _s)
218 #define IEEE80211_NODEREQ_STATE_BITS \
219 "\20\01CACHE\02BSS\03AUTH\04ASSOC\05COLLECT"
220
221 #define IEEE80211_NODEREQ_RSSI(_nr) \
222 ((u_int)(((float)(_nr)->nr_rssi / (_nr)->nr_max_rssi) * 100))
223
224 #define IEEE80211_NODEREQ_STA 0x00
225 #define IEEE80211_NODEREQ_AP 0x01
226 #define IEEE80211_NODEREQ_AP_BSS 0x02
227 #define IEEE80211_NODEREQ_COPY 0x04
228
229 #define SIOCG80211NODE _IOWR('i', 211, struct ieee80211_nodereq)
230 #define SIOCS80211NODE _IOW('i', 212, struct ieee80211_nodereq)
231 #define SIOCS80211DELNODE _IOW('i', 213, struct ieee80211_nodereq)
232
233
234 struct ieee80211_nodereq_all {
235 char na_ifname[IFNAMSIZ];
236
237 int na_nodes;
238 size_t na_size;
239 struct ieee80211_nodereq *na_node;
240
241
242 u_int8_t na_flags;
243 };
244
245 #define SIOCG80211ALLNODES _IOWR('i', 214, struct ieee80211_nodereq)
246
247
248 #define IEEE80211_F_HIDENWID 0x10000000
249 #define IEEE80211_F_NOBRIDGE 0x20000000
250 #define IEEE80211_F_HOSTAPMASK 0x30000000
251 #define IEEE80211_F_USERSHIFT 28
252 #define IEEE80211_F_USERBITS "\20\01HIDENWID\02NOBRIDGE"
253
254 struct ieee80211_flags {
255 const char *f_name;
256 u_int f_flag;
257 };
258
259 #define IEEE80211_FLAGS { \
260 { "hidenwid", IEEE80211_F_HIDENWID >> IEEE80211_F_USERSHIFT }, \
261 { "nobridge", IEEE80211_F_NOBRIDGE >> IEEE80211_F_USERSHIFT } \
262 }
263
264 #define SIOCG80211FLAGS _IOWR('i', 216, struct ifreq)
265 #define SIOCS80211FLAGS _IOW('i', 217, struct ifreq)
266
267 #endif