proto-slap.h 62.4 KB
Newer Older
1
/* $OpenLDAP$ */
Kurt Zeilenga's avatar
Kurt Zeilenga committed
2
3
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
 *
Kurt Zeilenga's avatar
Kurt Zeilenga committed
4
 * Copyright 1998-2007 The OpenLDAP Foundation.
Kurt Zeilenga's avatar
Kurt Zeilenga committed
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted only as authorized by the OpenLDAP
 * Public License.
 *
 * A copy of this license is available in the file LICENSE in the
 * top-level directory of the distribution or, alternatively, at
 * <http://www.OpenLDAP.org/license.html>.
 */
/* Portions Copyright (c) 1995 Regents of the University of Michigan.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that this notice is preserved and that due credit is given
 * to the University of Michigan at Ann Arbor. The name of the University
 * may not be used to endorse or promote products derived from this
 * software without specific prior written permission. This software
 * is provided ``as is'' without express or implied warranty.
24
 */
Kurt Zeilenga's avatar
Kurt Zeilenga committed
25

Kurt Zeilenga's avatar
Kurt Zeilenga committed
26
27
#ifndef PROTO_SLAP_H
#define PROTO_SLAP_H
Kurt Zeilenga's avatar
Kurt Zeilenga committed
28

Kurt Zeilenga's avatar
Kurt Zeilenga committed
29
#include <ldap_cdefs.h>
30
#include "ldap_pvt.h"
Kurt Zeilenga's avatar
Kurt Zeilenga committed
31

32
33
LDAP_BEGIN_DECL

34
struct config_args_s;	/* config.h */
35
struct config_reply_s;	/* config.h */
36

37
38
39
40
/*
 * aci.c
 */
#ifdef SLAP_DYNACL
41
#ifdef SLAPD_ACI_ENABLED
42
43
LDAP_SLAPD_F (int) dynacl_aci_init LDAP_P(( void ));
#endif /* SLAPD_ACI_ENABLED */
44
#endif /* SLAP_DYNACL */
45

Kurt Zeilenga's avatar
Kurt Zeilenga committed
46
47
48
/*
 * acl.c
 */
Pierangelo Masarati's avatar
Pierangelo Masarati committed
49
LDAP_SLAPD_F (int) access_allowed_mask LDAP_P((
50
	Operation *op,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
51
	Entry *e, AttributeDescription *desc, struct berval *val,
52
	slap_access_t access,
Pierangelo Masarati's avatar
Pierangelo Masarati committed
53
54
55
	AccessControlState *state,
	slap_mask_t *mask ));
#define access_allowed(op,e,desc,val,access,state) access_allowed_mask(op,e,desc,val,access,state,NULL)
Pierangelo Masarati's avatar
Pierangelo Masarati committed
56
57
58
59
60
61
62
63
LDAP_SLAPD_F (int) slap_access_allowed LDAP_P((
	Operation		*op,
	Entry			*e,
	AttributeDescription	*desc,
	struct berval		*val,
	slap_access_t		access,
	AccessControlState	*state,
	slap_mask_t		*maskp ));
64
65
66
67
68
69
70
71
72
LDAP_SLAPD_F (int) slap_access_always_allowed LDAP_P((
	Operation		*op,
	Entry			*e,
	AttributeDescription	*desc,
	struct berval		*val,
	slap_access_t		access,
	AccessControlState	*state,
	slap_mask_t		*maskp ));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
73
LDAP_SLAPD_F (int) acl_check_modlist LDAP_P((
74
	Operation *op, Entry *e, Modifications *ml ));
75

76
LDAP_SLAPD_F (void) acl_append( AccessControl **l, AccessControl *a, int pos );
Kurt Zeilenga's avatar
Kurt Zeilenga committed
77

Pierangelo Masarati's avatar
Pierangelo Masarati committed
78
79
80
81
82
83
#ifdef SLAP_DYNACL
LDAP_SLAPD_F (int) slap_dynacl_register LDAP_P(( slap_dynacl_t *da ));
LDAP_SLAPD_F (slap_dynacl_t *) slap_dynacl_get LDAP_P(( const char *name ));
#endif /* SLAP_DYNACL */
LDAP_SLAPD_F (int) acl_init LDAP_P(( void ));

84
85
86
87
88
89
90
91
92
LDAP_SLAPD_F (int) acl_get_part LDAP_P((
	struct berval	*list,
	int		ix,
	char		sep,
	struct berval	*bv ));
LDAP_SLAPD_F (int) acl_match_set LDAP_P((
	struct berval *subj,
	Operation *op,
	Entry *e,
93
	struct berval *default_set_attribute ));
94
95
96
97
LDAP_SLAPD_F (int) acl_string_expand LDAP_P((
	struct berval *newbuf, struct berval *pattern,
	char *match, int nmatch, regmatch_t *matches ));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
98
99
100
/*
 * aclparse.c
 */
101
102
LDAP_SLAPD_V (char *) style_strings[];

