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