Fixed some bugs, added more Cisco elements

Almost able to create a WLAN
This commit is contained in:
7u83 2022-08-30 08:52:18 +02:00
parent 2b055175c7
commit 89e7e61e1d
17 changed files with 260 additions and 395 deletions

View File

@ -31,8 +31,12 @@ INCL_DIRS=-I../ -I/usr/local/include -I./ -I../../include
#FLAGS=-DWITH_IPV6 -DWITH_OPENSSL -DSYS_ARCH="$(ARCH)" -DSYS_ARCH="XXX"
FLAGS=-DWITH_IPV6 -DUSE_OPENSSL -DSYS_ARCH='"$(KERNEL)/$(ARCH)"'
all: act actube
act: act.c
$(CC) act.c $(INCL_DIRS) $(LIBPATH) -DSYS_ARCH='"$(KERNEL)/$(ARCH)"' -o act -l:libcw.a -lasan -lcrypto -ledit
.c.o:
@echo " $(CC) "$<
@ -43,8 +47,8 @@ all: $(PRG) $(ACTPRG)
$(PRG): $(OBJS)
$(CC) $(OBJS) -o $(PRG) $(LIBPATH) $(LDFLAGS) $(LIBS)
$(ACTPRG): $(ACTOBJS)
$(CC) $(ACTOBJS) -o $(ACTPRG) $(LIBPATH) $(LIBS) -ledit
#$(ACTPRG): $(ACTOBJS)
# $(CC) $(ACTOBJS) -o $(ACTPRG) $(LIBPATH) $(LIBS) -ledit
#$(CC) $(ACTOBJS) $(ACTPRG) $(LIBPATH) $(LDFLAGS) $(LIBS) -ledit

View File

@ -17,7 +17,8 @@ capwap/ssl-certfile: "../../ssl/intermediate-ca/int-ca.crt"
cisco/ssl-keyfile: "../../ssl/intermediate-ca/int-ca.key"
cisco/ssl-certfile: "../../ssl/intermediate-ca/int-ca.crt"
cisco/ssl-cipher: DEFAULT
#cisco/ssl-cipher: DEFAULT
cisco/ssl-cipher: RSA
cisco/ssl-dhbits: 2048

View File

@ -445,6 +445,32 @@ static int join_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, in
return 0;
}
static int fill_update_cfg(struct cw_Conn * conn)
{
struct cw_Cfg_iter cfi;
struct cw_Cfg_entry *e;
cw_Cfg_t * u;
u=cw_cfg_create();
if( cw_cfg_load("status_response.ckv",u)){
cw_log(LOG_ERR,"Cant load file");
stop();
};
cw_cfg_dump(conn->remote_cfg);
cw_cfg_iter_init(u, &cfi, NULL);
while ((e = cw_cfg_iter_next(&cfi, NULL))!=NULL){
const char * r;
r = cw_cfg_get(conn->remote_cfg, e->key, "[]");
// cw_dbg(DBG_CFG_UPDATES,"check: %s: %s",e->key,e->val);
if (strcmp(r,e->val)==0)
continue;
cw_dbg(DBG_CFG_UPDATES,"Status reps: %s: %s -> %s",e->key,r,e->val);
}
return 0;
}
static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
{
struct cw_Conn * conn = (struct cw_Conn*)params->conn;
@ -454,6 +480,7 @@ static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr,
cw_dbg(DBG_X,"UPDATE Callback");
copy(params);
fill_update_cfg(params->conn);
const char * wtpname = cw_cfg_get(conn->remote_cfg,"capwap/wtp-name","default");
sprintf(filename,"wtp-status-%s.ckv",wtpname);

View File

@ -584,7 +584,12 @@ void cw_cfg_iter_init(cw_Cfg_t * cfg, struct cw_Cfg_iter *cfi, const char *base)
search.key = base;
mavliter_init(&(cfi->it), cfg->cfg);
mavliter_seek(&(cfi->it), &search, 0);
if (base == NULL){
mavliter_seek_set(&(cfi->it));
mavliter_next(&(cfi->it));
}
else
mavliter_seek(&(cfi->it), &search, 0);
cfi->base = base;
}
@ -594,12 +599,12 @@ struct cw_Cfg_entry *cw_cfg_iter_next(struct cw_Cfg_iter *cfi, const char *nnkey
struct cw_Cfg_entry *e;
int bl, kl;
const char *d;
e = mavliter_get(&(cfi->it));
if (e == NULL){
return NULL;
}
if (cfi->base ==NULL)
goto eeX;
bl = strlen(cfi->base);
kl = strlen(e->key);
@ -623,7 +628,7 @@ struct cw_Cfg_entry *cw_cfg_iter_next(struct cw_Cfg_iter *cfi, const char *nnkey
if (strncmp(cfi->base, e->key, bl) != 0)
return NULL;
eeX:
mavliter_next(&(cfi->it));
return e;
}
@ -739,25 +744,25 @@ int cw_cfg_get_first_index(cw_Cfg_t * cfg, const char *key, int n)
char ikey[CW_CFG_MAX_KEY_LEN];
struct cw_Cfg_entry search, * result;
char *d;
int l;
sprintf(ikey,"%s.%d",key,n);
search.key=ikey;
result = mavl_get_first(cfg->cfg,&search);
if (result == NULL){
return -1;
}
d = strrchr(result->key,'.');
d = strrchr(ikey,'.');
if (d==NULL){
return -1;
}
if (strncmp(result->key,ikey,d-result->key)!=0)
l = d-ikey;
if (strncmp(result->key,ikey,l)!=0)
return -1;
return atoi(d+1);
return atoi(result->key+l+1);
}
int cw_cfg_get_first_index_l(cw_Cfg_t ** cfgs, const char *key, int n)

