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