1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * 3*0Sstevel@tonic-gate * Copyright %G% Sun Microsystems, Inc. 4*0Sstevel@tonic-gate * All Rights Reserved 5*0Sstevel@tonic-gate * 6*0Sstevel@tonic-gate */ 7*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 8*0Sstevel@tonic-gate 9*0Sstevel@tonic-gate #ifndef _LLOG_H 10*0Sstevel@tonic-gate #define _LLOG_H 11*0Sstevel@tonic-gate 12*0Sstevel@tonic-gate 13*0Sstevel@tonic-gate #include <stdio.h> 14*0Sstevel@tonic-gate #include <sys/types.h> 15*0Sstevel@tonic-gate #include <sys/stat.h> 16*0Sstevel@tonic-gate #include <nl_types.h> 17*0Sstevel@tonic-gate #include <limits.h> 18*0Sstevel@tonic-gate #include <syslog.h> 19*0Sstevel@tonic-gate #include <portable.h> 20*0Sstevel@tonic-gate 21*0Sstevel@tonic-gate 22*0Sstevel@tonic-gate 23*0Sstevel@tonic-gate /* Log levels */ 24*0Sstevel@tonic-gate 25*0Sstevel@tonic-gate /* slapd values */ 26*0Sstevel@tonic-gate #define LDAP_DEBUG_TRACE 0x001 27*0Sstevel@tonic-gate #define LDAP_DEBUG_PACKETS 0x002 28*0Sstevel@tonic-gate #define LDAP_DEBUG_ARGS 0x004 29*0Sstevel@tonic-gate #define LDAP_DEBUG_CONNS 0x008 30*0Sstevel@tonic-gate #define LDAP_DEBUG_BER 0x010 31*0Sstevel@tonic-gate #define LDAP_DEBUG_FILTER 0x020 32*0Sstevel@tonic-gate #define LDAP_DEBUG_CONFIG 0x040 33*0Sstevel@tonic-gate #define LDAP_DEBUG_ACL 0x080 34*0Sstevel@tonic-gate #define LDAP_DEBUG_STATS 0x100 35*0Sstevel@tonic-gate #define LDAP_DEBUG_STATS2 0x200 36*0Sstevel@tonic-gate #define LDAP_DEBUG_SHELL 0x400 37*0Sstevel@tonic-gate #define LDAP_DEBUG_PARSE 0x800 38*0Sstevel@tonic-gate /* More values for http gateway */ 39*0Sstevel@tonic-gate #define LDAP_DEBUG_GWAY 0x1000 40*0Sstevel@tonic-gate #define LDAP_DEBUG_GWAYMORE 0x2000 41*0Sstevel@tonic-gate /* Generic values */ 42*0Sstevel@tonic-gate #define LDAP_DEBUG_ANY 0xffff 43*0Sstevel@tonic-gate 44*0Sstevel@tonic-gate nl_catd sundscat; 45*0Sstevel@tonic-gate extern nl_catd slapdcat; 46*0Sstevel@tonic-gate extern void ldaplogconfig(char * logf, int size); 47*0Sstevel@tonic-gate extern void ldaplogconfigf(FILE *fd); 48*0Sstevel@tonic-gate extern void ldaploginit(char *name, 49*0Sstevel@tonic-gate int facility); 50*0Sstevel@tonic-gate extern void ldaploginitlevel(char *name, 51*0Sstevel@tonic-gate int facility, 52*0Sstevel@tonic-gate int log_level); 53*0Sstevel@tonic-gate extern void ldaplog(int level,char *fmt,...); 54*0Sstevel@tonic-gate 55*0Sstevel@tonic-gate #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \ 56*0Sstevel@tonic-gate { \ 57*0Sstevel@tonic-gate if ( log_debug & level ) \ 58*0Sstevel@tonic-gate fprintf( stderr, fmt, connid, opid, arg1, arg2, arg3 );\ 59*0Sstevel@tonic-gate if ( log_syslog & level ) \ 60*0Sstevel@tonic-gate ldaplog( level, fmt, connid, opid, arg1, arg2, arg3 ); \ 61*0Sstevel@tonic-gate } 62*0Sstevel@tonic-gate #endif /* _LLOG_H */ 63*0Sstevel@tonic-gate 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate 66