moved local_cfg, remote_cfg ... to cw_ElemData struct

This commit is contained in:
7u83 2022-07-28 01:36:16 +02:00
parent 6ac1c87b2f
commit b894c00a7e
86 changed files with 360 additions and 243 deletions

View File

@ -3,6 +3,7 @@
ARCH!=uname -m
KERNEL!=uname -s
-include LocalDefs.mak
#.endif

View File

@ -12,21 +12,22 @@ OBJS = \
shell.o\
PRG=actube
LIBPATH=-L../../lib/$(ARCH)/ -L/usr/local/lib -L/usr/lib
LIBPATH=-L../../lib/Linux/$(ARCH)/ -L/usr/local/lib -L/usr/lib
LIBS+=-lmavl
LIBS+=-lcw
LIBS+=-lrt
LIBS+=-lpthread
LIBS+=-lconfuse
LIBS+=-lsqlite3
LIBS+=-lc
LIBS+=-lnettle
LIBS+=$(OPENSSL_LIBS)
INCL_DIRS=-I../ -I/usr/local/include -I./
INCL_DIRS=-I../ -I/usr/local/include -I./ -I/home/tube/v/rsrch/libmavl/
#FLAGS=-DWITH_IPV6 -DWITH_OPENSSL -DSYS_ARCH="$(ARCH)" -DSYS_ARCH="XXX"
FLAGS=-DWITH_IPV6 -DWITH_OPENSSL -DSYS_ARCH='"$(ARCH)"'
FLAGS=-DWITH_IPV6 -DUSE_OPENSSL -DSYS_ARCH='"$(ARCH)"'
.c.o:
@echo " $(CC) "$<

View File

@ -184,7 +184,7 @@ ssl_key="../../ssl/certs/ac-cisco.key"
# SSL certificate that will be sent to the client
#
# Default:
ssl_cert="../../ssl/certs/ac-cisco.pem"
ssl_cert="../../ssl/certs/ac-xcisco.pem"
# dtls_verify_peer
@ -242,4 +242,4 @@ ssl_cert="../../ssl/certs/ac-cisco.pem"
mods = { cisco, capwap, capwap80211 }
#, capwap80211 }
mods_dir = ../../lib
mods_dir = ../../lib/Linux/x86_64/

View File

@ -1,7 +1,8 @@
#ifndef __ACTUBE_AC_H
#define __ACTUBE_AC_H
#include "cw/mavl.h"
#include "mavl.h"
#include "cw/mavltypes.h"
extern mavl_t actube_global_cfg;

View File

@ -13,6 +13,7 @@
#include "wtpman.h"
#include "discovery_cache.h"
#include "cw/mavltypes.h"
mavl_t actube_global_cfg;

View File

@ -157,6 +157,7 @@ int mycmp (void *e1, void *e2)
return 0;
}
/*
void mavl_walk (struct mavlnode * node)
{
struct mykv * kv;
@ -175,6 +176,7 @@ void mavl_walk (struct mavlnode * node)
mavl_walk (node->right);
}
*/
/*
int stcmp (const void * sa1, const void *sa2)
@ -246,7 +248,7 @@ int main (int argc, char *argv[])
/* create types tree with default types */
types_tree = cw_ktv_create_types_tree();
for (ti=CW_KTV_STD_TYPES;*ti;ti++){
mavl_add_ptr(types_tree,*ti);
mavl_insert_ptr(types_tree,*ti);
}
global_cfg = cw_ktv_create();

View File

@ -37,6 +37,8 @@
#include "conf.h"
#include "ac.h"
#include "cw/mavltypes.h"
uint8_t conf_macaddress[12];
uint8_t conf_macaddress_len = 0;
@ -393,7 +395,8 @@ int init_bcast_addrs()
if (!conf_ipv4)
return 1;
t = mavl_create_str();
/*t = mavl_create_ptr(); */
t = mavl_create_ptr(mavl_cmpstr,mavl_freeptr);
if (t==NULL)
return 0;

View File

@ -29,7 +29,7 @@ ac-descriptor/software/vendor :Dword: 4232704
ac-descriptor/software/version :Bstr16: .x07036500
ac-descriptor/station-limit :Word: 1000
ac-descriptor/stations :Word: 0
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.29
capwap-control-ip-address/address.0 :IPAddress: 192.168.0.14
#capwap-control-ip-address/address.0 :IPAddress: 192.168.42.51
capwap-control-ip-address/wtps.0 :Word: 2
cisco/mwar-type :Byte: 0
@ -37,24 +37,28 @@ maximum-message-length :Word: 4096
radio/0/wtp-radio-information :Dword: 7
result-code :Dword: 0
cisco/ap-telnet-ssh/ssh :Bool: true
cisco/ap-telnet-ssh/telnet :Bool: true
ac-name:Bstr16:"X1"
#capwap-control-ip-address/address.0:IPAddress:1192.168.0.14
capwap-control-ip-address/address.0:IPAddress:192.168.0.29
capwap-control-ip-address/address.0:IPAddress:192.168.0.14
#capwap-control-ip-address/address.0:IPAddress:192.168.0.131
#capwap-control-ip-address/address.1:IPAddress:2a00:c1a0:48c6:4a00:9965:1b6e:aca3:1398
capwap-control-ip-address/wtps.0:Word:0
#capwap-control-ip-address/wtps.1:Word:11
#cisco/ssl-keyfile:Str:"../../ssl/certs/ac.key"
#cisco/ssl-certfile:Str:"../../ssl/certs/ac.crt"
#cisco/ssl-keyfile:Str:"../../ssl/certs/ac-cisco.key"
#cisco/ssl-certfile:Str:"../../ssl/certs/ac-cisco.pem"
#cisco/ssl-keyfile:Str:"../../ssl/certs/int-ca.key"
#cisco/ssl-certfile:Str:"../../ssl/certs/int-ca.crt"
cisco/ssl-keyfile:Str:"../../ssl/intermediate-ca/int-ca.key"
cisco/ssl-certfile:Str:"../../ssl/intermediate-ca/int-ca.crt"
#cisco/ssl-keyfile:Str:"../../ssl/intermediate-ca/cisco-ac-int-ca.key"
#cisco/ssl-certfile:Str:"../../ssl/intermediate-ca/cisco-ac-int-ca.crt"
cisco/ssl-cipher:Str:DEFAULT:!ECDH
#cisco/ssl-cipher:Str:+DHE-RSA:+AES-256-CBC:+AES-128-CBC:+SHA1
cisco/ssl-dhbits:Word:2048
@ -107,7 +111,7 @@ radio.1/cisco/multi-domain-capability/max-tx-power-level :Word: 20
radio.1/cisco/multi-domain-capability/number-of-channels :Word: 4
radio.1/cisco/multi-domain-capability/reserved :Byte: 1
radio.1/cisco/wtp-radio-config/beacon-period :Word: 100
radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x04fe7f499b90
radio.1/cisco/wtp-radio-config/bss-id :Bstr16: .x05fe7f499b90
radio.1/cisco/wtp-radio-config/cfg-period :Byte: 4
radio.1/cisco/wtp-radio-config/cfg-type :Byte: 1
radio.1/cisco/wtp-radio-config/cfp-maximum-duration :Word: 60

View File

@ -1,6 +1,6 @@
#include <stdlib.h>
#include "cw/mavl.h"
#include "mavl.h"
#include "cw/sock.h"
#include "cw/timer.h"
#include "cw/cw.h"
@ -86,7 +86,7 @@ struct dataman *dataman_list_add(struct dataman *dm)
{
cw_dbg(DBG_X,"Adding dataman %p\n",dm);
return mavl_add(dataman_list, dm,NULL);
return mavl_insert(dataman_list, dm,NULL);
}

View File

@ -1,7 +1,7 @@
#ifndef CW_MAVL_H
#define CW_MAVL_H
#include "cw/mavl.h"
#include "mavl.h"
extern void db_ping();
extern void db_ping_wtp(const char *wtpid,const char *acid);

View File

@ -2,7 +2,7 @@
#include "cw/sock.h"
#include "cw/mlist.h"
#include "cw/mavl.h"
#include "mavl.h"
#include "cw/mod.h"
#include "discovery_cache.h"
@ -125,8 +125,8 @@ void discovery_cache_add(struct cw_DiscoveryCache *cache,
cache->ctrhi++;
}
mavl_add_ptr(cache->byaddr,cur);
mavl_add_ptr(cache->byaddrp,cur);
mavl_insert_ptr(cache->byaddr,cur);
mavl_insert_ptr(cache->byaddrp,cur);
cache->qpos++;
if (cache->qpos>=cache->len)

View File

@ -148,6 +148,7 @@ static int wtpman_dtls_setup(void *arg)
cw_dbg(DBG_DTLS, "DTLS session established with %s, %s",
sock_addr2str_p(&wtpman->conn->addr,sock_buf), dtls_get_cipher(wtpman->conn,cipherstr));
return 1;
}

View File