103
LDAP_SLAPD_F (int) parse_acl LDAP_P(( Backend *be,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
104
	const char *fname, int lineno,
105
	int argc, char **argv, int pos ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
106
107
108
109
110

LDAP_SLAPD_F (char *) access2str LDAP_P(( slap_access_t access ));
LDAP_SLAPD_F (slap_access_t) str2access LDAP_P(( const char *str ));

#define ACCESSMASK_MAXLEN	sizeof("unknown (+wrscan)")
111
LDAP_SLAPD_F (char *) accessmask2str LDAP_P(( slap_mask_t mask, char*, int debug ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
112
LDAP_SLAPD_F (slap_mask_t) str2accessmask LDAP_P(( const char *str ));
113
LDAP_SLAPD_F (void) acl_unparse LDAP_P(( AccessControl*, struct berval* ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
114
115
LDAP_SLAPD_F (void) acl_destroy LDAP_P(( AccessControl*, AccessControl* ));
LDAP_SLAPD_F (void) acl_free LDAP_P(( AccessControl *a ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
116

Pierangelo Masarati's avatar
Pierangelo Masarati committed
117

Kurt Zeilenga's avatar
Kurt Zeilenga committed
118
119
120
/*
 * ad.c
 */
121
LDAP_SLAPD_F (int) slap_str2ad LDAP_P((
122
123
	const char *,
	AttributeDescription **ad,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
124
	const char **text ));
125

126
LDAP_SLAPD_F (int) slap_bv2ad LDAP_P((
127
128
	struct berval *bv,
	AttributeDescription **ad,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
129
	const char **text ));
130

Kurt Zeilenga's avatar
Kurt Zeilenga committed
131
132
LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * ));

133
134
#define ad_cmp(l,r)	(((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \
	? -1 : (((l)->ad_cname.bv_len > (r)->ad_cname.bv_len) \
Pierangelo Masarati's avatar
Pierangelo Masarati committed
135
		? 1 : strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val )))
136

137
LDAP_SLAPD_F (int) is_ad_subtype LDAP_P((
138
139
140
	AttributeDescription *sub,
	AttributeDescription *super ));

141
LDAP_SLAPD_F (int) ad_inlist LDAP_P((
142
	AttributeDescription *desc,
143
	AttributeName *attrs ));
144

145
146
147
LDAP_SLAPD_F (int) slap_str2undef_ad LDAP_P((
	const char *,
	AttributeDescription **ad,
148
149
	const char **text,
	unsigned proxied ));
150
151
152
153

LDAP_SLAPD_F (int) slap_bv2undef_ad LDAP_P((
	struct berval *bv,
	AttributeDescription **ad,
154
155
156
	const char **text,
	unsigned proxied ));

157
158
159
160
LDAP_SLAPD_F (AttributeDescription *) slap_bv2tmp_ad LDAP_P((
	struct berval *bv,
	void *memctx ));

161
162
163
LDAP_SLAPD_F (int) slap_ad_undef_promote LDAP_P((
	char *name,
	AttributeType *nat ));
164

165
LDAP_SLAPD_F (AttributeDescription *) ad_find_tags LDAP_P((
166
	AttributeType *type,
167
	struct berval *tags ));
168

169
LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an,
170
	char *str, const char *brkstr ));
171
172
173
LDAP_SLAPD_F (void) anlist_free LDAP_P(( AttributeName *an,
	int freename, void *ctx ));

174
175
176
177
178
179
LDAP_SLAPD_F (char **) anlist2charray_x LDAP_P((
									AttributeName *an, int dup, void *ctx ));
LDAP_SLAPD_F (char **) anlist2charray LDAP_P(( AttributeName *an, int dup ));
LDAP_SLAPD_F (char **) anlist2attrs LDAP_P(( AttributeName *anlist ));
LDAP_SLAPD_F (AttributeName *) file2anlist LDAP_P((
                        AttributeName *, const char *, const char * ));
180
LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s ));
181
182
LDAP_SLAPD_F (int) ad_define_option LDAP_P(( const char *name,
	const char *fname, int lineno ));
183
LDAP_SLAPD_F (void) ad_unparse_options LDAP_P(( BerVarray *res ));
184

Kurt Zeilenga's avatar
Kurt Zeilenga committed
185
186
187
188
LDAP_SLAPD_F (MatchingRule *) ad_mr(
	AttributeDescription *ad,
	unsigned usage );

189
190
191
192
193
LDAP_SLAPD_V( AttributeName * ) slap_anlist_no_attrs;
LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_user_attributes;
LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_operational_attributes;
LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_attributes;

194
195
196
197
/*
 * add.c
 */
LDAP_SLAPD_F (int) slap_mods2entry LDAP_P(( Modifications *mods, Entry **e,
198
	int initial, int dup, const char **text, char *textbuf, size_t textlen ));
199
200

LDAP_SLAPD_F (int) slap_entry2mods LDAP_P(( Entry *e,
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
201
202
						Modifications **mods, const char **text,
						char *textbuf, size_t textlen ));
Howard Chu's avatar
Howard Chu committed
203
204
205
206
207
208
LDAP_SLAPD_F( int ) slap_add_opattrs(
	Operation *op,
	const char **text,
	char *textbuf, size_t textlen,
	int manage_ctxcsn );

209

210
211
212
/*
 * at.c
 */
Howard Chu's avatar
Howard Chu committed
213
LDAP_SLAPD_V(int) at_oc_cache;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
214
215
216
217
218
LDAP_SLAPD_F (void) at_config LDAP_P((
	const char *fname, int lineno,
	int argc, char **argv ));
LDAP_SLAPD_F (AttributeType *) at_find LDAP_P((
	const char *name ));
219
220
LDAP_SLAPD_F (AttributeType *) at_bvfind LDAP_P((
	struct berval *name ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
221
222
223
224
225
226
LDAP_SLAPD_F (int) at_find_in_list LDAP_P((
	AttributeType *sat, AttributeType **list ));
LDAP_SLAPD_F (int) at_append_to_list LDAP_P((
	AttributeType *sat, AttributeType ***listp ));
LDAP_SLAPD_F (int) at_delete_from_list LDAP_P((
	int pos, AttributeType ***listp ));
227
LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
228
LDAP_SLAPD_F (int) at_add LDAP_P((
Howard Chu's avatar
Howard Chu committed
229
	LDAPAttributeType *at, int user,
230
	AttributeType **sat, AttributeType *prev, const char **err ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
231
LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
232

233
LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
234
235
236
	AttributeType *sub,
	AttributeType *super ));

237
238
LDAP_SLAPD_F (const char *) at_syntax LDAP_P((
	AttributeType *at ));
239
LDAP_SLAPD_F (int) is_at_syntax LDAP_P((
240
241
242
	AttributeType *at,
	const char *oid ));

243
244
LDAP_SLAPD_F (int) at_start LDAP_P(( AttributeType **at ));
LDAP_SLAPD_F (int) at_next LDAP_P(( AttributeType **at ));
Howard Chu's avatar
Howard Chu committed
245
LDAP_SLAPD_F (void) at_delete LDAP_P(( AttributeType *at ));
246

Howard Chu's avatar
Howard Chu committed
247
248
249
LDAP_SLAPD_F (void) at_unparse LDAP_P((
	BerVarray *bva, AttributeType *start, AttributeType *end, int system ));

250
251
252
253
254
LDAP_SLAPD_F (int) register_at LDAP_P((
	char *at,
	AttributeDescription **ad,
	int dupok ));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
255
256
257
/*
 * attr.c
 */
258
259
LDAP_SLAPD_F (void) attr_free LDAP_P(( Attribute *a ));
LDAP_SLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a ));
260

