From 02095ef5a344810d45ccc72ec753b5dedd5ff492 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Tue, 8 Mar 2016 18:57:19 +0000 Subject: [PATCH] Initial commit FossilOrigin-Name: 38104cd3acecc11898ae7d17fe1b730770120df8a04c4e6191460ba380564a6a --- src/cw/capwap_80211.h | 102 ------------------- src/mod/capwap80211/capwap80211_actions_ac.c | 80 +++++++++++++++ src/mod/capwap80211/mod_capwap80211_ac.c | 3 +- 3 files changed, 81 insertions(+), 104 deletions(-) delete mode 100644 src/cw/capwap_80211.h create mode 100644 src/mod/capwap80211/capwap80211_actions_ac.c diff --git a/src/cw/capwap_80211.h b/src/cw/capwap_80211.h deleted file mode 100644 index 737b5864..00000000 --- a/src/cw/capwap_80211.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef __CAPWAP_80211 -#define __CAPWAP_80211 - -#include "capwap.h" -#include - -#include "bstr.h" -#include "action.h" - - -#define CW80211IANA_ENTERPRISE_NUMBER 13277 - -#define CWMSG_80211_WLAN_CONFIGURATION_REQUEST 3398913 -#define CWMSG_80211_WLAN_CONFIGURATION_REPONSE 3398914 - -/** 802.11 Message Elements */ -enum radioelems { - /** Add WLAN Message element */ - CW_ELEM80211_ADD_WLAN =1024, - /** Antenna Message element */ - CW_ELEM80211_ANTENNA =1025, -/* - IEEE 802.11 Assigned WTP BSSID 1026 - IEEE 802.11 Delete WLAN 1027 - IEEE 802.11 Direct Sequence Control 1028 - IEEE 802.11 Information Element 1029 - IEEE 802.11 MAC Operation 1030 - IEEE 802.11 MIC Countermeasures 1031 - IEEE 802.11 Multi-Domain Capability 1032 - IEEE 802.11 OFDM Control 1033 -*/ - /** Supported WLAN Rates */ - CW_ELEM80211_RATE_SET=1034, -/* IEEE 802.11 RSNA Error Report From Station 1035 - IEEE 802.11 Station 1036 - IEEE 802.11 Station QoS Profile 1037 - IEEE 802.11 Station Session Key 1038 - IEEE 802.11 Statistics 1039 - IEEE 802.11 Supported Rates 1040 - IEEE 802.11 Tx Power 1041 - IEEE 802.11 Tx Power Level 1042 - IEEE 802.11 Update Station QoS 1043 - IEEE 802.11 Update WLAN 1044 - IEEE 802.11 WTP Quality of Service 1045 - IEEE 802.11 WTP Radio Configuration 1046 - IEEE 802.11 WTP Radio Fail Alarm Indication 1047 -*/ - - /** Radio Information Message Element */ - CW_ELEM80211_WTP_RADIO_INFORMATION=1048 -}; - - - -/* - * Messages - */ - - - -#define CW_80211_RADIO_TYPE_B (1) -#define CW_80211_RADIO_TYPE_A (2) -#define CW_80211_RADIO_TYPE_G (4) -#define CW_80211_RADIO_TYPE_N (8) - - - - - -struct cw_wlan { - uint8_t rid; /* Radio ID */ - uint8_t wid; /* WLAN ID */ - uint16_t capab; - uint8_t key_index; - uint8_t key_status; - uint16_t key_length; - uint8_t * key; - uint8_t group_tsc[6]; - uint8_t qos; - uint8_t auth_type; - uint8_t mac_mode; - uint8_t tunnel_mode; - uint8_t suppress_ssid; - bstr_t ssid; -}; - - - -int cw_out_radio_infos(struct conn *conn, struct cw_action_out *a, uint8_t * dst); - - -extern int cw_register_actions_capwap_80211_wtp(struct cw_actiondef *def); -extern struct cw_strlist_elem capwap_strings_elem80211[]; -extern int cw_register_actions_capwap_80211_ac(struct cw_actiondef *def); - - - - - -#endif - - diff --git a/src/mod/capwap80211/capwap80211_actions_ac.c b/src/mod/capwap80211/capwap80211_actions_ac.c new file mode 100644 index 00000000..27ae455f --- /dev/null +++ b/src/mod/capwap80211/capwap80211_actions_ac.c @@ -0,0 +1,80 @@ + + +#include "cw/action.h" +#include "cw/cw.h" +#include "cw/capwap.h" +#include "cw/capwap80211.h" + +//#include "capwap_80211_actions.h" +//#include "capwap_80211.h" +//#include "capwap.h" + + + + + + +static cw_action_in_t actions_ac_in[] = { + + /* -------------------------------------------------------- + * Discovery Resquest + */ + + /* Element Discovery Type */ + { + .capwap_state = CW_STATE_DISCOVERY, + .msg_id = CW_MSG_DISCOVERY_REQUEST, + .elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION, + .item_id = "radio_information", + .start = cw_in_radio_generic, + .mand = 1, + .min_len = 5, + .max_len = 5 + } + , + + + +// {0, 0, CW_STATE_DISCOVERY, CW_MSG_DISCOVERY_REQUEST, +// CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1} + /* -------------------------------------------------------- + * Discovery Resquest + */ + +// {0, 0, CW_STATE_JOIN, CW_MSG_JOIN_REQUEST, +// CW_ACTION_IN_80211_WTP_RADIO_INFORMATION, 1} + + + + {0, 0, 0} +}; + + +cw_action_out_t capwap_80211_actions_ac_out[]={ + /* Radio Infos */ +// {CW_MSG_DISCOVERY_RESPONSE, NULL /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0, +// CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1} + + /* Radio Infos */ +// {CW_MSG_JOIN_RESPONSE, NULL /*CW_ELEM80211_WTP_RADIO_INFORMATION*/, 0, +// CW_ELEM80211_WTP_RADIO_INFORMATION, NULL,cw_out_radio_infos, NULL,1} + + {0,0,0} +}; + + +int capwap80211_register_actions_ac(struct cw_actiondef *def) +{ + + int rc; + rc=cw_actionlist_in_register_actions(def->in, actions_ac_in); +// rc+=cw_actionlist_out_register_actions(def->out, capwap_80211_actions_ac_out); + + rc+= cw_strheap_register_strings(def->strelem, capwap_strings_elem80211); + /*rc += cw_strheap_register_strings(def->strelem, capwap_strings_elem); +*/ + + + return rc; +} + diff --git a/src/mod/capwap80211/mod_capwap80211_ac.c b/src/mod/capwap80211/mod_capwap80211_ac.c index e2812e6b..ab20abd5 100644 --- a/src/mod/capwap80211/mod_capwap80211_ac.c +++ b/src/mod/capwap80211/mod_capwap80211_ac.c @@ -35,8 +35,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele static int register_actions(struct cw_actiondef *actions) { - - return 0; + return capwap80211_register_actions_ac(actions); } static struct mod_ac capwap80211_ac = {