proto-slap.h 70.2 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/>.
 *
Quanah Gibson-Mount's avatar
Quanah Gibson-Mount committed
4
 * Copyright 1998-2020 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
LDAP_SLAPD_F (int) acl_string_expand LDAP_P((
	struct berval *newbuf, struct berval *pattern,
Pierangelo Masarati's avatar
Pierangelo Masarati committed
96
	struct berval *dnmatch, struct berval *valmatch, AclRegexMatches *matches ));
97

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

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* ));
Howard Chu's avatar
Howard Chu committed
114
LDAP_SLAPD_F (void) acl_destroy LDAP_P(( AccessControl* ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
115
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
LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * ));
132
LDAP_SLAPD_F (int) ad_keystring LDAP_P(( struct berval *bv ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
133

134
135
#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
136
		? 1 : strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val )))
137

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

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

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

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

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

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

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

170
LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an,
171
	char *str, const char *brkstr ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
172
173
174
LDAP_SLAPD_F (void) anlist_free LDAP_P(( AttributeName *an,
	int freename, void *ctx ));

175
176
177
178
179
180
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 * ));
181
LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s ));
182
183
LDAP_SLAPD_F (int) ad_define_option LDAP_P(( const char *name,
	const char *fname, int lineno ));
184
LDAP_SLAPD_F (void) ad_unparse_options LDAP_P(( BerVarray *res ));
185

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

190
191
192
193
194
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;

195
196
197
198
LDAP_SLAPD_V( struct berval * ) slap_bv_no_attrs;
LDAP_SLAPD_V( struct berval * ) slap_bv_all_user_attrs;
LDAP_SLAPD_V( struct berval * ) slap_bv_all_operational_attrs;

199
200
201
202
203
/* deprecated; only defined for backward compatibility */
#define NoAttrs		(*slap_bv_no_attrs)
#define AllUser		(*slap_bv_all_user_attrs)
#define AllOper		(*slap_bv_all_operational_attrs)

204
205
206
207
/*
 * add.c
 */
LDAP_SLAPD_F (int) slap_mods2entry LDAP_P(( Modifications *mods, Entry **e,
208
	int initial, int dup, const char **text, char *textbuf, size_t textlen ));
209
210

LDAP_SLAPD_F (int) slap_entry2mods LDAP_P(( Entry *e,
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
211
212
						Modifications **mods, const char **text,
						char *textbuf, size_t textlen ));
Howard Chu's avatar
Howard Chu committed
213
214
215
216
217
218
LDAP_SLAPD_F( int ) slap_add_opattrs(
	Operation *op,
	const char **text,
	char *textbuf, size_t textlen,
	int manage_ctxcsn );

219

220
221
222
/*
 * at.c
 */
Howard Chu's avatar
Howard Chu committed
223
LDAP_SLAPD_V(int) at_oc_cache;
Kurt Zeilenga's avatar
Kurt Zeilenga committed
224
225
226
227
228
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 ));
229
230
LDAP_SLAPD_F (AttributeType *) at_bvfind LDAP_P((
	struct berval *name ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
231
232
233
234
235
236
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 ));
237
LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
238
LDAP_SLAPD_F (int) at_add LDAP_P((
Howard Chu's avatar
Howard Chu committed
239
	LDAPAttributeType *at, int user,
240
	AttributeType **sat, AttributeType *prev, const char **err ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
241
LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
242

243
LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
244
245
246
	AttributeType *sub,
	AttributeType *super ));

247
248
LDAP_SLAPD_F (const char *) at_syntax LDAP_P((
	AttributeType *at ));
249
LDAP_SLAPD_F (int) is_at_syntax LDAP_P((
250
251
252
	AttributeType *at,
	const char *oid ));

253
254
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
255
LDAP_SLAPD_F (void) at_delete LDAP_P(( AttributeType *at ));
256