261
262
263
264
#ifdef LDAP_COMP_MATCH
LDAP_SLAPD_F (void) comp_tree_free LDAP_P(( Attribute *a ));
#endif

265
266
267
#define attr_mergeit( e, d, v ) attr_merge( e, d, v, NULL /* FIXME */ )
#define attr_mergeit_one( e, d, v ) attr_merge_one( e, d, v, NULL /* FIXME */ )

Howard Chu's avatar
Howard Chu committed
268
LDAP_SLAPD_F (Attribute *) attr_alloc LDAP_P(( AttributeDescription *ad ));
269
270
LDAP_SLAPD_F (Attribute *) attrs_alloc LDAP_P(( int num ));
LDAP_SLAPD_F (int) attr_prealloc LDAP_P(( int num ));
271
272
273
274
275
276
277
278
279
LDAP_SLAPD_F (int) attr_valfind LDAP_P(( Attribute *a,
	unsigned flags,
	struct berval *val,
	unsigned *slot,
	void *ctx ));
LDAP_SLAPD_F (int) attr_valadd LDAP_P(( Attribute *a,
	BerVarray vals,
	BerVarray nvals,
	int num ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
280
281
282
283
284
285
286
287
LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e,
	AttributeDescription *desc,
	BerVarray vals,
	BerVarray nvals ));
LDAP_SLAPD_F (int) attr_merge_one LDAP_P(( Entry *e,
	AttributeDescription *desc,
	struct berval *val,
	struct berval *nval ));
288
289
290
291
LDAP_SLAPD_F (int) attr_normalize LDAP_P(( AttributeDescription *desc,
	BerVarray vals, BerVarray *nvalsp, void *memctx ));
LDAP_SLAPD_F (int) attr_normalize_one LDAP_P(( AttributeDescription *desc,
	struct berval *val, struct berval *nval, void *memctx ));
292
293
LDAP_SLAPD_F (int) attr_merge_normalize LDAP_P(( Entry *e,
	AttributeDescription *desc,
Howard Chu's avatar
Howard Chu committed
294
	BerVarray vals, void *memctx ));
295
296
LDAP_SLAPD_F (int) attr_merge_normalize_one LDAP_P(( Entry *e,
	AttributeDescription *desc,
Howard Chu's avatar
Howard Chu committed
297
	struct berval *val, void *memctx ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
298
299
300
301
302
303
LDAP_SLAPD_F (Attribute *) attrs_find LDAP_P((
	Attribute *a, AttributeDescription *desc ));
LDAP_SLAPD_F (Attribute *) attr_find LDAP_P((
	Attribute *a, AttributeDescription *desc ));
LDAP_SLAPD_F (int) attr_delete LDAP_P((
	Attribute **attrs, AttributeDescription *desc ));
304

305
306
LDAP_SLAPD_F (void) attrs_free LDAP_P(( Attribute *a ));
LDAP_SLAPD_F (Attribute *) attrs_dup LDAP_P(( Attribute *a ));
307
308
LDAP_SLAPD_F (int) attr_init LDAP_P(( void ));
LDAP_SLAPD_F (int) attr_destroy LDAP_P(( void ));
309

310

Kurt Zeilenga's avatar
Kurt Zeilenga committed
311
312
313
/*
 * ava.c
 */
314
LDAP_SLAPD_F (int) get_ava LDAP_P((
315
	Operation *op,
316
	BerElement *ber,
317
	Filter *f,
318
	unsigned usage,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
319
	const char **text ));
320
LDAP_SLAPD_F (void) ava_free LDAP_P((
321
	Operation *op,
322
323
	AttributeAssertion *ava,
	int freeit ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
324
325
326
327

/*
 * backend.c
 */
328

Luke Howard's avatar
Luke Howard committed
329
330
#define be_match( be1, be2 )	( (be1) == (be2) || \
				  ( (be1) && (be2) && (be1)->be_nsuffix == (be2)->be_nsuffix ) )
331

332
333
334
335
LDAP_SLAPD_F (int) backend_init LDAP_P((void));
LDAP_SLAPD_F (int) backend_add LDAP_P((BackendInfo *aBackendInfo));
LDAP_SLAPD_F (int) backend_num LDAP_P((Backend *be));
LDAP_SLAPD_F (int) backend_startup LDAP_P((Backend *be));
336
LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be, struct config_reply_s *cr));
337
LDAP_SLAPD_F (int) backend_sync LDAP_P((Backend *be));
338
339
LDAP_SLAPD_F (int) backend_shutdown LDAP_P((Backend *be));
LDAP_SLAPD_F (int) backend_destroy LDAP_P((void));
340
LDAP_SLAPD_F (void) backend_stopdown_one LDAP_P((BackendDB *bd ));
Howard Chu's avatar
Howard Chu committed
341
LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd, int dynamic));
342

343
LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
344
LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type,
345
	BackendDB *be, int idx, struct config_reply_s *cr ));
346
347
LDAP_SLAPD_F (void) backend_db_insert LDAP_P((BackendDB *bd, int idx));
LDAP_SLAPD_F (void) backend_db_move LDAP_P((BackendDB *bd, int idx));
348

349
LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
350
	struct berval * dn,
351
	int noSubordinates ));
352

Kurt Zeilenga's avatar
Kurt Zeilenga committed
353
LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
354
	struct berval *suffix ));
355
356
LDAP_SLAPD_F (int) be_issubordinate LDAP_P(( Backend *be,
	struct berval *subordinate ));
