diff --git a/actube.workspace b/actube.workspace index c63c2d68..361145ca 100644 --- a/actube.workspace +++ b/actube.workspace @@ -4,9 +4,9 @@ - + - + diff --git a/libcw.project b/libcw.project index 9b14c05c..175b45f5 100644 --- a/libcw.project +++ b/libcw.project @@ -287,6 +287,8 @@ + + diff --git a/mod_cisco.project b/mod_cisco.project index 437054b6..11f583eb 100644 --- a/mod_cisco.project +++ b/mod_cisco.project @@ -44,6 +44,8 @@ + + @@ -60,7 +62,7 @@ - + @@ -131,6 +133,4 @@ - - diff --git a/src/cw/Makefile b/src/cw/Makefile index c9303187..6d73db87 100644 --- a/src/cw/Makefile +++ b/src/cw/Makefile @@ -130,6 +130,7 @@ KTVSRC=\ cw_ktv_read_struct.c\ cw_ktv_write_struct.c\ cw_ktv_std_types.c\ + cw_ktv_base_exists.c\ LWSRC=\ @@ -263,6 +264,7 @@ DTLSSRC+=\ RADIOSRC=\ cw_out_radio_generic.c\ + cw_out_radio_generic_struct.c\ cw_read_radio_generic.c\ diff --git a/src/cw/capwap.h b/src/cw/capwap.h index 57ed3b3a..1d15b5ac 100644 --- a/src/cw/capwap.h +++ b/src/cw/capwap.h @@ -217,10 +217,12 @@ #define CW_ELEM_RESERVED_9 9 #define CAPWAP_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS 10 #define CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS 11 +#define CAPWAP_ELEM_CAPWAP_TIMERS 12 + /**@}*/ #define CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS 30 #define CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS 50 -#define CW_ELEM_CAPWAP_TIMERS 12 + #define CW_ELEM_CAPWAP_TRANSPORT_PROTOCOL 51 /* not in draft 7 */ #define CW_ELEM_DATA_TRANSFER_DATA 13 #define CW_ELEM_DATA_TRANSFER_MODE 14 diff --git a/src/cw/capwap80211.h b/src/cw/capwap80211.h index b1a0ac92..f190534a 100644 --- a/src/cw/capwap80211.h +++ b/src/cw/capwap80211.h @@ -56,7 +56,7 @@ enum radioelems { /** IEEE 802.11 OFDM Control */ CW_ELEM80211_ODFM_CONTROL = 1033, /** IEEE 802.11 Supported WLAN Rates */ - CW_ELEM80211_RATE_SET = 1034, + CAPWAP80211_ELEM_RATE_SET = 1034, /** IEEE 802.11 RSNA Error Report From Station */ CW_ELEM80211_RSNA_ERROR_REPORT_FROM_STATION=1035, /** IEEE 802.11 Station */ diff --git a/src/cw/capwap_strings_elem.c b/src/cw/capwap_strings_elem.c index aa61b5f3..f7eeb0c9 100644 --- a/src/cw/capwap_strings_elem.c +++ b/src/cw/capwap_strings_elem.c @@ -17,7 +17,7 @@ struct cw_StrListElem capwap_strings_elem[] = { {CAPWAP_ELEM_CAPWAP_CONTROL_IPV6_ADDRESS, "Control IPv6 Address"}, {CAPWAP_ELEM_CAPWAP_LOCAL_IPV4_ADDRESS, "CAWPAP Local IPv4 Address"}, {CAPWAP_ELEM_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address"}, - {CW_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"}, + {CAPWAP_ELEM_CAPWAP_TIMERS, "CAPWAP Timers"}, {CW_ELEM_CAPWAP_TRANSPORT_PROTOCOL, "CAPWAP Transport Protocol"}, {CW_ELEM_DATA_TRANSFER_DATA, "Data Transfer Data"}, {CW_ELEM_DATA_TRANSFER_MODE, "Data Transfer Mode"}, diff --git a/src/cw/capwap_strings_elem80211.c b/src/cw/capwap_strings_elem80211.c index cb66ca14..5ec3e225 100644 --- a/src/cw/capwap_strings_elem80211.c +++ b/src/cw/capwap_strings_elem80211.c @@ -6,7 +6,7 @@ struct cw_StrListElem capwap_strings_elem80211[] = { {CW_ELEM80211_ADD_WLAN, "802.11 Add WLAN"}, {CW_ELEM80211_ANTENNA, "802.11 Antenna"}, - {CW_ELEM80211_RATE_SET, "802.11 Rate Set"}, + {CAPWAP80211_ELEM_RATE_SET, "802.11 Rate Set"}, {CW_ELEM80211_SUPPORTED_RATES,"802.11 Supported Rates"}, {CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, " 802.11 WTP Radio Information"}, diff --git a/src/cw/cw.h b/src/cw/cw.h index b2709467..426ba110 100644 --- a/src/cw/cw.h +++ b/src/cw/cw.h @@ -419,6 +419,9 @@ int cw_in_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHa int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params , uint8_t * dst); + +int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params + , uint8_t * dst); extern int cw_in_wtp_reboot_statistics(struct conn *conn, struct cw_action_in *a, uint8_t * data, int len, struct sockaddr *from); diff --git a/src/cw/cw_in_radio_generic_struct.c b/src/cw/cw_in_radio_generic_struct.c index d1131264..00dc25bf 100644 --- a/src/cw/cw_in_radio_generic_struct.c +++ b/src/cw/cw_in_radio_generic_struct.c @@ -17,7 +17,7 @@ int cw_in_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHa } radio = cw_get_byte(elem_data); - sprintf(key,"radio/%d/%s",radio,handler->key); + sprintf(key,"radio.%d/%s",radio,handler->key); cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data+1,elem_len-1); diff --git a/src/cw/cw_ktv_base_exists.c b/src/cw/cw_ktv_base_exists.c new file mode 100644 index 00000000..bd656acd --- /dev/null +++ b/src/cw/cw_ktv_base_exists.c @@ -0,0 +1,29 @@ +#include "ktv.h" +/** + * @file + * @description Implementation of cw_ktv_base_exisits + */ + + +/** + * @brief Check if elements with e certain baskey can be found in + * in ktvstore. + * @param ktvstore ktvstore to search in + * @param basekey basekey to search for + * @return The first ktv element belonging to the base eky, + * otherwise NULL if no element was found. + * + */ +cw_KTV_t * cw_ktv_base_exists(mavl_t ktvstore, const char *basekey) +{ + cw_KTV_t * result, search; + search.key=(char*)basekey; + result = mavl_get_first(ktvstore,&search); + if (result == NULL) + return NULL; + + if (strncmp(result->key,basekey,strlen(basekey))==0) + return result; + + return NULL; +} diff --git a/src/cw/cw_ktv_idx_get.c b/src/cw/cw_ktv_idx_get.c index c12f4dd0..673dd505 100644 --- a/src/cw/cw_ktv_idx_get.c +++ b/src/cw/cw_ktv_idx_get.c @@ -43,9 +43,6 @@ void * ktvn(struct mavl *t ,const void *search) } - - - int cw_ktv_idx_get(mavl_t ktv, const char *key) { char ikey[CW_KTV_MAX_KEY_LEN]; diff --git a/src/cw/cw_ktv_mavlcmp.c b/src/cw/cw_ktv_mavlcmp.c index 9f56c3c3..23e0063a 100644 --- a/src/cw/cw_ktv_mavlcmp.c +++ b/src/cw/cw_ktv_mavlcmp.c @@ -4,54 +4,64 @@ #include "ktv.h" /** * @brief Default function to compare two values of type #cw_KTV_t. - * + * * @param v1 * @param v2 - * @return + * @return */ -int cw_ktv_mavlcmp(const void *v1, const void *v2) +int cw_ktv_mavlcmp (const void *v1, const void *v2) { - char *d1,*d2; - int l1,l2,rc,i1,i2; + char *d1, *d2, *k1, *k2; + int l1, l2, rc, i1, i2; - /* Find dots in both keys */ - d1 = strchr(((cw_KTV_t *) v1)->key,'.'); - d2 = strchr(((cw_KTV_t *) v2)->key,'.'); + k1 = ( (cw_KTV_t *) v1)->key; + k2 = ( (cw_KTV_t *) v2)->key; - /* if there are no dots, compare keys as normal */ - if (d1==NULL || d2==NULL) - return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key); - - /* calculate the length of the key till dots */ - l1=d1-((cw_KTV_t *) v1)->key; - l2=d2-((cw_KTV_t *) v2)->key; - - /* if length differs do a normal compare */ - if (l1!=l2){ - return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key); - } - - - rc = strncmp(((cw_KTV_t *) v1)->key,((cw_KTV_t *) v2)->key,l1); - if (rc!=0){ - return rc; - } - - d1++; - d2++; - i1 = atoi(d1); - i2 = atoi(d2); - - rc = i1-i2; - if (rc != 0) - return rc; - - while (isdigit(*d1)) + while (1) { + /* Find dots in both keys */ + d1 = strchr (k1, '.'); + d2 = strchr (k2, '.'); + + /* if there are no dots, compare keys as normal */ + if (d1 == NULL || d2 == NULL) + return strcmp (k1, k2); + + + /* calculate the length of the key till dots */ + l1 = d1 - k1; /*((cw_KTV_t *) v1)->key;*/ + l2 = d2 - k2; /*((cw_KTV_t *) v2)->key;*/ + + /* if length differs do a normal compare */ + if (l1 != l2) { + return strcmp (k1, k2); /*((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);*/ + } + + + rc = strncmp (k1, k2, l1); /*((cw_KTV_t *) v1)->key,((cw_KTV_t *) v2)->key,l1);*/ + + if (rc != 0) { + return rc; + } + d1++; - while (isdigit(*d2)) d2++; - - return strcmp(d1,d2); - - + i1 = atoi (d1); + i2 = atoi (d2); + + rc = i1 - i2; + + if (rc != 0) + return rc; + + while (isdigit (*d1)) + d1++; + + while (isdigit (*d2)) + d2++; + + k1=d1; + k2=d2; + /*return strcmp(d1,d2);*/ + /*return cw_ktv_mavlcmp(d1,d2);*/ + } } diff --git a/src/cw/cw_out_radio_generic.c b/src/cw/cw_out_radio_generic.c index 4ef96ce8..b7a4a43f 100644 --- a/src/cw/cw_out_radio_generic.c +++ b/src/cw/cw_out_radio_generic.c @@ -11,7 +11,7 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0); - for(i=1;iconn,params->msgdata->type,handler,dst,l); len+=l; diff --git a/src/cw/cw_out_radio_generic_struct.c b/src/cw/cw_out_radio_generic_struct.c new file mode 100644 index 00000000..77bae4f0 --- /dev/null +++ b/src/cw/cw_out_radio_generic_struct.c @@ -0,0 +1,41 @@ + +#include "cw.h" +#include "dbg.h" + +int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params + , uint8_t * dst) +{ + int i,l, offset; + int radios; + uint8_t * cdst; + + cdst = dst; + + radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0); + + + offset = params->conn->header_len(handler); + for(i=0;ikey); + + result = cw_ktv_base_exists(params->conn->local_cfg,basekey); + if (result == NULL) + continue; + + + l=0; + l+=cw_put_byte(cdst+offset+l,i); + l+= cw_ktv_write_struct(params->conn->local_cfg,handler->type,basekey,cdst+offset+l); + + + cdst+=params->conn->write_header(handler,cdst,l); + + +/* l = cw_write_radio_element(handler,params,i,dst+len); + cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l); + len+=l;*/ + } + return cdst-dst; +} diff --git a/src/cw/cw_read_radio_generic.c b/src/cw/cw_read_radio_generic.c index 4801c38f..9c3cc708 100644 --- a/src/cw/cw_read_radio_generic.c +++ b/src/cw/cw_read_radio_generic.c @@ -19,7 +19,7 @@ int cw_in_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerPa } radio=cw_get_byte(elem_data); - sprintf(key,"radio/%d/%s",radio,handler->key); + sprintf(key,"radio.%d/%s",radio,handler->key); result = cw_ktv_add(params->conn->remote_cfg, key, handler->type, elem_data+1,elem_len-1); diff --git a/src/cw/cw_write_radio_element.c b/src/cw/cw_write_radio_element.c index 20ed9778..afa66af0 100644 --- a/src/cw/cw_write_radio_element.c +++ b/src/cw/cw_write_radio_element.c @@ -11,7 +11,7 @@ int cw_write_radio_element(struct cw_ElemHandler * handler, struct cw_ElemHandle len =0; - sprintf(key,"radio/%d/%s",idx,handler->key); + sprintf(key,"radio.%d/%s",idx,handler->key); /*printf("Looking for key: %s\n",key);*/ diff --git a/src/cw/ktv.h b/src/cw/ktv.h index 510b45d5..7d0045d6 100644 --- a/src/cw/ktv.h +++ b/src/cw/ktv.h @@ -39,6 +39,7 @@ struct cw_KTV { void *ptr; char *str; int boolean; + float float_val; } val; }; typedef struct cw_KTV cw_KTV_t; @@ -170,7 +171,7 @@ void * cw_ktv_get_sysptr(mavl_t ktv,const char *key, void * def); char * cw_ktv_get_str(mavl_t ktv,const char *key, char * def); int cw_ktv_idx_get(mavl_t ktv, const char *key); - +cw_KTV_t * cw_ktv_base_exists(mavl_t ktvstore, const char *basekey); extern const cw_Type_t * cw_ktv_std_types[]; #define CW_KTV_STD_TYPES cw_ktv_std_types diff --git a/src/mod/capwap/capwap_actions_ac.c b/src/mod/capwap/capwap_actions_ac.c index 9ee2018c..f009c2e5 100644 --- a/src/mod/capwap/capwap_actions_ac.c +++ b/src/mod/capwap/capwap_actions_ac.c @@ -39,6 +39,13 @@ static cw_KTVStruct_t wtp_reboot_statistics[] = { {NULL,NULL,0,0} }; +static cw_KTVStruct_t capwap_timers[] = { + + {CW_TYPE_BYTE, "max-discovery-interval", 1,-1}, + {CW_TYPE_BYTE, "echo-interval", 1,-1}, + {NULL,NULL,0,0} +}; + static struct cw_ElemHandler handlers[] = { { @@ -298,6 +305,20 @@ static struct cw_ElemHandler handlers[] = { } , + { + "CAPWAP Timers", /* name */ + CAPWAP_ELEM_CAPWAP_TIMERS, /* Element ID */ + 0, 0, /* Vendor / Proto */ + 2, 2, /* min/max length */ + capwap_timers, /* type */ + "capwap-timers", /* Key */ + cw_in_generic_struct, /* get */ + cw_out_generic_struct /* put */ + } + , + + + {0,0,0,0,0,0,0,0} }; @@ -376,6 +397,15 @@ static struct cw_ElemDef configuration_status_request_elements[] ={ {0,0,0,0,0} }; +static int configuration_status_response_states[] = {CAPWAP_STATE_JOIN,0}; +static struct cw_ElemDef configuration_status_response_elements[] ={ + {0,0,CAPWAP_ELEM_CAPWAP_TIMERS, 1, 0}, + {0,0,CAPWAP_ELEM_RADIO_ADMINISTRATIVE_STATE, 1, 0}, + + {0,0,CAPWAP_ELEM_VENDOR_SPECIFIC_PAYLOAD, 0, CW_IGNORE}, + {0,0,0,0,0} +}; + static struct cw_MsgDef messages[] = { { @@ -418,7 +448,14 @@ static struct cw_MsgDef messages[] = { configuration_status_request_elements /* msg elements */ }, - + { + "Configuration Status Response", /* name */ + CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, /* msg type */ + CW_ROLE_WTP, /* role */ + configuration_status_response_states, /* allowed states */ + configuration_status_response_elements /* msg elements */ + }, + /* { "Discovery Request", diff --git a/src/mod/capwap/capwap_actions_wtp.c b/src/mod/capwap/capwap_actions_wtp.c index 67cb20a9..fa167773 100644 --- a/src/mod/capwap/capwap_actions_wtp.c +++ b/src/mod/capwap/capwap_actions_wtp.c @@ -214,7 +214,7 @@ static cw_action_in_t actions_in[] = { { .capwap_state = CW_STATE_CONFIGURE, .msg_id = CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, - .elem_id = CW_ELEM_CAPWAP_TIMERS, + .elem_id = CAPWAP_ELEM_CAPWAP_TIMERS, .item_id = CW_ITEM_CAPWAP_TIMERS, .start = cw_in_generic2, .min_len = 2, diff --git a/src/mod/capwap80211/capwap80211_messages.c b/src/mod/capwap80211/capwap80211_messages.c index 2b9d821c..0de97af1 100644 --- a/src/mod/capwap80211/capwap80211_messages.c +++ b/src/mod/capwap80211/capwap80211_messages.c @@ -2,6 +2,7 @@ #include "cw/capwap.h" #include "cw/cw.h" #include "cw/dbg.h" +#include "cw/dot11.h" #include "cw/capwap80211.h" @@ -9,7 +10,9 @@ #include "mod_capwap80211.h" - +static int capwap80211_in_crate_set(struct cw_ElemHandler *eh, + struct cw_ElemHandlerParams *params, + uint8_t * data, int len); static struct cw_ElemHandler handlers[] = { { @@ -23,6 +26,17 @@ static struct cw_ElemHandler handlers[] = { cw_out_radio_generic /* put */ } , + { + "IEEE 802.11 Rate Set", /* name */ + CAPWAP80211_ELEM_RATE_SET, /* Element ID */ + 0, 0, /* Vendor / Proto */ + 3, 0, /* min/max length */ + NULL, /* type */ + "rate_set", /* Key */ + capwap80211_in_crate_set, /* get */ + NULL /* put */ + } + , {NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL} @@ -45,35 +59,48 @@ static struct cw_ElemDef join_request_elements[] = { static int join_response_states[] = { CAPWAP_STATE_JOIN, 0 }; static struct cw_ElemDef join_response_elements[] = { - {0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, + {0, 0, CAPWAP80211_ELEM_WTP_RADIO_INFORMATION, 1, 0}, {0, 0, 0, 0, 0} }; +static int configuration_status_response_states[] = { CAPWAP_STATE_JOIN, 0 }; +static struct cw_ElemDef configuration_status_response_elements[] = { + {0, 0, CAPWAP80211_ELEM_RATE_SET , 1, 0}, + {0, 0, 0, 0, 0} +}; static struct cw_MsgDef messages[] = { { - NULL, - CAPWAP_MSG_DISCOVERY_REQUEST, - CW_ROLE_AC, - discovery_request_states, - discovery_request_elements + NULL, + CAPWAP_MSG_DISCOVERY_REQUEST, + CW_ROLE_AC, + discovery_request_states, + discovery_request_elements } , { - NULL, - CAPWAP_MSG_JOIN_REQUEST, - CW_ROLE_AC, - join_request_states, - join_request_elements + NULL, + CAPWAP_MSG_JOIN_REQUEST, + CW_ROLE_AC, + join_request_states, + join_request_elements } , { - NULL, - CAPWAP_MSG_JOIN_RESPONSE, - CW_ROLE_AC, - join_response_states, - join_response_elements + NULL, + CAPWAP_MSG_JOIN_RESPONSE, + CW_ROLE_AC, + join_response_states, + join_response_elements + } + , + { + NULL, + CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, + CW_ROLE_WTP, + configuration_status_response_states, + configuration_status_response_elements } , {0, 0, 0, 0, 0} @@ -92,3 +119,21 @@ int mode; return set; } + + + +static int capwap80211_in_crate_set(struct cw_ElemHandler *eh, + struct cw_ElemHandlerParams *params, + uint8_t * data, int len) +{ + int radio; + int i; + radio = cw_get_byte(data); + for (i=0; iconn->remote_cfg,type,key,data,len); - - return 1; } +int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh, + struct cw_ElemHandlerParams * params, uint8_t * dst) +{ + char key[CW_KTV_MAX_KEY_LEN]; + char testkey[CW_KTV_MAX_KEY_LEN]; + int idx; + void * type; + cw_KTV_t * result, search; + int len,start; + uint8_t * ob; + + + idx = 0; + ob = dst; + + do { + sprintf(key,"%s.%d",eh->key,idx); + search.key=key; + result = mavl_get_first(params->conn->local_cfg,&search); + if (result==NULL) + break; + if (strncmp(result->key,key,strlen(key))!=0) + break; + + sprintf(testkey,"%s/%s",key,"band-id"); + result = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_BYTE); + if (result==NULL){ + type = cisco_ap_regulatory_domain4; + } + else{ + type = cisco_ap_regulatory_domain5; + } + + start = params->conn->header_len(eh); + len = cw_ktv_write_struct(params->conn->local_cfg,type,key,ob+start); + ob += params->conn->write_header(eh,ob,len); + + idx++; + + }while(1); + + + sprintf(key,"%s.%d",eh->key,idx+1); +/* if(len==4) + type = cisco_ap_regulatory_domain4; + if(len==5) + type = cisco_ap_regulatory_domain5; + cw_ktv_read_struct(params->conn->remote_cfg,type,key,data,len); +*/ + return ob-dst; +} + +static cw_KTVStruct_t cisco_ap_model[]={ + {CW_TYPE_STR,"model",30,-1}, + {CW_TYPE_STR,"image",30,30}, + {NULL,NULL,0,0} +}; + +static cw_KTVStruct_t cisco_wtp_radio_config[]={ + {CW_TYPE_BYTE,"cfg-type",1,-1}, + {CW_TYPE_WORD,"occupancy-limit",2,-1}, + {CW_TYPE_BYTE,"cfg-period",1,-1}, + {CW_TYPE_WORD,"cfp-maximum-duration",2,-1}, + {CW_TYPE_BSTR16,"bss-id",6,-1}, + {CW_TYPE_WORD,"beacon-period",2,-1}, + {CW_TYPE_BSTR16,"country-str1",3,-1}, + {CW_TYPE_BSTR16,"country-str2",3,-1}, + {CW_TYPE_BYTE,"gpr-period",1,-1}, + {CW_TYPE_DWORD,"reg",4,-1}, + {CW_TYPE_BYTE,"max-stations",1,-1}, + {NULL,NULL,0,0} +}; static struct cw_ElemHandler handlers[] = { @@ -376,7 +446,7 @@ static struct cw_ElemHandler handlers[] = { } , { - "AP LED State COnfig", /* name */ + "AP LED State Config", /* name */ CISCO_ELEM_AP_LED_STATE_CONFIG, /* Element ID */ CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */ 2,2, /* min/max length */ @@ -491,8 +561,8 @@ static struct cw_ElemHandler handlers[] = { 17,17, /* min/max length */ cisco_ap_static_ip_addr, /* type */ "cisco/ap-satic-ip-addr", /* Key */ - cw_in_generic_struct, /* get */ - cw_out_generic_struct /* put */ + cw_in_generic_struct, /* get */ + cw_out_generic_struct /* put */ }, { @@ -534,12 +604,48 @@ static struct cw_ElemHandler handlers[] = { "AP Regulatory Domain", /* name */ CISCO_ELEM_AP_REGULATORY_DOMAIN, /* Element ID */ CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */ - 5,5, /* min/max length */ + 4,5, /* min/max length */ cisco_ap_regulatory_domain4, /* type */ "cisco/ap-regulatory-domain", /* Key */ cisco_in_ap_regulatory_domain, /* get */ - NULL /*cw_out_idx_generic_struct*/ /* put */ + cisco_out_ap_regulatory_domain /* put */ }, + + { + "AP Model", /* name */ + CISCO_ELEM_AP_MODEL, /* Element ID */ + CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */ + 60,60, /* min/max length */ + cisco_ap_model, /* type */ + "cisco/ap-model", /* Key */ + cw_in_generic_struct, /* get */ + cw_out_generic_struct, /* put */ + }, + + { + "Reset Button State", /* name */ + CISCO_ELEM_RESET_BUTTON_STATE, /* Element ID */ + CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */ + 1,1, /* min/max length */ + CW_TYPE_BOOL, /* type */ + "cisco/reset-button-state", /* Key */ + cw_in_generic, /* get */ + cw_out_generic /* put */ + }, + + { + "WTP Radio Configuration", /* name */ + CISCO_ELEM_WTP_RADIO_CONFIGURATION, /* Element ID */ + CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */ + 27,27, /* min/max length */ + cisco_wtp_radio_config, /* type */ + "cisco/wtp-radio-config", /* Key */ + cw_in_radio_generic_struct, /* get */ + cw_out_radio_generic_struct /* put */ + } + , + + {0,0,0,0,0,0,0,0} @@ -616,6 +722,9 @@ static struct cw_ElemDef configuration_status_request_elements[] ={ {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_MIN_IOS_VERSION, 0, 0}, {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_BACKUP_SOFTWARE_VERSION, 0, 0}, {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_REGULATORY_DOMAIN, 1, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_MODEL, 1, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_RESET_BUTTON_STATE, 1, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_WTP_RADIO_CONFIGURATION, 1, 0}, {CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_USERNAME_PASSWORD, 1, 0}, {CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_LOGHOST_CONFIG, 1, 0}, @@ -627,6 +736,17 @@ static struct cw_ElemDef configuration_status_request_elements[] ={ }; +static int configuration_status_response_states[] = {CAPWAP_STATE_JOIN,0}; +static struct cw_ElemDef configuration_status_response_elements[] ={ + {0,CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC,1, CW_IGNORE}, + + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MULTI_DOMAIN_CAPABILITY, 0, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_WTP_RADIO_CONFIGURATION, 1, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_LED_STATE_CONFIG, 0, 0}, + {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_LOG_FACILITY, 0, 0}, + + {0,0,0,0} +}; static struct cw_MsgDef messages[] = { { @@ -671,6 +791,16 @@ static struct cw_MsgDef messages[] = { NULL /* postprocess */ }, + { + NULL, /* name */ + CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE, /* type */ + CW_ROLE_WTP, + configuration_status_response_states, + configuration_status_response_elements, + NULL /* postprocess */ + }, + + {0,0,0,0} }; @@ -711,4 +841,4 @@ static int postprocess_discovery(struct conn *conn) set_ac_version(conn); cw_detect_nat(conn); return 1; -} \ No newline at end of file +} diff --git a/src/wtp/cisco.ktv b/src/wtp/cisco.ktv index ac452ca7..04c303b0 100644 --- a/src/wtp/cisco.ktv +++ b/src/wtp/cisco.ktv @@ -61,14 +61,14 @@ radio/0/cisco/regulatory-domain/set :Bool: true radio/0/cisco/regulatory-domain/slot :Byte: 0 -cisco/regulatory-domain/000/code0 :Byte: 0 -cisco/regulatory-domain/000/code1 :Byte: 1 -cisco/regulatory-domain/000/set :Bool: true -cisco/regulatory-domain/000/slot :Byte: 0 -cisco/regulatory-domain/001/code0 :Byte: 0 -cisco/regulatory-domain/001/code1 :Byte: 1 -cisco/regulatory-domain/001/set :Bool: true -cisco/regulatory-domain/001/slot :Byte: 1 +cisco/ap-regulatory-domain.0/code0 :Byte: 0 +cisco/ap-regulatory-domain.0/code1 :Byte: 1 +cisco/ap-regulatory-domain.0/set :Bool: true +cisco/ap-regulatory-domain.0/slot :Byte: 0 +cisco/ap-regulatory-domain.1/code0 :Byte: 0 +cisco/ap-regulatory-domain.1/code1 :Byte: 1 +cisco/ap-regulatory-domain.1/set :Bool: true +cisco/ap-regulatory-domain.1/slot :Byte: 1 tube.0/main : Byte : 12 @@ -76,3 +76,40 @@ tube.0/zumsel : Byte : 12 tube.1/main : Byte : 12 tube.1/zumsel : Byte : 12 + +ac-name-with-priority/TubesAC:Byte:3 +ac-name-with-priority/"ac2":Byte:05 + +radio.0/cisco-multi-domain-capability/first-channel :Word: 1 +radio.0/cisco-multi-domain-capability/max-tx-power-level :Word: 65535 +radio.0/cisco-multi-domain-capability/number-of-channels :Word: 13 +radio.0/cisco-multi-domain-capability/reserved :Byte: 1 +radio.0/cisco/wtp-radio-config/beacon-period :Word: 0 +radio.0/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90 +radio.0/cisco/wtp-radio-config/cfg-period :Byte: 0 +radio.0/cisco/wtp-radio-config/cfg-type :Byte: 1 +radio.0/cisco/wtp-radio-config/cfp-maximum-duration :Word: 0 +radio.0/cisco/wtp-radio-config/country-str1 :Bstr16: "DE " +radio.0/cisco/wtp-radio-config/country-str2 :Bstr16: "DE " +radio.0/cisco/wtp-radio-config/gpr-period :Byte: 0 +radio.0/cisco/wtp-radio-config/max-stations :Byte: 0 +radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 0 +radio.0/cisco/wtp-radio-config/reg :Dword: 65536 +radio.1/cisco-multi-domain-capability/first-channel :Word: 36 +radio.1/cisco-multi-domain-capability/max-tx-power-level :Word: 65535 +radio.1/cisco-multi-domain-capability/number-of-channels :Word: 16 +radio.1/cisco-multi-domain-capability/reserved :Byte: 1 +radio.1/cisco/wtp-radio-config/beacon-period :Word: 0 +radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90 +radio.1/cisco/wtp-radio-config/cfg-period :Byte: 0 +radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1 +radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 0 +radio.1/cisco/wtp-radio-config/country-str1 :Bstr16: DE +radio.1/cisco/wtp-radio-config/country-str2 :Bstr16: DE +radio.1/cisco/wtp-radio-config/gpr-period :Byte: 0 +radio.1/cisco/wtp-radio-config/max-stations :Byte: 0 +radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 0 +radio.1/cisco/wtp-radio-config/reg :Dword: 65536 + +radio.0/wtp-radio-information :Dword: 1 +radio.1/wtp-radio-information :Dword: 2 diff --git a/src/wtp/wtp_main.c b/src/wtp/wtp_main.c index aeafb9d6..c9e45538 100644 --- a/src/wtp/wtp_main.c +++ b/src/wtp/wtp_main.c @@ -172,6 +172,7 @@ int main (int argc, char **argv) if (mod->setup_cfg) mod->setup_cfg(conn); } +/* { int idx; cw_dbg_ktv_dump(conn->local_cfg,DBG_INFO,"head","BREP: ","bot"); @@ -180,6 +181,7 @@ printf("IDX: %d\n",idx); exit(0); } + */ dtls_init(); conn->base_rmac = get_base_rmac(); diff --git a/wtp.project b/wtp.project index 21769f55..d5f197eb 100644 --- a/wtp.project +++ b/wtp.project @@ -50,7 +50,7 @@ - +