2 * IEEE 802.11 Common routines
3 * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
9 #ifndef IEEE802_11_COMMON_H
10 #define IEEE802_11_COMMON_H
12 /* Parsed Information Elements */
13 struct ieee802_11_elems {
19 const u8 *ext_supp_rates;
22 const u8 *wmm; /* WMM Information or Parameter Element */
25 const u8 *supp_channels;
28 const u8 *timeout_int;
29 const u8 *ht_capabilities;
30 const u8 *ht_operation;
31 const u8 *mesh_config;
34 const u8 *vht_capabilities;
35 const u8 *vht_operation;
36 const u8 *vht_opmode_notif;
37 const u8 *vendor_ht_cap;
42 const u8 *interworking;
43 const u8 *qos_map_set;
46 const u8 *bss_max_idle_period;
57 u8 ext_supp_rates_len;
60 u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
67 u8 ht_capabilities_len;
72 u8 vht_capabilities_len;
88 typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
90 ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
91 struct ieee802_11_elems *elems,
93 int ieee802_11_ie_count(const u8 *ies, size_t ies_len);
94 struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len,
97 const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len);
99 struct hostapd_wmm_ac_params {
103 int txop_limit; /* in units of 32us */
104 int admission_control_mandatory;
107 int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[],
108 const char *name, const char *val);
109 enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel);
110 int ieee80211_chan_to_freq(const char *country, u8 op_class, u8 chan);
111 int ieee80211_is_dfs(int freq);
113 int supp_rates_11b_only(struct ieee802_11_elems *elems);
115 const char * fc2str(u16 fc);
116 #endif /* IEEE802_11_COMMON_H */