Alle join and status req messages elems are catched

shell
7u83 6 months ago
parent 301298dcdc
commit c422200a9a
  1. 18
      src/cw/message.c
  2. 1
      src/mod/cisco/capwap_cisco.h
  3. 140
      src/mod/cisco/cisco_actions.c
  4. 8
      src/mod/cisco/cisco_out_ac_descriptor.c
  5. 7
      src/mod/cisco/lwapp_cisco.h

@ -20,8 +20,8 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
handler = cw_msgset_get_elemhandler(params->msgset,data->proto,data->vendor,data->id);
params->elemdata = data;
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
if (handler==NULL){
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
cw_log(LOG_ERR,"Can't put message element %d %d %d, no handler defined.",
data->proto,data->vendor,data->id);
continue;
@ -29,6 +29,7 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
if (handler->put == NULL){
if (data->mand){
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
cw_log(LOG_ERR,"Error: Can't add mandatory message element %d - %s, no put method defined",
handler->id, handler->name);
@ -38,24 +39,21 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
if (!data->mand){
if (!cw_cfg_base_exists(params->cfg_list[0],handler->key)){
// cw_dbg(DBG_X,"nothing todo");
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s - (skip)",
data->proto, data->vendor, data->id, handler->name);
continue;
}
}
l = handler->put(handler,params,dst+len);
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s - (%d bytes)",
data->proto, data->vendor, data->id, handler->name,l);
/* if(l>0)
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
* if (strlen(details)){
cw_dbg(DBG_ELEM_DETAIL," %s",params.debug_details);
}
*/ len += l;
len += l;
}
return len;
}

@ -50,6 +50,7 @@
#define CW_CISCO_SUPPORTED_RATES LW_ELEM_80211_RATE_SET /* 16 */
#define CISCO_ELEM_15 15 /* 15 */
#define CISCO_ELEM_16 16 /* 16 */
#define CISCO_ELEM_19 19 /* 19 */
#define CISCO_ELEM_22 22 /* 22 */
#define CISCO_ELEM_24 24 /* 24 */

@ -531,6 +531,16 @@ static cw_ValStruct_t cisco_ap_mode_and_type[]={
{NULL,NULL,0,0}
};
static cw_ValStruct_t dtls_data_cfg[]={
{CW_TYPE_BOOL,"cabable",1,-1},
{CW_TYPE_BOOL,"enabled",1,-1},
{NULL,NULL,0,0}
};
/*
static cw_ValStruct_t cisco_add_wlan[]={
{CW_TYPE_BYTE,"radio-id",1,-1},
@ -1417,6 +1427,23 @@ static struct cw_ElemHandler handlers70[] = {
},
{
"Cisco Elem 16 ", /* name */
CISCO_ELEM_16, /* Element ID */
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/elem16", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic, /* put */
NULL,
NULL,
NULL,
},
{
"Cisco Elem 39", /* name */
CISCO_ELEM_39, /* Element ID */
@ -1499,6 +1526,75 @@ static struct cw_ElemHandler handlers70[] = {
cw_out_radio_generic /* put */
},
{
"Cisco LWAP Elem 11", /* name */
CISCO_LWELEM_11, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem11", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
},
{
"Cisco LWAP Elem 14", /* name */
CISCO_LWELEM_14, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem14", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
},
{
"Cisco LWAP Elem 27", /* name */
CISCO_LWELEM_27, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem27", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
},
{
"Cisco LWAP Elem 28", /* name */
CISCO_LWELEM_28, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem28", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
},
{
"Cisco LWAP Elem 29", /* name */
CISCO_LWELEM_29, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem29", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
},
{
"Cisco LWAP Elem 33", /* name */
@ -1525,6 +1621,20 @@ static struct cw_ElemHandler handlers70[] = {
cw_out_radio_generic /* put */
},
{
"Cisco LWAPP Elem 105", /* name */
CISCO_LWELEM_105, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/lwelem105", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
},
@ -1929,11 +2039,14 @@ static struct cw_ElemHandler handlers70[] = {
"AP DTLS Data CFG", /* name */
CISCO_LWELEM_AP_DTLS_DATA_CFG, /* Element ID */
CW_VENDOR_ID_CISCO, CW_PROTO_LWAPP, /* Vendor / Proto */
3, 3, /* min/max length */
CW_TYPE_BSTR16, /* type */
2, 2, /* min/max length */
CW_TYPE_STRUCT, /* type */
"cisco/ap-dtls-data-cfg", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
cw_out_generic, /* put */
NULL,
NULL,
dtls_data_cfg
}
,
{
@ -2029,6 +2142,7 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC,0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_16, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
@ -2043,8 +2157,14 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_153, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_156, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_11, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_14, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_27, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_28, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_29, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_33, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_48, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_105, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CAPWAP_TIMERS, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_DIRECT_SEQUENCE_CONTROL, 0, 0},
@ -2104,6 +2224,7 @@ static struct cw_ElemDef configuration_status_response_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_16, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
@ -2119,8 +2240,14 @@ static struct cw_ElemDef configuration_status_response_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_156, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_11, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_14, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_27, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_28, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_29, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_33, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_48, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_105, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CAPWAP_TIMERS, 0, 0},
@ -2159,6 +2286,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC,0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_16, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
@ -2173,8 +2301,14 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_153, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_156, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_11, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_14, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_27, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_28, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_29, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_33, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_48, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_105, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CAPWAP_TIMERS, 0, 0},

@ -55,7 +55,7 @@ static int put_ac_status(cw_Cfg_t * cfg1, cw_Cfg_t * cfg2, uint8_t *dst, const c
int cisco_out_ac_descriptor(struct cw_ElemHandler * eh,
struct cw_ElemHandlerParams * params, uint8_t * dst)
{
int len,l;
int len;
uint8_t *d = dst+4;
char key[CW_CFG_MAX_KEY_LEN];
@ -77,9 +77,9 @@ int cisco_out_ac_descriptor(struct cw_ElemHandler * eh,
len = d-dst-4;
l = len + cw_put_elem_hdr(dst,eh->id,len);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
return len + cw_put_elem_hdr(dst,eh->id,len);
// cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
return l;
// return l;
}

@ -29,10 +29,15 @@
*/
#define CISCO_LWELEM_9 9
#define CISCO_LWELEM_11 11
#define CISCO_LWELEM_14 14
#define CISCO_LWELEM_AP_USERNAME_PASSWORD 18
#define LW_CISCO_MANAGER_IP_ADDR 19
#define CISCO_LWELEM_DISCOVERY_PROTOCOL 20
#define CISCO_LWELEM_RADIO_MODULE_INFO 21
#define CISCO_LWELEM_27 27
#define CISCO_LWELEM_28 28
#define CISCO_LWELEM_29 29
#define CISCO_LWELEM_AC_IP_ADDR_WITH_INDEX 32
#define CISCO_LWELEM_33 33
#define CISCO_LWELEM_AP_ETHERNET_PORT_SUBTYPE 34
@ -54,6 +59,8 @@
#define LW_CISCO_PRIMED_JOIN_TIMEOUT 85
#define CISCO_LWELEM_AP_DTLS_DATA_CFG 74
#define CISCO_LWELEM_105 105
#define CISCO_LWELEM_RAD_EXTENDED_CONFIG 111
#define CISCO_LWELEM_ADD_WLAN 128
#define CISCO_LWELEM_AP_DNS_SERV_IP_ADD 121

Loading…
Cancel
Save