Howard Chu's avatar
Howard Chu committed
257
258
259
LDAP_SLAPD_F (void) at_unparse LDAP_P((
	BerVarray *bva, AttributeType *start, AttributeType *end, int system ));

260
LDAP_SLAPD_F (int) register_at LDAP_P((
261
	const char *at,
262
263
264
	AttributeDescription **ad,
	int dupok ));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
265
266
267
/*
 * attr.c
 */
268
269
LDAP_SLAPD_F (void) attr_free LDAP_P(( Attribute *a ));
LDAP_SLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a ));
270

271
272
273
274
#ifdef LDAP_COMP_MATCH
LDAP_SLAPD_F (void) comp_tree_free LDAP_P(( Attribute *a ));
#endif

275
276
277
#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
278
LDAP_SLAPD_F (Attribute *) attr_alloc LDAP_P(( AttributeDescription *ad ));
279
280
LDAP_SLAPD_F (Attribute *) attrs_alloc LDAP_P(( int num ));
LDAP_SLAPD_F (int) attr_prealloc LDAP_P(( int num ));
Howard Chu's avatar
Howard Chu committed
281
282
283
284
285
LDAP_SLAPD_F (int) attr_valfind LDAP_P(( Attribute *a,
	unsigned flags,
	struct berval *val,
	unsigned *slot,
	void *ctx ));
286
287
288
289
LDAP_SLAPD_F (int) attr_valadd LDAP_P(( Attribute *a,
	BerVarray vals,
	BerVarray nvals,
	int num ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
290
291
292
293
294
295
296
297
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 ));
298
299
300
301
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 ));
302
303
LDAP_SLAPD_F (int) attr_merge_normalize LDAP_P(( Entry *e,
	AttributeDescription *desc,
Howard Chu's avatar
Howard Chu committed
304
	BerVarray vals, void *memctx ));
305
306
LDAP_SLAPD_F (int) attr_merge_normalize_one LDAP_P(( Entry *e,
	AttributeDescription *desc,
Howard Chu's avatar
Howard Chu committed
307
	struct berval *val, void *memctx ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
308
309
310
311
312
313
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 ));
314

315
316
LDAP_SLAPD_F (void) attrs_free LDAP_P(( Attribute *a ));
LDAP_SLAPD_F (Attribute *) attrs_dup LDAP_P(( Attribute *a ));
317
318
LDAP_SLAPD_F (int) attr_init LDAP_P(( void ));
LDAP_SLAPD_F (int) attr_destroy LDAP_P(( void ));
319

320

Kurt Zeilenga's avatar
Kurt Zeilenga committed
321
322
323
/*
 * ava.c
 */
324
LDAP_SLAPD_F (int) get_ava LDAP_P((
325
	Operation *op,
326
	BerElement *ber,
327
	Filter *f,
328
	unsigned usage,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
329
	const char **text ));
330
LDAP_SLAPD_F (void) ava_free LDAP_P((
331
	Operation *op,
332
333
	AttributeAssertion *ava,
	int freeit ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
334
335
336
337

/*
 * backend.c
 */
338

Luke Howard's avatar
Luke Howard committed
339
340
#define be_match( be1, be2 )	( (be1) == (be2) || \
				  ( (be1) && (be2) && (be1)->be_nsuffix == (be2)->be_nsuffix ) )
341

342
343
344
345
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));
346
LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be, struct config_reply_s *cr));
347
LDAP_SLAPD_F (int) backend_sync LDAP_P((Backend *be));
348
349
LDAP_SLAPD_F (int) backend_shutdown LDAP_P((Backend *be));
LDAP_SLAPD_F (int) backend_destroy LDAP_P((void));
350
LDAP_SLAPD_F (void) backend_stopdown_one LDAP_P((BackendDB *bd ));
Howard Chu's avatar
Howard Chu committed
351
LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd, int dynamic));
352

353
LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
354
LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type,
355
	BackendDB *be, int idx, struct config_reply_s *cr ));
356
357
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));
358

359
LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
360
	struct berval * dn,
