very nice colored debugging and uncolored syslog
FossilOrigin-Name: 971a1f2eed2f25720af6be55c80d36ad5dc59e8ea11c48d2400bfaf7d774e59f
This commit is contained in:
parent
8d3d8f35f1
commit
6a5bd334e5
@ -298,6 +298,7 @@
|
||||
<File Name="src/cw/dbg_help_strings.c"/>
|
||||
<File Name="src/cw/cw_dbg_set_level.c"/>
|
||||
<File Name="src/cw/cw_dbg_set_level_from_str.c"/>
|
||||
<File Name="src/cw/ansi_colors.h"/>
|
||||
</VirtualDirectory>
|
||||
</VirtualDirectory>
|
||||
<Description/>
|
||||
|
28
src/cw/ansi_colors.h
Normal file
28
src/cw/ansi_colors.h
Normal file
@ -0,0 +1,28 @@
|
||||
#ifndef __ANSI_COLORS_H
|
||||
#define __ANSI_COLORS_H
|
||||
|
||||
#define DBG_CLR_OFF "\x1b[22;39m\x1b[23m"
|
||||
#define ANSI_DEFAULT "\x1b[39m"
|
||||
|
||||
#define ANSI_BLACK "\x1b[30m"
|
||||
#define ANSI_RED "\x1b[31m"
|
||||
#define ANSI_GREEN "\x1b[32m"
|
||||
#define ANSI_YELLOW "\x1b[33m"
|
||||
#define ANSI_BLUE "\x1b[34m"
|
||||
#define ANSI_MAGENTA "\x1b[35m"
|
||||
#define ANSI_CYAN "\x1b[35m"
|
||||
#define ANSI_WHITE "\x1b[37m"
|
||||
|
||||
#define ANSI_BBLACK "\x1b[90m"
|
||||
#define ANSI_BRED "\x1b[91m"
|
||||
#define ANSI_BGREEN "\x1b[92m"
|
||||
#define ANSI_BYELLOW "\x1b[93m"
|
||||
#define ANSI_BBLUE "\x1b[94m"
|
||||
#define ANSI_BMAGENTA "\x1b[95m"
|
||||
#define ANSI_BCYAN "\x1b[95m"
|
||||
#define ANSI_BWHITE "\x1b[97m"
|
||||
|
||||
#define ANSI_ITALIC "\x1b[3m"
|
||||
#define ANSI_BOLD "\x1b[1m"
|
||||
|
||||
#endif /* __ANSI_COLORS_H */
|
@ -353,7 +353,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
||||
mand_found = mavl_create_conststr();
|
||||
unrecognized = mlist_create(NULL,NULL,sizeof(uint8_t*));
|
||||
|
||||
cw_dbg(DBG_MSG_IN,"*** parsing messe elemtns for message of type %d (%s) ***",
|
||||
cw_dbg(DBG_MSG_PARSING ,"*** parsing message elemtns in %d - (%s) ***",
|
||||
message->type,message->name);
|
||||
/* iterate through message elements */
|
||||
cw_foreach_elem(elem, elems_ptr, elems_len) {
|
||||
@ -401,7 +401,7 @@ static int process_elements(struct conn *conn, uint8_t * rawmsg, int len,
|
||||
|
||||
cw_check_missing_mand(message,mand_found);
|
||||
|
||||
cw_dbg(DBG_MSG_IN," *** parsing of message of type %d (%s) done ***",
|
||||
cw_dbg(DBG_MSG_PARSING," *** done parsing message elements in %d (%s) ***",
|
||||
message->type,message->name);
|
||||
|
||||
mavl_destroy(mand_found);
|
||||
@ -723,13 +723,16 @@ int cw_read_messages(struct conn *conn)
|
||||
|
||||
int cw_read_from(struct conn *conn)
|
||||
{
|
||||
uint8_t buf[2024];
|
||||
int len = 2024;
|
||||
|
||||
if (!conn->readfrom) {
|
||||
cw_log(LOG_ERR, "Fatal error, no readfrom method available.");
|
||||
errno = EPROTO;
|
||||
return -1;
|
||||
}
|
||||
uint8_t buf[2024];
|
||||
int len = 2024;
|
||||
|
||||
|
||||
|
||||
struct sockaddr_storage from;
|
||||
int n = conn->readfrom(conn, buf, len, &from);
|
||||
|
@ -58,7 +58,7 @@ int cw_put_msg(struct conn *conn, uint8_t * rawout)
|
||||
}
|
||||
|
||||
|
||||
cw_dbg(DBG_ELEM_OUT,"*** Assenmbling message of type %d (%s) ***",
|
||||
cw_dbg(DBG_MSG_ASSEMBLY,"*** Assenmbling message of type %d (%s) ***",
|
||||
msg->type, msg->name);
|
||||
|
||||
dst = msgptr+8;
|
||||
@ -91,7 +91,8 @@ int cw_put_msg(struct 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);
|
||||
if (type & 1) {
|
||||
/* It's a request, so we have to set seqnum */
|
||||
int s = conn_get_next_seqnum(conn);
|
||||
|
237
src/cw/dbg.c
237
src/cw/dbg.c
@ -29,7 +29,7 @@
|
||||
#include "dbg.h"
|
||||
#include "log.h"
|
||||
#include "format.h"
|
||||
|
||||
#include "ansi_colors.h"
|
||||
|
||||
|
||||
/**
|
||||
@ -52,88 +52,63 @@ uint32_t cw_dbg_opt_level = 0;
|
||||
|
||||
|
||||
|
||||
#define DBG_CLR_MAGENTA "\x1b[35m"
|
||||
#define DBG_CLR_MAGENTA_L "\x1b[95m"
|
||||
#define DBG_CLR_MAGENTA_B "\x1b[1;35m"
|
||||
#define DBG_CLR_MAGENTA_F "\x1b[2;35m"
|
||||
#define DBG_CLR_MAGENTA_I "\x1b[3;35m"
|
||||
|
||||
#define DBG_CLR_BLUE "\x1b[34m"
|
||||
#define DBG_CLR_BLUE_B "\x1b[1;34m"
|
||||
#define DBG_CLR_BLUE_L "\x1b[94m"
|
||||
#define DBG_CLR_BLUE_F "\x1b[2;34m"
|
||||
#define DBG_CLR_BLUE_I "\x1b[3;34m"
|
||||
|
||||
#define DBG_CLR_YELLO "\x1b[33m"
|
||||
#define DBG_CLR_YELLO_I "\x1b[3;33m"
|
||||
|
||||
#define DBG_CLR_CYAN "\x1b[36m"
|
||||
|
||||
#define DBG_CLR_RED "\x1b[31m"
|
||||
#define DBG_CLR_RED_I "\x1b[3;31m"
|
||||
#define DBG_CLR_RED_L "\x1b[91m"
|
||||
|
||||
#define DBG_CLR_DEFAULT "\x1b[39m"
|
||||
#define DBG_CLR_DEFAULT_I "\x1b[3;39m"
|
||||
|
||||
#define DBG_CLR_BLACK "\x1b[30m"
|
||||
#define DBG_CLR_BLACK_L "\x1b[90m"
|
||||
#define DBG_CLR_BLACK_LI "\x1b[3;90m"
|
||||
|
||||
#define DBG_CLR_WHITE "\x1b[37m"
|
||||
#define DBG_CLR_WHITE_I "\x1b[3;37m"
|
||||
|
||||
|
||||
#define DBG_CLR_OFF "\x1b[22;39m\x1b[23m"
|
||||
|
||||
|
||||
#define ANSI_DEFAULT "\x1b[39m"
|
||||
#define ANSI_BLUE "\x1b[34m"
|
||||
|
||||
#define ANSI_ITALIC "\x1b[3m"
|
||||
#define ANSI_BOLD "\x1b[1m"
|
||||
|
||||
|
||||
static struct cw_StrListElem color_on[] = {
|
||||
{DBG_PKT_IN, DBG_CLR_YELLO},
|
||||
{DBG_PKT_OUT, DBG_CLR_YELLO_I},
|
||||
|
||||
{DBG_MSG_IN, ANSI_BLUE },
|
||||
{DBG_MSG_OUT, ANSI_BLUE ANSI_ITALIC},
|
||||
|
||||
{DBG_PKT_IN, ANSI_YELLOW},
|
||||
{DBG_PKT_OUT, ANSI_YELLOW ANSI_ITALIC},
|
||||
|
||||
{DBG_PKT_DMP_IN, ANSI_BYELLOW},
|
||||
{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_IN_DMP, ANSI_BBLUE },
|
||||
{DBG_MSG_OUT_DMP, ANSI_BBLUE ANSI_ITALIC},
|
||||
|
||||
{DBG_ELEM_IN, ANSI_DEFAULT},
|
||||
{DBG_ELEM_OUT, ANSI_DEFAULT ANSI_ITALIC},
|
||||
|
||||
{DBG_MSG_ERR, DBG_CLR_RED},
|
||||
{DBG_PKT_ERR, DBG_CLR_RED},
|
||||
{DBG_ELEM_ERR, DBG_CLR_RED},
|
||||
{DBG_MSG_ERR, ANSI_RED},
|
||||
{DBG_PKT_ERR, ANSI_RED},
|
||||
{DBG_ELEM_ERR, ANSI_RED},
|
||||
|
||||
{DBG_SUBELEM, DBG_CLR_BLACK},
|
||||
{DBG_DTLS, DBG_CLR_MAGENTA_B},
|
||||
{DBG_DTLS_DETAIL, DBG_CLR_MAGENTA},
|
||||
{DBG_DTLS_BIO, DBG_CLR_MAGENTA_L},
|
||||
{DBG_SUBELEM, ANSI_BBLACK},
|
||||
{DBG_DTLS, ANSI_MAGENTA ANSI_BOLD},
|
||||
{DBG_DTLS_DETAIL, ANSI_MAGENTA},
|
||||
{DBG_DTLS_BIO, ANSI_BMAGENTA},
|
||||
|
||||
{DBG_INFO, DBG_CLR_DEFAULT},
|
||||
{DBG_INFO, ANSI_DEFAULT},
|
||||
|
||||
{DBG_RFC, DBG_CLR_RED},
|
||||
{DBG_RFC, ANSI_BRED},
|
||||
{DBG_X, "\x1b[31m"},
|
||||
{DBG_WARN, DBG_CLR_CYAN},
|
||||
{DBG_MOD, DBG_CLR_WHITE},
|
||||
{DBG_WARN, ANSI_CYAN},
|
||||
{DBG_MOD, ANSI_WHITE},
|
||||
|
||||
|
||||
{CW_STR_STOP, ""}
|
||||
};
|
||||
|
||||
struct cw_StrListElem color_ontext[] = {
|
||||
|
||||
/* {DBG_ELEM_DMP, "\x1b[37m"},*/
|
||||
{DBG_ELEM_DMP, DBG_CLR_BLACK_LI},
|
||||
{DBG_ELEM_DMP, ANSI_BBLACK ANSI_ITALIC},
|
||||
|
||||
{CW_STR_STOP, ""}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
static struct cw_StrListElem color_off[] = {
|
||||
|
||||
{CW_STR_STOP, "\x1b[22;39m\x1b[23m"}
|
||||
};
|
||||
*/
|
||||
|
||||
static struct cw_StrListElem prefix[] = {
|
||||
{DBG_INFO, " Info -"},
|
||||
@ -166,12 +141,14 @@ static const char *get_dbg_color_on(int level)
|
||||
return cw_strlist_get_str(color_on, level);
|
||||
}
|
||||
|
||||
/*
|
||||
static const char *get_dbg_color_off(int level)
|
||||
{
|
||||
if (!(cw_dbg_opt_display & DBG_DISP_COLORS))
|
||||
return "";
|
||||
return cw_strlist_get_str(color_off, level);
|
||||
}
|
||||
*/
|
||||
|
||||
static const char *get_dbg_prefix(int level)
|
||||
{
|
||||
@ -187,7 +164,19 @@ const char *get_dbg_color_ontext(int level)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if a specific debug level is set.
|
||||
* @param level Level to check
|
||||
* @return 0 if leveln is not set, otherwise level is set
|
||||
*/
|
||||
|
||||
int cw_dbg_is_level(int level)
|
||||
{
|
||||
if (level >= DBG_ALL ){
|
||||
return 1;
|
||||
}
|
||||
return (cw_dbg_opt_level & (1<<level));
|
||||
}
|
||||
|
||||
|
||||
static void cw_dbg_vlog_line(struct cw_LogWriter * writer,
|
||||
@ -266,17 +255,19 @@ void cw_dbg_pkt(int level, struct conn *conn, uint8_t * packet, int len,
|
||||
|
||||
hlen = cw_get_hdr_msg_offset(packet);
|
||||
|
||||
if (cw_dbg_is_level(DBG_PKT_DMP)) {
|
||||
/*
|
||||
char *dmp = cw_dbg_mkdmp_c(packet, len, hlen);
|
||||
*/
|
||||
char * dmp;
|
||||
dmp = cw_format_dump(packet,len,NULL);
|
||||
cw_dbg(level, "%s", buf);
|
||||
|
||||
cw_dbg(level, "%s%s", buf, dmp);
|
||||
free(dmp);
|
||||
} else
|
||||
cw_dbg(level, "%s", buf);
|
||||
if (cw_dbg_is_level(DBG_PKT_DMP)) {
|
||||
int dlevel;
|
||||
if (level == DBG_PKT_IN){
|
||||
dlevel=DBG_PKT_DMP_IN;
|
||||
}
|
||||
else{
|
||||
dlevel=DBG_PKT_DMP_OUT;
|
||||
}
|
||||
cw_dbg_dmp(dlevel,packet,len,"");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -348,6 +339,20 @@ void cw_dbg_msg(int level, struct conn *conn, uint8_t * packet, int len,
|
||||
cw_get_msg_elems_len(msgptr));
|
||||
|
||||
cw_dbg(level, "%s", buf);
|
||||
|
||||
|
||||
if (cw_dbg_is_level(DBG_MSG_DMP)){
|
||||
int dlevel;
|
||||
if(level==DBG_MSG_IN){
|
||||
dlevel = DBG_MSG_IN_DMP;
|
||||
}
|
||||
else{
|
||||
dlevel = DBG_MSG_OUT_DMP;
|
||||
}
|
||||
cw_dbg_dmp(dlevel,packet,len,"");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -408,7 +413,7 @@ void cw_dbg_version_subelem(int level, const char *context, int subtype,
|
||||
cw_dbg(level, "%s: SubType %d, %s", context, subtype, v);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void cw_dbgv(struct cw_LogWriter *writer, int level, const char * format, va_list args)
|
||||
{
|
||||
char fbuf[1024];
|
||||
@ -429,14 +434,16 @@ void cw_dbgv(struct cw_LogWriter *writer, int level, const char * format, va_lis
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
void cw_dbgv1(struct cw_LogWriter *writer, int level, const char * format, ...){
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
cw_dbgv(writer,level,format,args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void cw_dbg(int level, const char *format, ...){
|
||||
@ -456,45 +463,7 @@ void cw_dbg(int level, const char *format, ...){
|
||||
}
|
||||
}
|
||||
|
||||
static void cw_dbg_help(struct cw_LogWriter *writer, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
/* if(writer->colored){
|
||||
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));
|
||||
|
||||
if (dmp!=NULL){
|
||||
sprintf(dbuf,"%s%s%s",
|
||||
get_dbg_color_ontext(dmp_level),"%s",
|
||||
get_dbg_color_off(dmp_level)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
va_start(args, format);
|
||||
writer->write(LOG_DEBUG,format,args,writer);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
static void builddmp(char *fbuf, char *format, int level, char *dmp, int dmp_level, int colored ){
|
||||
|
||||
char dbuf[128];
|
||||
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));
|
||||
|
||||
|
||||
if (dmp!=NULL){
|
||||
sprintf(dbuf,"%s%s%s",get_dbg_color_ontext(dmp_level),"%s",
|
||||
get_dbg_color_off(dmp_level));
|
||||
}
|
||||
strcat(fbuf,dbuf);
|
||||
}
|
||||
|
||||
void cw_dbg_elem(int level, struct conn *conn, int msg,
|
||||
struct cw_ElemHandler * handler,
|
||||
@ -502,8 +471,7 @@ void cw_dbg_elem(int level, struct conn *conn, int msg,
|
||||
{
|
||||
char vendorname[256];
|
||||
char vendor_details[265];
|
||||
char *dmp;
|
||||
int i;
|
||||
|
||||
|
||||
if (!cw_dbg_is_level(level))
|
||||
return;
|
||||
@ -523,56 +491,11 @@ void cw_dbg_elem(int level, struct conn *conn, int msg,
|
||||
if (cw_dbg_is_level(DBG_ELEM_DMP)) {
|
||||
/*dmp = cw_format_dump(msgbuf,len,NULL);*/
|
||||
|
||||
cw_dbg_dmp(DBG_ELEM_DMP,msgbuf,len,"hallo");
|
||||
cw_dbg_dmp(DBG_ELEM_DMP,msgbuf,len,"");
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
dmp = NULL;
|
||||
if (cw_dbg_is_level(DBG_ELEM_DMP)) {
|
||||
dmp = cw_format_dump(msgbuf,len,NULL);
|
||||
}
|
||||
|
||||
for (i=0; cw_log_writers[i]; i++){
|
||||
char fbuf[512];
|
||||
|
||||
if (cw_log_writers[i]->colored){
|
||||
builddmp(fbuf,"%s %d (%s), len=%d ",level,dmp,DBG_ELEM_DMP,cw_log_writers[i]->colored);
|
||||
cw_dbg_help(cw_log_writers[i],fbuf,vendorname,handler->id,handler->name,
|
||||
len, dmp);
|
||||
|
||||
}
|
||||
else{
|
||||
if (!dmp){
|
||||
cw_dbgv1(cw_log_writers[i],level,"%s %d (%s), len=%d ",vendorname,handler->id,
|
||||
handler->name,len);
|
||||
}
|
||||
else{
|
||||
cw_dbgv1(cw_log_writers[i],level,"%s %d (%s), len=%d\n%s",vendorname,handler->id,
|
||||
handler->name,len,dmp);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* cw_dbg(DBG_ELEM_IN, "%s %d (%s), len=%d%s%s",
|
||||
vendorname,
|
||||
handler->id, handler->name, len, get_dbg_color_ontext(DBG_ELEM_DMP), dmp);
|
||||
*/
|
||||
/* cw_dbg(DBG_ELEM_IN, "%s %d (%s), len=%d",
|
||||
vendorname,
|
||||
handler->id, handler->name, len);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
free(dmp);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
14
src/cw/dbg.h
14
src/cw/dbg.h
@ -66,6 +66,8 @@ enum cw_dbg_levels{
|
||||
/** Display outgoing CAPWAP/LWAPP messages */
|
||||
DBG_MSG_OUT,
|
||||
|
||||
DBG_MSG_DMP,
|
||||
|
||||
/** Message errors */
|
||||
DBG_MSG_ERR,
|
||||
|
||||
@ -116,6 +118,15 @@ enum cw_dbg_levels{
|
||||
|
||||
DBG_ALL,
|
||||
|
||||
DBG_PKT_DMP_OUT,
|
||||
DBG_PKT_DMP_IN,
|
||||
|
||||
DBG_MSG_IN_DMP,
|
||||
DBG_MSG_OUT_DMP,
|
||||
|
||||
DBG_MSG_ASSEMBLY,
|
||||
DBG_MSG_PARSING,
|
||||
|
||||
DBG_X
|
||||
};
|
||||
|
||||
@ -209,9 +220,10 @@ void cw_dbg_version_subelem(int level, const char *context, int subtype,
|
||||
* @param level Level to check
|
||||
* @return 0 if leveln is not set, otherwise level is set
|
||||
*/
|
||||
/*
|
||||
#define cw_dbg_is_level(level)\
|
||||
(cw_dbg_opt_level & (1<<level))
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
|
@ -35,24 +35,24 @@
|
||||
* Debug strings
|
||||
*/
|
||||
struct cw_StrListElem cw_dbg_strings[] = {
|
||||
{ DBG_INFO, "info", "Schow diverse info messages" },
|
||||
{ DBG_PKT_IN, "pkt_in" , "Show headers of incomming CAPWAP packets"},
|
||||
{ DBG_PKT_OUT, "pkt_out", "Show headers of outgoing CAPWAP packets" },
|
||||
{ DBG_PKT_ERR, "pkt_err", "Incomming CAPWAP packets with errors, wich would"
|
||||
"usually silently discarded" },
|
||||
{ DBG_PKT_DMP, "pkt_dmp", "Dump content of incomming/outgoing packets."
|
||||
"Requires pkt_in/pkt_out"},
|
||||
{ DBG_MSG_IN, "msg_in", "Display incomming CAPWAP/LWAPP messages." },
|
||||
{ DBG_MSG_OUT, "msg_out","Display outgoing CAPWAP/LWAPP messages."},
|
||||
{ DBG_MSG_ERR, "msg_err", "Messages wirh errors" },
|
||||
{ DBG_INFO, "info", },
|
||||
{ DBG_PKT_IN, "pkt_in" },
|
||||
{ DBG_PKT_OUT, "pkt_out" },
|
||||
{ DBG_PKT_ERR, "pkt_err" },
|
||||
{ DBG_PKT_DMP, "pkt_dmp" },
|
||||
{ DBG_MSG_IN, "msg_in" },
|
||||
{ DBG_MSG_OUT, "msg_out" },
|
||||
{ DBG_MSG_DMP, "msg_dmp" },
|
||||
|
||||
{ DBG_MSG_ERR, "msg_err"},
|
||||
|
||||
{ DBG_RFC, "rfc", "RFC related errors"},
|
||||
{ DBG_ELEM_IN, "elem_in", "Elements of incomming messages" },
|
||||
{ DBG_ELEM_OUT, "elem_out", "Elements of outgoing messages" },
|
||||
{ DBG_ELEM_DMP, "elem_dmp" , "Dump elements" },
|
||||
{ DBG_RFC, "rfc", },
|
||||
{ DBG_ELEM_IN, "elem_in"},
|
||||
{ DBG_ELEM_OUT, "elem_out"},
|
||||
{ DBG_ELEM_DMP, "elem_dmp"},
|
||||
|
||||
{ DBG_SUBELEM, "subelem", "Show sub-elements." },
|
||||
{ DBG_SUBELEM_DMP, "subelem_dmp", "Dump sub-elements" },
|
||||
{ DBG_SUBELEM, "subelem"},
|
||||
{ DBG_SUBELEM_DMP, "subelem_dmp" },
|
||||
|
||||
{ DBG_ELEM_DETAIL, "elem_detail"},
|
||||
|
||||
|
@ -207,7 +207,7 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
|
||||
cw_set_hdr_flags(rawmsg,CAPWAP_FLAG_HDR_F,1);
|
||||
cw_put_dword(ptr+4, nc->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
cw_dbg_pkt_nc(DBG_PKT_OUT,nc,ptr,mtu,(struct sockaddr*)&nc->addr);
|
||||
// cw_dbg_pkt_nc(DBG_PKT_OUT,nc,ptr,mtu,(struct sockaddr*)&nc->addr);
|
||||
|
||||
if (nc->write(nc,ptr,mtu)<0)
|
||||
return -1;
|
||||
@ -227,7 +227,7 @@ int netconn_send_capwap_msg(struct netconn * nc, uint8_t *rawmsg, int msglen)
|
||||
|
||||
cw_put_dword(ptr+4, nc->fragid<<16 | fragoffset<<3 );
|
||||
|
||||
cw_dbg_pkt_nc(DBG_PKT_OUT,nc,ptr,msglen,(struct sockaddr*)&nc->addr);
|
||||
// cw_dbg_pkt_nc(DBG_PKT_OUT,nc,ptr,msglen,(struct sockaddr*)&nc->addr);
|
||||
|
||||
return nc->write(nc,ptr,msglen-0);
|
||||
}
|
||||
@ -239,7 +239,7 @@ int netconn_process_packet(struct netconn *nc, uint8_t * packet, int len,
|
||||
{
|
||||
char sock_buf[SOCK_ADDR_BUFSIZE];
|
||||
|
||||
cw_dbg_pkt_nc(DBG_PKT_IN, nc, packet, len, from);
|
||||
// cw_dbg_pkt_nc(DBG_PKT_IN, nc, packet, len, from);
|
||||
if (len < 8) {
|
||||
/* packet too short */
|
||||
cw_dbg(DBG_PKT_ERR,
|
||||
@ -309,7 +309,7 @@ int netconn_process_packet(struct netconn *nc, uint8_t * packet, int len,
|
||||
}
|
||||
|
||||
|
||||
cw_dbg_pkt_nc(DBG_PKT_IN, nc, f + 4, *(uint32_t *) f, from);
|
||||
// cw_dbg_pkt_nc(DBG_PKT_IN, nc, f + 4, *(uint32_t *) f, from);
|
||||
|
||||
// XXX: Modify fragman to not throw away CAPWAP headers
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user