2008-10-29 20:48:14 +01:00
|
|
|
/*
|
|
|
|
* IEEE 802.11 Common routines
|
2012-12-16 20:22:24 +01:00
|
|
|
* Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
|
2008-10-29 20:48:14 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-10-29 20:48:14 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IEEE802_11_COMMON_H
|
|
|
|
#define IEEE802_11_COMMON_H
|
|
|
|
|
|
|
|
/* Parsed Information Elements */
|
|
|
|
struct ieee802_11_elems {
|
2009-12-13 22:11:11 +01:00
|
|
|
const u8 *ssid;
|
|
|
|
const u8 *supp_rates;
|
|
|
|
const u8 *fh_params;
|
|
|
|
const u8 *ds_params;
|
|
|
|
const u8 *cf_params;
|
|
|
|
const u8 *tim;
|
|
|
|
const u8 *ibss_params;
|
|
|
|
const u8 *challenge;
|
|
|
|
const u8 *erp_info;
|
|
|
|
const u8 *ext_supp_rates;
|
|
|
|
const u8 *wpa_ie;
|
|
|
|
const u8 *rsn_ie;
|
|
|
|
const u8 *wmm; /* WMM Information or Parameter Element */
|
|
|
|
const u8 *wmm_tspec;
|
|
|
|
const u8 *wps_ie;
|
|
|
|
const u8 *power_cap;
|
|
|
|
const u8 *supp_channels;
|
|
|
|
const u8 *mdie;
|
|
|
|
const u8 *ftie;
|
|
|
|
const u8 *timeout_int;
|
|
|
|
const u8 *ht_capabilities;
|
|
|
|
const u8 *ht_operation;
|
2012-08-10 18:39:43 +02:00
|
|
|
const u8 *vht_capabilities;
|
|
|
|
const u8 *vht_operation;
|
2009-12-13 22:11:11 +01:00
|
|
|
const u8 *vendor_ht_cap;
|
2010-07-18 23:30:24 +02:00
|
|
|
const u8 *p2p;
|
2012-03-02 16:26:01 +01:00
|
|
|
const u8 *wfd;
|
2010-12-13 10:20:55 +01:00
|
|
|
const u8 *link_id;
|
2011-10-21 11:43:24 +02:00
|
|
|
const u8 *interworking;
|
2011-10-03 17:23:01 +02:00
|
|
|
const u8 *hs20;
|
2012-05-28 02:35:00 +02:00
|
|
|
const u8 *ext_capab;
|
|
|
|
const u8 *bss_max_idle_period;
|
2012-12-16 20:22:24 +01:00
|
|
|
const u8 *ssid_list;
|
2009-12-13 22:11:11 +01:00
|
|
|
|
2008-10-29 20:48:14 +01:00
|
|
|
u8 ssid_len;
|
|
|
|
u8 supp_rates_len;
|
|
|
|
u8 fh_params_len;
|
|
|
|
u8 ds_params_len;
|
|
|
|
u8 cf_params_len;
|
|
|
|
u8 tim_len;
|
|
|
|
u8 ibss_params_len;
|
|
|
|
u8 challenge_len;
|
|
|
|
u8 erp_info_len;
|
|
|
|
u8 ext_supp_rates_len;
|
|
|
|
u8 wpa_ie_len;
|
|
|
|
u8 rsn_ie_len;
|
2009-03-04 11:33:24 +01:00
|
|
|
u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
|
|
|
|
u8 wmm_tspec_len;
|
2008-11-23 18:34:26 +01:00
|
|
|
u8 wps_ie_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
u8 power_cap_len;
|
|
|
|
u8 supp_channels_len;
|
|
|
|
u8 mdie_len;
|
|
|
|
u8 ftie_len;
|
2009-01-19 17:42:10 +01:00
|
|
|
u8 timeout_int_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
u8 ht_capabilities_len;
|
|
|
|
u8 ht_operation_len;
|
2012-08-10 18:39:43 +02:00
|
|
|
u8 vht_capabilities_len;
|
|
|
|
u8 vht_operation_len;
|
2008-12-04 12:42:33 +01:00
|
|
|
u8 vendor_ht_cap_len;
|
2010-07-18 23:30:24 +02:00
|
|
|
u8 p2p_len;
|
2012-03-02 16:26:01 +01:00
|
|
|
u8 wfd_len;
|
2011-10-21 11:43:24 +02:00
|
|
|
u8 interworking_len;
|
2011-10-03 17:23:01 +02:00
|
|
|
u8 hs20_len;
|
2012-05-28 02:35:00 +02:00
|
|
|
u8 ext_capab_len;
|
2012-12-16 20:22:24 +01:00
|
|
|
u8 ssid_list_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
|
|
|
|
|
2009-12-13 22:11:11 +01:00
|
|
|
ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
|
2008-10-29 20:48:14 +01:00
|
|
|
struct ieee802_11_elems *elems,
|
|
|
|
int show_errors);
|
2009-03-09 19:45:17 +01:00
|
|
|
int ieee802_11_ie_count(const u8 *ies, size_t ies_len);
|
2009-09-11 15:36:59 +02:00
|
|
|
struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len,
|
|
|
|
u32 oui_type);
|
2011-10-20 20:50:23 +02:00
|
|
|
struct ieee80211_hdr;
|
|
|
|
const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len);
|
2008-10-29 20:48:14 +01:00
|
|
|
|
2012-08-12 10:33:00 +02:00
|
|
|
struct hostapd_wmm_ac_params {
|
|
|
|
int cwmin;
|
|
|
|
int cwmax;
|
|
|
|
int aifs;
|
|
|
|
int txop_limit; /* in units of 32us */
|
|
|
|
int admission_control_mandatory;
|
|
|
|
};
|
|
|
|
|
|
|
|
int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[],
|
|
|
|
const char *name, const char *val);
|
|
|
|
|
2008-10-29 20:48:14 +01:00
|
|
|
#endif /* IEEE802_11_COMMON_H */
|