361
	int noSubordinates ));
362

Kurt Zeilenga's avatar
Kurt Zeilenga committed
363
LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
364
	struct berval *suffix ));
365
366
LDAP_SLAPD_F (int) be_issubordinate LDAP_P(( Backend *be,
	struct berval *subordinate ));
367
368
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
LDAP_SLAPD_F (int) be_isroot_dn LDAP_P(( Backend *be, struct berval *ndn ));
369
LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
370
LDAP_SLAPD_F (int) be_rootdn_bind LDAP_P(( Operation *op, SlapReply *rs ));
371
372
373
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 ));
374
LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
375
LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
376
LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( Operation *o,
377
378
		struct berval *ndn, ObjectClass *oc,
		AttributeDescription *at, int rw, Entry **e ));
379
380
381
382
383
384
385
386
387
388

/* "backend->ophandler(op,rs)" wrappers, applied by contrib:wrap_slap_ops */
#define SLAP_OP(which, op, rs)  slap_bi_op((op)->o_bd->bd_info, which, op, rs)
#define slap_be_op(be, which, op, rs) slap_bi_op((be)->bd_info, which, op, rs)
#if !(defined(USE_RS_ASSERT) && (USE_RS_ASSERT))
#define slap_bi_op(bi, which, op, rs) ((&(bi)->bi_op_bind)[which](op, rs))
#endif
LDAP_SLAPD_F (int) (slap_bi_op) LDAP_P(( BackendInfo *bi,
	slap_operation_t which, Operation *op, SlapReply *rs ));

389
LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
390
391
392
	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 )
393

394
395
396
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));
397

398
399
400
LDAP_SLAPD_F( int ) backend_check_controls LDAP_P((
	Operation *op,
	SlapReply *rs ));
401
LDAP_SLAPD_F( int )	backend_check_restrictions LDAP_P((
402
	Operation *op,
403
404
	SlapReply *rs,
	struct berval *opdata ));
405

406
LDAP_SLAPD_F( int )	backend_check_referrals LDAP_P((
407
	Operation *op,
408
	SlapReply *rs ));
409

410
LDAP_SLAPD_F (int) backend_group LDAP_P((
411
	Operation *op,
412
	Entry *target,
413
	struct berval *gr_ndn,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
414
	struct berval *op_ndn,
415
416
	ObjectClass *group_oc,
	AttributeDescription *group_at
417
));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
418

419
LDAP_SLAPD_F (int) backend_attribute LDAP_P((
420
421
	Operation *op,
	Entry *target,
422
	struct berval *entry_ndn,
423
	AttributeDescription *entry_at,
424
425
	BerVarray *vals,
	slap_access_t access
426
427
));

428
429
430
431
432
433
434
435
436
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 ));

437
LDAP_SLAPD_F (int) backend_operational LDAP_P((
438
	Operation *op,
439
440
	SlapReply *rs 
));
441

442
443
LDAP_SLAPD_F (ID) backend_tool_entry_first LDAP_P(( BackendDB *be ));

444
445
LDAP_SLAPD_V(BackendInfo) slap_binfo[]; 

446
447
448
449
450
/*
 * backglue.c
 */

LDAP_SLAPD_F (int) glue_sub_init( void );
451
LDAP_SLAPD_F (int) glue_sub_attach( int online );
452
453
454
LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online );
LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );

455
456
457
/*
 * backover.c
 */
Pierangelo Masarati's avatar
Pierangelo Masarati committed
458
LDAP_SLAPD_F (int) overlay_register LDAP_P(( slap_overinst *on ));
459
LDAP_SLAPD_F (int) overlay_config LDAP_P(( BackendDB *be, const char *ov,
460
	int idx, BackendInfo **res, ConfigReply *cr ));
461
462
463
LDAP_SLAPD_F (void) overlay_destroy_one LDAP_P((
	BackendDB *be,
	slap_overinst *on ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
464
465
466
467
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 ));
468
469
470
LDAP_SLAPD_F (int) overlay_register_control LDAP_P((
	BackendDB *be,
	const char *oid ));
