2008-10-01 07:07:55 -04:00
|
|
|
/*
|
2009-11-20 14:12:49 -05:00
|
|
|
* Driver interface for RADIUS server or WPS ER only (no driver)
|
2008-10-01 07:07:55 -04:00
|
|
|
* Copyright (c) 2008, Atheros Communications
|
|
|
|
*
|
2012-02-11 09:31:36 -05:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-10-01 07:07:55 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
|
2009-11-29 10:51:55 -05:00
|
|
|
#include "common.h"
|
2008-10-01 07:07:55 -04:00
|
|
|
#include "driver.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct none_driver_data {
|
|
|
|
struct hostapd_data *hapd;
|
2009-11-20 14:12:49 -05:00
|
|
|
void *ctx;
|
2008-10-01 07:07:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-11-20 14:12:49 -05:00
|
|
|
static void * none_driver_hapd_init(struct hostapd_data *hapd,
|
|
|
|
struct wpa_init_params *params)
|
2008-10-01 07:07:55 -04:00
|
|
|
{
|
|
|
|
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->hapd = hapd;
|
|
|
|
|
|
|
|
return drv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-20 14:12:49 -05:00
|
|
|
static void none_driver_hapd_deinit(void *priv)
|
2008-10-01 07:07:55 -04:00
|
|
|
{
|
|
|
|
struct none_driver_data *drv = priv;
|
|
|
|
|
|
|
|
os_free(drv);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
|
|
|
|
u16 proto, const u8 *data, size_t data_len)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-20 14:12:49 -05:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-04-09 06:40:12 -04:00
|
|
|
const struct wpa_driver_ops wpa_driver_none_ops = {
|
2008-10-01 07:07:55 -04:00
|
|
|
.name = "none",
|
2009-11-20 14:12:49 -05:00
|
|
|
.desc = "no driver (RADIUS server/WPS ER)",
|
|
|
|
.hapd_init = none_driver_hapd_init,
|
|
|
|
.hapd_deinit = none_driver_hapd_deinit,
|
2008-10-01 07:07:55 -04:00
|
|
|
.send_ether = none_driver_send_ether,
|
2009-11-20 14:12:49 -05:00
|
|
|
.init = none_driver_init,
|
|
|
|
.deinit = none_driver_deinit,
|
|
|
|
.send_eapol = none_driver_send_eapol,
|
2008-10-01 07:07:55 -04:00
|
|
|
};
|