]> git.ipfire.org Git - thirdparty/hostap.git/blame - hostapd/hostapd.h
Replace hostapd_wps_probe_req_rx() with more generic ProbeReq notifier
[thirdparty/hostap.git] / hostapd / hostapd.h
CommitLineData
6fc6879b
JM
1/*
2 * hostapd / Initialization and configuration
3 * Host AP kernel driver
ddaa83eb 4 * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
71b6ae14 5 * Copyright (c) 2007-2008, Intel Corporation
6fc6879b
JM
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"
8d06da09 21#include "hostapd_defs.h"
6fc6879b 22
c5121837 23struct wpa_driver_ops;
6fc6879b
JM
24struct wpa_ctrl_dst;
25struct radius_server_data;
f620268f 26struct upnp_wps_device_sm;
6fc6879b
JM
27
28#ifdef CONFIG_FULL_DYNAMIC_VLAN
29struct full_dynamic_vlan;
30#endif /* CONFIG_FULL_DYNAMIC_VLAN */
31
32/**
33 * struct hostapd_data - hostapd per-BSS data structure
34 */
35struct hostapd_data {
36 struct hostapd_iface *iface;
37 struct hostapd_config *iconf;
38 struct hostapd_bss_config *conf;
39 int interface_added; /* virtual interface added for this BSS */
40
41 u8 own_addr[ETH_ALEN];
42
43 int num_sta; /* number of entries in sta_list */
44 struct sta_info *sta_list; /* STA info list head */
2991469c
JM
45#define STA_HASH_SIZE 256
46#define STA_HASH(sta) (sta[5])
6fc6879b
JM
47 struct sta_info *sta_hash[STA_HASH_SIZE];
48
2991469c
JM
49 /*
50 * Bitfield for indicating which AIDs are allocated. Only AID values
51 * 1-2007 are used and as such, the bit at index 0 corresponds to AID
52 * 1.
6fc6879b 53 */
2991469c
JM
54#define AID_WORDS ((2008 + 31) / 32)
55 u32 sta_aid[AID_WORDS];
6fc6879b 56
c5121837 57 const struct wpa_driver_ops *driver;
6fc6879b
JM
58 void *drv_priv;
59
6fc6879b
JM
60 struct radius_client_data *radius;
61 int radius_client_reconfigured;
62 u32 acct_session_id_hi, acct_session_id_lo;
63
64 struct iapp_data *iapp;
65
6fc6879b
JM
66 struct hostapd_cached_radius_acl *acl_cache;
67 struct hostapd_acl_query_data *acl_queries;
68
69 struct wpa_authenticator *wpa_auth;
70 struct eapol_authenticator *eapol_auth;
71
72 struct rsn_preauth_interface *preauth_iface;
73 time_t michael_mic_failure;
74 int michael_mic_failures;
75 int tkip_countermeasures;
76
77 int ctrl_sock;
78 struct wpa_ctrl_dst *ctrl_dst;
79
80 void *ssl_ctx;
81 void *eap_sim_db_priv;
82 struct radius_server_data *radius_srv;
83
84 int parameter_set_count;
85
86#ifdef CONFIG_FULL_DYNAMIC_VLAN
87 struct full_dynamic_vlan *full_dynamic_vlan;
88#endif /* CONFIG_FULL_DYNAMIC_VLAN */
89
90 struct l2_packet_data *l2;
ad08c363
JM
91 struct wps_context *wps;
92
93#ifdef CONFIG_WPS
94 u8 *wps_beacon_ie;
95 size_t wps_beacon_ie_len;
96 u8 *wps_probe_resp_ie;
97 size_t wps_probe_resp_ie_len;
3b2cf800 98 unsigned int ap_pin_failures;
f620268f 99 struct upnp_wps_device_sm *wps_upnp;
ad08c363 100#endif /* CONFIG_WPS */
6fc6879b
JM
101};
102
103
6fc6879b
JM
104/**
105 * struct hostapd_iface - hostapd per-interface data structure
106 */
107struct hostapd_iface {
0f2b2c19 108 void *owner;
6fc6879b
JM
109 char *config_fname;
110 struct hostapd_config *conf;
111
6fc6879b
JM
112 size_t num_bss;
113 struct hostapd_data **bss;
114
115 int num_ap; /* number of entries in ap_list */
116 struct ap_info *ap_list; /* AP info list head */
117 struct ap_info *ap_hash[STA_HASH_SIZE];
118 struct ap_info *ap_iter_list;
119
120 struct hostapd_hw_modes *hw_features;
121 int num_hw_features;
122 struct hostapd_hw_modes *current_mode;
123 /* Rates that are currently used (i.e., filtered copy of
124 * current_mode->channels */
125 int num_rates;
126 struct hostapd_rate_data *current_rates;
6fc6879b
JM
127
128 u16 hw_flags;
129
130 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
131 * in 802.11g BSS) */
132 int num_sta_non_erp;
133
134 /* Number of associated stations that do not support Short Slot Time */
135 int num_sta_no_short_slot_time;
136
137 /* Number of associated stations that do not support Short Preamble */
138 int num_sta_no_short_preamble;
139
140 int olbc; /* Overlapping Legacy BSS Condition */
141
de9289c8
JM
142 /* Number of HT associated stations that do not support greenfield */
143 int num_sta_ht_no_gf;
144
145 /* Number of associated non-HT stations */
146 int num_sta_no_ht;
147
148 /* Number of HT associated stations 20 MHz */
149 int num_sta_ht_20mhz;
150
151 /* Overlapping BSS information */
152 int olbc_ht;
153
edd360e1 154 u16 ht_op_mode;
ad1e68e6 155 void (*scan_cb)(struct hostapd_iface *iface);
6fc6879b
JM
156};
157
ad08c363 158int hostapd_reload_config(struct hostapd_iface *iface);
b6a7859d
JM
159struct hostapd_data *
160hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
161 struct hostapd_config *conf,
162 struct hostapd_bss_config *bss);
5c333467 163int hostapd_setup_interface(struct hostapd_iface *iface);
ad1e68e6 164int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
5c333467
JM
165void hostapd_interface_deinit(struct hostapd_iface *iface);
166int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
167int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
168
b5b969e9
JM
169int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
170 void *ctx), void *ctx);
6fc6879b
JM
171
172#endif /* HOSTAPD_H */