]> git.sur5r.net Git - openldap/blob - servers/slapd/proto-slap.h
Reorder error detection based upon precedence
[openldap] / servers / slapd / proto-slap.h
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 #ifndef _PROTO_SLAP
7 #define _PROTO_SLAP
8
9 #include <ldap_cdefs.h>
10
11 LDAP_BEGIN_DECL
12
13 #ifdef SLAPD_SCHEMA_NOT_COMPAT
14 LIBSLAPD_F (int) slap_str2ad LDAP_P((
15         const char *,
16         AttributeDescription **ad,
17         char **text ));
18
19 LIBSLAPD_F (int) slap_bv2ad LDAP_P((
20         struct berval *bv,
21         AttributeDescription **ad,
22         char **text ));
23
24 LIBSLAPD_F (AttributeDescription *) ad_dup LDAP_P((
25         AttributeDescription *desc ));
26
27 LIBSLAPD_F (void) ad_free LDAP_P((
28         AttributeDescription *desc,
29         int freeit ));
30
31 #define ad_cmp(l,r)     ( strcasecmp( \
32         (l)->ad_cname->bv_val, (r)->ad_cname->bv_val ))
33
34 LIBSLAPD_F (int) is_ad_subtype LDAP_P((
35         AttributeDescription *sub,
36         AttributeDescription *super ));
37
38 LIBSLAPD_F (int) ad_inlist LDAP_P((
39         AttributeDescription *desc,
40         char **attrs ));
41 #else
42 #define ad_inlist(d,a) charray_inlist(a,d)
43 #endif
44
45 /*
46  * acl.c
47  */
48
49 #if SLAPD_SCHEMA_NOT_COMPAT
50 LIBSLAPD_F (int) access_allowed LDAP_P((
51         Backend *be, Connection *conn, Operation *op,
52         Entry *e, AttributeDescription *desc, struct berval *val,
53         slap_access_t access ));
54 #else
55 LIBSLAPD_F (int) access_allowed LDAP_P((
56         Backend *be, Connection *conn, Operation *op,
57         Entry *e, const char *attr, struct berval *val,
58         slap_access_t access ));
59 #endif
60 LIBSLAPD_F (int) acl_check_modlist LDAP_P((
61         Backend *be, Connection *conn, Operation *op,
62         Entry *e, Modifications *ml ));
63
64 LIBSLAPD_F (void) acl_append( AccessControl **l, AccessControl *a );
65
66 LIBSLAPD_F (char *) get_supported_acimech LDAP_P((int index));
67
68 /*
69  * aclparse.c
70  */
71
72 LIBSLAPD_F (void) parse_acl LDAP_P(( Backend *be,
73         const char *fname, int lineno,
74         int argc, char **argv ));
75
76 LIBSLAPD_F (char *) access2str LDAP_P(( slap_access_t access ));
77 LIBSLAPD_F (slap_access_t) str2access LDAP_P(( const char *str ));
78
79 #define ACCESSMASK_MAXLEN       sizeof("unknown (+wrscan)")
80 LIBSLAPD_F (char *) accessmask2str LDAP_P(( slap_access_mask_t mask, char* ));
81 LIBSLAPD_F (slap_access_mask_t) str2accessmask LDAP_P(( const char *str ));
82
83 /*
84  * at.c
85  */
86
87 LIBSLAPD_F (void) at_config LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
88 LIBSLAPD_F (AttributeType *) at_find LDAP_P(( const char *name ));
89 LIBSLAPD_F (int) at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list ));
90 LIBSLAPD_F (int) at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp ));
91 LIBSLAPD_F (int) at_delete_from_list LDAP_P(( int pos, AttributeType ***listp ));
92 LIBSLAPD_F (int) at_fake_if_needed LDAP_P(( const char *name ));
93 LIBSLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
94 LIBSLAPD_F (int) at_add LDAP_P(( LDAP_ATTRIBUTE_TYPE *at, const char **err ));
95
96 #ifdef SLAPD_SCHEMA_NOT_COMPAT
97 LIBSLAPD_F (int) is_at_subtype LDAP_P((
98         AttributeType *sub,
99         AttributeType *super ));
100
101 #       define at_canonical_name(at) ((at)->sat_cname)  
102 #else
103 LIBSLAPD_F (char *) at_canonical_name LDAP_P(( const char * a_type ));
104 #endif
105
106
107 /*
108  * attr.c
109  */
110
111 LIBSLAPD_F (void) attr_free LDAP_P(( Attribute *a ));
112 LIBSLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a ));
113 LIBSLAPD_F (char *) attr_normalize LDAP_P(( char *s ));
114 LIBSLAPD_F (int) attr_merge_fast LDAP_P(( Entry *e, const char *type,
115         struct berval **vals, int  nvals, int  naddvals, int  *maxvals,
116         Attribute ***a ));
117 LIBSLAPD_F (int) attr_merge LDAP_P(( Entry *e, const char *type,
118         struct berval **vals ));
119
120 #ifdef SLAPD_SCHEMA_NOT_COMPAT
121 LIBSLAPD_F (Attribute *) attrs_find LDAP_P(( Attribute *a, AttributeDescription *desc ));
122 LIBSLAPD_F (Attribute *) attr_find LDAP_P(( Attribute *a, AttributeDescription *desc ));
123 LIBSLAPD_F (int) attr_delete LDAP_P(( Attribute **attrs, AttributeDescription *desc ));
124 #else
125 LIBSLAPD_F (Attribute *) attr_find LDAP_P(( Attribute *a, const char *type ));
126 LIBSLAPD_F (int) attr_delete LDAP_P(( Attribute **attrs, const char *type ));
127 LIBSLAPD_F (int) attr_syntax LDAP_P(( const char *type ));
128 #endif
129
130 LIBSLAPD_F (void) attrs_free LDAP_P(( Attribute *a ));
131 LIBSLAPD_F (Attribute *) attrs_dup LDAP_P(( Attribute *a ));
132
133
134 /*
135  * ava.c
136  */
137 #ifdef SLAPD_SCHEMA_NOT_COMPAT
138 LIBSLAPD_F (int) get_ava LDAP_P((
139         BerElement *ber,
140         AttributeAssertion *ava ));
141 LIBSLAPD_F (void) ava_free LDAP_P((
142         AttributeAssertion *ava,
143         int freeit ));
144 #else
145 LIBSLAPD_F (int) get_ava LDAP_P(( BerElement *ber, Ava *ava ));
146 LIBSLAPD_F (void) ava_free LDAP_P(( Ava *ava, int freeit ));
147 #endif
148
149 /*
150  * backend.c
151  */
152
153 LIBSLAPD_F (int) backend_init LDAP_P((void));
154 LIBSLAPD_F (int) backend_add LDAP_P((BackendInfo *aBackendInfo));
155 LIBSLAPD_F (int) backend_num LDAP_P((Backend *be));
156 LIBSLAPD_F (int) backend_startup LDAP_P((Backend *be));
157 LIBSLAPD_F (int) backend_shutdown LDAP_P((Backend *be));
158 LIBSLAPD_F (int) backend_destroy LDAP_P((void));
159
160 LIBSLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
161 LIBSLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type ));
162
163 LIBSLAPD_F (BackendDB *) select_backend LDAP_P(( const char * dn ));
164
165 LIBSLAPD_F (int) be_issuffix LDAP_P(( Backend *be, const char *suffix ));
166 LIBSLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
167 LIBSLAPD_F (int) be_isroot_pw LDAP_P(( Backend *be, const char *ndn, struct berval *cred ));
168 LIBSLAPD_F (char *) be_root_dn LDAP_P(( Backend *be ));
169 LIBSLAPD_F (int) be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
170 #define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 )
171 #define be_entry_release_w( be, e ) be_entry_release_rw( be, e, 1 )
172
173 LIBSLAPD_F (int) backend_unbind LDAP_P((Connection *conn, Operation *op));
174
175 LIBSLAPD_F( int )       backend_check_controls LDAP_P((
176         Backend *be,
177         Connection *conn,
178         Operation *op ));
179
180 LIBSLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
181 LIBSLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
182
183 #ifdef SLAPD_SCHEMA_NOT_COMPAT
184 LIBSLAPD_F (int) backend_group LDAP_P((Backend *be,
185         Entry *target,
186         const char *gr_ndn,
187         const char *op_ndn,
188         const char *objectclassValue,
189         AttributeDescription *groupAttrType
190 ));
191 #else
192 LIBSLAPD_F (int) backend_group LDAP_P((Backend *be,
193         Entry *target,
194         const char *gr_ndn,
195         const char *op_ndn,
196         const char *objectclassValue,
197         const char *groupattrName
198 ));
199 #endif
200
201 LIBSLAPD_F (Attribute *) backend_operational( Backend *, Entry * );
202
203
204
205 /*
206  * ch_malloc.c
207  */
208
209 #ifdef CSRIMALLOC
210 #define ch_malloc malloc
211 #define ch_realloc realloc
212 #define ch_calloc calloc
213 #define ch_strdup strdup
214 #define ch_free free
215
216 #else
217 LIBSLAPD_F (void *) ch_malloc LDAP_P(( ber_len_t size ));
218 LIBSLAPD_F (void *) ch_realloc LDAP_P(( void *block, ber_len_t size ));
219 LIBSLAPD_F (void *) ch_calloc LDAP_P(( ber_len_t nelem, ber_len_t size ));
220 LIBSLAPD_F (char *) ch_strdup LDAP_P(( const char *string ));
221 LIBSLAPD_F (void) ch_free LDAP_P(( void * ));
222
223 #ifndef CH_FREE
224 #undef free
225 #define free ch_free
226 #endif
227 #endif
228
229 /*
230  * charray.c
231  */
232
233 LIBSLAPD_F (void) charray_add LDAP_P(( char ***a, const char *s ));
234 LIBSLAPD_F (void) charray_merge LDAP_P(( char ***a, char **s ));
235 LIBSLAPD_F (void) charray_free LDAP_P(( char **array ));
236 LIBSLAPD_F (int) charray_inlist LDAP_P(( char **a, const char *s ));
237 LIBSLAPD_F (char **) charray_dup LDAP_P(( char **a ));
238 LIBSLAPD_F (char **) str2charray LDAP_P(( const char *str, const char *brkstr ));
239 LIBSLAPD_F (char *) charray2str LDAP_P(( char **a ));
240
241 /*
242  * controls.c
243  */
244 LIBSLAPD_F (int) get_ctrls LDAP_P((
245         Connection *co,
246         Operation *op,
247         int senderrors ));
248
249 LIBSLAPD_F (int) get_manageDSAit LDAP_P(( Operation *op ));
250
251 /*
252  * config.c
253  */
254
255 LIBSLAPD_F (int) read_config LDAP_P(( const char *fname ));
256
257 /*
258  * connection.c
259  */
260 LIBSLAPD_F (int) connections_init LDAP_P((void));
261 LIBSLAPD_F (int) connections_shutdown LDAP_P((void));
262 LIBSLAPD_F (int) connections_destroy LDAP_P((void));
263 LIBSLAPD_F (int) connections_timeout_idle LDAP_P((time_t));
264
265 LIBSLAPD_F (long) connection_init LDAP_P((
266         ber_socket_t s,
267         const char* url,
268         const char* dnsname,
269         const char* peername,
270         const char* sockname,
271         int use_tls ));
272
273 LIBSLAPD_F (void) connection_closing LDAP_P(( Connection *c ));
274 LIBSLAPD_F (int) connection_state_closing LDAP_P(( Connection *c ));
275 LIBSLAPD_F (const char *) connection_state2str LDAP_P(( int state )) LDAP_GCCATTR((const));
276
277 LIBSLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
278 LIBSLAPD_F (int) connection_read LDAP_P((ber_socket_t s));
279
280 LIBSLAPD_F (unsigned long) connections_nextid(void);
281
282 LIBSLAPD_F (Connection *) connection_first LDAP_P((ber_socket_t *));
283 LIBSLAPD_F (Connection *) connection_next LDAP_P((Connection *, ber_socket_t *));
284 LIBSLAPD_F (void) connection_done LDAP_P((Connection *));
285
286 /*
287  * dn.c
288  */
289
290 LIBSLAPD_F (char *) dn_validate LDAP_P(( char *dn ));
291 LIBSLAPD_F (char *) dn_normalize LDAP_P(( char *dn ));
292 LIBSLAPD_F (char *) dn_parent LDAP_P(( Backend *be, const char *dn ));
293 LIBSLAPD_F (char **) dn_subtree LDAP_P(( Backend *be, const char *dn ));
294 LIBSLAPD_F (char *) dn_rdn LDAP_P(( Backend *be, char *dn ));
295 LIBSLAPD_F (int) dn_issuffix LDAP_P(( char *dn, char *suffix ));
296 LIBSLAPD_F (int) rdn_validate LDAP_P(( const char* str ));
297 LIBSLAPD_F (char *) rdn_attr_value LDAP_P(( char * rdn ));
298 LIBSLAPD_F (char *) rdn_attr_type LDAP_P(( char * rdn ));
299
300 LIBSLAPD_F (void) build_new_dn LDAP_P(( char ** new_dn,
301         const char *e_dn,
302         const char * p_dn,
303         const char * newrdn ));
304 /*
305  * entry.c
306  */
307
308 LIBSLAPD_F (int) entry_destroy LDAP_P((void));
309
310 LIBSLAPD_F (Entry *) str2entry LDAP_P(( char    *s ));
311 LIBSLAPD_F (char *) entry2str LDAP_P(( Entry *e, int *len ));
312 LIBSLAPD_F (void) entry_free LDAP_P(( Entry *e ));
313
314 LIBSLAPD_F (int) entry_cmp LDAP_P(( Entry *a, Entry *b ));
315 LIBSLAPD_F (int) entry_dn_cmp LDAP_P(( Entry *a, Entry *b ));
316 LIBSLAPD_F (int) entry_id_cmp LDAP_P(( Entry *a, Entry *b ));
317
318 /*
319  * extended.c
320  */
321
322 #define SLAPD_EXTOP_GETVERSION 0
323 #define SLAPD_EXTOP_GETPROTO 1
324 #define SLAPD_EXTOP_GETAUTH 2
325 #define SLAPD_EXTOP_GETDN 3
326 #define SLAPD_EXTOP_GETCLIENT 4
327
328 typedef int (*SLAP_EXTOP_CALLBACK_FN) LDAP_P((
329         Connection *conn, Operation *op,
330         int msg, int arg, void *argp ));
331
332 typedef int (*SLAP_EXTOP_MAIN_FN) LDAP_P((
333         SLAP_EXTOP_CALLBACK_FN,
334         Connection *conn, Operation *op,
335         char * reqoid,
336         struct berval * reqdata,
337         char ** rspoid,
338         struct berval ** rspdata,
339         LDAPControl *** rspctrls,
340         char ** text,
341         struct berval *** refs ));
342
343 typedef int (*SLAP_EXTOP_GETOID_FN) LDAP_P((
344         int index, char *oid, int blen ));
345
346 LIBSLAPD_F (int) load_extension LDAP_P((const void *module, const char *file_name));
347 LIBSLAPD_F (char *) get_supported_extension LDAP_P((int index));
348
349 LIBSLAPD_F (int) load_extop LDAP_P((
350         const char *ext_oid,
351         SLAP_EXTOP_MAIN_FN ext_main ));
352
353 LIBSLAPD_F (int) extops_init LDAP_P(( void ));
354
355 LIBSLAPD_F (int) extops_kill LDAP_P(( void ));
356
357 LIBSLAPD_F (char *) get_supported_extop LDAP_P((int index));
358
359 /*
360  * filter.c
361  */
362
363 LIBSLAPD_F (int) get_filter LDAP_P((
364         Connection *conn,
365         BerElement *ber,
366         Filter **filt,
367         char **fstr,
368         char **text ));
369
370 LIBSLAPD_F (void) filter_free LDAP_P(( Filter *f ));
371 LIBSLAPD_F (void) filter_print LDAP_P(( Filter *f ));
372
373 /*
374  * filterentry.c
375  */
376
377 LIBSLAPD_F (int) test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e, Filter    *f ));
378
379 /*
380  * lock.c
381  */
382
383 LIBSLAPD_F (FILE *) lock_fopen LDAP_P(( const char *fname, const char *type, FILE **lfp ));
384 LIBSLAPD_F (int) lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
385
386
387 /*
388  * modify.c
389  *      should be relocated to separate file
390  */
391 LIBSLAPD_F( void ) slap_mod_free LDAP_P(( Modification *mod, int freeit ));
392 LIBSLAPD_F( void ) slap_mods_free LDAP_P(( Modifications *mods ));
393 LIBSLAPD_F( void ) slap_modlist_free LDAP_P(( LDAPModList *ml ));
394
395 #ifdef SLAPD_SCHEMA_NOT_COMPAT
396 LIBSLAPD_F( int ) slap_modlist2mods(
397         LDAPModList *ml,
398         int update,
399         Modifications **mods,
400         char **text );
401
402 LIBSLAPD_F( int ) slap_mods_opattrs(
403         Operation *op,
404         Modifications **modlist,
405         char **text );
406 #endif
407
408 /*
409  * module.c
410  */
411
412 #ifdef SLAPD_MODULES
413
414 LIBSLAPD_F (int) module_init LDAP_P(( void ));
415 LIBSLAPD_F (int) module_kill LDAP_P(( void ));
416
417 LIBSLAPD_F (int) load_null_module(
418         const void *module, const char *file_name);
419 LIBSLAPD_F (int) load_extop_module(
420         const void *module, const char *file_name);
421
422 LIBSLAPD_F (int) module_load LDAP_P((
423         const char* file_name,
424         int argc, char *argv[] ));
425 LIBSLAPD_F (int) module_path LDAP_P(( const char* path ));
426
427 LIBSLAPD_F (void) *module_resolve LDAP_P((
428         const void *module, const char *name));
429
430 #endif /* SLAPD_MODULES */
431
432 /*
433  * monitor.c
434  */
435 LIBSLAPD_F (char *) supportedControls[];
436
437 LIBSLAPD_F (void) monitor_info LDAP_P((
438         Connection *conn,
439         Operation *op,
440         char ** attrs,
441         int attrsonly ));
442
443 /*
444  * operation.c
445  */
446
447 LIBSLAPD_F (void) slap_op_free LDAP_P(( Operation *op ));
448 LIBSLAPD_F (Operation *) slap_op_alloc LDAP_P((
449         BerElement *ber, ber_int_t msgid,
450         ber_tag_t tag, ber_int_t id ));
451
452 LIBSLAPD_F (int) slap_op_add LDAP_P(( Operation **olist, Operation *op ));
453 LIBSLAPD_F (int) slap_op_remove LDAP_P(( Operation **olist, Operation *op ));
454 LIBSLAPD_F (Operation *) slap_op_pop LDAP_P(( Operation **olist ));
455
456 /*
457  * phonetic.c
458  */
459
460 LIBSLAPD_F (char *) first_word LDAP_P(( char *s ));
461 LIBSLAPD_F (char *) next_word LDAP_P(( char *s ));
462 LIBSLAPD_F (char *) word_dup LDAP_P(( char *w ));
463 LIBSLAPD_F (char *) phonetic LDAP_P(( char *s ));
464
465 /*
466  * repl.c
467  */
468
469 LIBSLAPD_F (void) replog LDAP_P(( Backend *be, Operation *op, char *dn, void *change ));
470
471 /*
472  * result.c
473  */
474
475 LIBSLAPD_F (struct berval **) get_entry_referrals LDAP_P((
476         Backend *be, Connection *conn, Operation *op,
477         Entry *e ));
478
479 LIBSLAPD_F (void) send_ldap_result LDAP_P((
480         Connection *conn, Operation *op,
481         ber_int_t err, const char *matched, const char *text,
482         struct berval **refs,
483         LDAPControl **ctrls ));
484
485 LIBSLAPD_F (void) send_ldap_sasl LDAP_P((
486         Connection *conn, Operation *op,
487         ber_int_t err, const char *matched,
488         const char *text,
489         struct berval **refs,
490         LDAPControl **ctrls,
491         struct berval *cred ));
492
493 LIBSLAPD_F (void) send_ldap_disconnect LDAP_P((
494         Connection *conn, Operation *op,
495         ber_int_t err, const char *text ));
496
497 LIBSLAPD_F (void) send_ldap_extended LDAP_P((
498         Connection *conn, Operation *op,
499         ber_int_t err, const char *matched,
500         const char *text, struct berval **refs,
501         char *rspoid, struct berval *rspdata,
502         LDAPControl **ctrls ));
503
504 LIBSLAPD_F (void) send_ldap_partial LDAP_P((
505         Connection *conn, Operation *op,
506         char *rspoid, struct berval *rspdata,
507         LDAPControl **ctrls ));
508
509 LIBSLAPD_F (void) send_search_result LDAP_P((
510         Connection *conn, Operation *op,
511         ber_int_t err, const char *matched, const char *text,
512         struct berval **refs,
513         LDAPControl **ctrls,
514         int nentries ));
515
516 LIBSLAPD_F (int) send_search_reference LDAP_P((
517         Backend *be, Connection *conn, Operation *op,
518         Entry *e, struct berval **refs, int scope,
519         LDAPControl **ctrls,
520         struct berval ***v2refs ));
521
522 LIBSLAPD_F (int) send_search_entry LDAP_P((
523         Backend *be, Connection *conn, Operation *op,
524         Entry *e, char **attrs, int attrsonly,
525         LDAPControl **ctrls ));
526
527 LIBSLAPD_F (int) str2result LDAP_P(( char *s,
528         int *code, char **matched, char **info ));
529
530 /*
531  * sasl.c
532  */
533 LIBSLAPD_F (char **) supportedSASLMechanisms;
534
535 LIBSLAPD_F (int) sasl_init(void);
536 LIBSLAPD_F (int) sasl_destroy(void);
537 #ifdef HAVE_CYRUS_SASL
538 LIBSLAPD_F (int) sasl_errldap LDAP_P(( int ));
539 LIBSLAPD_F (int) sasl_bind LDAP_P((Backend *, 
540         Connection *, Operation *, 
541         char *, char *, char *, struct berval *, char **));
542 #endif
543
544 /* oc.c */
545 LIBSLAPD_F (int) oc_schema_info( Entry *e );
546
547 /* mr.c */
548 LIBSLAPD_F (int) mr_schema_info( Entry *e );
549
550 /* syntax.c */
551 LIBSLAPD_F (int) syn_schema_info( Entry *e );
552
553 /*
554  * schema.c
555  */
556
557 LIBSLAPD_F (int) oc_check_op_attr LDAP_P(( const char *type ));
558 LIBSLAPD_F (int) oc_check_op_usermod_attr LDAP_P(( const char *type ));
559 LIBSLAPD_F (int) oc_check_op_no_usermod_attr LDAP_P(( const char *type ));
560 LIBSLAPD_F (ObjectClass *) oc_find LDAP_P((const char *ocname));
561 LIBSLAPD_F (int) oc_add LDAP_P((LDAP_OBJECT_CLASS *oc, const char **err));
562
563 LIBSLAPD_F (Syntax *) syn_find LDAP_P((const char *synname));
564 LIBSLAPD_F (Syntax *) syn_find_desc LDAP_P((const char *syndesc, int *slen));
565 LIBSLAPD_F (int) syn_add LDAP_P((LDAP_SYNTAX *syn, int flags,
566         slap_syntax_validate_func *validate,
567         slap_syntax_transform_func *ber2str,
568         slap_syntax_transform_func *str2ber,
569         const char **err));
570
571 LIBSLAPD_F (MatchingRule *) mr_find LDAP_P((const char *mrname));
572 LIBSLAPD_F (int) mr_add LDAP_P((LDAP_MATCHING_RULE *mr,
573         unsigned usage,
574         slap_mr_convert_func *convert,
575         slap_mr_normalize_func *normalize,
576         slap_mr_match_func *match,
577         slap_mr_indexer_func *indexer,
578         slap_mr_filter_func *filter,
579         const char **err));
580
581 LIBSLAPD_F (int) register_syntax LDAP_P((char *desc, int flags,
582         slap_syntax_validate_func *validate,
583         slap_syntax_transform_func *ber2str,
584         slap_syntax_transform_func *str2ber ));
585
586 LIBSLAPD_F (int) register_matching_rule LDAP_P((char * desc,
587         unsigned usage,
588         slap_mr_convert_func *convert,
589         slap_mr_normalize_func *normalize,
590         slap_mr_match_func *match,
591         slap_mr_indexer_func *indexer,
592         slap_mr_filter_func *filter     ));
593
594 LIBSLAPD_F (void) schema_info LDAP_P((Connection *conn, Operation *op,
595         char **attrs, int attrsonly));
596
597 LIBSLAPD_F (int) is_entry_objectclass LDAP_P((
598         Entry *, const char* objectclass ));
599 #define is_entry_alias(e)               is_entry_objectclass((e), "ALIAS")
600 #define is_entry_referral(e)    is_entry_objectclass((e), "REFERRAL")
601
602 /*
603  * schema_check.c
604  */
605 LIBSLAPD_F (int) schema_check_entry LDAP_P(( Entry *e ));
606
607
608 /*
609  * schema_init.c
610  */
611 LIBSLAPD_F (int) schema_init LDAP_P((void));
612
613
614 /*
615  * schemaparse.c
616  */
617
618 LIBSLAPD_F (void) parse_oc_old LDAP_P(( Backend *be, const char *fname, int lineno, int argc, char **argv ));
619 LIBSLAPD_F (void) parse_oc LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
620 LIBSLAPD_F (void) parse_at LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
621 LIBSLAPD_F (void) parse_oidm LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
622 LIBSLAPD_F (char *) scherr2str LDAP_P((int code)) LDAP_GCCATTR((const));
623 LIBSLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del, char delim ));
624
625
626 /*
627  * starttls.c
628  */
629
630 LIBSLAPD_F (int) starttls_extop LDAP_P((
631         SLAP_EXTOP_CALLBACK_FN,
632         Connection *conn, Operation *op,
633         char * reqoid,
634         struct berval * reqdata,
635         char ** rspoid,
636         struct berval ** rspdata,
637         LDAPControl ***rspctrls,
638         char ** text,
639         struct berval *** refs ));
640
641
642 /*
643  * str2filter.c
644  */
645
646 LIBSLAPD_F (Filter *) str2filter LDAP_P(( const char *str ));
647
648 /*
649  * suffixalias.c
650  */
651 LIBSLAPD_F (char *) suffix_alias LDAP_P(( Backend *be, char *ndn ));
652
653 /*
654  * value.c
655  */
656
657 LIBSLAPD_F (int) value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals, int naddvals, int *maxvals ));
658 LIBSLAPD_F (int) value_add LDAP_P(( struct berval ***vals, struct berval **addvals ));
659 LIBSLAPD_F (void) value_normalize LDAP_P(( char *s, int syntax ));
660 LIBSLAPD_F (int) value_cmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax, int normalize ));
661 LIBSLAPD_F (int) value_find LDAP_P(( struct berval **vals, struct berval *v, int syntax, int normalize ));
662
663 /*
664  * user.c
665  */
666 #if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
667 LIBSLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname ));
668 #endif
669
670 /*
671  * passwd.c
672  */
673 LIBSLAPD_F (int) passwd_extop LDAP_P((
674         SLAP_EXTOP_CALLBACK_FN,
675         Connection *conn, Operation *op,
676         char * reqoid,
677         struct berval * reqdata,
678         char ** rspoid,
679         struct berval ** rspdata,
680         LDAPControl *** rspctrls,
681         char ** text,
682         struct berval *** refs ));
683
684 LIBSLAPD_F (int) slap_passwd_check(
685         Attribute                       *attr,
686         struct berval           *cred );
687
688 LIBSLAPD_F (struct berval *) slap_passwd_generate( void );
689
690 LIBSLAPD_F (struct berval *) slap_passwd_hash(
691         struct berval           *cred );
692
693 LIBSLAPD_F (struct berval *) slap_passwd_return(
694         struct berval           *cred );
695
696 LIBSLAPD_F (int) slap_passwd_parse(
697         struct berval *reqdata,
698         struct berval **id,
699         struct berval **old,
700         struct berval **new,
701         char **text );
702
703 /*
704  * kerberos.c
705  */
706 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
707 extern char             *ldap_srvtab;
708 LIBSLAPD_F (int)        krbv4_ldap_auth();
709 #endif
710
711 /*
712  * Other...
713  */
714
715 LIBSLAPD_F (struct berval **)   default_referral;
716 LIBSLAPD_F (char *)             replogfile;
717 LIBSLAPD_F (const char)         Versionstr[];
718 LIBSLAPD_F (int)                active_threads;
719 LIBSLAPD_F (int)                defsize;
720 LIBSLAPD_F (int)                deftime;
721 LIBSLAPD_F (int)                g_argc;
722 LIBSLAPD_F (slap_access_t)      global_default_access;
723 LIBSLAPD_F (int)                global_readonly;
724 LIBSLAPD_F (int)                global_lastmod;
725 LIBSLAPD_F (int)                global_idletimeout;
726 LIBSLAPD_F (int)                global_schemacheck;
727 LIBSLAPD_F (char)               *global_realm;
728 LIBSLAPD_F (char)               *default_passwd_hash;
729 LIBSLAPD_F (int)                lber_debug;
730 LIBSLAPD_F (int)                ldap_syslog;
731
732 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    num_sent_mutex;
733 LIBSLAPD_F (long)               num_bytes_sent;
734 LIBSLAPD_F (long)               num_pdu_sent;
735 LIBSLAPD_F (long)               num_entries_sent;
736 LIBSLAPD_F (long)               num_refs_sent;
737
738 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    num_ops_mutex;
739 LIBSLAPD_F (long)               num_ops_completed;
740 LIBSLAPD_F (long)               num_ops_initiated;
741
742 LIBSLAPD_F (char *)             slapd_pid_file;
743 LIBSLAPD_F (char *)             slapd_args_file;
744 LIBSLAPD_F (char)               **g_argv;
745 LIBSLAPD_F (time_t)             starttime;
746
747 LIBSLAPD_F (time_t) slap_get_time LDAP_P((void));
748
749 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    active_threads_mutex;
750 LIBSLAPD_F (ldap_pvt_thread_cond_t)     active_threads_cond;
751
752 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    entry2str_mutex;
753 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    replog_mutex;
754
755 #ifdef SLAPD_CRYPT
756 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    crypt_mutex;
757 #endif
758 LIBSLAPD_F (ldap_pvt_thread_mutex_t)    gmtime_mutex;
759
760 LIBSLAPD_F (AccessControl *) global_acl;
761
762 LIBSLAPD_F (int)        slap_init LDAP_P((int mode, char* name));
763 LIBSLAPD_F (int)        slap_startup LDAP_P(( Backend *be ));
764 LIBSLAPD_F (int)        slap_shutdown LDAP_P(( Backend *be ));
765 LIBSLAPD_F (int)        slap_destroy LDAP_P((void));
766
767 struct sockaddr_in;
768
769 LIBSLAPD_F (int) slapd_daemon_init( char *urls );
770 LIBSLAPD_F (int) slapd_daemon_destroy(void);
771 LIBSLAPD_F (int) slapd_daemon(void);
772
773 LIBSLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
774 LIBSLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
775 LIBSLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));
776 LIBSLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
777
778 LIBSLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, int wake));
779
780 LIBSLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
781 LIBSLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
782
783 LIBSLAPD_F (void) config_info LDAP_P((
784         Connection *conn,
785         Operation *op,
786         char ** attrs,
787         int attrsonly ));
788
789 LIBSLAPD_F (void) root_dse_info LDAP_P((
790         Connection *conn,
791         Operation *op,
792         char ** attrs,
793         int attrsonly ));
794
795 LIBSLAPD_F (int) do_abandon LDAP_P((Connection *conn, Operation *op));
796 LIBSLAPD_F (int) do_add LDAP_P((Connection *conn, Operation *op));
797 LIBSLAPD_F (int) do_bind LDAP_P((Connection *conn, Operation *op));
798 LIBSLAPD_F (int) do_compare LDAP_P((Connection *conn, Operation *op));
799 LIBSLAPD_F (int) do_delete LDAP_P((Connection *conn, Operation *op));
800 LIBSLAPD_F (int) do_modify LDAP_P((Connection *conn, Operation *op));
801 LIBSLAPD_F (int) do_modrdn LDAP_P((Connection *conn, Operation *op));
802 LIBSLAPD_F (int) do_search LDAP_P((Connection *conn, Operation *op));
803 LIBSLAPD_F (int) do_unbind LDAP_P((Connection *conn, Operation *op));
804 LIBSLAPD_F (int) do_extended LDAP_P((Connection *conn, Operation *op));
805
806
807 LIBSLAPD_F (ber_socket_t) dtblsize;
808
809 LDAP_END_DECL
810
811 #endif /* _proto_slap */
812