summaryrefslogtreecommitdiff
path: root/source3/include/byteorder.h
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-12 11:46:42 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-12 11:46:42 +0000
commita26037ac7c1ac218863f9d674dcf85293eb2f085 (patch)
tree5d1330cc8dec0776f4edf8406d1044155528b65f /source3/include/byteorder.h
parentecd462f1c34b7cdc4670376d53a63d7210f3ef61 (diff)
downloadsamba-a26037ac7c1ac218863f9d674dcf85293eb2f085.tar.gz
samba-a26037ac7c1ac218863f9d674dcf85293eb2f085.tar.bz2
samba-a26037ac7c1ac218863f9d674dcf85293eb2f085.zip
added debugging macros (suitable eventually for use in tcpdump, hopefully)
(This used to be commit 946d73cf838976b905550288cac3aea7c43959f6)
Diffstat (limited to 'source3/include/byteorder.h')
-rw-r--r--source3/include/byteorder.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
index 0664a33817..e8989ee7e4 100644
--- a/source3/include/byteorder.h
+++ b/source3/include/byteorder.h
@@ -198,3 +198,32 @@ it also defines lots of intermediate macros, just ignore those :-)
#define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val))
#define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val))
+#define DBG_RW_PCVAL(string,depth,base,read,inbuf,outbuf,len) \
+ RW_PCVAL(read,inbuf,outbuf,len) \
+ DEBUG(5,("%s %04x %s: ", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
+ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \
+ DEBUG(5,("\n"));
+
+#define DBG_RW_PSVAL(string,depth,base,read,inbuf,outbuf,len) \
+ RW_PSVAL(read,inbuf,outbuf,len) \
+ DEBUG(5,("%s %04x %s: ", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string)); \
+ { int idx; for (idx = 0; idx < len; idx++) { DEBUG(5,("%d ", (inbuf)[idx])); } } \
+ DEBUG(5,("\n"));
+
+#define DBG_RW_CVAL(string,depth,base,read,inbuf,outbuf) \
+ RW_CVAL(read,inbuf,outbuf,0) \
+ DEBUG(5,("%s %04x %s: %02x\n", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf)));
+
+#define DBG_RW_SVAL(string,depth,base,read,inbuf,outbuf) \
+ RW_SVAL(read,inbuf,outbuf,0) \
+ DEBUG(5,("%s %04x %s: %04x\n", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf)));
+
+#define DBG_RW_IVAL(string,depth,base,read,inbuf,outbuf) \
+ RW_IVAL(read,inbuf,outbuf,0) \
+ DEBUG(5,("%s %04x %s: %08x\n", \
+ tab_depth(depth), PTR_DIFF(inbuf,base),string, (unsigned int)*(inbuf)));
+