From 32da61d9c9594a35db46dacd8ca3e0ae7167bac2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 25 Dec 2009 01:26:37 +0200 Subject: [PATCH] Move wps_hostapd.c into src/ap --- hostapd/Makefile | 3 ++- hostapd/ctrl_iface.c | 2 +- hostapd/ctrl_iface_ap.c | 2 +- hostapd/drv_callbacks.c | 2 +- hostapd/hostapd.c | 25 +------------------------ hostapd/main.c | 1 + src/ap/hostapd.h | 1 + {hostapd => src/ap}/wps_hostapd.c | 2 +- {hostapd => src/ap}/wps_hostapd.h | 0 wpa_supplicant/Makefile | 3 ++- 10 files changed, 11 insertions(+), 30 deletions(-) rename {hostapd => src/ap}/wps_hostapd.c (99%) rename {hostapd => src/ap}/wps_hostapd.h (100%) diff --git a/hostapd/Makefile b/hostapd/Makefile index b50a230b1..900bd26f6 100644 --- a/hostapd/Makefile +++ b/hostapd/Makefile @@ -38,6 +38,7 @@ OBJS += config_file.o OBJS += drv_callbacks.o OBJS += ap_drv_ops.o +OBJS += ../src/ap/utils.o OBJS += ../src/ap/ieee802_1x.o OBJS += ../src/ap/config.o OBJS += ../src/ap/ieee802_11_auth.o @@ -289,7 +290,7 @@ endif ifdef CONFIG_WPS CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC OBJS += ../src/utils/uuid.o -OBJS += wps_hostapd.o +OBJS += ../src/ap/wps_hostapd.o OBJS += ../src/eap_server/eap_wsc.o ../src/eap_common/eap_wsc_common.o OBJS += ../src/wps/wps.o OBJS += ../src/wps/wps_common.o diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index d0aac0ecc..479724c21 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -31,8 +31,8 @@ #include "ap/ieee802_11.h" #include "ap/sta_info.h" #include "ap/accounting.h" +#include "ap/wps_hostapd.h" #include "ctrl_iface.h" -#include "wps_hostapd.h" #include "ctrl_iface_ap.h" diff --git a/hostapd/ctrl_iface_ap.c b/hostapd/ctrl_iface_ap.c index 3c1f8aa2f..7940f801c 100644 --- a/hostapd/ctrl_iface_ap.c +++ b/hostapd/ctrl_iface_ap.c @@ -20,7 +20,7 @@ #include "ap/wpa.h" #include "ap/ieee802_11.h" #include "ap/sta_info.h" -#include "wps_hostapd.h" +#include "ap/wps_hostapd.h" #include "ctrl_iface_ap.h" diff --git a/hostapd/drv_callbacks.c b/hostapd/drv_callbacks.c index 9b652b31d..81c1b82df 100644 --- a/hostapd/drv_callbacks.c +++ b/hostapd/drv_callbacks.c @@ -24,9 +24,9 @@ #include "ap/ieee802_1x.h" #include "ap/wpa.h" #include "ap/wmm.h" +#include "ap/wps_hostapd.h" #include "driver_i.h" #include "iapp.h" -#include "wps_hostapd.h" int hostapd_notif_new_sta(struct hostapd_data *hapd, const u8 *addr) diff --git a/hostapd/hostapd.c b/hostapd/hostapd.c index f480291af..15efd50c9 100644 --- a/hostapd/hostapd.c +++ b/hostapd/hostapd.c @@ -37,11 +37,11 @@ #include "ap/tkip_countermeasures.h" #include "ap/vlan_init.h" #include "ap/wpa.h" +#include "ap/wps_hostapd.h" #include "hw_features.h" #include "iapp.h" #include "driver_i.h" #include "ctrl_iface.h" -#include "wps_hostapd.h" static int hostapd_flush_old_stations(struct hostapd_data *hapd); @@ -1466,29 +1466,6 @@ void hostapd_interface_deinit(struct hostapd_iface *iface) } -int hostapd_register_probereq_cb(struct hostapd_data *hapd, - void (*cb)(void *ctx, const u8 *sa, - const u8 *ie, size_t ie_len), - void *ctx) -{ - struct hostapd_probereq_cb *n; - - n = os_realloc(hapd->probereq_cb, (hapd->num_probereq_cb + 1) * - sizeof(struct hostapd_probereq_cb)); - if (n == NULL) - return -1; - - hapd->probereq_cb = n; - n = &hapd->probereq_cb[hapd->num_probereq_cb]; - hapd->num_probereq_cb++; - - n->cb = cb; - n->ctx = ctx; - - return 0; -} - - struct prune_data { struct hostapd_data *hapd; const u8 *addr; diff --git a/hostapd/main.c b/hostapd/main.c index abbab1882..a08da3a8b 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -179,6 +179,7 @@ static struct hostapd_iface * hostapd_init(const char *config_file) if (hapd_iface == NULL) goto fail; + hapd_iface->reload_config = hostapd_reload_config; hapd_iface->config_read_cb = hostapd_config_read; hapd_iface->config_fname = os_strdup(config_file); if (hapd_iface->config_fname == NULL) diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 39dc64033..b3c526682 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -176,6 +176,7 @@ struct hostapd_data { struct hostapd_iface { struct hapd_interfaces *interfaces; void *owner; + int (*reload_config)(struct hostapd_iface *iface); struct hostapd_config * (*config_read_cb)(const char *config_fname); char *config_fname; struct hostapd_config *conf; diff --git a/hostapd/wps_hostapd.c b/src/ap/wps_hostapd.c similarity index 99% rename from hostapd/wps_hostapd.c rename to src/ap/wps_hostapd.c index f4a39098c..965db26ca 100644 --- a/hostapd/wps_hostapd.c +++ b/src/ap/wps_hostapd.c @@ -165,7 +165,7 @@ static void wps_reload_config(void *eloop_data, void *user_ctx) struct hostapd_iface *iface = eloop_data; wpa_printf(MSG_DEBUG, "WPS: Reload configuration data"); - if (hostapd_reload_config(iface) < 0) { + if (iface->reload_config(iface) < 0) { wpa_printf(MSG_WARNING, "WPS: Failed to reload the updated " "configuration"); } diff --git a/hostapd/wps_hostapd.h b/src/ap/wps_hostapd.h similarity index 100% rename from hostapd/wps_hostapd.h rename to src/ap/wps_hostapd.h diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile index adbae08fb..3616b148d 100644 --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile @@ -588,6 +588,7 @@ CFLAGS += -DCONFIG_NO_RADIUS CFLAGS += -DCONFIG_NO_ACCOUNTING CFLAGS += -DCONFIG_NO_VLAN OBJS += ../hostapd/hostapd.o +OBJS += ../src/ap/utils.o OBJS += ../src/ap/config.o OBJS += ../src/utils/ip_addr.o OBJS += ../src/ap/sta_info.o @@ -624,7 +625,7 @@ CFLAGS += -DNEED_AP_MLME endif ifdef CONFIG_WPS CFLAGS += -DEAP_SERVER_WSC -OBJS += ../hostapd/wps_hostapd.o +OBJS += ../src/ap/wps_hostapd.o OBJS += ../src/eap_server/eap_wsc.o endif endif