netfilter: xtables: move extension arguments into compound structure (2/6)
[safe/jmp/linux-2.6] / include / linux / nl80211.h
index 6369506..9bad654 100644 (file)
  *     or, if no MAC address given, all stations, on the interface identified
  *     by %NL80211_ATTR_IFINDEX.
  *
+ * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
+ *     destination %NL80211_ATTR_MAC on the interface identified by
+ *     %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_MPATH:  Set mesh path attributes for mesh path to
+ *     destination %NL80211_ATTR_MAC on the interface identified by
+ *     %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the
+ *     the interface identified by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
+ *     or, if no MAC address given, all mesh paths, on the interface identified
+ *     by %NL80211_ATTR_IFINDEX.
+ * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
+ *     %NL80211_ATTR_IFINDEX.
+ *
+ * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
+ *     after being queried by the kernel. CRDA replies by sending a regulatory
+ *     domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
+ *     current alpha2 if it found a match. It also provides
+ *     NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
+ *     regulatory rule is a nested set of attributes  given by
+ *     %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
+ *     %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
+ *     %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
+ *     %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
+ * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
+ *     to the the specified ISO/IEC 3166-1 alpha2 country code. The core will
+ *     store this as a valid request and then query userspace for it.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -110,13 +138,28 @@ enum nl80211_commands {
        NL80211_CMD_NEW_STATION,
        NL80211_CMD_DEL_STATION,
 
-       /* add commands here */
+       NL80211_CMD_GET_MPATH,
+       NL80211_CMD_SET_MPATH,
+       NL80211_CMD_NEW_MPATH,
+       NL80211_CMD_DEL_MPATH,
+
+       NL80211_CMD_SET_BSS,
+
+       NL80211_CMD_SET_REG,
+       NL80211_CMD_REQ_SET_REG,
+
+       /* add new commands above here */
 
        /* used to define NL80211_CMD_MAX below */
        __NL80211_CMD_AFTER_LAST,
        NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
 };
 
+/*
+ * Allow user space programs to use #ifdef on new commands by defining them
+ * here
+ */
+#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
 
 /**
  * enum nl80211_attrs - nl80211 netlink attributes
@@ -157,13 +200,48 @@ enum nl80211_commands {
  *     restriction (at most %NL80211_MAX_SUPP_RATES).
  * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
  *     to, or the AP interface the station was originally added to to.
- * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
+ * @NL80211_ATTR_STA_INFO: information about a station, part of station info
  *     given for %NL80211_CMD_GET_STATION, nested attribute containing
- *     info as possible, see &enum nl80211_sta_stats.
+ *     info as possible, see &enum nl80211_sta_info.
  *
  * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
  *     consisting of a nested array.
  *
+ * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
+ * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link.
+ * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
+ * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
+ *     info given for %NL80211_CMD_GET_MPATH, nested attribute described at
+ *     &enum nl80211_mpath_info.
+ *
+ * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
+ *      &enum nl80211_mntr_flags.
+ *
+ * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
+ *     current regulatory domain should be set to or is already set to.
+ *     For example, 'CR', for Costa Rica. This attribute is used by the kernel
+ *     to query the CRDA to retrieve one regulatory domain. This attribute can
+ *     also be used by userspace to query the kernel for the currently set
+ *     regulatory domain. We chose an alpha2 as that is also used by the
+ *     IEEE-802.11d country information element to identify a country.
+ *     Users can also simply ask the wireless core to set regulatory domain
+ *     to a specific alpha2.
+ * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
+ *     rules.
+ *
+ * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
+ *     (u8, 0 or 1)
+ * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
+ *     (u8, 0 or 1)
+ *
+ * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
+ *     association request when used with NL80211_CMD_NEW_STATION)
+ *
+ * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
+ *     supported interface types, each a flag attribute with the number
+ *     of the interface mode.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -196,17 +274,46 @@ enum nl80211_attrs {
        NL80211_ATTR_STA_LISTEN_INTERVAL,
        NL80211_ATTR_STA_SUPPORTED_RATES,
        NL80211_ATTR_STA_VLAN,
-       NL80211_ATTR_STA_STATS,
+       NL80211_ATTR_STA_INFO,
 
        NL80211_ATTR_WIPHY_BANDS,
 
+       NL80211_ATTR_MNTR_FLAGS,
+
+       NL80211_ATTR_MESH_ID,
+       NL80211_ATTR_STA_PLINK_ACTION,
+       NL80211_ATTR_MPATH_NEXT_HOP,
+       NL80211_ATTR_MPATH_INFO,
+
+       NL80211_ATTR_BSS_CTS_PROT,
+       NL80211_ATTR_BSS_SHORT_PREAMBLE,
+       NL80211_ATTR_BSS_SHORT_SLOT_TIME,
+
+       NL80211_ATTR_HT_CAPABILITY,
+
+       NL80211_ATTR_SUPPORTED_IFTYPES,
+
+       NL80211_ATTR_REG_ALPHA2,
+       NL80211_ATTR_REG_RULES,
+
        /* add attributes here, update the policy in nl80211.c */
 
        __NL80211_ATTR_AFTER_LAST,
        NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
 };
 
