wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ieee802_11_common.h
Go to the documentation of this file.
1 
5 #ifndef IEEE802_11_COMMON_H
6 #define IEEE802_11_COMMON_H
7 
8 #define MAX_NOF_MB_IES_SUPPORTED 5
9 
10 struct mb_ies_info {
11  struct {
12  const u8 *ie;
13  u8 ie_len;
14  } ies[MAX_NOF_MB_IES_SUPPORTED];
15  u8 nof_ies;
16 };
17 
18 /* Parsed Information Elements */
20  const u8 *ssid;
21  const u8 *supp_rates;
22  const u8 *ds_params;
23  const u8 *challenge;
24  const u8 *erp_info;
25  const u8 *ext_supp_rates;
26  const u8 *wpa_ie;
27  const u8 *rsn_ie;
28  const u8 *wmm; /* WMM Information or Parameter Element */
29  const u8 *wmm_tspec;
30  const u8 *wps_ie;
31  const u8 *supp_channels;
32  const u8 *mdie;
33  const u8 *ftie;
34  const u8 *timeout_int;
35  const u8 *ht_capabilities;
36  const u8 *ht_operation;
37  const u8 *mesh_config;
38  const u8 *mesh_id;
39  const u8 *peer_mgmt;
40  const u8 *vht_capabilities;
41  const u8 *vht_operation;
42  const u8 *vht_opmode_notif;
43  const u8 *vendor_ht_cap;
44  const u8 *vendor_vht;
45  const u8 *p2p;
46  const u8 *wfd;
47  const u8 *link_id;
48  const u8 *interworking;
49  const u8 *qos_map_set;
50  const u8 *hs20;
51  const u8 *ext_capab;
52  const u8 *bss_max_idle_period;
53  const u8 *ssid_list;
54  const u8 *osen;
55  const u8 *ampe;
56  const u8 *mic;
57  const u8 *pref_freq_list;
58 
59  u8 ssid_len;
60  u8 supp_rates_len;
61  u8 challenge_len;
62  u8 ext_supp_rates_len;
63  u8 wpa_ie_len;
64  u8 rsn_ie_len;
65  u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
66  u8 wmm_tspec_len;
67  u8 wps_ie_len;
68  u8 supp_channels_len;
69  u8 mdie_len;
70  u8 ftie_len;
71  u8 mesh_config_len;
72  u8 mesh_id_len;
73  u8 peer_mgmt_len;
74  u8 vendor_ht_cap_len;
75  u8 vendor_vht_len;
76  u8 p2p_len;
77  u8 wfd_len;
78  u8 interworking_len;
79  u8 qos_map_set_len;
80  u8 hs20_len;
81  u8 ext_capab_len;
82  u8 ssid_list_len;
83  u8 osen_len;
84  u8 ampe_len;
85  u8 mic_len;
86  u8 pref_freq_list_len;
87  struct mb_ies_info mb_ies;
88 };
89 
90 typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
91 
92 ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
93  struct ieee802_11_elems *elems,
94  int show_errors);
95 int ieee802_11_ie_count(const u8 *ies, size_t ies_len);
96 struct wpabuf * ieee802_11_vendor_ie_concat(const u8 *ies, size_t ies_len,
97  u32 oui_type);
98 struct ieee80211_hdr;
99 const u8 * get_hdr_bssid(const struct ieee80211_hdr *hdr, size_t len);
100 
102  int cwmin;
103  int cwmax;
104  int aifs;
105  int txop_limit; /* in units of 32us */
106  int admission_control_mandatory;
107 };
108 
109 int hostapd_config_wmm_ac(struct hostapd_wmm_ac_params wmm_ac_params[],
110  const char *name, const char *val);
111 enum hostapd_hw_mode ieee80211_freq_to_chan(int freq, u8 *channel);
112 int ieee80211_chan_to_freq(const char *country, u8 op_class, u8 chan);
113 enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
114  int sec_channel, int vht,
115  u8 *op_class, u8 *channel);
116 int ieee80211_is_dfs(int freq);
117 
118 int supp_rates_11b_only(struct ieee802_11_elems *elems);
119 int mb_ies_info_by_ies(struct mb_ies_info *info, const u8 *ies_buf,
120  size_t ies_len);
121 struct wpabuf * mb_ies_by_info(struct mb_ies_info *info);
122 
123 const char * fc2str(u16 fc);
124 #endif /* IEEE802_11_COMMON_H */
ParseRes ieee802_11_parse_elems(const u8 *start, size_t len, struct ieee802_11_elems *elems, int show_errors)
Parse information elements in management frames.
Definition: ieee802_11_common.c:181
enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq, int sec_channel, int vht, u8 *op_class, u8 *channel)
Convert frequency into channel info for HT40 and VHT. DFS channels are not covered.
Definition: ieee802_11_common.c:583
Definition: wpabuf.h:16
Definition: ieee802_11_defs.h:445
hostapd_hw_mode
Hardware mode.
Definition: defs.h:302
Definition: ieee802_11_common.h:19
int ieee80211_chan_to_freq(const char *country, u8 op_class, u8 chan)
Convert channel info to frequency.
Definition: ieee802_11_common.c:958
Definition: ieee802_11_common.h:101
Definition: ieee802_11_common.h:10