1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

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)
This commit is contained in:
Samba Release Account 1997-07-13 12:58:20 +00:00
parent d952004a14
commit adf19b8ec3

View File

@ -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"));
}
}
/*******************************************************************