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