diff options
Diffstat (limited to 'package/network/services/hostapd/src/src/ap/ubus.h')
-rw-r--r-- | package/network/services/hostapd/src/src/ap/ubus.h | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h new file mode 100644 index 0000000000..479ddfca7a --- /dev/null +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -0,0 +1,78 @@ +/* + * hostapd / ubus support + * Copyright (c) 2013, Felix Fietkau <nbd@nbd.name> + * + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ +#ifndef __HOSTAPD_UBUS_H +#define __HOSTAPD_UBUS_H + +enum hostapd_ubus_event_type { + HOSTAPD_UBUS_PROBE_REQ, + HOSTAPD_UBUS_AUTH_REQ, + HOSTAPD_UBUS_ASSOC_REQ, + HOSTAPD_UBUS_TYPE_MAX +}; + +struct hostapd_ubus_request { + enum hostapd_ubus_event_type type; + const struct ieee80211_mgmt *mgmt_frame; + const struct hostapd_frame_info *frame_info; + const u8 *addr; +}; + +struct hostapd_iface; +struct hostapd_data; + +#ifdef UBUS_SUPPORT + +#include <libubox/avl.h> +#include <libubus.h> + +struct hostapd_ubus_iface { + struct ubus_object obj; +}; + +struct hostapd_ubus_bss { + struct ubus_object obj; + struct avl_tree banned; +}; + +void hostapd_ubus_add_iface(struct hostapd_iface *iface); +void hostapd_ubus_free_iface(struct hostapd_iface *iface); +void hostapd_ubus_add_bss(struct hostapd_data *hapd); +void hostapd_ubus_free_bss(struct hostapd_data *hapd); + +int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req); + +#else + +struct hostapd_ubus_iface {}; + +struct hostapd_ubus_bss {}; + +static inline void hostapd_ubus_add_iface(struct hostapd_iface *iface) +{ +} + +static inline void hostapd_ubus_free_iface(struct hostapd_iface *iface) +{ +} + +static inline void hostapd_ubus_add_bss(struct hostapd_data *hapd) +{ +} + +static inline void hostapd_ubus_free_bss(struct hostapd_data *hapd) +{ +} + +static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req) +{ + return 0; +} + +#endif + +#endif |