Fix couple of forgotten wpa_hw_modes -> hostapd_hw_modes
[wpasupplicant] / hostapd / driver_test.c
index 0a87395..94da5d0 100644 (file)
@@ -17,6 +17,7 @@
 #include <dirent.h>
 
 #include "hostapd.h"
+#include "config.h"
 #include "driver.h"
 #include "sha1.h"
 #include "eloop.h"
@@ -24,6 +25,7 @@
 #include "l2_packet/l2_packet.h"
 #include "hw_features.h"
 #include "wps_hostapd.h"
+#include "ieee802_11_defs.h"
 
 
 struct test_client_socket {
@@ -1004,12 +1006,13 @@ static int test_driver_set_privacy(const char *ifname, void *priv, int enabled)
 }
 
 
-static int test_driver_set_encryption(const char *iface, void *priv,
-                                     const char *alg, const u8 *addr, int idx,
-                                     const u8 *key, size_t key_len, int txkey)
+static int test_driver_set_key(const char *iface, void *priv, wpa_alg alg,
+                              const u8 *addr, int key_idx, int set_tx,
+                              const u8 *seq, size_t seq_len,
+                              const u8 *key, size_t key_len)
 {
-       wpa_printf(MSG_DEBUG, "%s(iface=%s alg=%s idx=%d txkey=%d)",
-                  __func__, iface, alg, idx, txkey);
+       wpa_printf(MSG_DEBUG, "%s(iface=%s alg=%d idx=%d set_tx=%d)",
+                  __func__, iface, alg, key_idx, set_tx);
        if (addr)
                wpa_printf(MSG_DEBUG, "   addr=" MACSTR, MAC2STR(addr));
        if (key)
@@ -1027,10 +1030,8 @@ static int test_driver_set_sta_vlan(void *priv, const u8 *addr,
 }
 
 
-static int test_driver_sta_add(const char *ifname, void *priv, const u8 *addr,
-                              u16 aid, u16 capability, u8 *supp_rates,
-                              size_t supp_rates_len, int flags,
-                              u16 listen_interval)
+static int test_driver_sta_add(const char *ifname, void *priv,
+                              struct hostapd_sta_add_params *params)
 {
        struct test_driver_data *drv = priv;
        struct test_client_socket *cli;
@@ -1038,14 +1039,15 @@ static int test_driver_sta_add(const char *ifname, void *priv, const u8 *addr,
 
        wpa_printf(MSG_DEBUG, "%s(ifname=%s addr=" MACSTR " aid=%d "
                   "capability=0x%x flags=0x%x listen_interval=%d)",
-                  __func__, ifname, MAC2STR(addr), aid, capability, flags,
-                  listen_interval);
+                  __func__, ifname, MAC2STR(params->addr), params->aid,
+                  params->capability, params->flags,
+                  params->listen_interval);
        wpa_hexdump(MSG_DEBUG, "test_driver_sta_add - supp_rates",
-                   supp_rates, supp_rates_len);
+                   params->supp_rates, params->supp_rates_len);
 
        cli = drv->cli;
        while (cli) {
-               if (memcmp(cli->addr, addr, ETH_ALEN) == 0)
+               if (os_memcmp(cli->addr, params->addr, ETH_ALEN) == 0)
                        break;
                cli = cli->next;
        }
@@ -1198,7 +1200,7 @@ static void test_driver_deinit(void *priv)
 }
 
 
-const struct wpa_driver_ops wpa_driver_test_ops = {
+const struct hapd_driver_ops wpa_driver_test_ops = {
        .name = "test",
        .init = test_driver_init,
        .deinit = test_driver_deinit,
@@ -1216,7 +1218,7 @@ const struct wpa_driver_ops wpa_driver_test_ops = {
        .valid_bss_mask = test_driver_valid_bss_mask,
        .set_ssid = test_driver_set_ssid,
        .set_privacy = test_driver_set_privacy,
-       .set_encryption = test_driver_set_encryption,
+       .set_key = test_driver_set_key,
        .set_sta_vlan = test_driver_set_sta_vlan,
        .sta_add = test_driver_sta_add,
        .send_ether = test_driver_send_ether,