]> git.ipfire.org Git - thirdparty/hostap.git/blame - src/drivers/driver_none.c
Remove src/common from default header file path
[thirdparty/hostap.git] / src / drivers / driver_none.c
CommitLineData
d64dabee 1/*
a3c6598f 2 * Driver interface for RADIUS server or WPS ER only (no driver)
d64dabee
JM
3 * Copyright (c) 2008, Atheros Communications
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
11 *
12 * See README and COPYING for more details.
13 */
14
15#include "includes.h"
16
90973fb2 17#include "common.h"
d64dabee
JM
18#include "driver.h"
19
20
21struct none_driver_data {
22 struct hostapd_data *hapd;
a3c6598f 23 void *ctx;
d64dabee
JM
24};
25
26
a3c6598f
JM
27static void * none_driver_hapd_init(struct hostapd_data *hapd,
28 struct wpa_init_params *params)
d64dabee
JM
29{
30 struct none_driver_data *drv;
31
32 drv = os_zalloc(sizeof(struct none_driver_data));
33 if (drv == NULL) {
34 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
35 "driver data");
36 return NULL;
37 }
38 drv->hapd = hapd;
39
40 return drv;
41}
42
43
a3c6598f 44static void none_driver_hapd_deinit(void *priv)
d64dabee
JM
45{
46 struct none_driver_data *drv = priv;
47
48 os_free(drv);
49}
50
51
52static int none_driver_send_ether(void *priv, const u8 *dst, const u8 *src,
53 u16 proto, const u8 *data, size_t data_len)
54{
55 return 0;
56}
57
58
a3c6598f
JM
59static void * none_driver_init(void *ctx, const char *ifname)
60{
61 struct none_driver_data *drv;
62
63 drv = os_zalloc(sizeof(struct none_driver_data));
64 if (drv == NULL) {
65 wpa_printf(MSG_ERROR, "Could not allocate memory for none "
66 "driver data");
67 return NULL;
68 }
69 drv->ctx = ctx;
70
71 return drv;
72}
73
74
75static void none_driver_deinit(void *priv)
76{
77 struct none_driver_data *drv = priv;
78
79 os_free(drv);
80}
81
82
83static int none_driver_send_eapol(void *priv, const u8 *dest, u16 proto,
84 const u8 *data, size_t data_len)
85{
86 return -1;
87}
88
89
c5121837 90const struct wpa_driver_ops wpa_driver_none_ops = {
d64dabee 91 .name = "none",
a3c6598f
JM
92 .desc = "no driver (RADIUS server/WPS ER)",
93 .hapd_init = none_driver_hapd_init,
94 .hapd_deinit = none_driver_hapd_deinit,
d64dabee 95 .send_ether = none_driver_send_ether,
a3c6598f
JM
96 .init = none_driver_init,
97 .deinit = none_driver_deinit,
98 .send_eapol = none_driver_send_eapol,
d64dabee 99};