FossilOrigin-Name: 71f629df1cccad394595950c2419a3523113d36cf07c39418a075b6601d89ad8
This commit is contained in:
7u83@mail.ru
2016-04-18 05:40:30 +00:00
parent a0ee1bc9be
commit cbd513792b
23 changed files with 207 additions and 78 deletions

View File

@ -172,7 +172,7 @@ static cw_action_in_t actions_in[] = {
.msg_id = CW_MSG_JOIN_REQUEST,
.elem_id = CW_ELEM_WTP_NAME,
.start = cw_in_generic2,
.item_id = "wtp_name",
.item_id = CW_ITEM_WTP_NAME,
.mand = 1,
.min_len = 1,
.max_len = 1024
@ -801,7 +801,7 @@ int capwap_register_actions_ac(struct cw_actiondef *def)
rc += cw_strheap_register_strings(def->strelem, capwap_strings_elem);
rc += cw_itemdefheap_register(def->items, capwap_itemdefs);
rc += cw_itemdefheap_register(def->radioitems, capwap_radiodefs);
rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs);
intavltree_add(def->wbids, 0);

View File

@ -313,6 +313,30 @@ static cw_action_in_t actions_in[] = {
}
,
/* ----------------------------------------------------------------
* Change State Event Response - IN Run State
*/
{
.capwap_state = CW_STATE_RUN,
.msg_id = CW_MSG_CHANGE_STATE_EVENT_RESPONSE,
.end = cw_in_check_cfg_update_req
}
,
{
.capwap_state = CW_STATE_RUN,
.msg_id = CW_MSG_CHANGE_STATE_EVENT_RESPONSE,
.elem_id = CW_ELEM_RESULT_CODE,
.item_id = CW_ITEM_RESULT_CODE,
.start = cw_in_generic2,
.min_len = 4,
.max_len = 4,
.mand = 1
}
,
@ -376,14 +400,15 @@ 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,
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
.item_id = CW_RADIOITEM_ADMIN_STATE,
.start = cw_in_radio_generic,
// .start = cw_in_radio_administrative_state,
.min_len=2,
.max_len=2,
.mand = 0
}
,
@ -583,7 +608,7 @@ static cw_action_out_t actions_out[] = {
* Configuration Status Request - Out
*/
/* AC Name - Config Status Request */
/* AC Name - Config Status Request - OUT */
{
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.elem_id = CW_ELEM_AC_NAME,
@ -594,7 +619,7 @@ static cw_action_out_t actions_out[] = {
}
,
/* Radio Admin State - Config Status Request */
/* Radio Admin State - Config Status Request - OUT */
{
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
@ -643,8 +668,9 @@ static cw_action_out_t actions_out[] = {
{
.msg_id = CW_MSG_CHANGE_STATE_EVENT_REQUEST,
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
// .item_id = CW_RADIO_OPERATIONAL_STATE,
.out = cw_out_radio_operational_states,
.item_id = CW_RADIOITEM_OPER_STATE,
// .out = cw_out_radio_operational_state,
.out = cw_out_radio_generic,
.mand = 1
}
,
@ -720,7 +746,7 @@ int capwap_register_actions_wtp(struct cw_actiondef *def)
rc += cw_strheap_register_strings(def->strelem, capwap_strings_elem);
rc += cw_itemdefheap_register(def->items,capwap_itemdefs);
// rc += cw_itemdefheap_register(def->radioitems,capwap_radioitemdefs);
rc += cw_itemdefheap_register(def->radioitems,capwap_radioitemdefs);
return rc;
}

View File

@ -25,7 +25,8 @@ OBJS=\
cisco_in_add_wlan.o \
cisco_out_wtp_administrative_state.o \
cisco_out_radio_operational_state.o \
cisco_in_radio_operational_state.o
cisco_in_radio_operational_state.o \
cisco_out_wtp_operational_state.o
# cisco_out_radio_administrative_state.o \

View File

@ -47,6 +47,7 @@ int cisco_in_add_wlan(struct conn *conn, struct cw_action_in *a, uint8_t * data,
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);

View File

@ -124,14 +124,32 @@ static cw_action_in_t actions_in[] = {
}
,
/* WTP Name - Conf Update Req */
{
.capwap_state = CW_STATE_RUN,
.vendor_id = CW_VENDOR_ID_CISCO,
.msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CW_CISCO_AP_GROUP_NAME,
.item_id = CIPWAP_ITEM_WTP_GROUP_NAME,
.start = cw_in_generic2,
.min_len = 0,
.max_len = 1024,
.mand = 0
}
,
/* Radio Admin State - Config Update Request */
{
.capwap_state = CW_STATE_RUN,
.msg_id = CW_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
.item_id = CW_RADIOITEM_ADMIN_STATE,
// .start = cisco_in_radio_administrative_state_wtp,
.start = cw_in_radio_generic,
.start = cisco_in_radio_administrative_state,
.min_len=2,
.max_len=2,
.mand = 0
}
,
@ -196,11 +214,12 @@ static cw_action_in_t actions_in[] = {
/* Radio Admin State - Config Status Response */
{
.capwap_state = CW_STATE_RUN,
.capwap_state = CW_STATE_CONFIGURE,
.msg_id = CW_MSG_CONFIGURATION_STATUS_RESPONSE,
.elem_id = CW_ELEM_RADIO_ADMINISTRATIVE_STATE,
.item_id = CW_RADIOITEM_ADMIN_STATE,
.start = cw_in_radio_generic,
// .start = cw_in_radio_generic,
.start = cisco_in_radio_administrative_state,
.mand = 1
}
,
@ -301,7 +320,7 @@ static cw_action_out_t actions_out[]={
.msg_id = CW_MSG_JOIN_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_AP_GROUP_NAME,
.item_id = CW_ITEM_WTP_GROUP_NAME,
.item_id = CIPWAP_ITEM_WTP_GROUP_NAME,
.out = cw_out_generic,
.get = cw_out_get_config,
.mand = 1
@ -347,6 +366,54 @@ static cw_action_out_t actions_out[]={
,
/* Cisco WTP Admin state - OUT */
{
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.item_id = CISCO_ITEM_WTP_ADMIN_STATE,
.out = cisco_out_wtp_administrative_state,
}
,
/* Cisco Admin state - 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_WTP_ADMIN_STATE,
.out = cisco_out_wtp_administrative_state,
// .get = cw_out_get_outgoming,
}
,
*/
/* Cisco WTP Operational state - OUT */
{
.msg_id = CW_MSG_CHANGE_STATE_EVENT_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
// .elem_id = CW_CISCO_AP_MODE_AND_TYPE,
.item_id = CISCO_ITEM_WTP_OPER_STATE,
.out = cisco_out_wtp_operational_state,
// .get = cw_out_get_outgoming,
}
,
/* Radio Operational State - OUT */
{
.msg_id = CW_MSG_CHANGE_STATE_EVENT_REQUEST,
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
.item_id = CW_RADIOITEM_OPER_STATE,
.out = cisco_out_radio_operational_state,
.mand = 1
}
,
@ -357,19 +424,35 @@ static cw_action_out_t actions_out[]={
static cw_action_in_t actions80211_in[] = {
/* Radio Operational State - Change State Event Req */
/* Radio Operational State - Status Resp */
{
.capwap_state = CW_STATE_CONFIGURE,
.msg_id= CW_MSG_CONFIGURATION_STATUS_RESPONSE,
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
.item_id = CW_RADIOITEM_OPER_STATE,
.start = cw_in_radio_generic, //operational_state,
// .start = cw_in_radio_generic, //operational_state,
.start = cisco_in_radio_operational_state, //operational_state,
.min_len=3,
.max_len=3,
.mand = 0
}
,
/* Radio Operational State - Update Req */
{
.capwap_state = CW_STATE_RUN,
.msg_id= CW_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CW_ELEM_RADIO_OPERATIONAL_STATE,
.item_id = CW_RADIOITEM_OPER_STATE,
// .start = cw_in_radio_generic, //operational_state,
.start = cisco_in_radio_operational_state, //operational_state,
.min_len=3,
.max_len=3,
.mand = 0
}
,
};

View File

@ -1,6 +1,7 @@
#include "cw/radio.h"
#include "cw/action.h"
#include "cw/cw.h"
#include "cw/dbg.h"
#include "cisco_items.h"
@ -8,6 +9,8 @@ int cisco_in_radio_administrative_state(struct conn *conn, struct cw_action_in *
struct sockaddr *from)
{
cw_dbg(DBG_X,"This is radio admin statie in for Cisco");
int rid = cw_get_byte(data);
if (rid != 255)
return cw_in_radio_generic(conn,a,data,len,from);

View File

@ -7,6 +7,8 @@
#include "cw/capwap_actions.h"
#include "cw/cw.h"
#include "cisco_items.h"
int cisco_in_radio_operational_state(struct conn *conn, struct cw_action_in *a, uint8_t * data,
int len, struct sockaddr *from)
{
@ -22,7 +24,12 @@ int cisco_in_radio_operational_state(struct conn *conn, struct cw_action_in *a,
if (state == CW_RADIO_OPER_STATE_DISABLED_7)
state_t = CW_RADIO_OPER_STATE_DISABLED;
cw_dbg(DBG_X,"Translated state to %d",state_t);
cw_dbg(DBG_X,"%d Translated state to %d",rid,state_t);
if (rid==255){
mbag_set_word(conn->incomming,CISCO_ITEM_WTP_OPER_STATE, (state_t<<8)|cause);
return 1;
}
mbag_t radio = mbag_i_get_mbag(conn->radios,rid,NULL);
@ -31,9 +38,15 @@ int cisco_in_radio_operational_state(struct conn *conn, struct cw_action_in *a,
return 0;
}
cw_dbg(DBG_X,"Radio settng to %d",state_t << 8);
mbag_set_word(radio,CW_RADIOITEM_OPER_STATE,(state_t<<8)|cause);
// mbag_set_word(radio,"hitler_status",911);
// mbag_set_word(radio,CW_RADIOITEM_OPER_STATE,912);
cw_dbg(DBG_X, "setting operstate %s",CW_RADIOITEM_OPER_STATE);
// mbag_set_word(radio,CW_RADIOITEM_ADMIN_STATE,66);
return 1;

View File

@ -12,6 +12,8 @@
#include "cw/vendors.h"
#include "include/cipwap_items.h"
extern int cisco_register_actions80211_wtp(struct cw_actiondef *def);
extern int cisco_register_actions_wtp(struct cw_actiondef *def);
@ -86,10 +88,10 @@ static int init()
static int init_config(mbag_t config)
{
bstr16_t gname = mbag_get_bstr16(config,CW_ITEM_WTP_GROUP_NAME,NULL);
bstr16_t gname = mbag_get_bstr16(config,CIPWAP_ITEM_WTP_GROUP_NAME,NULL);
if (!gname){
gname = bstr16_create_from_str("Entangled");
mbag_set_bstr16(config,CW_ITEM_WTP_GROUP_NAME,gname);
mbag_set_bstr16(config,CIPWAP_ITEM_WTP_GROUP_NAME,gname);
}