diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-11 15:10:57 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-11 15:10:57 +0000 |
commit | 9160c85a78b66dab5318e2c9c922f00b6b3560f5 (patch) | |
tree | 358356803f5b23e5db51ec2e8d6ec783c1380ab4 /source3/lib/util.c | |
parent | f0340f490473b5be0aa2ef5d0dd99f543ec2ab9a (diff) | |
download | samba-9160c85a78b66dab5318e2c9c922f00b6b3560f5.tar.gz samba-9160c85a78b66dab5318e2c9c922f00b6b3560f5.tar.bz2 samba-9160c85a78b66dab5318e2c9c922f00b6b3560f5.zip |
namelogon.c :
added NTLOGON. (fixed the case 0:)
namepacket.c:
call to NTLOGON mailslot
nameserv.h
defines for NETLOGON and NTLOGON mailslot
util.c:
added andrew's dump_data() function.
(This used to be commit 1eaad1c99463dcd42eb8ff4ea5686ad9ec6fc42e)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 4e6bfb7054..208f13aaf0 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -4390,3 +4390,41 @@ char *align_offset(char *q, char *base, int align_offset_len) return q; } +static void print_asc(int level, unsigned char *buf,int len) +{ + int i; + for (i=0;i<len;i++) + DEBUG(level,("%c", isprint(buf[i])?buf[i]:'.')); +} + +void dump_data(int level,unsigned char *buf,int len) +{ + int i=0; + if (len<=0) return; + + DEBUG(level,("[%03X] ",i)); + for (i=0;i<len;) { + DEBUG(level,("%02X ",(int)buf[i])); + i++; + if (i%8 == 0) DEBUG(level,(" ")); + if (i%16 == 0) { + print_asc(level,&buf[i-16],8); DEBUG(level,(" ")); + print_asc(level,&buf[i-8],8); DEBUG(level,("\n")); + if (i<len) DEBUG(level,("[%03X] ",i)); + } + } + if (i%16) { + int n; + + n = 16 - (i%16); + DEBUG(level,(" ")); + if (n>8) DEBUG(level,(" ")); + while (n--) DEBUG(level,(" ")); + + n = MIN(8,i%16); + print_asc(level,&buf[i-(i%16)],n); DEBUG(level,(" ")); + n = (i%16) - n; + if (n>0) print_asc(level,&buf[i-n],n); + DEBUG(level,("\n")); + } +} |