357
358
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isroot_dn LDAP_P(( Backend *be, struct berval *ndn ));
359
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
360
LDAP_SLAPD_F (int) be_rootdn_bind LDAP_P(( Operation *op, SlapReply *rs ));
361
362
363
LDAP_SLAPD_F (int) be_slurp_update LDAP_P(( Operation *op ));
#define be_isupdate( op ) be_slurp_update( (op) )
LDAP_SLAPD_F (int) be_shadow_update LDAP_P(( Operation *op ));
364
LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
365
LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
366
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( Operation *o,
367
368
		struct berval *ndn, ObjectClass *oc,
		AttributeDescription *at, int rw, Entry **e ));
369
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
370
371
372
	Operation *o, Entry *e, int rw ));
#define be_entry_release_r( o, e ) be_entry_release_rw( o, e, 0 )
#define be_entry_release_w( o, e ) be_entry_release_rw( o, e, 1 )
373

374
375
376
LDAP_SLAPD_F (int) backend_unbind LDAP_P((Operation *op, SlapReply *rs));
LDAP_SLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
LDAP_SLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
377

378
379
380
LDAP_SLAPD_F( int ) backend_check_controls LDAP_P((
	Operation *op,
	SlapReply *rs ));
381
LDAP_SLAPD_F( int )	backend_check_restrictions LDAP_P((
382
	Operation *op,
383
384
	SlapReply *rs,
	struct berval *opdata ));
385

386
LDAP_SLAPD_F( int )	backend_check_referrals LDAP_P((
387
	Operation *op,
388
	SlapReply *rs ));
389

390
LDAP_SLAPD_F (int) backend_group LDAP_P((
391
	Operation *op,
392
	Entry *target,
393
	struct berval *gr_ndn,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
394
	struct berval *op_ndn,
395
396
	ObjectClass *group_oc,
	AttributeDescription *group_at
397
));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
398

399
LDAP_SLAPD_F (int) backend_attribute LDAP_P((
400
401
	Operation *op,
	Entry *target,
402
	struct berval *entry_ndn,
403
	AttributeDescription *entry_at,
404
405
	BerVarray *vals,
	slap_access_t access
406
407
));

408
409
410
411
412
413
414
415
416
LDAP_SLAPD_F (int) backend_access LDAP_P((
	Operation		*op,
	Entry			*target,
	struct berval		*edn,
	AttributeDescription	*entry_at,
	struct berval		*nval,
	slap_access_t		access,
	slap_mask_t		*mask ));

417
LDAP_SLAPD_F (int) backend_operational LDAP_P((
418
	Operation *op,
419
420
	SlapReply *rs 
));
421

422
423
LDAP_SLAPD_V(BackendInfo) slap_binfo[]; 

424
425
426
427
428
/*
 * backglue.c
 */

LDAP_SLAPD_F (int) glue_sub_init( void );
429
LDAP_SLAPD_F (int) glue_sub_attach( void );
430
431
432
LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online );
LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );

433
434
435
/*
 * backover.c
 */
Pierangelo Masarati's avatar
Pierangelo Masarati committed
436
LDAP_SLAPD_F (int) overlay_register LDAP_P(( slap_overinst *on ));
437
438
LDAP_SLAPD_F (int) overlay_config LDAP_P(( BackendDB *be, const char *ov,
	int idx, BackendInfo **res ));
