Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / common / ieee802_11_common.h
CommitLineData
a875087d
JL
1/*
2 * IEEE 802.11 Common routines
4781064b 3 * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
a875087d 4 *
4781064b
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
a875087d
JL
7 */
8
9#ifndef IEEE802_11_COMMON_H
10#define IEEE802_11_COMMON_H
11
12/* Parsed Information Elements */
13struct ieee802_11_elems {
4781064b
JM
14 const u8 *ssid;
15 const u8 *supp_rates;
16 const u8 *ds_params;
17 const u8 *challenge;
18 const u8 *erp_info;
19 const u8 *ext_supp_rates;
20 const u8 *wpa_ie;
21 const u8 *rsn_ie;
22 const u8 *wmm; /* WMM Information or Parameter Element */
23 const u8 *wmm_tspec;
24 const u8 *wps_ie;
25 const u8 *supp_channels;
26 const u8 *mdie;
27 const u8 *ftie;
28 const u8 *timeout_int;
29 const u8 *ht_capabilities;
30 const u8 *ht_operation;
31 const u8 *vht_capabilities;
32 const u8 *vht_operation;
33 const u8 *vendor_ht_cap;
34 const u8 *p2p;
35 const u8 *wfd;
36 const u8 *link_id;
37 const u8 *interworking;
38 const u8 *qos_map_set;
39 const u8 *hs20;
40 const u8 *ext_capab;
41 const u8 *bss_max_idle_period;
42 const u8 *ssid_list;
43
a875087d 44 u8 ssid_len;
a875087d 45 u8 supp_rates_len;
a875087d 46 u8 ds_params_len;
a875087d 47 u8 challenge_len;
a875087d 48 u8 erp_info_len;
a875087d 49 u8 ext_supp_rates_len;
a875087d 50 u8 wpa_ie_len;
a875087d 51 u8 rsn_ie_len;
a875087d 52 u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
a875087d 53 u8 wmm_tspec_len;
a875087d 54 u8 wps_ie_len;
a875087d 55 u8 supp_channels_len;
a875087d 56 u8 mdie_len;
a875087d 57 u8 ftie_len;
a875087d 58 u8 timeout_int_len;
a875087d 59 u8 ht_capabilities_len;
a875087d 60 u8 ht_operation_len;
4781064b
JM
61 u8 vht_capabilities_len;
62 u8 vht_operation_len;
a875087d 63 u8 vendor_ht_cap_len;
4781064b
JM
64 u8 p2p_len;
65 u8 wfd_len;
66 u8 interworking_len;
67 u8 qos_map_set_len;
68 u8 hs20_len;
69 u8 ext_capab_len;
70 u8 ssid_list_len;
a875087d
JL
71};
72
73typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
74
4781064b 75ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
a875087d
JL
76 struct ieee802_11_elems *elems,
77 int show_errors);
4781064b
JM
78int ieee802_11_ie_count(const u8 *ies, size_t ies_len);
79struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len,
80 u32 oui_type);
81struct ieee80211_hdr;
82const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len);
83
84struct hostapd_wmm_ac_params {
85 int cwmin;
86 int cwmax;
87 int aifs;
88 int txop_limit; /* in units of 32us */
89 int admission_control_mandatory;
90};
91
92int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[],
93 const char *name, const char *val);
94enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel);
95
96int supp_rates_11b_only(struct ieee802_11_elems *elems);
a875087d
JL
97
98#endif /* IEEE802_11_COMMON_H */