From 60dac37081cc54f115f94bc088689c03eabf02e4 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Thu, 19 Mar 2015 20:51:28 +0000 Subject: [PATCH] Changed defs/function names from ..IEEE80211.. to ...80211... Shorter names... FossilOrigin-Name: e494b45b4f03db8638cbcb2c437e2fe168dbdce0d11fd9f8a56db7767ac0aaf7 --- src/ac/ac_interface.c | 10 ++-- src/ac/conf.c | 5 ++ src/capwap/Makefile | 3 +- .../{capwap_ieee80211.h => capwap_80211.h} | 52 ++++++++++++++++--- src/capwap/cw_msgelemtostr.c | 4 +- ...o.c => cw_readelem_80211_wtp_radio_info.c} | 8 +-- src/capwap/cwmsg_addelem_80211_add_wlan.c | 40 ++++++++++++++ src/capwap/cwmsg_addelem_wtp_radio_infos.c | 4 +- src/capwap/cwread_discovery_request.c | 4 +- src/capwap/process_conf_status_request.c | 2 +- src/capwap/process_join_request.c | 2 +- src/capwap/wtpinfo_print.c | 10 ++-- src/capwap/wtpinfo_readelem_wtp_radio_info.c | 4 +- 13 files changed, 116 insertions(+), 32 deletions(-) rename src/capwap/{capwap_ieee80211.h => capwap_80211.h} (68%) rename src/capwap/{cw_readelem_ieee80211_wtp_radio_info.c => cw_readelem_80211_wtp_radio_info.c} (80%) create mode 100644 src/capwap/cwmsg_addelem_80211_add_wlan.c diff --git a/src/ac/ac_interface.c b/src/ac/ac_interface.c index c318769d..993d5988 100644 --- a/src/ac/ac_interface.c +++ b/src/ac/ac_interface.c @@ -11,7 +11,7 @@ #include "conf.h" #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" ACIPLIST * get_aciplist() { @@ -109,10 +109,10 @@ struct ac_info * get_acinfo() int i; for (i=1; i<=4; i++){ acinfo->radioinfos[i].type= - CW_IEEE80211_RADIO_TYPE_B | - CW_IEEE80211_RADIO_TYPE_A | - CW_IEEE80211_RADIO_TYPE_G | - CW_IEEE80211_RADIO_TYPE_N; + CW_80211_RADIO_TYPE_B | + CW_80211_RADIO_TYPE_A | + CW_80211_RADIO_TYPE_G | + CW_80211_RADIO_TYPE_N; // acinfo->radioinfos[i].type=0xffffffff; acinfo->radioinfos[i].rid=i; } diff --git a/src/ac/conf.c b/src/ac/conf.c index fb29f47c..ce05351a 100644 --- a/src/ac/conf.c +++ b/src/ac/conf.c @@ -590,6 +590,11 @@ int read_config(const char * filename){ CFG_SIMPLE_STR("ac_name",&conf_acname), CFG_SIMPLE_STR("hardware_version",&conf_hardware_version), CFG_SIMPLE_STR("software_version",&conf_software_version), + + CFG_SIMPLE_STR("cisco_hardware_version",&conf_cisco_hardware_version), + CFG_SIMPLE_STR("cisco_software_version",&conf_cisco_software_version), + + CFG_SIMPLE_STR("ssl_cert",&conf_sslcertfilename), CFG_SIMPLE_STR("ssl_key",&conf_sslkeyfilename), diff --git a/src/capwap/Makefile b/src/capwap/Makefile index 628d7ea2..197d8e90 100644 --- a/src/capwap/Makefile +++ b/src/capwap/Makefile @@ -102,7 +102,8 @@ CAPWAPOBJS= \ wtpinfo_readelem_wtp_board_data.o \ wtpinfo_readelem_wtp_mac_type.o \ wtpinfo_readelem_wtp_radio_info.o \ - cw_readelem_ieee80211_wtp_radio_info.o \ + cw_readelem_80211_wtp_radio_info.o \ + cwmsg_addelem_80211_add_wlan.o \ wtpinfo_readelem_wtp_descriptor.o \ wtpinfo_readelem_discovery_type.o \ wtpinfo_readelem_wtp_frame_tunnel_mode.o \ diff --git a/src/capwap/capwap_ieee80211.h b/src/capwap/capwap_80211.h similarity index 68% rename from src/capwap/capwap_ieee80211.h rename to src/capwap/capwap_80211.h index 9c882b71..8580f4a0 100644 --- a/src/capwap/capwap_ieee80211.h +++ b/src/capwap/capwap_80211.h @@ -1,6 +1,7 @@ -#define CWMSGELEM_IEEE80211_ADD_WLAN 1024 -/* IEEE 802.11 Antenna 1025 +#define CWMSGELEM_80211_ADD_WLAN 1024 +#define CWMSGELEM_80211_ANTENNA 1025 +/* IEEE 802.11 Assigned WTP BSSID 1026 IEEE 802.11 Delete WLAN 1027 IEEE 802.11 Direct Sequence Control 1028 @@ -25,7 +26,16 @@ IEEE 802.11 WTP Radio Fail Alarm Indication 1047 */ -#define CWMSGELEM_IEEE80211_WTP_RADIO_INFO 1048 +#define CWMSGELEM_80211_WTP_RADIO_INFO 1048 + + + +/* + * Messages + */ + +#define CWMSG_80211_WLAN_CONFIGURATION_REQUEST 3398913 +#define CWMSG_80211_WLAN_CONFIGURATION_REPONSE 3398914 @@ -36,12 +46,40 @@ #define CW_IEEE80211_RADIO_TYPE_N (8<<24) */ -#define CW_IEEE80211_RADIO_TYPE_B (1) -#define CW_IEEE80211_RADIO_TYPE_A (2) -#define CW_IEEE80211_RADIO_TYPE_G (4) -#define CW_IEEE80211_RADIO_TYPE_N (8) +#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 cwwlan { + 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; + +}; + + extern int cw_readelem_ieee80211_wtp_radio_info(void *dst,int type,uint8_t *msgelem, int len); + + + + diff --git a/src/capwap/cw_msgelemtostr.c b/src/capwap/cw_msgelemtostr.c index feb4d880..5cb687aa 100644 --- a/src/capwap/cw_msgelemtostr.c +++ b/src/capwap/cw_msgelemtostr.c @@ -18,7 +18,7 @@ #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" const char * cw_msgelemtostr(int elem) @@ -148,7 +148,7 @@ const char * cw_msgelemtostr(int elem) - case CWMSGELEM_IEEE80211_WTP_RADIO_INFO: + case CWMSGELEM_80211_WTP_RADIO_INFO: return "802.11: wtp radio info"; diff --git a/src/capwap/cw_readelem_ieee80211_wtp_radio_info.c b/src/capwap/cw_readelem_80211_wtp_radio_info.c similarity index 80% rename from src/capwap/cw_readelem_ieee80211_wtp_radio_info.c rename to src/capwap/cw_readelem_80211_wtp_radio_info.c index 449e7145..753466c7 100644 --- a/src/capwap/cw_readelem_ieee80211_wtp_radio_info.c +++ b/src/capwap/cw_readelem_80211_wtp_radio_info.c @@ -19,18 +19,18 @@ #include #include "wtpinfo.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include "cw_log.h" -int cw_readelem_ieee80211_wtp_radio_info(void *dst,int type,uint8_t *msgelem, int len) +int cw_readelem_80211_wtp_radio_info(void *dst,int type,uint8_t *msgelem, int len) { - if (type != CWMSGELEM_IEEE80211_WTP_RADIO_INFO) + if (type != CWMSGELEM_80211_WTP_RADIO_INFO) return 0; if (len!=5){ - cw_dbg(DBG_CW_MSG_ERR,"Discarding msgelem IEEE80211_WTP_RADIO_INFO, wrong size, len=%d\n",len); + cw_dbg(DBG_CW_MSG_ERR,"Discarding msgelem 80211_WTP_RADIO_INFO, wrong size, len=%d\n",len); return 0; } diff --git a/src/capwap/cwmsg_addelem_80211_add_wlan.c b/src/capwap/cwmsg_addelem_80211_add_wlan.c new file mode 100644 index 00000000..6dd2fecd --- /dev/null +++ b/src/capwap/cwmsg_addelem_80211_add_wlan.c @@ -0,0 +1,40 @@ +/** + * @file + * @brief add wlan msg element implementation + */ + +#include "capwap.h" +#include "capwap_80211.h" + +#include "cwmsg.h" + +#include "bstr.h" + + +void cwmsg_addelem_80211_add_wlan(struct cwmsg *cwmsg,struct cwwlan *wlan) +{ + + uint16_t capab=htons(wlan->capab); + uint16_t keylen=htons(wlan->key_length); + + cwmsg_vaddelem(cwmsg,CWMSGELEM_80211_ADD_WLAN, + &wlan->rid,1, + &wlan->wid,1, + &capab,2, + &wlan->key_index,1, + &wlan->key_status,1, + &keylen,2, + wlan->key,wlan->key_length, + wlan->group_tsc,6, + &wlan->qos,1, + &wlan->auth_type,1, + &wlan->mac_mode,1, + &wlan->tunnel_mode,1, + &wlan->suppress_ssid,1, + bstr_data(wlan->ssid),bstr_len(wlan->ssid), + NULL + + ); + +} + diff --git a/src/capwap/cwmsg_addelem_wtp_radio_infos.c b/src/capwap/cwmsg_addelem_wtp_radio_infos.c index a3c7e01e..cc1e37b1 100644 --- a/src/capwap/cwmsg_addelem_wtp_radio_infos.c +++ b/src/capwap/cwmsg_addelem_wtp_radio_infos.c @@ -17,7 +17,7 @@ */ #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include "radioinfo.h" void cwmsg_addelem_wtp_radio_info(struct cwmsg * msg,struct radioinfo *radioinfo) @@ -27,7 +27,7 @@ void cwmsg_addelem_wtp_radio_info(struct cwmsg * msg,struct radioinfo *radioinfo *ri = radioinfo->rid; *((uint32_t*)(ri+1))=htonl(radioinfo->type); - cwmsg_addelem(msg,CWMSGELEM_IEEE80211_WTP_RADIO_INFO,ri,5); + cwmsg_addelem(msg,CWMSGELEM_80211_WTP_RADIO_INFO,ri,5); } diff --git a/src/capwap/cwread_discovery_request.c b/src/capwap/cwread_discovery_request.c index c05ed902..8c4dfb51 100644 --- a/src/capwap/cwread_discovery_request.c +++ b/src/capwap/cwread_discovery_request.c @@ -20,7 +20,7 @@ #include #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include "cw_log.h" #include "cw_util.h" @@ -85,7 +85,7 @@ void cwread_discovery_request(struct wtpinfo *wtpinfo, uint8_t * msg, CWMSGELEM_WTP_DESCRIPTOR, CWMSGELEM_WTP_FRAME_TUNNEL_MODE, CWMSGELEM_WTP_MAC_TYPE, - CWMSGELEM_IEEE80211_WTP_RADIO_INFO, + CWMSGELEM_80211_WTP_RADIO_INFO, -1 }; diff --git a/src/capwap/process_conf_status_request.c b/src/capwap/process_conf_status_request.c index ab351448..b8e63504 100644 --- a/src/capwap/process_conf_status_request.c +++ b/src/capwap/process_conf_status_request.c @@ -18,7 +18,7 @@ #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include #include diff --git a/src/capwap/process_join_request.c b/src/capwap/process_join_request.c index 4e6a9ec0..09ea94b2 100644 --- a/src/capwap/process_join_request.c +++ b/src/capwap/process_join_request.c @@ -17,7 +17,7 @@ */ #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include #include diff --git a/src/capwap/wtpinfo_print.c b/src/capwap/wtpinfo_print.c index c3ef79d7..0b5b0259 100644 --- a/src/capwap/wtpinfo_print.c +++ b/src/capwap/wtpinfo_print.c @@ -20,7 +20,7 @@ #include #include "capwap.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include "cw_util.h" @@ -33,16 +33,16 @@ int radioinfo_print(char * str, struct radioinfo * radioinfo) s += sprintf(s,"\t RID %d ",radioinfo->rid); s += sprintf(s,"modes: "); - if(radioinfo->type & CW_IEEE80211_RADIO_TYPE_B){ + if(radioinfo->type & CW_80211_RADIO_TYPE_B){ s+=sprintf(s,"B"); } - if(radioinfo->type & CW_IEEE80211_RADIO_TYPE_G){ + if(radioinfo->type & CW_80211_RADIO_TYPE_G){ s+=sprintf(s,"G"); } - if(radioinfo->type & CW_IEEE80211_RADIO_TYPE_A){ + if(radioinfo->type & CW_80211_RADIO_TYPE_A){ s+=sprintf(s,"A"); } - if(radioinfo->type & CW_IEEE80211_RADIO_TYPE_N){ + if(radioinfo->type & CW_80211_RADIO_TYPE_N){ s+=sprintf(s,"N"); } diff --git a/src/capwap/wtpinfo_readelem_wtp_radio_info.c b/src/capwap/wtpinfo_readelem_wtp_radio_info.c index a380e257..d9021b57 100644 --- a/src/capwap/wtpinfo_readelem_wtp_radio_info.c +++ b/src/capwap/wtpinfo_readelem_wtp_radio_info.c @@ -19,14 +19,14 @@ #include #include "wtpinfo.h" -#include "capwap_ieee80211.h" +#include "capwap_80211.h" #include "cw_log.h" int wtpinfo_readelem_wtp_radio_info(struct wtpinfo * wtpinfo,int type,uint8_t *msgelem, int len) { - if (type != CWMSGELEM_IEEE80211_WTP_RADIO_INFO) + if (type != CWMSGELEM_80211_WTP_RADIO_INFO) return 0; if (len!=5){