2008-10-29 20:48:14 +01:00
|
|
|
/*
|
|
|
|
* IEEE 802.11 Common routines
|
|
|
|
* Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* Alternatively, this software may be distributed under the terms of BSD
|
|
|
|
* license.
|
|
|
|
*
|
|
|
|
* See README and COPYING for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IEEE802_11_COMMON_H
|
|
|
|
#define IEEE802_11_COMMON_H
|
|
|
|
|
|
|
|
/* Parsed Information Elements */
|
|
|
|
struct ieee802_11_elems {
|
|
|
|
u8 *ssid;
|
|
|
|
u8 ssid_len;
|
|
|
|
u8 *supp_rates;
|
|
|
|
u8 supp_rates_len;
|
|
|
|
u8 *fh_params;
|
|
|
|
u8 fh_params_len;
|
|
|
|
u8 *ds_params;
|
|
|
|
u8 ds_params_len;
|
|
|
|
u8 *cf_params;
|
|
|
|
u8 cf_params_len;
|
|
|
|
u8 *tim;
|
|
|
|
u8 tim_len;
|
|
|
|
u8 *ibss_params;
|
|
|
|
u8 ibss_params_len;
|
|
|
|
u8 *challenge;
|
|
|
|
u8 challenge_len;
|
|
|
|
u8 *erp_info;
|
|
|
|
u8 erp_info_len;
|
|
|
|
u8 *ext_supp_rates;
|
|
|
|
u8 ext_supp_rates_len;
|
|
|
|
u8 *wpa_ie;
|
|
|
|
u8 wpa_ie_len;
|
|
|
|
u8 *rsn_ie;
|
|
|
|
u8 rsn_ie_len;
|
2009-03-04 11:33:24 +01:00
|
|
|
u8 *wmm; /* WMM Information or Parameter Element */
|
|
|
|
u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
|
|
|
|
u8 *wmm_tspec;
|
|
|
|
u8 wmm_tspec_len;
|
2008-11-23 18:34:26 +01:00
|
|
|
u8 *wps_ie;
|
|
|
|
u8 wps_ie_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
u8 *power_cap;
|
|
|
|
u8 power_cap_len;
|
|
|
|
u8 *supp_channels;
|
|
|
|
u8 supp_channels_len;
|
|
|
|
u8 *mdie;
|
|
|
|
u8 mdie_len;
|
|
|
|
u8 *ftie;
|
|
|
|
u8 ftie_len;
|
2009-01-19 17:42:10 +01:00
|
|
|
u8 *timeout_int;
|
|
|
|
u8 timeout_int_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
u8 *ht_capabilities;
|
|
|
|
u8 ht_capabilities_len;
|
|
|
|
u8 *ht_operation;
|
|
|
|
u8 ht_operation_len;
|
2008-12-04 12:42:33 +01:00
|
|
|
u8 *vendor_ht_cap;
|
|
|
|
u8 vendor_ht_cap_len;
|
2008-10-29 20:48:14 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
|
|
|
|
|
|
|
|
ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
|
|
|
|
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);
|
2008-10-29 20:48:14 +01:00
|
|
|
|
|
|
|
#endif /* IEEE802_11_COMMON_H */
|