Move rest of the generic AP mode functionality into src/ap

This commit is contained in:
Jouni Malinen 2009-12-25 20:06:07 +02:00
parent 481a11c94f
commit 70db2ab308
14 changed files with 20 additions and 24 deletions

View file

@ -32,13 +32,13 @@ CFLAGS += -DCONFIG_NATIVE_WINDOWS
LIBS += -lws2_32
endif
OBJS = hostapd.o
OBJS += wpa_auth_glue.o
OBJS += main.o
OBJS += config_file.o
OBJS += drv_callbacks.o
OBJS += ap_drv_ops.o
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/drv_callbacks.o
OBJS += ../src/ap/ap_drv_ops.o
OBJS += ../src/ap/utils.o
OBJS += ../src/ap/authsrv.o
OBJS += ../src/ap/ieee802_1x.o
@ -693,7 +693,7 @@ OBJS += ../src/ap/beacon.o
OBJS += ../src/ap/wmm.o
OBJS += ../src/ap/ap_list.o
OBJS += ../src/ap/ieee802_11.o
OBJS += hw_features.o
OBJS += ../src/ap/hw_features.o
ifdef CONFIG_IEEE80211N
OBJS += ../src/ap/ieee802_11_ht.o
endif

View file

@ -29,6 +29,7 @@
#include "config_file.h"
#include "eap_register.h"
#include "dump_state.h"
#include "ctrl_iface.h"
extern int wpa_debug_level;
@ -187,6 +188,8 @@ static struct hostapd_iface * hostapd_init(const char *config_file)
hapd_iface->config_fname = os_strdup(config_file);
if (hapd_iface->config_fname == NULL)
goto fail;
hapd_iface->ctrl_iface_init = hostapd_ctrl_iface_init;
hapd_iface->ctrl_iface_deinit = hostapd_ctrl_iface_deinit;
conf = hostapd_config_read(hapd_iface->config_fname);
if (conf == NULL)

View file

@ -32,7 +32,6 @@
#include "ap/wps_hostapd.h"
#include "hw_features.h"
#include "driver_i.h"
#include "ctrl_iface.h"
#include "wpa_auth_glue.h"
#include "ap_drv_ops.h"
@ -201,7 +200,8 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd)
*/
static void hostapd_cleanup(struct hostapd_data *hapd)
{
hostapd_ctrl_iface_deinit(hapd);
if (hapd->iface->ctrl_iface_deinit)
hapd->iface->ctrl_iface_deinit(hapd);
iapp_deinit(hapd->iapp);
hapd->iapp = NULL;
@ -583,7 +583,8 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first)
return -1;
}
if (hostapd_ctrl_iface_init(hapd)) {
if (hapd->iface->ctrl_iface_init &&
hapd->iface->ctrl_iface_init(hapd)) {
wpa_printf(MSG_ERROR, "Failed to setup control interface");
return -1;
}

View file

@ -225,6 +225,9 @@ struct hostapd_iface {
u16 ht_op_mode;
void (*scan_cb)(struct hostapd_iface *iface);
int (*ctrl_iface_init)(struct hostapd_data *hapd);
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
};
/* hostapd.c */

View file

@ -587,8 +587,8 @@ OBJS += ap.o
CFLAGS += -DCONFIG_NO_RADIUS
CFLAGS += -DCONFIG_NO_ACCOUNTING
CFLAGS += -DCONFIG_NO_VLAN
OBJS += ../hostapd/hostapd.o
OBJS += ../hostapd/wpa_auth_glue.o
OBJS += ../src/ap/hostapd.o
OBJS += ../src/ap/wpa_auth_glue.o
OBJS += ../src/ap/utils.o
OBJS += ../src/ap/authsrv.o
OBJS += ../src/ap/config.o
@ -599,8 +599,8 @@ OBJS += ../src/ap/mlme.o
OBJS += ../src/ap/ieee802_1x.o
OBJS += ../src/eapol_auth/eapol_auth_sm.o
OBJS += ../src/ap/ieee802_11_auth.o
OBJS += ../hostapd/drv_callbacks.o
OBJS += ../hostapd/ap_drv_ops.o
OBJS += ../src/ap/drv_callbacks.o
OBJS += ../src/ap/ap_drv_ops.o
ifdef CONFIG_CTRL_IFACE
OBJS += ../src/ap/ctrl_iface_ap.o
endif
@ -619,7 +619,7 @@ OBJS += ../src/ap/beacon.o
OBJS += ../src/ap/wmm.o
OBJS += ../src/ap/ap_list.o
OBJS += ../src/ap/ieee802_11.o
OBJS += ../hostapd/hw_features.o
OBJS += ../src/ap/hw_features.o
ifdef CONFIG_IEEE80211N
OBJS += ../src/ap/ieee802_11_ht.o
endif

View file

@ -49,17 +49,6 @@ int hostapd_for_each_interface(struct hapd_interfaces *interfaces,
}
int hostapd_ctrl_iface_init(struct hostapd_data *hapd)
{
return 0;
}
void hostapd_ctrl_iface_deinit(struct hostapd_data *hapd)
{
}
static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid,
struct hostapd_config *conf)