-#define NL80211_MAX_SUPP_RATES 32
+/*
+ * Allow user space programs to use #ifdef on new attributes by defining them
+ * here
+ */
+#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
+
+#define NL80211_MAX_SUPP_RATES                 32
+#define NL80211_MAX_SUPP_REG_RULES             32
+#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY      0
+#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY    16
+#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY    24
+#define NL80211_HT_CAPABILITY_LEN              26
 
 /**
  * enum nl80211_iftype - (virtual) interface types
@@ -218,6 +325,7 @@ enum nl80211_attrs {
  * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points
  * @NL80211_IFTYPE_WDS: wireless distribution interface
  * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
+ * @NL80211_IFTYPE_MESH_POINT: mesh point
  * @NL80211_IFTYPE_MAX: highest interface type number currently defined
  * @__NL80211_IFTYPE_AFTER_LAST: internal use
  *
@@ -233,6 +341,7 @@ enum nl80211_iftype {
        NL80211_IFTYPE_AP_VLAN,
        NL80211_IFTYPE_WDS,
        NL80211_IFTYPE_MONITOR,
+       NL80211_IFTYPE_MESH_POINT,
 
        /* keep last */
        __NL80211_IFTYPE_AFTER_LAST,
@@ -262,27 +371,78 @@ enum nl80211_sta_flags {
 };
 
 /**
- * enum nl80211_sta_stats - station statistics
+ * enum nl80211_sta_info - station information
  *
- * These attribute types are used with %NL80211_ATTR_STA_STATS
+ * These attribute types are used with %NL80211_ATTR_STA_INFO
  * when getting information about a station.
  *
- * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
- * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
- * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
- * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
- * @__NL80211_STA_STAT_AFTER_LAST: internal
- * @NL80211_STA_STAT_MAX: highest possible station stats attribute
+ * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
+ * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station)
+ * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)
+ * @__NL80211_STA_INFO_AFTER_LAST: internal
+ * @NL80211_STA_INFO_MAX: highest possible station info attribute
+ */
+enum nl80211_sta_info {
+       __NL80211_STA_INFO_INVALID,
+       NL80211_STA_INFO_INACTIVE_TIME,
+       NL80211_STA_INFO_RX_BYTES,
+       NL80211_STA_INFO_TX_BYTES,
+       NL80211_STA_INFO_LLID,
+       NL80211_STA_INFO_PLID,
+       NL80211_STA_INFO_PLINK_STATE,
+
+       /* keep last */
+       __NL80211_STA_INFO_AFTER_LAST,
+       NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_mpath_flags - nl80211 mesh path flags
+ *
+ * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
+ * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
+ * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN
+ * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
+ * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
+ */
+enum nl80211_mpath_flags {
+       NL80211_MPATH_FLAG_ACTIVE =     1<<0,
+       NL80211_MPATH_FLAG_RESOLVING =  1<<1,
+       NL80211_MPATH_FLAG_DSN_VALID =  1<<2,
+       NL80211_MPATH_FLAG_FIXED =      1<<3,
+       NL80211_MPATH_FLAG_RESOLVED =   1<<4,
+};
+
+/**
+ * enum nl80211_mpath_info - mesh path information
+ *
+ * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
+ * information about a mesh path.
+ *
+ * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
+ * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
+ * @NL80211_ATTR_MPATH_DSN: destination sequence number
+ * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
+ * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
+ * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
+ *     &enum nl80211_mpath_flags;
+ * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
+ * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries
  */
-enum nl80211_sta_stats {
-       __NL80211_STA_STAT_INVALID,
-       NL80211_STA_STAT_INACTIVE_TIME,
-       NL80211_STA_STAT_RX_BYTES,
-       NL80211_STA_STAT_TX_BYTES,
+enum nl80211_mpath_info {
+       __NL80211_MPATH_INFO_INVALID,
+       NL80211_MPATH_INFO_FRAME_QLEN,
+       NL80211_MPATH_INFO_DSN,
+       NL80211_MPATH_INFO_METRIC,
+       NL80211_MPATH_INFO_EXPTIME,
+       NL80211_MPATH_INFO_FLAGS,
+       NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
+       NL80211_MPATH_INFO_DISCOVERY_RETRIES,
 
        /* keep last */
-       __NL80211_STA_STAT_AFTER_LAST,
-       NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
+       __NL80211_MPATH_INFO_AFTER_LAST,
+       NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
 };
 
 /**
@@ -344,4 +504,94 @@ enum nl80211_bitrate_attr {
        NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
 };
 
+/**
+ * enum nl80211_reg_rule_attr - regulatory rule attributes
+ * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
+ *     considerations for a given frequency range. These are the
+ *     &enum nl80211_reg_rule_flags.
+ * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
+ *     rule in KHz. This is not a center of frequency but an actual regulatory
+ *     band edge.
+ * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
+ *     in KHz. This is not a center a frequency but an actual regulatory
+ *     band edge.
+ * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
+ *     frequency range, in KHz.
+ * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
+ *     for a given frequency range. The value is in mBi (100 * dBi).
+ *     If you don't have one then don't send this.
+ * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
+ *     a given frequency range. The value is in mBm (100 * dBm).
+ */
+enum nl80211_reg_rule_attr {
+       __NL80211_REG_RULE_ATTR_INVALID,
+       NL80211_ATTR_REG_RULE_FLAGS,
+
+       NL80211_ATTR_FREQ_RANGE_START,
+       NL80211_ATTR_FREQ_RANGE_END,
+       NL80211_ATTR_FREQ_RANGE_MAX_BW,
+
+       NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
+       NL80211_ATTR_POWER_RULE_MAX_EIRP,
+
+       /* keep last */
+       __NL80211_REG_RULE_ATTR_AFTER_LAST,
+       NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
+};
+
+/**
+ * enum nl80211_reg_rule_flags - regulatory rule flags
+ *
+ * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
+ * @NL80211_RRF_NO_CCK: CCK modulation not allowed
+ * @NL80211_RRF_NO_INDOOR: indoor operation not allowed
+ * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
+ * @NL80211_RRF_DFS: DFS support is required to be used
+ * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
+ * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
+ * @NL80211_RRF_PASSIVE_SCAN: passive scan is required
+ * @NL80211_RRF_NO_IBSS: no IBSS is allowed
+ */
+enum nl80211_reg_rule_flags {
+       NL80211_RRF_NO_OFDM             = 1<<0,
+       NL80211_RRF_NO_CCK              = 1<<1,
+       NL80211_RRF_NO_INDOOR           = 1<<2,
+       NL80211_RRF_NO_OUTDOOR          = 1<<3,
+       NL80211_RRF_DFS                 = 1<<4,
+       NL80211_RRF_PTP_ONLY            = 1<<5,
+       NL80211_RRF_PTMP_ONLY           = 1<<6,
+       NL80211_RRF_PASSIVE_SCAN        = 1<<7,
+       NL80211_RRF_NO_IBSS             = 1<<8,
+};
+
+/**
+ * enum nl80211_mntr_flags - monitor configuration flags
+ *
+ * Monitor configuration flags.
+ *
+ * @__NL80211_MNTR_FLAG_INVALID: reserved
+ *
+ * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
+ * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
+ * @NL80211_MNTR_FLAG_CONTROL: pass control frames
+ * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
+ * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
+ *     overrides all other flags.
+ *
+ * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
+ * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
+ */
+enum nl80211_mntr_flags {
+       __NL80211_MNTR_FLAG_INVALID,
+       NL80211_MNTR_FLAG_FCSFAIL,
+       NL80211_MNTR_FLAG_PLCPFAIL,
+       NL80211_MNTR_FLAG_CONTROL,
+       NL80211_MNTR_FLAG_OTHER_BSS,
+       NL80211_MNTR_FLAG_COOK_FRAMES,
+
+       /* keep last */
+       __NL80211_MNTR_FLAG_AFTER_LAST,
+       NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
+};
+
 #endif /* __LINUX_NL80211_H */