Configuration Request and Reponse

FossilOrigin-Name: 7ee0e857269b188cb3b1b720d5f9ea4be45c211ea8ccccb7abadcb74587b3870
This commit is contained in:
7u83@mail.ru 2018-04-17 05:46:09 +00:00
parent 7968096687
commit 36905beefd
26 changed files with 438 additions and 99 deletions

View File

@ -4,9 +4,9 @@
<Project Name="wtp" Path="wtp.project" Active="No"/>
<Project Name="mod_cipwap" Path="mod_cipwap.project" Active="No"/>
<Project Name="mod_capwap" Path="mod_capwap.project" Active="No"/>
<Project Name="mod_cisco" Path="mod_cisco.project" Active="Yes"/>
<Project Name="mod_cisco" Path="mod_cisco.project" Active="No"/>
<Project Name="libcw" Path="libcw.project" Active="No"/>
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="No"/>
<Project Name="mod_capwap80211" Path="mod_capwap80211.project" Active="Yes"/>
<Project Name="mod_fortinet" Path="mod_fortinet.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Debug" Selected="yes">

View File

@ -287,6 +287,8 @@
<File Name="src/cw/cw_in_idx_generic.c"/>
<File Name="src/cw/cw_in_idx_generic_struct.c"/>
<File Name="src/cw/cw_out_idx_generic_struct.c"/>
<File Name="src/cw/cw_out_radio_generic_struct.c"/>
<File Name="src/cw/cw_ktv_base_exists.c"/>
</VirtualDirectory>
</VirtualDirectory>
<Description/>

View File

@ -44,6 +44,8 @@
</VirtualDirectory>
<Description/>
<Dependencies/>
<Dependencies Name="Debug"/>
<Dependencies Name="Release"/>
<Settings Type="Dynamic Library">
<GlobalSettings>
<Compiler Options="" C_Options="" Assembler="">
@ -60,7 +62,7 @@
</Compiler>
<Linker Options="" Required="yes"/>
<ResourceCompiler Options="" Required="no"/>
<General OutputFile="" IntermediateDirectory="./Debug" Command="" CommandArguments="" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(IntermediateDirectory)" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
<General OutputFile="" IntermediateDirectory="./Debug" Command="$(WorkspacePath)/src/wtp/wtp" CommandArguments="-dall -mcisco -ccisco.ktv" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(WorkspacePath)/src/wtp/" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
<![CDATA[]]>
</Environment>
@ -131,6 +133,4 @@
</Completion>
</Configuration>
</Settings>
<Dependencies Name="Debug"/>
<Dependencies Name="Release"/>
</CodeLite_Project>

View File

@ -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\

View File

@ -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

View File

@ -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 */

View File

@ -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"},

View File

@ -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"},

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -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];

View File

@ -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);*/
}
}

View File

@ -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;i<radios+1;i++){
for(i=0;i<radios;i++){
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;

View File

@ -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;i<radios;i++){
char basekey[CW_KTV_MAX_KEY_LEN];
cw_KTV_t * result;
sprintf(basekey,"radio.%d/%s",i,handler->key);
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;
}

View File

@ -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);

View File

@ -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);*/

View File

@ -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

View File

@ -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",

View File

@ -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,

View File

@ -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; i<len-1; i++){
int rate = (data+1)[i];
}
}

View File

@ -37,7 +37,7 @@
#define CW_CISCO_RAD_NAME LWAPP_ELEM_WTP_NAME /* 5 */
#define CW_CISCO_MWAR LW_ELEM_AC_DESCRIPTOR /* 6 */
#define CW_CISCO_ADD_WLAN LW_ELEM_80211_ADD_WLAN /* 7 */
#define CW_CISCO_WTP_RADIO_CFG 8
#define CISCO_ELEM_WTP_RADIO_CONFIGURATION 8
#define CISCO_ELEM_MULTI_DOMAIN_CAPABILITY LW_ELEM_80211_MULTI_DOMAIN_CAPABILITY /* 10 */
#define CISCO_ELEM_MAC_OPERATION LW_ELEM_80211_MAC_OPERATION /* 11 */
@ -79,10 +79,11 @@
#define CISCO_ELEM_AP_GROUP_NAME 123
#define CISCO_ELEM_AP_LED_STATE_CONFIG 125
#define CW_CISCO_AP_MODEL 127
#define CW_CISCO_AP_RESET_BUTTON_STATE 128
#define CISCO_ELEM_AP_REGULATORY_DOMAIN 126
#define CISCO_ELEM_AP_MODEL 127
#define CISCO_ELEM_RESET_BUTTON_STATE 128
#define CW_CISCO_LWAPP_CHANNEL_POWER 134
#define CW_CISCO_AP_CORE_DUMP 135

View File

@ -157,14 +157,84 @@ int cisco_in_ap_regulatory_domain(struct cw_ElemHandler *eh,
if(len==5)
type = cisco_ap_regulatory_domain5;
cw_ktv_read_struct(params->conn->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;
}
}

View File

@ -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

View File

@ -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();

View File

@ -50,7 +50,7 @@
</Compiler>
<Linker Options="" Required="yes"/>
<ResourceCompiler Options="" Required="no"/>
<General OutputFile="" IntermediateDirectory="./Debug" Command="$(WorkspacePath)/src/wtp/wtp" CommandArguments="-dall -mcisco -ctest.ktv" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(WorkspacePath)/src/wtp/" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
<General OutputFile="" IntermediateDirectory="./Debug" Command="$(WorkspacePath)/src/wtp/wtp" CommandArguments="-dall -mcisco -ccisco.ktv" UseSeparateDebugArgs="no" DebugArguments="" WorkingDirectory="$(WorkspacePath)/src/wtp/" PauseExecWhenProcTerminates="yes" IsGUIProgram="no" IsEnabled="yes"/>
<Environment EnvVarSetName="&lt;Use Defaults&gt;" DbgSetName="&lt;Use Defaults&gt;">
<![CDATA[LD_LIBRARY_PATH=../../lib]]>
</Environment>