new debug functions - work on hex dump
FossilOrigin-Name: c76afdd26f14000b912fea5a052abf0338c8515871ae526fef727a828924d2e7
This commit is contained in:
@ -18,10 +18,6 @@ extern int capwap_register_actions_ac(struct cw_actiondef *def);
|
||||
static int init()
|
||||
{
|
||||
cw_dbg(DBG_MOD, "Initialiazing mod_capwap.");
|
||||
|
||||
test_sets();
|
||||
|
||||
exit(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -95,8 +95,8 @@ int cisco_out_80211_wtp_radio_cfg(struct conn *conn, struct cw_action_out *a, ui
|
||||
continue;
|
||||
}
|
||||
// l+=cw_put_elem_radio_info(dst+l,i->id,i->data);
|
||||
l+=cw_put_elem_cisco_radio_cfg(dst+l,i->iid,i->data);
|
||||
l+=cw_put_elem_cisco_ap_regulatory_domain(dst+l,i->iid,i->data,0);
|
||||
l+=cw_put_elem_cisco_radio_cfg(dst+l,i->u1.iid,i->u2.data);
|
||||
l+=cw_put_elem_cisco_ap_regulatory_domain(dst+l,i->u1.iid,i->u2.data,0);
|
||||
// l+=cw_put_elem_cisco_ap_regulatory_domain(dst+l,i->iid,i->data,1);
|
||||
// l+=cw_put_elem_cisco_ap_regulatory_domain(dst+l,i->iid,i->data,2);
|
||||
|
||||
@ -149,7 +149,7 @@ int cw_radio_cisco_set_state(struct conn * conn, uint8_t *data, int len, int cau
|
||||
MAVLITER_DEFINE(it,conn->radios);
|
||||
mavliter_foreach(&it){
|
||||
mbag_item_t *i = mavliter_get(&it);
|
||||
cw_radio_set_admin_state(conn->radios,i->iid,state,cause);
|
||||
cw_radio_set_admin_state(conn->radios,i->u1.iid,state,cause);
|
||||
|
||||
}
|
||||
return 1;
|
||||
|
@ -25,7 +25,7 @@ int cisco80211_in_wtp_radio_configuration(struct conn *conn, struct cw_action_in
|
||||
mbag_set_word(r,CIPWAP_RADIOITEM80211_CFP_MAXIMUM_DURATION,cw_get_word(data+5));
|
||||
|
||||
struct mbag_item * bssid = MBAG_DATA->get(data+7,6);
|
||||
bssid->id=CW_RADIOITEM80211_BSSID;
|
||||
bssid->u1.id=CW_RADIOITEM80211_BSSID;
|
||||
mbag_set(r,bssid);
|
||||
|
||||
mbag_set_word(r,CW_RADIOITEM80211_BEACON_PERIOD,cw_get_word(data+13));
|
||||
|
@ -25,12 +25,12 @@ cw_dbg(DBG_X,"The update beginns ***********************************************
|
||||
MAVLITER_DEFINE(it,conn->radios_upd);
|
||||
mavliter_foreach(&it){
|
||||
struct mbag_item *r = mavliter_get(&it);
|
||||
mbag_t radio_upd = r->data;
|
||||
mbag_t radio = mbag_i_get_mbag(conn->radios,r->iid,NULL);
|
||||
mbag_t radio_upd = r->u2.data;
|
||||
mbag_t radio = mbag_i_get_mbag(conn->radios,r->u1.iid,NULL);
|
||||
|
||||
radio = radio_upd;
|
||||
|
||||
d+=cw_put_byte(d,r->iid);
|
||||
d+=cw_put_byte(d,r->u1.iid);
|
||||
|
||||
// mbag_t radio = mbag_i_get(conn->radios,radio_upd->data->iid);
|
||||
|
||||
|
@ -40,40 +40,50 @@
|
||||
|
||||
#include "include/cipwap_items.h"
|
||||
|
||||
#include "cw/message_set.h"
|
||||
#include "cw/cw_types.h"
|
||||
|
||||
static struct cw_ElemHandler handlers[] = {
|
||||
|
||||
{
|
||||
"Discovery Type", /* name */
|
||||
CAPWAP_ELEM_DISCOVERY_TYPE, /* Element ID */
|
||||
0,0, /* Vendor / Proto */
|
||||
1,1, /* min/max length */
|
||||
CW_TYPE_BYTE, /* type */
|
||||
"discovery_type" /* Key */
|
||||
}
|
||||
,
|
||||
{
|
||||
"WTP Mac Type", /* name */
|
||||
CAPWAP_ELEM_WTP_MAC_TYPE, /* Element ID */
|
||||
0,0, /* Vendor / Proto */
|
||||
1,1, /* min/max length */
|
||||
CW_TYPE_BYTE, /* type */
|
||||
"wtp_mac_type" /* Key */
|
||||
}
|
||||
,
|
||||
{0,0,0,0,0,0,0,0}
|
||||
|
||||
/*
|
||||
static cw_elem_handler_t _DISCOVERY_TYPE = {
|
||||
.id = CAPWAP_ELEM_DISCOVERY_TYPE,
|
||||
.name = "WTP Frame Tunnel Mode",
|
||||
// .start = cw_in_generic2,
|
||||
// .item_id = CW_ITEM_WTP_FRAME_TUNNEL_MODE,
|
||||
.min_len = 1,
|
||||
.max_len = 1
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
static cw_msgdef_t messages[] = {
|
||||
static int discovery_request_states[] = {CAPWAP_STATE_DISCOVERY,0};
|
||||
static struct cw_ElemDef discovery_request_elements[] ={
|
||||
{0,0,CAPWAP_ELEM_DISCOVERY_TYPE, 1, 0},
|
||||
{0,0,0,00}
|
||||
|
||||
};
|
||||
|
||||
/* Discovery Request Message*/
|
||||
static struct cw_MsgDef messages[] = {
|
||||
{
|
||||
.name = "Discovery Request Cisco",
|
||||
.type = CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
|
||||
.elements = (cw_ElemDef_t []){
|
||||
{&_DISCOVERY_TYPE,1},
|
||||
{0,0},
|
||||
}
|
||||
},
|
||||
/* Discovery Request Response */
|
||||
{
|
||||
.name = "Discovery Response",
|
||||
.type = CAPWAP_MSG_DISCOVERY_RESPONSE,
|
||||
.states = (int[]){CAPWAP_STATE_DISCOVERY,0},
|
||||
.elements = (cw_ElemDef_t[]){
|
||||
{0,0},
|
||||
}
|
||||
"Discovery Request",
|
||||
CAPWAP_MSG_DISCOVERY_REQUEST,
|
||||
CW_RECEIVER_AC,
|
||||
discovery_request_states,
|
||||
discovery_request_elements
|
||||
},
|
||||
|
||||
{0,0,0,0}
|
||||
|
||||
|
||||
@ -94,9 +104,6 @@ static cw_msgdef_t messages[] = {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static cw_action_in_t actions_in[] = {
|
||||
|
||||
|
||||
@ -550,11 +557,14 @@ static cw_action_out_t actions_out[]={
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
struct cw_MsgSet * cisco_register_msg_set(struct cw_MsgSet * set, int mode){
|
||||
if (mode != CW_MOD_MODE_CAPWAP)
|
||||
return NULL;
|
||||
cw_msgset_add(set,messages);
|
||||
return set;
|
||||
if (mode != CW_MOD_MODE_CAPWAP)
|
||||
return NULL;
|
||||
cw_msgset_add(set,messages, handlers);
|
||||
return set;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "cw/mbag.h"
|
||||
#include "cw/item.h"
|
||||
#include "cisco_items.h"
|
||||
|
||||
|
@ -37,7 +37,7 @@ int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *
|
||||
return 0;
|
||||
}
|
||||
|
||||
d+=cw_put_ac_status(d ,(struct cw_ac_status*)(i->data),conn);
|
||||
d+=cw_put_ac_status(d ,(struct cw_ac_status*)(i->u2.data),conn);
|
||||
|
||||
|
||||
i = mbag_get(cisco_config,CW_ITEM_AC_SOFTWARE_VERSION);
|
||||
@ -49,7 +49,7 @@ int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *
|
||||
}
|
||||
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,1,i->data);
|
||||
d += cw_put_version(d,1,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't set Cisco Software Version in AC descriptor, No value defined.");
|
||||
@ -57,7 +57,7 @@ int cisco_out_ac_descriptor(struct conn *conn,struct cw_action_out * a,uint8_t *
|
||||
|
||||
i = mbag_get(cisco_config, CW_ITEM_AC_HARDWARE_VERSION);
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,0,i->data);
|
||||
d += cw_put_version(d,0,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't set Cisco Hardware Version in AC descriptor, No value defined.");
|
||||
|
@ -18,7 +18,7 @@ int cisco_out_radio_operational_state(struct conn *conn, struct cw_action_out *a
|
||||
continue;
|
||||
}
|
||||
|
||||
int state = mbag_get_word(i->data,CW_RADIOITEM_OPER_STATE,CW_RADIO_OPER_STATE_DISABLED<<8);
|
||||
int state = mbag_get_word(i->u2.data,CW_RADIOITEM_OPER_STATE,CW_RADIO_OPER_STATE_DISABLED<<8);
|
||||
int oper_state = (state >> 8) & 0xff;
|
||||
int oper_cause = state & 0xff;
|
||||
|
||||
@ -31,7 +31,7 @@ int cisco_out_radio_operational_state(struct conn *conn, struct cw_action_out *a
|
||||
cw_dbg(DBG_X,"Translated oper state for output from %d to %d",oper_state, oper_state_t);
|
||||
|
||||
l+=cw_put_elem_radio_operational_state(dst+l,255,oper_state_t, oper_cause);
|
||||
l+=cw_put_elem_radio_operational_state(dst+l,i->iid,oper_state_t, oper_cause);
|
||||
l+=cw_put_elem_radio_operational_state(dst+l,i->u1.iid,oper_state_t, oper_cause);
|
||||
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ int lw_cisco_put_telnet_ssh(struct conn *conn, uint8_t type,const char * item_id
|
||||
|
||||
if (item){
|
||||
if (item->type == MBAG_BYTE) {
|
||||
d+=lw_put_byte(d,item->byte);
|
||||
d+=lw_put_byte(d,item->u2.byte);
|
||||
d+=lw_put_byte(d,type);
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ mbag_t mbag = NULL;
|
||||
mbag_item_t * i;
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_HARDWARE_VERSION);
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_HARDWARE_VERSION,i->data);
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_HARDWARE_VERSION,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send Hardware Version in WTP Descriptor, not set.");
|
||||
@ -39,7 +39,7 @@ mbag_t mbag = NULL;
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_SOFTWARE_VERSION);
|
||||
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_SOFTWARE_VERSION,i->data);
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_SOFTWARE_VERSION,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send Software Version in WTP descriptor, not set.");
|
||||
@ -47,7 +47,7 @@ mbag_t mbag = NULL;
|
||||
|
||||
i = mbag_get(mbag,CW_ITEM_WTP_BOOTLOADER_VERSION);
|
||||
if ( i ) {
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_BOOTLOADER_VERSION,i->data);
|
||||
d += cw_put_version(d,CW_SUBELEM_WTP_BOOTLOADER_VERSION,i->u2.data);
|
||||
}
|
||||
else {
|
||||
cw_log(LOG_ERR, "Can't send Bootloader Version in WTP descriptor, not set.");
|
||||
|
Reference in New Issue
Block a user