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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
/*
* Copyright (c) 2004-2005 Atheros Communications Inc.
* All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
*
*
*
* $Id: //depot/sw/releases/olca2.0-GPL/host/os/linux/include/ieee80211_ioctl.h#1 $
*/
#ifndef _IEEE80211_IOCTL_H_
#define _IEEE80211_IOCTL_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Extracted from the MADWIFI net80211/ieee80211_ioctl.h
*/
/*
* WPA/RSN get/set key request. Specify the key/cipher
* type and whether the key is to be used for sending and/or
* receiving. The key index should be set only when working
* with global keys (use IEEE80211_KEYIX_NONE for ``no index'').
* Otherwise a unicast/pairwise key is specified by the bssid
* (on a station) or mac address (on an ap). They key length
* must include any MIC key data; otherwise it should be no
more than IEEE80211_KEYBUF_SIZE.
*/
struct ieee80211req_key {
u_int8_t ik_type; /* key/cipher type */
u_int8_t ik_pad;
u_int16_t ik_keyix; /* key index */
u_int8_t ik_keylen; /* key length in bytes */
u_int8_t ik_flags;
#define IEEE80211_KEY_XMIT 0x01
#define IEEE80211_KEY_RECV 0x02
#define IEEE80211_KEY_DEFAULT 0x80 /* default xmit key */
u_int8_t ik_macaddr[IEEE80211_ADDR_LEN];
u_int64_t ik_keyrsc; /* key receive sequence counter */
u_int64_t ik_keytsc; /* key transmit sequence counter */
u_int8_t ik_keydata[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
};
/*
* Delete a key either by index or address. Set the index
* to IEEE80211_KEYIX_NONE when deleting a unicast key.
*/
struct ieee80211req_del_key {
u_int8_t idk_keyix; /* key index */
u_int8_t idk_macaddr[IEEE80211_ADDR_LEN];
};
/*
* MLME state manipulation request. IEEE80211_MLME_ASSOC
* only makes sense when operating as a station. The other
* requests can be used when operating as a station or an
* ap (to effect a station).
*/
struct ieee80211req_mlme {
u_int8_t im_op; /* operation to perform */
#define IEEE80211_MLME_ASSOC 1 /* associate station */
#define IEEE80211_MLME_DISASSOC 2 /* disassociate station */
#define IEEE80211_MLME_DEAUTH 3 /* deauthenticate station */
#define IEEE80211_MLME_AUTHORIZE 4 /* authorize station */
#define IEEE80211_MLME_UNAUTHORIZE 5 /* unauthorize station */
u_int16_t im_reason; /* 802.11 reason code */
u_int8_t im_macaddr[IEEE80211_ADDR_LEN];
};
struct ieee80211req_addpmkid {
u_int8_t pi_bssid[IEEE80211_ADDR_LEN];
u_int8_t pi_enable;
u_int8_t pi_pmkid[16];
};
#define AUTH_ALG_OPEN_SYSTEM 0x01
#define AUTH_ALG_SHARED_KEY 0x02
#define AUTH_ALG_LEAP 0x04
struct ieee80211req_authalg {
u_int8_t auth_alg;
};
/*
* Request to add an IE to a Management Frame
*/
enum{
IEEE80211_APPIE_FRAME_BEACON = 0,
IEEE80211_APPIE_FRAME_PROBE_REQ = 1,
IEEE80211_APPIE_FRAME_PROBE_RESP = 2,
IEEE80211_APPIE_FRAME_ASSOC_REQ = 3,
IEEE80211_APPIE_FRAME_ASSOC_RESP = 4,
IEEE80211_APPIE_NUM_OF_FRAME = 5
};
/*
* The Maximum length of the IE that can be added to a Management frame
*/
#define IEEE80211_APPIE_FRAME_MAX_LEN 78
struct ieee80211req_getset_appiebuf {
u_int32_t app_frmtype; /* management frame type for which buffer is added */
u_int32_t app_buflen; /*application supplied buffer length */
u_int8_t app_buf[];
};
/*
* The following definitions are used by an application to set filter
* for receiving management frames
*/
enum {
IEEE80211_FILTER_TYPE_BEACON = 0x1,
IEEE80211_FILTER_TYPE_PROBE_REQ = 0x2,
IEEE80211_FILTER_TYPE_PROBE_RESP = 0x4,
IEEE80211_FILTER_TYPE_ASSOC_REQ = 0x8,
IEEE80211_FILTER_TYPE_ASSOC_RESP = 0x10,
IEEE80211_FILTER_TYPE_AUTH = 0x20,
IEEE80211_FILTER_TYPE_DEAUTH = 0x40,
IEEE80211_FILTER_TYPE_DISASSOC = 0x80,
IEEE80211_FILTER_TYPE_ALL = 0xFF /* used to check the valid filter bits */
};
struct ieee80211req_set_filter {
u_int32_t app_filterype; /* management frame filter type */
};
enum {
IEEE80211_PARAM_AUTHMODE = 3, /* Authentication Mode */
IEEE80211_PARAM_MCASTCIPHER = 5,
IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */
IEEE80211_PARAM_UCASTCIPHER = 8,
IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */
IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */
IEEE80211_PARAM_ROAMING = 12, /* roaming mode */
IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */
IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */
IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */
};
/*
* Values for IEEE80211_PARAM_WPA
*/
#define WPA_MODE_WPA1 1
#define WPA_MODE_WPA2 2
#define WPA_MODE_AUTO 3
#define WPA_MODE_NONE 4
#ifdef __cplusplus
}
#endif
#endif /* _IEEE80211_IOCTL_H_ */
|