471
472
473
474
475
476
LDAP_SLAPD_F (int) overlay_op_walk LDAP_P((
	Operation *op,
	SlapReply *rs,
	slap_operation_t which,
	slap_overinfo *oi,
	slap_overinst *on ));
477
478
479
480
481
482
483
484
485
486
487
488
489
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 ));
490
491
492
493
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 ));
494
495
#ifdef SLAP_CONFIG_DELETE
LDAP_SLAPD_F (void) overlay_remove LDAP_P((
496
	BackendDB *be, slap_overinst *on, Operation *op ));
497
498
499
LDAP_SLAPD_F (void) overlay_unregister_control LDAP_P((
	BackendDB *be,
	const char *oid ));
500
#endif /* SLAP_CONFIG_DELETE */
501
502
503
LDAP_SLAPD_F (int) overlay_callback_after_backover LDAP_P((
	Operation *op, slap_callback *sc, int append ));

504
505
506
507
/*
 * bconfig.c
 */
LDAP_SLAPD_F (int) slap_loglevel_register LDAP_P (( slap_mask_t m, struct berval *s ));
508
LDAP_SLAPD_F (int) slap_loglevel_get LDAP_P(( struct berval *s, int *l ));
509
LDAP_SLAPD_F (int) str2loglevel LDAP_P(( const char *s, int *l ));
510
511
512
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 ));
513
LDAP_SLAPD_F (int) loglevel_print LDAP_P(( FILE *out ));
514
515
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 ));
516

Kurt Zeilenga's avatar
Kurt Zeilenga committed
517
518
519
/*
 * ch_malloc.c
 */
Howard Chu's avatar
Howard Chu committed
520
LDAP_SLAPD_V (BerMemoryFunctions) ch_mfuncs;
521
522
523
524
525
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 * ));
526
527
528

#ifndef CH_FREE
#undef free
529
#define free ch_free
530
#endif
Kurt Zeilenga's avatar
Kurt Zeilenga committed
531

532
533
534
535
536
537
538
539
540
/*
 * compare.c
 */

LDAP_SLAPD_F (int) slap_compare_entry LDAP_P((
	Operation *op,
	Entry *e,
	AttributeAssertion *ava ));

541
542
543
544
/*
 * component.c
 */
#ifdef LDAP_COMP_MATCH
545
546
struct comp_attribute_aliasing;

547
548
549
550
551
LDAP_SLAPD_F (int) test_comp_filter_entry LDAP_P((
	Operation* op,
	Entry* e,
	MatchingRuleAssertion* mr));

552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
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 ));

570
571
572
573
574
575
LDAP_SLAPD_F (int) get_comp_filter LDAP_P((
	Operation* op,
	BerValue* bv,
	ComponentFilter** filt,
	const char **text ));

576
577
578
579
580
581
582
583
584
585
586
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 ));

587
588
589
590
591
592
593
594
LDAP_SLAPD_F (int) componentFilterMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *assertedValue ));

595
596
597
598
599
600
601
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
602
603
604
605
606
607
608
609

LDAP_SLAPD_F (int) allComponentsMatch LDAP_P((
        int *matchp,
        slap_mask_t flags,
        Syntax *syntax,
        MatchingRule *mr,
        struct berval *value,
        void *assertedValue ));
610
611
612
613

LDAP_SLAPD_F (ComponentReference*) dup_comp_ref LDAP_P((
	Operation *op,
	ComponentReference *cr ));
Sang Seok Lim's avatar
Sang Seok Lim committed
614
                                                                          
615
616
617
LDAP_SLAPD_F (int) componentFilterValidate LDAP_P(( 
	Syntax *syntax,
	struct berval* bv ));
Sang Seok Lim's avatar
Sang Seok Lim committed
618
619
620
621

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

623
624
625
626
627
628
LDAP_SLAPD_F (void) component_free LDAP_P((
	ComponentFilter *f ));

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

