nl80211.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. * enum nl80211_commands - supported nl80211 commands
  10. *
  11. * @NL80211_CMD_UNSPEC: unspecified command to catch errors
  12. *
  13. * @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
  14. * to get a list of all present wiphys.
  15. * @NL80211_CMD_SET_WIPHY: set wiphy name, needs %NL80211_ATTR_WIPHY and
  16. * %NL80211_ATTR_WIPHY_NAME.
  17. * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
  18. * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
  19. * %NL80211_ATTR_WIPHY_NAME.
  20. * @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
  21. * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
  22. *
  23. * @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
  24. * either a dump request on a %NL80211_ATTR_WIPHY or a specific get
  25. * on an %NL80211_ATTR_IFINDEX is supported.
  26. * @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
  27. * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
  28. * @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
  29. * to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
  30. * %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
  31. * be sent from userspace to request creation of a new virtual interface,
  32. * then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
  33. * %NL80211_ATTR_IFNAME.
  34. * @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
  35. * %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
  36. * userspace to request deletion of a virtual interface, then requires
  37. * attribute %NL80211_ATTR_IFINDEX.
  38. *
  39. * @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
  40. * by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC.
  41. * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT or
  42. * %NL80211_ATTR_KEY_THRESHOLD.
  43. * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
  44. * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER
  45. * attributes.
  46. * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
  47. * or %NL80211_ATTR_MAC.
  48. *
  49. * @NL80211_CMD_MAX: highest used command number
  50. * @__NL80211_CMD_AFTER_LAST: internal use
  51. */
  52. enum nl80211_commands {
  53. /* don't change the order or add anything inbetween, this is ABI! */
  54. NL80211_CMD_UNSPEC,
  55. NL80211_CMD_GET_WIPHY, /* can dump */
  56. NL80211_CMD_SET_WIPHY,
  57. NL80211_CMD_NEW_WIPHY,
  58. NL80211_CMD_DEL_WIPHY,
  59. NL80211_CMD_GET_INTERFACE, /* can dump */
  60. NL80211_CMD_SET_INTERFACE,
  61. NL80211_CMD_NEW_INTERFACE,
  62. NL80211_CMD_DEL_INTERFACE,
  63. NL80211_CMD_GET_KEY,
  64. NL80211_CMD_SET_KEY,
  65. NL80211_CMD_NEW_KEY,
  66. NL80211_CMD_DEL_KEY,
  67. /* add commands here */
  68. /* used to define NL80211_CMD_MAX below */
  69. __NL80211_CMD_AFTER_LAST,
  70. NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
  71. };
  72. /**
  73. * enum nl80211_attrs - nl80211 netlink attributes
  74. *
  75. * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
  76. *
  77. * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
  78. * /sys/class/ieee80211/<phyname>/index
  79. * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
  80. *
  81. * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
  82. * @NL80211_ATTR_IFNAME: network interface name
  83. * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
  84. *
  85. * @NL80211_ATTR_MAC: MAC address (various uses)
  86. *
  87. * @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
  88. * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
  89. * keys
  90. * @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
  91. * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
  92. * section 7.3.2.25.1, e.g. 0x000FAC04)
  93. * @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
  94. * CCMP keys, each six bytes in little endian
  95. *
  96. * @NL80211_ATTR_MAX: highest attribute number currently defined
  97. * @__NL80211_ATTR_AFTER_LAST: internal use
  98. */
  99. enum nl80211_attrs {
  100. /* don't change the order or add anything inbetween, this is ABI! */
  101. NL80211_ATTR_UNSPEC,
  102. NL80211_ATTR_WIPHY,
  103. NL80211_ATTR_WIPHY_NAME,
  104. NL80211_ATTR_IFINDEX,
  105. NL80211_ATTR_IFNAME,
  106. NL80211_ATTR_IFTYPE,
  107. NL80211_ATTR_MAC,
  108. NL80211_ATTR_KEY_DATA,
  109. NL80211_ATTR_KEY_IDX,
  110. NL80211_ATTR_KEY_CIPHER,
  111. NL80211_ATTR_KEY_SEQ,
  112. NL80211_ATTR_KEY_DEFAULT,
  113. /* add attributes here, update the policy in nl80211.c */
  114. __NL80211_ATTR_AFTER_LAST,
  115. NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
  116. };
  117. /**
  118. * enum nl80211_iftype - (virtual) interface types
  119. *
  120. * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
  121. * @NL80211_IFTYPE_ADHOC: independent BSS member
  122. * @NL80211_IFTYPE_STATION: managed BSS member
  123. * @NL80211_IFTYPE_AP: access point
  124. * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
  125. * @NL80211_IFTYPE_WDS: wireless distribution interface
  126. * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
  127. * @NL80211_IFTYPE_MAX: highest interface type number currently defined
  128. * @__NL80211_IFTYPE_AFTER_LAST: internal use
  129. *
  130. * These values are used with the %NL80211_ATTR_IFTYPE
  131. * to set the type of an interface.
  132. *
  133. */
  134. enum nl80211_iftype {
  135. NL80211_IFTYPE_UNSPECIFIED,
  136. NL80211_IFTYPE_ADHOC,
  137. NL80211_IFTYPE_STATION,
  138. NL80211_IFTYPE_AP,
  139. NL80211_IFTYPE_AP_VLAN,
  140. NL80211_IFTYPE_WDS,
  141. NL80211_IFTYPE_MONITOR,
  142. /* keep last */
  143. __NL80211_IFTYPE_AFTER_LAST,
  144. NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1
  145. };
  146. #endif /* __LINUX_NL80211_H */