@ -1,8 +1,9 @@
include ../Defs.mak
MFDEPS=../Defs.mak ../LocalDefs.mak
CWSRC=\
cw_write_header.c\
cw_check_missing_mand.c\
cw_clock_lap.c\
cw_dbg_elem.c\
@ -63,6 +64,7 @@ CWSRC=\
cw_strlist_get_id.c\
cw_strlist_get_str.c\
cw_type_bstr16.c\
cw_type_bwstr.c\
cw_type_byte.c\
cw_type_bool.c\
cw_type_str.c\
@ -166,7 +168,6 @@ MISCSRC=\
bstr_create.c\
bstr_create_from_str.c\
bstr_replace.c\
bstrv_create.c\
capwap_inline.c\
capwap_strings_board.c\
capwap_strings_elem80211.c\
@ -182,6 +183,7 @@ MISCSRC=\
connlist.c\
conn_prepare_image_data_request.c\
conn_process_packet.c\
cw_decode_msg.c \
conn_q_add_packet.c\
conn_q_get_packet.c\
conn_q_wait_packet.c\
@ -218,11 +220,10 @@ MAVLSRC=\
mavl_get_ptr.c\
mavl_insert_ptr.c\
mavl_replace.c\
mavl_merge.c\
mavliter_get_ptr.c\
mavl_cmpstr.c\
mavl_freeptr.c \
mavl_merge.c\
DTLSSRC += dtls_openssl.c \
@ -256,7 +257,7 @@ SNAME := $(LIBARCHDIR)/libcw.a
DNAME := $(LIBARCHDIR)/libcw.so
CFLAGS+=-fPIC -DUSE_OPENSSL -I../contrib/openssl-1.1.1f/include/ -O0
CFLAGS+=-g -I/home/tube/v/rsrch/libmavl
CFLAGS+=-g
all: $(SNAME) $(DNAME)
static: $(SNAME)

View File

@ -203,7 +203,7 @@ struct conn {
int dtls_verify_peer;
int dtls_mtu;
uint8_t dtls_buffer[2048];
uint8_t dtls_buffer[4096];
int dtls_buffer_len;
int dtls_buffer_pos;

View File

@ -90,7 +90,7 @@ struct conn * conn_create(int sock, struct sockaddr * addr, int qsize)
/* conn->send_data_packet = conn_send_data_packet;*/
conn->last_seqnum_received=-1;
conn->mtu=1500;
conn->mtu=500;
conn->cur_packet=0;
@ -102,7 +102,7 @@ struct conn * conn_create(int sock, struct sockaddr * addr, int qsize)
/* conn->write_data = conn->send_data_packet; */
conn->dtls_mtu = 1500;
conn->dtls_mtu = 500;
return conn;
}

View File

@ -67,7 +67,8 @@ struct conn * conn_create_noq(int sock, struct sockaddr * addr)
/* misc settings */
conn->last_seqnum_received=-1;
conn->mtu=1500;
conn->mtu=480;
conn->dtls_mtu=500;
conn->cur_packet=0;

View File

@ -333,7 +333,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
ui = message->states;
for (ui=message->states; ui->state; ui++){
printf("Comparing %d and %d\n", conn->capwap_state, ui->state);
/* printf("Comparing %d and %d\n", conn->capwap_state, ui->state);*/
if(ui->state==conn->capwap_state){
break;
}
@ -398,7 +398,15 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
params.conn=conn;
/* params.conn=conn;*/
params.local_cfg=conn->local_cfg;
params.remote_cfg=conn->remote_cfg;
params.default_cfg=conn->default_cfg;
params.global_cfg=conn->global_cfg;
params.msgset=conn->msgset;
params.from=from;
params.msgdata=message;
params.mand_found=mand_found;

View File

@ -30,7 +30,7 @@ int conn_send_msg(struct conn * conn, uint8_t *rawmsg)
hlen = cw_get_hdr_hlen(rawmsg)*4;
mtu = conn->mtu;
mtu = 440;
mtu = 9440;
mtu = mtu >> 3;
mtu = mtu << 3;

View File

@ -547,6 +547,8 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout);
char *cw_strdup(const char *s);
int cw_stricmp(char const *a, char const *b);
int cw_write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len);
int cw_header_len(struct cw_ElemHandler * handler);
/**
*@}

View File

@ -14,7 +14,7 @@ int cw_in_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams *
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
}
result = cw_ktv_add(params->conn->remote_cfg, handler->key,
result = cw_ktv_add(params->remote_cfg, handler->key,
handler->type,NULL, elem_data,elem_len);
params->elem=result;

View File

@ -27,7 +27,7 @@ int cw_in_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
}
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data,elem_len);
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data,elem_len);
return CAPWAP_RESULT_SUCCESS;
}

View File

@ -9,6 +9,6 @@ int cw_in_generic_with_index(struct cw_ElemHandler *eh,
idx = cw_get_byte(data);
sprintf(key,"%s.%d",eh->key,idx);
cw_ktv_add(params->conn->remote_cfg,key,eh->type,NULL,data+1,len-1);
cw_ktv_add(params->remote_cfg,key,eh->type,NULL,data+1,len-1);
return 1;
}

View File

@ -16,7 +16,7 @@ int cw_in_idx_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerPara
idx=cw_get_byte(elem_data);
sprintf(key,handler->key,idx);
result = cw_ktv_add(params->conn->remote_cfg, key,
result = cw_ktv_add(params->remote_cfg, key,
handler->type, NULL, elem_data+1,elem_len-1);
params->elem=result;

View File

@ -19,7 +19,7 @@ int cw_in_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHand
idx = cw_get_byte(elem_data);
sprintf(key, handler->key, idx);
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
return CAPWAP_RESULT_SUCCESS;
}

View File

@ -19,7 +19,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);
cw_ktv_read_struct(params->conn->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
cw_ktv_read_struct(params->remote_cfg,handler->type,key,elem_data+1,elem_len-1);
/*params->elem=result;*/

View File

@ -10,7 +10,6 @@ cw_KTV_t * cw_ktv_add(mavl_t kvtstore, const char *key, const struct cw_Type *ty
{
cw_KTV_t mdata, *mresult;
int exists;
printf("KTV ADD: %s\n",key);
mdata.key=cw_strdup(key);
mdata.valguard=valguard;
@ -30,8 +29,6 @@ printf("KTV ADD: %s\n",key);
return NULL;
}
printf("MAVLCOUNT: %d - %s\n",kvtstore->count, mdata.key);
mavl_del(kvtstore,&mdata);
mresult = mavl_insert(kvtstore, &mdata, &exists);
if (exists){

View File

@ -19,7 +19,7 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
/* search.key=(char*)handler->key;
elem = mavl_get(params->conn->local_cfg, &search);
*/
elem = cw_ktv_get(params->conn->local_cfg,handler->key,NULL);
elem = cw_ktv_get(params->local_cfg,handler->key,NULL);
/* if (elem == NULL && params->conn->default_cfg !=NULL)
elem = mavl_get(params->conn->default_cfg, &search);
@ -49,7 +49,7 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
/* Size for msg elem header depends on
vendor specific payload */
/* start = handler->vendor ? 10 : 4; */
start = params->conn->header_len(handler);
start = cw_header_len(handler);
if (cw_ktv_cast(elem,handler->type)==NULL){
cw_log(LOG_ERR,"Can't put element '%s'- can't cast from %s to %s for key: %s", handler->name,
@ -67,9 +67,11 @@ int cw_out_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerParams
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
l = len + cw_put_elem_hdr(dst, handler->id, len); */
l = params->conn->write_header(handler,dst,len);
l = cw_write_header(handler,dst,len);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst,l);
/* cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);*/
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst,l);
return l;
}

View File

@ -22,10 +22,10 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
for(i=0; e[i].name!=NULL; i++) {
sprintf(key,"%s/%s",handler->key,e[i].name);
result = cw_ktv_base_exists(params->conn->local_cfg,key);
result = cw_ktv_base_exists(params->local_cfg,key);
if (result==NULL)
continue;
start = params->conn->header_len(handler);
start = cw_header_len(handler);
len = 0;
if (ie->idxpos==0)
len = 1;
@ -33,7 +33,7 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
if (e[i].fun_out==NULL)
len += result->type->put(result,ob+start+len);
else
len += cw_ktv_write_struct(params->conn->local_cfg,
len += cw_ktv_write_struct(params->local_cfg,
NULL,e[i].type,key,ob+start+len);
/* thandler.type=e[i].type;
@ -44,7 +44,7 @@ int cw_out_generic_indexed_enum(struct cw_ElemHandler * handler, struct cw_ElemH
if (ie->idxpos==len)
len++;
ob += params->conn->write_header(handler,ob,len);
ob += cw_write_header(handler,ob,len);

View File

@ -17,7 +17,7 @@ int cw_out_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandler
}
search.key = (char*)handler->key;
result = mavl_get_first(params->conn->local_cfg,&search);
result = mavl_get_first(params->local_cfg,&search);
if (result == NULL ){
if (params->elemdata->mand)
cw_log(LOG_ERR,"Can't put mandatory message element %s, no data available",handler->name);
@ -30,12 +30,12 @@ int cw_out_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHandler
return 0;
}
start = params->conn->header_len(handler);
start = cw_header_len(handler);
len = cw_ktv_write_struct(params->conn->local_cfg,
params->conn->default_cfg,
len = cw_ktv_write_struct(params->local_cfg,
params->default_cfg,
handler->type,handler->key,dst+start);
return params->conn->write_header(handler,dst,len);
return cw_write_header(handler,dst,len);
}

View File

@ -18,18 +18,18 @@ int cw_out_generic_with_index(struct cw_ElemHandler * eh,
do {
sprintf(key,"%s.%d",eh->key,idx);
search.key=key;
result = mavl_get_first(params->conn->local_cfg,&search);
result = mavl_get_first(params->local_cfg,&search);
if (result==NULL)
break;
if (strncmp(result->key,key,strlen(key))!=0)
break;
start = params->conn->header_len(eh);
start = cw_header_len(eh);
len = cw_put_byte(ob+start,idx);
len += result->type->put(result,ob+start+len);
ob += params->conn->write_header(eh,ob,len);
ob += cw_write_header(eh,ob,len);
idx++;

View File

@ -24,7 +24,7 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
sprintf(key,handler->key,i);
search.key=key;
/*elem = mavl_get(params->conn->local_cfg, &search);*/
elem = mavl_get_first(params->conn->local_cfg,&search);
elem = mavl_get_first(params->local_cfg,&search);
if(elem != NULL){
printf("Elem key: %s\n",elem->key);
}
@ -40,12 +40,12 @@ int cw_out_idx_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemHan
printf("Here we are '%s'! --> %d\n",key,idx);
len =0;
start = mdst + params->conn->header_len(handler);
start = mdst + cw_header_len(handler);
len += cw_put_byte(start+len,idx);
len += cw_ktv_write_struct(params->conn->local_cfg,NULL, handler->type,key,start+len);
len += cw_ktv_write_struct(params->local_cfg,NULL, handler->type,key,start+len);
mdst += params->conn->write_header(handler,mdst,len);
mdst += cw_write_header(handler,mdst,len);
i=idx+1;

View File

@ -20,11 +20,11 @@ int cw_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandlerP
idx++;
}
*/
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
radios = cw_ktv_get_byte(params->local_cfg,"wtp-descriptor/max-radios",0);
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);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst,l);
len+=l;
}
return len;

