Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 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 | |
| 9 | /** |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 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 | |
| 21 | /** |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 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 | * |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 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 | * |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 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 | * |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 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 | * |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 81 | * @NL80211_CMD_MAX: highest used command number |
| 82 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 83 | */ |
| 84 | enum 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 Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 98 | NL80211_CMD_GET_KEY, |
| 99 | NL80211_CMD_SET_KEY, |
| 100 | NL80211_CMD_NEW_KEY, |
| 101 | NL80211_CMD_DEL_KEY, |
| 102 | |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 103 | NL80211_CMD_GET_BEACON, |
| 104 | NL80211_CMD_SET_BEACON, |
| 105 | NL80211_CMD_NEW_BEACON, |
| 106 | NL80211_CMD_DEL_BEACON, |
| 107 | |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 108 | NL80211_CMD_GET_STATION, |
| 109 | NL80211_CMD_SET_STATION, |
| 110 | NL80211_CMD_NEW_STATION, |
| 111 | NL80211_CMD_DEL_STATION, |
| 112 | |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 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 | * |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 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 | * |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 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 | * |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 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. |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 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. |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 163 | * |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 164 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 165 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 166 | */ |
| 167 | enum nl80211_attrs { |
| 168 | /* don't change the order or add anything inbetween, this is ABI! */ |
| 169 | NL80211_ATTR_UNSPEC, |
| 170 | |
| 171 | NL80211_ATTR_WIPHY, |
| 172 | NL80211_ATTR_WIPHY_NAME, |
| 173 | |
| 174 | NL80211_ATTR_IFINDEX, |
| 175 | NL80211_ATTR_IFNAME, |
| 176 | NL80211_ATTR_IFTYPE, |
| 177 | |
Johannes Berg | 41ade00 | 2007-12-19 02:03:29 +0100 | [diff] [blame] | 178 | NL80211_ATTR_MAC, |
| 179 | |
| 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, |
| 185 | |
Johannes Berg | ed1b6cc | 2007-12-19 02:03:32 +0100 | [diff] [blame] | 186 | NL80211_ATTR_BEACON_INTERVAL, |
| 187 | NL80211_ATTR_DTIM_PERIOD, |
| 188 | NL80211_ATTR_BEACON_HEAD, |
| 189 | NL80211_ATTR_BEACON_TAIL, |
| 190 | |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 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, |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 196 | NL80211_ATTR_STA_STATS, |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 197 | |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 198 | /* add attributes here, update the policy in nl80211.c */ |
| 199 | |
| 200 | __NL80211_ATTR_AFTER_LAST, |
| 201 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
| 202 | }; |
| 203 | |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 204 | #define NL80211_MAX_SUPP_RATES 32 |
| 205 | |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 206 | /** |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 207 | * enum nl80211_iftype - (virtual) interface types |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 208 | * |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 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 |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 216 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 217 | * @__NL80211_IFTYPE_AFTER_LAST: internal use |
| 218 | * |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 219 | * These values are used with the %NL80211_ATTR_IFTYPE |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 220 | * to set the type of an interface. |
| 221 | * |
| 222 | */ |
| 223 | enum nl80211_iftype { |
| 224 | NL80211_IFTYPE_UNSPECIFIED, |
| 225 | NL80211_IFTYPE_ADHOC, |
| 226 | NL80211_IFTYPE_STATION, |
| 227 | NL80211_IFTYPE_AP, |
| 228 | NL80211_IFTYPE_AP_VLAN, |
| 229 | NL80211_IFTYPE_WDS, |
| 230 | NL80211_IFTYPE_MONITOR, |
| 231 | |
| 232 | /* keep last */ |
Johannes Berg | 5568296 | 2007-09-20 13:09:35 -0400 | [diff] [blame] | 233 | __NL80211_IFTYPE_AFTER_LAST, |
| 234 | NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 235 | }; |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 236 | |
Johannes Berg | 5727ef1 | 2007-12-19 02:03:34 +0100 | [diff] [blame] | 237 | /** |
| 238 | * enum nl80211_sta_flags - station flags |
| 239 | * |
| 240 | * Station flags. When a station is added to an AP interface, it is |
| 241 | * assumed to be already associated (and hence authenticated.) |
| 242 | * |
| 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 |
| 247 | */ |
| 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, |
| 253 | |
| 254 | /* keep last */ |
| 255 | __NL80211_STA_FLAG_AFTER_LAST, |
| 256 | NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1 |
| 257 | }; |
| 258 | |
Johannes Berg | fd5b74d | 2007-12-19 02:03:36 +0100 | [diff] [blame] | 259 | /** |
| 260 | * enum nl80211_sta_stats - station statistics |
| 261 | * |
| 262 | * These attribute types are used with %NL80211_ATTR_STA_STATS |
| 263 | * when getting information about a station. |
| 264 | * |
| 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 |
| 271 | */ |
| 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, |
| 277 | |
| 278 | /* keep last */ |
| 279 | __NL80211_STA_STAT_AFTER_LAST, |
| 280 | NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1 |
| 281 | }; |
| 282 | |
Johannes Berg | 704232c | 2007-04-23 12:20:05 -0700 | [diff] [blame] | 283 | #endif /* __LINUX_NL80211_H */ |