1 #ifndef __LINUX_NL80211_H
2 #define __LINUX_NL80211_H
4 * 802.11 netlink interface public header
6 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
10 * DOC: Station handling
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
18 * TODO: need more info?
22 * enum nl80211_commands - supported nl80211 commands
24 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
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.
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.
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
59 * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
60 * or %NL80211_ATTR_MAC.
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
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.
81 * @NL80211_CMD_MAX: highest used command number
82 * @__NL80211_CMD_AFTER_LAST: internal use
84 enum nl80211_commands
{
85 /* don't change the order or add anything inbetween, this is ABI! */
88 NL80211_CMD_GET_WIPHY
, /* can dump */
89 NL80211_CMD_SET_WIPHY
,
90 NL80211_CMD_NEW_WIPHY
,
91 NL80211_CMD_DEL_WIPHY
,
93 NL80211_CMD_GET_INTERFACE
, /* can dump */
94 NL80211_CMD_SET_INTERFACE
,
95 NL80211_CMD_NEW_INTERFACE
,
96 NL80211_CMD_DEL_INTERFACE
,
103 NL80211_CMD_GET_BEACON
,
104 NL80211_CMD_SET_BEACON
,
105 NL80211_CMD_NEW_BEACON
,
106 NL80211_CMD_DEL_BEACON
,
108 NL80211_CMD_GET_STATION
,
109 NL80211_CMD_SET_STATION
,
110 NL80211_CMD_NEW_STATION
,
111 NL80211_CMD_DEL_STATION
,
113 /* add commands here */
115 /* used to define NL80211_CMD_MAX below */
116 __NL80211_CMD_AFTER_LAST
,
117 NL80211_CMD_MAX
= __NL80211_CMD_AFTER_LAST
- 1
122 * enum nl80211_attrs - nl80211 netlink attributes
124 * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
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)
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
134 * @NL80211_ATTR_MAC: MAC address (various uses)
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
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
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
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 * @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.
164 * @NL80211_ATTR_MAX: highest attribute number currently defined
165 * @__NL80211_ATTR_AFTER_LAST: internal use
168 /* don't change the order or add anything inbetween, this is ABI! */
172 NL80211_ATTR_WIPHY_NAME
,
174 NL80211_ATTR_IFINDEX
,
180 NL80211_ATTR_KEY_DATA
,
181 NL80211_ATTR_KEY_IDX
,
182 NL80211_ATTR_KEY_CIPHER
,
183 NL80211_ATTR_KEY_SEQ
,
184 NL80211_ATTR_KEY_DEFAULT
,
186 NL80211_ATTR_BEACON_INTERVAL
,
187 NL80211_ATTR_DTIM_PERIOD
,
188 NL80211_ATTR_BEACON_HEAD
,
189 NL80211_ATTR_BEACON_TAIL
,
191 NL80211_ATTR_STA_AID
,
192 NL80211_ATTR_STA_FLAGS
,
193 NL80211_ATTR_STA_LISTEN_INTERVAL
,
194 NL80211_ATTR_STA_SUPPORTED_RATES
,
195 NL80211_ATTR_STA_VLAN
,
196 NL80211_ATTR_STA_STATS
,
198 /* add attributes here, update the policy in nl80211.c */
200 __NL80211_ATTR_AFTER_LAST
,
201 NL80211_ATTR_MAX
= __NL80211_ATTR_AFTER_LAST
- 1
204 #define NL80211_MAX_SUPP_RATES 32
207 * enum nl80211_iftype - (virtual) interface types
209 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
210 * @NL80211_IFTYPE_ADHOC: independent BSS member
211 * @NL80211_IFTYPE_STATION: managed BSS member
212 * @NL80211_IFTYPE_AP: access point
213 * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
214 * @NL80211_IFTYPE_WDS: wireless distribution interface
215 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
216 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
217 * @__NL80211_IFTYPE_AFTER_LAST: internal use
219 * These values are used with the %NL80211_ATTR_IFTYPE
220 * to set the type of an interface.
223 enum nl80211_iftype
{
224 NL80211_IFTYPE_UNSPECIFIED
,
225 NL80211_IFTYPE_ADHOC
,
226 NL80211_IFTYPE_STATION
,
228 NL80211_IFTYPE_AP_VLAN
,
230 NL80211_IFTYPE_MONITOR
,
233 __NL80211_IFTYPE_AFTER_LAST
,
234 NL80211_IFTYPE_MAX
= __NL80211_IFTYPE_AFTER_LAST
- 1
238 * enum nl80211_sta_flags - station flags
240 * Station flags. When a station is added to an AP interface, it is
241 * assumed to be already associated (and hence authenticated.)
243 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
244 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
245 * with short barker preamble
246 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
248 enum nl80211_sta_flags
{
249 __NL80211_STA_FLAG_INVALID
,
250 NL80211_STA_FLAG_AUTHORIZED
,
251 NL80211_STA_FLAG_SHORT_PREAMBLE
,
252 NL80211_STA_FLAG_WME
,
255 __NL80211_STA_FLAG_AFTER_LAST
,
256 NL80211_STA_FLAG_MAX
= __NL80211_STA_FLAG_AFTER_LAST
- 1
260 * enum nl80211_sta_stats - station statistics
262 * These attribute types are used with %NL80211_ATTR_STA_STATS
263 * when getting information about a station.
265 * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
266 * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
267 * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
268 * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
269 * @__NL80211_STA_STAT_AFTER_LAST: internal
270 * @NL80211_STA_STAT_MAX: highest possible station stats attribute
272 enum nl80211_sta_stats
{
273 __NL80211_STA_STAT_INVALID
,
274 NL80211_STA_STAT_INACTIVE_TIME
,
275 NL80211_STA_STAT_RX_BYTES
,
276 NL80211_STA_STAT_TX_BYTES
,
279 __NL80211_STA_STAT_AFTER_LAST
,
280 NL80211_STA_STAT_MAX
= __NL80211_STA_STAT_AFTER_LAST
- 1
283 #endif /* __LINUX_NL80211_H */