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