drv_callbacks.o \
tkip_countermeasures.o \
mlme.o wpa_auth_ie.o
+OBJS += ap_drv_ops.o
NEED_RC4=y
NEED_AES=y
NEED_MD5=y
--- /dev/null
+/*
+ * hostapd - Driver operations
+ * Copyright (c) 2009, Jouni Malinen <j@w1.fi>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Alternatively, this software may be distributed under the terms of BSD
+ * license.
+ *
+ * See README and COPYING for more details.
+ */
+
+#include "includes.h"
+
+#include "common.h"
+#include "hostapd.h"
+#include "driver_i.h"
+
+
+static int hostapd_set_ap_wps_ie(struct hostapd_data *hapd,
+ const u8 *beacon_ie, size_t beacon_ie_len,
+ const u8 *probe_resp_ie,
+ size_t probe_resp_ie_len)
+{
+ if (hostapd_set_wps_beacon_ie(hapd, hapd->wps_beacon_ie,
+ hapd->wps_beacon_ie_len) < 0 ||
+ hostapd_set_wps_probe_resp_ie(hapd, hapd->wps_probe_resp_ie,
+ hapd->wps_probe_resp_ie_len) < 0)
+ return -1;
+ return 0;
+}
+
+
+void hostapd_set_driver_ops(struct hostapd_driver_ops *ops)
+{
+ ops->set_ap_wps_ie = hostapd_set_ap_wps_ie;
+}
if (hapd == NULL)
return NULL;
+ hostapd_set_driver_ops(&hapd->drv);
hapd->iconf = conf;
hapd->conf = bss;
hapd->iface = hapd_iface;
struct radius_server_data;
struct upnp_wps_device_sm;
struct hapd_interfaces;
+struct hostapd_data;
#ifdef CONFIG_FULL_DYNAMIC_VLAN
struct full_dynamic_vlan;
};
+struct hostapd_driver_ops {
+ int (*set_ap_wps_ie)(struct hostapd_data *hapd,
+ const u8 *beacon_ie, size_t beacon_ie_len,
+ const u8 *probe_resp_ie,
+ size_t probe_resp_ie_len);
+};
+
/**
* struct hostapd_data - hostapd per-BSS data structure
*/
const struct wpa_driver_ops *driver;
void *drv_priv;
+ struct hostapd_driver_ops drv;
void *msg_ctx; /* ctx for wpa_msg() calls */
int hostapd_sta_flags_to_drv(int flags);
int eap_server_register_methods(void);
+void hostapd_set_driver_ops(struct hostapd_driver_ops *ops);
#endif /* HOSTAPD_H */
#include "wps/wps_defs.h"
#include "wps/wps_dev_attr.h"
#include "hostapd.h"
-#include "driver_i.h"
+#include "config.h"
#include "sta_info.h"
#include "wps_hostapd.h"
os_memcpy(hapd->wps_beacon_ie, beacon_ie, beacon_ie_len);
hapd->wps_beacon_ie_len = beacon_ie_len;
}
- hostapd_set_wps_beacon_ie(hapd, hapd->wps_beacon_ie,
- hapd->wps_beacon_ie_len);
os_free(hapd->wps_probe_resp_ie);
if (probe_resp_ie_len == 0) {
probe_resp_ie_len);
hapd->wps_probe_resp_ie_len = probe_resp_ie_len;
}
- hostapd_set_wps_probe_resp_ie(hapd, hapd->wps_probe_resp_ie,
- hapd->wps_probe_resp_ie_len);
+ hapd->drv.set_ap_wps_ie(hapd, hapd->wps_beacon_ie,
+ hapd->wps_beacon_ie_len,
+ hapd->wps_probe_resp_ie,
+ hapd->wps_probe_resp_ie_len);
return 0;
}
os_free(hapd->wps_beacon_ie);
hapd->wps_beacon_ie = NULL;
hapd->wps_beacon_ie_len = 0;
- hostapd_set_wps_beacon_ie(hapd, NULL, 0);
os_free(hapd->wps_probe_resp_ie);
hapd->wps_probe_resp_ie = NULL;
hapd->wps_probe_resp_ie_len = 0;
- hostapd_set_wps_probe_resp_ie(hapd, NULL, 0);
+
+ hapd->drv.set_ap_wps_ie(hapd, NULL, 0, NULL, 0);
}
OBJS += ../src/eapol_auth/eapol_auth_sm.o
OBJS += ../hostapd/ieee802_11_auth.o
OBJS += ../hostapd/drv_callbacks.o
+OBJS += ../hostapd/ap_drv_ops.o
ifdef CONFIG_CTRL_IFACE
OBJS += ../hostapd/ctrl_iface_ap.o
endif