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