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