From a3f03ed4bd2d154a651447aa61826a1edff00bcb Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Mon, 11 Apr 2016 01:29:06 +0000 Subject: [PATCH] LED related elements and more added FossilOrigin-Name: 4f6584c130ed3dd1e78f1706a19aa68bfa6720201f79a120e30d0155bd357139 --- src/mod/cisco/Makefile | 3 +- src/mod/cisco/cisco.h | 3 ++ src/mod/cisco/cisco_actions_ac.c | 60 +++++++++++++++++++++++++++++++ src/mod/cisco/cisco_actions_wtp.c | 47 +++++++++++++++++++++++- src/mod/cisco/cisco_in_add_wlan.c | 18 +++++----- 5 files changed, 120 insertions(+), 11 deletions(-) diff --git a/src/mod/cisco/Makefile b/src/mod/cisco/Makefile index 1db2ec6f..fa1af1a2 100644 --- a/src/mod/cisco/Makefile +++ b/src/mod/cisco/Makefile @@ -22,7 +22,8 @@ OBJS=\ cisco80211_out_wtp_radio_configuration.o \ cisco_out_manager_ip_addr.o \ cisco_out_ac_ipv4_list.o \ - cisco_out_capwap_up.o + cisco_out_capwap_up.o \ + cisco_in_add_wlan.o diff --git a/src/mod/cisco/cisco.h b/src/mod/cisco/cisco.h index a6c8b3b0..5bb32bbe 100644 --- a/src/mod/cisco/cisco.h +++ b/src/mod/cisco/cisco.h @@ -43,5 +43,8 @@ int cisco80211_out_wtp_radio_configuration(struct conn *conn, struct cw_action_o 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); + #endif diff --git a/src/mod/cisco/cisco_actions_ac.c b/src/mod/cisco/cisco_actions_ac.c index e516a672..c03db497 100644 --- a/src/mod/cisco/cisco_actions_ac.c +++ b/src/mod/cisco/cisco_actions_ac.c @@ -188,6 +188,30 @@ static cw_action_in_t actions_in[] = { , + /* LED State Config */ + { + .capwap_state = CW_STATE_CONFIGURE, + .msg_id = CW_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_generic2 + + } + , + + /* LED Flash Config */ + { + .capwap_state = CW_STATE_CONFIGURE, + .msg_id = CW_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_generic2 + + } + , + { @@ -371,6 +395,42 @@ static cw_action_out_t actions_out[]={ } , + /* LED State Config - OUT */ + { + .msg_id = CW_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 = CW_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 = CW_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, + } + , + diff --git a/src/mod/cisco/cisco_actions_wtp.c b/src/mod/cisco/cisco_actions_wtp.c index 764c8e65..187af855 100644 --- a/src/mod/cisco/cisco_actions_wtp.c +++ b/src/mod/cisco/cisco_actions_wtp.c @@ -27,6 +27,7 @@ #include "cw/capwap80211.h" #include "cw/capwap80211_items.h" #include "cw/lwapp_cisco.h" +#include "cisco_items.h" #include "include/cipwap_items.h" @@ -123,7 +124,7 @@ static cw_action_in_t actions_in[] = { } , - /* Radio Admin State - Config Status Request */ + /* Radio Admin State - Config Update Request */ { .capwap_state = CW_STATE_RUN, .msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST, @@ -134,6 +135,34 @@ static cw_action_in_t actions_in[] = { } , + /* AP Mode and Type */ + { + + .capwap_state = CW_STATE_RUN, + .msg_id = CW_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, + .start = cw_in_generic2 + } + , + + /* Add WLAN */ + { + + .capwap_state = CW_STATE_RUN, + .msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST, + .vendor_id = CW_VENDOR_ID_CISCO, + .elem_id = CW_CISCO_ADD_WLAN, +// .item_id = CISCO_ITEM_ADD_WLAN, + .start = cisco_in_add_wlan + } + , + + + + + /* Element Cisco 802.11 Radio Config - Config Update Resp */ { .capwap_state = CW_STATE_RUN, @@ -293,6 +322,20 @@ static cw_action_out_t actions_out[]={ , + /* AP Mode and Type - Configuration Status Request OUT */ + { + .msg_id = CW_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, + .out = cw_out_generic, + .get = cw_out_get_config, + .mand = 1 + } + , + + + {0,0} @@ -395,6 +438,8 @@ int cisco_register_actions80211_wtp(struct cw_actiondef *def) 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); diff --git a/src/mod/cisco/cisco_in_add_wlan.c b/src/mod/cisco/cisco_in_add_wlan.c index 2a0a5fbb..72134bd5 100644 --- a/src/mod/cisco/cisco_in_add_wlan.c +++ b/src/mod/cisco/cisco_in_add_wlan.c @@ -1,12 +1,12 @@ -#include "action.h" -#include "dbg.h" -#include "log.h" -#include "mbag.h" -#include "cw.h" -#include "capwap_items.h" - +#include "cw/action.h" +#include "cw/dbg.h" +#include "cw/log.h" +#include "cw/mbag.h" +#include "cw/cw.h" +#include "cw/capwap_items.h" +#include "cisco_items.h" int cw_cisco_get_wlan_legacy(mbag_t wlan, uint8_t *data, int len) { @@ -108,7 +108,7 @@ int cw_cisco_get_wlan_(mbag_t wlan, uint8_t *data, int len) -int cw_in_cisco_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, +int cisco_in_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, struct sockaddr *from) { @@ -123,7 +123,7 @@ int cw_in_cisco_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * da mbag_set_byte(wlan,"radio_id",rid); - int mytype=mbag_get_byte(conn->config,CW_ITEM_AP_MODE_AND_TYPE,77) & 0xff; + int mytype=mbag_get_byte(conn->config,CISCO_ITEM_AP_MODE_AND_TYPE,77) & 0xff; printf("My type: %d\n",mytype); exit(0);