void *ctx, int (*cb)(struct wpa_authenticator *sm, void *ctx),
void *cb_ctx)
{
+ struct hostapd_data *hapd = ctx;
struct wpa_auth_iface_iter_data data;
data.cb = cb;
data.cb_ctx = cb_ctx;
- return hostapd_for_each_interface(wpa_auth_iface_iter, &data);
+ return hostapd_for_each_interface(hapd->iface->interfaces,
+ wpa_auth_iface_iter, &data);
}
struct wpa_ctrl_dst;
struct radius_server_data;
struct upnp_wps_device_sm;
+struct hapd_interfaces;
#ifdef CONFIG_FULL_DYNAMIC_VLAN
struct full_dynamic_vlan;
* struct hostapd_iface - hostapd per-interface data structure
*/
struct hostapd_iface {
+ struct hapd_interfaces *interfaces;
void *owner;
char *config_fname;
struct hostapd_config *conf;
int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
-int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
+int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
+ int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx);
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
};
-int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
+int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
+ int (*cb)(struct hostapd_iface *iface,
void *ctx), void *ctx)
{
- struct hapd_interfaces *interfaces = eloop_get_user_data();
size_t i;
int ret;
}
-static struct hostapd_iface * hostapd_interface_init(const char *config_fname,
- int debug)
+static struct hostapd_iface *
+hostapd_interface_init(struct hapd_interfaces *interfaces,
+ const char *config_fname, int debug)
{
struct hostapd_iface *iface;
int k;
iface = hostapd_init(config_fname);
if (!iface)
return NULL;
+ iface->interfaces = interfaces;
for (k = 0; k < debug; k++) {
if (iface->bss[0]->conf->logger_stdout_level > 0)
*/
static void handle_reload(int sig, void *eloop_ctx, void *signal_ctx)
{
+ struct hapd_interfaces *interfaces = eloop_ctx;
wpa_printf(MSG_DEBUG, "Signal %d received - reloading configuration",
sig);
- hostapd_for_each_interface(handle_reload_iface, NULL);
+ hostapd_for_each_interface(interfaces, handle_reload_iface, NULL);
}
static void handle_dump_state(int sig, void *eloop_ctx, void *signal_ctx)
{
#ifdef HOSTAPD_DUMP_STATE
- hostapd_for_each_interface(handle_dump_state_iface, NULL);
+ struct hapd_interfaces *interfaces = eloop_ctx;
+ hostapd_for_each_interface(interfaces, handle_dump_state_iface, NULL);
#endif /* HOSTAPD_DUMP_STATE */
}
#endif /* CONFIG_NATIVE_WINDOWS */
/* Initialize interfaces */
for (i = 0; i < interfaces.count; i++) {
- interfaces.iface[i] = hostapd_interface_init(argv[optind + i],
+ interfaces.iface[i] = hostapd_interface_init(&interfaces,
+ argv[optind + i],
debug);
if (!interfaces.iface[i])
goto out;