View File

@ -554,7 +554,6 @@ static int process_elements(struct cw_Conn *conn, uint8_t * rawmsg, int len,
* Put further actions here, if needed.
*/
}
if (params.unrecognized)
mlist_destroy(params.unrecognized);
cw_cfg_destroy(params.cfg);

View File

@ -36,10 +36,9 @@ int cw_in_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams *
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
int cw_out_generic0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst,const char *key)
{
int start, len, l;
// cw_dbg(DBG_X,"cw_out_generic (%s)%s",((struct cw_Type*)handler->type)->name,handler->key);
@ -49,19 +48,21 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
// cw_dbg(DBG_X,"Generic out!!!!!!!!!!!!!!!!!!!!!!!!!!!! ENDDUMP");
//
//
if (!cw_cfg_base_exists(params->cfg_list[0],handler->key)){
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s %s - (skip)",
params->elemdata->proto,
params->elemdata->vendor,
params->elemdata->id,
handler->name, handler->key);
return 0;
}
if (!params->elemdata->mand){
if (!cw_cfg_base_exists(params->cfg_list[0],key)){
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s %s - (bskip)",
params->elemdata->proto,
params->elemdata->vendor,
params->elemdata->id,
handler->name, key);
return 0;
}
}
start = params->msgset->header_len(handler);
len = ((const cw_Type_t*)(handler->type))->
write(params->cfg_list,handler->key,dst+start,handler->param);
write(params->cfg_list,key,dst+start,handler->param);
// cw_dbg(DBG_X, "Type result is %d",len);
if (len == -1) {
@ -73,7 +74,7 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
cw_log(LOG_ERR,
"Can't put mandatory element %s %d-(%s) into %s. No value for '%s' found.",
vendor, handler->id, handler->name, params->msgdata->name
, handler->key
, key
);
}
else{
@ -90,6 +91,15 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
l = params->msgset->write_header(handler,dst,len);
return l;
}
int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
{
return cw_out_generic0(handler,params,dst,handler->key);
}
@ -314,3 +324,148 @@ cw_put_descriptor_subelem (uint8_t *dst, cw_Cfg_t ** cfg_list,
return d-dst;
}
/*
int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst, int i, const char *current, const char * next,
int * stack)
{
char *sl;
int l;
char key[CW_CFG_MAX_KEY_LEN];
int len;
len = 0;
printf("Next: %s\n", next);
sl = strchr(next,'/');
if (sl==NULL){
cw_Val_t * result;
sprintf(key,"%s/%s",current,next);
result = cw_ktv_base_exists(params->cfg,key);
if (result != NULL){
int offset;
int i,l;
offset = params->msgset->header_len(handler);
printf("Yea! We can do it: %s\n",result->key);
for (i=0;i<stack[0];i++){
printf("I=%i\n",stack[i+1]);
}
l= cw_ktv_write_struct(params->cfg,params->cfg,
handler->type,key,dst+offset);
printf("Write struct len %i\n",l);
l=params->msgset->write_header(handler,dst,l);
printf("header wr len %d\n",l);
if (handler->patch){
handler->patch(dst+offset,stack);
}
return l;
}
return 0;
}
strcpy(key,current);
printf("current is %s\n", current);
if (key[0!=0])
strcat(key,"/");
l = sl - next;
strncat(key,next,l);
printf("Here we are %s\n",key);
cw_dbg_ktv_dump(params->cfg,DBG_INFO,"start"," ", "end" );
i=-1;
while(1){
char basekey[CW_CFG_MAX_KEY_LEN];
cw_Val_t * result;
i = cw_ktv_idx_get_next(params->cfg,key,i+1);
if (i==-1)
break;
sprintf(basekey,"%s.%d",key,i);
printf("Our basekey is %s\n",basekey);
result = cw_ktv_base_exists(params->cfg,basekey);
if (result == NULL){
continue;
}
stack[0]++;
stack[stack[0]]=i;
len += cw_out_traverse0(handler,params,dst+len,-1,basekey,next+l+1, stack);
printf("Len is now %d\n", len);
}
return len;
return 0;
}
*/
int cw_out_traverse(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
{
/* char current[CW_CFG_MAX_KEY_LEN];
int stack[10];
stack[0]=0;
current[0]=0;
// return cw_out_traverse0(handler,params,dst,-1,current,handler->key, stack);*/
return 0;
}
int walk0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst, const char *current, const char * next)
{
char key[CW_CFG_MAX_KEY_LEN];
const char *sl;
int rc;
int len=0;
/* Is this the last key ? */
sl = strchr(next,'/');
if (sl){
char basekey[CW_CFG_MAX_KEY_LEN+13];
int i,l;
strcpy(key,current);
l = sl - next;
strncat(key,next,l);
for (i=0; (i=cw_cfg_get_first_index_l(params->cfg_list,key,i))!=-1; i++){
sprintf(basekey,"%s.%d%c",key,i, *(sl+1) ?'/':'\0');
rc = walk0(handler,params,dst,basekey,next+l+1);
if (rc>0)
len+=rc;
}
return len;
}
printf("Final %s [%s]\n",current,next);
return cw_out_generic0(handler,params,dst,current);
return 0;
}
int cw_out_generic_walk(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
{
char current[CW_CFG_MAX_KEY_LEN];
// int stack[10];
// stack[0]=0;
current[0]=0;
return walk0(handler,params,dst,current,handler->key);
}

View File

@ -558,6 +558,8 @@ int cw_put_descriptor_subelem (uint8_t *dst, cw_Cfg_t ** cfg_list,
int cw_send_request(struct cw_Conn *conn,int msg_id);
int cw_out_generic_walk(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst);
/**
*@}

View File

@ -42,106 +42,8 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
cdst+=params->msgset->write_header(handler,cdst,l);
}
return cdst-dst;
return cdst-dst;*/
}
int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst, int i, const char *current, const char * next,
int * stack)
{
char *sl;
int l;
char key[CW_CFG_MAX_KEY_LEN];
int len;
len = 0;
printf("Next: %s\n", next);
sl = strchr(next,'/');
if (sl==NULL){
cw_Val_t * result;
sprintf(key,"%s/%s",current,next);
result = cw_ktv_base_exists(params->cfg,key);
if (result != NULL){
int offset;
int i,l;
offset = params->msgset->header_len(handler);
printf("Yea! We can do it: %s\n",result->key);
for (i=0;i<stack[0];i++){
printf("I=%i\n",stack[i+1]);
}
l= cw_ktv_write_struct(params->cfg,params->cfg,
handler->type,key,dst+offset);
printf("Write struct len %i\n",l);
l=params->msgset->write_header(handler,dst,l);
printf("header wr len %d\n",l);
if (handler->patch){
handler->patch(dst+offset,stack);
}
return l;
}
return 0;
}
strcpy(key,current);
printf("current is %s\n", current);
if (key[0!=0])
strcat(key,"/");
l = sl - next;
strncat(key,next,l);
printf("Here we are %s\n",key);
cw_dbg_ktv_dump(params->cfg,DBG_INFO,"start"," ", "end" );
i=-1;
while(1){
char basekey[CW_CFG_MAX_KEY_LEN];
cw_Val_t * result;
i = cw_ktv_idx_get_next(params->cfg,key,i+1);
if (i==-1)
break;
sprintf(basekey,"%s.%d",key,i);
printf("Our basekey is %s\n",basekey);
result = cw_ktv_base_exists(params->cfg,basekey);
if (result == NULL){
continue;
}
stack[0]++;
stack[stack[0]]=i;
len += cw_out_traverse0(handler,params,dst+len,-1,basekey,next+l+1, stack);
printf("Len is now %d\n", len);
}
return len;
*/
return 0;
}
int cw_out_traverse(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams * params
, uint8_t * dst)
{
//char current[CW_CFG_MAX_KEY_LEN];
//int stack[10];
//stack[0]=0;
//current[0]=0;
//stop();
return 0;
// return cw_out_traverse0(handler,params,dst,-1,current,handler->key, stack);
}

