diff --git a/mod_cipwap.project b/mod_cipwap.project index 301e5974..d7582535 100644 --- a/mod_cipwap.project +++ b/mod_cipwap.project @@ -3,12 +3,10 @@ - - diff --git a/mod_cisco.project b/mod_cisco.project index d1c43e00..9f674b3f 100644 --- a/mod_cisco.project +++ b/mod_cisco.project @@ -6,8 +6,6 @@ - - @@ -28,7 +26,6 @@ - @@ -36,6 +33,7 @@ + diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c index 590c8fea..24529b25 100644 --- a/src/mod/capwap/capwap_actions_ac.c +++ b/src/mod/capwap/capwap_actions_ac.c @@ -20,12 +20,14 @@ #include "cw/cw.h" #include "cw/ktv.h" #include "cw/log.h" +#include "cw/dbg.h" #include "cw/msgset.h" #include "cw/keys.h" #include "mod_capwap.h" + static struct cw_ElemHandler handlers[] = { { @@ -219,12 +221,16 @@ static struct cw_MsgDef messages[] = { struct cw_MsgSet * capwap_register_msg_set(struct cw_MsgSet * set, int mode){ if (mode != CW_MOD_MODE_CAPWAP) return NULL; + + cw_dbg(DBG_INFO,"CAPWAP: Register messages"); + cw_msgset_add(set,messages, handlers); mavl_add_ptr(set->types_tree,CW_TYPE_BSTR16); mavl_add_ptr(set->types_tree,CW_TYPE_BYTE); mavl_add_ptr(set->types_tree,CW_TYPE_DWORD); mavl_add_ptr(set->types_tree,CW_TYPE_WORD); + cw_dbg(DBG_INFO,"CAPWAP: Done register messages"); return set; } diff --git a/src/mod/capwap/capwap_in_vendor_specific_payload.c b/src/mod/capwap/capwap_in_vendor_specific_payload.c index c405b3c4..ffd1be5d 100644 --- a/src/mod/capwap/capwap_in_vendor_specific_payload.c +++ b/src/mod/capwap/capwap_in_vendor_specific_payload.c @@ -33,7 +33,7 @@ int capwap_in_vendor_specific_payload(struct cw_ElemHandler *handler, return 0; } - cw_dbg_elem(DBG_ELEM_IN,params->conn,0,vhandler, params, data+6,len-6); +// cw_dbg_elem(DBG_ELEM_IN,params->conn,0,vhandler, data+6,len-6); //vhandler->get(vhandler, params, data+6, len-6); cw_process_element(params,0,vendor_id,elem_id,data+6,len-6); diff --git a/src/mod/capwap/mod_capwap_ac.c b/src/mod/capwap/mod_capwap_ac.c index 626d7e64..6eaa59dd 100644 --- a/src/mod/capwap/mod_capwap_ac.c +++ b/src/mod/capwap/mod_capwap_ac.c @@ -14,6 +14,7 @@ extern int capwap_register_actions_ac(struct cw_actiondef *def); static int init(struct cw_Mod * mod, mavl_t global_cfg, int role) { + cw_dbg(DBG_INFO,"CAPWAP: Inititalizing mod_capwap."); switch (role){ case CW_ROLE_AC:{ cw_dbg(DBG_MOD, "CAPWAP: Initialiazing mod_capwap in AC mode"); diff --git a/src/mod/cipwap/cipwap_items.c b/src/mod/cipwap/cipwap_items.c deleted file mode 100644 index e6981aff..00000000 --- a/src/mod/cipwap/cipwap_items.c +++ /dev/null @@ -1,43 +0,0 @@ - -#include "cw/mbag.h" -#include "cw/item.h" - -#include "cipwap_items.h" - - - -const char CIPWAP_ITEM_SSH_ENABLE[]="ssh_enable"; -const char CIPWAP_ITEM_TELNET_ENABLE[]="telnet_enable"; -const char CIPWAP_ITEM_AC_HASH_VALUE[]="ac_hash_value"; -const char CIPWAP_ITEM_LOG_FACILITY[]="log_facility"; -const char CIPWAP_ITEM_WTP_GROUP_NAME[]="wtp_group"; - - - - -struct cw_itemdef cipwap_itemdefs[] = { - - {CIPWAP_ITEM_TELNET_ENABLE,CW_ITEM_NONE,MBAG_BYTE}, - {CIPWAP_ITEM_SSH_ENABLE,CW_ITEM_NONE,MBAG_BYTE}, - {CIPWAP_ITEM_AC_HASH_VALUE,CW_ITEM_NONE,MBAG_BSTR16}, - {CIPWAP_ITEM_LOG_FACILITY,CW_ITEM_NONE,MBAG_BYTE}, - {CIPWAP_ITEM_WTP_GROUP_NAME,CW_ITEM_NONE,MBAG_BSTR16}, - - {CW_ITEM_NONE} - -}; - -const char CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT[]="occupancy_limit"; -const char CIPWAP_RADIOITEM80211_CFP_PERIOD[]="cfp_period"; -const char CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION[]="cfp_max_duration"; - -struct cw_itemdef cipwap_radioitemdefs[] = { - - {CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT,CW_ITEM_NONE,MBAG_WORD}, - {CIPWAP_RADIOITEM80211_CFP_PERIOD,CW_ITEM_NONE,MBAG_BYTE}, - {CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION,CW_ITEM_NONE,MBAG_WORD}, - - {CW_ITEM_NONE} - -}; - diff --git a/src/mod/cipwap/cipwap_items.h b/src/mod/cipwap/cipwap_items.h deleted file mode 100644 index daf261c9..00000000 --- a/src/mod/cipwap/cipwap_items.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __CIPWAP_ITEMS_H -#define __CIPWAP_ITEMS_H - -extern const char CIPWAP_ITEM_SSH_ENABLE[]; -extern const char CIPWAP_ITEM_TELNET_ENABLE[]; -extern const char CIPWAP_ITEM_AC_HASH_VALUE[]; -extern const char CIPWAP_ITEM_LOG_FACILITY[]; -extern const char CIPWAP_ITEM_WTP_GROUP_NAME[]; - - - -extern const char CIPWAP_RADIOITEM80211_OCCUPANCY_LIMIT[]; -extern const char CIPWAP_RADIOITEM80211_CFP_PERIOD[]; -extern const char CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION[]; - -extern struct cw_itemdef cipwap_itemdefs[]; -extern struct cw_itemdef cipwap_radioitemdefs[]; - -#endif diff --git a/src/mod/cisco/Makefile b/src/mod/cisco/Makefile index b5a46f05..077dd37f 100644 --- a/src/mod/cisco/Makefile +++ b/src/mod/cisco/Makefile @@ -6,19 +6,19 @@ include ../../Config.local.mak OBJS=\ mod_cisco_ac.o \ cisco_actions_ac.o \ - cisco_actions_wtp.o \ - cisco_out_ap_timesync.o \ cisco_in_wtp_descriptor.o \ - cisco_out_ac_descriptor.o \ cisco_out_wtp_descriptor.o \ - cisco_out_telnet_ssh.o \ - cisco_in_ac_descriptor.o\ - cisco80211.o \ - cisco_out_board_data_options.o \ + +# cisco80211.o \ +# cisco_out_radio_administrative_state.o \ cisco_in_radio_administrative_state.o \ cisco_in_spam_vendor_specific.o \ +# cisco_out_ap_timesync.o \ + cisco_out_board_data_options.o \ +# cisco_out_ac_descriptor.o \ +# cisco_out_telnet_ssh.o \ cisco_in_telnet_ssh.o \ - cisco_items.o \ + cisco_in_ac_descriptor.o\ cisco80211_in_mac_operation.o \ cisco80211_in_wtp_radio_configuration.o \ cisco80211_out_wtp_radio_configuration.o \ @@ -31,8 +31,6 @@ OBJS=\ cisco_in_radio_operational_state.o \ cisco_out_wtp_operational_state.o -# cisco_out_radio_administrative_state.o \ - LIBDIR := ../../../lib LIBARCHDIR := $(LIBDIR)/$(ARCH) diff --git a/src/cw/capwap_cisco.h b/src/mod/cisco/capwap_cisco.h similarity index 98% rename from src/cw/capwap_cisco.h rename to src/mod/cisco/capwap_cisco.h index a1f00e06..f41e82b7 100644 --- a/src/cw/capwap_cisco.h +++ b/src/mod/cisco/capwap_cisco.h @@ -27,9 +27,9 @@ #include #include -#include "lwapp.h" -#include "cw.h" -#include "vendors.h" +#include "cw/lwapp.h" +#include "cw/cw.h" +#include "cw/vendors.h" #define CW_CISCO_MWAR_ADDR LW_ELEM_AC_ADDRESS /* 2 */ #define CW_CISCO_RAD 3 @@ -112,9 +112,9 @@ #define CW_CISCO_AP_LED_FLASH_CONFIG 254 - +/* int cw_put_cisco_ap_timesync(uint8_t * dst, time_t time, uint8_t type); - +*/ /* int cw_out_cisco_ap_timesync(struct conn *conn,struct cw_action_out * a,uint8_t *dst); @@ -142,6 +142,7 @@ static inline int cw_addelem_cisco_mwar(uint8_t *dst, struct ac_info *acinfo){ } */ +/* int cw_readelem_cisco_station_cfg(uint8_t *src,int len); int cw_addelem_cisco_certificate(uint8_t*dst,uint8_t*src,int len); @@ -150,11 +151,13 @@ extern const char * cw_cisco_id_to_str(int elem_id); int cw_readelem_cisco_wtp_radio_cfg(int elem_id,uint8_t *elem, int len,struct radioinfo *ri); int cw_addelem_cisco_wtp_radio_cfg(uint8_t*dst,struct radioinfo * ri); +*/ /* extern int cw_out_cisco_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *dst) ; */ +/* int cw_in_cisco_image_identifier(struct conn *conn,struct cw_action_in * a,uint8_t *data,int len,struct sockaddr *from); int cw_in_cipwap_wtp_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data, @@ -179,5 +182,5 @@ int cw_in_cisco_radio_cfg(struct conn *conn, struct cw_action_in *a, uint8_t * d int cw_in_cisco_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, struct sockaddr *from); - +*/ #endif diff --git a/src/mod/cisco/capwap_items.h b/src/mod/cisco/capwap_items.h deleted file mode 100644 index 84b78ec3..00000000 --- a/src/mod/cisco/capwap_items.h +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef __CAPWAP_ITEMS_H -#define __CAPWAP_ITEMS_H - -#include "capwap/item.h" - -/* - CW_ITEM_NONE=0, - CW_ITEM_IDLE_TIMEOUT, - CW_ITEM_DISCOVERY_TYPE, - CW_ITEM_WTP_NAME, - CW_ITEM_WTP_BOARD_VENDOR, - CW_ITEM_WTP_BOARD_MODELNO, - CW_ITEM_WTP_BOARD_MACADDRESS, - CW_ITEM_WTP_BOARD_ID, - CW_ITEM_WTP_BOARD_REVISION, - CW_ITEM_WTP_BOARD_SERIALNO, - CW_ITEM_WTP_MAC_TYPE, - CW_ITEM_WTP_FRAME_TUNNEL_MODE, - CW_ITEM_WTP_RADIOS_IN_USE, - CW_ITEM_WTP_MAX_RADIOS, - CW_ITEM_WTP_HARDWARE_VENDOR, - CW_ITEM_WTP_HARDWARE_VERSION, - CW_ITEM_WTP_SOFTWARE_VENDOR, - CW_ITEM_WTP_SOFTWARE_VERSION, - CW_ITEM_WTP_BOOTLOADER_VENDOR, - CW_ITEM_WTP_BOOTLOADER_VERSION, - CW_ITEM_WTP_OTHERSOFTWARE_VENDOR, - CW_ITEM_WTP_OTHERSOFTWARE_VERSION, - CW_ITEM_WTP_BOARD_DATA, - CW_ITEM_WTP_DESCRIPTOR, - CW_ITEM_CAPWAP_TIMERS, - CW_ITEM_RADIO_ADMINISTRATIVE_STATE, - - CW_ITEM_AC_NAME, - CW_ITEM_AC_DESCRIPTOR, - CW_ITEM_RESULT_CODE, - CW_ITEM_AC_STATUS, - - CW_ITEM_AC_HARDWARE_VERSION, - CW_ITEM_AC_SOFTWARE_VERSION, - - CW_ITEM_AC_IP_LIST, - CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST, - CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS, - - CW_ITEM_LOCATION_DATA, - CW_ITEM_SESSION_ID, - - CW_ITEM_AC_TIMESTAMP, - CW_ITEM_STATISTICS_TIMER, - CW_ITEM_WTP_REBOOT_STATISTICS, - CW_ITEM_IMAGE_IDENTIFIER, - CW_ITEM_AC_HASH_VALUE, - - CW_ITEM_AC_NAME_WITH_PRIORITY, - CW_ITEM_MAXIMUM_MESSAGE_LENGTH, - - - CW_ITEM_WTP_GROUP_NAME, - - - CW_ITEM_AC_IMAGE_DIR, - CW_ITEM_IMAGE_FILENAME, - CW_ITEM_DISCOVERIES, - - CW_ITEM_IMAGE_FILEHANDLE, - - CW_ITEM_RADIO_CFG, - CW_ITEM_AP_MODE_AND_TYPE, - - CW_ITEM_CISCO_BOARD_DATA_OPTIONS, - CW_ITEM_RADIOS, - CW_ITEM_RADIO_OPER_STATE, - - -*/ - -extern const char CW_ITEM_IDLE_TIMEOUT[]; -extern const char CW_ITEM_DISCOVERY_TYPE[]; -extern const char CW_ITEM_WTP_NAME[]; - -/* -extern const char CW_ITEM_WTP_BOARD_VENDOR, -extern const char CW_ITEM_WTP_BOARD_MODELNO, -extern const char CW_ITEM_WTP_BOARD_MACADDRESS, -extern const char CW_ITEM_WTP_BOARD_ID, -extern const char CW_ITEM_WTP_BOARD_REVISION, -extern const char CW_ITEM_WTP_BOARD_SERIALNO, -*/ -extern const char CW_ITEM_WTP_MAC_TYPE[]; -extern const char CW_ITEM_WTP_FRAME_TUNNEL_MODE[]; -/* -extern const char CW_ITEM_WTP_RADIOS_IN_USE= -extern const char CW_ITEM_WTP_MAX_RADIOS, -*/ -/* -extern const char CW_ITEM_WTP_HARDWARE_VENDOR= -extern const char CW_ITEM_WTP_HARDWARE_VERSION=" -*/ -/* -extern const char CW_ITEM_WTP_SOFTWARE_VENDOR, -extern const char CW_ITEM_WTP_SOFTWARE_VERSION, -extern const char CW_ITEM_WTP_BOOTLOADER_VENDOR, -extern const char CW_ITEM_WTP_BOOTLOADER_VERSION, -extern const char CW_ITEM_WTP_OTHERSOFTWARE_VENDOR, -extern const char CW_ITEM_WTP_OTHERSOFTWARE_VERSION, -*/ -extern const char CW_ITEM_WTP_BOARD_DATA[]; -extern const char CW_ITEM_WTP_DESCRIPTOR[]; -extern const char CW_ITEM_CAPWAP_TIMERS[]; -extern const char CW_ITEM_RADIO_ADMINISTRATIVE_STATE[]; - -extern const char CW_ITEM_AC_NAME[]; -extern const char CW_ITEM_AC_DESCRIPTOR[]; -extern const char CW_ITEM_RESULT_CODE[]; -extern const char CW_ITEM_AC_STATUS[]; - -extern const char CW_ITEM_AC_HARDWARE_VERSION[]; -extern const char CW_ITEM_AC_SOFTWARE_VERSION[]; - -extern const char CW_ITEM_AC_IP_LIST[]; -extern const char CW_ITEM_CAPWAP_CONTROL_IP_ADDRESS_LIST[]; -extern const char CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS[]; - -extern const char CW_ITEM_LOCATION_DATA[]; -extern const char CW_ITEM_SESSION_ID[]; - -extern const char CW_ITEM_AC_TIMESTAMP[]; -extern const char CW_ITEM_STATISTICS_TIMER[]; -extern const char CW_ITEM_WTP_REBOOT_STATISTICS[]; -extern const char CW_ITEM_IMAGE_IDENTIFIER[]; -extern const char CW_ITEM_AC_HASH_VALUE[]; - -extern const char CW_ITEM_AC_NAME_WITH_PRIORITY[]; -extern const char CW_ITEM_MAXIMUM_MESSAGE_LENGTH[]; - - - /* CIPWAP and Cisco */ -extern const char CW_ITEM_WTP_GROUP_NAME[]; - - - /* Other Items */ -extern const char CW_ITEM_AC_IMAGE_DIR[]; /* Path where WTP images are stored */ -extern const char CW_ITEM_IMAGE_FILENAME[]; /* Full path of image filename */ -extern const char CW_ITEM_DISCOVERIES[]; - - /** FILE handle for uploading and downloading images */ -extern const char CW_ITEM_IMAGE_FILEHANDLE[]; - -extern const char CW_ITEM_RADIO_CFG[]; -extern const char CW_ITEM_AP_MODE_AND_TYPE[]; - -extern const char CW_ITEM_CISCO_BOARD_DATA_OPTIONS[]; -extern const char CW_ITEM_RADIOS[]; -extern const char CW_ITEM_RADIO_OPER_STATE[]; - - -extern const char CW_ITEM_WTP_BOARD_VENDOR[]; -extern const char CW_ITEM_WTP_BOARD_MODELNO[]; -extern const char CW_ITEM_WTP_BOARD_MACADDRESS[]; -extern const char CW_ITEM_WTP_BOARD_ID[]; -extern const char CW_ITEM_WTP_BOARD_REVISION[]; -extern const char CW_ITEM_WTP_BOARD_SERIALNO[]; - -extern const char CW_ITEM_WTP_SOFTWARE_VERSION[]; -extern const char CW_ITEM_WTP_HARDWARE_VERSION[]; - -extern const char CW_ITEM_WTP_BOOTLOADER_VERSION[]; - -extern const char CW_ITEM_WTP_RADIOS_IN_USE[]; -extern const char CW_ITEM_WTP_MAX_RADIOS[]; -extern const char CW_ITEM_RADIO_INFOS[]; - - - - - -extern struct cw_itemdef capwap_itemdefs[]; - -#endif diff --git a/src/mod/cisco/cisco.h b/src/mod/cisco/cisco.h deleted file mode 100644 index 9c529bdb..00000000 --- a/src/mod/cisco/cisco.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __CISCO_H -#define __CISCO_H - -#include "cw/conn.h" -#include "cw/action.h" - -extern int cisco_out_ap_timesync(struct conn *conn, struct cw_action_out *a, - uint8_t * dst); -/* -extern int cisco_in_wtp_descriptor(struct conn *conn, struct cw_action_in *a, - uint8_t * data, int len, struct sockaddr *from);*/ - -int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerParams * params, uint8_t * data, - int len); - -extern int cisco_out_ac_descriptor(struct conn *conn, struct cw_action_out *a, - uint8_t * dst); - -int cisco_out_wtp_descriptor(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params - , uint8_t * dst); - - - -extern int cisco_out_board_data_options(struct conn *conn, struct cw_action_out *a, - uint8_t * dst); - - - -extern int cisco_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, - uint8_t * data, int len, struct sockaddr *from); - -extern int cisco_in_radio_administrative_state(struct conn *conn, - struct cw_action_in *a, uint8_t * data, - int len, struct sockaddr *from); -int cisco_in_spam_vendor_specific(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, - struct sockaddr *from); - -int cisco_in_telnet_ssh(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, - struct sockaddr *from); - -int cisco_out_telnet_ssh(struct conn *conn,struct cw_action_out * a,uint8_t *dst); - -int cisco_out_radio_administrative_states(struct conn *conn, struct cw_action_out *a, uint8_t * dst); - -int cisco80211_in_mac_operation(struct conn *conn, struct cw_action_in *a, uint8_t * data, - int len, struct sockaddr *from); - -int cisco80211_in_wtp_radio_configuration(struct conn *conn, struct cw_action_in *a, uint8_t * data, - int len, struct sockaddr *from); -int cisco80211_out_wtp_radio_configuration(struct conn *conn, struct cw_action_out *a, uint8_t * dst); - -int cisco_out_manager_ip_addr(struct conn *conn,struct cw_action_out * a,uint8_t *dst) ; -int cisco_out_ac_ipv4_list(struct conn *conn, struct cw_action_out *a, uint8_t * dst); - -int cisco_in_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, - struct sockaddr *from); - -int cisco_out_wtp_administrative_state(struct conn *conn, struct cw_action_out *a, uint8_t * dst); -int cisco_out_wtp_operational_state(struct conn *conn, struct cw_action_out *a, uint8_t * dst); -int cisco_out_radio_operational_state(struct conn *conn, struct cw_action_out *a, uint8_t * dst); -int cisco_in_radio_operational_state(struct conn *conn, struct cw_action_in *a, uint8_t * data, - int len, struct sockaddr *from); -struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode); -#endif diff --git a/src/mod/cisco/cisco80211.c b/src/mod/cisco/cisco80211.c index 7332f10b..ee701889 100644 --- a/src/mod/cisco/cisco80211.c +++ b/src/mod/cisco/cisco80211.c @@ -1,7 +1,7 @@ #include "cw/capwap.h" #include "cw/capwap_cisco.h" -#include "cw/mbag.h" + #include "cw/radio.h" #include "cw/log.h" #include "cw/dbg.h" diff --git a/src/mod/cisco/cisco_actions_ac.c b/src/mod/cisco/cisco_actions_ac.c index bc538f4c..c64836e2 100644 --- a/src/mod/cisco/cisco_actions_ac.c +++ b/src/mod/cisco/cisco_actions_ac.c @@ -18,33 +18,26 @@ #include "cw/capwap.h" -#include "cw/cipwap.h" - -#include "cw/action.h" -#include "cw/capwap_items.h" -#include "cw/strheap.h" -#include "cw/radio.h" -#include "cw/capwap_cisco.h" -#include "cw/capwap80211.h" -#include "cw/capwap80211_items.h" - -#include "cw/lwapp_cisco.h" -#include "cw/cw_80211.h" - -#include "include/capwap_actions.h" - - -#include "cisco.h" - -#include "cisco_items.h" - - -#include "include/cipwap_items.h" - #include "cw/msgset.h" #include "cw/ktv.h" #include "cw/keys.h" +#include "capwap_cisco.h" +#include "mod_cisco.h" + +/*#include "cw/strheap.h" +#include "cw/radio.h" +#include "cw/capwap_cisco.h" +#include "cw/capwap80211.h" +#include "cw/lwapp_cisco.h" +#include "cw/cw_80211.h" +*/ + +/* #include "include/capwap_actions.h" */ + + + + static struct cw_ElemHandler handlers[] = { { "WTP Descriptor (Draft 7)", /* name */ @@ -114,471 +107,6 @@ static struct cw_MsgDef messages[] = { - - - - - - - - - -static cw_action_in_t actions_in[] = { - - - /* -------------------------------------------------------- - * Discovery Resquest - */ - - /* Message Discovery Request */ - { - .capwap_state = CAPWAP_STATE_DISCOVERY, - .msg_id = CAPWAP_MSG_DISCOVERY_REQUEST, - /* .end = cw_in_check_disc_req*/ - } - , - - /* Element WTP Descriptor */ - { - .capwap_state = CAPWAP_STATE_DISCOVERY, - .msg_id = CAPWAP_MSG_DISCOVERY_REQUEST, - .elem_id = CAPWAP_ELEM_WTP_DESCRIPTOR, - .start = cisco_in_wtp_descriptor, - .item_id = "wtp_descriptor", - .mand = 1, - } - , - - /* Element Cisco RAD Name */ - { - .capwap_state = CAPWAP_STATE_DISCOVERY, - .msg_id = CAPWAP_MSG_DISCOVERY_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_RAD_NAME, - .start=cw_in_generic, - .item_id = "wtp_name", - .min_len=1, - .max_len=512, - .mand=1 - } - , - - /* Element WTP Board Data - Discovery Request - * Change it to not mandatory, because older Cisco - * firmware does not send this message element. - */ - { - .capwap_state = CAPWAP_STATE_DISCOVERY, - .msg_id = CAPWAP_MSG_DISCOVERY_REQUEST, - .elem_id = CAPWAP_ELEM_WTP_BOARD_DATA, - .start = cw_in_wtp_board_data, - .item_id = CW_ITEM_WTP_BOARD_DATA, - .mand = 0, - } - , - - - - - /* -------------------------------------------------------- - * Join Resquest - */ - - /* WTP Descriptor - Join Request */ - { - .capwap_state = CAPWAP_STATE_JOIN, - .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CAPWAP_ELEM_WTP_DESCRIPTOR, - .start = cisco_in_wtp_descriptor, - .item_id = "wtp_descriptor", - .mand = 1, - } - , - - /* Session ID - Join Request */ - { - /* Cisco uses 4 byte session ids */ - .capwap_state = CAPWAP_STATE_JOIN, - .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CW_ELEM_SESSION_ID, - .start = capwap_in_session_id, - .item_id = CW_ITEM_SESSION_ID, - .mand = 1, - .min_len = 4, - .max_len = 16 - } - , - - /* Local IPv4 Address - Join Request */ - { - .capwap_state = CAPWAP_STATE_JOIN, - .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CAPWAP_ELEM_WTP_IPV4_IP_ADDRESS, - .item_id = CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS, - .start = cw_in_capwap_local_ipv4_address, - .mand = 1, - .min_len = 4, - .max_len = 4 - } - , - - /* Local IPv6 Address - Join Request */ - { - .capwap_state = CAPWAP_STATE_JOIN, - .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CAPWAP_ELEM_WTP_IPV6_IP_ADDRESS, - .item_id = CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS, - .start = cw_in_capwap_local_ipv4_address, - .mand = 1, - .min_len = 16, - .max_len = 16 - } - , - - /* ECN Support - Join Request */ - { - /* Cisco (using draft 7) does nothing know - * about ECN support, so make it non-mandatory */ - .capwap_state = CAPWAP_STATE_JOIN, - .msg_id = CAPWAP_MSG_JOIN_REQUEST, - .elem_id = CAPWAP_ELEM_ECN_SUPPORT, - .item_id = CW_ITEM_ECN_SUPPORT, - .start = cw_in_generic, - .mand = 0, - .min_len = 1, - .max_len = 1 - } - , - - - /* -------------------------------------------------------- - * Configuration Status Request - */ - - - - /* AC Name - Config Status Request */ - { - /* We have to deal with zero-length strings */ - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .elem_id = CAPWAP_ELEM_AC_NAME, - .item_id = CW_ITEM_AC_NAME, - .start = cw_in_generic, - .min_len = 0, - .max_len = 512, - .mand = 1 - - } - , - - - - { - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_WTP_RADIO_CFG, - .start=cisco80211_in_wtp_radio_configuration, - .item_id = "cisco_radio_cfg", - } - , - - - /* LED State Config */ - { - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_LED_STATE_CONFIG, - .item_id = CISCO_ITEM_AP_LED_STATE_CONFIG, - .start = cw_in_generic - - } - , - - /* LED Flash Config */ - { - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_LED_FLASH_CONFIG, - .item_id = CISCO_ITEM_AP_LED_FLASH_CONFIG, - .start = cw_in_generic - - } - , - - - - { - /* This is Cisco's Vendor specific encapsulation - * of LWAPP elements */ - - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_SPAM_VENDOR_SPECIFIC, - .start = lw_in_vendor_specific, - - } - , - - /* LWAPP Vendor spec Messages */ - - - /* Telent SSH */ - { - - .proto = CW_ACTION_PROTO_LWAPP, - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = LW_VENDOR_ID_CISCO, - .elem_id = LW_CISCO_TELNET_SSH, - .start = cisco_in_telnet_ssh - } - - , - - /* AP Mode and Type */ - { - - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_MODE_AND_TYPE, - .item_id = CISCO_ITEM_AP_MODE_AND_TYPE, - .start = cw_in_generic - } - , - - /* Log Facility */ - { - - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_LOG_FACILITY, - .item_id = CIPWAP_ITEM_LOG_FACILITY, - .start = cw_in_generic - } - , - - - - - /* Radio Operational State - Run State - Change State Event Req */ - { - .capwap_state = CW_STATE_RUN, - .msg_id= CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST, - .elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE, - .item_id = CW_RADIOITEM_OPER_STATE, - .start = cisco_in_radio_operational_state, - .min_len=3, - .max_len=3, - .mand = 0 - } - , - - /* Radio Operational State - Configure State - Change State Event Req */ - { - .capwap_state = CW_STATE_CONFIGURE, - .msg_id= CAPWAP_MSG_CHANGE_STATE_EVENT_REQUEST, - .elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE, - .item_id = CW_RADIOITEM_OPER_STATE, - .start = cisco_in_radio_operational_state, //operational_state, - .min_len=3, - .max_len=3, - .mand = 0 - } - , - - - - /* End of list */ - {0, 0} -}; - - -static cw_action_out_t actions_out[]={ - - /* -------------------------------------------------------- - * Discovery Response - */ - - /* AC Descriptor - Discovery Response */ - { - .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, - .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, - .out = cisco_out_ac_descriptor, - .mand = 1 - } - , - - - /* Cisco AP Timesync - Discovery Request - * Important to get the WTP a DTLS connection established - */ - { - .msg_id = CAPWAP_MSG_DISCOVERY_RESPONSE, - .item_id = CW_ITEM_AC_TIMESTAMP, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_TIMESYNC, - .out = cisco_out_ap_timesync, - .mand = 1 - } - , - - - /* AC Descriptor - Join Response */ - { - .msg_id = CAPWAP_MSG_JOIN_RESPONSE, - .item_id = CW_ITEM_AC_DESCRIPTOR, - .elem_id = CAPWAP_ELEM_AC_DESCRIPTOR, - .out = cisco_out_ac_descriptor, - .mand = 1 - } - , - - - - /* ECN Support - Join Response */ - { - .msg_id = CAPWAP_MSG_JOIN_RESPONSE, - .elem_id = CAPWAP_ELEM_ECN_SUPPORT, - .item_id = CW_ITEM_ECN_SUPPORT - } - , - - /* -------------------------------------------------------- - * Echo Response - */ - /* AP Time Sync - Echo Response */ - { - .msg_id = CAPWAP_MSG_ECHO_RESPONSE, - .vendor_id = CW_VENDOR_ID_CISCO, - .item_id = CW_ITEM_AC_TIMESTAMP, - .elem_id = CW_CISCO_AP_TIMESYNC, - .out = cisco_out_ap_timesync, - .mand = 1 - } - , - - /* -------------------------------------------------------- - * Configuration Status Response - */ - /* Manager IP Address */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, - .out = cisco_out_manager_ip_addr, - .mand = 1 - } - , - - - /* -------------------------------------------------------- - * Configuration Update Request - Out - */ - - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .out = cisco_out_telnet_ssh, - } - , - - { - /* Cisco's APs complain about msg elements of type - 45 (WTP Name). So it ist silenced here. - But the method here used to silence the element - isn't effective. TODO: There shuld be a way to remove - or replace such elemenns */ - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .item_id = CW_ITEM_WTP_NAME, - .elem_id = CAPWAP_ELEM_WTP_NAME, - } - , - - /* WTP Name */ - { - - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .item_id = CW_ITEM_WTP_NAME, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_RAD_NAME, - .out=cw_out_generic, - /*.get = cw_out_get_outgoing*/ - } - , - - /* Radio Operational State - OUT */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE, - .item_id = CW_RADIOITEM_OPER_STATE, - .out = cisco_out_radio_operational_state, - .mand = 0 - } - , - - /* LED State Config - OUT */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_LED_STATE_CONFIG, - .item_id = CISCO_ITEM_AP_LED_STATE_CONFIG, - .out = cw_out_generic, - /*.get = cw_out_get_outgoing,*/ - .mand = 0 - } - , - - - /* LED Flash Config - OUT */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_LED_FLASH_CONFIG, - .item_id = CISCO_ITEM_AP_LED_FLASH_CONFIG, - .out = cw_out_generic, - /*.get = cw_out_get_outgoing,*/ - .mand = 0 - } - , - - /* AP Mode and Type - OUT */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_AP_MODE_AND_TYPE, - .item_id = CISCO_ITEM_AP_MODE_AND_TYPE, - .out = cw_out_generic, - /*.get = cw_out_get_outgoing,*/ - } - , - - - /* Cisco WTP Admin state - OUT */ - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, -// .elem_id = CW_CISCO_AP_MODE_AND_TYPE, - .item_id = CISCO_ITEM_WTP_ADMIN_STATE, - .out = cisco_out_wtp_administrative_state, -// .get = cw_out_get_outgoming, - } - , - - - - {0,0} - -}; - - - - - struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode){ if (mode != CW_MOD_MODE_CAPWAP) return NULL; @@ -586,166 +114,3 @@ struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode){ return set; } - -static cw_action_in_t actions80211_in[] = { - /* -------------------------------------------------------- - * Discovery Resquest - */ - - /* 802.11 Radio Information - Discovery Request */ - { - /* Cisco doe't sned this message element in discovery request, - so make it non-mandatory */ - - .capwap_state = CAPWAP_STATE_DISCOVERY, - .msg_id = CAPWAP_MSG_DISCOVERY_REQUEST, - .elem_id = CW_ELEM80211_WTP_RADIO_INFORMATION, - .item_id = CW_RADIOITEM80211_WTP_RADIO_INFORMATION, - /*.start = cw_in_radio_generic, */ - .mand = 0, - .min_len = 5, - .max_len = 5 - } - , - - /* -------------------------------------------------------- - * Configuration Status Resquest - IN - */ - /* Supported Rates - Configruati Status Request */ - { - .capwap_state = CW_STATE_CONFIGURE, - .vendor_id = CW_VENDOR_ID_CISCO, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .elem_id = CW_CISCO_SUPPORTED_RATES, - .item_id = CW_RADIOITEM80211_SUPPORTED_RATES, - /*.start = cw_in_radio_generic, */ - .mand = 0, - .min_len = 5, - .max_len = 5 - - } - - , - - /* MAC Operation - Configruation Status Request */ - { - .capwap_state = CW_STATE_CONFIGURE, - .vendor_id = CW_VENDOR_ID_CISCO, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .elem_id = CW_CISCO_MAC_OPERATION, - .item_id = "mac operation", - .start = cisco80211_in_mac_operation, - .mand = 0, - .min_len = 5, - .max_len = 5 - - } - - , - - - /* Radio Admin State (IN) - Config Status Request */ - { - .capwap_state = CW_STATE_CONFIGURE, - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST, - .elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE, - .item_id = CW_RADIOITEM_ADMIN_STATE, - .start = cisco_in_radio_administrative_state, - .mand = 1 - } - , - - - - {0,0} - - -}; - - - -extern int cisco_out_capwap_up(struct conn *conn, struct cw_action_out *a, uint8_t * dst); - -static cw_action_out_t actions80211_out[]={ - - { - .msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST, - .vendor_id = CW_VENDOR_ID_CISCO, - .elem_id = CW_CISCO_WTP_RADIO_CFG, - .out = cisco80211_out_wtp_radio_configuration, - } - , - { - .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, - .out = cisco_out_capwap_up, - } - , - - - - {0,0} -}; - - -#include "cw/item.h" - -static struct cw_itemdef _capwap_itemdefs[] = { - - {"wtp_name_cisco",CW_ITEM_NONE,MBAG_STR}, - - /* {"wtp_mac_type",CW_ITEM_NONE,MBAG_BYTE}, - {"discovery_type",CW_ITEM_NONE,MBAG_BYTE}, - {"wtp_frame_tunnel_mode",CW_ITEM_NONE,MBAG_BYTE}, -*/ {CW_ITEM_NONE} - -}; - - -#include "../modload.h" - -int cisco_register_actions_ac(struct cw_actiondef *def) -{ - - int rc; - rc = cw_actionlist_in_register_actions(def->in, actions_in); - rc += cw_actionlist_out_register_actions(def->out, actions_out); - - rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg); - rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem); - - rc += cw_itemdefheap_register(def->items, _capwap_itemdefs); -// rc += cw_itemdefheap_register(def->radioitems, cisco_radioitemdefs); - - intavltree_add(def->wbids, 0); - - - - return rc; -} - - - -int cisco_register_actions80211_ac(struct cw_actiondef *def) -{ - - int rc; - rc=0; - rc = cw_actionlist_in_register_actions(def->in, actions80211_in); - rc += cw_actionlist_out_register_actions(def->out, actions80211_out); - rc += cw_itemdefheap_register(def->items, cisco_itemdefs); - rc += cw_itemdefheap_register(def->radioitems, cisco_radioitemdefs); - - -/* rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg); - rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem); - - rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs); - - intavltree_add(def->wbids, 0); -*/ - - - return rc; -} - - diff --git a/src/mod/cisco/cisco_actions_wtp.c b/src/mod/cisco/cisco_actions_wtp.c index 369ce1c3..808f36f5 100644 --- a/src/mod/cisco/cisco_actions_wtp.c +++ b/src/mod/cisco/cisco_actions_wtp.c @@ -17,19 +17,18 @@ */ -#include "cw/cipwap.h" -#include "cw/action.h" -#include "cw/capwap_items.h" + + #include "cw/strheap.h" #include "cw/radio.h" #include "cw/capwap_cisco.h" #include "cw/capwap80211.h" -#include "cw/capwap80211_items.h" -#include "cw/lwapp_cisco.h" -#include "cisco_items.h" -#include "include/cipwap_items.h" +#include "cw/lwapp_cisco.h" + + + /*#include "mod_cisco.h"*/ diff --git a/src/mod/cisco/cisco_in_ac_descriptor.c b/src/mod/cisco/cisco_in_ac_descriptor.c index 684aaba8..d42bc32c 100644 --- a/src/mod/cisco/cisco_in_ac_descriptor.c +++ b/src/mod/cisco/cisco_in_ac_descriptor.c @@ -1,8 +1,8 @@ #include "cw/cw.h" -#include "cw/capwap_items.h" + #include "cw/dbg.h" -#include "cw/mbag.h" + #include "cw/vendors.h" int cisco_in_ac_descriptor(struct conn *conn, struct cw_action_in *a, uint8_t * data, diff --git a/src/mod/cisco/cisco_in_wtp_descriptor.c b/src/mod/cisco/cisco_in_wtp_descriptor.c index d9d8bbfb..cf6c852e 100644 --- a/src/mod/cisco/cisco_in_wtp_descriptor.c +++ b/src/mod/cisco/cisco_in_wtp_descriptor.c @@ -19,7 +19,7 @@ #include "cw/keys.h" #include "cw/cw.h" #include "cw/vendors.h" -#include "cw/capwap_items.h" + int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerParams * params, uint8_t * data, diff --git a/src/mod/cisco/cisco_items.c b/src/mod/cisco/cisco_items.c deleted file mode 100644 index 872673ca..00000000 --- a/src/mod/cisco/cisco_items.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "cw/mbag.h" -#include "cw/item.h" -#include "cisco_items.h" - -const char CISCO_ITEM_AP_MODE_AND_TYPE[]="cisco_ap_mode_and_type"; -const char CISCO_ITEM_AP_LED_STATE_CONFIG[]="cisco_ap_led_state"; -const char CISCO_ITEM_AP_LED_FLASH_CONFIG[]="cisco_ap_led_flash"; -const char CISCO_ITEM_WTP_OPER_STATE[]="cisco_wtp_oper_state"; -const char CISCO_ITEM_WTP_ADMIN_STATE[]="cisco_wtp_admin_state"; - - -struct cw_itemdef cisco_itemdefs[] = { - - {CISCO_ITEM_AP_MODE_AND_TYPE,CW_ITEM_NONE,MBAG_WORD}, - {CISCO_ITEM_AP_LED_STATE_CONFIG,CW_ITEM_NONE,MBAG_WORD}, - {CISCO_ITEM_AP_LED_FLASH_CONFIG,CW_ITEM_NONE,MBAG_BIN}, - {CISCO_ITEM_WTP_OPER_STATE,CW_ITEM_NONE,MBAG_WORD}, - {CISCO_ITEM_WTP_ADMIN_STATE,CW_ITEM_NONE,MBAG_BYTE}, - - {CW_ITEM_NONE} -}; - - - -const char CISCO_RADIOITEM80211_CFG_TYPE[]="cisco_radio_cfg_type"; -const char CISCO_RADIOITEM80211_COUNTRY_STR1[]="cisco_country_str1"; -const char CISCO_RADIOITEM80211_COUNTRY_STR2[]="cisco_country_str2"; - -struct cw_itemdef cisco_radioitemdefs[] = { - - {CISCO_RADIOITEM80211_CFG_TYPE,CW_ITEM_NONE,MBAG_BYTE}, - {CISCO_RADIOITEM80211_COUNTRY_STR1,CW_ITEM_NONE,MBAG_BSTR16}, - {CISCO_RADIOITEM80211_COUNTRY_STR2,CW_ITEM_NONE,MBAG_BSTR16}, - - {CW_ITEM_NONE} -}; diff --git a/src/mod/cisco/cisco_items.h b/src/mod/cisco/cisco_items.h deleted file mode 100644 index 9dd38af1..00000000 --- a/src/mod/cisco/cisco_items.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __CISCO_ITEMS_H -#define __CISCO_ITEMS_H - -extern const char CISCO_ITEM_AP_MODE_AND_TYPE[]; -extern const char CISCO_ITEM_AP_LED_STATE_CONFIG[]; -extern const char CISCO_ITEM_AP_LED_FLASH_CONFIG[]; -extern const char CISCO_ITEM_WTP_OPER_STATE[]; -extern const char CISCO_ITEM_WTP_ADMIN_STATE[]; - -extern struct cw_itemdef cisco_itemdefs[]; - -extern const char CISCO_RADIOITEM80211_CFG_TYPE[]; -extern const char CISCO_RADIOITEM80211_COUNTRY_STR1[]; -extern const char CISCO_RADIOITEM80211_COUNTRY_STR2[]; - -extern struct cw_itemdef cisco_radioitemdefs[]; - -#endif diff --git a/src/mod/cisco/cisco_out_ac_descriptor.c b/src/mod/cisco/cisco_out_ac_descriptor.c index 37f76692..f6e14b4d 100644 --- a/src/mod/cisco/cisco_out_ac_descriptor.c +++ b/src/mod/cisco/cisco_out_ac_descriptor.c @@ -19,8 +19,8 @@ #include "cw/log.h" #include "cw/conn.h" -#include "cw/mbag.h" -#include "cw/capwap_items.h" + + #include "cw/cw.h" extern mbag_t cisco_config; diff --git a/src/mod/cisco/cisco_out_telnet_ssh.c b/src/mod/cisco/cisco_out_telnet_ssh.c index 3b1b2a87..2e338bed 100644 --- a/src/mod/cisco/cisco_out_telnet_ssh.c +++ b/src/mod/cisco/cisco_out_telnet_ssh.c @@ -1,6 +1,6 @@ #include "cisco.h" -#include "cw/capwap_items.h" + #include "cw/lwapp.h" #include "cw/cw.h" @@ -10,7 +10,7 @@ #include "cw/capwap_cisco.h" -#include "include/cipwap_items.h" + diff --git a/src/mod/cisco/mod_cisco_ac.c b/src/mod/cisco/mod_cisco_ac.c index fbd14e1c..ce6ee378 100644 --- a/src/mod/cisco/mod_cisco_ac.c +++ b/src/mod/cisco/mod_cisco_ac.c @@ -5,45 +5,38 @@ #include "cw/log.h" #include "cw/dbg.h" -#include "cw/action.h" + /*#include "mod_cisco.h"*/ #include "../modload.h" #include "cw/vendors.h" -#include "cw/capwap_items.h" + extern int cisco_register_actions80211_ac(struct cw_actiondef *def); extern int cisco_register_actions_ac(struct cw_actiondef *def); -mbag_t cisco_config = NULL; +/*mbag_t cisco_config = NULL;*/ +static struct cw_Mod * capwap_mod = NULL; + static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode) { + cw_dbg(DBG_INFO,"CISCO: Register messages"); switch (mode) { case CW_MOD_MODE_CAPWAP: { - cw_dbg(DBG_MOD,"Cisco: loading base mod capwap"); + capwap_mod->register_messages(set, CW_MOD_MODE_CAPWAP); - struct cw_Mod *cmod = cw_mod_load("capwap"); - if (!cmod) { - cw_log(LOG_ERR, - "Can't initialize mod_cisco, failed to load base module mod_cipwap"); - return 1; - } - -\ - cmod->register_messages(set, CW_MOD_MODE_CAPWAP); - - cw_dbg(DBG_MOD,"Cisco: loading cisco message set"); + /* cw_dbg(DBG_MOD,"Cisco: loading cisco message set");*/ cisco_register_msg_set(set,CW_MOD_MODE_CAPWAP); - cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messages", 7); - return 0; +/* cw_dbg(DBG_INFO, "Initialized mod_cisco with %d messages", 7);*/ + break; } - case CW_MOD_MODE_BINDINGS: +/* case CW_MOD_MODE_BINDINGS: { return 0; struct cw_Mod *cmod = cw_mod_load("capwap80211"); //modload_ac("capwap80211"); @@ -57,11 +50,11 @@ static struct cw_MsgSet * register_messages(struct cw_MsgSet *set, int mode) cw_dbg(DBG_INFO, "Initialized mod_cisco 80211 with %d actions", 12); return 0; } - +*/ } - + cw_dbg(DBG_INFO,"CISCO: Done register messages"); return 0; @@ -76,22 +69,32 @@ static void errfunc(cfg_t *cfg, const char *fmt, va_list ap){ cw_log(LOG_ERR, "MOD Cisco cfg file in %s:", cfg->filename); } -static int init() +static int init(struct cw_Mod *mod, mavl_t global_cfg, int role) { + uint8_t * str; + static char * hardware_version; /*strdup(".x01000001");*/ + static char * software_version; /* = NULL; */ + cfg_t *cfg; + int rc = 1; - cw_dbg(DBG_INFO, "Initialiazing mod_cisco ..."); - cisco_config = mbag_create(); - - char * hardware_version = strdup(".x01000001"); - char * software_version = NULL; - cfg_opt_t opts[] = { CFG_SIMPLE_STR("hardware_version", &hardware_version), CFG_SIMPLE_STR("software_version",&software_version), CFG_END() }; - cfg_t *cfg; + cw_dbg(DBG_INFO, "CISCO: Initialiazing mod_cisco ..."); + cw_dbg(DBG_MOD, "CISCO: Loading base module: capwap"); + + capwap_mod = cw_mod_load("capwap",global_cfg,role); + if (capwap_mod == NULL){ + cw_log(LOG_ERR, "CISCO: failed to load base module 'capwap"); + } + + /*cisco_config = mbag_create();*/ + + +/* cfg = cfg_init(opts, CFGF_NONE); cfg_set_error_function(cfg, errfunc); @@ -105,8 +108,9 @@ static int init() goto errX; } } +*/ + - uint8_t * str; /* str = bstr_create_from_cfgstr(hardware_version); mbag_set_bstrv(cisco_config, CW_ITEM_AC_HARDWARE_VERSION, @@ -150,7 +154,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele if (id == CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD) { uint32_t vendor_id = cw_get_dword(cw_get_elem_data(elem)); if (vendor_id == CW_VENDOR_ID_CISCO) { - // conn->actions = &actions; +/* // conn->actions = &actions;*/ if (mode == CW_MOD_MODE_CAPWAP) { cw_dbg(DBG_MOD, "CISCO capwap detected: yes"); } else { @@ -174,6 +178,7 @@ static int detect(struct conn *conn, const uint8_t * rawmsg, int rawlen, int ele return 0; } +/* static struct cw_Mod capwap_ac = { .name = "cisco", .init = init, @@ -181,14 +186,24 @@ static struct cw_Mod capwap_ac = { // .register_actions = register_actions, .register_messages = register_messages }; +*/ -struct cw_Mod *mod_cisco_ac() -{ - return &capwap_ac; + +static struct cw_Mod cisco_data = { + "cisco", /* name */ + init, /* init */ + detect, /* detect */ + register_messages, /* register_messages */ + NULL, /* dll_handle */ + NULL /* data */ }; + + + + struct cw_Mod *mod_cisco() { - return &capwap_ac; -}; + return &cisco_data; +}