439
440
441
LDAP_SLAPD_F (void) overlay_destroy_one LDAP_P((
	BackendDB *be,
	slap_overinst *on ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
442
443
444
445
LDAP_SLAPD_F (slap_overinst *) overlay_next LDAP_P(( slap_overinst *on ));
LDAP_SLAPD_F (slap_overinst *) overlay_find LDAP_P(( const char *name ));
LDAP_SLAPD_F (int) overlay_is_over LDAP_P(( BackendDB *be ));
LDAP_SLAPD_F (int) overlay_is_inst LDAP_P(( BackendDB *be, const char *name ));
446
447
448
LDAP_SLAPD_F (int) overlay_register_control LDAP_P((
	BackendDB *be,
	const char *oid ));
449
450
451
452
453
454
LDAP_SLAPD_F (int) overlay_op_walk LDAP_P((
	Operation *op,
	SlapReply *rs,
	slap_operation_t which,
	slap_overinfo *oi,
	slap_overinst *on ));
455
456
457
458
459
460
461
462
463
464
465
466
467
LDAP_SLAPD_F (int) overlay_entry_get_ov LDAP_P((
	Operation *op,
	struct berval *dn,
	ObjectClass *oc,
	AttributeDescription *ad,
	int rw,
	Entry **e,
	slap_overinst *ov ));
LDAP_SLAPD_F (int) overlay_entry_release_ov LDAP_P((
	Operation *op,
	Entry *e,
	int rw,
	slap_overinst *ov ));
468
469
470
471
LDAP_SLAPD_F (void) overlay_insert LDAP_P((
	BackendDB *be, slap_overinst *on, slap_overinst ***prev, int idx ));
LDAP_SLAPD_F (void) overlay_move LDAP_P((
	BackendDB *be, slap_overinst *on, int idx ));
472

473
474
475
476
/*
 * bconfig.c
 */
LDAP_SLAPD_F (int) slap_loglevel_register LDAP_P (( slap_mask_t m, struct berval *s ));
477
LDAP_SLAPD_F (int) slap_loglevel_get LDAP_P(( struct berval *s, int *l ));
478
LDAP_SLAPD_F (int) str2loglevel LDAP_P(( const char *s, int *l ));
479
480
481
LDAP_SLAPD_F (int) loglevel2bvarray LDAP_P(( int l, BerVarray *bva ));
LDAP_SLAPD_F (const char *) loglevel2str LDAP_P(( int l ));
LDAP_SLAPD_F (int) loglevel2bv LDAP_P(( int l, struct berval *bv ));
482
LDAP_SLAPD_F (int) loglevel_print LDAP_P(( FILE *out ));
483
484
LDAP_SLAPD_F (int) slap_cf_aux_table_parse LDAP_P(( const char *word, void *bc, slap_cf_aux_table *tab0, LDAP_CONST char *tabmsg ));
LDAP_SLAPD_F (int) slap_cf_aux_table_unparse LDAP_P(( void *bc, struct berval *bv, slap_cf_aux_table *tab0 ));
485

Kurt Zeilenga's avatar
Kurt Zeilenga committed
486
487
488
/*
 * ch_malloc.c
 */
Howard Chu's avatar
Howard Chu committed
489
LDAP_SLAPD_V (BerMemoryFunctions) ch_mfuncs;
490
491
492
493
494
LDAP_SLAPD_F (void *) ch_malloc LDAP_P(( ber_len_t size ));
LDAP_SLAPD_F (void *) ch_realloc LDAP_P(( void *block, ber_len_t size ));
LDAP_SLAPD_F (void *) ch_calloc LDAP_P(( ber_len_t nelem, ber_len_t size ));
LDAP_SLAPD_F (char *) ch_strdup LDAP_P(( const char *string ));
LDAP_SLAPD_F (void) ch_free LDAP_P(( void * ));
495
496
497

#ifndef CH_FREE
#undef free
498
#define free ch_free
499
#endif
Kurt Zeilenga's avatar
Kurt Zeilenga committed
500

501
502
503
504
/*
 * component.c
 */
#ifdef LDAP_COMP_MATCH
505
506
struct comp_attribute_aliasing;

507
508
509
510
511
LDAP_SLAPD_F (int) test_comp_filter_entry LDAP_P((
	Operation* op,
	Entry* e,
	MatchingRuleAssertion* mr));

512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
LDAP_SLAPD_F (int) dup_comp_filter LDAP_P((
	Operation* op,
	struct berval *bv,
	ComponentFilter *in_f,
	ComponentFilter **out_f ));

LDAP_SLAPD_F (int) get_aliased_filter_aa LDAP_P((
	Operation* op,
	AttributeAssertion* a_assert,
	struct comp_attribute_aliasing* aa,
	const char** text ));

LDAP_SLAPD_F (int) get_aliased_filter LDAP_P((
	Operation* op,
	MatchingRuleAssertion* ma,
	struct comp_attribute_aliasing* aa,
	const char** text ));

530
531
532
533
534
535
LDAP_SLAPD_F (int) get_comp_filter LDAP_P((
	Operation* op,
	BerValue* bv,
	ComponentFilter** filt,
	const char **text ));

536
537
538
539
540
541
542
543
544
545
546
LDAP_SLAPD_F (int) insert_component_reference LDAP_P((
	ComponentReference *cr,
	ComponentReference** cr_list ));

LDAP_SLAPD_F (int) is_component_reference LDAP_P((
	char *attr ));

LDAP_SLAPD_F (int) extract_component_reference LDAP_P((
	char* attr,
	ComponentReference** cr ));

547
548
549
550
551
552
553
554
LDAP_SLAPD_F (int) componentFilterMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *assertedValue ));

555
556
557
558
559
560
561
LDAP_SLAPD_F (int) directoryComponentsMatch LDAP_P((
        int *matchp,
        slap_mask_t flags,
        Syntax *syntax,
        MatchingRule *mr,
        struct berval *value,
        void *assertedValue ));
Sang Seok Lim's avatar
Sang Seok Lim committed
562
563
564
565
566
567
568
569

LDAP_SLAPD_F (int) allComponentsMatch LDAP_P((
        int *matchp,
        slap_mask_t flags,
        Syntax *syntax,
        MatchingRule *mr,
        struct berval *value,
        void *assertedValue ));
570
571
572
573

LDAP_SLAPD_F (ComponentReference*) dup_comp_ref LDAP_P((
	Operation *op,
	ComponentReference *cr ));
Sang Seok Lim's avatar
Sang Seok Lim committed
574
                                                                          
575
576
577
LDAP_SLAPD_F (int) componentFilterValidate LDAP_P(( 
	Syntax *syntax,
	struct berval* bv ));
Sang Seok Lim's avatar
Sang Seok Lim committed
578
579
580
581

LDAP_SLAPD_F (int) allComponentsValidate LDAP_P((
        Syntax *syntax,
        struct berval* bv ));
582

583
584
585
586
587
588
LDAP_SLAPD_F (void) component_free LDAP_P((
	ComponentFilter *f ));

LDAP_SLAPD_F (void) free_ComponentData LDAP_P((
	Attribute *a ));

589
590
591
592
LDAP_SLAPD_V (test_membership_func*) is_aliased_attribute;

LDAP_SLAPD_V (free_component_func*) component_destructor;

593
594
595
596
597
598
599
600
601
LDAP_SLAPD_V (get_component_info_func*) get_component_description;

LDAP_SLAPD_V (component_encoder_func*) component_encoder;

LDAP_SLAPD_V (convert_attr_to_comp_func*) attr_converter;

LDAP_SLAPD_V (alloc_nibble_func*) nibble_mem_allocator;

LDAP_SLAPD_V (free_nibble_func*) nibble_mem_free;
602
603
#endif

604
605
606
/*
 * controls.c
 */
Howard Chu's avatar
Howard Chu committed
607
LDAP_SLAPD_V( struct slap_control_ids ) slap_cids;
608
609
610
LDAP_SLAPD_F (void) slap_free_ctrls LDAP_P((
	Operation *op,
	LDAPControl **ctrls ));
611
612
613
614
615
LDAP_SLAPD_F (int) slap_parse_ctrl LDAP_P((
	Operation *op,
	SlapReply *rs,
	LDAPControl *control,
	const char **text ));
616
LDAP_SLAPD_F (int) get_ctrls LDAP_P((
617
	Operation *op,
618
	SlapReply *rs,
619
	int senderrors ));
620
LDAP_SLAPD_F (int) register_supported_control2 LDAP_P((
621
622
623
	const char *controloid,
	slap_mask_t controlmask,
	char **controlexops,
Howard Chu's avatar
Howard Chu committed
624
	SLAP_CTRL_PARSE_FN *controlparsefn,
625
	unsigned flags,
Howard Chu's avatar
Howard Chu committed
626
	int *controlcid ));
