1 /* slap.h - stand alone ldap server include file */
3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include "ldap_defaults.h"
12 #include <ac/stdlib.h>
14 #include <sys/types.h>
15 #include <ac/syslog.h>
17 #include <ac/socket.h>
20 #ifdef HAVE_CYRUS_SASL
27 #define ldap_debug slap_debug
34 #include <ldap_schema.h>
36 #include "ldap_pvt_thread.h"
42 #undef f_next /* name conflict between sys/file.h on SCO and struct filter */
45 #define SERVICE_NAME OPENLDAP_PACKAGE "-slapd"
47 /* LDAPMod.mod_op value ===> Must be kept in sync with ldap.h!
49 * This is a value used internally by the backends. It is needed to allow
50 * adding values that already exist without getting an error as required by
51 * modrdn when the new rdn was already an attribute value itself.
52 * JCG 05/1999 (gomez@engr.sgi.com)
54 #define LDAP_MOD_SOFTADD 0x1000
65 #define MAXREMATCHES 10
67 /* XXYYZ: these macros assume 'x' is an ASCII x */
68 #define DNSEPARATOR(c) ((c) == ',' || (c) == ';')
69 #define SEPARATOR(c) ((c) == ',' || (c) == ';' || (c) == '+')
70 #define SPACE(c) ((c) == ' ' || (c) == '\n')
72 #define ASCII_LOWER(c) ( (c) >= 'a' && (c) <= 'z' )
73 #define ASCII_UPPER(c) ( (c) >= 'A' && (c) <= 'Z' )
74 #define ASCII_ALPHA(c) ( ASCII_LOWER(c) || ASCII_UPPER(c) )
75 #define ASCII_DIGIT(c) ( (c) >= '0' && (c) <= '9' )
76 #define ASCII_ALNUM(c) ( ASCII_ALPHA(c) || ASCII_DIGIT(c) )
78 #define LEADKEYCHAR(c) ( ASCII_ALPHA(c) )
79 #define KEYCHAR(c) ( ASCII_ALNUM(c) || (c) == '-' )
80 #define LEADOIDCHAR(c) ( ASCII_DIGIT(c) )
81 #define OIDCHAR(c) ( ASCII_DIGIT(c) || (c) == '.' )
83 #define LEADATTRCHAR(c) ( LEADKEYCHAR(c) || LEADOIDCHAR(c) )
84 #define ATTRCHAR(c) ( KEYCHAR((c)) || (c) == '.' )
86 #define NEEDSESCAPE(c) ((c) == '\\' || (c) == '"')
88 #define SLAP_SCHERR_OUTOFMEM 1
89 #define SLAP_SCHERR_CLASS_NOT_FOUND 2
90 #define SLAP_SCHERR_ATTR_NOT_FOUND 3
91 #define SLAP_SCHERR_DUP_CLASS 4
92 #define SLAP_SCHERR_DUP_ATTR 5
93 #define SLAP_SCHERR_DUP_SYNTAX 6
94 #define SLAP_SCHERR_DUP_RULE 7
95 #define SLAP_SCHERR_NO_NAME 8
96 #define SLAP_SCHERR_ATTR_INCOMPLETE 9
97 #define SLAP_SCHERR_MR_NOT_FOUND 10
98 #define SLAP_SCHERR_SYN_NOT_FOUND 11
99 #define SLAP_SCHERR_MR_INCOMPLETE 12
101 #define SLAPD_ACI_DEFAULT_ATTR "aci"
103 extern int slap_debug;
108 struct replog_moddn {
115 * represents an attribute value assertion (i.e., attr=value)
117 typedef struct slap_ava {
119 struct berval ava_value;
122 typedef struct slap_mra {
130 * represents a search filter
132 typedef struct slap_filter {
133 ber_tag_t f_choice; /* values taken from ldap.h */
139 /* equality, lessorequal, greaterorequal, approx */
146 struct slap_filter *f_un_complex;
151 char *f_un_sub_initial;
153 char *f_un_sub_final;
157 #define f_dn f_un.f_un_type /* used for DN indices */
158 #define f_type f_un.f_un_type
159 #define f_ava f_un.f_un_ava
160 #define f_avtype f_un.f_un_ava.ava_type
161 #define f_avvalue f_un.f_un_ava.ava_value
162 #define f_mra f_un.f_un_mra
163 #define f_mrtype f_un.f_un_mra.mra_type
164 #define f_mrvalue f_un.f_un_mra.mra_value
165 #define f_mrdnaddrs f_un.f_un_mra.mra_dnattrs
166 #define f_and f_un.f_un_complex
167 #define f_or f_un.f_un_complex
168 #define f_not f_un.f_un_complex
169 #define f_list f_un.f_un_complex
170 #define f_sub f_un.f_un_sub
171 #define f_sub_type f_un.f_un_sub.f_un_sub_type
172 #define f_sub_initial f_un.f_un_sub.f_un_sub_initial
173 #define f_sub_any f_un.f_un_sub.f_un_sub_any
174 #define f_sub_final f_un.f_un_sub.f_un_sub_final
176 struct slap_filter *f_next;
180 * represents an attribute (type + values + syntax)
182 typedef struct slap_attr {
184 struct berval **a_vals;
186 struct slap_attr *a_next;
190 * the attr_syntax() routine returns one of these values
191 * telling what kind of syntax an attribute supports.
193 #define SYNTAX_CIS 0x01 /* case insensitive string */
194 #define SYNTAX_CES 0x02 /* case sensitive string */
195 #define SYNTAX_BIN 0x04 /* binary data */
196 #define SYNTAX_TEL 0x08 /* telephone number string */
197 #define SYNTAX_DN 0x10 /* dn string */
200 * the id used in the indexes to refer to an entry
202 typedef unsigned long ID;
203 #define NOID ((ID)~0)
206 * represents an entry in core
208 typedef struct slap_entry {
210 * The ID field should only be changed before entry is
211 * inserted into a cache. The ID value is backend
216 char *e_dn; /* DN of this entry */
217 char *e_ndn; /* normalized DN of this entry */
218 Attribute *e_attrs; /* list of attributes + values */
220 /* for use by the backend for any purpose */
225 * represents an access control list
229 typedef struct slap_access {
231 #define ACL_NONE 0x0001
232 #define ACL_AUTH 0x0004
233 #define ACL_COMPARE 0x0008
234 #define ACL_SEARCH 0x0010
235 #define ACL_READ 0x0020
236 #define ACL_WRITE 0x0040
237 #define ACL_PRIV_MASK 0x00ff
239 #define ACL_SELF 0x4000
240 #define ACL_INVALID (-1)
242 #define ACL_IS(a,lvl) (((a) & (lvl)) == (lvl))
244 #define ACL_IS_NONE(a) ACL_IS((a),ACL_SELF)
245 #define ACL_IS_AUTH(a) ACL_IS((a),ACL_AUTH)
246 #define ACL_IS_COMPARE(a) ACL_IS((a),ACL_COMPARE)
247 #define ACL_IS_SEARCH(a) ACL_IS((a),ACL_SEARCH)
248 #define ACL_IS_READ(a) ACL_IS((a),ACL_READ)
249 #define ACL_IS_WRITE(a) ACL_IS((a),ACL_WRITE)
250 #define ACL_IS_SELF(a) ACL_IS((a),ACL_SELF)
251 #define ACL_IS_INVALID(a) ((a) == ACL_INVALID)
253 #define ACL_CLR(a) ((a) = 0)
254 #define ACL_SET(a,lvl) ((a) |= (lvl))
255 #define ACL_SET_NONE(a) ACL_SET((a),ACL_SELF)
256 #define ACL_SET_AUTH(a) ACL_SET((a),ACL_AUTH)
257 #define ACL_SET_COMPARE(a) ACL_SET((a),ACL_COMPARE)
258 #define ACL_SET_SEARCH(a) ACL_SET((a),ACL_SEARCH)
259 #define ACL_SET_READ(a) ACL_SET((a),ACL_READ)
260 #define ACL_SET_WRITE(a) ACL_SET((a),ACL_WRITE)
261 #define ACL_SET_SELF(a) ACL_SET((a),ACL_SELF)
262 #define ACL_SET_INVALID(a) ((a) = ACL_INVALID)
264 #define ACL_PRIV(a) ((a) & ACL_PRIV_MASK)
265 #define ACL_GRANT(a,lvl) (ACL_PRIV(a) >= (lvl))
272 char *a_peername_pat;
273 char *a_sockname_pat;
278 #ifdef SLAPD_ACI_ENABLED
287 struct slap_access *a_next;
291 typedef struct slap_acl {
292 /* "to" part: the entries this acl applies to */
298 /* "by" part: list of who has what access to the entries */
301 struct slap_acl *acl_next;
307 typedef struct ldapmodlist {
308 struct ldapmod ml_mod;
309 struct ldapmodlist *ml_next;
310 #define ml_op ml_mod.mod_op
311 #define ml_type ml_mod.mod_type
312 #define ml_values ml_mod.mod_values
313 #define ml_bvalues ml_mod.mod_bvalues
317 * represents schema information for a database
319 typedef struct slap_oid_macro {
320 struct slap_oid_macro *next;
326 typedef int slap_syntax_check_func LDAP_P((struct berval * val));
328 typedef struct slap_syntax {
329 LDAP_SYNTAX ssyn_syn;
330 slap_syntax_check_func *ssyn_check;
331 struct slap_syntax *ssyn_next;
333 #define ssyn_oid ssyn_syn.syn_oid
334 #define ssyn_desc ssyn_syn.syn_desc
336 typedef int slap_mr_normalize_func LDAP_P((struct berval * val, struct berval **normalized));
337 typedef int slap_mr_compare_func LDAP_P((struct berval * val1, struct berval * val2));
339 typedef struct slap_matching_rule {
340 LDAP_MATCHING_RULE smr_mrule;
341 slap_mr_normalize_func *smr_normalize;
342 slap_mr_compare_func *smr_compare;
344 struct slap_matching_rule *smr_next;
346 #define smr_oid smr_mrule.mr_oid
347 #define smr_names smr_mrule.mr_names
348 #define smr_desc smr_mrule.mr_desc
349 #define smr_obsolete smr_mrule.mr_obsolete
350 #define smr_syntax_oid smr_mrule.mr_syntax_oid
352 typedef struct slap_attribute_type {
353 LDAP_ATTRIBUTE_TYPE sat_atype;
354 struct slap_attribute_type *sat_sup;
355 struct slap_attribute_type **sat_subtypes;
356 MatchingRule *sat_equality;
357 MatchingRule *sat_ordering;
358 MatchingRule *sat_substr;
360 /* The next one is created to help in the transition */
361 int sat_syntax_compat;
362 struct slap_attribute_type *sat_next;
364 #define sat_oid sat_atype.at_oid
365 #define sat_names sat_atype.at_names
366 #define sat_desc sat_atype.at_desc
367 #define sat_obsolete sat_atype.at_obsolete
368 #define sat_sup_oid sat_atype.at_sup_oid
369 #define sat_equality_oid sat_atype.at_equality_oid
370 #define sat_ordering_oid sat_atype.at_ordering_oid
371 #define sat_substr_oid sat_atype.at_substr_oid
372 #define sat_syntax_oid sat_atype.at_syntax_oid
373 #define sat_syntax_len sat_atype.at_syntax_len
374 #define sat_single_value sat_atype.at_single_value
375 #define sat_collective sat_atype.at_collective
376 #define sat_no_user_mods sat_atype.at_no_user_mods
377 #define sat_usage sat_atype.at_usage
379 typedef struct slap_object_class {
380 LDAP_OBJECT_CLASS soc_oclass;
381 struct slap_object_class **soc_sups;
382 AttributeType **soc_required;
383 AttributeType **soc_allowed;
384 struct slap_object_class *soc_next;
386 #define soc_oid soc_oclass.oc_oid
387 #define soc_names soc_oclass.oc_names
388 #define soc_desc soc_oclass.oc_desc
389 #define soc_obsolete soc_oclass.oc_obsolete
390 #define soc_sup_oids soc_oclass.oc_sup_oids
391 #define soc_kind soc_oclass.oc_kind
392 #define soc_at_oids_must soc_oclass.oc_at_oids_must
393 #define soc_at_oids_may soc_oclass.oc_at_oids_may
397 * represents a backend
400 typedef struct slap_backend_info BackendInfo; /* per backend type */
401 typedef struct slap_backend_db BackendDB; /* per backend database */
403 extern int nBackendInfo;
404 extern int nBackendDB;
405 extern BackendInfo *backendInfo;
406 extern BackendDB *backendDB;
409 #define SLAP_UNDEFINED_MODE 0x0000
410 #define SLAP_SERVER_MODE 0x0001
411 #define SLAP_TOOL_MODE 0x0002
412 #define SLAP_MODE 0x0003
414 #define SLAP_TRUNCATE_MODE 0x0100
416 #define SLAP_TIMED_MODE 0x1000
418 #define SLAP_TOOLID_MODE 4
420 /* temporary aliases */
421 typedef BackendDB Backend;
422 #define nbackends nBackendDB
423 #define backends backendDB
425 struct slap_backend_db {
426 BackendInfo *bd_info; /* pointer to shared backend info */
428 /* BackendInfo accessors */
429 #define be_config bd_info->bi_db_config
430 #define be_type bd_info->bi_type
432 #define be_bind bd_info->bi_op_bind
433 #define be_unbind bd_info->bi_op_unbind
434 #define be_add bd_info->bi_op_add
435 #define be_compare bd_info->bi_op_compare
436 #define be_delete bd_info->bi_op_delete
437 #define be_modify bd_info->bi_op_modify
438 #define be_modrdn bd_info->bi_op_modrdn
439 #define be_search bd_info->bi_op_search
441 #define be_release bd_info->bi_entry_release_rw
442 #define be_group bd_info->bi_acl_group
444 #define be_connection_init bd_info->bi_connection_init
445 #define be_connection_destroy bd_info->bi_connection_destroy
448 #define be_entry_open bd_info->bi_tool_entry_open
449 #define be_entry_close bd_info->bi_tool_entry_close
450 #define be_entry_first bd_info->bi_tool_entry_first
451 #define be_entry_next bd_info->bi_tool_entry_next
452 #define be_entry_get bd_info->bi_tool_entry_get
453 #define be_entry_put bd_info->bi_tool_entry_put
454 #define be_index_attr bd_info->bi_tool_index_attr
455 #define be_index_change bd_info->bi_tool_index_change
456 #define be_sync bd_info->bi_tool_sync
459 /* these should be renamed from be_ to bd_ */
460 char **be_suffix; /* the DN suffixes of data in this backend */
461 char **be_nsuffix; /* the normalized DN suffixes in this backend */
462 char **be_suffixAlias; /* pairs of DN suffix aliases and deref values */
463 char *be_root_dn; /* the magic "root" dn for this db */
464 char *be_root_ndn; /* the magic "root" normalized dn for this db */
465 char *be_root_pw; /* the magic "root" password for this db */
466 int be_readonly; /* 1 => db is in "read only" mode */
467 unsigned int be_max_deref_depth; /* limit for depth of an alias deref */
468 int be_sizelimit; /* size limit for this backend */
469 int be_timelimit; /* time limit for this backend */
470 AccessControl *be_acl; /* access control list for this backend */
471 int be_dfltaccess; /* access given if no acl matches */
472 char **be_replica; /* replicas of this backend (in master) */
473 char *be_replogfile; /* replication log file (in master) */
474 char *be_update_ndn; /* allowed to make changes (in replicas) */
475 struct berval **be_update_refs; /* where to refer modifying clients to */
476 int be_lastmod; /* keep track of lastmodified{by,time} */
480 void *be_private; /* anything the backend database needs */
483 struct slap_backend_info {
484 char *bi_type; /* type of backend */
487 * per backend type routines:
488 * bi_init: called to allocate a backend_info structure,
489 * called once BEFORE configuration file is read.
490 * bi_init() initializes this structure hence is
491 * called directly from be_initialize()
492 * bi_config: called per 'backend' specific option
493 * all such options must before any 'database' options
494 * bi_config() is called only from read_config()
495 * bi_open: called to open each database, called
496 * once AFTER configuration file is read but
497 * BEFORE any bi_db_open() calls.
498 * bi_open() is called from backend_startup()
499 * bi_close: called to close each database, called
500 * once during shutdown after all bi_db_close calls.
501 * bi_close() is called from backend_shutdown()
502 * bi_destroy: called to destroy each database, called
503 * once during shutdown after all bi_db_destroy calls.
504 * bi_destory() is called from backend_destroy()
506 int (*bi_init) LDAP_P((BackendInfo *bi));
507 int (*bi_config) LDAP_P((BackendInfo *bi,
508 const char *fname, int lineno, int argc, char **argv ));
509 int (*bi_open) LDAP_P((BackendInfo *bi));
510 int (*bi_close) LDAP_P((BackendInfo *bi));
511 int (*bi_destroy) LDAP_P((BackendInfo *bi));
514 * per database routines:
515 * bi_db_init: called to initialize each database,
516 * called upon reading 'database <type>'
517 * called only from backend_db_init()
518 * bi_db_config: called to configure each database,
519 * called per database to handle per database options
520 * called only from read_config()
521 * bi_db_open: called to open each database
522 * called once per database immediately AFTER bi_open()
523 * calls but before daemon startup.
524 * called only by backend_startup()
525 * bi_db_close: called to close each database
526 * called once per database during shutdown but BEFORE
528 * called only by backend_shutdown()
529 * bi_db_destroy: called to destroy each database
530 * called once per database during shutdown AFTER all
531 * bi_close calls but before bi_destory calls.
532 * called only by backend_destory()
534 int (*bi_db_init) LDAP_P((Backend *bd));
535 int (*bi_db_config) LDAP_P((Backend *bd,
536 const char *fname, int lineno, int argc, char **argv ));
537 int (*bi_db_open) LDAP_P((Backend *bd));
538 int (*bi_db_close) LDAP_P((Backend *bd));
539 int (*bi_db_destroy) LDAP_P((Backend *db));
541 /* LDAP Operations Handling Routines */
542 int (*bi_op_bind) LDAP_P(( BackendDB *bd,
543 struct slap_conn *c, struct slap_op *o,
544 char *dn, int method, char* mechanism,
545 struct berval *cred, char** edn ));
546 int (*bi_op_unbind) LDAP_P((BackendDB *bd,
547 struct slap_conn *c, struct slap_op *o ));
548 int (*bi_op_search) LDAP_P((BackendDB *bd,
549 struct slap_conn *c, struct slap_op *o,
550 char *base, int scope, int deref,
551 int slimit, int tlimit,
552 Filter *f, char *filterstr, char **attrs,
554 int (*bi_op_compare)LDAP_P((BackendDB *bd,
555 struct slap_conn *c, struct slap_op *o,
556 char *dn, Ava *ava));
557 int (*bi_op_modify) LDAP_P((BackendDB *bd,
558 struct slap_conn *c, struct slap_op *o,
559 char *dn, LDAPModList *m));
560 int (*bi_op_modrdn) LDAP_P((BackendDB *bd,
561 struct slap_conn *c, struct slap_op *o,
562 char *dn, char *newrdn, int deleteoldrdn,
564 int (*bi_op_add) LDAP_P((BackendDB *bd,
565 struct slap_conn *c, struct slap_op *o,
567 int (*bi_op_delete) LDAP_P((BackendDB *bd,
568 struct slap_conn *c, struct slap_op *o,
570 int (*bi_op_abandon) LDAP_P((BackendDB *bd,
571 struct slap_conn *c, struct slap_op *o,
574 /* Auxilary Functions */
575 int (*bi_entry_release_rw) LDAP_P((BackendDB *bd, Entry *e, int rw));
577 int (*bi_acl_group) LDAP_P((Backend *bd,
578 Entry *e, const char *bdn, const char *edn,
579 const char *objectclassValue, const char *groupattrName ));
581 int (*bi_connection_init) LDAP_P((BackendDB *bd,
582 struct slap_conn *c));
583 int (*bi_connection_destroy) LDAP_P((BackendDB *bd,
584 struct slap_conn *c));
586 /* hooks for slap tools */
587 int (*bi_tool_entry_open) LDAP_P(( BackendDB *be, int mode ));
588 int (*bi_tool_entry_close) LDAP_P(( BackendDB *be ));
589 ID (*bi_tool_entry_first) LDAP_P(( BackendDB *be ));
590 ID (*bi_tool_entry_next) LDAP_P(( BackendDB *be ));
591 Entry* (*bi_tool_entry_get) LDAP_P(( BackendDB *be, ID id ));
592 ID (*bi_tool_entry_put) LDAP_P(( BackendDB *be, Entry *e ));
593 int (*bi_tool_index_attr) LDAP_P(( BackendDB *be, char* type ));
594 int (*bi_tool_index_change) LDAP_P(( BackendDB *be, char* type,
595 struct berval **bv, ID id, int op ));
596 int (*bi_tool_sync) LDAP_P(( BackendDB *be ));
598 #define SLAP_INDEX_ADD_OP 0x0001
599 #define SLAP_INDEX_DELETE_OP 0x0002
601 unsigned int bi_nDB; /* number of databases of this type */
602 void *bi_private; /* anything the backend type needs */
606 * represents an operation pending from an ldap client
609 typedef struct slap_op {
610 ber_int_t o_opid; /* id of this operation */
611 ber_int_t o_msgid; /* msgid of the request */
613 ldap_pvt_thread_t o_tid; /* thread handling this op */
615 BerElement *o_ber; /* ber of the request */
617 ber_tag_t o_tag; /* tag of the request */
618 time_t o_time; /* time op was initiated */
620 int o_bind_in_progress; /* multi-step bind in progress */
622 char *o_dn; /* dn bound when op was initiated */
623 char *o_ndn; /* normalized dn bound when op was initiated */
624 ber_int_t o_protocol; /* version of the LDAP protocol used by client */
625 ber_tag_t o_authtype; /* auth method used to bind dn */
626 /* values taken from ldap.h */
628 char *o_authmech; /* SASL mechanism used to bind dn */
630 LDAPControl **o_ctrls; /* controls */
632 unsigned long o_connid; /* id of conn initiating this op */
634 #ifdef LDAP_CONNECTIONLESS
635 int o_cldap; /* != 0 if this came in via CLDAP */
636 struct sockaddr o_clientaddr; /* client address if via CLDAP */
637 char o_searchbase; /* search base if via CLDAP */
640 ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon */
641 int o_abandon; /* abandon flag */
643 struct slap_op *o_next; /* next operation in list */
644 void *o_private; /* anything the backend needs */
648 * represents a connection from an ldap client
651 typedef struct slap_conn {
652 int c_struct_state; /* structure management state */
653 int c_conn_state; /* connection state */
655 ldap_pvt_thread_mutex_t c_mutex; /* protect the connection */
656 Sockbuf *c_sb; /* ber connection stuff */
658 /* only can be changed by connect_init */
659 time_t c_starttime; /* when the connection was opened */
660 time_t c_activitytime; /* when the connection was last used */
661 unsigned long c_connid; /* id of this connection for stats*/
663 char *c_listener_url; /* listener URL */
664 char *c_peer_domain; /* DNS name of client */
665 char *c_peer_name; /* peer name (trans=addr:port) */
666 char *c_sock_name; /* sock name (trans=addr:port) */
668 #ifdef HAVE_CYRUS_SASL
669 sasl_conn_t *c_sasl_context;
672 /* only can be changed by binding thread */
673 int c_bind_in_progress; /* multi-op bind in progress */
675 char *c_cdn; /* DN provided by the client */
676 char *c_dn; /* DN bound to this conn */
677 ber_int_t c_protocol; /* version of the LDAP protocol used by client */
678 ber_tag_t c_authtype;/* auth method used to bind c_dn */
679 char *c_authmech; /* SASL mechanism used to bind c_dn */
680 void *c_authstate; /* SASL state data */
682 Operation *c_ops; /* list of operations being processed */
683 Operation *c_pending_ops; /* list of pending operations */
685 ldap_pvt_thread_mutex_t c_write_mutex; /* only one pdu written at a time */
686 ldap_pvt_thread_cond_t c_write_cv; /* used to wait for sd write-ready*/
688 BerElement *c_currentber; /* ber we're attempting to read */
689 int c_writewaiter; /* true if writer is waiting */
692 int c_is_tls; /* true if this LDAP over raw TLS */
693 int c_needs_tls_accept; /* true if SSL_accept should be called */
696 long c_n_ops_received; /* num of ops received (next op_id) */
697 long c_n_ops_executing; /* num of ops currently executing */
698 long c_n_ops_pending; /* num of ops pending execution */
699 long c_n_ops_completed; /* num of ops completed */
701 long c_n_get; /* num of get calls */
702 long c_n_read; /* num of read calls */
703 long c_n_write; /* num of write calls */
706 #if defined(LDAP_SYSLOG) && defined(LDAP_DEBUG)
707 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 ) \
709 if ( ldap_debug & (level) ) \
710 fprintf( stderr, (fmt), (connid), (opid), (arg1), (arg2), (arg3) );\
711 if ( ldap_syslog & (level) ) \
712 syslog( ldap_syslog_level, (fmt), (connid), (opid), (arg1), \
716 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )
721 #include "proto-slap.h"
723 #endif /* _slap_h_ */