freewtp/src/wtp/wtp_kmod.h
Andreas Schultz f3119eec8d rework kernel socket handling to use udp tunnel infrastructure
Reimplmenting what is already there doesn't make sense. Switch
to the existing and UDP tunnel support code and handle the data
channel as a connected UDP socket
2016-02-22 16:54:54 +01:00

70 lines
1.5 KiB
C

#ifndef __WTP_KMOD_HEADER__
#define __WTP_KMOD_HEADER__
#include "wifi_drivers.h"
/* */
#ifdef HAVE_LIBNL_10
#define nl_sock nl_handle
#endif
/* */
#define WTP_KMOD_FLAGS_TUNNEL_NATIVE 0x00000000
#define WTP_KMOD_FLAGS_TUNNEL_8023 0x00000001
/* */
struct wtp_kmod_iface_handle {
uint32_t flags;
struct wifi_wlan* wlan;
};
/* */
struct wtp_kmod_handle {
struct nl_sock* nl;
int nl_fd;
struct nl_cb* nl_cb;
int nlsmartcapwap_id;
/* */
struct nl_sock* nlmsg;
struct nl_cb* nlmsg_cb;
/* */
struct capwap_list* interfaces;
};
/* */
#define WTP_KMOD_EVENT_MAX_ITEMS 2
struct wtp_kmod_event {
void (*event_handler)(int fd, void** params, int paramscount);
int paramscount;
void* params[WTP_KMOD_EVENT_MAX_ITEMS];
};
/* */
int wtp_kmod_init(void);
void wtp_kmod_free(void);
/* */
int wtp_kmod_isconnected(void);
int wtp_kmod_getfd(struct pollfd* fds, struct wtp_kmod_event* events, int count);
/* */
int wtp_kmod_create(uint16_t family, struct sockaddr_storage* peeraddr,
struct capwap_sessionid_element* sessionid, uint16_t mtu);
int wtp_kmod_resetsession(void);
/* */
int wtp_kmod_send_keepalive(void);
int wtp_kmod_send_data(uint8_t radioid, const uint8_t* frame, int length, uint8_t rssi, uint8_t snr, uint16_t rate);
/* */
int wtp_kmod_join_mac80211_device(struct wifi_wlan* wlan, uint32_t flags);
int wtp_kmod_leave_mac80211_device(struct wifi_wlan* wlan);
/* */
int wtp_kmod_add_station(uint8_t radioid, const uint8_t *mac, uint8_t wlanid);
int wtp_kmod_del_station(uint8_t radioid, const uint8_t *mac);
#endif /* __WTP_KMOD_HEADER__ */