]> git.sur5r.net Git - openldap/blob - servers/slapd/proto-slap.h
Add prototype for at_add().
[openldap] / servers / slapd / proto-slap.h
1 #ifndef _PROTO_SLAP
2 #define _PROTO_SLAP
3
4 #include <ldap_cdefs.h>
5
6 /*
7  * acl.c
8  */
9
10 int access_allowed LDAP_P(( Backend *be, Connection *conn,
11         Operation *op, Entry *e,
12         char *attr, struct berval *val, int access ));
13
14 struct acl * acl_get_applicable LDAP_P(( Backend *be,
15         Operation *op, Entry *e,
16         char *attr, int nmatches, regmatch_t *matches ));
17
18 int acl_access_allowed LDAP_P(( struct acl *a, Backend *be, Connection *conn, Entry *e,
19         struct berval *val, Operation *op, int  access, char *edn,
20         regmatch_t *matches ));
21
22 int acl_check_modlist LDAP_P(( Backend *be,
23         Connection *conn,
24         Operation *op,
25         Entry *e,
26         LDAPModList *ml ));
27
28 /*
29  * aclparse.c
30  */
31
32 void parse_acl LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
33 char * access2str LDAP_P(( int access ));
34 int str2access LDAP_P(( char *str ));
35
36 /*
37  * attr.c
38  */
39
40 void attr_free LDAP_P(( Attribute *a ));
41 char * attr_normalize LDAP_P(( char *s ));
42 int attr_merge_fast LDAP_P(( Entry *e, char *type, struct berval **vals, int  nvals,
43         int  naddvals, int  *maxvals, Attribute ***a ));
44 int attr_merge LDAP_P(( Entry *e, char *type, struct berval **vals ));
45 Attribute * attr_find LDAP_P(( Attribute *a, char *type ));
46 int attr_delete LDAP_P(( Attribute **attrs, char *type ));
47 int attr_syntax LDAP_P(( char *type ));
48 void attr_syntax_config LDAP_P(( char *fname, int lineno, int argc, char **argv ));
49 AttributeType * at_find LDAP_P(( char *name ));
50 int at_find_in_list LDAP_P(( AttributeType *sat, AttributeType **list ));
51 int at_append_to_list LDAP_P(( AttributeType *sat, AttributeType ***listp ));
52 int at_delete_from_list LDAP_P(( int pos, AttributeType ***listp ));
53 int at_fake_if_needed LDAP_P(( char *name ));
54 int at_schema_info LDAP_P(( Entry *e ));
55 int at_add LDAP_P(( LDAP_ATTRIBUTE_TYPE *at, char **err ));
56
57 /*
58  * ava.c
59  */
60
61 int get_ava LDAP_P(( BerElement *ber, Ava *ava ));
62 void ava_free LDAP_P(( Ava *ava, int freeit ));
63
64 /*
65  * backend.c
66  */
67
68 int backend_init LDAP_P((void));
69 int backend_startup LDAP_P((int dbnum));
70 int backend_shutdown LDAP_P((int dbnum));
71 int backend_destroy LDAP_P((void));
72
73 BackendInfo * backend_info LDAP_P(( char *type ));
74 BackendDB * backend_db_init LDAP_P(( char *type ));
75
76 BackendDB * select_backend LDAP_P(( char * dn ));
77
78 int be_issuffix LDAP_P(( Backend *be, char *suffix ));
79 int be_isroot LDAP_P(( Backend *be, char *ndn ));
80 int be_isroot_pw LDAP_P(( Backend *be, char *ndn, struct berval *cred ));
81 char* be_root_dn LDAP_P(( Backend *be ));
82 int be_entry_release_rw LDAP_P(( Backend *be, Entry *e, int rw ));
83 #define be_entry_release_r( be, e ) be_entry_release_rw( be, e, 0 )
84 #define be_entry_release_w( be, e ) be_entry_release_rw( be, e, 1 )
85
86
87 extern int      backend_unbind LDAP_P((Connection *conn, Operation *op));
88
89 extern int      backend_group LDAP_P((Backend *be,
90         Entry *target,
91         char *gr_ndn, char *op_ndn,
92         char *objectclassValue, char *groupattrName));
93
94 /*
95  * ch_malloc.c
96  */
97
98 void * ch_malloc LDAP_P(( unsigned long size ));
99 void * ch_realloc LDAP_P(( void *block, unsigned long size ));
100 void * ch_calloc LDAP_P(( unsigned long nelem, unsigned long size ));
101 char * ch_strdup LDAP_P(( const char *string ));
102
103 /*
104  * charray.c
105  */
106
107 void charray_add LDAP_P(( char ***a, char *s ));
108 void charray_merge LDAP_P(( char ***a, char **s ));
109 void charray_free LDAP_P(( char **array ));
110 int charray_inlist LDAP_P(( char **a, char *s ));
111 char ** charray_dup LDAP_P(( char **a ));
112 char ** str2charray LDAP_P(( char *str, char *brkstr ));
113
114 /*
115  * config.c
116  */
117
118 int read_config LDAP_P(( char *fname ));
119
120 /*
121  * connection.c
122  */
123 int connections_init LDAP_P((void));
124 int connections_shutdown LDAP_P((void));
125 int connections_destroy LDAP_P((void));
126
127 long connection_init LDAP_P((
128         int s,
129         const char* name, const char* addr));
130
131 void connection_closing LDAP_P(( Connection *c ));
132 int connection_state_closing LDAP_P(( Connection *c ));
133
134 int connection_write LDAP_P((int s));
135 int connection_read LDAP_P((int s));
136
137 long connections_nextid(void);
138
139 Connection* connection_first LDAP_P((int *));
140 Connection* connection_next LDAP_P((Connection *, int *));
141 void connection_done LDAP_P((Connection *));
142
143 /*
144  * dn.c
145  */
146
147 char * dn_normalize LDAP_P(( char *dn ));
148 char * dn_normalize_case LDAP_P(( char *dn ));
149 char * dn_parent LDAP_P(( Backend *be, char *dn ));
150 char * dn_rdn LDAP_P(( Backend *be, char *dn ));
151 int dn_issuffix LDAP_P(( char *dn, char *suffix ));
152 int dn_type LDAP_P(( char *dn ));
153 char * dn_upcase LDAP_P(( char *dn ));
154 char * rdn_attr_value LDAP_P(( char * rdn ));
155 char * rdn_attr_type LDAP_P(( char * rdn ));
156 void build_new_dn LDAP_P(( char ** new_dn, char *e_dn, char * p_dn,
157                            char * newrdn ));
158 /*
159  * entry.c
160  */
161
162 Entry * str2entry LDAP_P(( char *s ));
163 char * entry2str LDAP_P(( Entry *e, int *len, int printid ));
164 void entry_free LDAP_P(( Entry *e ));
165
166 int entry_cmp LDAP_P(( Entry *a, Entry *b ));
167 int entry_dn_cmp LDAP_P(( Entry *a, Entry *b ));
168 int entry_id_cmp LDAP_P(( Entry *a, Entry *b ));
169
170 /*
171  * filter.c
172  */
173
174 int get_filter LDAP_P(( Connection *conn, BerElement *ber, Filter **filt, char **fstr ));
175 void filter_free LDAP_P(( Filter *f ));
176 void filter_print LDAP_P(( Filter *f ));
177
178 /*
179  * filterentry.c
180  */
181
182 int test_filter LDAP_P(( Backend *be, Connection *conn, Operation *op, Entry *e,
183         Filter  *f ));
184
185 /*
186  * lock.c
187  */
188
189 FILE * lock_fopen LDAP_P(( char *fname, char *type, FILE **lfp ));
190 int lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
191
192 /*
193  * monitor.c
194  */
195
196 void monitor_info LDAP_P(( Connection *conn, Operation *op ));
197
198 /*
199  * operation.c
200  */
201
202 void slap_op_free LDAP_P(( Operation *op ));
203 Operation * slap_op_alloc LDAP_P((
204         BerElement *ber, unsigned long msgid,
205         unsigned long tag, long id ));
206
207 int slap_op_add LDAP_P(( Operation **olist, Operation *op ));
208 int slap_op_remove LDAP_P(( Operation **olist, Operation *op ));
209 Operation * slap_op_pop LDAP_P(( Operation **olist ));
210
211 /*
212  * phonetic.c
213  */
214
215 char * first_word LDAP_P(( char *s ));
216 char * next_word LDAP_P(( char *s ));
217 char * word_dup LDAP_P(( char *w ));
218 char * phonetic LDAP_P(( char *s ));
219
220 /*
221  * repl.c
222  */
223
224 void replog LDAP_P(( Backend *be, int optype, char *dn, void *change, int flag ));
225
226 /*
227  * result.c
228  */
229
230 void send_ldap_result LDAP_P(( Connection *conn, Operation *op, int err, char *matched,
231         char *text ));
232 void send_ldap_search_result LDAP_P(( Connection *conn, Operation *op, int err,
233         char *matched, char *text, int nentries ));
234
235 /*
236  * schema.c
237  */
238
239 int oc_schema_check LDAP_P(( Entry *e ));
240 ObjectClass *oc_find LDAP_P((char *ocname));
241 int oc_add LDAP_P((LDAP_OBJECT_CLASS *oc, char **err));
242 void schema_info LDAP_P((Connection *conn, Operation *op, char **attrs, int attrsonly));
243
244
245 /*
246  * schemaparse.c
247  */
248
249 void parse_oc_old LDAP_P(( Backend *be, char *fname, int lineno, int argc, char **argv ));
250 void parse_oc LDAP_P(( char *fname, int lineno, char * line ));
251 void parse_at LDAP_P(( char *fname, int lineno, char *line ));
252
253 /*
254  * str2filter.c
255  */
256
257 Filter * str2filter LDAP_P(( char *str ));
258
259 /*
260  * value.c
261  */
262
263 int value_add_fast LDAP_P(( struct berval ***vals, struct berval **addvals, int nvals,
264         int naddvals, int *maxvals ));
265 int value_add LDAP_P(( struct berval ***vals, struct berval **addvals ));
266 void value_normalize LDAP_P(( char *s, int syntax ));
267 int value_cmp LDAP_P(( struct berval *v1, struct berval *v2, int syntax,
268         int normalize ));
269 int value_find LDAP_P(( struct berval **vals, struct berval *v, int syntax,
270         int normalize ));
271
272 /*
273  * suffixAlias.c
274  */
275 char *suffixAlias LDAP_P(( char *dn, Operation *op, Backend *be ));
276
277 /*
278  * user.c
279  */
280 #if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
281 void slap_init_user LDAP_P(( char *username, char *groupname ));
282 #endif
283
284 /*
285  * Other...
286  */
287
288 extern char             *default_referral;
289 extern char             *replogfile;
290 extern const char Versionstr[];
291 extern int              active_threads;
292 extern int              defsize;
293 extern int              deftime;
294 extern int              g_argc;
295 extern int              global_default_access;
296 extern int              global_lastmod;
297 extern int              global_schemacheck;
298 extern int              lber_debug;
299 extern int              ldap_syslog;
300
301 extern ldap_pvt_thread_mutex_t  num_sent_mutex;
302 extern long             num_bytes_sent;
303 extern long             num_entries_sent;
304
305 extern ldap_pvt_thread_mutex_t  num_ops_mutex;
306 extern long             num_ops_completed;
307 extern long             num_ops_initiated;
308
309 extern char   *slapd_pid_file;
310 extern char   *slapd_args_file;
311 extern char             **g_argv;
312 extern time_t   starttime;
313
314 time_t slap_get_time LDAP_P((void));
315
316 extern ldap_pvt_thread_mutex_t  active_threads_mutex;
317 extern ldap_pvt_thread_cond_t   active_threads_cond;
318
319 extern ldap_pvt_thread_mutex_t  entry2str_mutex;
320 extern ldap_pvt_thread_mutex_t  replog_mutex;
321
322 #ifdef SLAPD_CRYPT
323 extern ldap_pvt_thread_mutex_t  crypt_mutex;
324 #endif
325 extern ldap_pvt_thread_mutex_t  gmtime_mutex;
326
327 extern struct acl               *global_acl;
328
329 extern int      slap_init LDAP_P((int mode, char* name));
330 extern int      slap_startup LDAP_P((int dbnum));
331 extern int      slap_shutdown LDAP_P((int dbnum));
332 extern int      slap_destroy LDAP_P((void));
333
334 struct sockaddr_in;
335 extern int      set_socket LDAP_P((struct sockaddr_in *addr));
336 extern int      slapd_daemon LDAP_P((int inetd, int tcps));
337
338 extern void slapd_set_write LDAP_P((int s, int wake));
339 extern void slapd_clr_write LDAP_P((int s, int wake));
340 extern void slapd_set_read LDAP_P((int s, int wake));
341 extern void slapd_clr_read LDAP_P((int s, int wake));
342
343 extern void     slap_set_shutdown LDAP_P((int sig));
344 extern void     slap_do_nothing   LDAP_P((int sig));
345
346 extern void     config_info LDAP_P((Connection *conn, Operation *op));
347 extern void     root_dse_info LDAP_P((Connection *conn, Operation *op, char **attrs, int attrsonly));
348 extern void     do_abandon LDAP_P((Connection *conn, Operation *op));
349 extern void     do_add LDAP_P((Connection *conn, Operation *op));
350 extern void     do_bind LDAP_P((Connection *conn, Operation *op));
351 extern void     do_compare LDAP_P((Connection *conn, Operation *op));
352 extern void     do_delete LDAP_P((Connection *conn, Operation *op));
353 extern void     do_modify LDAP_P((Connection *conn, Operation *op));
354 extern void     do_modrdn LDAP_P((Connection *conn, Operation *op));
355 extern void     do_search LDAP_P((Connection *conn, Operation *op));
356 extern void     do_unbind LDAP_P((Connection *conn, Operation *op));
357
358 extern int send_search_entry LDAP_P((Backend *be, Connection *conn, Operation *op, Entry *e, char **attrs, int attrsonly));
359 extern int str2result LDAP_P(( char *s, int *code, char **matched, char **info ));
360
361 extern int dtblsize;
362
363 #endif /* _proto_slap */
364