blob: 63695060db9fe1137ea160559148dc67be7be5cc [file] [log] [blame]
Johannes Berg704232c2007-04-23 12:20:05 -07001#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
9/**
Johannes Berg5727ef12007-12-19 02:03:34 +010010 * 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
21/**
Johannes Berg55682962007-09-20 13:09:35 -040022 * 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 *
Johannes Berg41ade002007-12-19 02:03:29 +010052 * @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 *
Johannes Berged1b6cc2007-12-19 02:03:32 +010062 * @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 *
Johannes Berg5727ef12007-12-19 02:03:34 +010071 * @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 *
Johannes Berg55682962007-09-20 13:09:35 -040081 * @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
Johannes Berg41ade002007-12-19 02:03:29 +010098 NL80211_CMD_GET_KEY,
99 NL80211_CMD_SET_KEY,
100 NL80211_CMD_NEW_KEY,
101 NL80211_CMD_DEL_KEY,
102
Johannes Berged1b6cc2007-12-19 02:03:32 +0100103 NL80211_CMD_GET_BEACON,
104 NL80211_CMD_SET_BEACON,
105 NL80211_CMD_NEW_BEACON,
106 NL80211_CMD_DEL_BEACON,
107
Johannes Berg5727ef12007-12-19 02:03:34 +0100108 NL80211_CMD_GET_STATION,
109 NL80211_CMD_SET_STATION,
110 NL80211_CMD_NEW_STATION,
111 NL80211_CMD_DEL_STATION,
112
Johannes Berg55682962007-09-20 13:09:35 -0400113 /* 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 *
Johannes Berg41ade002007-12-19 02:03:29 +0100134 * @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 *
Johannes Berged1b6cc2007-12-19 02:03:32 +0100145 * @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 *
Johannes Berg5727ef12007-12-19 02:03:34 +0100150 * @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.
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100160 * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
161 * given for %NL80211_CMD_GET_STATION, nested attribute containing
162 * info as possible, see &enum nl80211_sta_stats.
Johannes Berg5727ef12007-12-19 02:03:34 +0100163 *
Johannes Bergee688b002008-01-24 19:38:39 +0100164 * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
165 * consisting of a nested array.
166 *
Johannes Berg55682962007-09-20 13:09:35 -0400167 * @NL80211_ATTR_MAX: highest attribute number currently defined
168 * @__NL80211_ATTR_AFTER_LAST: internal use
169 */
170enum nl80211_attrs {
171/* don't change the order or add anything inbetween, this is ABI! */
172 NL80211_ATTR_UNSPEC,
173
174 NL80211_ATTR_WIPHY,
175 NL80211_ATTR_WIPHY_NAME,
176
177 NL80211_ATTR_IFINDEX,
178 NL80211_ATTR_IFNAME,
179 NL80211_ATTR_IFTYPE,
180
Johannes Berg41ade002007-12-19 02:03:29 +0100181 NL80211_ATTR_MAC,
182
183 NL80211_ATTR_KEY_DATA,
184 NL80211_ATTR_KEY_IDX,
185 NL80211_ATTR_KEY_CIPHER,
186 NL80211_ATTR_KEY_SEQ,
187 NL80211_ATTR_KEY_DEFAULT,
188
Johannes Berged1b6cc2007-12-19 02:03:32 +0100189 NL80211_ATTR_BEACON_INTERVAL,
190 NL80211_ATTR_DTIM_PERIOD,
191 NL80211_ATTR_BEACON_HEAD,
192 NL80211_ATTR_BEACON_TAIL,
193
Johannes Berg5727ef12007-12-19 02:03:34 +0100194 NL80211_ATTR_STA_AID,
195 NL80211_ATTR_STA_FLAGS,
196 NL80211_ATTR_STA_LISTEN_INTERVAL,
197 NL80211_ATTR_STA_SUPPORTED_RATES,
198 NL80211_ATTR_STA_VLAN,
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100199 NL80211_ATTR_STA_STATS,
Johannes Berg5727ef12007-12-19 02:03:34 +0100200
Johannes Bergee688b002008-01-24 19:38:39 +0100201 NL80211_ATTR_WIPHY_BANDS,
202
Johannes Berg55682962007-09-20 13:09:35 -0400203 /* add attributes here, update the policy in nl80211.c */
204
205 __NL80211_ATTR_AFTER_LAST,
206 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
207};
208
Johannes Berg5727ef12007-12-19 02:03:34 +0100209#define NL80211_MAX_SUPP_RATES 32
210
Johannes Berg55682962007-09-20 13:09:35 -0400211/**
Johannes Berg704232c2007-04-23 12:20:05 -0700212 * enum nl80211_iftype - (virtual) interface types
Johannes Berg55682962007-09-20 13:09:35 -0400213 *
Johannes Berg704232c2007-04-23 12:20:05 -0700214 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
215 * @NL80211_IFTYPE_ADHOC: independent BSS member
216 * @NL80211_IFTYPE_STATION: managed BSS member
217 * @NL80211_IFTYPE_AP: access point
218 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
219 * @NL80211_IFTYPE_WDS: wireless distribution interface
220 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
Johannes Berg55682962007-09-20 13:09:35 -0400221 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
Johannes Berg704232c2007-04-23 12:20:05 -0700222 * @__NL80211_IFTYPE_AFTER_LAST: internal use
223 *
Johannes Berg55682962007-09-20 13:09:35 -0400224 * These values are used with the %NL80211_ATTR_IFTYPE
Johannes Berg704232c2007-04-23 12:20:05 -0700225 * to set the type of an interface.
226 *
227 */
228enum nl80211_iftype {
229 NL80211_IFTYPE_UNSPECIFIED,
230 NL80211_IFTYPE_ADHOC,
231 NL80211_IFTYPE_STATION,
232 NL80211_IFTYPE_AP,
233 NL80211_IFTYPE_AP_VLAN,
234 NL80211_IFTYPE_WDS,
235 NL80211_IFTYPE_MONITOR,
236
237 /* keep last */
Johannes Berg55682962007-09-20 13:09:35 -0400238 __NL80211_IFTYPE_AFTER_LAST,
239 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
Johannes Berg704232c2007-04-23 12:20:05 -0700240};
Johannes Berg704232c2007-04-23 12:20:05 -0700241
Johannes Berg5727ef12007-12-19 02:03:34 +0100242/**
243 * enum nl80211_sta_flags - station flags
244 *
245 * Station flags. When a station is added to an AP interface, it is
246 * assumed to be already associated (and hence authenticated.)
247 *
248 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
249 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
250 * with short barker preamble
251 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
252 */
253enum nl80211_sta_flags {
254 __NL80211_STA_FLAG_INVALID,
255 NL80211_STA_FLAG_AUTHORIZED,
256 NL80211_STA_FLAG_SHORT_PREAMBLE,
257 NL80211_STA_FLAG_WME,
258
259 /* keep last */
260 __NL80211_STA_FLAG_AFTER_LAST,
261 NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
262};
263
Johannes Bergfd5b74d2007-12-19 02:03:36 +0100264/**
265 * enum nl80211_sta_stats - station statistics
266 *
267 * These attribute types are used with %NL80211_ATTR_STA_STATS
268 * when getting information about a station.
269 *
270 * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
271 * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
272 * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
273 * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
274 * @__NL80211_STA_STAT_AFTER_LAST: internal
275 * @NL80211_STA_STAT_MAX: highest possible station stats attribute
276 */
277enum nl80211_sta_stats {
278 __NL80211_STA_STAT_INVALID,
279 NL80211_STA_STAT_INACTIVE_TIME,
280 NL80211_STA_STAT_RX_BYTES,
281 NL80211_STA_STAT_TX_BYTES,
282
283 /* keep last */
284 __NL80211_STA_STAT_AFTER_LAST,
285 NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
286};
287
Johannes Bergee688b002008-01-24 19:38:39 +0100288/**
289 * enum nl80211_band_attr - band attributes
290 * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
291 * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
292 * an array of nested frequency attributes
293 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
294 * an array of nested bitrate attributes
295 */
296enum nl80211_band_attr {
297 __NL80211_BAND_ATTR_INVALID,
298 NL80211_BAND_ATTR_FREQS,
299 NL80211_BAND_ATTR_RATES,
300
301 /* keep last */
302 __NL80211_BAND_ATTR_AFTER_LAST,
303 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
304};
305
306/**
307 * enum nl80211_frequency_attr - frequency attributes
308 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
309 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
310 * regulatory domain.
311 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
312 * permitted on this channel in current regulatory domain.
313 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
314 * on this channel in current regulatory domain.
315 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
316 * on this channel in current regulatory domain.
317 */
318enum nl80211_frequency_attr {
319 __NL80211_FREQUENCY_ATTR_INVALID,
320 NL80211_FREQUENCY_ATTR_FREQ,
321 NL80211_FREQUENCY_ATTR_DISABLED,
322 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
323 NL80211_FREQUENCY_ATTR_NO_IBSS,
324 NL80211_FREQUENCY_ATTR_RADAR,
325
326 /* keep last */
327 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
328 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
329};
330
331/**
332 * enum nl80211_bitrate_attr - bitrate attributes
333 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
334 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
335 * in 2.4 GHz band.
336 */
337enum nl80211_bitrate_attr {
338 __NL80211_BITRATE_ATTR_INVALID,
339 NL80211_BITRATE_ATTR_RATE,
340 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
341
342 /* keep last */
343 __NL80211_BITRATE_ATTR_AFTER_LAST,
344 NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
345};
346
Johannes Berg704232c2007-04-23 12:20:05 -0700347#endif /* __LINUX_NL80211_H */