dbg_pkt for nc driven conns.
FossilOrigin-Name: 30f2a551d00ad49aa09c335a6987941e80d3ab861c8e650375417d185eddf131
This commit is contained in:
parent
9b76e5925e
commit
8943e9937b
22
src/cw/dbg.c
22
src/cw/dbg.c
@ -423,6 +423,28 @@ void cw_dbg_pkt(int level,struct conn *conn, uint8_t * packet, int len,struct so
|
|||||||
cw_dbg(level,"%s",buf);
|
cw_dbg(level,"%s",buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cw_dbg_pkt_nc(int level,struct netconn *nc, uint8_t * packet, int len,struct sockaddr *from)
|
||||||
|
{
|
||||||
|
if (!cw_dbg_is_level(level))
|
||||||
|
return;
|
||||||
|
|
||||||
|
char buf[1024];
|
||||||
|
cw_format_pkt_hdr(buf,level,NULL,packet,len,from);
|
||||||
|
|
||||||
|
int hlen = cw_get_hdr_msg_offset(packet);
|
||||||
|
|
||||||
|
if (cw_dbg_is_level(DBG_PKT_DMP)){
|
||||||
|
char *dmp = cw_dbg_mkdmp_c(packet,len,hlen);
|
||||||
|
cw_dbg(level,"%s%s",buf,dmp);
|
||||||
|
free(dmp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
cw_dbg(level,"%s",buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cw_dbg_dmp_(int level, const char *file, int line,
|
void cw_dbg_dmp_(int level, const char *file, int line,
|
||||||
|
@ -184,6 +184,8 @@ extern void cw_dbg_elem_colored(int level, struct conn *conn, int msg, int msgel
|
|||||||
const uint8_t * msgbuf, int len);
|
const uint8_t * msgbuf, int len);
|
||||||
|
|
||||||
void cw_dbg_pkt(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
void cw_dbg_pkt(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
||||||
|
void cw_dbg_pkt_nc(int level,struct netconn *nc, uint8_t * packet, int len,struct sockaddr *from);
|
||||||
|
|
||||||
void cw_dbg_msg(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
void cw_dbg_msg(int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from);
|
||||||
char * cw_dbg_mkdmp(const uint8_t * data, int len);
|
char * cw_dbg_mkdmp(const uint8_t * data, int len);
|
||||||
void cw_dbg_version_subelem(int level,const char*context,int subtype,bstrv_t vstr);
|
void cw_dbg_version_subelem(int level,const char*context,int subtype,bstrv_t vstr);
|
||||||
|
Loading…
Reference in New Issue
Block a user