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