From 0032599833c8f81dabc03f85912acbe54924d412 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Tue, 28 Nov 2006 09:45:59 +0000 Subject: implement more detailed protocol logging (dumping the actual byte values read and written) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@128 ef36b2f9-881f-0410-afb5-c4e39611909c --- nslcd-common.h | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'nslcd-common.h') diff --git a/nslcd-common.h b/nslcd-common.h index 10f73a6..5daebca 100644 --- a/nslcd-common.h +++ b/nslcd-common.h @@ -24,28 +24,50 @@ #ifndef _NSLCD_COMMON_H #define _NSLCD_COMMON_H 1 -/* WRITE marcos, used for writing data, on write error they will - call the ERROR_OUT_WRITEERROR macro - these macros may require the availability of the following - variables: - int32_t tmpint32; - temporary variable - */ - #include +#undef DEBUG_PROT +#undef DEBUG_PROT_DUMP + #ifdef DEBUG_PROT /* define a debugging macro to output logging */ #include #include #define DEBUG_PRINT(fmt,arg) \ - fprintf(stderr,"%s:%d:%s: " fmt"\n",__FILE__,__LINE__,__PRETTY_FUNCTION__,arg); + fprintf(stderr,"%s:%d:%s: " fmt "\n",__FILE__,__LINE__,__PRETTY_FUNCTION__,arg); #else /* DEBUG_PROT */ /* define an empty debug macro to disable logging */ #define DEBUG_PRINT(fmt,arg) #endif /* not DEBUG_PROT */ +#ifdef DEBUG_PROT_DUMP +/* define a debugging macro to output detailed logging */ +#include +static void debug_dump(const void *ptr,size_t size) +{ + int i; + for (i=0;i