629
630
631
632
LDAP_SLAPD_V (test_membership_func*) is_aliased_attribute;

LDAP_SLAPD_V (free_component_func*) component_destructor;

633
634
635
636
637
638
639
640
641
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;
642
643
#endif

644
645
646
/*
 * controls.c
 */
Howard Chu's avatar
Howard Chu committed
647
LDAP_SLAPD_V( struct slap_control_ids ) slap_cids;
648
649
650
LDAP_SLAPD_F (void) slap_free_ctrls LDAP_P((
	Operation *op,
	LDAPControl **ctrls ));
651
652
653
654
LDAP_SLAPD_F (int) slap_add_ctrls LDAP_P((
	Operation *op,
	SlapReply *rs,
	LDAPControl **ctrls ));
655
656
657
658
659
LDAP_SLAPD_F (int) slap_parse_ctrl LDAP_P((
	Operation *op,
	SlapReply *rs,
	LDAPControl *control,
	const char **text ));
660
LDAP_SLAPD_F (int) get_ctrls LDAP_P((
661
	Operation *op,
662
	SlapReply *rs,
663
	int senderrors ));
664
665
666
667
668
LDAP_SLAPD_F (int) get_ctrls2 LDAP_P((
	Operation *op,
	SlapReply *rs,
	int senderrors,
	ber_tag_t ctag ));
669
LDAP_SLAPD_F (int) register_supported_control2 LDAP_P((
670
671
672
	const char *controloid,
	slap_mask_t controlmask,
	char **controlexops,
Howard Chu's avatar
Howard Chu committed
673
	SLAP_CTRL_PARSE_FN *controlparsefn,
674
	unsigned flags,
Howard Chu's avatar
Howard Chu committed
675
	int *controlcid ));
676
677
#define register_supported_control(oid, mask, exops, fn, cid) \
	register_supported_control2((oid), (mask), (exops), (fn), 0, (cid))
678
679
680
681
#ifdef SLAP_CONFIG_DELETE
LDAP_SLAPD_F (int) unregister_supported_control LDAP_P((
	const char* controloid ));
#endif /* SLAP_CONFIG_DELETE */
682
LDAP_SLAPD_F (int) register_control_exop LDAP_P (( const char *controloid, char *exopoid ));
683
684
685
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));
686
687
688
689
690
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 ((
691
	Operation *op, const char *oid, int *cid ));
692
693
694
695
696
LDAP_SLAPD_F (int) slap_remove_control LDAP_P((
	Operation	*op,
	SlapReply	*rs,
	int		ctrl,
	BI_chk_controls	fnc ));
697

698
699
700
701
702
703
704
705
706
707
708
709
710
#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 */
711
712
713
714
715
716
717
#ifdef SLAP_CONTROL_X_WHATFAILED
LDAP_SLAPD_F (int)
slap_ctrl_whatFailed_add LDAP_P((
	Operation *op,
	SlapReply *rs,
	char **oids ));
#endif /* SLAP_CONTROL_X_WHATFAILED */
718

Kurt Zeilenga's avatar
Kurt Zeilenga committed
719
720
721
/*
 * config.c
 */
722
LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, const char *dir ));
Howard Chu's avatar
Howard Chu committed
723
LDAP_SLAPD_F (void) config_destroy LDAP_P ((void));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
724
LDAP_SLAPD_F (char **) slap_str2clist LDAP_P((
725
	char ***, char *, const char * ));
Pierangelo Masarati's avatar
Pierangelo Masarati committed
726
727
LDAP_SLAPD_F (int) bverb_to_mask LDAP_P((
	struct berval *bword,  slap_verbmasks *v ));
Howard Chu's avatar
Howard Chu committed
728
729
730
731
732
733
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 ));
734
735
736
737
LDAP_SLAPD_F (int) mask_to_verbstring LDAP_P((
	slap_verbmasks *v, slap_mask_t m, char delim, struct berval *bv ));
