#ifdef HOSTAPD
#include "../../hostapd/hostapd.h"
-#include "../../hostapd/config.h"
#include "../../hostapd/wpa.h"
#include "../../hostapd/hw_features.h"
#include "../../hostapd/wps_hostapd.h"
}
-static int test_driver_send_mgmt_frame(void *priv, const void *buf,
- size_t len, int flags)
+static int wpa_driver_test_send_mlme(void *priv, const u8 *buf, size_t len)
{
struct test_driver_data *drv = priv;
struct msghdr msg;
}
-static int test_driver_sta_deauth(void *priv, const u8 *addr, int reason)
+static int test_driver_sta_deauth(void *priv, const u8 *own_addr,
+ const u8 *addr, int reason)
{
struct test_driver_data *drv = priv;
struct test_client_socket *cli;
}
-static int test_driver_sta_disassoc(void *priv, const u8 *addr, int reason)
+static int test_driver_sta_disassoc(void *priv, const u8 *own_addr,
+ const u8 *addr, int reason)
{
struct test_driver_data *drv = priv;
struct test_client_socket *cli;
}
-static void * test_driver_init(struct hostapd_data *hapd)
+static void * test_driver_init(struct hostapd_data *hapd,
+ struct wpa_init_params *params)
{
struct test_driver_data *drv;
struct sockaddr_un addr_un;
/* Generate a MAC address to help testing with multiple APs */
hapd->own_addr[0] = 0x02; /* locally administered */
- sha1_prf((const u8 *) hapd->conf->iface, strlen(hapd->conf->iface),
+ sha1_prf((const u8 *) params->ifname, strlen(params->ifname),
"hostapd test bssid generation",
- (const u8 *) hapd->conf->ssid.ssid, hapd->conf->ssid.ssid_len,
+ params->ssid, params->ssid_len,
hapd->own_addr + 1, ETH_ALEN - 1);
- os_strlcpy(drv->bss->ifname, hapd->conf->iface, IFNAMSIZ);
+ os_strlcpy(drv->bss->ifname, params->ifname, IFNAMSIZ);
memcpy(drv->bss->bssid, hapd->own_addr, ETH_ALEN);
- if (hapd->conf->test_socket) {
- if (strlen(hapd->conf->test_socket) >=
+ if (params->test_socket) {
+ if (os_strlen(params->test_socket) >=
sizeof(addr_un.sun_path)) {
printf("Too long test_socket path\n");
test_driver_free_priv(drv);
return NULL;
}
- if (strncmp(hapd->conf->test_socket, "DIR:", 4) == 0) {
- size_t len = strlen(hapd->conf->test_socket) + 30;
- drv->socket_dir = strdup(hapd->conf->test_socket + 4);
+ if (strncmp(params->test_socket, "DIR:", 4) == 0) {
+ size_t len = strlen(params->test_socket) + 30;
+ drv->socket_dir = strdup(params->test_socket + 4);
drv->own_socket_path = malloc(len);
if (drv->own_socket_path) {
snprintf(drv->own_socket_path, len,
"%s/AP-" MACSTR,
- hapd->conf->test_socket + 4,
+ params->test_socket + 4,
MAC2STR(hapd->own_addr));
}
- } else if (strncmp(hapd->conf->test_socket, "UDP:", 4) == 0) {
- drv->udp_port = atoi(hapd->conf->test_socket + 4);
+ } else if (strncmp(params->test_socket, "UDP:", 4) == 0) {
+ drv->udp_port = atoi(params->test_socket + 4);
} else {
- drv->own_socket_path = strdup(hapd->conf->test_socket);
+ drv->own_socket_path = strdup(params->test_socket);
}
if (drv->own_socket_path == NULL && drv->udp_port == 0) {
test_driver_free_priv(drv);
.hapd_init = test_driver_init,
.hapd_deinit = test_driver_deinit,
.hapd_send_eapol = test_driver_send_eapol,
- .send_mgmt_frame = test_driver_send_mgmt_frame,
+ .send_mlme = wpa_driver_test_send_mlme,
.set_generic_elem = test_driver_set_generic_elem,
.sta_deauth = test_driver_sta_deauth,
.sta_disassoc = test_driver_sta_disassoc,
NULL /* set_beacon */,
NULL /* set_beacon_int */,
NULL /* hapd_init */,
- NULL /* init_bssid */,
NULL /* hapd_deinit */,
NULL /* set_ieee8021x */,
NULL /* set_privacy */,
NULL /* hapd_get_ssid */,
NULL /* hapd_set_ssid */,
NULL /* hapd_set_countermeasures */,
- NULL /* send_mgmt_frame */,
NULL /* sta_add */,
NULL /* get_inact_sec */,
NULL /* sta_clear_stats */,
NULL /* set_retry */,
NULL /* sta_set_flags */,
NULL /* set_rate_sets */,
- NULL /* hapd_set_country */,
NULL /* set_ieee80211d */,
NULL /* hapd_set_beacon */,
NULL /* set_internal_bridge */,
- NULL /* hapd_set_beacon_int */,
NULL /* set_broadcast_ssid */,
NULL /* set_cts_protect */,
NULL /* set_preamble */,
NULL /* set_radius_acl_expire */,
NULL /* set_ht_params */,
NULL /* set_wps_beacon_ie */,
- NULL /* set_wps_probe_resp_ie */,
- NULL /* get_neighbor_bss */
+ NULL /* set_wps_probe_resp_ie */
#endif /* HOSTAPD */
};