};
-int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
- int (*cb)(struct hostapd_iface *iface,
- void *ctx), void *ctx)
+static int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
+ int (*cb)(struct hostapd_iface *iface,
+ void *ctx), void *ctx)
{
size_t i;
int ret;
goto fail;
hapd_iface->ctrl_iface_init = hostapd_ctrl_iface_init;
hapd_iface->ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
+ hapd_iface->for_each_interface = hostapd_for_each_interface;
conf = hostapd_config_read(hapd_iface->config_fname);
if (conf == NULL)
int (*ctrl_iface_init)(struct hostapd_data *hapd);
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
+
+ int (*for_each_interface)(struct hapd_interfaces *interfaces,
+ int (*cb)(struct hostapd_iface *iface,
+ void *ctx), void *ctx);
};
/* hostapd.c */
void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
int reassoc);
-/* main.c */
-int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
- int (*cb)(struct hostapd_iface *iface,
- void *ctx), void *ctx);
-
/* utils.c */
int hostapd_register_probereq_cb(struct hostapd_data *hapd,
void (*cb)(void *ctx, const u8 *sa,
struct prune_data data;
data.hapd = hapd;
data.addr = addr;
- hostapd_for_each_interface(hapd->iface->interfaces,
- prune_associations, &data);
+ if (hapd->iface->for_each_interface)
+ hapd->iface->for_each_interface(hapd->iface->interfaces,
+ prune_associations, &data);
}
{
struct hostapd_data *hapd = ctx;
struct wpa_auth_iface_iter_data data;
+ if (hapd->iface->for_each_interface == NULL)
+ return -1;
data.cb = cb;
data.cb_ctx = cb_ctx;
- return hostapd_for_each_interface(hapd->iface->interfaces,
- wpa_auth_iface_iter, &data);
+ return hapd->iface->for_each_interface(hapd->iface->interfaces,
+ wpa_auth_iface_iter, &data);
}
#include "ap.h"
-struct hapd_interfaces {
- size_t count;
- struct hostapd_iface **iface;
-};
-
-
-int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
- int (*cb)(struct hostapd_iface *iface,
- void *ctx), void *ctx)
-{
- /* TODO */
- return 0;
-}
-
-
static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid,
struct hostapd_config *conf)