aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_none.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-11-20 19:12:49 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-20 19:12:49 (GMT)
commita3c6598fcd896420997f38d973dc79b8ef200df5 (patch)
tree10da823835d0aaafaf93dfac6eb0800819c57536 /src/drivers/driver_none.c
parentda87d6f8b560b3fcf75c622a84bafb60daa1e90c (diff)
downloadhostap-a3c6598fcd896420997f38d973dc79b8ef200df5.zip
hostap-a3c6598fcd896420997f38d973dc79b8ef200df5.tar.gz
hostap-a3c6598fcd896420997f38d973dc79b8ef200df5.tar.bz2
Add 'none' driver as an option for wpa_supplicant
This can be used, e.g., with WPS ER when no network interface is actually used for IEEE 802.1X or wireless operations.
Diffstat (limited to 'src/drivers/driver_none.c')
-rw-r--r--src/drivers/driver_none.c48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/drivers/driver_none.c b/src/drivers/driver_none.c
index 31b1076..a5d66c4 100644
--- a/src/drivers/driver_none.c
+++ b/src/drivers/driver_none.c
@@ -1,5 +1,5 @@
/*
- * hostapd / Driver interface for RADIUS server only (no driver)
+ * Driver interface for RADIUS server or WPS ER only (no driver)
* Copyright (c) 2008, Atheros Communications
*
* This program is free software; you can redistribute it and/or modify
@@ -20,11 +20,12 @@
struct none_driver_data {
struct hostapd_data *hapd;
+ void *ctx;
};
-static void * none_driver_init(struct hostapd_data *hapd,
- struct wpa_init_params *params)
+static void * none_driver_hapd_init(struct hostapd_data *hapd,
+ struct wpa_init_params *params)
{
struct none_driver_data *drv;
@@ -40,7 +41,7 @@ static void * none_driver_init(struct hostapd_data *hapd,
}
-static void none_driver_deinit(void *priv)
+static void none_driver_hapd_deinit(void *priv)
{
struct none_driver_data *drv = priv;
@@ -55,9 +56,44 @@ static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
}
+static void * none_driver_init(void *ctx, const char *ifname)
+{
+ struct none_driver_data *drv;
+
+ drv = os_zalloc(sizeof(struct none_driver_data));
+ if (drv == NULL) {
+ wpa_printf(MSG_ERROR, "Could not allocate memory for none "
+ "driver data");
+ return NULL;
+ }
+ drv->ctx = ctx;
+
+ return drv;
+}
+
+
+static void none_driver_deinit(void *priv)
+{
+ struct none_driver_data *drv = priv;
+
+ os_free(drv);
+}
+
+
+static int none_driver_send_eapol(void *priv, const u8 *dest, u16 proto,
+ const u8 *data, size_t data_len)
+{
+ return -1;
+}
+
+
const struct wpa_driver_ops wpa_driver_none_ops = {
.name = "none",
- .hapd_init = none_driver_init,
- .hapd_deinit = none_driver_deinit,
+ .desc = "no driver (RADIUS server/WPS ER)",
+ .hapd_init = none_driver_hapd_init,
+ .hapd_deinit = none_driver_hapd_deinit,
.send_ether = none_driver_send_ether,
+ .init = none_driver_init,
+ .deinit = none_driver_deinit,
+ .send_eapol = none_driver_send_eapol,
};