diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-12 11:46:42 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-12 11:46:42 +0000 |
commit | a26037ac7c1ac218863f9d674dcf85293eb2f085 (patch) | |
tree | 5d1330cc8dec0776f4edf8406d1044155528b65f /source3/include | |
parent | ecd462f1c34b7cdc4670376d53a63d7210f3ef61 (diff) | |
download | samba-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')
-rw-r--r-- | source3/include/byteorder.h | 29 | ||||
-rw-r--r-- | source3/include/proto.h | 37 |
2 files changed, 48 insertions, 18 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))); + diff --git a/source3/include/proto.h b/source3/include/proto.h index f859e9bfa2..d9b6ca157b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -322,24 +322,24 @@ BOOL remove_share_oplock(int fnum, share_lock_token token); /*The following definitions come from lsaparse.c */ -char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align); -char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align); -char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align); -char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align); -char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align); -char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align); -char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align); -char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align); -char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align); -char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align); -char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align); -char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align); -char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align); -char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align); -char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align); -char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align); -char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align); -char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align); +char* lsa_io_r_open_pol(BOOL io, LSA_R_OPEN_POL *r_p, char *q, char *base, int align, int depth); +char* lsa_io_q_query(BOOL io, LSA_Q_QUERY_INFO *q_q, char *q, char *base, int align, int depth); +char* lsa_io_r_query(BOOL io, LSA_R_QUERY_INFO *r_q, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_sids(BOOL io, LSA_Q_LOOKUP_SIDS *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_sids(BOOL io, LSA_R_LOOKUP_SIDS *r_s, char *q, char *base, int align, int depth); +char* lsa_io_q_lookup_rids(BOOL io, LSA_Q_LOOKUP_RIDS *q_r, char *q, char *base, int align, int depth); +char* lsa_io_r_lookup_rids(BOOL io, LSA_R_LOOKUP_RIDS *r_r, char *q, char *base, int align, int depth); +char* lsa_io_q_req_chal(BOOL io, LSA_Q_REQ_CHAL *q_c, char *q, char *base, int align, int depth); +char* lsa_io_r_req_chal(BOOL io, LSA_R_REQ_CHAL *r_c, char *q, char *base, int align, int depth); +char* lsa_io_q_auth_2(BOOL io, LSA_Q_AUTH_2 *q_a, char *q, char *base, int align, int depth); +char* lsa_io_r_auth_2(BOOL io, LSA_R_AUTH_2 *r_a, char *q, char *base, int align, int depth); +char* lsa_io_q_srv_pwset(BOOL io, LSA_Q_SRV_PWSET *q_s, char *q, char *base, int align, int depth); +char* lsa_io_r_srv_pwset(BOOL io, LSA_R_SRV_PWSET *r_s, char *q, char *base, int align, int depth); +char* lsa_io_user_info(BOOL io, LSA_USER_INFO *usr, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logon(BOOL io, LSA_Q_SAM_LOGON *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logon(BOOL io, LSA_R_SAM_LOGON *r_l, char *q, char *base, int align, int depth); +char* lsa_io_q_sam_logoff(BOOL io, LSA_Q_SAM_LOGOFF *q_l, char *q, char *base, int align, int depth); +char* lsa_io_r_sam_logoff(BOOL io, LSA_R_SAM_LOGOFF *r_l, char *q, char *base, int align, int depth); /*The following definitions come from mangle.c */ @@ -1072,3 +1072,4 @@ char *align4(char *q, char *base); char *align2(char *q, char *base); char *align_offset(char *q, char *base, int align_offset_len); void dump_data(int level,unsigned char *buf,int len); +char *tab_depth(int depth); |