initial commit
FossilOrigin-Name: 51b8f8e23f548577a9e8231e3fd1d9129f69e31286f7ca2b3917c6b3e63cc57c
This commit is contained in:
parent
d2d1be3346
commit
bc98b67450
26
src/cw/debug.c
Normal file
26
src/cw/debug.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdarg.h>
|
||||
#include "debug.h"
|
||||
#include "mbag.h"
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
|
||||
void cw_debug(const char * file, int line, struct dbg_Context *ctx, int level,
|
||||
const char * format, ...){
|
||||
if (!(cw_dbg_is_level(level)))
|
||||
return;
|
||||
|
||||
/* char fbuf[1024];
|
||||
|
||||
sprintf(fbuf, "DBG:%s%s %s%s%s",
|
||||
get_dbg_color_on(level),
|
||||
get_dbg_prefix(level),
|
||||
get_dbg_color_ontext(level), format, get_dbg_color_off(level)
|
||||
);
|
||||
|
||||
*/
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cw_log_vcb(level, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
92
src/cw/debug.h
Normal file
92
src/cw/debug.h
Normal file
@ -0,0 +1,92 @@
|
||||
#ifndef __DEBUG_H
|
||||
#define __DEBUG_H
|
||||
|
||||
/**
|
||||
* Debug levels
|
||||
*/
|
||||
enum cw_dbg_levels{
|
||||
/** Show headers of incomming CAPWAP packets */
|
||||
DBG_PKT_IN=0,
|
||||
/** Show headers of outgoing CAPWAP packets */
|
||||
DBG_PKT_OUT,
|
||||
|
||||
/** Incomming CAPWAP packets with errors, wich would
|
||||
usually silently discarded */
|
||||
DBG_PKT_ERR,
|
||||
|
||||
/** Dump content of incomming packets */
|
||||
DBG_PKT_DMP,
|
||||
|
||||
/** Display incomming CAPWAP/LWAPP messages */
|
||||
DBG_MSG_IN,
|
||||
|
||||
/** Display outgoing CAPWAP/LWAPP messages */
|
||||
DBG_MSG_OUT,
|
||||
|
||||
/** Message errors */
|
||||
DBG_MSG_ERR,
|
||||
|
||||
/** Show message elements */
|
||||
DBG_ELEM,
|
||||
|
||||
/** Show message element details */
|
||||
DBG_ELEM_DETAIL,
|
||||
|
||||
/** Error in msg elements */
|
||||
DBG_ELEM_ERR,
|
||||
|
||||
/** Show subelements */
|
||||
DBG_SUBELEM,
|
||||
|
||||
/** Show dump of subelements */
|
||||
DBG_SUBELEM_DMP,
|
||||
|
||||
/** hex dump elements */
|
||||
DBG_ELEM_DMP,
|
||||
|
||||
/** General infos, like CAPWAP state */
|
||||
DBG_INFO,
|
||||
|
||||
/** Misc. warnings */
|
||||
DBG_WARN,
|
||||
|
||||
/** RFC related */
|
||||
DBG_RFC,
|
||||
|
||||
/** DTLS related messages */
|
||||
DBG_DTLS,
|
||||
|
||||
/** DTLS BIOs in/out */
|
||||
DBG_DTLS_BIO,
|
||||
|
||||
/** Dump DTLS BIO i/o */
|
||||
DBG_DTLS_BIO_DMP,
|
||||
|
||||
/** Show DTLS Details */
|
||||
DBG_DTLS_DETAIL,
|
||||
|
||||
/** Debug Mods */
|
||||
DBG_MOD,
|
||||
|
||||
DBG_X
|
||||
};
|
||||
|
||||
|
||||
#define DBG_LN __FILE__,__LINE__
|
||||
|
||||
|
||||
struct dbg_Context{
|
||||
int level;
|
||||
};
|
||||
|
||||
|
||||
void cw_debug( const char * file, int line, struct dbg_Context *ctx, int level,
|
||||
const char * format, ...);
|
||||
|
||||
|
||||
#define DBG_START(ctx,level) cw_debug(__FILE__,__LINE__,ctx,level,
|
||||
#define DBG_END );
|
||||
|
||||
|
||||
|
||||
#endif
|
7
src/cw/mavl_free_bin.c
Normal file
7
src/cw/mavl_free_bin.c
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
#include "mavl.h"
|
||||
|
||||
void mavl_free_bin(union mavldata *data){
|
||||
free(data->ptr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user