driver_none.c
Go to the documentation of this file.
00001 /*
00002  * Driver interface for RADIUS server or WPS ER only (no driver)
00003  * Copyright (c) 2008, Atheros Communications
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 2 as
00007  * published by the Free Software Foundation.
00008  *
00009  * Alternatively, this software may be distributed under the terms of BSD
00010  * license.
00011  *
00012  * See README and COPYING for more details.
00013  */
00014 
00015 #include "includes.h"
00016 
00017 #include "common.h"
00018 #include "driver.h"
00019 
00020 
00021 struct none_driver_data {
00022         struct hostapd_data *hapd;
00023         void *ctx;
00024 };
00025 
00026 
00027 static void * none_driver_hapd_init(struct hostapd_data *hapd,
00028                                     struct wpa_init_params *params)
00029 {
00030         struct none_driver_data *drv;
00031 
00032         drv = os_zalloc(sizeof(struct none_driver_data));
00033         if (drv == NULL) {
00034                 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
00035                            "driver data");
00036                 return NULL;
00037         }
00038         drv->hapd = hapd;
00039 
00040         return drv;
00041 }
00042 
00043 
00044 static void none_driver_hapd_deinit(void *priv)
00045 {
00046         struct none_driver_data *drv = priv;
00047 
00048         os_free(drv);
00049 }
00050 
00051 
00052 static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
00053                                   u16 proto, const u8 *data, size_t data_len)
00054 {
00055         return 0;
00056 }
00057 
00058 
00059 static void * none_driver_init(void *ctx, const char *ifname)
00060 {
00061         struct none_driver_data *drv;
00062 
00063         drv = os_zalloc(sizeof(struct none_driver_data));
00064         if (drv == NULL) {
00065                 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
00066                            "driver data");
00067                 return NULL;
00068         }
00069         drv->ctx = ctx;
00070 
00071         return drv;
00072 }
00073 
00074 
00075 static void none_driver_deinit(void *priv)
00076 {
00077         struct none_driver_data *drv = priv;
00078 
00079         os_free(drv);
00080 }
00081 
00082 
00083 static int none_driver_send_eapol(void *priv, const u8 *dest, u16 proto,
00084                                   const u8 *data, size_t data_len)
00085 {
00086         return -1;
00087 }
00088 
00089 
00090 const struct wpa_driver_ops wpa_driver_none_ops = {
00091         .name = "none",
00092         .desc = "no driver (RADIUS server/WPS ER)",
00093         .hapd_init = none_driver_hapd_init,
00094         .hapd_deinit = none_driver_hapd_deinit,
00095         .send_ether = none_driver_send_ether,
00096         .init = none_driver_init,
00097         .deinit = none_driver_deinit,
00098         .send_eapol = none_driver_send_eapol,
00099 };


wpa_supplicant
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Jan 2 2014 11:26:36