Move generic definitions away from hostapd.h
[wpasupplicant] / hostapd / hostapd.h
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
6  *
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.
10  *
11  * Alternatively, this software may be distributed under the terms of BSD
12  * license.
13  *
14  * See README and COPYING for more details.
15  */
16
17 #ifndef HOSTAPD_H
18 #define HOSTAPD_H
19
20 #include "common.h"
21 #include "ap.h"
22 #include "hostapd_defs.h"
23 #include "config.h"
24
25 extern unsigned char rfc1042_header[6];
26
27 struct wpa_driver_ops;
28 struct wpa_ctrl_dst;
29 struct radius_server_data;
30
31 #ifdef CONFIG_FULL_DYNAMIC_VLAN
32 struct full_dynamic_vlan;
33 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
34
35 /**
36  * struct hostapd_data - hostapd per-BSS data structure
37  */
38 struct hostapd_data {
39         struct hostapd_iface *iface;
40         struct hostapd_config *iconf;
41         struct hostapd_bss_config *conf;
42         int interface_added; /* virtual interface added for this BSS */
43
44         u8 own_addr[ETH_ALEN];
45
46         int num_sta; /* number of entries in sta_list */
47         struct sta_info *sta_list; /* STA info list head */
48         struct sta_info *sta_hash[STA_HASH_SIZE];
49
50         /* pointers to STA info; based on allocated AID or NULL if AID free
51          * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
52          * and so on
53          */
54         struct sta_info *sta_aid[MAX_AID_TABLE_SIZE];
55
56         const struct wpa_driver_ops *driver;
57         void *drv_priv;
58
59         u8 *default_wep_key;
60         u8 default_wep_key_idx;
61
62         struct radius_client_data *radius;
63         int radius_client_reconfigured;
64         u32 acct_session_id_hi, acct_session_id_lo;
65
66         struct iapp_data *iapp;
67
68         struct hostapd_cached_radius_acl *acl_cache;
69         struct hostapd_acl_query_data *acl_queries;
70
71         struct wpa_authenticator *wpa_auth;
72         struct eapol_authenticator *eapol_auth;
73
74         struct rsn_preauth_interface *preauth_iface;
75         time_t michael_mic_failure;
76         int michael_mic_failures;
77         int tkip_countermeasures;
78
79         int ctrl_sock;
80         struct wpa_ctrl_dst *ctrl_dst;
81
82         void *ssl_ctx;
83         void *eap_sim_db_priv;
84         struct radius_server_data *radius_srv;
85
86         int parameter_set_count;
87
88 #ifdef CONFIG_FULL_DYNAMIC_VLAN
89         struct full_dynamic_vlan *full_dynamic_vlan;
90 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
91
92         struct l2_packet_data *l2;
93         struct wps_context *wps;
94
95 #ifdef CONFIG_WPS
96         u8 *wps_beacon_ie;
97         size_t wps_beacon_ie_len;
98         u8 *wps_probe_resp_ie;
99         size_t wps_probe_resp_ie_len;
100 #endif /* CONFIG_WPS */
101 };
102
103
104 /**
105  * struct hostapd_iface - hostapd per-interface data structure
106  */
107 struct hostapd_iface {
108         char *config_fname;
109         struct hostapd_config *conf;
110
111         size_t num_bss;
112         struct hostapd_data **bss;
113
114         int num_ap; /* number of entries in ap_list */
115         struct ap_info *ap_list; /* AP info list head */
116         struct ap_info *ap_hash[STA_HASH_SIZE];
117         struct ap_info *ap_iter_list;
118
119         struct hostapd_hw_modes *hw_features;
120         int num_hw_features;
121         struct hostapd_hw_modes *current_mode;
122         /* Rates that are currently used (i.e., filtered copy of
123          * current_mode->channels */
124         int num_rates;
125         struct hostapd_rate_data *current_rates;
126
127         u16 hw_flags;
128
129         /* Number of associated Non-ERP stations (i.e., stations using 802.11b
130          * in 802.11g BSS) */
131         int num_sta_non_erp;
132
133         /* Number of associated stations that do not support Short Slot Time */
134         int num_sta_no_short_slot_time;
135
136         /* Number of associated stations that do not support Short Preamble */
137         int num_sta_no_short_preamble;
138
139         int olbc; /* Overlapping Legacy BSS Condition */
140
141         /* Number of HT associated stations that do not support greenfield */
142         int num_sta_ht_no_gf;
143
144         /* Number of associated non-HT stations */
145         int num_sta_no_ht;
146
147         /* Number of HT associated stations 20 MHz */
148         int num_sta_ht_20mhz;
149
150         /* Overlapping BSS information */
151         int olbc_ht;
152
153 #ifdef CONFIG_IEEE80211N
154         u16 ht_op_mode;
155 #endif /* CONFIG_IEEE80211N */
156 };
157
158 int hostapd_reload_config(struct hostapd_iface *iface);
159
160 #endif /* HOSTAPD_H */