00001 /* 00002 * IEEE 802.11 Common routines 00003 * Copyright (c) 2002-2009, Jouni Malinen <j@w1.fi> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation. 00008 * 00009 * Alternatively, this software may be distributed under the terms of BSD 00010 * license. 00011 * 00012 * See README and COPYING for more details. 00013 */ 00014 00015 #ifndef IEEE802_11_COMMON_H 00016 #define IEEE802_11_COMMON_H 00017 00018 /* Parsed Information Elements */ 00019 struct ieee802_11_elems { 00020 const u8 *ssid; 00021 const u8 *supp_rates; 00022 const u8 *fh_params; 00023 const u8 *ds_params; 00024 const u8 *cf_params; 00025 const u8 *tim; 00026 const u8 *ibss_params; 00027 const u8 *challenge; 00028 const u8 *erp_info; 00029 const u8 *ext_supp_rates; 00030 const u8 *wpa_ie; 00031 const u8 *rsn_ie; 00032 const u8 *wmm; /* WMM Information or Parameter Element */ 00033 const u8 *wmm_tspec; 00034 const u8 *wps_ie; 00035 const u8 *power_cap; 00036 const u8 *supp_channels; 00037 const u8 *mdie; 00038 const u8 *ftie; 00039 const u8 *timeout_int; 00040 const u8 *ht_capabilities; 00041 const u8 *ht_operation; 00042 const u8 *vendor_ht_cap; 00043 00044 u8 ssid_len; 00045 u8 supp_rates_len; 00046 u8 fh_params_len; 00047 u8 ds_params_len; 00048 u8 cf_params_len; 00049 u8 tim_len; 00050 u8 ibss_params_len; 00051 u8 challenge_len; 00052 u8 erp_info_len; 00053 u8 ext_supp_rates_len; 00054 u8 wpa_ie_len; 00055 u8 rsn_ie_len; 00056 u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */ 00057 u8 wmm_tspec_len; 00058 u8 wps_ie_len; 00059 u8 power_cap_len; 00060 u8 supp_channels_len; 00061 u8 mdie_len; 00062 u8 ftie_len; 00063 u8 timeout_int_len; 00064 u8 ht_capabilities_len; 00065 u8 ht_operation_len; 00066 u8 vendor_ht_cap_len; 00067 }; 00068 00069 typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes; 00070 00071 ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, 00072 struct ieee802_11_elems *elems, 00073 int show_errors); 00074 int ieee802_11_ie_count(const u8 *ies, size_t ies_len); 00075 struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len, 00076 u32 oui_type); 00077 00078 #endif /* IEEE802_11_COMMON_H */