627
628
#define register_supported_control(oid, mask, exops, fn, cid) \
	register_supported_control2((oid), (mask), (exops), (fn), 0, (cid))
629
630
631
LDAP_SLAPD_F (int) slap_controls_init LDAP_P ((void));
LDAP_SLAPD_F (void) controls_destroy LDAP_P ((void));
LDAP_SLAPD_F (int) controls_root_dse_info LDAP_P ((Entry *e));
632
633
634
635
636
LDAP_SLAPD_F (int) get_supported_controls LDAP_P ((
	char ***ctrloidsp, slap_mask_t **ctrlmasks ));
LDAP_SLAPD_F (int) slap_find_control_id LDAP_P ((
	const char *oid, int *cid ));
LDAP_SLAPD_F (int) slap_global_control LDAP_P ((
637
	Operation *op, const char *oid, int *cid ));
638
639
640
641
642
LDAP_SLAPD_F (int) slap_remove_control LDAP_P((
	Operation	*op,
	SlapReply	*rs,
	int		ctrl,
	BI_chk_controls	fnc ));
643

644
645
646
647
648
649
650
651
652
653
654
655
656
657
#ifdef SLAP_CONTROL_X_SESSION_TRACKING
LDAP_SLAPD_F (int)
slap_ctrl_session_tracking_add LDAP_P((
	Operation *op,
	SlapReply *rs,
	struct berval *ip,
	struct berval *name,
	struct berval *id,
	LDAPControl *ctrl ));
LDAP_SLAPD_F (int)
slap_ctrl_session_tracking_request_add LDAP_P((
	Operation *op, SlapReply *rs, LDAPControl *ctrl ));
#endif /* SLAP_CONTROL_X_SESSION_TRACKING */

Kurt Zeilenga's avatar
Kurt Zeilenga committed
658
659
660
/*
 * config.c
 */
