Actually hook powernow.4 into the build.
[dragonfly.git] / contrib / hostapd / hostapd / hostapd.h
blob26f30d7016ff74d7132190f2908507b43a666a05
1 /*
2 * hostapd / Initialization and configuration
3 * Host AP kernel driver
4 * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
5 * Copyright (c) 2007-2008, Intel Corporation
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
12 * license.
14 * See README and COPYING for more details.
17 #ifndef HOSTAPD_H
18 #define HOSTAPD_H
20 #include "common.h"
21 #include "ap.h"
23 #ifndef ETH_ALEN
24 #define ETH_ALEN 6
25 #endif
26 #ifndef IFNAMSIZ
27 #define IFNAMSIZ 16
28 #endif
29 #ifndef ETH_P_ALL
30 #define ETH_P_ALL 0x0003
31 #endif
32 #ifndef ETH_P_PAE
33 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
34 #endif /* ETH_P_PAE */
35 #ifndef ETH_P_EAPOL
36 #define ETH_P_EAPOL ETH_P_PAE
37 #endif /* ETH_P_EAPOL */
39 #ifndef ETH_P_RRB
40 #define ETH_P_RRB 0x890D
41 #endif /* ETH_P_RRB */
43 #include "config.h"
45 #ifdef _MSC_VER
46 #pragma pack(push, 1)
47 #endif /* _MSC_VER */
49 #define MAX_VLAN_ID 4094
51 struct ieee8023_hdr {
52 u8 dest[6];
53 u8 src[6];
54 u16 ethertype;
55 } STRUCT_PACKED;
58 struct ieee80211_hdr {
59 le16 frame_control;
60 le16 duration_id;
61 u8 addr1[6];
62 u8 addr2[6];
63 u8 addr3[6];
64 le16 seq_ctrl;
65 /* followed by 'u8 addr4[6];' if ToDS and FromDS is set in data frame
67 } STRUCT_PACKED;
69 #ifdef _MSC_VER
70 #pragma pack(pop)
71 #endif /* _MSC_VER */
73 #define IEEE80211_DA_FROMDS addr1
74 #define IEEE80211_BSSID_FROMDS addr2
75 #define IEEE80211_SA_FROMDS addr3
77 #define IEEE80211_HDRLEN (sizeof(struct ieee80211_hdr))
79 #define IEEE80211_FC(type, stype) host_to_le16((type << 2) | (stype << 4))
81 /* MTU to be set for the wlan#ap device; this is mainly needed for IEEE 802.1X
82 * frames that might be longer than normal default MTU and they are not
83 * fragmented */
84 #define HOSTAPD_MTU 2290
86 extern unsigned char rfc1042_header[6];
88 struct hostap_sta_driver_data {
89 unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
90 unsigned long current_tx_rate;
91 unsigned long inactive_msec;
92 unsigned long flags;
93 unsigned long num_ps_buf_frames;
94 unsigned long tx_retry_failed;
95 unsigned long tx_retry_count;
96 int last_rssi;
97 int last_ack_rssi;
100 struct wpa_driver_ops;
101 struct wpa_ctrl_dst;
102 struct radius_server_data;
103 struct upnp_wps_device_sm;
105 #ifdef CONFIG_FULL_DYNAMIC_VLAN
106 struct full_dynamic_vlan;
107 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
110 * struct hostapd_data - hostapd per-BSS data structure
112 struct hostapd_data {
113 struct hostapd_iface *iface;
114 struct hostapd_config *iconf;
115 struct hostapd_bss_config *conf;
116 int interface_added; /* virtual interface added for this BSS */
118 u8 own_addr[ETH_ALEN];
120 int num_sta; /* number of entries in sta_list */
121 struct sta_info *sta_list; /* STA info list head */
122 struct sta_info *sta_hash[STA_HASH_SIZE];
124 /* pointers to STA info; based on allocated AID or NULL if AID free
125 * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
126 * and so on
128 struct sta_info *sta_aid[MAX_AID_TABLE_SIZE];
130 const struct wpa_driver_ops *driver;
131 void *drv_priv;
133 u8 *default_wep_key;
134 u8 default_wep_key_idx;
136 struct radius_client_data *radius;
137 int radius_client_reconfigured;
138 u32 acct_session_id_hi, acct_session_id_lo;
140 struct iapp_data *iapp;
142 struct hostapd_cached_radius_acl *acl_cache;
143 struct hostapd_acl_query_data *acl_queries;
145 struct wpa_authenticator *wpa_auth;
146 struct eapol_authenticator *eapol_auth;
148 struct rsn_preauth_interface *preauth_iface;
149 time_t michael_mic_failure;
150 int michael_mic_failures;
151 int tkip_countermeasures;
153 int ctrl_sock;
154 struct wpa_ctrl_dst *ctrl_dst;
156 void *ssl_ctx;
157 void *eap_sim_db_priv;
158 struct radius_server_data *radius_srv;
160 int parameter_set_count;
162 #ifdef CONFIG_FULL_DYNAMIC_VLAN
163 struct full_dynamic_vlan *full_dynamic_vlan;
164 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
166 struct l2_packet_data *l2;
167 struct wps_context *wps;
169 #ifdef CONFIG_WPS
170 u8 *wps_beacon_ie;
171 size_t wps_beacon_ie_len;
172 u8 *wps_probe_resp_ie;
173 size_t wps_probe_resp_ie_len;
174 unsigned int ap_pin_failures;
175 struct upnp_wps_device_sm *wps_upnp;
176 #endif /* CONFIG_WPS */
181 * struct hostapd_iface - hostapd per-interface data structure
183 struct hostapd_iface {
184 char *config_fname;
185 struct hostapd_config *conf;
187 size_t num_bss;
188 struct hostapd_data **bss;
190 int num_ap; /* number of entries in ap_list */
191 struct ap_info *ap_list; /* AP info list head */
192 struct ap_info *ap_hash[STA_HASH_SIZE];
193 struct ap_info *ap_iter_list;
195 struct hostapd_hw_modes *hw_features;
196 int num_hw_features;
197 struct hostapd_hw_modes *current_mode;
198 /* Rates that are currently used (i.e., filtered copy of
199 * current_mode->channels */
200 int num_rates;
201 struct hostapd_rate_data *current_rates;
203 u16 hw_flags;
205 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
206 * in 802.11g BSS) */
207 int num_sta_non_erp;
209 /* Number of associated stations that do not support Short Slot Time */
210 int num_sta_no_short_slot_time;
212 /* Number of associated stations that do not support Short Preamble */
213 int num_sta_no_short_preamble;
215 int olbc; /* Overlapping Legacy BSS Condition */
217 /* Number of HT associated stations that do not support greenfield */
218 int num_sta_ht_no_gf;
220 /* Number of associated non-HT stations */
221 int num_sta_no_ht;
223 /* Number of HT associated stations 20 MHz */
224 int num_sta_ht_20mhz;
226 /* Overlapping BSS information */
227 int olbc_ht;
229 #ifdef CONFIG_IEEE80211N
230 u16 ht_op_mode;
231 #endif /* CONFIG_IEEE80211N */
234 void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
235 int reassoc);
236 int hostapd_reload_config(struct hostapd_iface *iface);
238 #endif /* HOSTAPD_H */