diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-07-13 12:58:20 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-07-13 12:58:20 +0000 |
commit | adf19b8ec3d3c0e98d9fd4e4f099b50b52695f2d (patch) | |
tree | 5363cc219dae7e27f2ce1a5198b1a99ce8c45104 /source3/lib | |
parent | d952004a14d7403ea5c0467cf40353d1edd8f60d (diff) | |
download | samba-adf19b8ec3d3c0e98d9fd4e4f099b50b52695f2d.tar.gz samba-adf19b8ec3d3c0e98d9fd4e4f099b50b52695f2d.tar.bz2 samba-adf19b8ec3d3c0e98d9fd4e4f099b50b52695f2d.zip |
added pretty printing of data section to show_msg(), for debug log level 10.
data section output is now in same format as tcpdump (hex and characters).
lkcl
(This used to be commit dcb1a74cf11de0c02c640e4d683ac81a814db624)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index f31ae390aa..b7ad0bb5bc 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -995,6 +995,7 @@ void dos_format(char *fname) void show_msg(char *buf) { int i; + int j; int bcc=0; if (DEBUGLEVEL < 5) return; @@ -1020,9 +1021,28 @@ void show_msg(char *buf) DEBUG(5,("smb_bcc=%d\n",bcc)); if (DEBUGLEVEL < 10) return; - for (i=0;i<MIN(bcc,128);i++) - DEBUG(10,("%X ",CVAL(smb_buf(buf),i))); - DEBUG(10,("\n")); + for (i = 0; i < MIN(bcc, 256); i += 16) + { + for (j = 0; j < 16 && i+j < MIN(bcc,256); j++) + { + + DEBUG(10,("%2X ",CVAL(smb_buf(buf),i+j))); + if (j == 7) DEBUG(10, (" ")); + + } + DEBUG(10,(" ")); + + for (j = 0; j < 16 && i+j < MIN(bcc,256); j++) + { + unsigned char c = CVAL(smb_buf(buf),i+j); + if (c < 32 || c > 128) c = '.'; + DEBUG(10,("%c",c)); + + if (j == 7) DEBUG(10, (" ")); + } + + DEBUG(10,("\n")); + } } /******************************************************************* |