661
LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, const char *dir ));
Howard Chu's avatar
Howard Chu committed
662
LDAP_SLAPD_F (void) config_destroy LDAP_P ((void));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
663
LDAP_SLAPD_F (char **) slap_str2clist LDAP_P((
664
	char ***, char *, const char * ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
665
666
LDAP_SLAPD_F (int) bverb_to_mask LDAP_P((
	struct berval *bword,  slap_verbmasks *v ));
Howard Chu's avatar
Howard Chu committed
667
668
669
670
671
672
LDAP_SLAPD_F (int) verb_to_mask LDAP_P((
	const char *word,  slap_verbmasks *v ));
LDAP_SLAPD_F (int) verbs_to_mask LDAP_P((
	int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m ));
LDAP_SLAPD_F (int) mask_to_verbs LDAP_P((
	slap_verbmasks *v, slap_mask_t m, BerVarray *bva ));
673
674
LDAP_SLAPD_F (int) enum_to_verb LDAP_P((
	slap_verbmasks *v, slap_mask_t m, struct berval *bv ));
675
676
677
678
LDAP_SLAPD_F (int) slap_verbmasks_init LDAP_P(( slap_verbmasks **vp, slap_verbmasks *v ));
LDAP_SLAPD_F (int) slap_verbmasks_destroy LDAP_P(( slap_verbmasks *v ));
LDAP_SLAPD_F (int) slap_verbmasks_append LDAP_P(( slap_verbmasks **vp,
	slap_mask_t m, struct berval *v, slap_mask_t *ignore ));
679
680
681
LDAP_SLAPD_F (int) slap_tls_get_config LDAP_P((
	LDAP *ld, int opt, char **val ));
LDAP_SLAPD_F (void) bindconf_tls_defaults LDAP_P(( slap_bindconf *bc ));
Howard Chu's avatar
Howard Chu committed
682
683
684
685
LDAP_SLAPD_F (int) bindconf_tls_parse LDAP_P((
	const char *word,  slap_bindconf *bc ));
LDAP_SLAPD_F (int) bindconf_tls_unparse LDAP_P((
	slap_bindconf *bc, struct berval *bv ));
Howard Chu's avatar
Howard Chu committed
686
687
688
689
LDAP_SLAPD_F (int) bindconf_parse LDAP_P((
	const char *word,  slap_bindconf *bc ));
LDAP_SLAPD_F (int) bindconf_unparse LDAP_P((
	slap_bindconf *bc, struct berval *bv ));
Howard Chu's avatar
Howard Chu committed
690
691
LDAP_SLAPD_F (int) bindconf_tls_set LDAP_P((
	slap_bindconf *bc, LDAP *ld ));
Howard Chu's avatar
Howard Chu committed
692
LDAP_SLAPD_F (void) bindconf_free LDAP_P(( slap_bindconf *bc ));
693
LDAP_SLAPD_F (int) slap_client_connect LDAP_P(( LDAP **ldp, slap_bindconf *sb ));
694
695
LDAP_SLAPD_F (int) config_generic_wrapper LDAP_P(( Backend *be,
	const char *fname, int lineno, int argc, char **argv ));
696
LDAP_SLAPD_F (char *) anlist_unparse LDAP_P(( AttributeName *, char *, ber_len_t buflen ));
Howard Chu's avatar
Howard Chu committed
697

698
699
700
701
#ifdef LDAP_SLAPI
LDAP_SLAPD_V (int) slapi_plugins_used;
#endif

Kurt Zeilenga's avatar
Kurt Zeilenga committed
702
703
704
/*
 * connection.c
 */
705
706
707
708
LDAP_SLAPD_F (int) connections_init LDAP_P((void));
LDAP_SLAPD_F (int) connections_shutdown LDAP_P((void));
LDAP_SLAPD_F (int) connections_destroy LDAP_P((void));
LDAP_SLAPD_F (int) connections_timeout_idle LDAP_P((time_t));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
709

710
711
712
713
714
715
716
LDAP_SLAPD_F (int) connection_client_setup LDAP_P((
	ber_socket_t s,
	ldap_pvt_thread_start_t *func,
	void *arg ));
LDAP_SLAPD_F (void) connection_client_enable LDAP_P(( ber_socket_t s ));
LDAP_SLAPD_F (void) connection_client_stop LDAP_P(( ber_socket_t s ));

717
718
719
720
721
#ifdef LDAP_PF_LOCAL_SENDMSG
#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)	, arg
#else
#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)
#endif
722

723
LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
724
	ber_socket_t s,
Pierangelo Masarati's avatar
Pierangelo Masarati committed
725
	Listener* url,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
726
727
	const char* dnsname,
	const char* peername,
728
	int use_tls,
729
	slap_ssf_t ssf,
730
731
	struct berval *id
	LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
732

733
734
LDAP_SLAPD_F (void) connection_closing LDAP_P((
	Connection *c, const char *why ));
735
LDAP_SLAPD_F (int) connection_state_closing LDAP_P(( Connection *c ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
736
737
LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
	LDAP_GCCATTR((const));
738

Kurt Zeilenga's avatar
Kurt Zeilenga committed
739
LDAP_SLAPD_F (int) connection_read_activate LDAP_P((ber_socket_t s));
740
LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
741

742
LDAP_SLAPD_F (unsigned long) connections_nextid(void);
743

Kurt Zeilenga's avatar
Kurt Zeilenga committed
744
745
746
LDAP_SLAPD_F (Connection *) connection_first LDAP_P(( ber_socket_t * ));
LDAP_SLAPD_F (Connection *) connection_next LDAP_P((
	Connection *, ber_socket_t *));
747
LDAP_SLAPD_F (void) connection_done LDAP_P((Connection *));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
748

749
LDAP_SLAPD_F (void) connection2anonymous LDAP_P((Connection *));
Howard Chu's avatar
Howard Chu committed
750
751
LDAP_SLAPD_F (void) connection_fake_init LDAP_P((
	Connection *conn,
752
	OperationBuffer *opbuf,
Howard Chu's avatar
Howard Chu committed
753
	void *threadctx ));
754
755
LDAP_SLAPD_F (void) connection_fake_init2 LDAP_P((
	Connection *conn,
756
	OperationBuffer *opbuf,
757
758
	void *threadctx,
	int newmem ));
759
LDAP_SLAPD_F (void) connection_assign_nextid LDAP_P((Connection *));
760

761
762
763
764
/*
 * cr.c
 */
LDAP_SLAPD_F (int) cr_schema_info( Entry *e );
Howard Chu's avatar
Howard Chu committed
765
766
LDAP_SLAPD_F (void) cr_unparse LDAP_P((
	BerVarray *bva, ContentRule *start, ContentRule *end, int system ));
767
768
769
770

LDAP_SLAPD_F (int) cr_add LDAP_P((
	LDAPContentRule *oc,
	int user,
Howard Chu's avatar
Howard Chu committed
771
	ContentRule **scr,
772
	const char **err));
Howard Chu's avatar
Howard Chu committed
773

774
775
776
777
778
779
780
LDAP_SLAPD_F (void) cr_destroy LDAP_P(( void ));

LDAP_SLAPD_F (ContentRule *) cr_find LDAP_P((
	const char *crname));
LDAP_SLAPD_F (ContentRule *) cr_bvfind LDAP_P((
	struct berval *crname));

Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
781
782
783
784
/*
 * ctxcsn.c
 */

785
LDAP_SLAPD_V( int ) slap_serverID;
786
787
LDAP_SLAPD_V( const struct berval ) slap_ldapsync_bv;
LDAP_SLAPD_V( const struct berval ) slap_ldapsync_cn_bv;
788
LDAP_SLAPD_F (void) slap_get_commit_csn LDAP_P((
789
	Operation *, struct berval *maxcsn ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
790
791
792
LDAP_SLAPD_F (void) slap_rewind_commit_csn LDAP_P(( Operation * ));
LDAP_SLAPD_F (void) slap_graduate_commit_csn LDAP_P(( Operation * ));
LDAP_SLAPD_F (Entry *) slap_create_context_csn_entry LDAP_P(( Backend *, struct berval *));
Howard Chu's avatar
Howard Chu committed
793
LDAP_SLAPD_F (int) slap_get_csn LDAP_P(( Operation *, struct berval *, int ));
794
LDAP_SLAPD_F (void) slap_queue_csn LDAP_P(( Operation *, struct berval * ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
795

Kurt Zeilenga's avatar
Kurt Zeilenga committed
796
/*
Kurt Zeilenga's avatar
Kurt Zeilenga committed
797
 * daemon.c
Kurt Zeilenga's avatar
Kurt Zeilenga committed
798
 */
799
LDAP_SLAPD_F (void) slapd_add_internal(ber_socket_t s, int isactive);
Kurt Zeilenga's avatar
Kurt Zeilenga committed
800
801
802
803
LDAP_SLAPD_F (int) slapd_daemon_init( const char *urls );
LDAP_SLAPD_F (int) slapd_daemon_destroy(void);
LDAP_SLAPD_F (int) slapd_daemon(void);
LDAP_SLAPD_F (Listener **)	slapd_get_listeners LDAP_P((void));
804
805
LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, Sockbuf *sb,
	int wasactive, int wake, int locked ));
806
807
LDAP_SLAPD_F (void) slapd_sd_lock LDAP_P((void));
LDAP_SLAPD_F (void) slapd_sd_unlock LDAP_P((void));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
808

Kurt Zeilenga's avatar
Kurt Zeilenga committed
809
810
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
811
LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
812
813
814
815

LDAP_SLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
LDAP_SLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));
816
LDAP_SLAPD_F (int) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
817

818
819
820
LDAP_SLAPD_V (volatile sig_atomic_t) slapd_abrupt_shutdown;
LDAP_SLAPD_V (volatile sig_atomic_t) slapd_shutdown;
LDAP_SLAPD_V (int) slapd_register_slp;
821
LDAP_SLAPD_V (const char *) slapd_slp_attrs;
822
LDAP_SLAPD_V (slap_ssf_t) local_ssf;
823
LDAP_SLAPD_V (struct runqueue_s) slapd_rq;
824

Kurt Zeilenga's avatar
Kurt Zeilenga committed
825
826
827
/*
 * dn.c
 */
828

829
#define dn_match(dn1, dn2) 	( ber_bvcmp((dn1), (dn2)) == 0 )
830
#define bvmatch(bv1, bv2)	( ((bv1)->bv_len == (bv2)->bv_len) && (memcmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
831

832
833
834
LDAP_SLAPD_F (int) dnValidate LDAP_P((
	Syntax *syntax, 
	struct berval *val ));
835
836
837
LDAP_SLAPD_F (int) rdnValidate LDAP_P((
	Syntax *syntax, 
	struct berval *val ));
838

Howard Chu's avatar
Howard Chu committed
839
LDAP_SLAPD_F (slap_mr_normalize_func) dnNormalize;
840

841
842
LDAP_SLAPD_F (slap_mr_normalize_func) rdnNormalize;

Kurt Zeilenga's avatar
Kurt Zeilenga committed
843
LDAP_SLAPD_F (slap_syntax_transform_func) dnPretty;
844

845
846
LDAP_SLAPD_F (slap_syntax_transform_func) rdnPretty;

847
848
849
850
LDAP_SLAPD_F (int) dnPrettyNormal LDAP_P(( 
	Syntax *syntax, 
	struct berval *val, 
	struct berval *pretty,
Howard Chu's avatar
Howard Chu committed
851
852
	struct berval *normal,
	void *ctx ));
853

854
855
856
857
858
859
860
861
LDAP_SLAPD_F (int) dnMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *assertedValue ));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
862
863
864
865
866
867
868
869
LDAP_SLAPD_F (int) dnRelativeMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *assertedValue ));

