ac compiles w/o warnings

This commit is contained in:
7u83 2022-08-26 08:05:41 +02:00
parent c3b921292b
commit d127263d80
18 changed files with 110 additions and 292 deletions

View File

@ -97,10 +97,8 @@ prompt(EditLine *el )
rc=get_result(act_f,str2,64);
}
static char a[] = "\1\033[7m\1Edit$\1\033[0m\1 ";
static char b[] = "> ";
return (continuation ? b : str);
return (continuation ? "> " : str);
}
static void

View File

@ -289,13 +289,13 @@ int init_bcast_addrs(cw_Cfg_t *cfg)
if (ifa->ifa_broadaddr) {
char *s,*sr;
char *s; //,*sr;
sock_addrtostr(ifa->ifa_broadaddr, str, 100,1);
*strchr(str, ':') = 0;
s = cw_strdup(str);
sr = mavl_add_str(t, s);
mavl_add_str(t, s);
// printf("BCAST = %p --- %p: %s\n",str,s,str);

View File

@ -45,31 +45,31 @@ actube/rpc/listen: tcp:127.0.0.1:5000
actube/rpc/enable: true
ac-descriptor/dtls-policy: 1
ac-descriptor/hardware/vendor: 4232704
ac-descriptor/hardware/version: .x01000001
ac-descriptor/max-wtps : 200
ac-descriptor/active-wtps: 2
ac-descriptor/r-mac-field: 1
ac-descriptor/reserved1 : 0
ac-descriptor/security : 2
ac-descriptor/software/vendor : 0
ac-descriptor/software/version: v0.0.1
ac-descriptor/station-limit: 1000
ac-descriptor/stations: 0
capwap/ac-descriptor/dtls-policy: 1
capwap/ac-descriptor/hardware/vendor: 4232704
capwap/ac-descriptor/hardware/version: .x01000001
capwap/ac-descriptor/max-wtps : 200
capwap/ac-descriptor/active-wtps: 2
capwap/ac-descriptor/r-mac-field: 1
cawpap/ac-descriptor/reserved1 : 0
capwap/ac-descriptor/security : 2
capwap/ac-descriptor/software/vendor : 0
capwap/ac-descriptor/software/version: v0.0.1
capwap/ac-descriptor/station-limit: 1000
capwap/ac-descriptor/stations: 0
capwap-control-ip-address/address.0: 192.168.0.24
capwap/control-ip-address/address.0: 192.168.0.24
#
# CAPWAP Timers
#
capwap-timers/change-state-pending-timer: Word: 3
capwap-timers/data-check-timer: Word: 10
capwap-timers/echo-interval :Byte: 30
capwap-timers/max-discovery-interval :Byte: 10
capwap/timers/change-state-pending-timer: Word: 3
capwap/timers/data-check-timer: Word: 10
capwap/timers/echo-interval :Byte: 30
capwap/timers/max-discovery-interval :Byte: 10

View File

@ -114,8 +114,10 @@ int dataman_process_keep_alive(struct netconn *nc, uint8_t *rawmsg, int len)
((uint16_t*)sessid)[0]=sessid_len;
memcpy(bstr16_data(sessid),cw_get_elem_data(elem),sessid_len);
struct wtpman * wtpman = wtplist_get_by_session_id(sessid);
stop();
struct wtpman * wtpman =NULL;
// struct wtpman * wtpman = wtplist_get_by_session_id(sessid);
if (wtpman){
if (!dm->wtpman)
dm->wtpman=wtpman;

View File

@ -203,7 +203,7 @@ int discovery_cache_get(struct cw_DiscoveryCache * cache,struct sockaddr *addr,
{
cw_dbg(DBG_X,"DISCOVERY CACHE ---------------------------- DOUND BY ADDR");
char str[128];
sock_addrtostr(&elem->addr,str,128,1);
sock_addrtostr((struct sockaddr*)&elem->addr,str,128,1);
printf("ELEM addr: %s\n",str);
}

View File

@ -313,9 +313,9 @@ int show_aps (FILE *out)
struct cw_Conn * conn;
conn = mavliter_get_ptr (&it);
print_mw(out,16,cw_cfg_get(conn->remote_cfg, "wtp-name", "Unknown"));
print_mw(out,16,cw_cfg_get(conn->remote_cfg, "wtp-board-data/model-no", "Unknown"));
vendor = cw_cfg_get(conn->remote_cfg, "wtp-board-data/vendor", "0");
print_mw(out,16,cw_cfg_get(conn->remote_cfg, "capwap/wtp-name", "Unknown"));
print_mw(out,16,cw_cfg_get(conn->remote_cfg, "capwap/wtp-board-data/model-no", "Unknown"));
vendor = cw_cfg_get(conn->remote_cfg, "capwap/wtp-board-data/vendor", "0");
print_mw(out,14,vendor);
sock_addr2str_p (&conn->addr, addr);
print_mw(out,16,addr);
@ -342,7 +342,7 @@ struct cw_Conn * find_ap(const char *name)
struct cw_Conn * conn;
conn = mavliter_get_ptr (&it);
wtpname = cw_cfg_get (conn->remote_cfg, "wtp-name", NULL);
wtpname = cw_cfg_get (conn->remote_cfg, "capwap/wtp-name", NULL);
if (wtpname == NULL)
continue;

View File

@ -131,7 +131,7 @@ struct mavl * cw_statemachine_load_states (struct mavl * statemachine_states, cw
cw_strstate(s->state));
s++;
}
return 1;
return NULL;
}

View File

@ -78,7 +78,7 @@ struct wtpman * wtplist_get(const struct sockaddr * addr)
}
struct wtpman * wtplist_get_by_session_id(bstr16_t *session_id)
struct wtpman * wtplist_get_by_session_id(bstr16_t session_id)
{
struct cw_Conn search;
struct cw_Conn * conn;

View File

@ -13,7 +13,7 @@ extern struct wtpman * wtplist_add(struct wtpman * wtpman);
extern void wtplist_remove(struct wtpman * wtpman);
extern void wtplist_lock();
extern void wtplist_unlock();
extern struct wtpman * wtplist_get_by_session_id(bstr16_t *session_id);
extern struct wtpman * wtplist_get_by_session_id(bstr16_t session_id);
struct connlist * wtplist_get_connlist(void);
#endif

View File

@ -166,7 +166,7 @@ static int wtpman_join(void *arg)
static void wtpman_image_data(struct wtpman *wtpman)
void wtpman_image_data(struct wtpman *wtpman)
{
/* char sock_buf[SOCK_ADDR_BUFSIZE];
struct cw_Conn *conn = wtpman->conn;
@ -300,12 +300,12 @@ int cw_run_state_machine(struct cw_Conn *conn, time_t * timer)
static void *wtpman_main(void *arg)
{
mavl_t r;
//mavl_t r;
int rc;
time_t timer;
char sock_buf[SOCK_ADDR_BUFSIZE];
//char sock_buf[SOCK_ADDR_BUFSIZE];
struct cw_Conn *conn;
int last_state;
// int last_state;
struct wtpman *wtpman = (struct wtpman *) arg;
wtpman->conn->seqnum = 0;
@ -346,8 +346,8 @@ static void *wtpman_main(void *arg)
while (1) {
int wait_join;
int wait_change_state;
//int wait_join;
//int wait_change_state;
@ -397,7 +397,7 @@ static void *wtpman_main(void *arg)
/* dtls is established, goto join state */
/*
conn->capwap_state = CAPWAP_STATE_JOIN;
if (!wtpman_join(wtpman)) {
wtpman_remove(wtpman);
@ -410,182 +410,14 @@ static void *wtpman_main(void *arg)
sock_addr2str_p(&conn->addr, sock_buf),
format_bin2hex(conn->session_id, 16));
*/
exit(0);
/*
// cw_dbg(DBG_INFO, "Creating data thread");
// pthread_t thread;
// pthread_create(&thread, NULL, (void *) wtpman_run_data, (void *) wtpman);
*/
/* here the WTP has joined, now we assume an image data request
or a configuration status request. Nothing else.
*/
rc = 0;
while (!cw_timer_timeout(timer)
&& wtpman->conn->capwap_state == CAPWAP_STATE_CONFIGURE) {
rc = cw_read_messages(wtpman->conn);
if (rc < 0) {
if (errno != EAGAIN)
break;
}
}
cw_dbg_ktv_dump(conn->remote_cfg, DBG_INFO,
"-------------dump------------", "DMP",
"---------end dump --------");
if (!cw_result_is_ok(rc)) {
cw_dbg(DBG_INFO, "WTP Problem: %s", cw_strrc(rc));
wtpman_remove(wtpman);
return NULL;
}
if (conn->capwap_state == CW_STATE_IMAGE_DATA) {
wtpman_image_data(wtpman);
return NULL;
}
conn->capwap_state = CAPWAP_STATE_RUN;
/*
// XXX testing ...
// DBGX("Cofig to sql", "");
// props_to_sql(conn,conn->incomming,0);
// radios_to_sql(conn);
*/
/*conn->msg_end=msg_end_handler; */
/* The main run loop */
reset_echointerval_timer(wtpman);
rc = 0;
while (wtpman->conn->capwap_state == CAPWAP_STATE_RUN) {
rc = cw_read_messages(wtpman->conn);
if (rc < 0) {
if (errno != EAGAIN)
break;
}
/*// cw_dbg(DBG_X, "Time left: %d",
// */
/*cw_timer_timeleft(wtpman->echointerval_timer); */
if (cw_timer_timeout(wtpman->echointerval_timer)) {
cw_dbg(DBG_INFO, "Lost connection to WTP:%s",
sock_addr2str_p(&conn->addr, sock_buf));
break;
}
/*
// mavl_del_all(conn->outgoing);
// conn_clear_upd(conn,1);
// props_to_sql(conn,conn->incomming,0);
// radios_to_sql(conn);
*/
r = db_get_update_tasks(conn,
sock_addr2str(&conn->addr, sock_buf));
if (r) {
/*
// if (!conn->outgoing->count)
// continue;
*/
cw_dbg(DBG_INFO, "Updating WTP %s",
sock_addr2str(&conn->addr, sock_buf));
rc = cw_send_request(conn,
CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
/*
// mavl_merge(conn->config, conn->outgoing);
// mavl_destroy(conn->outgoing);
// conn->outgoing = mbag_create();
// props_to_sql(conn,conn->incomming,0);
// radios_to_sql(conn);
// mavl_destroy(r);
*/
}
r = db_get_radio_tasks(conn,
sock_addr2str(&conn->addr, sock_buf));
if (r) {
/*
// if (!conn->radios_upd->count)
// continue;
*/
cw_dbg(DBG_INFO, "Updating Radios for %s",
sock_addr2str(&conn->addr, sock_buf));
rc = cw_send_request(conn,
CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST);
/*
// conn_clear_upd(conn,1);
// mavl_destroy(conn->radios_upd);
// conn->radios_upd=mbag_i_create();
// radios_to_sql(conn);
*/
/*
rc = cw_send_request(conn, CW_MSG_CONFIGURATION_UPDATE_REQUEST);
mavl_merge(conn->config, conn->outgoing);
mavl_destroy(conn->outgoing);
conn->outgoing = mbag_create();
config_to_sql(conn);
radios_to_sql(conn);
mavl_destroy(r);
*/
}
}
db_ping_wtp(sock_addr2str_p(&conn->addr, sock_buf), "");
wtpman_remove(wtpman);
return NULL;
}
static void wtpman_run_dtls(void *arg)
{
char sock_buf[SOCK_ADDR_BUFSIZE];
struct wtpman *wtpman = (struct wtpman *) arg;
/* reject connections to our multi- or broadcast sockets */
if (socklist[wtpman->socklistindex].type != SOCKLIST_UNICAST_SOCKET) {
cw_dbg(DBG_DTLS,
"Dropping connection from %s to non-unicast socket.",
sock_addr2str_p(&wtpman->conn->addr, sock_buf));
wtpman_remove(wtpman);
return;
}
/*// time_t timer = cw_timer_start(wtpman->conn->wait_dtls);*/
/* establish dtls session */
if (!wtpman_dtls_setup(wtpman)) {
wtpman_remove(wtpman);
return;
}
wtpman_main(arg);
}
void wtpman_destroy(struct wtpman *wtpman)
{
@ -601,10 +433,10 @@ void wtpman_destroy(struct wtpman *wtpman)
static void copy(struct cw_ElemHandlerParams * params)
{
struct wtpman * wtpman;
struct cw_Conn * conn;
wtpman = (struct wtpman*)params->conn->data;
conn = (struct cw_Conn*)params->conn;
// struct wtpman * wtpman;
//struct cw_Conn * conn;
//wtpman = (struct wtpman*)params->conn->data;
//conn = (struct cw_Conn*)params->conn;
// cw_dbg(DBG_X,"------------- Here is the config we ve got from WTP ---------------- ");
@ -632,7 +464,7 @@ static int join_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, in
cw_dbg(DBG_X,"JOIN Callback");
copy(params);
const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default");
const char * wtpname = cw_cfg_get(conn->local_cfg,"capwap/wtp-name","default");
sprintf(filename,"wtp-join-%s.ckv",wtpname);
cw_cfg_save(filename,params->cfg,NULL);
cw_cfg_clear(params->cfg);
@ -649,7 +481,7 @@ static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr,
cw_dbg(DBG_X,"UPDATE Callback");
copy(params);
const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default");
const char * wtpname = cw_cfg_get(conn->local_cfg,"capwap/wtp-name","default");
sprintf(filename,"wtp-status-%s.ckv",wtpname);
cw_cfg_save(filename,params->cfg,NULL);
//stop();
@ -666,8 +498,8 @@ static int event_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, i
cw_dbg(DBG_X,"WTP EVENT Callback");
copy(params);
const char * wtpname = cw_cfg_get(conn->local_cfg,"wtp-name","default");
sprintf(filename,"wtp-status-%s.ckv",wtpname);
const char * wtpname = cw_cfg_get(conn->local_cfg,"capwap/wtp-name","default");
sprintf(filename,"wtp-event-%s.ckv",wtpname);
cw_cfg_save(filename,params->cfg,NULL);
//stop();
return 0;
@ -676,16 +508,6 @@ static int event_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, i
static setup_complete(struct cw_Conn *conn)
{
struct wtpman * wtpman = (struct wtpman *)conn->data;
// wtpman->pjoin = cw_msgset_set_postprocess(conn->msgset,CAPWAP_MSG_JOIN_REQUEST,join_cb);
// wtpman->pupdate = cw_msgset_set_postprocess(conn->msgset,CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST,update_cb);
cw_dbg(DBG_X,"SETUP COMPLETE");
}
struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
int dtlsmode, cw_Cfg_t * global_cfg)
@ -778,7 +600,7 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
wtpman->conn->strict_capwap = conf_strict_capwap;
wtpman->conn->strict_hdr = conf_strict_headers;
wtpman->conn->setup_complete = setup_complete;
// wtpman->conn->setup_complete = setup_complete;
/*
// wtpman->conn->radios = mbag_i_create();
// wtpman->conn->radios_upd = mbag_i_create();
@ -806,8 +628,8 @@ struct wtpman *wtpman_create(int socklistindex, struct sockaddr *srcaddr,
cw_mod_get_msg_set(wtpman->conn, cmod, bmod);
wtpman->conn->detected = 1;
cmod->setup_cfg(wtpman->conn);
if (wtpman->conn->setup_complete)
wtpman->conn->setup_complete(wtpman->conn);
// if (wtpman->conn->setup_complete)
// wtpman->conn->setup_complete(wtpman->conn);
}

View File

@ -640,7 +640,7 @@ uint8_t cw_cfg_get_byte_l(cw_Cfg_t ** cfgs, char *key, uint8_t def)
uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def)
uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, const char *key, uint16_t def)
{
struct cw_Val v;
const char *s = cw_cfg_get(cfg,key,NULL);
@ -650,7 +650,7 @@ uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def)
return v.val.word;
}
uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, char *key, uint16_t def)
uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, const char *key, uint16_t def)
{
struct cw_Val v;
const char *s = cw_cfg_get_l(cfg,key,NULL);

View File

@ -39,7 +39,7 @@ struct cw_Cfg_entry *cw_cfg_iter_next(struct cw_Cfg_iter *cfi, const char *key);
void cw_cfg_iter_init(cw_Cfg_t * cfg, struct cw_Cfg_iter *cfi, const char *base);
int cw_cfg_get_bool(cw_Cfg_t * cfg, const char * key, int def);
uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, char *key, uint16_t def);
uint16_t cw_cfg_get_word(cw_Cfg_t * cfg, const char *key, uint16_t def);
void cw_cfg_set_int(cw_Cfg_t * cfg, const char * key, int val);
uint8_t cw_cfg_get_byte(cw_Cfg_t * cfg, char *key, uint8_t def);
bstr16_t cw_cfg_get_bstr16(cw_Cfg_t * cfg, const char * key, const char *def);
@ -55,7 +55,7 @@ cw_Val_t * cw_cfg_get_val_l(cw_Cfg_t ** cfgs, const char *key, const struct cw_T
int cw_cfg_base_exists_l(cw_Cfg_t ** cfgs, const char *key);
int cw_cfg_save(const char *filename, cw_Cfg_t *cfg, const char *format, ...);
uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, char *key, uint16_t def);
uint16_t cw_cfg_get_word_l(cw_Cfg_t ** cfg, const char *key, uint16_t def);
void cw_cfg_fdump(FILE *f, cw_Cfg_t * cfg);
int cw_cfg_read_from_string(const char *str, cw_Cfg_t *cfg);

View File

@ -1,7 +1,7 @@
#ifndef __KEYS_H
#define __KEYS_H
#define CW_KEY_WTP_DESCRIPTOR "wtp-descriptor"
//#define CW_KEY_WTP_DESCRIPTOR "capwap/wtp-descriptor"
#define CW_SKEY_HARDWARE "hardware"
#define CW_SKEY_SOFTWARE "software"
@ -15,8 +15,8 @@
#define CW_SKEY_RADIOS_IN_USE "radios-in-use"
#define CW_KEY_WTP_NAME "wtp-name"
#define CW_KEY_DISCOVERY_TYPE "discovery-type"
//#define CW_KEY_WTP_NAME "wtp-name"
//#define CW_KEY_DISCOVERY_TYPE "discovery-type"
#define CW_KEY_WTP_MAC_TYPE "wtp-mac-type"
#define CW_KEY_WTP_FRAME_TUNNEL_MODE "wtp-frame-tunnel-mode"

View File

@ -117,7 +117,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BYTE, /* type */
"wtp-mac-type", /* Key */
"capwap/wtp-mac-type", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
@ -131,18 +131,18 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
14,1024, /* min/max length */
NULL, /* type */
CW_KEY_WTP_BOARD_DATA, /* Key */
"capwap/wtp-board-data", /* Key */
capwap_in_wtp_board_data, /* get */
capwap_out_wtp_board_data /* put */
}
,
{
"WTP Descriptor", /* name */
CAPWAP_ELEM_WTP_DESCRIPTOR, /* Element ID */
CAPWAP_ELEM_WTP_DESCRIPTOR, /* #Element ID */
0,0, /* Vendor / Proto */
33,1024, /* min/max length */
NULL, /* type */
CW_KEY_WTP_DESCRIPTOR, /* Key */
"capwap/wtp-descriptor", /* Key */
capwap_in_wtp_descriptor, /* get */
capwap_out_wtp_descriptor, /* put */
}
@ -153,7 +153,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BYTE, /* type */
CW_KEY_WTP_FRAME_TUNNEL_MODE, /* Key */
"capwap/wtp-frame-tunnel-mode", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -193,7 +193,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
0,0, /* min/max length */
NULL, /* type */
CW_KEY_AC_DESCRIPTOR, /* Key */
"capwap/ac-descriptor", /* Key */
capwap_in_ac_descriptor, /* get */
capwap_out_ac_descriptor /* put */
}
@ -205,7 +205,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,CAPWAP_MAX_AC_NAME_LEN, /* min/max length */
CW_TYPE_BSTR16, /* type */
"ac-name", /* Key */
"capwap/ac-name", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -217,7 +217,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
6,6, /* min/max length */
CW_TYPE_BSTR16, /* type */
"capwap-control-ip-address", /* Key */
"capwap/control-ip-address", /* Key */
capwap_in_capwap_control_ip_address, /* get */
capwap_out_capwap_control_ip_address /* put */
},
@ -228,7 +228,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
18,18, /* min/max length */
CW_TYPE_BSTR16, /* type */
"capwap-control-ip-address", /* Key */
"capwap/control-ip-address", /* Key */
capwap_in_capwap_control_ip_address, /* get */
capwap_out_capwap_control_ip_address /* put */
}
@ -241,7 +241,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,CAPWAP_MAX_LOCATION_DATA_LEN, /* min/max length */
CW_TYPE_BSTR16, /* type */
"location-data", /* Key */
"capwap/location-data", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -253,7 +253,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,CAPWAP_MAX_WTP_NAME_LEN, /* min/max length */
CW_TYPE_BSTR16, /* type */
"wtp-name", /* Key */
"capwap/wtp-name", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -264,7 +264,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
CAPWAP_SESSION_ID_LEN,CAPWAP_SESSION_ID_LEN, /* min/max length */
CW_TYPE_BSTR16, /* type */
"session-id", /* Key */
"capwap/session-id", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -276,7 +276,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
4,4, /* min/max length */
CW_TYPE_DWORD, /* type */
"result-code", /* Key */
"capwap/result-code", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -288,7 +288,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,1, /* min/max length */
CW_TYPE_BYTE, /* type */
"ecn-support", /* Key */
"capwap/ecn-support", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -300,7 +300,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
2,2, /* min/max length */
CW_TYPE_WORD, /* type */
"maximum-message-length", /* Key */
"capwap/maximum-message-length", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -312,7 +312,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
4,4, /* min/max length */
CW_TYPE_IPADDRESS, /* type */
"capwap-local-ip-address", /* Key */
"capwap/local-ip-address", /* Key */
cw_in_generic, /* get */
capwap_out_capwap_local_ip_address /* put */
}
@ -323,7 +323,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
16,16, /* min/max length */
CW_TYPE_IPADDRESS, /* type */
"capwap-local-ip-address", /* Key */
"capwap/local-ip-address", /* Key */
cw_in_generic, /* get */
capwap_out_capwap_local_ip_address /* put */
}
@ -336,7 +336,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
2,2, /* min/max length */
CW_TYPE_WORD, /* type */
"statistics-timer", /* Key */
"capwap/statistics-timer", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -348,7 +348,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
15,15, /* min/max length */
CW_TYPE_STRUCT, /* type */
"wtp-reboot-statistics", /* Key */
"capwap/wtp-reboot-statistics", /* Key */
cw_in_generic, /* handler */
cw_out_generic, /* put */
NULL,
@ -364,7 +364,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
2, 2, /* min/max length */
CW_TYPE_STRUCT, /* type */
"admin-state", /* Key */
"capwap/admin-state", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic, /* put */
NULL,
@ -380,7 +380,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
2, 2, /* min/max length */
CW_TYPE_STRUCT, /* type */
"capwap-timers", /* Key */
"capwap/timers", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
@ -395,7 +395,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
3, 3, /* min/max length */
CW_TYPE_WORD, /* type */
"decryption-error-report-period", /* Key */
"capwap/decryption-error-report-period", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic /* put */
}
@ -407,7 +407,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
4, 4, /* min/max length */
CW_TYPE_DWORD, /* type */
"idle-timeout", /* Key */
"capwap/idle-timeout", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -419,7 +419,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
1, 1, /* min/max length */
CW_TYPE_BYTE, /* type */
"wtp-fallback", /* Key */
"capwap/wtp-fallback", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -430,7 +430,7 @@ static struct cw_ElemHandler handlers[] = {
0, 0, /* Vendor / Proto */
3, 3, /* min/max length */
radio_operational_state, /* type */
"operational-state", /* Key */
"capwap/operational-state", /* Key */
cw_in_radio_generic_struct, /* get */
cw_out_radio_generic_struct /* put */
}
@ -442,7 +442,7 @@ static struct cw_ElemHandler handlers[] = {
0,0, /* Vendor / Proto */
1,513, /* min/max length */
CW_TYPE_BSTR16, /* type */
"ac-name-with-index", /* Key */
"capwap/ac-name-with-index", /* Key */
cw_in_generic_with_index, /* get */
cw_out_generic_with_index /* put */
}

