freewtp/src/wtp/wtp_radio.h

92 lines
2.6 KiB
C
Raw Normal View History

#ifndef __WTP_RADIO_HEADER__
#define __WTP_RADIO_HEADER__
#include "ieee80211.h"
2013-12-20 23:14:34 +01:00
/* */
#define WTP_RADIO_ENABLED 0
#define WTP_RADIO_DISABLED 1
#define WTP_RADIO_HWFAILURE 2
#define WTP_RADIO_SWFAILURE 3
2014-01-18 19:13:10 +01:00
/* */
#define WTP_RADIO_ACL_HASH_SIZE 64
#define WTP_RADIO_ACL_KEY_SIZE ETH_ALEN
#define WTP_RADIO_ACL_STATION_ALLOW 0
#define WTP_RADIO_ACL_STATION_DENY 1
2013-12-20 23:14:34 +01:00
/* */
#define WTP_PREFIX_NAME_MAX_LENGTH (IFNAMSIZ - 6)
#define WTP_PREFIX_DEFAULT_NAME "ap"
#define WTP_RADIO_WLAN_STATE_IDLE 0
#define WTP_RADIO_WLAN_STATE_CREATED 1
#define WTP_RADIO_WLAN_STATE_READY 2
#define WTP_RADIO_WLAN_STATE_AP 3
struct wtp_radio_wlan {
struct wtp_radio* radio;
int state;
2013-12-20 23:14:34 +01:00
uint8_t wlanid;
char wlanname[IFNAMSIZ];
uint8_t bssid[ETH_ALEN];
/* */
uint16_t capability;
uint8_t qos;
uint8_t authmode;
uint8_t macmode;
uint8_t tunnelmode;
uint8_t ssid_hidden;
char ssid[IEEE80211_IE_SSID_MAX_LENGTH + 1];
2013-12-20 23:14:34 +01:00
};
/* */
struct wtp_radio {
2013-12-20 23:14:34 +01:00
uint8_t radioid;
char device[IFNAMSIZ];
2013-12-20 23:14:34 +01:00
struct capwap_array* wlan;
int status;
struct capwap_80211_antenna_element antenna;
struct capwap_80211_directsequencecontrol_element directsequencecontrol;
struct capwap_80211_macoperation_element macoperation;
struct capwap_80211_multidomaincapability_element multidomaincapability;
struct capwap_80211_ofdmcontrol_element ofdmcontrol;
2013-12-20 23:14:34 +01:00
struct capwap_80211_rateset_element rateset;
struct capwap_80211_supportedrates_element supportedrates;
struct capwap_80211_txpower_element txpower;
struct capwap_80211_txpowerlevel_element txpowerlevel;
struct capwap_80211_wtpradioconf_element radioconfig;
struct capwap_80211_wtpradioinformation_element radioinformation;
2013-12-20 23:14:34 +01:00
struct capwap_80211_wtpqos_element qos;
};
2013-12-20 23:14:34 +01:00
/* */
void wtp_radio_init(void);
void wtp_radio_close(void);
void wtp_radio_free(void);
/* */
struct wtp_radio* wtp_radio_create_phy(void);
struct wtp_radio* wtp_radio_get_phy(uint8_t radioid);
struct wtp_radio_wlan* wtp_radio_get_wlan(struct wtp_radio* radio, uint8_t wlanid);
/* */
int wtp_radio_setconfiguration(struct capwap_parsed_packet* packet);
/* */
uint32_t wtp_radio_create_wlan(struct capwap_parsed_packet* packet, struct capwap_80211_assignbssid_element* bssid);
uint32_t wtp_radio_update_wlan(struct capwap_parsed_packet* packet);
uint32_t wtp_radio_delete_wlan(struct capwap_parsed_packet* packet);
2014-01-18 19:13:10 +01:00
/* Station ACL */
int wtp_radio_acl_station(const uint8_t* macaddress);
void wtp_radio_acl_addstation(const uint8_t* macaddress);
void wtp_radio_acl_deletestation(const uint8_t* macaddress);
#endif /* __WTP_RADIO_HEADER__ */