870
871
872
873
874
875
876
877
LDAP_SLAPD_F (int) rdnMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *assertedValue ));

878

879
880
881
LDAP_SLAPD_F (int) dnIsSuffix LDAP_P((
	const struct berval *dn, const struct berval *suffix ));

882
883
LDAP_SLAPD_F (int) dnIsOneLevelRDN LDAP_P(( struct berval *rdn ));

884
LDAP_SLAPD_F (int) dnExtractRdn LDAP_P((
Howard Chu's avatar
Howard Chu committed
885
	struct berval *dn, struct berval *rdn, void *ctx ));
886

887
LDAP_SLAPD_F (int) rdn_validate LDAP_P(( struct berval * rdn ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
888

Pierangelo Masarati's avatar
Pierangelo Masarati committed
889
LDAP_SLAPD_F (ber_len_t) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
890
891
892
893

LDAP_SLAPD_F (void) build_new_dn LDAP_P((
	struct berval * new_dn,
	struct berval * parent_dn,
894
895
	struct berval * newrdn,
	void *memctx ));
896

897
LDAP_SLAPD_F (void) dnParent LDAP_P(( struct berval *dn, struct berval *pdn ));
898
LDAP_SLAPD_F (void) dnRdn LDAP_P(( struct berval *dn, struct berval *rdn ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
899

900
901
LDAP_SLAPD_F (int) dnX509normalize LDAP_P(( void *x509_name, struct berval *out ));

902
LDAP_SLAPD_F (int) dnX509peerNormalize LDAP_P(( void *ssl, struct berval *dn ));
903

Howard Chu's avatar
Howard Chu committed
904
905
906
907
908
LDAP_SLAPD_F (int) dnPrettyNormalDN LDAP_P(( Syntax *syntax, struct berval *val, LDAPDN *dn, int flags, void *ctx ));
#define dnPrettyDN(syntax, val, dn, ctx) \
	dnPrettyNormalDN((syntax),(val),(dn), SLAP_LDAPDN_PRETTY, ctx)
#define dnNormalDN(syntax, val, dn, ctx) \
	dnPrettyNormalDN((syntax),(val),(dn), 0, ctx)
909

910
911
typedef int (SLAP_CERT_MAP_FN) LDAP_P(( void *ssl, struct berval *dn ));
LDAP_SLAPD_F (int) register_certificate_map_function LDAP_P(( SLAP_CERT_MAP_FN *fn ));
912

Kurt Zeilenga's avatar
Kurt Zeilenga committed
913
914
915
/*
 * entry.c
 */
Howard Chu's avatar
Howard Chu committed
916
LDAP_SLAPD_V (const Entry) slap_entry_root;
917

Pierangelo Masarati's avatar
Pierangelo Masarati committed
918
LDAP_SLAPD_F (int) entry_init LDAP_P((void));
919
LDAP_SLAPD_F (int) entry_destroy LDAP_P((void));
920

921
LDAP_SLAPD_F (Entry *) str2entry LDAP_P(( char	*s ));
922
LDAP_SLAPD_F (Entry *) str2entry2 LDAP_P(( char	*s, int checkvals ));
923
LDAP_SLAPD_F (char *) entry2str LDAP_P(( Entry *e, int *len ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
924

925
926
927
928
LDAP_SLAPD_F (ber_len_t) entry_flatsize LDAP_P(( Entry *e, int norm ));
LDAP_SLAPD_F (void) entry_partsize LDAP_P(( Entry *e, ber_len_t *len,
	int *nattrs, int *nvals, int norm ));

929
LDAP_SLAPD_F (int) entry_header LDAP_P(( EntryHeader *eh ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
930
931
#ifdef SLAP_ZONE_ALLOC
LDAP_SLAPD_F (int) entry_decode LDAP_P((
932
						EntryHeader *eh, Entry **e, void *ctx ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
933
934
#else
LDAP_SLAPD_F (int) entry_decode LDAP_P((
935
						EntryHeader *eh, Entry **e ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
936
#endif
937
LDAP_SLAPD_F (int) entry_encode LDAP_P(( Entry *e, struct berval *bv ));
938

939
LDAP_SLAPD_F (void) entry_clean LDAP_P(( Entry *e ));
940
LDAP_SLAPD_F (void) entry_free LDAP_P(( Entry *e ));