3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
9 #include <ldap_cdefs.h>
17 int access_allowed LDAP_P(( Backend *be, Connection *conn,
18 Operation *op, Entry *e,
19 char *attr, struct berval *val, slap_access_t access ));
21 int acl_check_modlist LDAP_P(( Backend *be,
27 void acl_append( AccessControl **l, AccessControl *a );
33 void parse_acl LDAP_P(( Backend *be,
36 int argc, char **argv ));
38 char * access2str LDAP_P(( slap_access_t access ));
39 slap_access_t str2access LDAP_P(( const char *str ));
41 char * accessmask2str LDAP_P(( slap_access_mask_t mask ));
42 slap_access_mask_t str2accessmask LDAP_P(( const char *str ));
48 void attr_free LDAP_P(( Attribute *a ));
49 Attribute *attr_dup LDAP_P(( Attribute *a ));
50 char * attr_normalize LDAP_P(( char *s ));
51 int attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int nvals,
52 int naddvals, int *maxvals, Attribute ***a ));
53 int attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals ));
54 Attribute * attr_find LDAP_P(( Attribute *a, const char *type ));
55 int attr_delete LDAP_P(( Attribute **attrs, const char *type ));
56 int attr_syntax LDAP_P(( char *type ));
57 void attr_syntax_config LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
58 AttributeType * at_find LDAP_P(( const char *name ));
59 int at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list ));
60 int at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp ));
61 int at_delete_from_list LDAP_P(( int pos, AttributeType ***listp ));
62 int at_fake_if_needed LDAP_P(( char *name ));
63 int at_schema_info LDAP_P(( Entry *e ));
64 int at_add LDAP_P(( LDAP_ATTRIBUTE_TYPE *at, const char **err ));
65 char * at_canonical_name LDAP_P(( char * a_type ));
67 void attrs_free LDAP_P(( Attribute *a ));
68 Attribute *attrs_dup LDAP_P(( Attribute *a ));
74 int get_ava LDAP_P(( BerElement *ber, Ava *ava ));
75 void ava_free LDAP_P(( Ava *ava, int freeit ));
81 int backend_init LDAP_P((void));
82 int backend_add LDAP_P((BackendInfo *aBackendInfo));
83 int backend_num LDAP_P((Backend *be));
84 int backend_startup LDAP_P((Backend *be));
85 int backend_shutdown LDAP_P((Backend *be));
86 int backend_destroy LDAP_P((void));
88 BackendInfo * backend_info LDAP_P(( const char *type ));
89 BackendDB * backend_db_init LDAP_P(( const char *type ));
91 BackendDB * select_backend LDAP_P(( const char * dn ));
93 int be_issuffix LDAP_P(( Backend *be, const char *suffix ));
94 int be_isroot LDAP_P(( Backend *be, const char *ndn ));
95 int be_isroot_pw LDAP_P(( Backend *be, const char *ndn, struct berval *cred ));
96 char* be_root_dn LDAP_P(( Backend *be ));
97 int be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
98 #define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 )
99 #define be_entry_release_w( be, e ) be_entry_release_rw( be, e, 1 )
102 extern int backend_unbind LDAP_P((Connection *conn, Operation *op));
104 extern int backend_connection_init LDAP_P((Connection *conn));
105 extern int backend_connection_destroy LDAP_P((Connection *conn));
107 extern int backend_group LDAP_P((Backend *be,
111 const char *objectclassValue,
112 const char *groupattrName));
114 #ifdef SLAPD_SCHEMA_DN
115 /* temporary extern for temporary routine*/
116 extern Attribute *backend_subschemasubentry( Backend * );
125 #define ch_malloc malloc
126 #define ch_realloc realloc
127 #define ch_calloc calloc
128 #define ch_strdup strdup
132 void * ch_malloc LDAP_P(( ber_len_t size ));
133 void * ch_realloc LDAP_P(( void *block, ber_len_t size ));
134 void * ch_calloc LDAP_P(( ber_len_t nelem, ber_len_t size ));
135 char * ch_strdup LDAP_P(( const char *string ));
136 void ch_free LDAP_P(( void * ));
148 void charray_add LDAP_P(( char ***a, const char *s ));
149 void charray_merge LDAP_P(( char ***a, char **s ));
150 void charray_free LDAP_P(( char **array ));
151 int charray_inlist LDAP_P(( char **a, const char *s ));
152 char ** charray_dup LDAP_P(( char **a ));
153 char ** str2charray LDAP_P(( const char *str, const char *brkstr ));
154 char * charray2str LDAP_P(( char **a ));
159 int get_ctrls LDAP_P((
164 int get_manageDSAit LDAP_P(( Operation *op ));
170 int read_config LDAP_P(( const char *fname ));
175 int connections_init LDAP_P((void));
176 int connections_shutdown LDAP_P((void));
177 int connections_destroy LDAP_P((void));
178 int connections_timeout_idle LDAP_P((time_t));
180 long connection_init LDAP_P((
184 const char* peername,
185 const char* sockname,
188 void connection_closing LDAP_P(( Connection *c ));
189 int connection_state_closing LDAP_P(( Connection *c ));
190 const char *connection_state2str LDAP_P(( int state )) LDAP_GCCATTR((const));
192 int connection_write LDAP_P((ber_socket_t s));
193 int connection_read LDAP_P((ber_socket_t s));
195 unsigned long connections_nextid(void);
197 Connection* connection_first LDAP_P((ber_socket_t *));
198 Connection* connection_next LDAP_P((Connection *, ber_socket_t *));
199 void connection_done LDAP_P((Connection *));
205 char * dn_validate LDAP_P(( char *dn ));
206 char * dn_normalize LDAP_P(( char *dn ));
207 char * dn_parent LDAP_P(( Backend *be, const char *dn ));
208 char ** dn_subtree LDAP_P(( Backend *be, const char *dn ));
209 char * dn_rdn LDAP_P(( Backend *be, char *dn ));
210 int dn_issuffix LDAP_P(( char *dn, char *suffix ));
212 int dn_type LDAP_P(( char *dn ));
214 int rdn_validate LDAP_P(( const char* str ));
215 char * rdn_attr_value LDAP_P(( char * rdn ));
216 char * rdn_attr_type LDAP_P(( char * rdn ));
218 void build_new_dn LDAP_P(( char ** new_dn,
221 const char * newrdn ));
226 int entry_destroy LDAP_P((void));
228 Entry * str2entry LDAP_P(( char *s ));
229 char * entry2str LDAP_P(( Entry *e, int *len ));
230 void entry_free LDAP_P(( Entry *e ));
232 int entry_cmp LDAP_P(( Entry *a, Entry *b ));
233 int entry_dn_cmp LDAP_P(( Entry *a, Entry *b ));
234 int entry_id_cmp LDAP_P(( Entry *a, Entry *b ));
240 int get_filter LDAP_P(( Connection *conn, BerElement *ber, Filter **filt, char **fstr ));
241 void filter_free LDAP_P(( Filter *f ));
242 void filter_print LDAP_P(( Filter *f ));
248 int test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e,
255 FILE * lock_fopen LDAP_P(( const char *fname, const char *type, FILE **lfp ));
256 int lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
263 int module_load LDAP_P(( const char* file_name, int argc, char *argv[] ));
264 int module_path LDAP_P(( const char* path ));
265 #endif /* SLAPD_MODULES */
270 extern char *supportedExtensions[];
271 extern char *supportedControls[];
273 void monitor_info LDAP_P((
283 void slap_op_free LDAP_P(( Operation *op ));
284 Operation * slap_op_alloc LDAP_P((
285 BerElement *ber, ber_int_t msgid,
286 ber_tag_t tag, ber_int_t id ));
288 int slap_op_add LDAP_P(( Operation **olist, Operation *op ));
289 int slap_op_remove LDAP_P(( Operation **olist, Operation *op ));
290 Operation * slap_op_pop LDAP_P(( Operation **olist ));
296 char * first_word LDAP_P(( char *s ));
297 char * next_word LDAP_P(( char *s ));
298 char * word_dup LDAP_P(( char *w ));
299 char * phonetic LDAP_P(( char *s ));
305 void replog LDAP_P(( Backend *be, Operation *op, char *dn, void *change ));
311 struct berval **get_entry_referrals LDAP_P((
312 Backend *be, Connection *conn, Operation *op,
315 void send_ldap_result LDAP_P((
316 Connection *conn, Operation *op,
317 int err, const char *matched, const char *text,
318 struct berval **refs,
319 LDAPControl **ctrls ));
321 void send_ldap_disconnect LDAP_P((
322 Connection *conn, Operation *op,
323 int err, const char *text ));
325 void send_search_result LDAP_P((
326 Connection *conn, Operation *op,
327 int err, const char *matched, const char *text,
328 struct berval **refs,
332 int send_search_reference LDAP_P((
333 Backend *be, Connection *conn, Operation *op,
334 Entry *e, struct berval **refs, int scope,
336 struct berval ***v2refs ));
338 int send_search_entry LDAP_P((
339 Backend *be, Connection *conn, Operation *op,
340 Entry *e, char **attrs, int attrsonly,
341 LDAPControl **ctrls ));
343 int str2result LDAP_P(( char *s,
344 int *code, char **matched, char **info ));
349 extern char **supportedSASLMechanisms;
352 int sasl_destroy(void);
358 int oc_schema_check LDAP_P(( Entry *e ));
359 int oc_check_operational_attr LDAP_P(( const char *type ));
360 int oc_check_usermod_attr LDAP_P(( const char *type ));
361 int oc_check_no_usermod_attr LDAP_P(( const char *type ));
362 ObjectClass *oc_find LDAP_P((const char *ocname));
363 int oc_add LDAP_P((LDAP_OBJECT_CLASS *oc, const char **err));
364 Syntax *syn_find LDAP_P((const char *synname));
365 Syntax *syn_find_desc LDAP_P((const char *syndesc, int *slen));
366 int syn_add LDAP_P((LDAP_SYNTAX *syn, slap_syntax_check_func *check, const char **err));
367 MatchingRule *mr_find LDAP_P((const char *mrname));
368 int mr_add LDAP_P((LDAP_MATCHING_RULE *mr, slap_mr_normalize_func *normalize, slap_mr_compare_func *compare, const char **err));
369 int case_ignore_normalize LDAP_P((struct berval *val, struct berval **normalized));
370 int register_syntax LDAP_P((char *desc, slap_syntax_check_func *check ));
371 int register_matching_rule LDAP_P((char * desc, slap_mr_normalize_func *normalize, slap_mr_compare_func *compare));
372 void schema_info LDAP_P((Connection *conn, Operation *op, char **attrs, int attrsonly));
373 int schema_init LDAP_P((void));
375 int is_entry_objectclass LDAP_P(( Entry *, const char* objectclass ));
376 #define is_entry_alias(e) is_entry_objectclass((e), "ALIAS")
377 #define is_entry_referral(e) is_entry_objectclass((e), "REFERRAL")
384 void parse_oc_old LDAP_P(( Backend *be, const char *fname, int lineno, int argc, char **argv ));
385 void parse_oc LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
386 void parse_at LDAP_P(( const char *fname, int lineno, char *line, char **argv ));
387 void parse_oidm LDAP_P(( const char *fname, int lineno, int argc, char **argv ));
388 char *scherr2str LDAP_P((int code)) LDAP_GCCATTR((const));
389 int dscompare LDAP_P(( const char *s1, const char *s2del, char delim ));
394 Filter * str2filter LDAP_P(( char *str ));
399 char *suffix_alias LDAP_P(( Backend *be, char *ndn ));
405 int value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals,
406 int naddvals, int *maxvals ));
407 int value_add LDAP_P(( struct berval ***vals, struct berval **addvals ));
408 void value_normalize LDAP_P(( char *s, int syntax ));
409 int value_cmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax,
411 int value_find LDAP_P(( struct berval **vals, struct berval *v, int syntax,
417 #if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
418 void slap_init_user LDAP_P(( char *username, char *groupname ));
425 extern struct berval **default_referral;
426 extern char *replogfile;
427 extern const char Versionstr[];
428 extern int active_threads;
432 extern slap_access_t global_default_access;
433 extern int global_readonly;
434 extern int global_lastmod;
435 extern int global_idletimeout;
436 extern int global_schemacheck;
437 extern char *global_realm;
438 extern int lber_debug;
439 extern int ldap_syslog;
441 extern ldap_pvt_thread_mutex_t num_sent_mutex;
442 extern long num_bytes_sent;
443 extern long num_pdu_sent;
444 extern long num_entries_sent;
445 extern long num_refs_sent;
447 extern ldap_pvt_thread_mutex_t num_ops_mutex;
448 extern long num_ops_completed;
449 extern long num_ops_initiated;
451 extern char *slapd_pid_file;
452 extern char *slapd_args_file;
453 extern char **g_argv;
454 extern time_t starttime;
456 time_t slap_get_time LDAP_P((void));
458 extern ldap_pvt_thread_mutex_t active_threads_mutex;
459 extern ldap_pvt_thread_cond_t active_threads_cond;
461 extern ldap_pvt_thread_mutex_t entry2str_mutex;
462 extern ldap_pvt_thread_mutex_t replog_mutex;
465 extern ldap_pvt_thread_mutex_t crypt_mutex;
467 extern ldap_pvt_thread_mutex_t gmtime_mutex;
469 extern AccessControl *global_acl;
471 int slap_init LDAP_P((int mode, char* name));
472 int slap_startup LDAP_P(( Backend *be ));
473 int slap_shutdown LDAP_P(( Backend *be ));
474 int slap_destroy LDAP_P((void));
478 extern int slapd_daemon_init( char *urls, int port, int tls_port );
479 extern int slapd_daemon_destroy(void);
480 extern int slapd_daemon(void);
482 extern void slapd_set_write LDAP_P((ber_socket_t s, int wake));
483 extern void slapd_clr_write LDAP_P((ber_socket_t s, int wake));
484 extern void slapd_set_read LDAP_P((ber_socket_t s, int wake));
485 extern void slapd_clr_read LDAP_P((ber_socket_t s, int wake));
487 extern void slapd_remove LDAP_P((ber_socket_t s, int wake));
489 extern RETSIGTYPE slap_sig_shutdown LDAP_P((int sig));
490 extern RETSIGTYPE slap_sig_wake LDAP_P((int sig));
492 extern void config_info LDAP_P((
498 extern void root_dse_info LDAP_P((
504 extern int do_abandon LDAP_P((Connection *conn, Operation *op));
505 extern int do_add LDAP_P((Connection *conn, Operation *op));
506 extern int do_bind LDAP_P((Connection *conn, Operation *op));
507 extern int do_compare LDAP_P((Connection *conn, Operation *op));
508 extern int do_delete LDAP_P((Connection *conn, Operation *op));
509 extern int do_modify LDAP_P((Connection *conn, Operation *op));
510 extern int do_modrdn LDAP_P((Connection *conn, Operation *op));
511 extern int do_search LDAP_P((Connection *conn, Operation *op));
512 extern int do_unbind LDAP_P((Connection *conn, Operation *op));
513 extern int do_extended LDAP_P((Connection *conn, Operation *op));
516 extern ber_socket_t dtblsize;
520 #endif /* _proto_slap */