More improved dumps
This commit is contained in:
parent
aa3d83d8a4
commit
196f56b988
@ -610,7 +610,7 @@ static void copy(struct cw_ElemHandlerParams * params)
|
||||
cw_cfg_dump(params->cfg);
|
||||
cw_dbg(DBG_X,"------------- This was the config we ve got from WTP ---------------- ");
|
||||
cw_dbg(DBG_X,"Now copying:");
|
||||
cw_cfg_copy(params->cfg,conn->local_cfg);
|
||||
cw_cfg_copy(params->cfg,conn->local_cfg,0,"");
|
||||
cw_dbg(DBG_X,"Copying done.");
|
||||
}
|
||||
|
||||
|
13
src/cw/cfg.c
13
src/cw/cfg.c
@ -87,7 +87,7 @@ cw_Cfg_t *cw_cfg_create()
|
||||
cfg = malloc(sizeof(cw_Cfg_t));
|
||||
if (cfg == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(cfg,0,sizeof(cw_Cfg_t));
|
||||
cfg->cfg = mavl_create(cmp, del, sizeof(struct cw_Cfg_entry));
|
||||
if (cfg->cfg==NULL){
|
||||
cw_cfg_destroy(cfg);
|
||||
@ -98,7 +98,7 @@ cw_Cfg_t *cw_cfg_create()
|
||||
|
||||
int cw_cfg_set(cw_Cfg_t * cfg, const char *key, const char *val)
|
||||
{
|
||||
cw_dbg(DBG_CFG_SET, "%s: %s",key,val);
|
||||
cw_dbg(cfg->dbg_level, "%s%s: %s",cfg->dbg_prefix,key,val);
|
||||
|
||||
struct cw_Cfg_entry e;
|
||||
int replaced;
|
||||
@ -694,7 +694,7 @@ int cw_cfg_set_val(cw_Cfg_t * cfg, const char *key, const struct cw_Type *type,
|
||||
|
||||
|
||||
|
||||
void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst)
|
||||
void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst,int dbg_level,const char *dbg_prefix)
|
||||
{
|
||||
mavliter_t it;
|
||||
mavliter_init(&it, src->cfg);
|
||||
@ -726,9 +726,7 @@ void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst)
|
||||
*/
|
||||
|
||||
if (!exists){
|
||||
|
||||
|
||||
cw_dbg(DBG_CFG_SET, "New: %s: %s",new_elem.key,new_elem.val);
|
||||
cw_dbg(dbg_level, "%s: [undef] -> %s",new_elem.key,new_elem.val);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -740,7 +738,8 @@ void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst)
|
||||
continue;
|
||||
}
|
||||
|
||||
cw_dbg(DBG_CFG_SET, "Replace: %s: %s (old: %s)",new_elem.key, new_elem.val, old_elem->val);
|
||||
cw_dbg(dbg_level, "%s: %s -> %s",new_elem.key,old_elem->val,new_elem.val);
|
||||
// cw_dbg(DBG_X, "Replace: %s: %s (old: %s)",new_elem.key, new_elem.val, old_elem->val);
|
||||
if(dst->cfg->del){
|
||||
dst->cfg->del(old_elem);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ struct cw_Cfg {
|
||||
struct mavl * cfg;
|
||||
const char *name;
|
||||
int dbg_level;
|
||||
const char *dbg_prefix;
|
||||
};
|
||||
|
||||
typedef struct cw_Cfg cw_Cfg_t;
|
||||
@ -45,7 +46,7 @@ bstr16_t cw_cfg_get_bstr16(cw_Cfg_t * cfg, const char * key, const char *def);
|
||||
int cw_cfg_set_bstr16(cw_Cfg_t * cfg, const char * key, bstr16_t str);
|
||||
int cw_cfg_get_next_index(cw_Cfg_t * cfg, const char *key);
|
||||
const char *cw_cfg_get_l(cw_Cfg_t ** cfg, const char * key, const char *def);
|
||||
void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst);
|
||||
void cw_cfg_copy(cw_Cfg_t *src, cw_Cfg_t *dst,int dbg_level,const char *dbg_prefix);
|
||||
void cw_cfg_destroy(cw_Cfg_t *cfg);
|
||||
void cw_cfg_clear(cw_Cfg_t *cfg);
|
||||
int cw_cfg_base_exists(cw_Cfg_t * cfg, const char *key);
|
||||
|
@ -484,7 +484,10 @@ static int process_elements(struct cw_Conn *conn, uint8_t * rawmsg, int len,
|
||||
params.mand_found = mavl_create_conststr();
|
||||
params.unrecognized = mlist_create(NULL, NULL, sizeof(uint8_t *));
|
||||
|
||||
params.cfg = cw_cfg_create();
|
||||
params.cfg = cw_cfg_create();
|
||||
params.cfg->dbg_level = DBG_ELEM_DETAIL_IN;
|
||||
params.cfg->dbg_prefix = " ";
|
||||
|
||||
params.cfg_list[0]=params.cfg;
|
||||
params.cfg_list[1]=conn->local_cfg;
|
||||
params.cfg_list[2]=conn->global_cfg;
|
||||
|
@ -29,6 +29,8 @@ int conn_send_msg(struct cw_Conn * conn, uint8_t *rawmsg)
|
||||
int elems_len = cw_get_msg_elems_len(msg_ptr);
|
||||
elems_ptr = cw_get_msg_elems_ptr(msg_ptr);
|
||||
cw_Cfg_t * cfg = cw_cfg_create();
|
||||
cfg->dbg_level = DBG_ELEM_DETAIL_OUT;
|
||||
cfg->dbg_prefix = " ";
|
||||
|
||||
struct cw_ElemHandlerParams params;
|
||||
memset(¶ms,0,sizeof(struct cw_ElemHandlerParams));
|
||||
|
@ -9,6 +9,7 @@ int cw_dbg_set_level_from_str(const char *level)
|
||||
switch(*level){
|
||||
case '-':
|
||||
case '!':
|
||||
case '~':
|
||||
on =0;
|
||||
slevel=level+1;
|
||||
break;
|
||||
|
55
src/cw/dbg.c
55
src/cw/dbg.c
@ -63,14 +63,13 @@ static struct cw_StrListElem theme0[] = {
|
||||
{DBG_PKT_DMP_OUT, ANSI_BYELLOW ANSI_ITALIC},
|
||||
|
||||
{DBG_MSG_IN, ANSI_BLUE ANSI_BOLD},
|
||||
{DBG_MSG_PARSING, ANSI_BLUE },
|
||||
|
||||
{DBG_MSG_OUT, ANSI_BLUE ANSI_BOLD ANSI_ITALIC},
|
||||
{DBG_MSG_ASSEMBLY, ANSI_BLUE ANSI_ITALIC},
|
||||
{DBG_MSG_COMPOSE, ANSI_BLUE ANSI_ITALIC},
|
||||
|
||||
|
||||
{DBG_MSG_IN_DMP, ANSI_BBLUE },
|
||||
{DBG_MSG_OUT_DMP, ANSI_BBLUE ANSI_ITALIC},
|
||||
{DBG_MSG_DMP_IN, ANSI_BBLUE },
|
||||
{DBG_MSG_DMP_OUT, ANSI_BBLUE ANSI_ITALIC},
|
||||
|
||||
{DBG_ELEM_IN, ANSI_DEFAULT},
|
||||
{DBG_ELEM_OUT, ANSI_DEFAULT ANSI_ITALIC},
|
||||
@ -92,8 +91,8 @@ static struct cw_StrListElem theme0[] = {
|
||||
{DBG_X, "\x1b[31m"},
|
||||
{DBG_WARN, ANSI_CYAN},
|
||||
{DBG_MOD, ANSI_WHITE},
|
||||
{DBG_CFG_DMP, ANSI_BCYAN },
|
||||
|
||||
// {DBG_CFG_DMP, ANSI_BCYAN },
|
||||
{DBG_CFG_UPDATES,ANSI_BRED},
|
||||
|
||||
{CW_STR_STOP, ""}
|
||||
};
|
||||
@ -118,26 +117,25 @@ static struct cw_StrListElem color_off[] = {
|
||||
*/
|
||||
|
||||
static struct cw_StrListElem prefix[] = {
|
||||
{DBG_INFO, "Info -"},
|
||||
{DBG_PKT_IN, "Pkt In -"},
|
||||
{DBG_PKT_OUT, "Pkt Out -"},
|
||||
{DBG_MSG_IN, "Msg In - "},
|
||||
{DBG_MSG_OUT, "Msg Out - "},
|
||||
{DBG_INFO, "Info -"},
|
||||
{DBG_PKT_IN, "Pkt In -"},
|
||||
{DBG_PKT_OUT, "Pkt Out -"},
|
||||
{DBG_MSG_IN, "Msg In - "},
|
||||
{DBG_MSG_OUT, "Msg Out - "},
|
||||
|
||||
{DBG_MSG_PARSING, "" },
|
||||
{DBG_ELEM_IN, " Msg Element -"},
|
||||
{DBG_ELEM_OUT, " Msg Element -"},
|
||||
{DBG_ELEM_IN, " Msg Element -"},
|
||||
{DBG_ELEM_OUT, " Msg Element -"},
|
||||
|
||||
{DBG_MSG_ERR, " Msg Error -"},
|
||||
{DBG_PKT_ERR, " Pkt Error -"},
|
||||
{DBG_ELEM_ERR, " Elem Error -"},
|
||||
{DBG_RFC, " RFC -"},
|
||||
{DBG_DTLS, "DTLS - "},
|
||||
{DBG_DTLS_DETAIL, "DTLS - "},
|
||||
{DBG_WARN, " Warning - "},
|
||||
{DBG_MOD, " Mod - "},
|
||||
{DBG_STATE, " STATEMACHINE - "},
|
||||
{DBG_CFG_SET, " Cfg Set - "},
|
||||
{DBG_MSG_ERR, " Msg Error -"},
|
||||
{DBG_PKT_ERR, " Pkt Error -"},
|
||||
{DBG_ELEM_ERR, " Elem Error -"},
|
||||
{DBG_RFC, " RFC -"},
|
||||
{DBG_DTLS, "DTLS - "},
|
||||
{DBG_DTLS_DETAIL, "DTLS - "},
|
||||
{DBG_WARN, " Warning - "},
|
||||
{DBG_MOD, "Mod - "},
|
||||
{DBG_STATE, "STATEMACHINE - "},
|
||||
{DBG_CFG_UPDATES, "Cfg - "},
|
||||
|
||||
|
||||
|
||||
@ -357,16 +355,16 @@ void cw_dbg_msg(int level, struct cw_Conn *conn, uint8_t * packet, int len,
|
||||
cw_dbg(level, "%s", buf);
|
||||
|
||||
|
||||
if (cw_dbg_is_level(DBG_MSG_DMP)){
|
||||
// if (cw_dbg_is_level(DBG_MSG_DMP)){
|
||||
int dlevel;
|
||||
if(level==DBG_MSG_IN){
|
||||
dlevel = DBG_MSG_IN_DMP;
|
||||
dlevel = DBG_MSG_DMP_IN;
|
||||
}
|
||||
else{
|
||||
dlevel = DBG_MSG_OUT_DMP;
|
||||
dlevel = DBG_MSG_DMP_OUT;
|
||||
}
|
||||
cw_dbg_dmp(dlevel,packet,len,"");
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@ -415,7 +413,6 @@ void cw_dbg_elem(int level, struct cw_Conn *conn, int msg,
|
||||
handler->name,len);
|
||||
|
||||
if (cw_dbg_is_level(DBG_ELEM_DMP)) {
|
||||
int dlevel;
|
||||
if (level == DBG_ELEM_OUT)
|
||||
cw_dbg_dmp(DBG_ELEM_DMP_OUT,msgbuf,len,"");
|
||||
else
|
||||
|
75
src/cw/dbg.h
75
src/cw/dbg.h
@ -51,90 +51,95 @@ enum cw_dbg_levels{
|
||||
DBG_PKT_IN = (1<<0),
|
||||
DBG_PKT_OUT = (1<<1),
|
||||
|
||||
/** Hex-dump incomming/outgoing CAPWAP packets */
|
||||
DBG_PKT_DMP_IN = (1<<3),
|
||||
DBG_PKT_DMP_OUT = (1<<4),
|
||||
|
||||
/** Incomming CAPWAP packets with errors, wich would
|
||||
usually silently discarded */
|
||||
DBG_PKT_ERR = (1<<2),
|
||||
|
||||
/** Dump content of packets */
|
||||
// DBG_PKT_DMP = (1<<3),
|
||||
DBG_PKT_ERR = (1<<5),
|
||||
|
||||
|
||||
/** Display incomming/outgoing CAPWAP/LWAPP messages */
|
||||
DBG_MSG_IN = (1<<4),
|
||||
DBG_MSG_OUT = (1<<5),
|
||||
DBG_MSG_IN = (1<<6),
|
||||
DBG_MSG_OUT = (1<<7),
|
||||
|
||||
/** Show hex-dump of messages */
|
||||
DBG_MSG_DMP = (1<<6),
|
||||
|
||||
DBG_MSG_DMP_IN = (1<<8),
|
||||
DBG_MSG_DMP_OUT = (1<<9),
|
||||
|
||||
/** Message errors */
|
||||
DBG_MSG_ERR = (1<<7),
|
||||
DBG_MSG_ERR = (1<<10),
|
||||
|
||||
/** Show message elements in incomming/outgoing messages */
|
||||
DBG_ELEM_IN = (1<<8),
|
||||
DBG_ELEM_OUT = (1<<9),
|
||||
DBG_ELEM_IN = (1<<11),
|
||||
DBG_ELEM_OUT = (1<<12),
|
||||
|
||||
/** Show message element details */
|
||||
DBG_ELEM_DETAIL = (1<<10),
|
||||
DBG_ELEM_DETAIL_IN = (1<<13),
|
||||
DBG_ELEM_DETAIL_OUT = (1<<14),
|
||||
|
||||
/** Error in msg elements */
|
||||
DBG_ELEM_ERR = (1<<11),
|
||||
DBG_ELEM_ERR = (1<<15),
|
||||
|
||||
/** hex dump elements */
|
||||
DBG_ELEM_DMP = (1<<12),
|
||||
DBG_ELEM_DMP = (1<<16),
|
||||
|
||||
/** General infos, like CAPWAP state */
|
||||
DBG_INFO = (1<<13),
|
||||
DBG_INFO = (1<<17),
|
||||
|
||||
/** Misc. warnings */
|
||||
DBG_WARN = (1<<14),
|
||||
DBG_WARN = (1<<18),
|
||||
|
||||
/** RFC related */
|
||||
DBG_RFC = (1<<15),
|
||||
DBG_RFC = (1<<19),
|
||||
|
||||
/** DTLS related messages */
|
||||
DBG_DTLS = (1<<16),
|
||||
DBG_DTLS = (1<<20),
|
||||
|
||||
/** DTLS BIOs in/out */
|
||||
DBG_DTLS_BIO = (1<<17),
|
||||
DBG_DTLS_BIO = (1<<21),
|
||||
|
||||
/** Dump DTLS BIO i/o */
|
||||
DBG_DTLS_BIO_DMP = (1<<18),
|
||||
DBG_DTLS_BIO_DMP = (1<<22),
|
||||
|
||||
/** Show DTLS Details */
|
||||
DBG_DTLS_DETAIL = (1<<19),
|
||||
DBG_DTLS_DETAIL = (1<<23),
|
||||
|
||||
DBG_CFG_DMP = (1<<20),
|
||||
// DBG_CFG_DMP = (1<<20),
|
||||
|
||||
DBG_CFG_SET = (1<<21),
|
||||
// DBG_CFG_SET = (1<<21),
|
||||
|
||||
/** Debug Mods */
|
||||
DBG_MOD = (1<<22),
|
||||
DBG_MOD = (1<<24),
|
||||
|
||||
/**Debug State machine */
|
||||
DBG_STATE = (1<<23),
|
||||
DBG_STATE = (1<<25),
|
||||
|
||||
|
||||
DBG_PKT_DMP_OUT = (1<<24),
|
||||
DBG_PKT_DMP_IN = (1<<25),
|
||||
|
||||
|
||||
DBG_MSG_ASSEMBLY = (1<<26),
|
||||
DBG_MSG_COMPOSE = (1<<26),
|
||||
|
||||
DBG_MSG_IN_DMP = (1<<27),
|
||||
DBG_MSG_OUT_DMP = (1<<29),
|
||||
DBG_CFG_UPDATES = (1<<27),
|
||||
|
||||
|
||||
DBG_X = (1<<30),
|
||||
DBG_ALL = (0xffffffff),
|
||||
|
||||
|
||||
DBG_MSG_PARSING = 3,
|
||||
DBG_MSG_COMPOSING = 5,
|
||||
|
||||
DBG_ELEM_DMP_IN = 7,
|
||||
DBG_ELEM_DMP_OUT = 9,
|
||||
|
||||
|
||||
};
|
||||
|
||||
#define DBG_MSG (DBG_MSG_IN | DBG_MSG_OUT)
|
||||
#define DBG_PKT (DBG_PKT_IN | DBG_PKT_OUT)
|
||||
#define DBG_ELEM (DBG_ELEM_IN | DBG_ELEM_OUT)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define DBG_LN __FILE__,__LINE__
|
||||
|
||||
|
@ -39,12 +39,13 @@ struct cw_StrListElem cw_dbg_strings[] = {
|
||||
{ DBG_PKT_IN, "pkt_in" },
|
||||
{ DBG_PKT_OUT, "pkt_out" },
|
||||
{ DBG_PKT_ERR, "pkt_err" },
|
||||
// { DBG_PKT_IN_DMP, "pkt_in_dmp" },
|
||||
// { DBG_PKT_IN_DMP, "pkt_out_dmp" },
|
||||
{ DBG_PKT_DMP_IN, "pkt_dmp_in" },
|
||||
{ DBG_PKT_DMP_OUT, "pkt_dmp_out" },
|
||||
|
||||
{ DBG_MSG_IN, "msg_in" },
|
||||
{ DBG_MSG_OUT, "msg_out" },
|
||||
// { DBG_MSG_DMP, "msg_dmp" },
|
||||
{ DBG_MSG_DMP_IN, "msg_dmp_in" },
|
||||
{ DBG_MSG_DMP_OUT, "msg_dmp_out" },
|
||||
|
||||
{ DBG_MSG_ERR, "msg_err"},
|
||||
|
||||
@ -54,32 +55,32 @@ struct cw_StrListElem cw_dbg_strings[] = {
|
||||
{ DBG_ELEM_OUT, "elem_out"},
|
||||
{ DBG_ELEM_DMP, "elem_dmp"},
|
||||
|
||||
// { DBG_SUBELEM, "subelem"},
|
||||
// { DBG_SUBELEM_DMP, "subelem_dmp" },
|
||||
|
||||
// { DBG_ELEM_DETAIL, "elem_detail"},
|
||||
|
||||
{ DBG_ELEM_ERR, "elem_err" },
|
||||
{ DBG_ELEM_DETAIL_IN, "elem_detail_in" },
|
||||
{ DBG_ELEM_DETAIL_OUT, "elem_detail_out" },
|
||||
|
||||
{ DBG_DTLS, "dtls" },
|
||||
{ DBG_DTLS_BIO, "dtls_bio" },
|
||||
{ DBG_DTLS_BIO_DMP, "dtls_bio_dmp"},
|
||||
{ DBG_DTLS_DETAIL, "dtls_detail"},
|
||||
|
||||
{ DBG_CFG_SET, "cfg_set" },
|
||||
{ DBG_CFG_UPDATES, "cfg_updates" },
|
||||
|
||||
|
||||
{DBG_CFG_DMP, "cfg_dmp" },
|
||||
// {DBG_CFG_DMP, "cfg_dmp" },
|
||||
|
||||
{ DBG_WARN, "warn" },
|
||||
|
||||
|
||||
{ DBG_MOD,"mod"},
|
||||
{ DBG_STATE, "state" },
|
||||
|
||||
{ DBG_MSG_COMPOSE, "msg_compose" },
|
||||
|
||||
{ (DBG_MSG_IN | DBG_MSG_OUT), "msg" },
|
||||
{ (DBG_PKT_IN | DBG_PKT_OUT), "pkt" },
|
||||
{ (DBG_MSG_IN | DBG_MSG_OUT | DBG_ELEM_IN | DBG_ELEM_OUT ), "std" },
|
||||
{ (DBG_ELEM_IN | DBG_ELEM_OUT), "elem" },
|
||||
{ (DBG_ELEM_DETAIL_IN | DBG_ELEM_DETAIL_OUT), "elem_detail" },
|
||||
{ (DBG_ELEM_IN | DBG_ELEM_OUT | DBG_ELEM_DMP | DBG_ELEM_DETAIL_IN | DBG_ELEM_DETAIL_OUT), "elem_all" },
|
||||
{ (DBG_MSG_IN | DBG_MSG_OUT | DBG_ELEM_IN | DBG_ELEM_OUT | DBG_STATE), "std" },
|
||||
|
||||
{ DBG_ALL, "all"},
|
||||
|
||||
|
@ -98,7 +98,7 @@ void cw_discovery_results_add(struct cw_DiscoveryResults *dis,
|
||||
if (e.cfg == NULL)
|
||||
continue;
|
||||
|
||||
cw_cfg_copy(ac_cfg,e.cfg);
|
||||
cw_cfg_copy(ac_cfg,e.cfg,0,"");
|
||||
|
||||
strcpy(e.ip,ipval);
|
||||
|
||||
|
@ -21,7 +21,7 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
|
||||
params->elemdata = data;
|
||||
|
||||
if (handler==NULL){
|
||||
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
|
||||
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
|
||||
cw_log(LOG_ERR,"Can't put message element %d %d %d, no handler defined.",
|
||||
data->proto,data->vendor,data->id);
|
||||
continue;
|
||||
@ -29,7 +29,7 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
|
||||
|
||||
if (handler->put == NULL){
|
||||
if (data->mand){
|
||||
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
|
||||
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
|
||||
cw_log(LOG_ERR,"Error: Can't add mandatory message element %d - %s, no put method defined",
|
||||
handler->id, handler->name);
|
||||
|
||||
@ -39,7 +39,7 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
|
||||
|
||||
if (!data->mand){
|
||||
if (!cw_cfg_base_exists(params->cfg_list[0],handler->key)){
|
||||
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s - (skip)",
|
||||
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s - (skip)",
|
||||
data->proto, data->vendor, data->id, handler->name);
|
||||
|
||||
continue;
|
||||
@ -48,7 +48,7 @@ int cw_encode_elements(struct cw_ElemHandlerParams *params, mlist_t elements_lis
|
||||
|
||||
|
||||
l = handler->put(handler,params,dst+len);
|
||||
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s - (%d bytes)",
|
||||
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s - (%d bytes)",
|
||||
data->proto, data->vendor, data->id, handler->name,l);
|
||||
|
||||
len += l;
|
||||
@ -89,7 +89,7 @@ int cw_compose_message(struct cw_Conn *conn, uint8_t * rawout)
|
||||
msg->preprocess(conn);
|
||||
}
|
||||
|
||||
cw_dbg(DBG_MSG_ASSEMBLY,"*** Assembling message of type %d (%s) ***",
|
||||
cw_dbg(DBG_MSG_COMPOSE,"Composing message of type %d (%s) ***",
|
||||
msg->type, msg->name);
|
||||
|
||||
dst = msgptr+8;
|
||||
@ -112,7 +112,7 @@ int cw_compose_message(struct cw_Conn *conn, uint8_t * rawout)
|
||||
|
||||
data = mlistelem_dataptr(elem);
|
||||
handler = cw_msgset_get_elemhandler(conn->msgset,data->proto,data->vendor,data->id);
|
||||
cw_dbg(DBG_MSG_ASSEMBLY," Add Elem: %d %d %d %s", data->proto, data->vendor, data->id, handler->name);
|
||||
cw_dbg(DBG_MSG_COMPOSE," Add Elem: %d %d %d %s", 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);
|
||||
@ -149,8 +149,8 @@ int cw_compose_message(struct cw_Conn *conn, uint8_t * rawout)
|
||||
// }
|
||||
|
||||
cw_set_msg_elems_len(msgptr, len);
|
||||
cw_dbg(DBG_MSG_ASSEMBLY,"*** Done assenmbling message of type %d (%s) ***",
|
||||
msg->type, msg->name);
|
||||
//cw_dbg(DBG_MSG_COMPOSE,"*** Done assenmbling message of type %d (%s) ***",
|
||||
// msg->type, msg->name);
|
||||
if (type & 1) {
|
||||
/* It's a request, so we have to set seqnum */
|
||||
int s = conn_get_next_seqnum(conn);
|
||||
|
@ -2,6 +2,9 @@
|
||||
# This file is igenerated by WAT
|
||||
# If you edit this, your cahnges might be overwritten
|
||||
#
|
||||
ac-name-with-index.0:
|
||||
ac-name-with-index.1:
|
||||
ac-name-with-index.2:
|
||||
capwap-local-ip-address: 192.168.0.13
|
||||
capwap-timers/echo-interval: 30
|
||||
capwap-timers/max-discovery-interval: 10
|
||||
@ -9,7 +12,13 @@ capwap/ac-name:
|
||||
cisco-8011-assoc-limit/enable: false
|
||||
cisco-8011-assoc-limit/interval: 500
|
||||
cisco-8011-assoc-limit/limit: 25
|
||||
cisco/ac-ip-addr-with-index.0: 0.0.0.0
|
||||
cisco/ac-ip-addr-with-index.1: 0.0.0.0
|
||||
cisco/ac-ip-addr-with-index.2: 0.0.0.0
|
||||
cisco/ap-backup-software-version: .x00000000
|
||||
cisco/ap-core-dump/compression: false
|
||||
cisco/ap-core-dump/filename:
|
||||
cisco/ap-core-dump/tftp-server: 0.0.0.0
|
||||
cisco/ap-dtls-data-cfg/cabable: true
|
||||
cisco/ap-dtls-data-cfg/enabled: false
|
||||
cisco/ap-ethernet-port-type: .x000000
|
||||
@ -22,7 +31,7 @@ cisco/ap-mode-and-type/type: 15
|
||||
cisco/ap-model/image: 12.4(23c)JA2
|
||||
cisco/ap-model/model: "AIR-LAP1142N-E-K9 "
|
||||
cisco/ap-power-injector-config/selection: 0
|
||||
cisco/ap-power-injector-config/state: 17
|
||||
cisco/ap-power-injector-config/state: 34
|
||||
cisco/ap-power-injector-config/switch-mac-address: .x000000000000
|
||||
cisco/ap-pre-std-switch-config: 0
|
||||
cisco/ap-regulatory-domain.0/code0: 0
|
||||
@ -33,8 +42,10 @@ cisco/ap-regulatory-domain.1/code0: 0
|
||||
cisco/ap-regulatory-domain.1/code1: 1
|
||||
cisco/ap-regulatory-domain.1/set: true
|
||||
cisco/ap-regulatory-domain.1/slot: 1
|
||||
cisco/ap-static-domain/enable: true
|
||||
cisco/ap-static-domain/name: planix.org
|
||||
cisco/ap-static-ip-addr/address: 192.168.0.13
|
||||
cisco/ap-static-ip-addr/enabled: false
|
||||
cisco/ap-static-ip-addr/enabled: true
|
||||
cisco/ap-static-ip-addr/gateway: 192.168.0.1
|
||||
cisco/ap-static-ip-addr/netmask: 255.255.255.0
|
||||
cisco/ap-static-ip-addr/unknown: 0.0.0.0
|
||||
@ -75,7 +86,7 @@ cisco/wtp-board-data/card-revision: 0
|
||||
cisco/wtp-board-data/ethernet-mac-address: .xc47d4f3af8a6
|
||||
cisco/wtp-board-data/options/ant-type: 1
|
||||
cisco/wtp-board-data/options/ap-type: 1
|
||||
cisco/wtp-board-data/options/failover-priority: 0
|
||||
cisco/wtp-board-data/options/failover-priority: 1
|
||||
cisco/wtp-board-data/options/flex-connect: 1
|
||||
cisco/wtp-board-data/wtp-model-hi: 0
|
||||
cisco/wtp-board-data/wtp-model-lo: 0
|
||||
@ -105,7 +116,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/elem47: .x0100000000000000000000000000000000
|
||||
@ -116,6 +127,7 @@ radio.0/cisco/lwelem27: .x00000000000000000000000000000000000000000000000000
|
||||
radio.0/cisco/lwelem28: .x0303020202000000000000000000000000000000000000000000313f01
|
||||
radio.0/cisco/lwelem29: .x00010000000000000200001400
|
||||
radio.0/cisco/lwelem48: .x01055a0101a6c405b06432b03232
|
||||
radio.0/cisco/lwelem55: .x000000000000000000000000
|
||||
radio.0/cisco/lwelem9: .x0100000000000000000000000000000000
|
||||
radio.0/cisco/mac-operation/fragmentation-threshold: 2346
|
||||
radio.0/cisco/mac-operation/long-retry: 4
|
||||
@ -157,7 +169,7 @@ radio.0/wlan.1/add-wlan/scan-defer-time: 100
|
||||
radio.0/wlan.1/add-wlan/session-timout: 1800
|
||||
radio.0/wlan.1/add-wlan/ssid: tubeC
|
||||
radio.0/wlan.1/add-wlan/wep-encryption: false
|
||||
radio.0/wlan.1/add-wlan/wep-key: .x6ecd3e2d4ada67bc959ff28170
|
||||
radio.0/wlan.1/add-wlan/wep-key: .xc214aef5bd4c4e1ff2574303a4
|
||||
radio.0/wlan.1/add-wlan/wep-key-index: 1
|
||||
radio.0/wlan.1/add-wlan/wlan-capability: 1073
|
||||
radio.0/wlan.1/add-wlan/wlan-id: 1
|
||||
@ -174,7 +186,7 @@ radio.0/wlan.13/add-wlan/scan-defer-time: 100
|
||||
radio.0/wlan.13/add-wlan/session-timout: 1800
|
||||
radio.0/wlan.13/add-wlan/ssid: SuperSSID
|
||||
radio.0/wlan.13/add-wlan/wep-encryption: false
|
||||
radio.0/wlan.13/add-wlan/wep-key: .x6ecd3e2d4ada67bc959ff28170
|
||||
radio.0/wlan.13/add-wlan/wep-key: .xc214aef5bd4c4e1ff2574303a4
|
||||
radio.0/wlan.13/add-wlan/wep-key-index: 1
|
||||
radio.0/wlan.13/add-wlan/wlan-capability: 1057
|
||||
radio.0/wlan.13/add-wlan/wlan-id: 13
|
||||
@ -192,12 +204,12 @@ radio.1/cisco/antenna-payload/unknown: 3
|
||||
radio.1/cisco/channel-power: .x0808102408221c16100a04fefe2808221c16100a04fefe2c08221c16100a04fefe3008221c16100a04fefe3408221c16100a04fefe3808221c16100a04fefe3c08221c16100a04fefe4008221c16100a04fefe6408221c16100a04fefe6808221c16100a04fefe6c08221c16100a04fefe7008221c16100a04fefe7408221c16100a04fefe8408221c16100a04fefe8808221c16100a04fefe8c08221c16100a04fefe
|
||||
radio.1/cisco/elem145: .x01
|
||||
radio.1/cisco/elem15/cfg-type: 1 - global
|
||||
radio.1/cisco/elem15/channel: 36
|
||||
radio.1/cisco/elem15/rest: .x07ffffffce000000
|
||||
radio.1/cisco/elem15/channel: 124
|
||||
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/elem47: .x0100000000000000000000000000000000
|
||||
@ -250,7 +262,7 @@ radio.1/wlan.1/add-wlan/scan-defer-time: 100
|
||||
radio.1/wlan.1/add-wlan/session-timout: 1800
|
||||
radio.1/wlan.1/add-wlan/ssid: tubeC
|
||||
radio.1/wlan.1/add-wlan/wep-encryption: false
|
||||
radio.1/wlan.1/add-wlan/wep-key: .x150728c73ce900b86693fc5e57
|
||||
radio.1/wlan.1/add-wlan/wep-key: .xc97bf74c5a6b5d327384ac9065
|
||||
radio.1/wlan.1/add-wlan/wep-key-index: 1
|
||||
radio.1/wlan.1/add-wlan/wlan-capability: 17
|
||||
radio.1/wlan.1/add-wlan/wlan-id: 1
|
||||
@ -267,7 +279,7 @@ radio.1/wlan.13/add-wlan/scan-defer-time: 100
|
||||
radio.1/wlan.13/add-wlan/session-timout: 1800
|
||||
radio.1/wlan.13/add-wlan/ssid: SuperSSID
|
||||
radio.1/wlan.13/add-wlan/wep-encryption: false
|
||||
radio.1/wlan.13/add-wlan/wep-key: .x150728c73ce900b86693fc5e57
|
||||
radio.1/wlan.13/add-wlan/wep-key: .xc97bf74c5a6b5d327384ac9065
|
||||
radio.1/wlan.13/add-wlan/wep-key-index: 1
|
||||
radio.1/wlan.13/add-wlan/wlan-capability: 1
|
||||
radio.1/wlan.13/add-wlan/wlan-id: 13
|
||||
|
@ -13,7 +13,7 @@
|
||||
static int config_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
|
||||
{
|
||||
cw_dbg(DBG_X,"*** Configurations Status Response received ****");
|
||||
cw_cfg_copy(params->cfg, params->conn->global_cfg);
|
||||
cw_cfg_copy(params->cfg, params->conn->global_cfg,DBG_CFG_UPDATES,"GlbalCfg");
|
||||
cw_cfg_save(bootcfg.cfgfilename, params->conn->global_cfg,
|
||||
"#\n# This file is igenerated by WAT\n# If you edit this, your cahnges might be overwritten\n#\n");
|
||||
cw_dbg(DBG_X,"*** Cnofig Saved ***");
|
||||
@ -31,7 +31,7 @@ int configure(struct cw_Conn * conn)
|
||||
cw_conn_set_msg_cb(conn,CAPWAP_MSG_CONFIGURATION_STATUS_RESPONSE,config_cb);
|
||||
|
||||
int rc;
|
||||
cw_cfg_copy(conn->global_cfg,conn->update_cfg);
|
||||
cw_cfg_copy(conn->global_cfg,conn->update_cfg,0,"");
|
||||
rc = cw_send_request(conn, CAPWAP_MSG_CONFIGURATION_STATUS_REQUEST);
|
||||
cw_cfg_clear(conn->update_cfg);
|
||||
|
||||
|
@ -213,7 +213,7 @@ int join(struct cw_Conn * conn, struct cw_DiscoveryResults * results)
|
||||
sock_setport((struct sockaddr*)&sockaddr,5246);
|
||||
|
||||
cw_cfg_clear(conn->remote_cfg);
|
||||
cw_cfg_copy(e->cfg,conn->remote_cfg);
|
||||
cw_cfg_copy(e->cfg,conn->remote_cfg,0,"");
|
||||
rc = run_join_d(conn,(struct sockaddr*)(&sockaddr),e->cfg);
|
||||
if (rc)
|
||||
return 1;
|
||||
|
@ -33,12 +33,12 @@ int update =1;
|
||||
|
||||
static int update_cb(struct cw_ElemHandlerParams * params, uint8_t * elems_ptr, int elems_len)
|
||||
{
|
||||
cw_dbg(DBG_X," **** Configuration Update Request Received ***");
|
||||
// cw_dbg(DBG_X," **** Configuration Update Request Received ***");
|
||||
// cw_cfg_dump(params->conn->global_cfg);
|
||||
cw_cfg_copy(params->cfg, params->conn->global_cfg);
|
||||
cw_cfg_copy(params->cfg, params->conn->global_cfg,DBG_CFG_UPDATES,"GlobalCfg");
|
||||
cw_cfg_save(bootcfg.cfgfilename, params->conn->global_cfg,
|
||||
"#\n# This file is igenerated by WAT\n# If you edit this, your cahnges might be overwritten\n#\n");
|
||||
cw_dbg(DBG_X," **** Configuration Update Request Received Saved ***");
|
||||
// cw_dbg(DBG_X," **** Configuration Update Request Received Saved ***");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,8 @@ int main (int argc, char **argv)
|
||||
bootcfg.modnames[1]="capwap80211";
|
||||
bootcfg.nmods=2;
|
||||
}
|
||||
|
||||
cw_dbg_set_level(DBG_X,0);
|
||||
|
||||
|
||||
/* create an empty message set */
|
||||
|
Loading…
Reference in New Issue
Block a user