cfg80211/nl80211: separate unicast/multicast default TX keys

Allow userspace to specify that a given key
is default only for unicast and/or multicast
transmissions. Only WEP keys are for both,
WPA/RSN keys set here are GTKs for multicast
only. For more future flexibility, allow to
specify all combiations.

Wireless extensions can only set both so use
nl80211; WEP keys (connect keys) must be set
as default for both (but 802.1X WEP is still
possible).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2010-12-09 19:58:59 +01:00
committed by John W. Linville
parent 897bed8b43
commit dbd2fd656f
9 changed files with 153 additions and 30 deletions

View File

@@ -851,6 +851,10 @@ enum nl80211_commands {
*
* @NL80211_ATTR_BSS_HTOPMODE: HT operation mode (u16)
*
* @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
* attributes, specifying what a key should be set as default as.
* See &enum nl80211_key_default_types.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1029,6 +1033,8 @@ enum nl80211_attrs {
NL80211_ATTR_BSS_HT_OPMODE,
NL80211_ATTR_KEY_DEFAULT_TYPES,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -1774,6 +1780,23 @@ enum nl80211_wpa_versions {
NL80211_WPA_VERSION_2 = 1 << 1,
};
/**
* enum nl80211_key_default_types - key default types
* @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
* @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
* unicast key
* @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
* multicast key
* @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
*/
enum nl80211_key_default_types {
__NL80211_KEY_DEFAULT_TYPE_INVALID,
NL80211_KEY_DEFAULT_TYPE_UNICAST,
NL80211_KEY_DEFAULT_TYPE_MULTICAST,
NUM_NL80211_KEY_DEFAULT_TYPES
};
/**
* enum nl80211_key_attributes - key attributes
* @__NL80211_KEY_INVALID: invalid
@@ -1790,6 +1813,9 @@ enum nl80211_wpa_versions {
* @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
* specified the default depends on whether a MAC address was
* given with the command using the key or not (u32)
* @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
* attributes, specifying what a key should be set as default as.
* See &enum nl80211_key_default_types.
* @__NL80211_KEY_AFTER_LAST: internal
* @NL80211_KEY_MAX: highest key attribute
*/
@@ -1802,6 +1828,7 @@ enum nl80211_key_attributes {
NL80211_KEY_DEFAULT,
NL80211_KEY_DEFAULT_MGMT,
NL80211_KEY_TYPE,
NL80211_KEY_DEFAULT_TYPES,
/* keep last */
__NL80211_KEY_AFTER_LAST,