Print wireless specific info in packet header.
FossilOrigin-Name: de50bebf6d3e61ae32c20a0e2ab20ee3dee98d4766fa0bb9b4cd1b2a131c1af2
This commit is contained in:
parent
5b78a05991
commit
630faa7ca7
20
src/cw/dbg.c
20
src/cw/dbg.c
@ -202,7 +202,7 @@ void cw_dbg_missing_mand(int level, struct conn *conn, cw_action_in_t ** ml, int
|
||||
/**
|
||||
* Format a Packet Header
|
||||
*/
|
||||
int cw_format_pkt(char *dst,int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from)
|
||||
int cw_format_pkt_hdr(char *dst,int level,struct conn *conn, uint8_t * packet, int len,struct sockaddr *from)
|
||||
{
|
||||
char *s=dst;
|
||||
switch (level) {
|
||||
@ -270,6 +270,22 @@ int cw_format_pkt(char *dst,int level,struct conn *conn, uint8_t * packet, int l
|
||||
s+=sprintf(s," ... (len=%d)",rmac_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (cw_get_hdr_flag_w(packet)){
|
||||
/* print wireless specific info */
|
||||
int ws_len = cw_get_hdr_ws_len(packet);
|
||||
int plen = ws_len > 20 ? 20:ws_len;
|
||||
s+=sprintf(s," WS:");
|
||||
s+=format_hexu(s,cw_get_hdr_ws_data(packet),plen);
|
||||
if (ws_len>20){
|
||||
s+=sprintf(s," ... (len=%d)",ws_len);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return s-dst;
|
||||
|
||||
|
||||
@ -382,7 +398,7 @@ void cw_dbg_pkt(int level,struct conn *conn, uint8_t * packet, int len,struct so
|
||||
return;
|
||||
|
||||
char buf[1024];
|
||||
cw_format_pkt(buf,level,conn,packet,len,from);
|
||||
cw_format_pkt_hdr(buf,level,conn,packet,len,from);
|
||||
|
||||
if (cw_dbg_is_level(DBG_PKT_DMP)){
|
||||
char *dmp = cw_dbg_mkdmp(packet,len);
|
||||
|
Loading…
Reference in New Issue
Block a user