17c478bd9Sstevel@tonic-gate #ifndef _LLOG_H
27c478bd9Sstevel@tonic-gate #define _LLOG_H
37c478bd9Sstevel@tonic-gate 
47c478bd9Sstevel@tonic-gate 
57c478bd9Sstevel@tonic-gate #include <stdio.h>
67c478bd9Sstevel@tonic-gate #include <sys/types.h>
77c478bd9Sstevel@tonic-gate #include <sys/stat.h>
87c478bd9Sstevel@tonic-gate #include <nl_types.h>
97c478bd9Sstevel@tonic-gate #include <limits.h>
107c478bd9Sstevel@tonic-gate #include <syslog.h>
117c478bd9Sstevel@tonic-gate #include <portable.h>
127c478bd9Sstevel@tonic-gate 
137c478bd9Sstevel@tonic-gate 
147c478bd9Sstevel@tonic-gate 
157c478bd9Sstevel@tonic-gate /* Log levels */
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate /* slapd values */
187c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_TRACE        0x001
197c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_PACKETS      0x002
207c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_ARGS         0x004
217c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_CONNS        0x008
227c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_BER          0x010
237c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_FILTER       0x020
247c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_CONFIG       0x040
257c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_ACL          0x080
267c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_STATS        0x100
277c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_STATS2       0x200
287c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_SHELL        0x400
297c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_PARSE        0x800
307c478bd9Sstevel@tonic-gate /* More values for http gateway */
317c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_GWAY		0x1000
327c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_GWAYMORE	0x2000
337c478bd9Sstevel@tonic-gate /* Generic values */
347c478bd9Sstevel@tonic-gate #define LDAP_DEBUG_ANY		0xffff
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate nl_catd	sundscat;
377c478bd9Sstevel@tonic-gate extern nl_catd	slapdcat;
387c478bd9Sstevel@tonic-gate extern void 	ldaplogconfig(char * logf, int size);
397c478bd9Sstevel@tonic-gate extern void	ldaplogconfigf(FILE *fd);
40*1da57d55SToomas Soome extern void	ldaploginit(char *name,
417c478bd9Sstevel@tonic-gate 			int facility);
42*1da57d55SToomas Soome extern void	ldaploginitlevel(char *name,
437c478bd9Sstevel@tonic-gate 			    int facility,
447c478bd9Sstevel@tonic-gate 			    int log_level);
457c478bd9Sstevel@tonic-gate extern void 	ldaplog(int level,char *fmt,...);
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )  \
487c478bd9Sstevel@tonic-gate { \
497c478bd9Sstevel@tonic-gate 	if ( log_debug & level ) \
507c478bd9Sstevel@tonic-gate 		fprintf( stderr, fmt, connid, opid, arg1, arg2, arg3 );\
517c478bd9Sstevel@tonic-gate 	if ( log_syslog & level ) \
527c478bd9Sstevel@tonic-gate 		ldaplog( level, fmt, connid, opid, arg1, arg2, arg3 ); \
537c478bd9Sstevel@tonic-gate }
547c478bd9Sstevel@tonic-gate #endif /* _LLOG_H */
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate 
58