LDAP_SLAPD_F (int) verbstring_to_mask LDAP_P((
	slap_verbmasks *v, char *str, char delim, slap_mask_t *m ));
738
739
LDAP_SLAPD_F (int) enum_to_verb LDAP_P((
	slap_verbmasks *v, slap_mask_t m, struct berval *bv ));
740
741
742
743
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 ));
744
745
746
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
747
748
749
750
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
751
752
753
754
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
755
756
LDAP_SLAPD_F (int) bindconf_tls_set LDAP_P((
	slap_bindconf *bc, LDAP *ld ));
Howard Chu's avatar
Howard Chu committed
757
LDAP_SLAPD_F (void) bindconf_free LDAP_P(( slap_bindconf *bc ));
758
LDAP_SLAPD_F (void) slap_client_keepalive LDAP_P(( LDAP *ld, slap_keepalive *sk ));
759
LDAP_SLAPD_F (int) slap_client_connect LDAP_P(( LDAP **ldp, slap_bindconf *sb ));
760
761
LDAP_SLAPD_F (int) config_generic_wrapper LDAP_P(( Backend *be,
	const char *fname, int lineno, int argc, char **argv ));
762
LDAP_SLAPD_F (char *) anlist_unparse LDAP_P(( AttributeName *, char *, ber_len_t buflen ));
763
LDAP_SLAPD_F (int) slap_bv_x_ordered_unparse LDAP_P(( BerVarray in, BerVarray *out ));
764
765
LDAP_SLAPD_F (int) slap_keepalive_parse( struct berval *val, void *bc,
	slap_cf_aux_table *tab0, const char *tabmsg, int unparse );
Howard Chu's avatar
Howard Chu committed
766

767
768
769
770
#ifdef LDAP_SLAPI
LDAP_SLAPD_V (int) slapi_plugins_used;
#endif

Kurt Zeilenga's avatar
Kurt Zeilenga committed
771
772
773
/*
 * connection.c
 */
774
775
776
777
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));
Howard Chu's avatar
Howard Chu committed
778
LDAP_SLAPD_F (void) connections_drop LDAP_P((void));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
779

780
LDAP_SLAPD_F (Connection *) connection_client_setup LDAP_P((
781
782
783
	ber_socket_t s,
	ldap_pvt_thread_start_t *func,
	void *arg ));
784
785
LDAP_SLAPD_F (void) connection_client_enable LDAP_P(( Connection *c ));
LDAP_SLAPD_F (void) connection_client_stop LDAP_P(( Connection *c ));
786

787
788
789
790
791
#ifdef LDAP_PF_LOCAL_SENDMSG
#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)	, arg
#else
#define LDAP_PF_LOCAL_SENDMSG_ARG(arg)
#endif
792

793
LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
794
	ber_socket_t s,
Pierangelo Masarati's avatar
Pierangelo Masarati committed
795
	Listener* url,
Kurt Zeilenga's avatar
Kurt Zeilenga committed
796
797
	const char* dnsname,
	const char* peername,
798
	int use_tls,
799
	slap_ssf_t ssf,
Howard Chu's avatar
Howard Chu committed
800
	struct berval *id
801
	LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
802

803
804
LDAP_SLAPD_F (void) connection_closing LDAP_P((
	Connection *c, const char *why ));
