/***************************************************************************/ /* Module: $Id: snmpdbg.h,v 1.2 1999/05/07 04:15:27 maf Exp $ /* Description: Define compile time switches to compile debugging code and /* expand debugging macros. /* Author: Shamim Ahmed /* Notes: /***************************************************************************/ /* $Log: snmpdbg.h,v $ Revision 1.2 1999/05/07 04:15:27 maf pr -e2 Revision 1.1 1997/02/23 18:05:11 maf Initial revision * Revision 2.1 1993/10/19 19:37:33 maf * kbconfig 1.7+ * * Revision 1.1 1993/08/29 01:43:32 maf * Initial revision * */ #ifndef SNMPDEBUG_H #define SNMPDEBUH_H /*#define SNMP_DEBUG /*if defined then expand print macros*/ /* define to isolate code for debugging purpose */ /*#define DMY_SOCKET /* if defined then use dummy socket */ /*#define DMY_STDMIB /* if defined then use dummy MIB-1 modules */ /*#define DMY_DS1MIB /* if defined then use dummy DS1 modules */ /*--------- Tags for error -----------------------------------------*/ /* error = wxyz (in Hex) is defined as: ** w = file error tag. ** x = function error tag. ** y = exit number within a function. ** z = SNMP error : SnmpErrorType. **------------------------------------------------------------------*/ /*------- file error tags ---*/ #define SNMPD_ERROR_TAG 1 /* error in snmpd.c */ #define SNMPSRV_ERROR_TAG 2 /* error in snmpsrv.c */ #define ASN_ERROR_TAG 3 /* error in osuasn.c */ #define SNMPCMD_ERROR_TAG 4 /* error in snmpcmd.c */ /*------ fuction error tage in snmpsrv.c -----*/ #define DOSNMP_ERROR_TAG 1 #define ENCODEHDR_ERROR_TAG 2 #define DECODEHDR_ERROR_TAG 3 #define ONEVARUNBIND_ERROR_TAG 4 #define ONEVARBINDREQ_ERROR_TAG 5 #define AUTHSET_ERROR_TAG 6 /* ------------ errors in snmpcmd.c --------- */ #define SNMPGET_ERROR_TAG 1 /*------------------ Debugging macros ------------------------------*/ #ifdef SNMP_DEBUG #define PRINTBYTES(bp, n) \ { \ short i; \ unsigned char *bbp; \ bbp = (char *) (bp); \ for (i = (short) (n); i > 0; i--){ \ printf ("%02.02X ", *bbp++); \ } \ printf("\n");\ } #define DEBUG_MSG1(a) \ printf("["); printf((a)); printf("]") #define DEBUG_MSG2(a,b) \ printf("["); \ printf((a),(b)); \ printf("]") #define DEBUG_MSG3(a,b,c) \ printf("["); \ printf((a),(b),(c)); \ printf("]") #define PRINTREQ(a) \ (void) printReq((a)); \ (void) fflush (stdout); #else /* else SNMP_DEBUG */ #define PRINTBYTES(b, n) #define DEBUG_MSG1(a) #define DEBUG_MSG2(a,b) #define DEBUG_MSG3(a,b,c) #define PRINTSMP(smp) #define PRINTREQ(a) #endif /* end SNMP_DEBUG */ int saveSnmpPkt(); #endif /* SNMPDEBUG_H */