Added function cw_dbg_msgelem.
FossilOrigin-Name: e70259812050469c6b0d4e97db6a2eeac31d3d3499583c9695c455a1d1e2252a
This commit is contained in:
parent
67bec32a26
commit
a97340b91d
@ -93,6 +93,7 @@ extern int cw_dbg_opt_level;
|
||||
#define cw_dbg(type,...) cw_log_dbg_(type,__FILE__,__LINE__,__VA_ARGS__)
|
||||
#define cw_log_dbg_dmp(type,str,len,...) cw_log_dbg_dmp_(type,__FILE__,__LINE__,str,len,__VA_ARGS__)
|
||||
#define cw_dbg_dmp(type,str,len,...) cw_log_dbg_dmp_(type,__FILE__,__LINE__,str,len,__VA_ARGS__)
|
||||
#define cw_dbg_msgelem(msgtype,msgelemtype,msgbuf,msglen) cw_dbg_msgelem_(msgtype,msgelemtype,msgbuf,msglen)
|
||||
|
||||
#else
|
||||
#define cw_log_dbg(...)
|
||||
@ -119,6 +120,10 @@ extern void cw_log_tosyslog(int level,const char *format, ...);
|
||||
extern void cw_log_tofile(int level,const char *format, ...);
|
||||
|
||||
|
||||
extern void cw_dbg_msgelem_(int msg, int msgelem, const uint8_t *msgbuf,int len);
|
||||
|
||||
|
||||
|
||||
extern int cw_log_debug_level;
|
||||
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "cw_log.h"
|
||||
|
||||
#include "capwap.h"
|
||||
|
||||
|
||||
static void cw_log_debug0_(const char *format, ...)
|
||||
@ -230,19 +230,6 @@ void cw_log_dbg_dmp_(int level,const char * file, int line, const uint8_t * data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void (*cw_log_debug_cbs[])(const char * fromat, ...) = {
|
||||
cw_log_debug0_,
|
||||
cw_log_debug1_,
|
||||
@ -250,3 +237,39 @@ void (*cw_log_debug_cbs[])(const char * fromat, ...) = {
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
void cw_dbg_msgelem_(int msg, int msgelem, const uint8_t *msgbuf,int len)
|
||||
{
|
||||
if (!cw_dbg_is_level(DBG_CW_MSGELEM))
|
||||
return;
|
||||
/*
|
||||
char buf[250];
|
||||
sprintf(buf,"Reading %s msgelem, type=%d (%d), len=%d",
|
||||
cw_msgtostr(msg),
|
||||
msgelem,
|
||||
cw_msgelemtostr(msg));
|
||||
*/
|
||||
if (!cw_dbg_is_level(DBG_CW_MSGELEM_DMP))
|
||||
cw_dbg(DBG_CW_MSGELEM,"Reading %s msgelem, type=%d (%s), len=%d",
|
||||
cw_msgtostr(msg),
|
||||
msgelem,
|
||||
cw_msgelemtostr(msgelem),
|
||||
len);
|
||||
|
||||
else
|
||||
cw_dbg_dmp(DBG_CW_MSGELEM,msgbuf,len,"Reading %s msgelem, type=%d (%s), len=%d\n\t Dump ...",
|
||||
cw_msgtostr(msg),
|
||||
msgelem,
|
||||
cw_msgelemtostr(msgelem),
|
||||
len);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//cw_dbg(DBG_CW_MSGELEM,"Process discovery req msgelem, type=%d (%s), len=%d",type,cw_msgelemtostr(type),len);
|
||||
//cw_dbg_dmp(DBG_CW_MSGELEM_DMP,msgelem,len,"Dump for msgelem ...");
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user