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