cfg80211/nl80211: station handling
[linux-2.6-block.git] / include / linux / nl80211.h
CommitLineData
704232c2
JB
1#ifndef __LINUX_NL80211_H
2#define __LINUX_NL80211_H
3/*
4 * 802.11 netlink interface public header
5 *
6 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
7 */
8
5727ef1b
JB
9/**
10 * DOC: Station handling
11 *
12 * Stations are added per interface, but a special case exists with VLAN
13 * interfaces. When a station is bound to an AP interface, it may be moved
14 * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
15 * The station is still assumed to belong to the AP interface it was added
16 * to.
17 *
18 * TODO: need more info?
19 */
20
55682965
JB
21/**
22 * enum nl80211_commands - supported nl80211 commands
23 *
24 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
25 *
26 * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
27 * to get a list of all present wiphys.
28 * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
29 * %NL80211_ATTR_WIPHY_NAME.
30 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
31 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
32 * %NL80211_ATTR_WIPHY_NAME.
33 * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
34 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
35 *
36 * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
37 * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
38 * on an %NL80211_ATTR_IFINDEX is supported.
39 * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
40 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
41 * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
42 * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
43 * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
44 * be sent from userspace to request creation of a new virtual interface,
45 * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
46 * %NL80211_ATTR_IFNAME.
47 * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
48 * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
49 * userspace to request deletion of a virtual interface, then requires
50 * attribute %NL80211_ATTR_IFINDEX.
51 *
41ade00f
JB
52 * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
53 * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
54 * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or
55 * %NL80211_ATTR_KEY_THRESHOLD.
56 * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
57 * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
58 * attributes.
59 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
60 * or %NL80211_ATTR_MAC.
61 *
ed1b6cc7
JB
62 * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a
63 * %NL80222_CMD_NEW_BEACON message)
64 * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
65 * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
66 * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes.
67 * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
68 * parameters are like for %NL80211_CMD_SET_BEACON.
69 * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
70 *
5727ef1b
JB
71 * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
72 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
73 * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
74 * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
75 * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
76 * the interface identified by %NL80211_ATTR_IFINDEX.
77 * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
78 * or, if no MAC address given, all stations, on the interface identified
79 * by %NL80211_ATTR_IFINDEX.
80 *
55682965
JB
81 * @NL80211_CMD_MAX: highest used command number
82 * @__NL80211_CMD_AFTER_LAST: internal use
83 */
84enum nl80211_commands {
85/* don't change the order or add anything inbetween, this is ABI! */
86 NL80211_CMD_UNSPEC,
87
88 NL80211_CMD_GET_WIPHY, /* can dump */
89 NL80211_CMD_SET_WIPHY,
90 NL80211_CMD_NEW_WIPHY,
91 NL80211_CMD_DEL_WIPHY,
92
93 NL80211_CMD_GET_INTERFACE, /* can dump */
94 NL80211_CMD_SET_INTERFACE,
95 NL80211_CMD_NEW_INTERFACE,
96 NL80211_CMD_DEL_INTERFACE,
97
41ade00f
JB
98 NL80211_CMD_GET_KEY,
99 NL80211_CMD_SET_KEY,
100 NL80211_CMD_NEW_KEY,
101 NL80211_CMD_DEL_KEY,
102
ed1b6cc7
JB
103 NL80211_CMD_GET_BEACON,
104 NL80211_CMD_SET_BEACON,
105 NL80211_CMD_NEW_BEACON,
106 NL80211_CMD_DEL_BEACON,
107
5727ef1b
JB
108 NL80211_CMD_GET_STATION,
109 NL80211_CMD_SET_STATION,
110 NL80211_CMD_NEW_STATION,
111 NL80211_CMD_DEL_STATION,
112
55682965
JB
113 /* add commands here */
114
115 /* used to define NL80211_CMD_MAX below */
116 __NL80211_CMD_AFTER_LAST,
117 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
118};
119
120
121/**
122 * enum nl80211_attrs - nl80211 netlink attributes
123 *
124 * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
125 *
126 * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
127 * /sys/class/ieee80211/<phyname>/index
128 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
129 *
130 * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
131 * @NL80211_ATTR_IFNAME: network interface name
132 * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
133 *
41ade00f
JB
134 * @NL80211_ATTR_MAC: MAC address (various uses)
135 *
136 * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
137 * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
138 * keys
139 * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
140 * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
141 * section 7.3.2.25.1, e.g. 0x000FAC04)
142 * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
143 * CCMP keys, each six bytes in little endian
144 *
ed1b6cc7
JB
145 * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
146 * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
147 * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
148 * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
149 *
5727ef1b
JB
150 * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
151 * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
152 * &enum nl80211_sta_flags.
153 * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
154 * IEEE 802.11 7.3.1.6 (u16).
155 * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
156 * rates as defined by IEEE 802.11 7.3.2.2 but without the length
157 * restriction (at most %NL80211_MAX_SUPP_RATES).
158 * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
159 * to, or the AP interface the station was originally added to to.
160 *
55682965
JB
161 * @NL80211_ATTR_MAX: highest attribute number currently defined
162 * @__NL80211_ATTR_AFTER_LAST: internal use
163 */
164enum nl80211_attrs {
165/* don't change the order or add anything inbetween, this is ABI! */
166 NL80211_ATTR_UNSPEC,
167
168 NL80211_ATTR_WIPHY,
169 NL80211_ATTR_WIPHY_NAME,
170
171 NL80211_ATTR_IFINDEX,
172 NL80211_ATTR_IFNAME,
173 NL80211_ATTR_IFTYPE,
174
41ade00f
JB
175 NL80211_ATTR_MAC,
176
177 NL80211_ATTR_KEY_DATA,
178 NL80211_ATTR_KEY_IDX,
179 NL80211_ATTR_KEY_CIPHER,
180 NL80211_ATTR_KEY_SEQ,
181 NL80211_ATTR_KEY_DEFAULT,
182
ed1b6cc7
JB
183 NL80211_ATTR_BEACON_INTERVAL,
184 NL80211_ATTR_DTIM_PERIOD,
185 NL80211_ATTR_BEACON_HEAD,
186 NL80211_ATTR_BEACON_TAIL,
187
5727ef1b
JB
188 NL80211_ATTR_STA_AID,
189 NL80211_ATTR_STA_FLAGS,
190 NL80211_ATTR_STA_LISTEN_INTERVAL,
191 NL80211_ATTR_STA_SUPPORTED_RATES,
192 NL80211_ATTR_STA_VLAN,
193
55682965
JB
194 /* add attributes here, update the policy in nl80211.c */
195
196 __NL80211_ATTR_AFTER_LAST,
197 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
198};
199
5727ef1b
JB
200#define NL80211_MAX_SUPP_RATES 32
201
704232c2
JB
202/**
203 * enum nl80211_iftype - (virtual) interface types
55682965 204 *
704232c2
JB
205 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
206 * @NL80211_IFTYPE_ADHOC: independent BSS member
207 * @NL80211_IFTYPE_STATION: managed BSS member
208 * @NL80211_IFTYPE_AP: access point
209 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
210 * @NL80211_IFTYPE_WDS: wireless distribution interface
211 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
55682965 212 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
704232c2
JB
213 * @__NL80211_IFTYPE_AFTER_LAST: internal use
214 *
55682965 215 * These values are used with the %NL80211_ATTR_IFTYPE
704232c2
JB
216 * to set the type of an interface.
217 *
218 */
219enum nl80211_iftype {
220 NL80211_IFTYPE_UNSPECIFIED,
221 NL80211_IFTYPE_ADHOC,
222 NL80211_IFTYPE_STATION,
223 NL80211_IFTYPE_AP,
224 NL80211_IFTYPE_AP_VLAN,
225 NL80211_IFTYPE_WDS,
226 NL80211_IFTYPE_MONITOR,
227
228 /* keep last */
55682965
JB
229 __NL80211_IFTYPE_AFTER_LAST,
230 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
704232c2 231};
704232c2 232
5727ef1b
JB
233/**
234 * enum nl80211_sta_flags - station flags
235 *
236 * Station flags. When a station is added to an AP interface, it is
237 * assumed to be already associated (and hence authenticated.)
238 *
239 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
240 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
241 * with short barker preamble
242 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
243 */
244enum nl80211_sta_flags {
245 __NL80211_STA_FLAG_INVALID,
246 NL80211_STA_FLAG_AUTHORIZED,
247 NL80211_STA_FLAG_SHORT_PREAMBLE,
248 NL80211_STA_FLAG_WME,
249
250 /* keep last */
251 __NL80211_STA_FLAG_AFTER_LAST,
252 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
253};
254
704232c2 255#endif /* __LINUX_NL80211_H */