View File

@ -14,19 +14,19 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
cdst = dst;
offset = params->conn->header_len(handler);
offset = cw_header_len(handler);
i=-1;
while(1){
char basekey[CW_KTV_MAX_KEY_LEN];
cw_KTV_t * result;
i = cw_ktv_idx_get_next(params->conn->local_cfg,"radio",i+1);
i = cw_ktv_idx_get_next(params->local_cfg,"radio",i+1);
if (i==-1)
break;
sprintf(basekey,"radio.%d/%s",i,handler->key);
result = cw_ktv_base_exists(params->conn->local_cfg,basekey);
result = cw_ktv_base_exists(params->local_cfg,basekey);
if (result == NULL){
continue;
}
@ -34,10 +34,10 @@ int cw_out_radio_generic_struct(struct cw_ElemHandler * handler, struct cw_ElemH
l=0;
l+=cw_put_byte(cdst+offset+l,i);
l+= cw_ktv_write_struct(params->conn->local_cfg,NULL, handler->type,basekey,cdst+offset+l);
l+= cw_ktv_write_struct(params->local_cfg,NULL, handler->type,basekey,cdst+offset+l);
cdst+=params->conn->write_header(handler,cdst,l);
cdst+=cw_write_header(handler,cdst,l);
}
return cdst-dst;
}
@ -57,21 +57,21 @@ int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParam
if (sl==NULL){
cw_KTV_t * result;
sprintf(key,"%s/%s",current,next);
result = cw_ktv_base_exists(params->conn->local_cfg,key);
result = cw_ktv_base_exists(params->local_cfg,key);
if (result != NULL){
int offset;
int i,l;
offset = params->conn->header_len(handler);
offset = cw_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->conn->local_cfg,params->conn->default_cfg,
l= cw_ktv_write_struct(params->local_cfg,params->default_cfg,
handler->type,key,dst+offset);
printf("Write struct len %i\n",l);
l=params->conn->write_header(handler,dst,l);
l=cw_write_header(handler,dst,l);
printf("header wr len %d\n",l);
if (handler->patch){
handler->patch(dst+offset,stack);
@ -91,18 +91,18 @@ int cw_out_traverse0(struct cw_ElemHandler * handler, struct cw_ElemHandlerParam
printf("Here we are %s\n",key);
cw_dbg_ktv_dump(params->conn->local_cfg,DBG_INFO,"start"," ", "end" );
cw_dbg_ktv_dump(params->local_cfg,DBG_INFO,"start"," ", "end" );
i=-1;
while(1){
char basekey[CW_KTV_MAX_KEY_LEN];
cw_KTV_t * result;
i = cw_ktv_idx_get_next(params->conn->local_cfg,key,i+1);
i = cw_ktv_idx_get_next(params->local_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->conn->local_cfg,basekey);
result = cw_ktv_base_exists(params->local_cfg,basekey);
if (result == NULL){
continue;
}

View File

@ -23,7 +23,7 @@ int cw_process_element(struct cw_ElemHandlerParams *params, int proto, int vendo
params->elem=NULL;
/* try to retrieve a handler for this message element */
handler = cw_msgset_get_elemhandler(params->conn->msgset,proto, vendor, elem_id);
handler = cw_msgset_get_elemhandler(params->msgset,proto, vendor, elem_id);
if (!handler) {
cw_dbg(DBG_ELEM_ERR, "Unrecognized message element: %d, ignoring",
@ -65,7 +65,9 @@ int cw_process_element(struct cw_ElemHandlerParams *params, int proto, int vendo
return -1;
}
cw_dbg_elem(DBG_ELEM_IN, params->conn, params->msgdata->type, handler,
/*cw_dbg_elem(DBG_ELEM_IN, params->conn, params->msgdata->type, handler,
data,len);*/
cw_dbg_elem(DBG_ELEM_IN, NULL, params->msgdata->type, handler,
data,len);
if (handler->get == NULL){

View File

@ -77,7 +77,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
data = mlistelem_dataptr(elem);
handler = cw_msgset_get_elemhandler(conn->msgset,data->proto,data->vendor,data->id);
/* printf("Elem: %d %d %d %s\n", data->proto, data->vendor, data->id, handler->name);*/
printf("Elem: %d %d %d %s\n", data->proto, data->vendor, data->id, handler->name);
if (handler==NULL){
cw_log(LOG_ERR,"Can't put message element %d %d %d, no handler defined.",
data->proto,data->vendor,data->id);
@ -94,7 +94,15 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
continue;
}
params.conn=conn;
/* params.conn=conn;*/
params.local_cfg=conn->local_cfg;
params.remote_cfg=conn->remote_cfg;
params.default_cfg=conn->default_cfg;
params.global_cfg=conn->global_cfg;
params.msgset=conn->msgset;
params.elemdata = data;
params.elem=NULL;
params.msgdata=msg;
@ -110,7 +118,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
/* if(l>0)
cw_dbg_elem(DBG_ELEM_OUT,conn,type,handler,dst+len,l);
if (strlen(details)){
* if (strlen(details)){
cw_dbg(DBG_ELEM_DETAIL," %s",params.debug_details);
}
*/ len += l;

View File

@ -32,7 +32,7 @@ int cw_read_ac_descriptor(mavl_t store,
struct cw_DescriptorSubelemDef *allowed)
{
cw_ktv_read_struct(params->conn->remote_cfg,acstatus,eh->key,data,len);
cw_ktv_read_struct(params->remote_cfg,acstatus,eh->key,data,len);
if (!allowed)
allowed=allowed_default;

View File

@ -21,7 +21,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);
result = cw_ktv_add(params->conn->remote_cfg, key,
result = cw_ktv_add(params->remote_cfg, key,
handler->type, NULL, elem_data+1,elem_len-1);
params->elem=result;

View File

@ -29,7 +29,7 @@ int cw_read_wtp_descriptor(mavl_t cfg, struct conn *conn,
/* Get number of encryption elements */
ncrypt = cw_get_byte(data + 2);
if (ncrypt == 0) {
if (conn->strict_capwap) {
if (0 /*conn->strict_capwap*/) {
cw_dbg(DBG_ELEM_ERR,
"Bad WTP Descriptor, number of encryption elements is 0.");
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;

View File

@ -1,4 +1,4 @@
#include "conn.h"
#include "msgset.h"
#include "cw.h"
@ -10,3 +10,9 @@ int cw_write_header(struct cw_ElemHandler * handler, uint8_t * dst, int len)
return len + cw_put_elem_hdr(dst, handler->id, len);
}
int cw_header_len(struct cw_ElemHandler * handler)
{
return handler->vendor ? 10 : 4;
}

View File

@ -10,15 +10,15 @@ int cw_write_radio_element(struct cw_ElemHandler * handler, struct cw_ElemHandle
uint8_t * d;
len =0;
sprintf(key,"radio.%d/%s",idx,handler->key);
/*printf("Looking for key: %s\n",key);*/
printf("Looking for readio key: %s\n",key);
search.key=key;
elem = mavl_get(params->conn->local_cfg, &search);
elem = mavl_get(params->local_cfg, &search);
if (elem==NULL){
printf("Nothing found\n");
return 0;
}
@ -27,14 +27,17 @@ int cw_write_radio_element(struct cw_ElemHandler * handler, struct cw_ElemHandle
d = handler->vendor ? dst+10 : dst+4;
/* put radio id */
printf("Putting put byte index: %d\n",idx);
len += cw_put_byte(d+len,idx);
len += ((const cw_Type_t*)(handler->type))->put(elem,d+len);
/* l = len + cw_put_elem_hdr(dst, handler->id, len);*/
/* if (handler->vendor)
if (handler->vendor)
return len + cw_put_elem_vendor_hdr(dst, handler->vendor, handler->id, len);
*/
return len + cw_put_elem_hdr(dst, handler->id, len);
}

View File

@ -41,7 +41,7 @@ int dtls_bio_read(struct conn *conn, char *out, int maxlen)
{
int ret;
if (conn->dtls_buffer_len == 0) {
int len = conn->recv_packet(conn, conn->dtls_buffer, 2048);
int len = conn->recv_packet(conn, conn->dtls_buffer, 4096);
if (len < 4)
return 0;
conn->dtls_buffer_len = len - 4;
@ -77,7 +77,7 @@ int dtls_bio_read(struct conn *conn, char *out, int maxlen)
*/
int dtls_bio_write(struct conn *conn, const char *data, int len)
{
uint8_t buffer[2048];
uint8_t buffer[4096];
int rc;
*((uint32_t *) buffer) = htonl(1 << 24);
memcpy(buffer + 4, data, len);

View File

@ -38,7 +38,7 @@ struct dtls_openssl_data{
SSL_CTX * ctx;
SSL * ssl;
BIO * bio;
uint8_t buffer[2048];
uint8_t buffer[4096];
int len;
int pos;
};

View File

@ -147,6 +147,7 @@ extern const struct cw_Type cw_type_byte;
extern const struct cw_Type cw_type_word;
extern const struct cw_Type cw_type_dword;
extern const struct cw_Type cw_type_bstr16;
extern const struct cw_Type cw_type_bwstr;
extern const struct cw_Type cw_type_str;
extern const struct cw_Type cw_type_ipaddress;
extern const struct cw_Type cw_type_sysptr;
@ -156,6 +157,7 @@ extern const struct cw_Type cw_type_bool;
#define CW_TYPE_WORD (&cw_type_word)
#define CW_TYPE_DWORD (&cw_type_dword)
#define CW_TYPE_BSTR16 (&cw_type_bstr16)
#define CW_TYPE_BWSTR (&cw_type_bwstr)
#define CW_TYPE_IPADDRESS (&cw_type_ipaddress)
#define CW_TYPE_SYSPTR (&cw_type_sysptr)
#define CW_TYPE_STR (&cw_type_str)

View File

@ -295,8 +295,6 @@ int cw_msgset_add(struct cw_MsgSet *set,
/* add the message */
search.type = msgdef->type;
printf("Msg type name %s\n",msgdef->name);
msg = mavl_insert(set->msgdata, &search, &exists);
if (msg == NULL) {
cw_log(LOG_ERR, "Can't create messae");

View File

@ -31,13 +31,18 @@ struct cw_ElemData{
};
struct cw_ElemHandlerParams {
struct conn * conn;
/* struct conn * conn;*/
struct cw_MsgData * msgdata;
struct cw_ElemData * elemdata;
struct sockaddr *from;
mavl_t mand_found;
cw_KTV_t * elem;
char * debug_details;
mavl_t remote_cfg;
mavl_t local_cfg;
mavl_t default_cfg;
mavl_t global_cfg;
struct cw_MsgSet * msgset;
};

View File

@ -201,7 +201,7 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
/* int mtu = nc->mtu; */
int mtu = 1400;
int mtu = 400;
while (msglen>mtu){
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);

View File

@ -91,7 +91,7 @@ int conn_send_data_msg(struct conn * conn, uint8_t *rawmsg,int len)
}
#define MAX_MTU 1500
#define MAX_MTU 9500
int
cw_send_msg( struct conn * conn, uint8_t *msg)
{
@ -155,7 +155,7 @@ cw_send_msg( struct conn * conn, uint8_t *msg)
cw_set_dword(buf+4, conn->fragid<<16 | fragoffset<<3 );
cw_dbg_pkt(DBG_PKT_OUT,conn,buf,packetlen,(struct sockaddr*)&conn->addr);
cw_dbg_pkt(DBG_PKT_OUT,conn,buf,msglen+hlen,(struct sockaddr*)&conn->addr);
return conn->write(conn,buf,msglen + hlen);

View File

@ -1,3 +1,4 @@
MF=Mf-$(KERNEL)-$(ARCH).mk
LIBTARGET=$(OBJDIR)/$(PROG)
@ -14,7 +15,7 @@ $(DNAME): $(MF) $(SOURCES)
@mkdir -p $(LIBARCHDIR)
@$(MAKE) -f $(MF) $(DNAME)
$(MF): Makefile
$(MF): Makefile $(MFDEPS)
@rm -f $(MF)
@echo "CFLAGS=$(CFLAGS)" >> $(MF)
@echo "LDFLAGS=$(LDFLAGS)" >> $(MF)

View File

@ -1,9 +1,8 @@
include ../Config.mak
all:
$(MAKE) -C capwap
$(MAKE) -C capwap80211
$(MAKE) -C cisco
$(MAKE) -C fortinet
# $(MAKE) -C fortinet
# $(CC) -c modload_ac.c -I../
# $(CC) -c modload_wtp.c -I../
@ -11,5 +10,5 @@ clean:
$(MAKE) -C capwap clean
$(MAKE) -C capwap80211 clean
$(MAKE) -C cisco clean
$(MAKE) -C fortinet clean
rm *.o
# $(MAKE) -C fortinet clean
rm -f *.o

View File

@ -30,6 +30,7 @@ DNAME := $(LIBARCHDIR)/mod_capwap.so
CFLAGS+=-fPIC
CFLAGS+= -I ../../ -I../ -I../../include
CFLAGS+=$(INC2)
all: $(SNAME) $(DNAME)
static: $(SNAME)

View File

@ -549,6 +549,7 @@ static struct cw_ElemDef change_state_event_request_elements[] ={
static cw_State_t change_state_event_response_states[] = {
{CAPWAP_STATE_JOIN,CAPWAP_STATE_JOIN},
{CAPWAP_STATE_RUN,CAPWAP_STATE_RUN},
{0,0}
};
static struct cw_ElemDef change_state_event_response_elements[] ={

View File

@ -16,6 +16,6 @@ int capwap_in_ac_descriptor(struct cw_ElemHandler *eh,
};
return cw_read_ac_descriptor(params->conn->remote_cfg,eh,params,data,len,allowed);
return cw_read_ac_descriptor(params->remote_cfg,eh,params,data,len,allowed);
}

View File

@ -20,7 +20,7 @@
* @file
* @brief Implements cw_in_capwap_control_ip_address
*/
#include "cw/conn.h"
#include "mod_capwap.h"
@ -32,15 +32,15 @@ int capwap_in_capwap_control_ip_address(struct cw_ElemHandler *eh,
int idx;
sprintf(key,"%s/address",eh->key);
idx = cw_ktv_idx_get(params->conn->remote_cfg,key);
idx = cw_ktv_idx_get(params->remote_cfg,key);
/* printf("SKEY is %s , idx: %d\n",key,idx);*/
sprintf(key,"%s/address.%d",eh->key,idx+1);
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_IPADDRESS,NULL,data,len-2);
cw_ktv_add(params->remote_cfg,key,CW_TYPE_IPADDRESS,NULL,data,len-2);
sprintf(key,"%s/wtps.%d",eh->key,idx+1);
cw_ktv_add(params->conn->remote_cfg,key,CW_TYPE_WORD,NULL,data+len-2,2);
cw_ktv_add(params->remote_cfg,key,CW_TYPE_WORD,NULL,data+len-2,2);
/* if (handler-id == CW_ELEM_CAPWAP_CONTROL_IPV4_ADDRESS) {
struct sockaddr_in addr;

View File

@ -36,7 +36,7 @@ int capwap_in_mtu_discovery_padding(struct cw_ElemHandler *eh,
cw_dbg(DBG_RFC,
"MTU discovery padding msg elem contains %d non-0xFF byte(s) out of %d, See RFC 5415.",
n, len);
if (params->conn->strict_capwap)
if (0 /*params->conn->strict_capwap*/)
return CAPWAP_RESULT_UNRECOGNIZED_MESSAGE_ELEMENT;
}
return CAPWAP_RESULT_SUCCESS;

View File

@ -22,14 +22,14 @@ int capwap_in_vendor_specific_payload(struct cw_ElemHandler *handler,
vendor_id = cw_get_dword(data);
elem_id = cw_get_word(data + 4);
vhandler = cw_msgset_get_elemhandler(params->conn->msgset,0,vendor_id,elem_id);
vhandler = cw_msgset_get_elemhandler(params->msgset,0,vendor_id,elem_id);
if (!vhandler) {
cw_dbg(DBG_WARN,
"Can't handle Vendor Specific Payload %s/%d, in msg %d (%s) in %s state.",
cw_strvendor(vendor_id), elem_id, params->msgdata->type,
params->msgdata->name, cw_strstate(params->conn->capwap_state));
params->msgdata->name, NULL /*cw_strstate(params->conn->capwap_state)*/);
return 0;
}

View File

@ -19,6 +19,7 @@
#include <stdlib.h>
#include <string.h>
#include "cw/conn.h"
#include "mod_capwap.h"
#include "cw/dbg.h"
@ -133,7 +134,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
char vendor_key[128];
mavl_t cfg = params->conn->remote_cfg;
mavl_t cfg = params->remote_cfg;
sprintf(vendor_key,"%s/%s",eh->key,CW_SKEY_VENDOR);

View File

@ -26,7 +26,8 @@ int capwap_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
int len)
{
int rc;
rc =cw_read_wtp_descriptor(params->conn->remote_cfg, params->conn, eh, data, len, NULL);
/*rc =cw_read_wtp_descriptor(params->remote_cfg, params->conn, eh, data, len, NULL);*/
rc =cw_read_wtp_descriptor(params->remote_cfg, NULL, eh, data, len, NULL);
return rc;
}

View File

@ -58,22 +58,22 @@ int capwap_out_ac_descriptor(struct cw_ElemHandler * eh,
uint8_t *d = dst+4;
char key[CW_KTV_MAX_KEY_LEN];
d+=put_ac_status(params->conn->local_cfg,
params->conn->global_cfg,
d+=put_ac_status(params->local_cfg,
params->global_cfg,
d, eh->key);
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CAPWAP_SUBELEM_AC_HARDWARE_VERSION, key);
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CAPWAP_SUBELEM_AC_SOFTWARE_VERSION, key);
len = d-dst-4;
l = len + cw_put_elem_hdr(dst,eh->id,len);
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,dst,l);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
return l;

View File

@ -63,9 +63,9 @@ int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
int l;
sprintf(key,"%s/address.%d",eh->key,i);
address = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_IPADDRESS);
address = cw_ktv_get(params->local_cfg,key,CW_TYPE_IPADDRESS);
sprintf(key,"%s/wtps.%d",eh->key,i);
wtps = cw_ktv_get_word(params->conn->local_cfg,key,0);
wtps = cw_ktv_get_word(params->local_cfg,key,0);
i++;
if (address==NULL){
break;
@ -93,7 +93,7 @@ int capwap_out_capwap_control_ip_address(struct cw_ElemHandler * eh,
l = address->type->put(address,d+4);
l+=cw_put_word(dst+4+l,wtps);
l+=cw_put_elem_hdr(d,eh->id,l);
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,d+4,l-4);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,d+4,l-4);
d+=l;
}while(address != NULL);

View File

@ -1,3 +1,4 @@
#include "cw/conn.h"
#include "mod_capwap.h"
#include "cw/cw.h"
@ -5,7 +6,7 @@ int capwap_out_capwap_local_ip_address(struct cw_ElemHandler * eh,
struct cw_ElemHandlerParams * params, uint8_t * dst)
{
cw_KTV_t * ip;
ip = cw_ktv_get(params->conn->local_cfg,eh->key,CW_TYPE_IPADDRESS);
ip = cw_ktv_get(params->local_cfg,eh->key,CW_TYPE_IPADDRESS);
if (ip==NULL){
return 0;
}

View File

@ -1,4 +1,5 @@
#include "cw/conn.h"
#include "cw/log.h"
#include "cw/ktv.h"
#include "cw/msgset.h"
@ -47,7 +48,7 @@ int capwap_out_wtp_board_data(struct cw_ElemHandler * eh,
d=dst+4;
cfg = params->conn->local_cfg;
cfg = params->local_cfg;
sprintf(key,"%s/%s",eh->key,CW_SKEY_VENDOR);
val = cw_ktv_get(cfg,key,CW_TYPE_DWORD);

View File

@ -36,7 +36,7 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
d = dst+4;
sprintf(key,"%s/%s",eh->key,CW_SKEY_MAX_RADIOS);
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
if (val != NULL)
d+=val->type->put(val,d);
else{
@ -45,7 +45,7 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
}
sprintf(key,"%s/%s",eh->key,CW_SKEY_RADIOS_IN_USE);
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
if (val != NULL){
d+=val->type->put(val,d);
}
@ -54,29 +54,30 @@ int capwap_out_wtp_descriptor(struct cw_ElemHandler * eh,
}
/* d+=cw_put_encryption_capabilities_7(d,1); */
d+=cw_put_encryption_subelems(d,params->conn->capwap_mode);
/* d+=cw_put_encryption_subelems(d,params->conn->capwap_mode);*/
d+=cw_put_encryption_subelems(d,0);
/*cw_ktv_dump(params->conn->local_cfg,DBG_INFO,"*** ktv dump ***","","*** end of dump ***");*/
/* hardware version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_HARDWARE_VERSION, key);
/* software version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_SOFTWARE_VERSION, key);
/* bootloader version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_BOOTLOADER);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_BOOTLOADER_VERSION, key);
len = d-dst-4;
l = len + cw_put_elem_hdr(dst,eh->id,len);
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,eh,dst,l);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
return l;
}

View File

@ -64,6 +64,9 @@
#define CW_CISCO_ANTENNA_PAYLOAD 41
#define CW_CISCO_CERTIFICATE LW_ELEM_CERTIFICATE /* 44 */
#define CISCO_ELEM_47 47 /* 47 */
#define CISCO_ELEM_WTP_BOARD_DATA LW_ELEM_WTP_BOARD_DATA /* 50 */
#define CW_CISCO_BCAST_SSID_MODE LW_BCAST_SSID_MODE
#define CISCO_ELEM_AP_MODE_AND_TYPE LW_ELEM_80211_WTP_MODE_AND_TYPE /* 54 */

View File

@ -229,7 +229,7 @@ int cisco_in_ap_regulatory_domain(struct cw_ElemHandler *eh,
int idx;
void * type;
idx = cw_ktv_idx_get(params->conn->remote_cfg,eh->key);
idx = cw_ktv_idx_get(params->remote_cfg,eh->key);
sprintf(key,"%s.%d",eh->key,idx+1);
@ -237,7 +237,7 @@ int cisco_in_ap_regulatory_domain(struct cw_ElemHandler *eh,
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);
cw_ktv_read_struct(params->remote_cfg,type,key,data,len);
return 1;
}
@ -261,7 +261,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
type = NULL;
result = cw_ktv_get(params->conn->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16);
result = cw_ktv_get(params->local_cfg,"ac-descriptor/software/version",CW_TYPE_BSTR16);
if (result!=NULL){
if(result->type->len(result)==4){
uint32_t rv;
@ -280,7 +280,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
do {
sprintf(key,"%s.%d",eh->key,idx);
search.key=key;
result = mavl_get_first(params->conn->local_cfg,&search);
result = mavl_get_first(params->local_cfg,&search);
if (result==NULL)
break;
if (strncmp(result->key,key,strlen(key))!=0)
@ -288,7 +288,7 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
if(type == NULL){
sprintf(testkey,"%s/%s",key,"band-id");
result = cw_ktv_get(params->conn->local_cfg,key,CW_TYPE_BYTE);
result = cw_ktv_get(params->local_cfg,key,CW_TYPE_BYTE);
if (result==NULL){
type = cisco_ap_regulatory_domain4;
}
@ -297,9 +297,9 @@ int cisco_out_ap_regulatory_domain(struct cw_ElemHandler * eh,
}
}
start = params->conn->header_len(eh);
len = cw_ktv_write_struct(params->conn->local_cfg,NULL,type,key,ob+start);
ob += params->conn->write_header(eh,ob,len);
start = cw_header_len(eh);
len = cw_ktv_write_struct(params->local_cfg,NULL,type,key,ob+start);
ob += cw_write_header(eh,ob,len);
idx++;
@ -543,7 +543,7 @@ static int cisco_in_lw_del_wlan(struct cw_ElemHandler *eh,
radio_id=cw_get_byte(data);
wlan_id=cw_get_word(data+1);
sprintf(key,"radio.%d/wlan.%d",radio_id,wlan_id);
cw_ktv_del_sub(params->conn->local_cfg,key);
cw_ktv_del_sub(params->local_cfg,key);
cw_dbg(DBG_INFO,"Del WLAN rid=%d, id=%d",wlan_id);
return 0;
}
@ -1261,6 +1261,18 @@ static struct cw_ElemHandler handlers70[] = {
cw_out_radio_generic /* put */
},
{
"Cisco Elem 47", /* name */
CISCO_ELEM_47, /* Element ID */
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
5,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"cisco/elem47", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
},
{
@ -1704,7 +1716,8 @@ static struct cw_ElemDef configuration_status_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_132, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_19, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 1, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_22, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_47, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_81, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_24, 0, 0},
@ -1801,6 +1814,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_15, 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_47, 0, 0},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_81, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_9, 0, 0},
@ -1827,7 +1841,7 @@ static struct cw_ElemDef configuration_update_request_elements[] ={
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_ROUGE_DETECTION, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_RAD_EXTENDED_CONFIG, 0, 0},
{0,0,0,00}
{0,0,0,0,0}
};
@ -1850,12 +1864,12 @@ static struct cw_ElemDef wtp_event_response_elements[] ={
static struct cw_ElemDef change_state_event_request_elements[] ={
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC, 0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_SPAM_VENDOR_SPECIFIC, 1, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_OPER_STATE_DETAIL_CAUSE, 0, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_ADD_WLAN, 1, CW_IGNORE},
{0, CW_VENDOR_ID_CISCO, CISCO_ELEM_OPER_STATE_DETAIL_CAUSE, 1, CW_IGNORE},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 0, 0},
{CW_PROTO_LWAPP, CW_VENDOR_ID_CISCO, CISCO_LWELEM_HARDWARE_INFO, 1, 0},
{0,0,0,0,0}
};

View File

@ -15,7 +15,7 @@ int cisco_in_ac_descriptor(struct cw_ElemHandler *eh,
{0,0, NULL,0, 0}
};
return cw_read_ac_descriptor(params->conn->remote_cfg,eh,params,data,len,allowed);
return cw_read_ac_descriptor(params->remote_cfg,eh,params,data,len,allowed);
/*return cw_read_ac_descriptor(conn->config,data,len,allowed);*/

View File

@ -13,14 +13,14 @@ int cisco_in_spam_vendor_specific(struct cw_ElemHandler *eh,
vendor_id = cw_get_dword(data);
elem_id = cw_get_word(data + 4);
vhandler = cw_msgset_get_elemhandler(params->conn->msgset,CW_PROTO_LWAPP,vendor_id,elem_id);
vhandler = cw_msgset_get_elemhandler(params->msgset,CW_PROTO_LWAPP,vendor_id,elem_id);
if (!vhandler) {
cw_dbg(DBG_WARN,
"Can't handle Vendor Specific LWAPP Payload %s/%d, in msg %d (%s) in %s state.",
cw_strvendor(vendor_id), elem_id, params->msgdata->type,
params->msgdata->name, cw_strstate(params->conn->capwap_state));
params->msgdata->name, NULL /*cw_strstate(params->conn->capwap_state)*/);
return 0;
}

View File

@ -35,7 +35,7 @@ int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerPara
};
return cw_read_wtp_descriptor_7(params->conn->remote_cfg, params->conn, eh, data, len, allowed);
return cw_read_wtp_descriptor_7(params->remote_cfg, NULL /*params->conn*/, eh, data, len, allowed);
}

View File

@ -60,18 +60,18 @@ int cisco_out_ac_descriptor(struct cw_ElemHandler * eh,
uint8_t *d = dst+4;
char key[CW_KTV_MAX_KEY_LEN];
d+=put_ac_status(params->conn->local_cfg,
params->conn->global_cfg,
d+=put_ac_status(params->local_cfg,
params->global_cfg,
d, eh->key);
/* it is important to send software version first,
* because APs don't check the type */
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
1, key);
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
0, key);
@ -79,7 +79,7 @@ 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,params->conn,params->msgdata->type,eh,dst,l);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,eh,dst,l);
return l;

View File

@ -2,7 +2,7 @@
#include <stdint.h>
#include <time.h>
#include "cw/conn.h"
#include "cw/msgset.h"
#include "cw/cw.h"

View File

@ -1,3 +1,5 @@
#include "cw/conn.h"
#include "mod_cisco.h"
#include "cw/cw.h"
@ -5,7 +7,7 @@ int cisco_out_capwap_local_ip_address(struct cw_ElemHandler * eh,
struct cw_ElemHandlerParams * params, uint8_t * dst)
{
cw_KTV_t * ip;
ip = cw_ktv_get(params->conn->local_cfg,eh->key,CW_TYPE_IPADDRESS);
ip = cw_ktv_get(params->local_cfg,eh->key,CW_TYPE_IPADDRESS);
if (ip==NULL){
return 0;
}

View File

@ -13,11 +13,11 @@ int cisco_out_lw_path_mtu(struct cw_ElemHandler * eh,
int len,max;
sprintf(key,"%s/%s",eh->key,"len");
len = cw_ktv_get_word(params->conn->local_cfg,key,0);
len = cw_ktv_get_word(params->local_cfg,key,0);
if (len == 0)
return 0;
sprintf(key,"%s/%s",eh->key,"max");
max = cw_ktv_get_word(params->conn->local_cfg,key,0);
max = cw_ktv_get_word(params->local_cfg,key,0);
lw_set_word(dst+16,max);
lw_set_word(dst+16+2,len);

View File

@ -13,11 +13,11 @@ int cisco_out_radio_generic(struct cw_ElemHandler * handler, struct cw_ElemHandl
int radios;
len =0;
radios = cw_ktv_get_byte(params->conn->local_cfg,"wtp-descriptor/max-radios",0);
radios = cw_ktv_get_byte(params->local_cfg,"wtp-descriptor/max-radios",0);
for(i=0;i<radios+0;i++){
l = cw_write_radio_element(handler,params,i,dst+len);
cw_dbg_elem(DBG_ELEM_OUT,params->conn,params->msgdata->type,handler,dst+len,l);
cw_dbg_elem(DBG_ELEM_OUT,NULL,params->msgdata->type,handler,dst+len,l);
len+=l;
}
return len;

View File

@ -16,7 +16,7 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
d = dst+4;
sprintf(key,"%s/%s",eh->key,CW_SKEY_MAX_RADIOS);
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
if (val != NULL)
d+=val->type->put(val,d);
else{
@ -25,7 +25,7 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
}
sprintf(key,"%s/%s",eh->key,CW_SKEY_RADIOS_IN_USE);
val = cw_ktv_get(params->conn->local_cfg,key, CW_TYPE_BYTE);
val = cw_ktv_get(params->local_cfg,key, CW_TYPE_BYTE);
if (val != NULL){
d+=val->type->put(val,d);
}
@ -38,17 +38,17 @@ int cisco_out_wtp_descriptor(struct cw_ElemHandler * eh,
/* hardware version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_HARDWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_HARDWARE_VERSION, key);
/* software version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_SOFTWARE);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_SOFTWARE_VERSION, key);
/* bootloader version sub element */
sprintf(key,"%s/%s",eh->key,CW_SKEY_BOOTLOADER);
d+=cw_write_descriptor_subelem (d, params->conn->local_cfg,
d+=cw_write_descriptor_subelem (d, params->local_cfg,
CW_SUBELEM_WTP_BOOTLOADER_VERSION, key);
len = d-dst-4;

View File

@ -28,6 +28,7 @@
* Vendor specific message elements defined in LWAPP by Cisco
*/
#define CISCO_LWELEM_9 9
#define CISCO_LWELEM_AP_USERNAME_PASSWORD 18
#define LW_CISCO_MANAGER_IP_ADDR 19
#define CISCO_LWELEM_DISCOVERY_PROTOCOL 20

View File

@ -2,6 +2,7 @@
#define __MOD_CISCO_H
#include <stdint.h>
#include "cw/conn.h"
#include "cw/msgset.h"
int cisco_in_wtp_descriptor(struct cw_ElemHandler *eh, struct cw_ElemHandlerParams * params, uint8_t * data,

View File

@ -22,7 +22,7 @@ capwap-control-ip-address/address.2 :IPAddress: 192.168.0.162
capwap-control-ip-address/wtps.0 :Word: 0
capwap-control-ip-address/wtps.1 :Word: 10
capwap-control-ip-address/wtps.2 :Word: 0
capwap-local-ip-address :IPAddress: 192.168.0.29
capwap-local-ip-address :IPAddress: 192.168.0.14
capwap-timers/echo-interval :Byte: 30
capwap-timers/max-discovery-interval :Byte: 10
capwap-timers/min-discovery-interval :Byte: 0
@ -53,18 +53,16 @@ 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/band-id :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: 0
cisco/ap-sub-mode :Byte: 0
cisco/ap-telnet-ssh/ssh :Bool: false
cisco/ap-telnet-ssh/telnet :Bool: false
cisco/ap-timesync/timestamp :Dword: 1585926286
cisco/ap-timesync/type :Byte: 1
cisco/ap-timesync/timestamp :Dword: 1469608260
cisco/ap-timesync/type :Byte: 0
cisco/ap-username-and-password/802.1x-credentials/option :Word: 2
cisco/ap-username-and-password/802.1x-credentials/password :Str:
cisco/ap-username-and-password/802.1x-credentials/username :Str:
@ -79,6 +77,7 @@ cisco/ap-venue-settings/type :Byte: 1
cisco/board-data-options :Dword: 16777217
cisco/cisco-discovery-protocol/data :Word: 0
cisco/cisco-discovery-protocol/enabled :Bool: false
cisco/elem132 :Bstr16: .x0100000000
cisco/hash/hash :Bstr16: c4084177cd95ddbba1237bfcb3de6780fdf48214
cisco/hash/validate :Bool: true
cisco/loghost-config/last-joined-ap :Str:
@ -86,21 +85,21 @@ cisco/loghost-config/loghost.0 :IPAddress: 7.7.1.3
cisco/loghost-config/loghost.1 :IPAddress: 0.0.0.0
cisco/loghost-config/loghost.2 :IPAddress: 0.0.0.0
cisco/loghost-config/loghost.3 :IPAddress: 0.0.0.0
cisco/mcast-mgid-info :Bstr16: .x002100010000000000000000000000000000000101000000
cisco/mcast-mgid-info :Bstr16: .x000000010000000000000000000000000000000101000000
cisco/mwar-addr/address :IPAddress: 192.168.0.162
cisco/mwar-addr/mwar-type :Byte: 0
cisco/mwar-addr/unknown :Word: 0
cisco/mwar-hash-value :Bstr16: c4084177cd95ddbba1237bfcb3de6780fdf48214
cisco/mwar-type :Byte: 0
cisco/mwar-type :Byte: 1
cisco/rouge-and-mss/enable :Bool: false
cisco/rouge-and-mss/mss :Word: 666
cisco/rouge-and-mss/roge-detection :Bool: true
cisco/rouge-and-mss/tcp-adjust-mss :Word: 0
cisco/rouge-detection/rest :Bstr16: .x000aff800000
cisco/rouge-detection/rouge-detection :Bool: false
cisco/sig-toogle :Bool: true
cisco/sig-toogle :Bool: false
cisco/spam-domain-secret :Bstr16: .xe1ffd18a8f15b3b59c0a47a7f17a96e7cb36174f00
cisco/ssl-certfile :Str: ../../ssl/certs/wtpc.crt
#cisco/ssl-cipher :Str: ALL
cisco/ssl-cipher :Str: RSA:AES-128-CBC:SHA1
cisco/ssl-keyfile :Str: ../../ssl/certs/wtpc.key
cisco/vlan/id :Word: 0
@ -128,10 +127,29 @@ 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/air-space-capability :Byte: 0
radio.0/cisco/antenna-payload/802-11n-rx-antennas :Byte: 7
radio.0/cisco/antenna-payload/802-11n-tx-antennas :Byte: 0
radio.0/cisco/antenna-payload/antenna-1 :Byte: 1
radio.0/cisco/antenna-payload/antenna-2 :Byte: 1
radio.0/cisco/antenna-payload/antenna-mode :Byte: 3
radio.0/cisco/antenna-payload/diversity-selection :Byte: 255
radio.0/cisco/antenna-payload/number-of-antennas :Byte: 2
radio.0/cisco/antenna-payload/unknown :Byte: 3
radio.0/cisco/channel-power :Bstr16: .x08080d0108221c16100a04fefe0208221c16100a04fefe0308221c16100a04fefe0408221c16100a04fefe0508221c16100a04fefe0608221c16100a04fefe0708221c16100a04fefe0808221c16100a04fefe0908221c16100a04fefe0a08221c16100a04fefe0b08221c16100a04fefe0c08221c16100a04fefe0d08221c16100a04fefe
radio.0/cisco/direct-sequence-control/cfg-type :Byte: 1
radio.0/cisco/direct-sequence-control/current-cca-mode :Byte: 0
radio.0/cisco/direct-sequence-control/current-channel :Byte: 1
radio.0/cisco/direct-sequence-control/energy-detect-threshold :Dword: -50
radio.0/cisco/direct-sequence-control/unknown :Byte: 1
radio.0/cisco/elem19 :Bstr16: .xc0a800a10001000bc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem22 :Bstr16: .x0d00b400320102030405060708090a0b0c0d
radio.0/cisco/elem24 :Bstr16: .x003c000c
radio.0/cisco/elem81 :Bstr16: .x00000000010101010a001e0a02051cbfffbfff0a00
radio.0/cisco/lwelem9 :Bstr16: .x0100000000000000000000000000000000
radio.0/cisco/mac-operation/byte75 :Byte: 0
radio.0/cisco/mac-operation/fragmentation-threshold :Word: 2346
radio.0/cisco/mac-operation/long-retry :Byte: 4
radio.0/cisco/mac-operation/reserved :Word: 1
radio.0/cisco/mac-operation/reserved :Byte: 0
radio.0/cisco/mac-operation/rts-threshold :Word: 2347
radio.0/cisco/mac-operation/rx-msdu-lifetime :Dword: 512
radio.0/cisco/mac-operation/short-retry :Byte: 7
@ -146,27 +164,42 @@ radio.0/cisco/rad-extended-config/c-ccat :Word: 0
radio.0/cisco/rad-extended-config/multicast-buffer :Word: 0
radio.0/cisco/rad-extended-config/multicast-data-range :Word: 0
radio.0/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
radio.0/cisco/tx-power/current-tx-power :Word: 10
radio.0/cisco/tx-power-levels :Bstr16: .x070011000e000b000800050002ffff0000
radio.0/cisco/tx-power/current-tx-power :Word: 1
radio.0/cisco/tx-power/reserved :Byte: 1
radio.0/cisco/wtp-radio-config/beacon-period :Word: 0
radio.0/cisco/wtp-radio-config/beacon-period :Word: 100
radio.0/cisco/wtp-radio-config/bss-id :Bstr16: .x0800276edf58
radio.0/cisco/wtp-radio-config/cfg-period :Byte: 0
radio.0/cisco/wtp-radio-config/cfg-period :Byte: 4
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/cfp-maximum-duration :Word: 60
radio.0/cisco/wtp-radio-config/country-str1 :Str: DE
radio.0/cisco/wtp-radio-config/country-str2 :Str: DE
radio.0/cisco/wtp-radio-config/gpr-period :Byte: 10
radio.0/cisco/wtp-radio-config/max-stations :Byte: 200
radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 0
radio.0/cisco/wtp-radio-config/reg :Dword: 256
radio.0/cisco/wtp-radio-config/occupancy-limit :Word: 100
radio.0/cisco/wtp-radio-config/reg :Dword: 167772416
radio.0/cisco/wtp-radio-config/unknown75 :Byte: 0
radio.0/decryption-error-report-period :Word: 120
radio.0/operational-state/cause :Byte: Normal
radio.0/operational-state/state :Byte: 0
radio.0/operational-state/state :Byte: enabled
radio.0/rate_set :Bstr16: .x82848b960c1218243048606c
radio.0/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100
radio.0/wlan.0/add-lw-wlan/misc2 :Word: 4
radio.0/wlan.0/add-lw-wlan/ssid :Str: TubeSSID
radio.0/wlan.0/add-wlan/broadcast-ssid :Bool: true
radio.0/wlan.0/add-wlan/dtim-period :Byte: 1
radio.0/wlan.0/add-wlan/encryption-policy :Dword: 4
radio.0/wlan.0/add-wlan/profile-name :Str: tubeC
radio.0/wlan.0/add-wlan/qos :Byte: 0
radio.0/wlan.0/add-wlan/radio-id :Byte: 0
radio.0/wlan.0/add-wlan/scan-defer-time :Word: 100
radio.0/wlan.0/add-wlan/session-timout :Word: 1800
radio.0/wlan.0/add-wlan/ssid :Str:
radio.0/wlan.0/add-wlan/wep-encryption :Bool: false
radio.0/wlan.0/add-wlan/wep-key :Bstr16: .x5b2a9f4c8b4d28d8f5dbbc0660
radio.0/wlan.0/add-wlan/wep-key-index :Byte: 1
radio.0/wlan.0/add-wlan/wlan-capability :Word: 1073
radio.0/wlan.0/add-wlan/wlan-id :Byte: 1
radio.0/wlan.0/allow-aaa-override :Byte: 0
radio.0/wlan.0/broadcast-ssid :Bool: true
radio.0/wlan.0/dtim-period :Byte: 1
@ -186,10 +219,26 @@ 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/air-space-capability :Byte: 0
radio.1/cisco/antenna-payload/802-11n-rx-antennas :Byte: 7
radio.1/cisco/antenna-payload/802-11n-tx-antennas :Byte: 0
radio.1/cisco/antenna-payload/antenna-1 :Byte: 1
radio.1/cisco/antenna-payload/antenna-2 :Byte: 1
radio.1/cisco/antenna-payload/antenna-mode :Byte: 3
radio.1/cisco/antenna-payload/diversity-selection :Byte: 255
radio.1/cisco/antenna-payload/number-of-antennas :Byte: 2
radio.1/cisco/antenna-payload/unknown :Byte: 3
radio.1/cisco/channel-power :Bstr16: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
radio.1/cisco/elem15 :Bstr16: .x027007ffffffce010001
radio.1/cisco/elem19 :Bstr16: .xc0a800a10001000ac0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem22 :Bstr16: .x1000b4003224282c3034383c4064686c707484888c
radio.1/cisco/elem24 :Bstr16: .x003c000c
radio.1/cisco/elem47 :Bstr16: .x01ccb0000c000f42401999ba1040000003
radio.1/cisco/elem81 :Bstr16: .x00000000010101010a001e0a02050fbfffbfff0a00
radio.1/cisco/lwelem9 :Bstr16: .x0100000000000000000000000000000000
radio.1/cisco/mac-operation/byte75 :Byte: 0
radio.1/cisco/mac-operation/fragmentation-threshold :Word: 2346
radio.1/cisco/mac-operation/long-retry :Byte: 4
radio.1/cisco/mac-operation/reserved :Word: 257
radio.1/cisco/mac-operation/reserved :Byte: 1
radio.1/cisco/mac-operation/rts-threshold :Word: 2347
radio.1/cisco/mac-operation/rx-msdu-lifetime :Dword: 512
radio.1/cisco/mac-operation/short-retry :Byte: 7
@ -198,56 +247,46 @@ radio.1/cisco/multi-domain-capability/first-channel :Word: 36
radio.1/cisco/multi-domain-capability/max-tx-power-level :Word: 20
radio.1/cisco/multi-domain-capability/number-of-channels :Word: 4
radio.1/cisco/multi-domain-capability/reserved :Byte: 1
radio.1/cisco/tx-power/current-tx-power :Word: 10
radio.1/cisco/tx-power-levels :Bstr16: .x070011000e000b000800050002ffff0000
radio.1/cisco/tx-power/current-tx-power :Word: 1
radio.1/cisco/tx-power/reserved :Byte: 1
radio.1/cisco/wtp-radio-config/beacon-period :Word: 100
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-period :Byte: 4
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/cfp-maximum-duration :Word: 60
radio.1/cisco/wtp-radio-config/country-str1 :Str: DE
radio.1/cisco/wtp-radio-config/country-str2 :Str: DE
radio.1/cisco/wtp-radio-config/gpr-period :Byte: 10
radio.1/cisco/wtp-radio-config/max-stations :Byte: 200
radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 0
radio.1/cisco/wtp-radio-config/reg :Dword: 256
radio.1/cisco/wtp-radio-config/occupancy-limit :Word: 100
radio.1/cisco/wtp-radio-config/reg :Dword: 167772416
radio.1/cisco/wtp-radio-config/unknown75 :Byte: 1
radio.1/decryption-error-report-period :Word: 120
radio.1/operational-state/cause :Byte: Normal
radio.1/operational-state/state :Byte: 0
radio.1/operational-state/state :Byte: enabled
radio.1/rate_set :Bstr16: .x8c129824b048606c
radio.1/wlan.0/add-lw-wlan/misc :Bstr16: .x3e9904fac0000100
radio.1/wlan.0/add-lw-wlan/misc2 :Word: 4
radio.1/wlan.0/add-lw-wlan/ssid :Str: TubeSSID
radio.1/wlan.0/add-wlan/broadcast-ssid :Bool: true
radio.1/wlan.0/add-wlan/dtim-period :Byte: 1
radio.1/wlan.0/add-wlan/encryption-policy :Dword: 4
radio.1/wlan.0/add-wlan/profile-name :Str: tubeC
radio.1/wlan.0/add-wlan/qos :Byte: 0
radio.1/wlan.0/add-wlan/radio-id :Byte: 1
radio.1/wlan.0/add-wlan/scan-defer-time :Word: 100
radio.1/wlan.0/add-wlan/session-timout :Word: 1800
radio.1/wlan.0/add-wlan/ssid :Str:
radio.1/wlan.0/add-wlan/wep-encryption :Bool: false
radio.1/wlan.0/add-wlan/wep-key :Bstr16: .xf0571b63dc70fdf913e2bd0806
radio.1/wlan.0/add-wlan/wep-key-index :Byte: 1
radio.1/wlan.0/add-wlan/wlan-capability :Word: 17
radio.1/wlan.0/add-wlan/wlan-id :Byte: 1
radio.1/wtp-radio-information :Dword: 2
#radio.2/cisco/rad-extended-config/beacon-interval :Word: 48128
#radio.2/cisco/rad-extended-config/beacon-range :Word: 0
#radio.2/cisco/rad-extended-config/c-ccat :Word: 1
#radio.2/cisco/rad-extended-config/multicast-buffer :Word: 0
#radio.2/cisco/rad-extended-config/multicast-data-range :Word: 0
#radio.2/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
#radio.3/cisco/rad-extended-config/beacon-interval :Word: 59392
#radio.3/cisco/rad-extended-config/beacon-range :Word: 0
#radio.3/cisco/rad-extended-config/c-ccat :Word: 1
#radio.3/cisco/rad-extended-config/multicast-buffer :Word: 0
#radio.3/cisco/rad-extended-config/multicast-data-range :Word: 0
#radio.3/cisco/rad-extended-config/rx-sensop-threshold :Word: 0
radio.255/admin-state :Byte: reserved
radio.255/operational-state/cause :Byte: Normal
radio.255/operational-state/state :Byte: 0
radio/0/cisco/regulatory-domain/code0 :Byte: 0
radio/0/cisco/regulatory-domain/code1 :Byte: 1
radio/0/cisco/regulatory-domain/set :Bool: true
radio/0/cisco/regulatory-domain/slot :Byte: 0
radio/0/wtp-radio-information :Dword: 1
radio/1/cisco/regulatory-domain/code0 :Byte: 0
radio/1/cisco/regulatory-domain/code1 :Byte: 1
radio/1/cisco/regulatory-domain/set :Bool: true
radio/1/cisco/regulatory-domain/slot :Byte: 0
radio/1/wtp-radio-information :Dword: 1
radio.255/operational-state/state :Byte: enabled
radio/wlan/encryption-policy :Dword: 16777216
radio/wlan/radio-od :Byte: 1
radio/wlan/wlan-capability :Word: 17
@ -276,7 +315,7 @@ wtp-descriptor/software/version :Bstr16: .x07007400
wtp-fallback :Byte: 1
wtp-frame-tunnel-mode :Byte: 4
wtp-mac-type :Byte: 1
wtp-name :Bstr16: tube
wtp-name :Bstr16: Supertube
wtp-reboot-statistics/ac-initiated-count :Word: 2
wtp-reboot-statistics/hw-failure-count :Word: 0
wtp-reboot-statistics/last-failure-type :Byte: 0

View File

@ -38,6 +38,6 @@ int configure(struct conn * conn)
cw_dbg_ktv_dump(conn->remote_cfg,DBG_INFO,"Config ***","CFG: ", "End config ***");
// cw_ktv_set_byte(conn->remote_cfg,"
exit(0);
/*exit(0);*/
return 1;
}

View File

@ -27,7 +27,7 @@
#include "cw/dbg.h"
#include "cfg.h"
int update =0;
int update =1;
/*
int handle_update_req(struct conn *conn, struct cw_action_in *a, uint8_t * data,
@ -167,13 +167,15 @@ int run(struct conn * conn)
if ( !cw_result_is_ok(rc))
break;
clean_cfg(conn->remote_cfg);
printf("Saving Config\n");
mavl_merge(conn->local_cfg,conn->remote_cfg);
cw_ktv_save(conn->local_cfg,"cisco.ktv");
clean_cfg(conn->remote_cfg);
/*cw_dbg(DBG_X,"We hav a message processed");*/
update=1;
do_update(conn);

View File

@ -159,7 +159,7 @@ int main (int argc, char **argv)
/* conn->mod=mod;*/
conn->detected = 1;
conn->dtls_verify_peer=0;
conn->dtls_mtu = 12000;
conn->dtls_mtu = 1200;
conn->msgset=msgset;
conn->local_cfg = global_cfg;
conn->remote_cfg = NULL;
@ -196,7 +196,6 @@ exit(0);
/*cw_run_discovery(conn, "255.255.255.255","192.168.56.1", &dis);*/
/* cw_run_discovery(conn, "255.255.255.255",NULL, &dis);*/
cw_run_discovery(conn, "192.168.0.162","192.168.0.14", &dis);
cw_dbg_ktv_dump(dis.prio_ip, DBG_INFO, "=== IP list ===", "IP", "=== END IP List ===");

View File

@ -9,7 +9,7 @@ set -x
NAME=$1
TYPE=$2
DAYS=6000
DIR=./certs
ROOT_CA_DIR=./root-ca
@ -65,8 +65,6 @@ then
fi
CISCOTIME='2013-12-24 08:15:42'
if [ "$TYPE" = "cisco-ac" ]
then
SUBJ="/C=US/ST=California/L=San Jose/O=Cisco Virtual Wireless LAN Controller/CN=DEVICE-AC-TUBE/emailAddress=7u83@mail.ru"
@ -82,14 +80,14 @@ then
openssl req -nodes -new -x509 \
-sha1 \
-extensions v3_ca \
-days 3650 \
-newkey rsa:2048 \
-days ${DAYS} \
-newkey rsa:${KEYSIZE} \
-keyout certs/${NAME}.key -out certs/${NAME}.crt \
-config openssl.cnf \
-x509 \
-subj "$SUBJ"
$OPENSSL x509 -in $DIR/$NAME.crt -out $DIR/$NAME.pem -days=128
$OPENSSL x509 -in $DIR/$NAME.crt -out $DIR/$NAME.pem -days=${DAYS}

View File

@ -7,7 +7,7 @@ then
fi
echo clock set $(date "+%H:%M:%S %d %b %Y")
#echo clock set $(date "+%H:%M:%S %d %b %Y")
echo debug capwap console cli
echo configure terminal
echo crypto ca profile enrollment ACTube

View File

@ -7,6 +7,8 @@ CONFIG=openssl.cnf
ROOT_CA_DIR=./root-ca
INT_CA_DIR=./intermediate-ca
DAYS=6000
if [ ! -e $ROOT_CA_DIR ]
@ -42,11 +44,11 @@ mkrootca()
# Create a self-signed root CA
openssl req -nodes -new -x509 \
-sha1 \
-days ${DAYS} \
-extensions v3_ca \
-days 3650 \
-newkey rsa:2048 \
-newkey rsa:${KEYSIZE} \
-keyout $ROOT_CA_DIR/${PREF}root-ca.key -out $ROOT_CA_DIR/${PREF}root-ca.crt \
-config openssl.cnf \
-config ${CONFIG} \
-x509 \
-subj "$ROOT_SUBJ"
@ -58,7 +60,7 @@ mkrootca()
-subj "$INT_SUBJ"
# Sign intermediate CA cert using previously created root CA
openssl ca -config openssl.cnf -batch -keyfile $ROOT_CA_DIR/${PREF}root-ca.key \
openssl ca -config ${CONFIG} -batch -keyfile $ROOT_CA_DIR/${PREF}root-ca.key \
-cert $ROOT_CA_DIR/${PREF}root-ca.crt \
-extensions v3_ca -notext -md sha1 -in $INT_CA_DIR/${PREF}int-ca.csr \
-out $INT_CA_DIR/${PREF}int-ca.crt

View File

@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions = crl_ext
default_days = 365 # how long to certify for
default_days = 6000 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md = sha256 #md5 # use public key default MD
preserve = no # keep passed DN ordering

View File

@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions = crl_ext
default_days = 365 # how long to certify for
default_days = 6000 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md = md5 # use public key default MD
preserve = no # keep passed DN ordering

View File

@ -70,7 +70,7 @@ cert_opt = ca_default # Certificate field options
# crlnumber must also be commented out to leave a V1 CRL.
# crl_extensions = crl_ext
default_days = 365 # how long to certify for
default_days = 6000 # how long to certify for
default_crl_days= 30 # how long before next CRL
default_md = md5 # use public key default MD
preserve = no # keep passed DN ordering

View File

@ -1,2 +1,2 @@
#!/bin/sh
indent -l90 -kr -ts8 -i8 -cli8 -cbi0 $1
indent -l80 -kr -ts8 -i8 -cli8 -cbi0 $1