805
LDAP_SLAPD_F (int) connection_valid LDAP_P(( Connection *c ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
806
807
LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
	LDAP_GCCATTR((const));
808

Kurt Zeilenga's avatar
Kurt Zeilenga committed
809
LDAP_SLAPD_F (int) connection_read_activate LDAP_P((ber_socket_t s));
810
LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
811

812
813
814
LDAP_SLAPD_F (void) connection_op_finish LDAP_P((
	Operation *op ));

815
LDAP_SLAPD_F (unsigned long) connections_nextid(void);
816

Kurt Zeilenga's avatar
Kurt Zeilenga committed
817
818
819
LDAP_SLAPD_F (Connection *) connection_first LDAP_P(( ber_socket_t * ));
LDAP_SLAPD_F (Connection *) connection_next LDAP_P((
	Connection *, ber_socket_t *));
820
LDAP_SLAPD_F (void) connection_done LDAP_P((Connection *));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
821

822
LDAP_SLAPD_F (void) connection2anonymous LDAP_P((Connection *));
Howard Chu's avatar
Howard Chu committed
823
824
LDAP_SLAPD_F (void) connection_fake_init LDAP_P((
	Connection *conn,
825
	OperationBuffer *opbuf,
Howard Chu's avatar
Howard Chu committed
826
	void *threadctx ));
827
828
LDAP_SLAPD_F (void) connection_fake_init2 LDAP_P((
	Connection *conn,
829
	OperationBuffer *opbuf,
830
831
	void *threadctx,
	int newmem ));
832
833
834
835
836
LDAP_SLAPD_F (void) operation_fake_init LDAP_P((
	Connection *conn,
	Operation *op,
	void *threadctx,
	int newmem ));
837
LDAP_SLAPD_F (void) connection_assign_nextid LDAP_P((Connection *));
838

839
840
841
842
/*
 * cr.c
 */
LDAP_SLAPD_F (int) cr_schema_info( Entry *e );
Howard Chu's avatar
Howard Chu committed
843
844
LDAP_SLAPD_F (void) cr_unparse LDAP_P((
	BerVarray *bva, ContentRule *start, ContentRule *end, int system ));
845
846
847
848

LDAP_SLAPD_F (int) cr_add LDAP_P((
	LDAPContentRule *oc,
	int user,
Howard Chu's avatar
Howard Chu committed
849
	ContentRule **scr,
850
	const char **err));
Howard Chu's avatar
Howard Chu committed
851

852
853
854
855
856
857
858
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
859
860
861
862
/*
 * ctxcsn.c
 */

863
LDAP_SLAPD_V( int ) slap_serverID;
864
865
LDAP_SLAPD_V( const struct berval ) slap_ldapsync_bv;
LDAP_SLAPD_V( const struct berval ) slap_ldapsync_cn_bv;
866
LDAP_SLAPD_F (void) slap_get_commit_csn LDAP_P((
867
	Operation *, struct berval *maxcsn, int *foundit ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
868
869
LDAP_SLAPD_F (void) slap_rewind_commit_csn LDAP_P(( Operation * ));
LDAP_SLAPD_F (void) slap_graduate_commit_csn LDAP_P(( Operation * ));
870
LDAP_SLAPD_F (Entry *) slap_create_context_csn_entry LDAP_P(( Backend *, struct berval *));
Howard Chu's avatar
Howard Chu committed
871
LDAP_SLAPD_F (int) slap_get_csn LDAP_P(( Operation *, struct berval *, int ));
872
LDAP_SLAPD_F (void) slap_queue_csn LDAP_P(( Operation *, struct berval * ));
Jong Hyuk Choi's avatar
Jong Hyuk Choi committed
873

Kurt Zeilenga's avatar
Kurt Zeilenga committed
874
/*
Kurt Zeilenga's avatar
Kurt Zeilenga committed
875
 * daemon.c
Kurt Zeilenga's avatar
Kurt Zeilenga committed
876
 */
877
LDAP_SLAPD_F (void) slapd_add_internal(ber_socket_t s, int isactive);
Kurt Zeilenga's avatar
Kurt Zeilenga committed
878
879
880
881
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));
882
883
LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, Sockbuf *sb,
	int wasactive, int wake, int locked ));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
884

Kurt Zeilenga's avatar
Kurt Zeilenga committed
885
886
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
887
LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
Kurt Zeilenga's avatar
Kurt Zeilenga committed
888

Howard Chu's avatar
Howard Chu committed
889
890
891
LDAP_SLAPD_F (void) slap_suspend_listeners LDAP_P((void));
LDAP_SLAPD_F (void) slap_resume_listeners LDAP_P((void));