View File

@ -49,6 +49,8 @@ int cw_setup_dtls(struct cw_Conn *conn, cw_Cfg_t * cfg, const char *prefix,
sprintf(key, "%s/%s", prefix, "ssl-cipher");
conn->dtls_cipher = cw_cfg_get(cfg, key, default_cipher);
cw_dbg(DBG_DTLS,"Using cipher: %s",conn->dtls_cipher);
sprintf(key, "%s/%s", prefix, "ssl-psk");
conn->dtls_psk = (bstr16_t)cw_cfg_get(cfg, key, NULL);

View File

@ -158,6 +158,7 @@ static int bwrite(cw_Cfg_t ** cfgs, const char *key, uint8_t *dst, const void *
i=0,l=0;
do {
sprintf(skey,"%s.%d",key,i);
// printf("iSKEY %s\n",skey);
i++;
if (cw_cfg_get_l(cfgs,skey,NULL)==NULL){
break;
@ -165,7 +166,7 @@ static int bwrite(cw_Cfg_t ** cfgs, const char *key, uint8_t *dst, const void *
l+=def->type->write(cfgs,skey,dst,def->param);
}while(1);
// printf("LEN: %d pl: %d\n",l,n);
// printf("LEN: %d (K: %s)\n",l,key);
fun(cfgs,key,dst,param,l);
return l;
}

View File

@ -113,12 +113,13 @@ static int write_struct(cw_Cfg_t ** cfgs, const cw_ValStruct_t * stru, const ch
if (!rc){
int l;
cw_log(LOG_ERR,"Can't put %s, no value found, filling wth zeros.",key);
cw_log(LOG_ERR,"Can't put %s, no value found, filling with zeros.",key);
l = stru[i].len;
if (l==-1)
l = 0;
memset(dst+pos,0,l);
wrlen=l;
}
else{
struct cw_Type * type;

View File

@ -122,7 +122,7 @@ struct cw_dbg_cfgstrs cw_dbg_cfgstrs[] = {
{"elem_err",DBG_ELEM_ERR},
{"dtls",DBG_DTLS},
{"dtls_dietail",DBG_DTLS_DETAIL},
{"dtls_detail",DBG_DTLS_DETAIL},
{"dtls_bio",DBG_DTLS_BIO},
{"dtls_bio_dmp",DBG_DTLS_BIO_DMP},

View File

@ -504,7 +504,7 @@ static cw_ValStruct_t cisco_lw_radio_module_info_stru[]={
{CW_TYPE_STR,"name",21,-1},
{CW_TYPE_STR,"serial",11,-1},
{CW_TYPE_STR,"type",25,-1},
{CW_TYPE_STR,"descr",126,-1},
{CW_TYPE_STR,"descr",125,-1},
{NULL,NULL,0,0}
};
@ -2082,9 +2082,9 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
7,1117, /* min/max length */
CW_TYPE_STRUCT, /* type */
"radio/wlan/add-wlan", /* Key */
"radio/wlan/", /* Key */
cw_in_generic, /* get */
cw_out_traverse, /* put */
cw_out_generic_walk, /* put */
cisco_add_wlan_mkkey70,
NULL, // cisco_patch_add_wlan70
cisco_add_wlan70
@ -2435,21 +2435,21 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
{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},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_WTP_RADIO_CONFIGURATION, 0, 0},
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 1, 0},
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AC_NAME_WITH_INDEX, 0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_CORE_DUMP, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_VENUE_SETTINGS, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MAC_OPERATION, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CHANNEL_POWER, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CHANNEL_POWER, 0, 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_USERNAME_PASSWORD, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_LOGHOST_CONFIG, 1, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_TELNET_SSH, 1, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_AP_SUBMODE, 1, 0},
@ -2513,7 +2513,7 @@ static struct cw_ElemDef configuration_status_response_elements[] ={
{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_DIRECT_SEQUENCE_CONTROL, 0, 0},
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 1, 0},
{0, CW_VENDOR_ID_CISCO, CW_CISCO_ANTENNA_PAYLOAD, 0, 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},
@ -2538,6 +2538,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, 0, CAPWAP_ELEM_RADIO_ADMINISTRATIVE_STATE, 0, 0},
{0, 0, CAPWAP_ELEM_RADIO_OPERATIONAL_STATE, 0, 0},
{0,CW_VENDOR_ID_CISCO, CISCO_ELEM_AP_GROUP_NAME, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_BCAST_SSID_MODE, 0, 0},
@ -2615,7 +2616,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_MAC_OPERATION, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER, 0, 0},
/* {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 1, 0}, */
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_TX_POWER_LEVELS, 0, 0},
/* {0, CW_VENDOR_ID_CISCO, CISCO_ELEM_CHANNEL_POWER, 1, 0}, */
@ -2680,7 +2681,7 @@ static struct cw_ElemDef change_state_event_request_elements[] ={
{0, 0, CAPWAP_ELEM_RADIO_ADMINISTRATIVE_STATE, 1, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 1, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_RADIO_MODULE_INFO, 1, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_RADIO_MODULE_INFO, 0, 0},
{0,0,0,0,0}

View File

@ -1,235 +0,0 @@
#
# 1142 startup
#
capwap/location-data: default location
capwap/maximum-message-length: 14000
capwap/session-id: .x45e59826
capwap/wtp-board-data/board-id: .x0000
capwap/wtp-board-data/mac-address: .xc47d4f3af8a6
capwap/wtp-board-data/model-no: "AIR-LAP1142N-E-K9 "
capwap/wtp-board-data/revision: A0
capwap/wtp-board-data/serial-no: FCZ1406W232
capwap/wtp-board-data/vendor: 4232704
capwap/wtp-descriptor/bootloader/vendor: 4232704
capwap/wtp-descriptor/bootloader/version: .x0c041200
capwap/wtp-descriptor/hardware/vendor: 4232704
capwap/wtp-descriptor/hardware/version: .x01000000
capwap/wtp-descriptor/max-radios: 2
capwap/wtp-descriptor/radios-in-use: 2
capwap/wtp-descriptor/software/vendor: 4232704
capwap/wtp-descriptor/software/version: .x07007400
capwap/wtp-frame-tunnel-mode: 4
capwap/wtp-mac-type: 1 - Split MAC
capwap/wtp-name: APc47d.4f3a.f8a6
cisco/ap-group-name: default-group
cisco/lw-path-mtu/len: 1095
cisco/lw-path-mtu/max: 1485
cisco/mwar-addr/address: 192.168.0.161
cisco/mwar-addr/mwar-type: 0
cisco/mwar-addr/unknown: 0
cisco/wtp-board-data/options/ant-type: 1
cisco/wtp-board-data/options/ap-type: 0
cisco/wtp-board-data/options/failover-priority: 1
cisco/wtp-board-data/options/flex-connect: 0
radio.0/capwap80211/wtp-radio-information: 1
radio.1/capwap80211/wtp-radio-information: 2
capwap/ac-name:
capwap/statistics-timer: 180
capwap/wtp-reboot-statistics/ac-initiated-count: 1
capwap/wtp-reboot-statistics/hw-failure-count: 0
capwap/wtp-reboot-statistics/last-failure-type: 1
capwap/wtp-reboot-statistics/link-failure-count: 0
capwap/wtp-reboot-statistics/other-failure-count: 17
capwap/wtp-reboot-statistics/reboot-count: 0
capwap/wtp-reboot-statistics/sw-failure-count: 0
capwap/wtp-reboot-statistics/unknown-failure-count: 0
cisco/ap-backup-software-version: .x00000000
cisco/ap-dtls-data-cfg/cabable: true
cisco/ap-dtls-data-cfg/enabled: false
cisco/ap-ethernet-port-type: .x000000
cisco/ap-led-state-config/led-state: 1
cisco/ap-log-facility: 0
cisco/ap-min-ios-version: .x08036f00
cisco/ap-mode-and-type/mode: 0
cisco/ap-mode-and-type/type: 15
cisco/ap-model/image: 12.4(23c)JA2
cisco/ap-model/model: "AIR-LAP1142N-E-K9 "
cisco/ap-power-injector-config/selection: 0
cisco/ap-power-injector-config/state: 17
cisco/ap-power-injector-config/switch-mac-address: .x000000000000
cisco/ap-pre-std-switch-config: 0
cisco/ap-regulatory-domain.0/code0: 0
cisco/ap-regulatory-domain.0/code1: 1
cisco/ap-regulatory-domain.0/set: true
cisco/ap-regulatory-domain.0/slot: 0
cisco/ap-regulatory-domain.1/code0: 0
cisco/ap-regulatory-domain.1/code1: 1
cisco/ap-regulatory-domain.1/set: true
cisco/ap-regulatory-domain.1/slot: 1
cisco/ap-static-ip-addr/address: 192.168.0.13
cisco/ap-static-ip-addr/enabled: false
cisco/ap-static-ip-addr/gateway: 192.168.0.1
cisco/ap-static-ip-addr/netmask: 255.255.255.0
cisco/ap-static-ip-addr/unknown: 0.0.0.0
cisco/ap-sub-mode: 0
cisco/ap-telnet-ssh/ssh: false
cisco/ap-telnet-ssh/telnet: false
cisco/ap-uptime/current-uptime: 291
cisco/ap-uptime/last-uptime: 1
cisco/ap-username-and-password/login-credentials/enable-password: $1$AmeO$sVDsj.7u2p72.6OD7ZxEo.
cisco/ap-username-and-password/login-credentials/option: 1
cisco/ap-username-and-password/login-credentials/password: $1$5oz2$kFPn2Dsy576Q50Z3XwVVx.
cisco/ap-username-and-password/login-credentials/username: Cisco
cisco/cisco-discovery-protocol/data: 513
cisco/cisco-discovery-protocol/enabled: false
cisco/loghost-config/last-joined-ap: None
cisco/loghost-config/loghost: 255.255.255.255
cisco/lwelem105: .x0000
cisco/lwelem14: .x000100000000000000000000000000000000
cisco/reset-button-state: true
cisco/rouge-and-mss/enable: false
cisco/rouge-and-mss/tcp-adjust-mss: 0
cisco/rouge-detection/rest: .x0000000a
cisco/rouge-detection/rouge-detection: true
cisco/wtp-board-data/card-id: 0
cisco/wtp-board-data/card-revision: 0
cisco/wtp-board-data/ethernet-mac-address: .xc47d4f3af8a6
cisco/wtp-board-data/options/ant-type: 1
cisco/wtp-board-data/options/ap-type: 1
cisco/wtp-board-data/options/failover-priority: 0
cisco/wtp-board-data/options/flex-connect: 1
cisco/wtp-board-data/wtp-model-hi: 0
cisco/wtp-board-data/wtp-model-lo: 0
cisco/wtp-board-data/wtp-serial-number: FCZ1406W232
radio.0/capwap/admin-state: 1 - enabled
radio.0/capwap80211/tx-power/@cisco/cfg-type: 1 - global
radio.0/capwap80211/tx-power/current-tx-power: 0
radio.0/cisco/antenna-payload/802-11n-rx-antennas: 0
radio.0/cisco/antenna-payload/802-11n-tx-antennas: 0
radio.0/cisco/antenna-payload/antenna-1: 1
radio.0/cisco/antenna-payload/antenna-2: 1
radio.0/cisco/antenna-payload/antenna-mode: 3
radio.0/cisco/antenna-payload/diversity-selection: 255
radio.0/cisco/antenna-payload/number-of-antennas: 2
radio.0/cisco/antenna-payload/unknown: 0
radio.0/cisco/ap-mfp-cap-subtype: 515
radio.0/cisco/channel-power: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe
radio.0/cisco/elem16: .x02040b0c
radio.0/cisco/mac-operation/fragmentation-threshold: 0
radio.0/cisco/mac-operation/long-retry: 0
radio.0/cisco/mac-operation/reserved: 1
radio.0/cisco/mac-operation/rts-threshold: 2347
radio.0/cisco/mac-operation/rx-msdu-lifetime: 1000
radio.0/cisco/mac-operation/short-retry: 0
radio.0/cisco/mac-operation/tx-msdu-lifetime: 5000
radio.0/cisco/multi-domain-capability/first-channel: 1
radio.0/cisco/multi-domain-capability/max-tx-power-level: 65535
radio.0/cisco/multi-domain-capability/number-of-channels: 13
radio.0/cisco/multi-domain-capability/reserved: 1
radio.0/cisco/phy-ht-cap/extendend-ht-cap-info: 0
radio.0/cisco/phy-ht-cap/ht-cap-info: 0
radio.0/cisco/phy-ht-cap/rest: .x000000000000000000000000000000000000000000
radio.0/cisco/phy-ht-control/cfg-type: 1 - global
radio.0/cisco/phy-ht-control/current-freq: 0
radio.0/cisco/phy-ht-control/enable-ht: 0
radio.0/cisco/phy-ht-control/rest: .x00000000000200001400
radio.0/cisco/proformance-profile/bytes-per-sec: 0
radio.0/cisco/proformance-profile/cfg-type: 1 - global
radio.0/cisco/proformance-profile/excpection-level: 0
radio.0/cisco/proformance-profile/foreigh-threshold: 0
radio.0/cisco/proformance-profile/min-num-clients: 0
radio.0/cisco/proformance-profile/min-perf-snr: 0
radio.0/cisco/proformance-profile/num-clients-threshold: 0
radio.0/cisco/proformance-profile/rf-busy-threshold: 0
radio.0/cisco/proformance-profile/rssi-threshold: 0
radio.0/cisco/spam-cfp-status: false
radio.0/cisco/station-cfg/cfg-type: 3
radio.0/cisco/station-cfg/current-freq: 3
radio.0/cisco/station-cfg/rest: .x020202000000000000000000000000000000000000000000313f01
radio.0/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.0/cisco/wtp-radio-config/beacon-period: 0
radio.0/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.0/cisco/wtp-radio-config/cfg-period: 0
radio.0/cisco/wtp-radio-config/cfg-type: 1
radio.0/cisco/wtp-radio-config/cfp-maximum-duration: 0
radio.0/cisco/wtp-radio-config/country-str1:
radio.0/cisco/wtp-radio-config/country-str2:
radio.0/cisco/wtp-radio-config/occupancy-limit: 0
radio.0/cisco/wtp-radio-config/reg: 256
radio.1/capwap/admin-state: 1 - enabled
radio.1/capwap80211/tx-power/@cisco/cfg-type: 1 - global
radio.1/capwap80211/tx-power/current-tx-power: 0
radio.1/cisco/antenna-payload/802-11n-rx-antennas: 0
radio.1/cisco/antenna-payload/802-11n-tx-antennas: 0
radio.1/cisco/antenna-payload/antenna-1: 1
radio.1/cisco/antenna-payload/antenna-2: 1
radio.1/cisco/antenna-payload/antenna-mode: 3
radio.1/cisco/antenna-payload/diversity-selection: 255
radio.1/cisco/antenna-payload/number-of-antennas: 2
radio.1/cisco/antenna-payload/unknown: 0
radio.1/cisco/ap-mfp-cap-subtype: 66051
radio.1/cisco/channel-power: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
radio.1/cisco/elem16: .x0c121824
radio.1/cisco/mac-operation/fragmentation-threshold: 0
radio.1/cisco/mac-operation/long-retry: 0
radio.1/cisco/mac-operation/reserved: 1
radio.1/cisco/mac-operation/rts-threshold: 2347
radio.1/cisco/mac-operation/rx-msdu-lifetime: 1000
radio.1/cisco/mac-operation/short-retry: 0
radio.1/cisco/mac-operation/tx-msdu-lifetime: 5000
radio.1/cisco/multi-domain-capability/first-channel: 36
radio.1/cisco/multi-domain-capability/max-tx-power-level: 65535
radio.1/cisco/multi-domain-capability/number-of-channels: 16
radio.1/cisco/multi-domain-capability/reserved: 1
radio.1/cisco/phy-ht-cap/extendend-ht-cap-info: 0
radio.1/cisco/phy-ht-cap/ht-cap-info: 0
radio.1/cisco/phy-ht-cap/rest: .x000000000000000000000000000000000000000000
radio.1/cisco/phy-ht-control/cfg-type: 1 - global
radio.1/cisco/phy-ht-control/current-freq: 0
radio.1/cisco/phy-ht-control/enable-ht: 0
radio.1/cisco/phy-ht-control/rest: .x03000000000200001400
radio.1/cisco/proformance-profile/bytes-per-sec: 0
radio.1/cisco/proformance-profile/cfg-type: 1 - global
radio.1/cisco/proformance-profile/excpection-level: 0
radio.1/cisco/proformance-profile/foreigh-threshold: 0
radio.1/cisco/proformance-profile/min-num-clients: 0
radio.1/cisco/proformance-profile/min-perf-snr: 0
radio.1/cisco/proformance-profile/num-clients-threshold: 0
radio.1/cisco/proformance-profile/rf-busy-threshold: 0
radio.1/cisco/proformance-profile/rssi-threshold: 0
radio.1/cisco/spam-cfp-status: false
radio.1/cisco/station-cfg/cfg-type: 3
radio.1/cisco/station-cfg/current-freq: 3
radio.1/cisco/station-cfg/rest: .x020202000000000000000000000000000000000000000000313f01
radio.1/cisco/tx-power-levels: .x070011000e000b000800050002ffff0000
radio.1/cisco/wtp-radio-config/beacon-period: 0
radio.1/cisco/wtp-radio-config/bss-id: .x04fe7f499b90
radio.1/cisco/wtp-radio-config/cfg-period: 0
radio.1/cisco/wtp-radio-config/cfg-type: 1
radio.1/cisco/wtp-radio-config/cfp-maximum-duration: 0
radio.1/cisco/wtp-radio-config/country-str1:
radio.1/cisco/wtp-radio-config/country-str2:
radio.1/cisco/wtp-radio-config/occupancy-limit: 0
radio.1/cisco/wtp-radio-config/reg: 256
radio.255/capwap/admin-state: 1 - enabled
cisco/ssl-certfile: ../../ssl/certs/wtpc.crt
cisco/ssl-cipher: SHA1
cisco/ssl-keyfile: ../../ssl/certs/wtpc.key
cisco/wtp-use-ac-version: true
capwap/wtp-board-data/mac-address: .x0800276edf58
capwap/local-ip-address: 192.168.0.14

View File

@ -81,12 +81,6 @@ static struct cw_DiscoveryResults * run_discovery(struct cw_Conn *conn)
while (!cw_timer_timeout(timer)
&& conn->capwap_state == CAPWAP_STATE_DISCOVERY) {
int rc;
// conn->remote_cfg = cw_ktv_create();
// if (conn->remote_cfg == NULL) {
// cw_log_errno("Can't allocate memory for remote_cfg");
// break;
// }
rc = cw_read_from(conn, &from);
if (rc < 0) {
if (errno == EAGAIN)

View File

@ -29,6 +29,7 @@ struct bootcfg{
const char * modpath;
const char * config_file;
const char * startup_file;
const char * local_startup_file;
};
extern struct bootcfg bootcfg;

View File

@ -34,8 +34,9 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
bootcfg->config_file = "config.ckv";
bootcfg->startup_file = "startup.ckv";
bootcfg->local_startup_file ="startup-local.ckv";
while ( (c = getopt (argc, argv, "s:p:d:vc:m:h")) != -1) {
while ( (c = getopt (argc, argv, "l:s:p:d:vc:m:h")) != -1) {
switch (c) {
case 'v':
@ -65,6 +66,9 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
case 's':
bootcfg->startup_file = optarg;
break;
case 'l':
bootcfg->local_startup_file = optarg;
break;
case '?':
exit(EXIT_FAILURE);
default:
@ -80,6 +84,7 @@ static int parse_args (int argc, char *argv[], struct bootcfg * bootcfg)
#include "cw/rand.h"
struct bootcfg bootcfg;
@ -136,6 +141,18 @@ int main (int argc, char **argv)
cw_log(LOG_ERR,"Can't open file '%s':%s",bootcfg.startup_file, strerror(errno));
goto errX;
}
cw_dbg(DBG_INFO,"Startup '%s' loaded.",bootcfg.startup_file);
if (access(bootcfg.local_startup_file,F_OK)==0){
rc = cw_cfg_load(bootcfg.local_startup_file,global_cfg);
if (rc){
cw_log(LOG_ERR,"Can't open file '%s':%s",bootcfg.local_startup_file, strerror(errno));
goto errX;
}
cw_dbg(DBG_INFO,"Local startup '%s' loaded.",bootcfg.local_startup_file);
}
cw_cfg_dump(global_cfg);
/* Create a temp. cfg */
cfg = cw_cfg_create();
@ -163,18 +180,6 @@ int main (int argc, char **argv)
cw_cfg_destroy(cfg);
/* {
struct cw_Cfg_iter cfi;
struct cw_Cfg_entry *e;
int i;
for (i=0; (i=cw_cfg_get_first_index(global_cfg,"radio",i))!=-1; i++){
printf("Inedx: %d\n", i);
}
goto errX;
}
*/
/* conn->mod=mod;*/
conn->detected = 1;
conn->dtls_verify_peer=0;