View File

@ -31,7 +31,7 @@
static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem,
int len)
int len,const char *pkey)
{
int i = 0;
uint32_t val;
@ -56,11 +56,7 @@ static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem,
return;
}
/* cw_dbg(DBG_SUBELEM, "WTP board data sub-element, type=%d, len=%d",
subtype, sublen);*/
switch (subtype) {
case CW_BOARDDATA_MODELNO:
key = "model-no";
@ -83,7 +79,7 @@ static void readsubelems_wtp_board_data(cw_Cfg_t * cfg, uint8_t * msgelem,
}
if (key != NULL){
char add_key[CW_CFG_MAX_KEY_LEN];
sprintf(add_key,"wtp-board-data/%s",key);
sprintf(add_key,"%s/%s",pkey,key);
cw_cfg_set_val(cfg,add_key,CW_TYPE_BSTR16,NULL,msgelem+i,sublen);
}
@ -107,7 +103,7 @@ int capwap_in_wtp_board_data(struct cw_ElemHandler *eh, struct cw_ElemHandlerPar
sprintf(vendor_key,"%s/%s",eh->key,"vendor");
cw_cfg_set_val(params->cfg,vendor_key,CW_TYPE_DWORD,NULL,data,len);
readsubelems_wtp_board_data(params->cfg, data + 4, len - 4);
readsubelems_wtp_board_data(params->cfg, data + 4, len - 4,eh->key);
return 1;
}

View File

@ -815,7 +815,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
4,128, /* min/max length */
NULL, /* type */
CW_KEY_WTP_DESCRIPTOR, /* Key */
"capwap/wtp-descriptor", /* Key */
cisco_in_wtp_descriptor, /* get */
cisco_out_wtp_descriptor /* put */
}
@ -826,7 +826,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
4,128, /* min/max length */
NULL, /* type */
"ac-descriptor", /* Key */
"capwap/ac-descriptor", /* Key */
cisco_in_ac_descriptor, /* get */
cisco_out_ac_descriptor /* put */
}
@ -837,7 +837,7 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
1,512, /* min/max length */
CW_TYPE_BSTR16, /* type */
CW_KEY_WTP_NAME, /* Key */
"capwap/wtp-name", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -900,7 +900,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
4,CAPWAP_SESSION_ID_LEN, /* min/max length */
CW_TYPE_BSTR16, /* type */
"session-id", /* Key */
"capwap/session-id", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -925,8 +925,8 @@ static struct cw_ElemHandler handlers70[] = {
7,7, /* min/max length */
CW_TYPE_STRUCT, /* type */
"cisco/mwar-addr", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
NULL,
mwar_addr
@ -938,7 +938,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
4,4, /* min/max length */
CW_TYPE_IPADDRESS, /* type */
"capwap-local-ip-address", /* Key */
"capwap/local-ip-address", /* Key */
cw_in_generic, /* get */
cisco_out_capwap_local_ip_address /* put */
}
@ -950,7 +950,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
16,16, /* min/max length */
CW_TYPE_IPADDRESS, /* type */
"capwap-local-ip-address", /* Key */
"capwap/local-ip-address", /* Key */
cw_in_generic, /* get */
cisco_out_capwap_local_ip_address /* put */
}
@ -1786,7 +1786,7 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
0,1024, /* min/max length */
CW_TYPE_BSTR16, /* type */
"location-data", /* Key */
"capwap/location-data", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
},
@ -1812,7 +1812,7 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO,0, /* Vendor / Proto */
2,2, /* min/max length */
CW_TYPE_WORD, /* type */
"statistics-timer", /* Key */
"capwap/statistics-timer", /* Key */
cw_in_generic, /* get */
cw_out_generic /* put */
}
@ -1943,12 +1943,12 @@ static struct cw_ElemHandler handlers70[] = {
,
{
"SSC Hash", /* name */
"SSC Hash", /* name */
CISCO_LWELEM_SSC_HASH, /* Element ID */
CW_VENDOR_ID_CISCO,CW_PROTO_LWAPP, /* Vendor / Proto */
1,331, /* min/max length */
CW_TYPE_STRUCT, /* type */
"cisco/hash", /* Key */
"cisco/ssc-hash", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
@ -1976,7 +1976,7 @@ static struct cw_ElemHandler handlers70[] = {
0,0, /* Vendor / Proto */
3,3, /* min/max length */
CW_TYPE_STRUCT, /* type */
"operational-state", /* Key */
"capwap/operational-state", /* Key */
cw_in_radio_generic, /* get */
cw_out_radio_generic, /* put */
NULL, /* mkkey */
@ -2034,7 +2034,7 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO, 0, /* Vendor / Proto */
2, 2, /* min/max length */
CW_TYPE_STRUCT, /* type */
"capwap-timers", /* Key */
"capwap/timers", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
@ -2049,7 +2049,7 @@ static struct cw_ElemHandler handlers70[] = {
CW_VENDOR_ID_CISCO, 0, /* Vendor / Proto */
4, 4, /* min/max length */
CW_TYPE_STRUCT, /* type */
"cisco-8011-assoc-limit", /* Key */
"cisco/8011-assoc-limit", /* Key */
cw_in_generic, /* get */
cw_out_generic, /* put */
NULL,
@ -2762,15 +2762,15 @@ static void set_ac_version(struct cw_ElemHandlerParams * params)
{
bstr16_t wtpver;
char verstr[512];
wtpver = cw_cfg_get_bstr16(params->cfg,"wtp-descriptor/software/version",NULL);
wtpver = cw_cfg_get_bstr16(params->cfg,"capwap/wtp-descriptor/software/version",NULL);
if (wtpver==NULL)
return;
cw_format_version(verstr,bstr16_data(wtpver),bstr16_len(wtpver));
cw_dbg(DBG_INFO, "Cisco - Setting AC software version to: %s", verstr);
cw_cfg_set_bstr16(params->conn->local_cfg,"ac-descriptor/software/version",wtpver);
cw_cfg_set_int(params->conn->local_cfg,"ac-descriptor/software/vendor",CW_VENDOR_ID_CISCO);
cw_cfg_set_bstr16(params->conn->local_cfg,"capwap/ac-descriptor/software/version",wtpver);
cw_cfg_set_int(params->conn->local_cfg,"capwap/ac-descriptor/software/vendor",CW_VENDOR_ID_CISCO);
if(bstr16_len(wtpver)==4){
uint32_t rv;
@ -2818,9 +2818,9 @@ static int preprocess_join_request(struct cw_Conn *conn)
use_ac_version = cw_cfg_get_bool(conn->global_cfg,"cisco/wtp-use-ac-version",0);
if (use_ac_version){
ver = cw_cfg_get_bstr16(conn->remote_cfg,"ac-descriptor/software/version",NULL );
ver = cw_cfg_get_bstr16(conn->remote_cfg,"capwap/ac-descriptor/software/version",NULL );
if (ver != NULL){
cw_cfg_set_bstr16(conn->local_cfg,"wtp-descriptor/software/version",ver);
cw_cfg_set_bstr16(conn->local_cfg,"capwap/wtp-descriptor/software/version",ver);
cw_format_version(verstr,bstr16_data(ver),bstr16_len(ver));
cw_dbg(DBG_INFO, "Cisco WTP - Using AC's software version: %s", verstr);
free(ver);

View File

@ -232,7 +232,7 @@ int static setup_cfg(struct cw_Conn * conn)
security = cw_setup_dtls(conn,conn->global_cfg,"cisco",CAPWAP_CIPHER);
if (conn->role == CW_ROLE_AC){
cw_cfg_set_int(conn->local_cfg,"ac-descriptor/security",security);
cw_cfg_set_int(conn->local_cfg,"capwap/ac-descriptor/security",security);
// if (conn->default_cfg==NULL){
// conn->default_cfg=cw_cfg_create();

View File

@ -122,7 +122,7 @@ radio.0/cisco/elem146: .x690f
radio.0/cisco/elem153: .x00
radio.0/cisco/elem156: .x020100
radio.0/cisco/elem16: .x02040b0c
radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem19: .xc0a800a10001000cc0a800a103000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000001060b010101
radio.0/cisco/elem22: .x0d00b400320102030405060708090a0b0c0d
radio.0/cisco/elem24: .x003c000c
radio.0/cisco/elem39: .x0078
@ -225,7 +225,7 @@ radio.1/cisco/elem15/rest: .x07ffffffce010001
radio.1/cisco/elem153: .x00
radio.1/cisco/elem156: .x020100
radio.1/cisco/elem16: .x0c121824
radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101001ecd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem19: .xc0a800a10001000bc0a800a110000101003ccd774fc43bd27db633509934957d3acb000000000000000052464d000000000000000000000000000000000000000000000000000000000024282c3034383c4064686c707484888c01010101010101010101010101010101
radio.1/cisco/elem22: .x1000b4003224282c3034383c4064686c707484888c
radio.1/cisco/elem24: .x003c000c
radio.1/cisco/elem39: .x0078