892
893
894
LDAP_SLAPD_F (int) slap_pause_server LDAP_P((void));
LDAP_SLAPD_F (int) slap_unpause_server LDAP_P((void));

Kurt Zeilenga's avatar
Kurt Zeilenga committed
895
896
897
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));
898
LDAP_SLAPD_F (int) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
Howard Chu's avatar
Howard Chu committed
899
900
LDAP_SLAPD_F (int) slapd_wait_writer( ber_socket_t sd );
LDAP_SLAPD_F (void) slapd_shutsock( ber_socket_t sd );
Kurt Zeilenga's avatar
Kurt Zeilenga committed
901

902
903
904
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;
905
LDAP_SLAPD_V (const char *) slapd_slp_attrs;
906
LDAP_SLAPD_V (slap_ssf_t) local_ssf;
907
LDAP_SLAPD_V (struct runqueue_s) slapd_rq;
908
909
LDAP_SLAPD_V (int) slapd_daemon_threads;
LDAP_SLAPD_V (int) slapd_daemon_mask;
910
911
912
913
#ifdef LDAP_TCP_BUFFER
LDAP_SLAPD_V (int) slapd_tcp_rmem;
LDAP_SLAPD_V (int) slapd_tcp_wmem;
#endif /* LDAP_TCP_BUFFER */
914

915
916
917
918
919
920
921
922
923
924
925
926
927
#ifdef HAVE_WINSOCK
LDAP_SLAPD_F (ber_socket_t) slapd_socknew(ber_socket_t s);
LDAP_SLAPD_F (ber_socket_t) slapd_sock2fd(ber_socket_t s);
LDAP_SLAPD_V (SOCKET *) slapd_ws_sockets;
#define	SLAP_FD2SOCK(s)	slapd_ws_sockets[s]
#define	SLAP_SOCK2FD(s)	slapd_sock2fd(s)
#define	SLAP_SOCKNEW(s)	slapd_socknew(s)
#else
#define	SLAP_FD2SOCK(s)	s
#define	SLAP_SOCK2FD(s)	s
#define	SLAP_SOCKNEW(s)	s
#endif

Kurt Zeilenga's avatar
Kurt Zeilenga committed
928
929
930
/*
 * dn.c
 */
931

932
#define dn_match(dn1, dn2) 	( ber_bvcmp((dn1), (dn2)) == 0 )
933
#define bvmatch(bv1, bv2)	( ((bv1)->bv_len == (bv2)->bv_len) && (memcmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
934

935
936
937
LDAP_SLAPD_F (int) dnValidate LDAP_P((
	Syntax *syntax, 
	struct berval *val ));
938
939
940
LDAP_SLAPD_F (int) rdnValidate LDAP_P((
	Syntax *syntax, 
	struct berval *val ));
941

Howard Chu's avatar
Howard Chu committed
942
LDAP_SLAPD_F (slap_mr_normalize_func) dnNormalize;
943

944
945
LDAP_SLAPD_F (slap_mr_normalize_func) rdnNormalize;

Kurt Zeilenga's avatar
Kurt Zeilenga committed
946
LDAP_SLAPD_F (slap_syntax_transform_func) dnPretty;
947

948
949
LDAP_SLAPD_F (slap_syntax_transform_func) rdnPretty;

950
951
952
953
LDAP_SLAPD_F (int) dnPrettyNormal LDAP_P(( 
	Syntax *syntax, 
	struct berval *val, 
	struct berval *pretty,
Howard Chu's avatar
Howard Chu committed
954
955
	struct berval *normal,
	void *ctx ));
956

957
958
959
960
961
962
963
964
LDAP_SLAPD_F (int) dnMatch LDAP_P(( 
	int *matchp, 
	slap_mask_t flags, 
	Syntax *syntax, 
	MatchingRule *mr,
	struct berval *value, 
	void *