nl80211.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. * DOC: Station handling
  10. *
  11. * Stations are added per interface, but a special case exists with VLAN
  12. * interfaces. When a station is bound to an AP interface, it may be moved
  13. * into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
  14. * The station is still assumed to belong to the AP interface it was added
  15. * to.
  16. *
  17. * TODO: need more info?
  18. */
  19. /**
  20. * enum nl80211_commands - supported nl80211 commands
  21. *
  22. * @NL80211_CMD_UNSPEC: unspecified command to catch errors
  23. *
  24. * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
  25. * to get a list of all present wiphys.
  26. * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
  27. * %NL80211_ATTR_WIPHY_NAME.
  28. * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
  29. * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
  30. * %NL80211_ATTR_WIPHY_NAME.
  31. * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
  32. * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
  33. *
  34. * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
  35. * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
  36. * on an %NL80211_ATTR_IFINDEX is supported.
  37. * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
  38. * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
  39. * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
  40. * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
  41. * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
  42. * be sent from userspace to request creation of a new virtual interface,
  43. * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
  44. * %NL80211_ATTR_IFNAME.
  45. * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
  46. * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
  47. * userspace to request deletion of a virtual interface, then requires
  48. * attribute %NL80211_ATTR_IFINDEX.
  49. *
  50. * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
  51. * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
  52. * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or
  53. * %NL80211_ATTR_KEY_THRESHOLD.
  54. * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
  55. * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
  56. * attributes.
  57. * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
  58. * or %NL80211_ATTR_MAC.
  59. *
  60. * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a
  61. * %NL80222_CMD_NEW_BEACON message)
  62. * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface
  63. * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD,
  64. * %NL80211_BEACON_HEAD and %NL80211_BEACON_TAIL attributes.
  65. * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface,
  66. * parameters are like for %NL80211_CMD_SET_BEACON.
  67. * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it
  68. *
  69. * @NL80211_CMD_GET_STATION: Get station attributes for station identified by
  70. * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
  71. * @NL80211_CMD_SET_STATION: Set station attributes for station identified by
  72. * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
  73. * @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
  74. * the interface identified by %NL80211_ATTR_IFINDEX.
  75. * @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
  76. * or, if no MAC address given, all stations, on the interface identified
  77. * by %NL80211_ATTR_IFINDEX.
  78. *
  79. * @NL80211_CMD_MAX: highest used command number
  80. * @__NL80211_CMD_AFTER_LAST: internal use
  81. */
  82. enum nl80211_commands {
  83. /* don't change the order or add anything inbetween, this is ABI! */
  84. NL80211_CMD_UNSPEC,
  85. NL80211_CMD_GET_WIPHY, /* can dump */
  86. NL80211_CMD_SET_WIPHY,
  87. NL80211_CMD_NEW_WIPHY,
  88. NL80211_CMD_DEL_WIPHY,
  89. NL80211_CMD_GET_INTERFACE, /* can dump */
  90. NL80211_CMD_SET_INTERFACE,
  91. NL80211_CMD_NEW_INTERFACE,
  92. NL80211_CMD_DEL_INTERFACE,
  93. NL80211_CMD_GET_KEY,
  94. NL80211_CMD_SET_KEY,
  95. NL80211_CMD_NEW_KEY,
  96. NL80211_CMD_DEL_KEY,
  97. NL80211_CMD_GET_BEACON,
  98. NL80211_CMD_SET_BEACON,
  99. NL80211_CMD_NEW_BEACON,
  100. NL80211_CMD_DEL_BEACON,
  101. NL80211_CMD_GET_STATION,
  102. NL80211_CMD_SET_STATION,
  103. NL80211_CMD_NEW_STATION,
  104. NL80211_CMD_DEL_STATION,
  105. /* add commands here */
  106. /* used to define NL80211_CMD_MAX below */
  107. __NL80211_CMD_AFTER_LAST,
  108. NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
  109. };
  110. /**
  111. * enum nl80211_attrs - nl80211 netlink attributes
  112. *
  113. * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
  114. *
  115. * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
  116. * /sys/class/ieee80211/<phyname>/index
  117. * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
  118. *
  119. * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
  120. * @NL80211_ATTR_IFNAME: network interface name
  121. * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
  122. *
  123. * @NL80211_ATTR_MAC: MAC address (various uses)
  124. *
  125. * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
  126. * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
  127. * keys
  128. * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
  129. * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
  130. * section 7.3.2.25.1, e.g. 0x000FAC04)
  131. * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
  132. * CCMP keys, each six bytes in little endian
  133. *
  134. * @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
  135. * @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
  136. * @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
  137. * @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
  138. *
  139. * @NL80211_ATTR_STA_AID: Association ID for the station (u16)
  140. * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
  141. * &enum nl80211_sta_flags.
  142. * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
  143. * IEEE 802.11 7.3.1.6 (u16).
  144. * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
  145. * rates as defined by IEEE 802.11 7.3.2.2 but without the length
  146. * restriction (at most %NL80211_MAX_SUPP_RATES).
  147. * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
  148. * to, or the AP interface the station was originally added to to.
  149. * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
  150. * given for %NL80211_CMD_GET_STATION, nested attribute containing
  151. * info as possible, see &enum nl80211_sta_stats.
  152. *
  153. * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
  154. * consisting of a nested array.
  155. *
  156. * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
  157. * &enum nl80211_mntr_flags.
  158. *
  159. * @NL80211_ATTR_MAX: highest attribute number currently defined
  160. * @__NL80211_ATTR_AFTER_LAST: internal use
  161. */
  162. enum nl80211_attrs {
  163. /* don't change the order or add anything inbetween, this is ABI! */
  164. NL80211_ATTR_UNSPEC,
  165. NL80211_ATTR_WIPHY,
  166. NL80211_ATTR_WIPHY_NAME,
  167. NL80211_ATTR_IFINDEX,
  168. NL80211_ATTR_IFNAME,
  169. NL80211_ATTR_IFTYPE,
  170. NL80211_ATTR_MAC,
  171. NL80211_ATTR_KEY_DATA,
  172. NL80211_ATTR_KEY_IDX,
  173. NL80211_ATTR_KEY_CIPHER,
  174. NL80211_ATTR_KEY_SEQ,
  175. NL80211_ATTR_KEY_DEFAULT,
  176. NL80211_ATTR_BEACON_INTERVAL,
  177. NL80211_ATTR_DTIM_PERIOD,
  178. NL80211_ATTR_BEACON_HEAD,
  179. NL80211_ATTR_BEACON_TAIL,
  180. NL80211_ATTR_STA_AID,
  181. NL80211_ATTR_STA_FLAGS,
  182. NL80211_ATTR_STA_LISTEN_INTERVAL,
  183. NL80211_ATTR_STA_SUPPORTED_RATES,
  184. NL80211_ATTR_STA_VLAN,
  185. NL80211_ATTR_STA_STATS,
  186. NL80211_ATTR_WIPHY_BANDS,
  187. NL80211_ATTR_MNTR_FLAGS,
  188. /* add attributes here, update the policy in nl80211.c */
  189. __NL80211_ATTR_AFTER_LAST,
  190. NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
  191. };
  192. #define NL80211_MAX_SUPP_RATES 32
  193. /**
  194. * enum nl80211_iftype - (virtual) interface types
  195. *
  196. * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
  197. * @NL80211_IFTYPE_ADHOC: independent BSS member
  198. * @NL80211_IFTYPE_STATION: managed BSS member
  199. * @NL80211_IFTYPE_AP: access point
  200. * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
  201. * @NL80211_IFTYPE_WDS: wireless distribution interface
  202. * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
  203. * @NL80211_IFTYPE_MAX: highest interface type number currently defined
  204. * @__NL80211_IFTYPE_AFTER_LAST: internal use
  205. *
  206. * These values are used with the %NL80211_ATTR_IFTYPE
  207. * to set the type of an interface.
  208. *
  209. */
  210. enum nl80211_iftype {
  211. NL80211_IFTYPE_UNSPECIFIED,
  212. NL80211_IFTYPE_ADHOC,
  213. NL80211_IFTYPE_STATION,
  214. NL80211_IFTYPE_AP,
  215. NL80211_IFTYPE_AP_VLAN,
  216. NL80211_IFTYPE_WDS,
  217. NL80211_IFTYPE_MONITOR,
  218. /* keep last */
  219. __NL80211_IFTYPE_AFTER_LAST,
  220. NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
  221. };
  222. /**
  223. * enum nl80211_sta_flags - station flags
  224. *
  225. * Station flags. When a station is added to an AP interface, it is
  226. * assumed to be already associated (and hence authenticated.)
  227. *
  228. * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
  229. * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
  230. * with short barker preamble
  231. * @NL80211_STA_FLAG_WME: station is WME/QoS capable
  232. */
  233. enum nl80211_sta_flags {
  234. __NL80211_STA_FLAG_INVALID,
  235. NL80211_STA_FLAG_AUTHORIZED,
  236. NL80211_STA_FLAG_SHORT_PREAMBLE,
  237. NL80211_STA_FLAG_WME,
  238. /* keep last */
  239. __NL80211_STA_FLAG_AFTER_LAST,
  240. NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
  241. };
  242. /**
  243. * enum nl80211_sta_stats - station statistics
  244. *
  245. * These attribute types are used with %NL80211_ATTR_STA_STATS
  246. * when getting information about a station.
  247. *
  248. * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
  249. * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
  250. * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
  251. * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
  252. * @__NL80211_STA_STAT_AFTER_LAST: internal
  253. * @NL80211_STA_STAT_MAX: highest possible station stats attribute
  254. */
  255. enum nl80211_sta_stats {
  256. __NL80211_STA_STAT_INVALID,
  257. NL80211_STA_STAT_INACTIVE_TIME,
  258. NL80211_STA_STAT_RX_BYTES,
  259. NL80211_STA_STAT_TX_BYTES,
  260. /* keep last */
  261. __NL80211_STA_STAT_AFTER_LAST,
  262. NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
  263. };
  264. /**
  265. * enum nl80211_band_attr - band attributes
  266. * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
  267. * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
  268. * an array of nested frequency attributes
  269. * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
  270. * an array of nested bitrate attributes
  271. */
  272. enum nl80211_band_attr {
  273. __NL80211_BAND_ATTR_INVALID,
  274. NL80211_BAND_ATTR_FREQS,
  275. NL80211_BAND_ATTR_RATES,
  276. /* keep last */
  277. __NL80211_BAND_ATTR_AFTER_LAST,
  278. NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
  279. };
  280. /**
  281. * enum nl80211_frequency_attr - frequency attributes
  282. * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
  283. * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
  284. * regulatory domain.
  285. * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
  286. * permitted on this channel in current regulatory domain.
  287. * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
  288. * on this channel in current regulatory domain.
  289. * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
  290. * on this channel in current regulatory domain.
  291. */
  292. enum nl80211_frequency_attr {
  293. __NL80211_FREQUENCY_ATTR_INVALID,
  294. NL80211_FREQUENCY_ATTR_FREQ,
  295. NL80211_FREQUENCY_ATTR_DISABLED,
  296. NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
  297. NL80211_FREQUENCY_ATTR_NO_IBSS,
  298. NL80211_FREQUENCY_ATTR_RADAR,
  299. /* keep last */
  300. __NL80211_FREQUENCY_ATTR_AFTER_LAST,
  301. NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
  302. };
  303. /**
  304. * enum nl80211_bitrate_attr - bitrate attributes
  305. * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
  306. * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
  307. * in 2.4 GHz band.
  308. */
  309. enum nl80211_bitrate_attr {
  310. __NL80211_BITRATE_ATTR_INVALID,
  311. NL80211_BITRATE_ATTR_RATE,
  312. NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
  313. /* keep last */
  314. __NL80211_BITRATE_ATTR_AFTER_LAST,
  315. NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
  316. };
  317. /**
  318. * enum nl80211_mntr_flags - monitor configuration flags
  319. *
  320. * Monitor configuration flags.
  321. *
  322. * @__NL80211_MNTR_FLAG_INVALID: reserved
  323. *
  324. * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
  325. * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
  326. * @NL80211_MNTR_FLAG_CONTROL: pass control frames
  327. * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
  328. * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
  329. * overrides all other flags.
  330. *
  331. * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
  332. * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
  333. */
  334. enum nl80211_mntr_flags {
  335. __NL80211_MNTR_FLAG_INVALID,
  336. NL80211_MNTR_FLAG_FCSFAIL,
  337. NL80211_MNTR_FLAG_PLCPFAIL,
  338. NL80211_MNTR_FLAG_CONTROL,
  339. NL80211_MNTR_FLAG_OTHER_BSS,
  340. NL80211_MNTR_FLAG_COOK_FRAMES,
  341. /* keep last */
  342. __NL80211_MNTR_FLAG_AFTER_LAST,
  343. NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
  344. };
  345. #endif /* __LINUX_NL80211_H */