Back to index

openldap  2.4.31
proto-slap.h
Go to the documentation of this file.
00001 /* $OpenLDAP$ */
00002 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00003  *
00004  * Copyright 1998-2012 The OpenLDAP Foundation.
00005  * All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted only as authorized by the OpenLDAP
00009  * Public License.
00010  *
00011  * A copy of this license is available in the file LICENSE in the
00012  * top-level directory of the distribution or, alternatively, at
00013  * <http://www.OpenLDAP.org/license.html>.
00014  */
00015 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
00016  * All rights reserved.
00017  *
00018  * Redistribution and use in source and binary forms are permitted
00019  * provided that this notice is preserved and that due credit is given
00020  * to the University of Michigan at Ann Arbor. The name of the University
00021  * may not be used to endorse or promote products derived from this
00022  * software without specific prior written permission. This software
00023  * is provided ``as is'' without express or implied warranty.
00024  */
00025 
00026 #ifndef PROTO_SLAP_H
00027 #define PROTO_SLAP_H
00028 
00029 #include <ldap_cdefs.h>
00030 #include "ldap_pvt.h"
00031 
00032 LDAP_BEGIN_DECL
00033 
00034 struct config_args_s;       /* config.h */
00035 struct config_reply_s;      /* config.h */
00036 
00037 /*
00038  * aci.c
00039  */
00040 #ifdef SLAP_DYNACL
00041 #ifdef SLAPD_ACI_ENABLED
00042 LDAP_SLAPD_F (int) dynacl_aci_init LDAP_P(( void ));
00043 #endif /* SLAPD_ACI_ENABLED */
00044 #endif /* SLAP_DYNACL */
00045 
00046 /*
00047  * acl.c
00048  */
00049 LDAP_SLAPD_F (int) access_allowed_mask LDAP_P((
00050        Operation *op,
00051        Entry *e, AttributeDescription *desc, struct berval *val,
00052        slap_access_t access,
00053        AccessControlState *state,
00054        slap_mask_t *mask ));
00055 #define access_allowed(op,e,desc,val,access,state) access_allowed_mask(op,e,desc,val,access,state,NULL)
00056 LDAP_SLAPD_F (int) slap_access_allowed LDAP_P((
00057        Operation            *op,
00058        Entry                *e,
00059        AttributeDescription *desc,
00060        struct berval        *val,
00061        slap_access_t        access,
00062        AccessControlState   *state,
00063        slap_mask_t          *maskp ));
00064 LDAP_SLAPD_F (int) slap_access_always_allowed LDAP_P((
00065        Operation            *op,
00066        Entry                *e,
00067        AttributeDescription *desc,
00068        struct berval        *val,
00069        slap_access_t        access,
00070        AccessControlState   *state,
00071        slap_mask_t          *maskp ));
00072 
00073 LDAP_SLAPD_F (int) acl_check_modlist LDAP_P((
00074        Operation *op, Entry *e, Modifications *ml ));
00075 
00076 LDAP_SLAPD_F (void) acl_append( AccessControl **l, AccessControl *a, int pos );
00077 
00078 #ifdef SLAP_DYNACL
00079 LDAP_SLAPD_F (int) slap_dynacl_register LDAP_P(( slap_dynacl_t *da ));
00080 LDAP_SLAPD_F (slap_dynacl_t *) slap_dynacl_get LDAP_P(( const char *name ));
00081 #endif /* SLAP_DYNACL */
00082 LDAP_SLAPD_F (int) acl_init LDAP_P(( void ));
00083 
00084 LDAP_SLAPD_F (int) acl_get_part LDAP_P((
00085        struct berval *list,
00086        int           ix,
00087        char          sep,
00088        struct berval *bv ));
00089 LDAP_SLAPD_F (int) acl_match_set LDAP_P((
00090        struct berval *subj,
00091        Operation *op,
00092        Entry *e,
00093        struct berval *default_set_attribute ));
00094 LDAP_SLAPD_F (int) acl_string_expand LDAP_P((
00095        struct berval *newbuf, struct berval *pattern,
00096        struct berval *dnmatch, struct berval *valmatch, AclRegexMatches *matches ));
00097 
00098 /*
00099  * aclparse.c
00100  */
00101 LDAP_SLAPD_V (LDAP_CONST char *) style_strings[];
00102 
00103 LDAP_SLAPD_F (int) parse_acl LDAP_P(( Backend *be,
00104        const char *fname, int lineno,
00105        int argc, char **argv, int pos ));
00106 
00107 LDAP_SLAPD_F (char *) access2str LDAP_P(( slap_access_t access ));
00108 LDAP_SLAPD_F (slap_access_t) str2access LDAP_P(( const char *str ));
00109 
00110 #define ACCESSMASK_MAXLEN   sizeof("unknown (+wrscan)")
00111 LDAP_SLAPD_F (char *) accessmask2str LDAP_P(( slap_mask_t mask, char*, int debug ));
00112 LDAP_SLAPD_F (slap_mask_t) str2accessmask LDAP_P(( const char *str ));
00113 LDAP_SLAPD_F (void) acl_unparse LDAP_P(( AccessControl*, struct berval* ));
00114 LDAP_SLAPD_F (void) acl_destroy LDAP_P(( AccessControl* ));
00115 LDAP_SLAPD_F (void) acl_free LDAP_P(( AccessControl *a ));
00116 
00117 
00118 /*
00119  * ad.c
00120  */
00121 LDAP_SLAPD_F (int) slap_str2ad LDAP_P((
00122        const char *,
00123        AttributeDescription **ad,
00124        const char **text ));
00125 
00126 LDAP_SLAPD_F (int) slap_bv2ad LDAP_P((
00127        struct berval *bv,
00128        AttributeDescription **ad,
00129        const char **text ));
00130 
00131 LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * ));
00132 LDAP_SLAPD_F (int) ad_keystring LDAP_P(( struct berval *bv ));
00133 
00134 #define ad_cmp(l,r)  (((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \
00135        ? -1 : (((l)->ad_cname.bv_len > (r)->ad_cname.bv_len) \
00136               ? 1 : strcasecmp((l)->ad_cname.bv_val, (r)->ad_cname.bv_val )))
00137 
00138 LDAP_SLAPD_F (int) is_ad_subtype LDAP_P((
00139        AttributeDescription *sub,
00140        AttributeDescription *super ));
00141 
00142 LDAP_SLAPD_F (int) ad_inlist LDAP_P((
00143        AttributeDescription *desc,
00144        AttributeName *attrs ));
00145 
00146 LDAP_SLAPD_F (int) slap_str2undef_ad LDAP_P((
00147        const char *,
00148        AttributeDescription **ad,
00149        const char **text,
00150        unsigned proxied ));
00151 
00152 LDAP_SLAPD_F (int) slap_bv2undef_ad LDAP_P((
00153        struct berval *bv,
00154        AttributeDescription **ad,
00155        const char **text,
00156        unsigned proxied ));
00157 
00158 LDAP_SLAPD_F (AttributeDescription *) slap_bv2tmp_ad LDAP_P((
00159        struct berval *bv,
00160        void *memctx ));
00161 
00162 LDAP_SLAPD_F (int) slap_ad_undef_promote LDAP_P((
00163        char *name,
00164        AttributeType *nat ));
00165 
00166 LDAP_SLAPD_F (AttributeDescription *) ad_find_tags LDAP_P((
00167        AttributeType *type,
00168        struct berval *tags ));
00169 
00170 LDAP_SLAPD_F (AttributeName *) str2anlist LDAP_P(( AttributeName *an,
00171        char *str, const char *brkstr ));
00172 LDAP_SLAPD_F (void) anlist_free LDAP_P(( AttributeName *an,
00173        int freename, void *ctx ));
00174 
00175 LDAP_SLAPD_F (char **) anlist2charray_x LDAP_P((
00176                                                                AttributeName *an, int dup, void *ctx ));
00177 LDAP_SLAPD_F (char **) anlist2charray LDAP_P(( AttributeName *an, int dup ));
00178 LDAP_SLAPD_F (char **) anlist2attrs LDAP_P(( AttributeName *anlist ));
00179 LDAP_SLAPD_F (AttributeName *) file2anlist LDAP_P((
00180                         AttributeName *, const char *, const char * ));
00181 LDAP_SLAPD_F (int) an_find LDAP_P(( AttributeName *a, struct berval *s ));
00182 LDAP_SLAPD_F (int) ad_define_option LDAP_P(( const char *name,
00183        const char *fname, int lineno ));
00184 LDAP_SLAPD_F (void) ad_unparse_options LDAP_P(( BerVarray *res ));
00185 
00186 LDAP_SLAPD_F (MatchingRule *) ad_mr(
00187        AttributeDescription *ad,
00188        unsigned usage );
00189 
00190 LDAP_SLAPD_V( AttributeName * ) slap_anlist_no_attrs;
00191 LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_user_attributes;
00192 LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_operational_attributes;
00193 LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_attributes;
00194 
00195 LDAP_SLAPD_V( struct berval * ) slap_bv_no_attrs;
00196 LDAP_SLAPD_V( struct berval * ) slap_bv_all_user_attrs;
00197 LDAP_SLAPD_V( struct berval * ) slap_bv_all_operational_attrs;
00198 
00199 /* deprecated; only defined for backward compatibility */
00200 #define NoAttrs             (*slap_bv_no_attrs)
00201 #define AllUser             (*slap_bv_all_user_attrs)
00202 #define AllOper             (*slap_bv_all_operational_attrs)
00203 
00204 /*
00205  * add.c
00206  */
00207 LDAP_SLAPD_F (int) slap_mods2entry LDAP_P(( Modifications *mods, Entry **e,
00208        int initial, int dup, const char **text, char *textbuf, size_t textlen ));
00209 
00210 LDAP_SLAPD_F (int) slap_entry2mods LDAP_P(( Entry *e,
00211                                           Modifications **mods, const char **text,
00212                                           char *textbuf, size_t textlen ));
00213 LDAP_SLAPD_F( int ) slap_add_opattrs(
00214        Operation *op,
00215        const char **text,
00216        char *textbuf, size_t textlen,
00217        int manage_ctxcsn );
00218 
00219 
00220 /*
00221  * at.c
00222  */
00223 LDAP_SLAPD_V(int) at_oc_cache;
00224 LDAP_SLAPD_F (void) at_config LDAP_P((
00225        const char *fname, int lineno,
00226        int argc, char **argv ));
00227 LDAP_SLAPD_F (AttributeType *) at_find LDAP_P((
00228        const char *name ));
00229 LDAP_SLAPD_F (AttributeType *) at_bvfind LDAP_P((
00230        struct berval *name ));
00231 LDAP_SLAPD_F (int) at_find_in_list LDAP_P((
00232        AttributeType *sat, AttributeType **list ));
00233 LDAP_SLAPD_F (int) at_append_to_list LDAP_P((
00234        AttributeType *sat, AttributeType ***listp ));
00235 LDAP_SLAPD_F (int) at_delete_from_list LDAP_P((
00236        int pos, AttributeType ***listp ));
00237 LDAP_SLAPD_F (int) at_schema_info LDAP_P(( Entry *e ));
00238 LDAP_SLAPD_F (int) at_add LDAP_P((
00239        LDAPAttributeType *at, int user,
00240        AttributeType **sat, AttributeType *prev, const char **err ));
00241 LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
00242 
00243 LDAP_SLAPD_F (int) is_at_subtype LDAP_P((
00244        AttributeType *sub,
00245        AttributeType *super ));
00246 
00247 LDAP_SLAPD_F (const char *) at_syntax LDAP_P((
00248        AttributeType *at ));
00249 LDAP_SLAPD_F (int) is_at_syntax LDAP_P((
00250        AttributeType *at,
00251        const char *oid ));
00252 
00253 LDAP_SLAPD_F (int) at_start LDAP_P(( AttributeType **at ));
00254 LDAP_SLAPD_F (int) at_next LDAP_P(( AttributeType **at ));
00255 LDAP_SLAPD_F (void) at_delete LDAP_P(( AttributeType *at ));
00256 
00257 LDAP_SLAPD_F (void) at_unparse LDAP_P((
00258        BerVarray *bva, AttributeType *start, AttributeType *end, int system ));
00259 
00260 LDAP_SLAPD_F (int) register_at LDAP_P((
00261        const char *at,
00262        AttributeDescription **ad,
00263        int dupok ));
00264 
00265 /*
00266  * attr.c
00267  */
00268 LDAP_SLAPD_F (void) attr_free LDAP_P(( Attribute *a ));
00269 LDAP_SLAPD_F (Attribute *) attr_dup LDAP_P(( Attribute *a ));
00270 
00271 #ifdef LDAP_COMP_MATCH
00272 LDAP_SLAPD_F (void) comp_tree_free LDAP_P(( Attribute *a ));
00273 #endif
00274 
00275 #define attr_mergeit( e, d, v ) attr_merge( e, d, v, NULL /* FIXME */ )
00276 #define attr_mergeit_one( e, d, v ) attr_merge_one( e, d, v, NULL /* FIXME */ )
00277 
00278 LDAP_SLAPD_F (Attribute *) attr_alloc LDAP_P(( AttributeDescription *ad ));
00279 LDAP_SLAPD_F (Attribute *) attrs_alloc LDAP_P(( int num ));
00280 LDAP_SLAPD_F (int) attr_prealloc LDAP_P(( int num ));
00281 LDAP_SLAPD_F (int) attr_valfind LDAP_P(( Attribute *a,
00282        unsigned flags,
00283        struct berval *val,
00284        unsigned *slot,
00285        void *ctx ));
00286 LDAP_SLAPD_F (int) attr_valadd LDAP_P(( Attribute *a,
00287        BerVarray vals,
00288        BerVarray nvals,
00289        int num ));
00290 LDAP_SLAPD_F (int) attr_merge LDAP_P(( Entry *e,
00291        AttributeDescription *desc,
00292        BerVarray vals,
00293        BerVarray nvals ));
00294 LDAP_SLAPD_F (int) attr_merge_one LDAP_P(( Entry *e,
00295        AttributeDescription *desc,
00296        struct berval *val,
00297        struct berval *nval ));
00298 LDAP_SLAPD_F (int) attr_normalize LDAP_P(( AttributeDescription *desc,
00299        BerVarray vals, BerVarray *nvalsp, void *memctx ));
00300 LDAP_SLAPD_F (int) attr_normalize_one LDAP_P(( AttributeDescription *desc,
00301        struct berval *val, struct berval *nval, void *memctx ));
00302 LDAP_SLAPD_F (int) attr_merge_normalize LDAP_P(( Entry *e,
00303        AttributeDescription *desc,
00304        BerVarray vals, void *memctx ));
00305 LDAP_SLAPD_F (int) attr_merge_normalize_one LDAP_P(( Entry *e,
00306        AttributeDescription *desc,
00307        struct berval *val, void *memctx ));
00308 LDAP_SLAPD_F (Attribute *) attrs_find LDAP_P((
00309        Attribute *a, AttributeDescription *desc ));
00310 LDAP_SLAPD_F (Attribute *) attr_find LDAP_P((
00311        Attribute *a, AttributeDescription *desc ));
00312 LDAP_SLAPD_F (int) attr_delete LDAP_P((
00313        Attribute **attrs, AttributeDescription *desc ));
00314 
00315 LDAP_SLAPD_F (void) attrs_free LDAP_P(( Attribute *a ));
00316 LDAP_SLAPD_F (Attribute *) attrs_dup LDAP_P(( Attribute *a ));
00317 LDAP_SLAPD_F (int) attr_init LDAP_P(( void ));
00318 LDAP_SLAPD_F (int) attr_destroy LDAP_P(( void ));
00319 
00320 
00321 /*
00322  * ava.c
00323  */
00324 LDAP_SLAPD_F (int) get_ava LDAP_P((
00325        Operation *op,
00326        BerElement *ber,
00327        Filter *f,
00328        unsigned usage,
00329        const char **text ));
00330 LDAP_SLAPD_F (void) ava_free LDAP_P((
00331        Operation *op,
00332        AttributeAssertion *ava,
00333        int freeit ));
00334 
00335 /*
00336  * backend.c
00337  */
00338 
00339 #define be_match( be1, be2 )       ( (be1) == (be2) || \
00340                               ( (be1) && (be2) && (be1)->be_nsuffix == (be2)->be_nsuffix ) )
00341 
00342 LDAP_SLAPD_F (int) backend_init LDAP_P((void));
00343 LDAP_SLAPD_F (int) backend_add LDAP_P((BackendInfo *aBackendInfo));
00344 LDAP_SLAPD_F (int) backend_num LDAP_P((Backend *be));
00345 LDAP_SLAPD_F (int) backend_startup LDAP_P((Backend *be));
00346 LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be, struct config_reply_s *cr));
00347 LDAP_SLAPD_F (int) backend_sync LDAP_P((Backend *be));
00348 LDAP_SLAPD_F (int) backend_shutdown LDAP_P((Backend *be));
00349 LDAP_SLAPD_F (int) backend_destroy LDAP_P((void));
00350 LDAP_SLAPD_F (void) backend_stopdown_one LDAP_P((BackendDB *bd ));
00351 LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd, int dynamic));
00352 
00353 LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
00354 LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type,
00355        BackendDB *be, int idx, struct config_reply_s *cr ));
00356 LDAP_SLAPD_F (void) backend_db_insert LDAP_P((BackendDB *bd, int idx));
00357 LDAP_SLAPD_F (void) backend_db_move LDAP_P((BackendDB *bd, int idx));
00358 
00359 LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
00360        struct berval * dn,
00361        int noSubordinates ));
00362 
00363 LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
00364        struct berval *suffix ));
00365 LDAP_SLAPD_F (int) be_issubordinate LDAP_P(( Backend *be,
00366        struct berval *subordinate ));
00367 LDAP_SLAPD_F (int) be_isroot LDAP_P(( Operation *op ));
00368 LDAP_SLAPD_F (int) be_isroot_dn LDAP_P(( Backend *be, struct berval *ndn ));
00369 LDAP_SLAPD_F (int) be_isroot_pw LDAP_P(( Operation *op ));
00370 LDAP_SLAPD_F (int) be_rootdn_bind LDAP_P(( Operation *op, SlapReply *rs ));
00371 LDAP_SLAPD_F (int) be_slurp_update LDAP_P(( Operation *op ));
00372 #define be_isupdate( op ) be_slurp_update( (op) )
00373 LDAP_SLAPD_F (int) be_shadow_update LDAP_P(( Operation *op ));
00374 LDAP_SLAPD_F (int) be_isupdate_dn LDAP_P(( Backend *be, struct berval *ndn ));
00375 LDAP_SLAPD_F (struct berval *) be_root_dn LDAP_P(( Backend *be ));
00376 LDAP_SLAPD_F (int) be_entry_get_rw LDAP_P(( Operation *o,
00377               struct berval *ndn, ObjectClass *oc,
00378               AttributeDescription *at, int rw, Entry **e ));
00379 LDAP_SLAPD_F (int) be_entry_release_rw LDAP_P((
00380        Operation *o, Entry *e, int rw ));
00381 #define be_entry_release_r( o, e ) be_entry_release_rw( o, e, 0 )
00382 #define be_entry_release_w( o, e ) be_entry_release_rw( o, e, 1 )
00383 
00384 LDAP_SLAPD_F (int) backend_unbind LDAP_P((Operation *op, SlapReply *rs));
00385 LDAP_SLAPD_F (int) backend_connection_init LDAP_P((Connection *conn));
00386 LDAP_SLAPD_F (int) backend_connection_destroy LDAP_P((Connection *conn));
00387 
00388 LDAP_SLAPD_F( int ) backend_check_controls LDAP_P((
00389        Operation *op,
00390        SlapReply *rs ));
00391 LDAP_SLAPD_F( int )  backend_check_restrictions LDAP_P((
00392        Operation *op,
00393        SlapReply *rs,
00394        struct berval *opdata ));
00395 
00396 LDAP_SLAPD_F( int )  backend_check_referrals LDAP_P((
00397        Operation *op,
00398        SlapReply *rs ));
00399 
00400 LDAP_SLAPD_F (int) backend_group LDAP_P((
00401        Operation *op,
00402        Entry *target,
00403        struct berval *gr_ndn,
00404        struct berval *op_ndn,
00405        ObjectClass *group_oc,
00406        AttributeDescription *group_at
00407 ));
00408 
00409 LDAP_SLAPD_F (int) backend_attribute LDAP_P((
00410        Operation *op,
00411        Entry *target,
00412        struct berval *entry_ndn,
00413        AttributeDescription *entry_at,
00414        BerVarray *vals,
00415        slap_access_t access
00416 ));
00417 
00418 LDAP_SLAPD_F (int) backend_access LDAP_P((
00419        Operation            *op,
00420        Entry                *target,
00421        struct berval        *edn,
00422        AttributeDescription *entry_at,
00423        struct berval        *nval,
00424        slap_access_t        access,
00425        slap_mask_t          *mask ));
00426 
00427 LDAP_SLAPD_F (int) backend_operational LDAP_P((
00428        Operation *op,
00429        SlapReply *rs 
00430 ));
00431 
00432 LDAP_SLAPD_F (ID) backend_tool_entry_first LDAP_P(( BackendDB *be ));
00433 
00434 LDAP_SLAPD_V(BackendInfo) slap_binfo[]; 
00435 
00436 /*
00437  * backglue.c
00438  */
00439 
00440 LDAP_SLAPD_F (int) glue_sub_init( void );
00441 LDAP_SLAPD_F (int) glue_sub_attach( int online );
00442 LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online );
00443 LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );
00444 
00445 /*
00446  * backover.c
00447  */
00448 LDAP_SLAPD_F (int) overlay_register LDAP_P(( slap_overinst *on ));
00449 LDAP_SLAPD_F (int) overlay_config LDAP_P(( BackendDB *be, const char *ov,
00450        int idx, BackendInfo **res, ConfigReply *cr ));
00451 LDAP_SLAPD_F (void) overlay_destroy_one LDAP_P((
00452        BackendDB *be,
00453        slap_overinst *on ));
00454 LDAP_SLAPD_F (slap_overinst *) overlay_next LDAP_P(( slap_overinst *on ));
00455 LDAP_SLAPD_F (slap_overinst *) overlay_find LDAP_P(( const char *name ));
00456 LDAP_SLAPD_F (int) overlay_is_over LDAP_P(( BackendDB *be ));
00457 LDAP_SLAPD_F (int) overlay_is_inst LDAP_P(( BackendDB *be, const char *name ));
00458 LDAP_SLAPD_F (int) overlay_register_control LDAP_P((
00459        BackendDB *be,
00460        const char *oid ));
00461 LDAP_SLAPD_F (int) overlay_op_walk LDAP_P((
00462        Operation *op,
00463        SlapReply *rs,
00464        slap_operation_t which,
00465        slap_overinfo *oi,
00466        slap_overinst *on ));
00467 LDAP_SLAPD_F (int) overlay_entry_get_ov LDAP_P((
00468        Operation *op,
00469        struct berval *dn,
00470        ObjectClass *oc,
00471        AttributeDescription *ad,
00472        int rw,
00473        Entry **e,
00474        slap_overinst *ov ));
00475 LDAP_SLAPD_F (int) overlay_entry_release_ov LDAP_P((
00476        Operation *op,
00477        Entry *e,
00478        int rw,
00479        slap_overinst *ov ));
00480 LDAP_SLAPD_F (void) overlay_insert LDAP_P((
00481        BackendDB *be, slap_overinst *on, slap_overinst ***prev, int idx ));
00482 LDAP_SLAPD_F (void) overlay_move LDAP_P((
00483        BackendDB *be, slap_overinst *on, int idx ));
00484 #ifdef SLAP_CONFIG_DELETE
00485 LDAP_SLAPD_F (void) overlay_remove LDAP_P((
00486        BackendDB *be, slap_overinst *on, Operation *op ));
00487 LDAP_SLAPD_F (void) overlay_unregister_control LDAP_P((
00488        BackendDB *be,
00489        const char *oid ));
00490 #endif /* SLAP_CONFIG_DELETE */
00491 LDAP_SLAPD_F (int) overlay_callback_after_backover LDAP_P((
00492        Operation *op, slap_callback *sc, int append ));
00493 
00494 /*
00495  * bconfig.c
00496  */
00497 LDAP_SLAPD_F (int) slap_loglevel_register LDAP_P (( slap_mask_t m, struct berval *s ));
00498 LDAP_SLAPD_F (int) slap_loglevel_get LDAP_P(( struct berval *s, int *l ));
00499 LDAP_SLAPD_F (int) str2loglevel LDAP_P(( const char *s, int *l ));
00500 LDAP_SLAPD_F (int) loglevel2bvarray LDAP_P(( int l, BerVarray *bva ));
00501 LDAP_SLAPD_F (const char *) loglevel2str LDAP_P(( int l ));
00502 LDAP_SLAPD_F (int) loglevel2bv LDAP_P(( int l, struct berval *bv ));
00503 LDAP_SLAPD_F (int) loglevel_print LDAP_P(( FILE *out ));
00504 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 ));
00505 LDAP_SLAPD_F (int) slap_cf_aux_table_unparse LDAP_P(( void *bc, struct berval *bv, slap_cf_aux_table *tab0 ));
00506 
00507 /*
00508  * ch_malloc.c
00509  */
00510 LDAP_SLAPD_V (BerMemoryFunctions) ch_mfuncs;
00511 LDAP_SLAPD_F (void *) ch_malloc LDAP_P(( ber_len_t size ));
00512 LDAP_SLAPD_F (void *) ch_realloc LDAP_P(( void *block, ber_len_t size ));
00513 LDAP_SLAPD_F (void *) ch_calloc LDAP_P(( ber_len_t nelem, ber_len_t size ));
00514 LDAP_SLAPD_F (char *) ch_strdup LDAP_P(( const char *string ));
00515 LDAP_SLAPD_F (void) ch_free LDAP_P(( void * ));
00516 
00517 #ifndef CH_FREE
00518 #undef free
00519 #define free ch_free
00520 #endif
00521 
00522 /*
00523  * compare.c
00524  */
00525 
00526 LDAP_SLAPD_F (int) slap_compare_entry LDAP_P((
00527        Operation *op,
00528        Entry *e,
00529        AttributeAssertion *ava ));
00530 
00531 /*
00532  * component.c
00533  */
00534 #ifdef LDAP_COMP_MATCH
00535 struct comp_attribute_aliasing;
00536 
00537 LDAP_SLAPD_F (int) test_comp_filter_entry LDAP_P((
00538        Operation* op,
00539        Entry* e,
00540        MatchingRuleAssertion* mr));
00541 
00542 LDAP_SLAPD_F (int) dup_comp_filter LDAP_P((
00543        Operation* op,
00544        struct berval *bv,
00545        ComponentFilter *in_f,
00546        ComponentFilter **out_f ));
00547 
00548 LDAP_SLAPD_F (int) get_aliased_filter_aa LDAP_P((
00549        Operation* op,
00550        AttributeAssertion* a_assert,
00551        struct comp_attribute_aliasing* aa,
00552        const char** text ));
00553 
00554 LDAP_SLAPD_F (int) get_aliased_filter LDAP_P((
00555        Operation* op,
00556        MatchingRuleAssertion* ma,
00557        struct comp_attribute_aliasing* aa,
00558        const char** text ));
00559 
00560 LDAP_SLAPD_F (int) get_comp_filter LDAP_P((
00561        Operation* op,
00562        BerValue* bv,
00563        ComponentFilter** filt,
00564        const char **text ));
00565 
00566 LDAP_SLAPD_F (int) insert_component_reference LDAP_P((
00567        ComponentReference *cr,
00568        ComponentReference** cr_list ));
00569 
00570 LDAP_SLAPD_F (int) is_component_reference LDAP_P((
00571        char *attr ));
00572 
00573 LDAP_SLAPD_F (int) extract_component_reference LDAP_P((
00574        char* attr,
00575        ComponentReference** cr ));
00576 
00577 LDAP_SLAPD_F (int) componentFilterMatch LDAP_P(( 
00578        int *matchp, 
00579        slap_mask_t flags, 
00580        Syntax *syntax, 
00581        MatchingRule *mr,
00582        struct berval *value, 
00583        void *assertedValue ));
00584 
00585 LDAP_SLAPD_F (int) directoryComponentsMatch LDAP_P((
00586         int *matchp,
00587         slap_mask_t flags,
00588         Syntax *syntax,
00589         MatchingRule *mr,
00590         struct berval *value,
00591         void *assertedValue ));
00592 
00593 LDAP_SLAPD_F (int) allComponentsMatch LDAP_P((
00594         int *matchp,
00595         slap_mask_t flags,
00596         Syntax *syntax,
00597         MatchingRule *mr,
00598         struct berval *value,
00599         void *assertedValue ));
00600 
00601 LDAP_SLAPD_F (ComponentReference*) dup_comp_ref LDAP_P((
00602        Operation *op,
00603        ComponentReference *cr ));
00604                                                                           
00605 LDAP_SLAPD_F (int) componentFilterValidate LDAP_P(( 
00606        Syntax *syntax,
00607        struct berval* bv ));
00608 
00609 LDAP_SLAPD_F (int) allComponentsValidate LDAP_P((
00610         Syntax *syntax,
00611         struct berval* bv ));
00612 
00613 LDAP_SLAPD_F (void) component_free LDAP_P((
00614        ComponentFilter *f ));
00615 
00616 LDAP_SLAPD_F (void) free_ComponentData LDAP_P((
00617        Attribute *a ));
00618 
00619 LDAP_SLAPD_V (test_membership_func*) is_aliased_attribute;
00620 
00621 LDAP_SLAPD_V (free_component_func*) component_destructor;
00622 
00623 LDAP_SLAPD_V (get_component_info_func*) get_component_description;
00624 
00625 LDAP_SLAPD_V (component_encoder_func*) component_encoder;
00626 
00627 LDAP_SLAPD_V (convert_attr_to_comp_func*) attr_converter;
00628 
00629 LDAP_SLAPD_V (alloc_nibble_func*) nibble_mem_allocator;
00630 
00631 LDAP_SLAPD_V (free_nibble_func*) nibble_mem_free;
00632 #endif
00633 
00634 /*
00635  * controls.c
00636  */
00637 LDAP_SLAPD_V( struct slap_control_ids ) slap_cids;
00638 LDAP_SLAPD_F (void) slap_free_ctrls LDAP_P((
00639        Operation *op,
00640        LDAPControl **ctrls ));
00641 LDAP_SLAPD_F (int) slap_add_ctrls LDAP_P((
00642        Operation *op,
00643        SlapReply *rs,
00644        LDAPControl **ctrls ));
00645 LDAP_SLAPD_F (int) slap_parse_ctrl LDAP_P((
00646        Operation *op,
00647        SlapReply *rs,
00648        LDAPControl *control,
00649        const char **text ));
00650 LDAP_SLAPD_F (int) get_ctrls LDAP_P((
00651        Operation *op,
00652        SlapReply *rs,
00653        int senderrors ));
00654 LDAP_SLAPD_F (int) register_supported_control2 LDAP_P((
00655        const char *controloid,
00656        slap_mask_t controlmask,
00657        char **controlexops,
00658        SLAP_CTRL_PARSE_FN *controlparsefn,
00659        unsigned flags,
00660        int *controlcid ));
00661 #define register_supported_control(oid, mask, exops, fn, cid) \
00662        register_supported_control2((oid), (mask), (exops), (fn), 0, (cid))
00663 #ifdef SLAP_CONFIG_DELETE
00664 LDAP_SLAPD_F (int) unregister_supported_control LDAP_P((
00665        const char* controloid ));
00666 #endif /* SLAP_CONFIG_DELETE */
00667 LDAP_SLAPD_F (int) slap_controls_init LDAP_P ((void));
00668 LDAP_SLAPD_F (void) controls_destroy LDAP_P ((void));
00669 LDAP_SLAPD_F (int) controls_root_dse_info LDAP_P ((Entry *e));
00670 LDAP_SLAPD_F (int) get_supported_controls LDAP_P ((
00671        char ***ctrloidsp, slap_mask_t **ctrlmasks ));
00672 LDAP_SLAPD_F (int) slap_find_control_id LDAP_P ((
00673        const char *oid, int *cid ));
00674 LDAP_SLAPD_F (int) slap_global_control LDAP_P ((
00675        Operation *op, const char *oid, int *cid ));
00676 LDAP_SLAPD_F (int) slap_remove_control LDAP_P((
00677        Operation     *op,
00678        SlapReply     *rs,
00679        int           ctrl,
00680        BI_chk_controls      fnc ));
00681 
00682 #ifdef SLAP_CONTROL_X_SESSION_TRACKING
00683 LDAP_SLAPD_F (int)
00684 slap_ctrl_session_tracking_add LDAP_P((
00685        Operation *op,
00686        SlapReply *rs,
00687        struct berval *ip,
00688        struct berval *name,
00689        struct berval *id,
00690        LDAPControl *ctrl ));
00691 LDAP_SLAPD_F (int)
00692 slap_ctrl_session_tracking_request_add LDAP_P((
00693        Operation *op, SlapReply *rs, LDAPControl *ctrl ));
00694 #endif /* SLAP_CONTROL_X_SESSION_TRACKING */
00695 #ifdef SLAP_CONTROL_X_WHATFAILED
00696 LDAP_SLAPD_F (int)
00697 slap_ctrl_whatFailed_add LDAP_P((
00698        Operation *op,
00699        SlapReply *rs,
00700        char **oids ));
00701 #endif /* SLAP_CONTROL_X_WHATFAILED */
00702 
00703 /*
00704  * config.c
00705  */
00706 LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, const char *dir ));
00707 LDAP_SLAPD_F (void) config_destroy LDAP_P ((void));
00708 LDAP_SLAPD_F (char **) slap_str2clist LDAP_P((
00709        char ***, char *, const char * ));
00710 LDAP_SLAPD_F (int) bverb_to_mask LDAP_P((
00711        struct berval *bword,  slap_verbmasks *v ));
00712 LDAP_SLAPD_F (int) verb_to_mask LDAP_P((
00713        const char *word,  slap_verbmasks *v ));
00714 LDAP_SLAPD_F (int) verbs_to_mask LDAP_P((
00715        int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m ));
00716 LDAP_SLAPD_F (int) mask_to_verbs LDAP_P((
00717        slap_verbmasks *v, slap_mask_t m, BerVarray *bva ));
00718 LDAP_SLAPD_F (int) mask_to_verbstring LDAP_P((
00719        slap_verbmasks *v, slap_mask_t m, char delim, struct berval *bv ));
00720 LDAP_SLAPD_F (int) verbstring_to_mask LDAP_P((
00721        slap_verbmasks *v, char *str, char delim, slap_mask_t *m ));
00722 LDAP_SLAPD_F (int) enum_to_verb LDAP_P((
00723        slap_verbmasks *v, slap_mask_t m, struct berval *bv ));
00724 LDAP_SLAPD_F (int) slap_verbmasks_init LDAP_P(( slap_verbmasks **vp, slap_verbmasks *v ));
00725 LDAP_SLAPD_F (int) slap_verbmasks_destroy LDAP_P(( slap_verbmasks *v ));
00726 LDAP_SLAPD_F (int) slap_verbmasks_append LDAP_P(( slap_verbmasks **vp,
00727        slap_mask_t m, struct berval *v, slap_mask_t *ignore ));
00728 LDAP_SLAPD_F (int) slap_tls_get_config LDAP_P((
00729        LDAP *ld, int opt, char **val ));
00730 LDAP_SLAPD_F (void) bindconf_tls_defaults LDAP_P(( slap_bindconf *bc ));
00731 LDAP_SLAPD_F (int) bindconf_tls_parse LDAP_P((
00732        const char *word,  slap_bindconf *bc ));
00733 LDAP_SLAPD_F (int) bindconf_tls_unparse LDAP_P((
00734        slap_bindconf *bc, struct berval *bv ));
00735 LDAP_SLAPD_F (int) bindconf_parse LDAP_P((
00736        const char *word,  slap_bindconf *bc ));
00737 LDAP_SLAPD_F (int) bindconf_unparse LDAP_P((
00738        slap_bindconf *bc, struct berval *bv ));
00739 LDAP_SLAPD_F (int) bindconf_tls_set LDAP_P((
00740        slap_bindconf *bc, LDAP *ld ));
00741 LDAP_SLAPD_F (void) bindconf_free LDAP_P(( slap_bindconf *bc ));
00742 LDAP_SLAPD_F (int) slap_client_connect LDAP_P(( LDAP **ldp, slap_bindconf *sb ));
00743 LDAP_SLAPD_F (int) config_generic_wrapper LDAP_P(( Backend *be,
00744        const char *fname, int lineno, int argc, char **argv ));
00745 LDAP_SLAPD_F (char *) anlist_unparse LDAP_P(( AttributeName *, char *, ber_len_t buflen ));
00746 
00747 #ifdef LDAP_SLAPI
00748 LDAP_SLAPD_V (int) slapi_plugins_used;
00749 #endif
00750 
00751 /*
00752  * connection.c
00753  */
00754 LDAP_SLAPD_F (int) connections_init LDAP_P((void));
00755 LDAP_SLAPD_F (int) connections_shutdown LDAP_P((void));
00756 LDAP_SLAPD_F (int) connections_destroy LDAP_P((void));
00757 LDAP_SLAPD_F (int) connections_timeout_idle LDAP_P((time_t));
00758 LDAP_SLAPD_F (void) connections_drop LDAP_P((void));
00759 
00760 LDAP_SLAPD_F (Connection *) connection_client_setup LDAP_P((
00761        ber_socket_t s,
00762        ldap_pvt_thread_start_t *func,
00763        void *arg ));
00764 LDAP_SLAPD_F (void) connection_client_enable LDAP_P(( Connection *c ));
00765 LDAP_SLAPD_F (void) connection_client_stop LDAP_P(( Connection *c ));
00766 
00767 #ifdef LDAP_PF_LOCAL_SENDMSG
00768 #define LDAP_PF_LOCAL_SENDMSG_ARG(arg)    , arg
00769 #else
00770 #define LDAP_PF_LOCAL_SENDMSG_ARG(arg)
00771 #endif
00772 
00773 LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
00774        ber_socket_t s,
00775        Listener* url,
00776        const char* dnsname,
00777        const char* peername,
00778        int use_tls,
00779        slap_ssf_t ssf,
00780        struct berval *id
00781        LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
00782 
00783 LDAP_SLAPD_F (void) connection_closing LDAP_P((
00784        Connection *c, const char *why ));
00785 LDAP_SLAPD_F (int) connection_valid LDAP_P(( Connection *c ));
00786 LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
00787        LDAP_GCCATTR((const));
00788 
00789 LDAP_SLAPD_F (int) connection_read_activate LDAP_P((ber_socket_t s));
00790 LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
00791 
00792 LDAP_SLAPD_F (unsigned long) connections_nextid(void);
00793 
00794 LDAP_SLAPD_F (Connection *) connection_first LDAP_P(( ber_socket_t * ));
00795 LDAP_SLAPD_F (Connection *) connection_next LDAP_P((
00796        Connection *, ber_socket_t *));
00797 LDAP_SLAPD_F (void) connection_done LDAP_P((Connection *));
00798 
00799 LDAP_SLAPD_F (void) connection2anonymous LDAP_P((Connection *));
00800 LDAP_SLAPD_F (void) connection_fake_init LDAP_P((
00801        Connection *conn,
00802        OperationBuffer *opbuf,
00803        void *threadctx ));
00804 LDAP_SLAPD_F (void) connection_fake_init2 LDAP_P((
00805        Connection *conn,
00806        OperationBuffer *opbuf,
00807        void *threadctx,
00808        int newmem ));
00809 LDAP_SLAPD_F (void) operation_fake_init LDAP_P((
00810        Connection *conn,
00811        Operation *op,
00812        void *threadctx,
00813        int newmem ));
00814 LDAP_SLAPD_F (void) connection_assign_nextid LDAP_P((Connection *));
00815 
00816 /*
00817  * cr.c
00818  */
00819 LDAP_SLAPD_F (int) cr_schema_info( Entry *e );
00820 LDAP_SLAPD_F (void) cr_unparse LDAP_P((
00821        BerVarray *bva, ContentRule *start, ContentRule *end, int system ));
00822 
00823 LDAP_SLAPD_F (int) cr_add LDAP_P((
00824        LDAPContentRule *oc,
00825        int user,
00826        ContentRule **scr,
00827        const char **err));
00828 
00829 LDAP_SLAPD_F (void) cr_destroy LDAP_P(( void ));
00830 
00831 LDAP_SLAPD_F (ContentRule *) cr_find LDAP_P((
00832        const char *crname));
00833 LDAP_SLAPD_F (ContentRule *) cr_bvfind LDAP_P((
00834        struct berval *crname));
00835 
00836 /*
00837  * ctxcsn.c
00838  */
00839 
00840 LDAP_SLAPD_V( int ) slap_serverID;
00841 LDAP_SLAPD_V( const struct berval ) slap_ldapsync_bv;
00842 LDAP_SLAPD_V( const struct berval ) slap_ldapsync_cn_bv;
00843 LDAP_SLAPD_F (void) slap_get_commit_csn LDAP_P((
00844        Operation *, struct berval *maxcsn, int *foundit ));
00845 LDAP_SLAPD_F (void) slap_rewind_commit_csn LDAP_P(( Operation * ));
00846 LDAP_SLAPD_F (void) slap_graduate_commit_csn LDAP_P(( Operation * ));
00847 LDAP_SLAPD_F (Entry *) slap_create_context_csn_entry LDAP_P(( Backend *, struct berval *));
00848 LDAP_SLAPD_F (int) slap_get_csn LDAP_P(( Operation *, struct berval *, int ));
00849 LDAP_SLAPD_F (void) slap_queue_csn LDAP_P(( Operation *, struct berval * ));
00850 
00851 /*
00852  * daemon.c
00853  */
00854 LDAP_SLAPD_F (void) slapd_add_internal(ber_socket_t s, int isactive);
00855 LDAP_SLAPD_F (int) slapd_daemon_init( const char *urls );
00856 LDAP_SLAPD_F (int) slapd_daemon_destroy(void);
00857 LDAP_SLAPD_F (int) slapd_daemon(void);
00858 LDAP_SLAPD_F (Listener **)  slapd_get_listeners LDAP_P((void));
00859 LDAP_SLAPD_F (void) slapd_remove LDAP_P((ber_socket_t s, Sockbuf *sb,
00860        int wasactive, int wake, int locked ));
00861 
00862 LDAP_SLAPD_F (RETSIGTYPE) slap_sig_shutdown LDAP_P((int sig));
00863 LDAP_SLAPD_F (RETSIGTYPE) slap_sig_wake LDAP_P((int sig));
00864 LDAP_SLAPD_F (void) slap_wake_listener LDAP_P((void));
00865 
00866 LDAP_SLAPD_F (void) slap_suspend_listeners LDAP_P((void));
00867 LDAP_SLAPD_F (void) slap_resume_listeners LDAP_P((void));
00868 
00869 LDAP_SLAPD_F (void) slapd_set_write LDAP_P((ber_socket_t s, int wake));
00870 LDAP_SLAPD_F (void) slapd_clr_write LDAP_P((ber_socket_t s, int wake));
00871 LDAP_SLAPD_F (void) slapd_set_read LDAP_P((ber_socket_t s, int wake));
00872 LDAP_SLAPD_F (int) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
00873 LDAP_SLAPD_F (void) slapd_clr_writetime LDAP_P((time_t old));
00874 LDAP_SLAPD_F (time_t) slapd_get_writetime LDAP_P((void));
00875 
00876 LDAP_SLAPD_V (volatile sig_atomic_t) slapd_abrupt_shutdown;
00877 LDAP_SLAPD_V (volatile sig_atomic_t) slapd_shutdown;
00878 LDAP_SLAPD_V (int) slapd_register_slp;
00879 LDAP_SLAPD_V (const char *) slapd_slp_attrs;
00880 LDAP_SLAPD_V (slap_ssf_t) local_ssf;
00881 LDAP_SLAPD_V (struct runqueue_s) slapd_rq;
00882 LDAP_SLAPD_V (int) slapd_daemon_threads;
00883 LDAP_SLAPD_V (int) slapd_daemon_mask;
00884 #ifdef LDAP_TCP_BUFFER
00885 LDAP_SLAPD_V (int) slapd_tcp_rmem;
00886 LDAP_SLAPD_V (int) slapd_tcp_wmem;
00887 #endif /* LDAP_TCP_BUFFER */
00888 
00889 #ifdef HAVE_WINSOCK
00890 LDAP_SLAPD_F (ber_socket_t) slapd_socknew(ber_socket_t s);
00891 LDAP_SLAPD_F (ber_socket_t) slapd_sock2fd(ber_socket_t s);
00892 LDAP_SLAPD_V (SOCKET *) slapd_ws_sockets;
00893 #define       SLAP_FD2SOCK(s)      slapd_ws_sockets[s]
00894 #define       SLAP_SOCK2FD(s)      slapd_sock2fd(s)
00895 #define       SLAP_SOCKNEW(s)      slapd_socknew(s)
00896 #else
00897 #define       SLAP_FD2SOCK(s)      s
00898 #define       SLAP_SOCK2FD(s)      s
00899 #define       SLAP_SOCKNEW(s)      s
00900 #endif
00901 
00902 /*
00903  * dn.c
00904  */
00905 
00906 #define dn_match(dn1, dn2)  ( ber_bvcmp((dn1), (dn2)) == 0 )
00907 #define bvmatch(bv1, bv2)   ( ((bv1)->bv_len == (bv2)->bv_len) && (memcmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
00908 
00909 LDAP_SLAPD_F (int) dnValidate LDAP_P((
00910        Syntax *syntax, 
00911        struct berval *val ));
00912 LDAP_SLAPD_F (int) rdnValidate LDAP_P((
00913        Syntax *syntax, 
00914        struct berval *val ));
00915 
00916 LDAP_SLAPD_F (slap_mr_normalize_func) dnNormalize;
00917 
00918 LDAP_SLAPD_F (slap_mr_normalize_func) rdnNormalize;
00919 
00920 LDAP_SLAPD_F (slap_syntax_transform_func) dnPretty;
00921 
00922 LDAP_SLAPD_F (slap_syntax_transform_func) rdnPretty;
00923 
00924 LDAP_SLAPD_F (int) dnPrettyNormal LDAP_P(( 
00925        Syntax *syntax, 
00926        struct berval *val, 
00927        struct berval *pretty,
00928        struct berval *normal,
00929        void *ctx ));
00930 
00931 LDAP_SLAPD_F (int) dnMatch LDAP_P(( 
00932        int *matchp, 
00933        slap_mask_t flags, 
00934        Syntax *syntax, 
00935        MatchingRule *mr,
00936        struct berval *value, 
00937        void *assertedValue ));
00938 
00939 LDAP_SLAPD_F (int) dnRelativeMatch LDAP_P(( 
00940        int *matchp, 
00941        slap_mask_t flags, 
00942        Syntax *syntax, 
00943        MatchingRule *mr,
00944        struct berval *value, 
00945        void *assertedValue ));
00946 
00947 LDAP_SLAPD_F (int) rdnMatch LDAP_P(( 
00948        int *matchp, 
00949        slap_mask_t flags, 
00950        Syntax *syntax, 
00951        MatchingRule *mr,
00952        struct berval *value, 
00953        void *assertedValue ));
00954 
00955 
00956 LDAP_SLAPD_F (int) dnIsSuffix LDAP_P((
00957        const struct berval *dn, const struct berval *suffix ));
00958 
00959 LDAP_SLAPD_F (int) dnIsWithinScope LDAP_P((
00960        struct berval *ndn, struct berval *nbase, int scope ));
00961 
00962 LDAP_SLAPD_F (int) dnIsSuffixScope LDAP_P((
00963        struct berval *ndn, struct berval *nbase, int scope ));
00964 
00965 LDAP_SLAPD_F (int) dnIsOneLevelRDN LDAP_P(( struct berval *rdn ));
00966 
00967 LDAP_SLAPD_F (int) dnExtractRdn LDAP_P((
00968        struct berval *dn, struct berval *rdn, void *ctx ));
00969 
00970 LDAP_SLAPD_F (int) rdn_validate LDAP_P(( struct berval * rdn ));
00971 
00972 LDAP_SLAPD_F (ber_len_t) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
00973 
00974 LDAP_SLAPD_F (void) build_new_dn LDAP_P((
00975        struct berval * new_dn,
00976        struct berval * parent_dn,
00977        struct berval * newrdn,
00978        void *memctx ));
00979 
00980 LDAP_SLAPD_F (void) dnParent LDAP_P(( struct berval *dn, struct berval *pdn ));
00981 LDAP_SLAPD_F (void) dnRdn LDAP_P(( struct berval *dn, struct berval *rdn ));
00982 
00983 LDAP_SLAPD_F (int) dnX509normalize LDAP_P(( void *x509_name, struct berval *out ));
00984 
00985 LDAP_SLAPD_F (int) dnX509peerNormalize LDAP_P(( void *ssl, struct berval *dn ));
00986 
00987 LDAP_SLAPD_F (int) dnPrettyNormalDN LDAP_P(( Syntax *syntax, struct berval *val, LDAPDN *dn, int flags, void *ctx ));
00988 #define dnPrettyDN(syntax, val, dn, ctx) \
00989        dnPrettyNormalDN((syntax),(val),(dn), SLAP_LDAPDN_PRETTY, ctx)
00990 #define dnNormalDN(syntax, val, dn, ctx) \
00991        dnPrettyNormalDN((syntax),(val),(dn), 0, ctx)
00992 
00993 typedef int (SLAP_CERT_MAP_FN) LDAP_P(( void *ssl, struct berval *dn ));
00994 LDAP_SLAPD_F (int) register_certificate_map_function LDAP_P(( SLAP_CERT_MAP_FN *fn ));
00995 
00996 /*
00997  * entry.c
00998  */
00999 LDAP_SLAPD_V (const Entry) slap_entry_root;
01000 
01001 LDAP_SLAPD_F (int) entry_init LDAP_P((void));
01002 LDAP_SLAPD_F (int) entry_destroy LDAP_P((void));
01003 
01004 LDAP_SLAPD_F (Entry *) str2entry LDAP_P(( char   *s ));
01005 LDAP_SLAPD_F (Entry *) str2entry2 LDAP_P(( char  *s, int checkvals ));
01006 LDAP_SLAPD_F (char *) entry2str LDAP_P(( Entry *e, int *len ));
01007 LDAP_SLAPD_F (char *) entry2str_wrap LDAP_P(( Entry *e, int *len, ber_len_t wrap ));
01008 
01009 LDAP_SLAPD_F (ber_len_t) entry_flatsize LDAP_P(( Entry *e, int norm ));
01010 LDAP_SLAPD_F (void) entry_partsize LDAP_P(( Entry *e, ber_len_t *len,
01011        int *nattrs, int *nvals, int norm ));
01012 
01013 LDAP_SLAPD_F (int) entry_header LDAP_P(( EntryHeader *eh ));
01014 LDAP_SLAPD_F (int) entry_decode_dn LDAP_P((
01015        EntryHeader *eh, struct berval *dn, struct berval *ndn ));
01016 #ifdef SLAP_ZONE_ALLOC
01017 LDAP_SLAPD_F (int) entry_decode LDAP_P((
01018                                           EntryHeader *eh, Entry **e, void *ctx ));
01019 #else
01020 LDAP_SLAPD_F (int) entry_decode LDAP_P((
01021                                           EntryHeader *eh, Entry **e ));
01022 #endif
01023 LDAP_SLAPD_F (int) entry_encode LDAP_P(( Entry *e, struct berval *bv ));
01024 
01025 LDAP_SLAPD_F (void) entry_clean LDAP_P(( Entry *e ));
01026 LDAP_SLAPD_F (void) entry_free LDAP_P(( Entry *e ));
01027 LDAP_SLAPD_F (int) entry_cmp LDAP_P(( Entry *a, Entry *b ));
01028 LDAP_SLAPD_F (int) entry_dn_cmp LDAP_P(( const void *v_a, const void *v_b ));
01029 LDAP_SLAPD_F (int) entry_id_cmp LDAP_P(( const void *v_a, const void *v_b ));
01030 LDAP_SLAPD_F (Entry *) entry_dup LDAP_P(( Entry *e ));
01031 LDAP_SLAPD_F (Entry *) entry_dup2 LDAP_P(( Entry *dest, Entry *src ));
01032 LDAP_SLAPD_F (Entry *) entry_dup_bv LDAP_P(( Entry *e ));
01033 LDAP_SLAPD_F (Entry *) entry_alloc LDAP_P((void));
01034 LDAP_SLAPD_F (int) entry_prealloc LDAP_P((int num));
01035 
01036 /*
01037  * extended.c
01038  */
01039 LDAP_SLAPD_F (int) exop_root_dse_info LDAP_P ((Entry *e));
01040 
01041 #define exop_is_write( op ) ((op->ore_flags & SLAP_EXOP_WRITES) != 0)
01042 
01043 LDAP_SLAPD_V( const struct berval ) slap_EXOP_CANCEL;
01044 LDAP_SLAPD_V( const struct berval ) slap_EXOP_WHOAMI;
01045 LDAP_SLAPD_V( const struct berval ) slap_EXOP_MODIFY_PASSWD;
01046 LDAP_SLAPD_V( const struct berval ) slap_EXOP_START_TLS;
01047 #ifdef LDAP_X_TXN
01048 LDAP_SLAPD_V( const struct berval ) slap_EXOP_TXN_START;
01049 LDAP_SLAPD_V( const struct berval ) slap_EXOP_TXN_END;
01050 #endif
01051 
01052 typedef int (SLAP_EXTOP_MAIN_FN) LDAP_P(( Operation *op, SlapReply *rs ));
01053 
01054 typedef int (SLAP_EXTOP_GETOID_FN) LDAP_P((
01055        int index, struct berval *oid, int blen ));
01056 
01057 LDAP_SLAPD_F (int) load_extop2 LDAP_P((
01058        const struct berval *ext_oid,
01059        slap_mask_t flags,
01060        SLAP_EXTOP_MAIN_FN *ext_main,
01061        unsigned tmpflags ));
01062 #define load_extop(ext_oid, flags, ext_main) \
01063        load_extop2((ext_oid), (flags), (ext_main), 0)
01064 
01065 LDAP_SLAPD_F (int) extops_init LDAP_P(( void ));
01066 
01067 LDAP_SLAPD_F (int) extops_kill LDAP_P(( void ));
01068 
01069 LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index));
01070 
01071 /*
01072  * txn.c
01073  */
01074 #ifdef LDAP_X_TXN
01075 LDAP_SLAPD_F ( SLAP_CTRL_PARSE_FN ) txn_spec_ctrl;
01076 LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) txn_start_extop;
01077 LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) txn_end_extop;
01078 #endif
01079 
01080 /*
01081  * cancel.c
01082  */
01083 LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) cancel_extop;
01084 
01085 /*
01086  * filter.c
01087  */
01088 LDAP_SLAPD_F (int) get_filter LDAP_P((
01089        Operation *op,
01090        BerElement *ber,
01091        Filter **filt,
01092        const char **text ));
01093 
01094 LDAP_SLAPD_F (void) filter_free LDAP_P(( Filter *f ));
01095 LDAP_SLAPD_F (void) filter_free_x LDAP_P(( Operation *op, Filter *f, int freeme ));
01096 LDAP_SLAPD_F (void) filter2bv LDAP_P(( Filter *f, struct berval *bv ));
01097 LDAP_SLAPD_F (void) filter2bv_x LDAP_P(( Operation *op, Filter *f, struct berval *bv ));
01098 LDAP_SLAPD_F (void) filter2bv_undef LDAP_P(( Filter *f, int noundef, struct berval *bv ));
01099 LDAP_SLAPD_F (void) filter2bv_undef_x LDAP_P(( Operation *op, Filter *f, int noundef, struct berval *bv ));
01100 LDAP_SLAPD_F (Filter *) filter_dup LDAP_P(( Filter *f, void *memctx ));
01101 
01102 LDAP_SLAPD_F (int) get_vrFilter LDAP_P(( Operation *op, BerElement *ber,
01103        ValuesReturnFilter **f,
01104        const char **text ));
01105 
01106 LDAP_SLAPD_F (void) vrFilter_free LDAP_P(( Operation *op, ValuesReturnFilter *f ));
01107 LDAP_SLAPD_F (void) vrFilter2bv LDAP_P(( Operation *op, ValuesReturnFilter *f, struct berval *fstr ));
01108 
01109 LDAP_SLAPD_F (int) filter_has_subordinates LDAP_P(( Filter *filter ));
01110 #define filter_escape_value( in, out )           ldap_bv2escaped_filter_value_x( (in), (out), 0, NULL )
01111 #define filter_escape_value_x( in, out, ctx )    ldap_bv2escaped_filter_value_x( (in), (out), 0, ctx )
01112 
01113 LDAP_SLAPD_V (const Filter *) slap_filter_objectClass_pres;
01114 LDAP_SLAPD_V (const struct berval *) slap_filterstr_objectClass_pres;
01115 
01116 LDAP_SLAPD_F (int) filter_init LDAP_P(( void ));
01117 LDAP_SLAPD_F (void) filter_destroy LDAP_P(( void ));
01118 /*
01119  * filterentry.c
01120  */
01121 
01122 LDAP_SLAPD_F (int) test_filter LDAP_P(( Operation *op, Entry *e, Filter *f ));
01123 
01124 /*
01125  * frontend.c
01126  */
01127 LDAP_SLAPD_F (int) frontend_init LDAP_P(( void ));
01128 
01129 /*
01130  * globals.c
01131  */
01132 
01133 LDAP_SLAPD_V( const struct berval ) slap_empty_bv;
01134 LDAP_SLAPD_V( const struct berval ) slap_unknown_bv;
01135 LDAP_SLAPD_V( const struct berval ) slap_true_bv;
01136 LDAP_SLAPD_V( const struct berval ) slap_false_bv;
01137 LDAP_SLAPD_V( struct slap_sync_cookie_s ) slap_sync_cookie;
01138 LDAP_SLAPD_V( void * ) slap_tls_ctx;
01139 LDAP_SLAPD_V( LDAP * ) slap_tls_ld;
01140 
01141 /*
01142  * index.c
01143  */
01144 LDAP_SLAPD_F (int) slap_str2index LDAP_P(( const char *str, slap_mask_t *idx ));
01145 LDAP_SLAPD_F (void) slap_index2bvlen LDAP_P(( slap_mask_t idx, struct berval *bv ));
01146 LDAP_SLAPD_F (void) slap_index2bv LDAP_P(( slap_mask_t idx, struct berval *bv ));
01147 
01148 /*
01149  * init.c
01150  */
01151 LDAP_SLAPD_F (int)   slap_init LDAP_P((int mode, const char* name));
01152 LDAP_SLAPD_F (int)   slap_startup LDAP_P(( Backend *be ));
01153 LDAP_SLAPD_F (int)   slap_shutdown LDAP_P(( Backend *be ));
01154 LDAP_SLAPD_F (int)   slap_destroy LDAP_P((void));
01155 LDAP_SLAPD_F (void) slap_counters_init LDAP_P((slap_counters_t *sc));
01156 LDAP_SLAPD_F (void) slap_counters_destroy LDAP_P((slap_counters_t *sc));
01157 
01158 LDAP_SLAPD_V (char *)       slap_known_controls[];
01159 
01160 /*
01161  * ldapsync.c
01162  */
01163 LDAP_SLAPD_F (void) slap_compose_sync_cookie LDAP_P((
01164                             Operation *, struct berval *, BerVarray, int, int ));
01165 LDAP_SLAPD_F (void) slap_sync_cookie_free LDAP_P((
01166                             struct sync_cookie *, int free_cookie ));
01167 LDAP_SLAPD_F (int) slap_parse_csn_sid LDAP_P((
01168                             struct berval * ));
01169 LDAP_SLAPD_F (int *) slap_parse_csn_sids LDAP_P((
01170                             BerVarray, int, void *memctx ));
01171 LDAP_SLAPD_F (int) slap_sort_csn_sids LDAP_P((
01172                             BerVarray, int *, int, void *memctx ));
01173 LDAP_SLAPD_F (void) slap_insert_csn_sids LDAP_P((
01174                             struct sync_cookie *ck, int, int, struct berval * ));
01175 LDAP_SLAPD_F (int) slap_parse_sync_cookie LDAP_P((
01176                             struct sync_cookie *, void *memctx ));
01177 LDAP_SLAPD_F (int) slap_init_sync_cookie_ctxcsn LDAP_P((
01178                             struct sync_cookie * ));
01179 LDAP_SLAPD_F (struct sync_cookie *) slap_dup_sync_cookie LDAP_P((
01180                             struct sync_cookie *, struct sync_cookie * ));
01181 LDAP_SLAPD_F (int) slap_build_syncUUID_set LDAP_P((
01182                             Operation *, BerVarray *, Entry * ));
01183 
01184 /*
01185  * limits.c
01186  */
01187 LDAP_SLAPD_F (int) limits_parse LDAP_P((
01188        Backend *be, const char *fname, int lineno,
01189        int argc, char **argv ));
01190 LDAP_SLAPD_F (int) limits_parse_one LDAP_P(( const char *arg, 
01191        struct slap_limits_set *limit ));
01192 LDAP_SLAPD_F (int) limits_check LDAP_P((
01193        Operation *op, SlapReply *rs ));
01194 LDAP_SLAPD_F (int) limits_unparse_one LDAP_P(( 
01195        struct slap_limits_set *limit, int which, struct berval *bv, ber_len_t buflen ));
01196 LDAP_SLAPD_F (int) limits_unparse LDAP_P(( 
01197        struct slap_limits *limit, struct berval *bv, ber_len_t buflen ));
01198 LDAP_SLAPD_F (void) limits_free_one LDAP_P(( 
01199        struct slap_limits   *lm ));
01200 LDAP_SLAPD_F (void) limits_destroy LDAP_P(( struct slap_limits **lm ));
01201 
01202 /*
01203  * lock.c
01204  */
01205 LDAP_SLAPD_F (FILE *) lock_fopen LDAP_P(( const char *fname,
01206        const char *type, FILE **lfp ));
01207 LDAP_SLAPD_F (int) lock_fclose LDAP_P(( FILE *fp, FILE *lfp ));
01208 
01209 /*
01210  * main.c
01211  */
01212 LDAP_SLAPD_F (int)
01213 parse_debug_level LDAP_P(( const char *arg, int *levelp, char ***unknowns ));
01214 LDAP_SLAPD_F (int)
01215 parse_syslog_level LDAP_P(( const char *arg, int *levelp ));
01216 LDAP_SLAPD_F (int)
01217 parse_syslog_user LDAP_P(( const char *arg, int *syslogUser ));
01218 LDAP_SLAPD_F (int)
01219 parse_debug_unknowns LDAP_P(( char **unknowns, int *levelp ));
01220 
01221 /*
01222  * matchedValues.c
01223  */
01224 LDAP_SLAPD_F (int) filter_matched_values( 
01225        Operation     *op,
01226        Attribute     *a,
01227        char          ***e_flags );
01228 
01229 /*
01230  * modrdn.c
01231  */
01232 LDAP_SLAPD_F (int) slap_modrdn2mods LDAP_P((
01233        Operation     *op,
01234        SlapReply     *rs ));
01235 
01236 /*
01237  * modify.c
01238  */
01239 LDAP_SLAPD_F( int ) slap_mods_obsolete_check(
01240        Operation *op,
01241        Modifications *ml,
01242        const char **text,
01243        char *textbuf, size_t textlen );
01244 
01245 LDAP_SLAPD_F( int ) slap_mods_no_user_mod_check(
01246        Operation *op,
01247        Modifications *ml,
01248        const char **text,
01249        char *textbuf, size_t textlen );
01250 
01251 LDAP_SLAPD_F ( int ) slap_mods_no_repl_user_mod_check(
01252        Operation *op,
01253        Modifications *ml,
01254        const char **text,
01255        char *textbuf,
01256        size_t textlen );
01257 
01258 LDAP_SLAPD_F( int ) slap_mods_check(
01259        Operation *op,
01260        Modifications *ml,
01261        const char **text,
01262        char *textbuf, size_t textlen, void *ctx );
01263 
01264 LDAP_SLAPD_F( int ) slap_sort_vals(
01265        Modifications *ml,
01266        const char **text,
01267        int *dup,
01268        void *ctx );
01269 
01270 LDAP_SLAPD_F( void ) slap_timestamp(
01271        time_t *tm,
01272        struct berval *bv );
01273 
01274 LDAP_SLAPD_F( void ) slap_mods_opattrs(
01275        Operation *op,
01276        Modifications **modsp,
01277        int manage_ctxcsn );
01278 
01279 LDAP_SLAPD_F( int ) slap_parse_modlist(
01280        Operation *op,
01281        SlapReply *rs,
01282        BerElement *ber,
01283        req_modify_s *ms );
01284 
01285 /*
01286  * mods.c
01287  */
01288 LDAP_SLAPD_F( int ) modify_add_values( Entry *e,
01289        Modification *mod,
01290        int permissive,
01291        const char **text, char *textbuf, size_t textlen );
01292 LDAP_SLAPD_F( int ) modify_delete_values( Entry *e,
01293        Modification *mod,
01294        int permissive,
01295        const char **text, char *textbuf, size_t textlen );
01296 LDAP_SLAPD_F( int ) modify_delete_vindex( Entry *e,
01297        Modification *mod,
01298        int permissive,
01299        const char **text, char *textbuf, size_t textlen, int *idx );
01300 LDAP_SLAPD_F( int ) modify_replace_values( Entry *e,
01301        Modification *mod,
01302        int permissive,
01303        const char **text, char *textbuf, size_t textlen );
01304 LDAP_SLAPD_F( int ) modify_increment_values( Entry *e,
01305        Modification *mod,
01306        int permissive,
01307        const char **text, char *textbuf, size_t textlen );
01308 
01309 LDAP_SLAPD_F( void ) slap_mod_free( Modification *mod, int freeit );
01310 LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods, int freevals );
01311 LDAP_SLAPD_F( void ) slap_modlist_free( LDAPModList *ml );
01312 
01313 /*
01314  * module.c
01315  */
01316 #ifdef SLAPD_MODULES
01317 
01318 LDAP_SLAPD_F (int) module_init LDAP_P(( void ));
01319 LDAP_SLAPD_F (int) module_kill LDAP_P(( void ));
01320 
01321 LDAP_SLAPD_F (int) load_null_module(
01322        const void *module, const char *file_name);
01323 LDAP_SLAPD_F (int) load_extop_module(
01324        const void *module, const char *file_name);
01325 
01326 LDAP_SLAPD_F (int) module_load LDAP_P((
01327        const char* file_name,
01328        int argc, char *argv[] ));
01329 LDAP_SLAPD_F (int) module_path LDAP_P(( const char* path ));
01330 LDAP_SLAPD_F (int) module_unload LDAP_P(( const char* file_name ));
01331 
01332 LDAP_SLAPD_F (void *) module_handle LDAP_P(( const char* file_name ));
01333 
01334 LDAP_SLAPD_F (void *) module_resolve LDAP_P((
01335        const void *module, const char *name));
01336 
01337 #endif /* SLAPD_MODULES */
01338 
01339 /* mr.c */
01340 LDAP_SLAPD_F (MatchingRule *) mr_bvfind LDAP_P((struct berval *mrname));
01341 LDAP_SLAPD_F (MatchingRule *) mr_find LDAP_P((const char *mrname));
01342 LDAP_SLAPD_F (int) mr_add LDAP_P(( LDAPMatchingRule *mr,
01343        slap_mrule_defs_rec *def,
01344        MatchingRule * associated,
01345        const char **err ));
01346 LDAP_SLAPD_F (void) mr_destroy LDAP_P(( void ));
01347 
01348 LDAP_SLAPD_F (int) register_matching_rule LDAP_P((
01349        slap_mrule_defs_rec *def ));
01350 
01351 LDAP_SLAPD_F (void) mru_destroy LDAP_P(( void ));
01352 LDAP_SLAPD_F (int) matching_rule_use_init LDAP_P(( void ));
01353 
01354 LDAP_SLAPD_F (int) mr_schema_info LDAP_P(( Entry *e ));
01355 LDAP_SLAPD_F (int) mru_schema_info LDAP_P(( Entry *e ));
01356 
01357 LDAP_SLAPD_F (int) mr_usable_with_at LDAP_P(( MatchingRule *mr,
01358        AttributeType *at ));
01359 LDAP_SLAPD_F (int) mr_make_syntax_compat_with_mr LDAP_P((
01360        Syntax        *syn,
01361        MatchingRule  *mr ));
01362 LDAP_SLAPD_F (int) mr_make_syntax_compat_with_mrs LDAP_P((
01363        const char *syntax,
01364        char *const *mrs ));
01365 
01366 /*
01367  * mra.c
01368  */
01369 LDAP_SLAPD_F (int) get_mra LDAP_P((
01370        Operation *op,
01371        BerElement *ber,
01372        Filter *f,
01373        const char **text ));
01374 LDAP_SLAPD_F (void) mra_free LDAP_P((
01375        Operation *op,
01376        MatchingRuleAssertion *mra,
01377        int freeit ));
01378 
01379 /* oc.c */
01380 LDAP_SLAPD_F (int) oc_add LDAP_P((
01381        LDAPObjectClass *oc,
01382        int user,
01383        ObjectClass **soc,
01384        ObjectClass *prev,
01385        const char **err));
01386 LDAP_SLAPD_F (void) oc_destroy LDAP_P(( void ));
01387 
01388 LDAP_SLAPD_F (ObjectClass *) oc_find LDAP_P((
01389        const char *ocname));
01390 LDAP_SLAPD_F (ObjectClass *) oc_bvfind LDAP_P((
01391        struct berval *ocname));
01392 LDAP_SLAPD_F (ObjectClass *) oc_bvfind_undef LDAP_P((
01393        struct berval *ocname));
01394 LDAP_SLAPD_F (int) is_object_subclass LDAP_P((
01395        ObjectClass *sup,
01396        ObjectClass *sub ));
01397 
01398 LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
01399        Entry *, ObjectClass *oc, unsigned flags ));
01400 #define       is_entry_objectclass_or_sub(e,oc) \
01401        (is_entry_objectclass((e),(oc),SLAP_OCF_CHECK_SUP))
01402 #define is_entry_alias(e)          \
01403        (((e)->e_ocflags & SLAP_OC__END) \
01404         ? (((e)->e_ocflags & SLAP_OC_ALIAS) != 0) \
01405         : is_entry_objectclass((e), slap_schema.si_oc_alias, SLAP_OCF_SET_FLAGS))
01406 #define is_entry_referral(e)       \
01407        (((e)->e_ocflags & SLAP_OC__END) \
01408         ? (((e)->e_ocflags & SLAP_OC_REFERRAL) != 0) \
01409         : is_entry_objectclass((e), slap_schema.si_oc_referral, SLAP_OCF_SET_FLAGS))
01410 #define is_entry_subentry(e)       \
01411        (((e)->e_ocflags & SLAP_OC__END) \
01412         ? (((e)->e_ocflags & SLAP_OC_SUBENTRY) != 0) \
01413         : is_entry_objectclass((e), slap_schema.si_oc_subentry, SLAP_OCF_SET_FLAGS))
01414 #define is_entry_collectiveAttributeSubentry(e)  \
01415        (((e)->e_ocflags & SLAP_OC__END) \
01416         ? (((e)->e_ocflags & SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY) != 0) \
01417         : is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributeSubentry, SLAP_OCF_SET_FLAGS))
01418 #define is_entry_dynamicObject(e)  \
01419        (((e)->e_ocflags & SLAP_OC__END) \
01420         ? (((e)->e_ocflags & SLAP_OC_DYNAMICOBJECT) != 0) \
01421         : is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, SLAP_OCF_SET_FLAGS))
01422 #define is_entry_glue(e)    \
01423        (((e)->e_ocflags & SLAP_OC__END) \
01424         ? (((e)->e_ocflags & SLAP_OC_GLUE) != 0) \
01425         : is_entry_objectclass((e), slap_schema.si_oc_glue, SLAP_OCF_SET_FLAGS))
01426 #define is_entry_syncProviderSubentry(e)  \
01427        (((e)->e_ocflags & SLAP_OC__END) \
01428         ? (((e)->e_ocflags & SLAP_OC_SYNCPROVIDERSUBENTRY) != 0) \
01429         : is_entry_objectclass((e), slap_schema.si_oc_syncProviderSubentry, SLAP_OCF_SET_FLAGS))
01430 #define is_entry_syncConsumerSubentry(e)  \
01431        (((e)->e_ocflags & SLAP_OC__END) \
01432         ? (((e)->e_ocflags & SLAP_OC_SYNCCONSUMERSUBENTRY) != 0) \
01433         : is_entry_objectclass((e), slap_schema.si_oc_syncConsumerSubentry, SLAP_OCF_SET_FLAGS))
01434 
01435 LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
01436 
01437 LDAP_SLAPD_F (int) oc_start LDAP_P(( ObjectClass **oc ));
01438 LDAP_SLAPD_F (int) oc_next LDAP_P(( ObjectClass **oc ));
01439 LDAP_SLAPD_F (void) oc_delete LDAP_P(( ObjectClass *oc ));
01440 
01441 LDAP_SLAPD_F (void) oc_unparse LDAP_P((
01442        BerVarray *bva, ObjectClass *start, ObjectClass *end, int system ));
01443 
01444 LDAP_SLAPD_F (int) register_oc LDAP_P((
01445        const char *desc,
01446        ObjectClass **oc,
01447        int dupok ));
01448 
01449 /*
01450  * oidm.c
01451  */
01452 LDAP_SLAPD_F(char *) oidm_find(char *oid);
01453 LDAP_SLAPD_F (void) oidm_destroy LDAP_P(( void ));
01454 LDAP_SLAPD_F (void) oidm_unparse LDAP_P((
01455        BerVarray *bva, OidMacro *start, OidMacro *end, int system ));
01456 LDAP_SLAPD_F (int) parse_oidm LDAP_P((
01457        struct config_args_s *ca, int user, OidMacro **om ));
01458 
01459 /*
01460  * operation.c
01461  */
01462 LDAP_SLAPD_F (void) slap_op_init LDAP_P(( void ));
01463 LDAP_SLAPD_F (void) slap_op_destroy LDAP_P(( void ));
01464 LDAP_SLAPD_F (void) slap_op_groups_free LDAP_P(( Operation *op ));
01465 LDAP_SLAPD_F (void) slap_op_free LDAP_P(( Operation *op, void *ctx ));
01466 LDAP_SLAPD_F (void) slap_op_time LDAP_P(( time_t *t, int *n ));
01467 LDAP_SLAPD_F (Operation *) slap_op_alloc LDAP_P((
01468        BerElement *ber, ber_int_t msgid,
01469        ber_tag_t tag, ber_int_t id, void *ctx ));
01470 
01471 LDAP_SLAPD_F (slap_op_t) slap_req2op LDAP_P(( ber_tag_t tag ));
01472 
01473 /*
01474  * operational.c
01475  */
01476 LDAP_SLAPD_F (Attribute *) slap_operational_subschemaSubentry( Backend *be );
01477 LDAP_SLAPD_F (Attribute *) slap_operational_entryDN( Entry *e );
01478 LDAP_SLAPD_F (Attribute *) slap_operational_hasSubordinate( int has );
01479 
01480 /*
01481  * overlays.c
01482  */
01483 LDAP_SLAPD_F (int) overlay_init( void );
01484 
01485 /*
01486  * passwd.c
01487  */
01488 LDAP_SLAPD_F (SLAP_EXTOP_MAIN_FN) passwd_extop;
01489 
01490 LDAP_SLAPD_F (int) slap_passwd_check(
01491        Operation            *op,
01492        Entry                *e,
01493        Attribute            *a,
01494        struct berval        *cred,
01495        const char           **text );
01496 
01497 LDAP_SLAPD_F (void) slap_passwd_generate( struct berval * );
01498 
01499 LDAP_SLAPD_F (void) slap_passwd_hash(
01500        struct berval        *cred,
01501        struct berval        *hash,
01502        const char           **text );
01503 
01504 LDAP_SLAPD_F (void) slap_passwd_hash_type(
01505        struct berval        *cred,
01506        struct berval        *hash,
01507        char                 *htype,
01508        const char           **text );
01509 
01510 LDAP_SLAPD_F (struct berval *) slap_passwd_return(
01511        struct berval        *cred );
01512 
01513 LDAP_SLAPD_F (int) slap_passwd_parse(
01514        struct berval        *reqdata,
01515        struct berval        *id,
01516        struct berval        *oldpass,
01517        struct berval        *newpass,
01518        const char           **text );
01519 
01520 LDAP_SLAPD_F (void) slap_passwd_init (void);
01521 
01522 /*
01523  * phonetic.c
01524  */
01525 LDAP_SLAPD_F (char *) phonetic LDAP_P(( char *s ));
01526 
01527 /*
01528  * referral.c
01529  */
01530 LDAP_SLAPD_F (int) validate_global_referral LDAP_P((
01531        const char *url ));
01532 
01533 LDAP_SLAPD_F (BerVarray) get_entry_referrals LDAP_P((
01534        Operation *op, Entry *e ));
01535 
01536 LDAP_SLAPD_F (BerVarray) referral_rewrite LDAP_P((
01537        BerVarray refs,
01538        struct berval *base,
01539        struct berval *target,
01540        int scope ));
01541 
01542 LDAP_SLAPD_F (int) get_alias_dn LDAP_P((
01543        Entry *e,
01544        struct berval *ndn,
01545        int *err,
01546        const char **text ));
01547 
01548 /*
01549  * result.c
01550  */
01551 #if USE_RS_ASSERT /*defined(USE_RS_ASSERT)?(USE_RS_ASSERT):defined(LDAP_TEST)*/
01552 #ifdef __GNUC__
01553 # define RS_FUNC_    __FUNCTION__
01554 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__) >= 199901L
01555 # define RS_FUNC_    __func__
01556 #else
01557 # define rs_assert_(file, line, func, cond) rs_assert__(file, line, cond)
01558 #endif
01559 LDAP_SLAPD_V(int)  rs_suppress_assert;
01560 LDAP_SLAPD_F(void) rs_assert_(const char*, unsigned, const char*, const char*);
01561 # define RS_ASSERT(cond)           ((rs_suppress_assert > 0 || (cond)) \
01562        ? (void) 0 : rs_assert_(__FILE__, __LINE__, RS_FUNC_, #cond))
01563 #else
01564 # define RS_ASSERT(cond)           ((void) 0)
01565 # define rs_assert_ok(rs)          ((void) (rs))
01566 # define rs_assert_ready(rs)       ((void) (rs))
01567 # define rs_assert_done(rs)        ((void) (rs))
01568 #endif
01569 LDAP_SLAPD_F (void) (rs_assert_ok)        LDAP_P(( const SlapReply *rs ));
01570 LDAP_SLAPD_F (void) (rs_assert_ready)     LDAP_P(( const SlapReply *rs ));
01571 LDAP_SLAPD_F (void) (rs_assert_done)      LDAP_P(( const SlapReply *rs ));
01572 
01573 #define rs_reinit(rs, type) do {                 \
01574               SlapReply *const rsRI = (rs);             \
01575               rs_assert_done( rsRI );                          \
01576               rsRI->sr_type = (type);                          \
01577               /* Got type before memset in case of rs_reinit(rs, rs->sr_type) */ \
01578               assert( !offsetof( SlapReply, sr_type ) );       \
01579               memset( (slap_reply_t *) rsRI + 1, 0,            \
01580                      sizeof(*rsRI) - sizeof(slap_reply_t) );   \
01581        } while ( 0 )
01582 LDAP_SLAPD_F (void) (rs_reinit)    LDAP_P(( SlapReply *rs, slap_reply_t type ));
01583 LDAP_SLAPD_F (void) rs_flush_entry LDAP_P(( Operation *op,
01584        SlapReply *rs, slap_overinst *on ));
01585 LDAP_SLAPD_F (void) rs_replace_entry LDAP_P(( Operation *op,
01586        SlapReply *rs, slap_overinst *on, Entry *e ));
01587 LDAP_SLAPD_F (int) rs_entry2modifiable LDAP_P(( Operation *op,
01588        SlapReply *rs, slap_overinst *on ));
01589 #define rs_ensure_entry_modifiable rs_entry2modifiable /* older name */
01590 LDAP_SLAPD_F (void) slap_send_ldap_result LDAP_P(( Operation *op, SlapReply *rs ));
01591 LDAP_SLAPD_F (void) send_ldap_sasl LDAP_P(( Operation *op, SlapReply *rs ));
01592 LDAP_SLAPD_F (void) send_ldap_disconnect LDAP_P(( Operation *op, SlapReply *rs ));
01593 LDAP_SLAPD_F (void) slap_send_ldap_extended LDAP_P(( Operation *op, SlapReply *rs ));
01594 LDAP_SLAPD_F (void) slap_send_ldap_intermediate LDAP_P(( Operation *op, SlapReply *rs ));
01595 LDAP_SLAPD_F (void) slap_send_search_result LDAP_P(( Operation *op, SlapReply *rs ));
01596 LDAP_SLAPD_F (int) slap_send_search_reference LDAP_P(( Operation *op, SlapReply *rs ));
01597 LDAP_SLAPD_F (int) slap_send_search_entry LDAP_P(( Operation *op, SlapReply *rs ));
01598 LDAP_SLAPD_F (int) slap_null_cb LDAP_P(( Operation *op, SlapReply *rs ));
01599 LDAP_SLAPD_F (int) slap_freeself_cb LDAP_P(( Operation *op, SlapReply *rs ));
01600 
01601 LDAP_SLAPD_V( const struct berval ) slap_pre_read_bv;
01602 LDAP_SLAPD_V( const struct berval ) slap_post_read_bv;
01603 LDAP_SLAPD_F (int) slap_read_controls LDAP_P(( Operation *op, SlapReply *rs,
01604        Entry *e, const struct berval *oid, LDAPControl **ctrl ));
01605 
01606 LDAP_SLAPD_F (int) str2result LDAP_P(( char *s,
01607        int *code, char **matched, char **info ));
01608 LDAP_SLAPD_F (int) slap_map_api2result LDAP_P(( SlapReply *rs ));
01609 LDAP_SLAPD_F (slap_mask_t) slap_attr_flags LDAP_P(( AttributeName *an ));
01610 LDAP_SLAPD_F (ber_tag_t) slap_req2res LDAP_P(( ber_tag_t tag ));
01611 
01612 LDAP_SLAPD_V( const struct berval ) slap_dummy_bv;
01613 
01614 /*
01615  * root_dse.c
01616  */
01617 LDAP_SLAPD_F (int) root_dse_init LDAP_P(( void ));
01618 LDAP_SLAPD_F (int) root_dse_destroy LDAP_P(( void ));
01619 
01620 LDAP_SLAPD_F (int) root_dse_info LDAP_P((
01621        Connection *conn,
01622        Entry **e,
01623        const char **text ));
01624 
01625 LDAP_SLAPD_F (int) root_dse_read_file LDAP_P((
01626        const char *file));
01627 
01628 LDAP_SLAPD_F (int) slap_discover_feature LDAP_P((
01629        slap_bindconf *sb,
01630        const char    *attr,
01631        const char    *val ));
01632 
01633 LDAP_SLAPD_F (int) supported_feature_load LDAP_P(( struct berval *f ));
01634 LDAP_SLAPD_F (int) supported_feature_destroy LDAP_P(( void ));
01635 
01636 LDAP_SLAPD_F (int) entry_info_register LDAP_P(( SLAP_ENTRY_INFO_FN func, void *arg ));
01637 LDAP_SLAPD_F (int) entry_info_unregister LDAP_P(( SLAP_ENTRY_INFO_FN func, void *arg ));
01638 LDAP_SLAPD_F (void) entry_info_destroy LDAP_P(( void ));
01639 
01640 /*
01641  * sasl.c
01642  */
01643 LDAP_SLAPD_F (int) slap_sasl_init(void);
01644 LDAP_SLAPD_F (char *) slap_sasl_secprops( const char * );
01645 LDAP_SLAPD_F (void) slap_sasl_secprops_unparse( struct berval * );
01646 LDAP_SLAPD_F (int) slap_sasl_destroy(void);
01647 
01648 LDAP_SLAPD_F (int) slap_sasl_open( Connection *c, int reopen );
01649 LDAP_SLAPD_F (char **) slap_sasl_mechs( Connection *c );
01650 
01651 LDAP_SLAPD_F (int) slap_sasl_external( Connection *c,
01652        slap_ssf_t ssf,      /* relative strength of external security */
01653        struct berval *authid );    /* asserted authenication id */
01654 
01655 LDAP_SLAPD_F (int) slap_sasl_reset( Connection *c );
01656 LDAP_SLAPD_F (int) slap_sasl_close( Connection *c );
01657 
01658 LDAP_SLAPD_F (int) slap_sasl_bind LDAP_P(( Operation *op, SlapReply *rs ));
01659 
01660 LDAP_SLAPD_F (int) slap_sasl_setpass(
01661        Operation       *op,
01662        SlapReply     *rs );
01663 
01664 LDAP_SLAPD_F (int) slap_sasl_getdn( Connection *conn, Operation *op,
01665        struct berval *id, char *user_realm, struct berval *dn, int flags );
01666 
01667 /*
01668  * saslauthz.c
01669  */
01670 LDAP_SLAPD_F (int) slap_parse_user LDAP_P((
01671        struct berval *id, struct berval *user,
01672        struct berval *realm, struct berval *mech ));
01673 LDAP_SLAPD_F (int) slap_sasl_matches LDAP_P((
01674        Operation *op, BerVarray rules,
01675        struct berval *assertDN, struct berval *authc ));
01676 LDAP_SLAPD_F (void) slap_sasl2dn LDAP_P((
01677        Operation *op,
01678        struct berval *saslname,
01679        struct berval *dn,
01680        int flags ));
01681 LDAP_SLAPD_F (int) slap_sasl_authorized LDAP_P((
01682        Operation *op,
01683        struct berval *authcid,
01684        struct berval *authzid ));
01685 LDAP_SLAPD_F (int) slap_sasl_regexp_config LDAP_P((
01686        const char *match, const char *replace ));
01687 LDAP_SLAPD_F (void) slap_sasl_regexp_unparse LDAP_P(( BerVarray *bva ));
01688 LDAP_SLAPD_F (int) slap_sasl_setpolicy LDAP_P(( const char * ));
01689 LDAP_SLAPD_F (const char *) slap_sasl_getpolicy LDAP_P(( void ));
01690 #ifdef SLAP_AUTH_REWRITE
01691 LDAP_SLAPD_F (int) slap_sasl_rewrite_config LDAP_P(( 
01692        const char *fname,
01693        int lineno,
01694        int argc, 
01695        char **argv ));
01696 LDAP_SLAPD_F (void) slap_sasl_regexp_destroy LDAP_P(( void ));
01697 #endif /* SLAP_AUTH_REWRITE */
01698 LDAP_SLAPD_F (int) authzValidate LDAP_P((
01699        Syntax *syn, struct berval *in ));
01700 #if 0
01701 LDAP_SLAPD_F (int) authzMatch LDAP_P((
01702        int *matchp,
01703        slap_mask_t flags,
01704        Syntax *syntax,
01705        MatchingRule *mr,
01706        struct berval *value,
01707        void *assertedValue ));
01708 #endif
01709 LDAP_SLAPD_F (int) authzPretty LDAP_P((
01710        Syntax *syntax,
01711        struct berval *val,
01712        struct berval *out,
01713        void *ctx ));
01714 LDAP_SLAPD_F (int) authzNormalize LDAP_P((
01715        slap_mask_t usage,
01716        Syntax *syntax,
01717        MatchingRule *mr,
01718        struct berval *val,
01719        struct berval *normalized,
01720        void *ctx ));
01721 
01722 /*
01723  * schema.c
01724  */
01725 LDAP_SLAPD_F (int) schema_info LDAP_P(( Entry **entry, const char **text ));
01726 
01727 /*
01728  * schema_check.c
01729  */
01730 LDAP_SLAPD_F( int ) oc_check_allowed(
01731        AttributeType *type,
01732        ObjectClass **socs,
01733        ObjectClass *sc );
01734 
01735 LDAP_SLAPD_F( int ) structural_class(
01736        BerVarray ocs,
01737        ObjectClass **sc,
01738        ObjectClass ***socs,
01739        const char **text,
01740        char *textbuf, size_t textlen, void *ctx );
01741 
01742 LDAP_SLAPD_F( int ) entry_schema_check(
01743        Operation *op,
01744        Entry *e,
01745        Attribute *attrs,
01746        int manage,
01747        int add,
01748        Attribute **socp,
01749        const char** text,
01750        char *textbuf, size_t textlen );
01751 
01752 LDAP_SLAPD_F( int ) mods_structural_class(
01753        Modifications *mods,
01754        struct berval *oc,
01755        const char** text,
01756        char *textbuf, size_t textlen, void *ctx );
01757 
01758 /*
01759  * schema_init.c
01760  */
01761 LDAP_SLAPD_V( int ) schema_init_done;
01762 LDAP_SLAPD_F (int) slap_schema_init LDAP_P((void));
01763 LDAP_SLAPD_F (void) schema_destroy LDAP_P(( void ));
01764 
01765 LDAP_SLAPD_F( slap_mr_indexer_func ) octetStringIndexer;
01766 LDAP_SLAPD_F( slap_mr_filter_func ) octetStringFilter;
01767 
01768 LDAP_SLAPD_F( int ) numericoidValidate LDAP_P((
01769        Syntax *syntax,
01770         struct berval *in ));
01771 LDAP_SLAPD_F( int ) numericStringValidate LDAP_P((
01772        Syntax *syntax,
01773        struct berval *in ));
01774 LDAP_SLAPD_F( int ) octetStringMatch LDAP_P((
01775        int *matchp,
01776        slap_mask_t flags,
01777        Syntax *syntax,
01778        MatchingRule *mr,
01779        struct berval *value,
01780        void *assertedValue ));
01781 LDAP_SLAPD_F( int ) octetStringOrderingMatch LDAP_P((
01782        int *matchp,
01783        slap_mask_t flags,
01784        Syntax *syntax,
01785        MatchingRule *mr,
01786        struct berval *value,
01787        void *assertedValue ));
01788 
01789 /*
01790  * schema_prep.c
01791  */
01792 LDAP_SLAPD_V( struct slap_internal_schema ) slap_schema;
01793 LDAP_SLAPD_F (int) slap_schema_load LDAP_P((void));
01794 LDAP_SLAPD_F (int) slap_schema_check LDAP_P((void));
01795 
01796 /*
01797  * schemaparse.c
01798  */
01799 LDAP_SLAPD_F( int ) slap_valid_descr( const char * );
01800 
01801 LDAP_SLAPD_F (int) parse_cr LDAP_P((
01802        struct config_args_s *ca, ContentRule **scr ));
01803 LDAP_SLAPD_F (int) parse_oc LDAP_P((
01804        struct config_args_s *ca, ObjectClass **soc, ObjectClass *prev ));
01805 LDAP_SLAPD_F (int) parse_at LDAP_P((
01806        struct config_args_s *ca, AttributeType **sat, AttributeType *prev ));
01807 LDAP_SLAPD_F (char *) scherr2str LDAP_P((int code)) LDAP_GCCATTR((const));
01808 LDAP_SLAPD_F (int) dscompare LDAP_P(( const char *s1, const char *s2del,
01809        char delim ));
01810 LDAP_SLAPD_F (int) parse_syn LDAP_P((
01811        struct config_args_s *ca, Syntax **sat, Syntax *prev ));
01812 
01813 /*
01814  * sessionlog.c
01815  */
01816 LDAP_SLAPD_F (int) slap_send_session_log LDAP_P((
01817                                    Operation *, Operation *, SlapReply *));
01818 LDAP_SLAPD_F (int) slap_add_session_log LDAP_P((
01819                                    Operation *, Operation *, Entry * ));
01820 
01821 /*
01822  * sl_malloc.c
01823  */
01824 LDAP_SLAPD_F (void *) slap_sl_malloc LDAP_P((
01825        ber_len_t size, void *ctx ));
01826 LDAP_SLAPD_F (void *) slap_sl_realloc LDAP_P((
01827        void *block, ber_len_t size, void *ctx ));
01828 LDAP_SLAPD_F (void *) slap_sl_calloc LDAP_P((
01829        ber_len_t nelem, ber_len_t size, void *ctx ));
01830 LDAP_SLAPD_F (void) slap_sl_free LDAP_P((
01831        void *, void *ctx ));
01832 
01833 LDAP_SLAPD_V (BerMemoryFunctions) slap_sl_mfuncs;
01834 
01835 LDAP_SLAPD_F (void) slap_sl_mem_init LDAP_P(( void ));
01836 LDAP_SLAPD_F (void *) slap_sl_mem_create LDAP_P((
01837                                           ber_len_t size, int stack, void *ctx, int flag ));
01838 LDAP_SLAPD_F (void) slap_sl_mem_detach LDAP_P(( void *ctx, void *memctx ));
01839 LDAP_SLAPD_F (void) slap_sl_mem_destroy LDAP_P(( void *key, void *data ));
01840 LDAP_SLAPD_F (void *) slap_sl_context LDAP_P(( void *ptr ));
01841 
01842 /*
01843  * starttls.c
01844  */
01845 LDAP_SLAPD_F (SLAP_EXTOP_MAIN_FN) starttls_extop;
01846 
01847 /*
01848  * str2filter.c
01849  */
01850 LDAP_SLAPD_F (Filter *) str2filter LDAP_P(( const char *str ));
01851 LDAP_SLAPD_F (Filter *) str2filter_x LDAP_P(( Operation *op, const char *str ));
01852 
01853 /*
01854  * syncrepl.c
01855  */
01856 
01857 LDAP_SLAPD_F (int)  syncrepl_add_glue LDAP_P(( 
01858                                    Operation*, Entry* ));
01859 LDAP_SLAPD_F (void) syncrepl_diff_entry LDAP_P((
01860        Operation *op, Attribute *old, Attribute *anew,
01861        Modifications **mods, Modifications **ml, int is_ctx ));
01862 LDAP_SLAPD_F (void) syncinfo_free LDAP_P(( struct syncinfo_s *, int all ));
01863 
01864 /* syntax.c */
01865 LDAP_SLAPD_F (int) syn_is_sup LDAP_P((
01866        Syntax *syn,
01867        Syntax *sup ));
01868 LDAP_SLAPD_F (Syntax *) syn_find LDAP_P((
01869        const char *synname ));
01870 LDAP_SLAPD_F (Syntax *) syn_find_desc LDAP_P((
01871        const char *syndesc, int *slen ));
01872 LDAP_SLAPD_F (int) syn_add LDAP_P((
01873        LDAPSyntax *syn,
01874        int user,
01875        slap_syntax_defs_rec *def,
01876        Syntax **ssyn,
01877        Syntax *prev,
01878        const char **err ));
01879 LDAP_SLAPD_F (void) syn_destroy LDAP_P(( void ));
01880 
01881 LDAP_SLAPD_F (int) register_syntax LDAP_P((
01882        slap_syntax_defs_rec *def ));
01883 
01884 LDAP_SLAPD_F (int) syn_schema_info( Entry *e );
01885 
01886 LDAP_SLAPD_F (int) syn_start LDAP_P(( Syntax **at ));
01887 LDAP_SLAPD_F (int) syn_next LDAP_P(( Syntax **at ));
01888 LDAP_SLAPD_F (void) syn_delete LDAP_P(( Syntax *at ));
01889 
01890 LDAP_SLAPD_F (void) syn_unparse LDAP_P((
01891        BerVarray *bva, Syntax *start, Syntax *end, int system ));
01892 
01893 /*
01894  * user.c
01895  */
01896 #if defined(HAVE_PWD_H) && defined(HAVE_GRP_H)
01897 LDAP_SLAPD_F (void) slap_init_user LDAP_P(( char *username, char *groupname ));
01898 #endif
01899 
01900 /*
01901  * value.c
01902  */
01903 LDAP_SLAPD_F (int) asserted_value_validate_normalize LDAP_P((
01904        AttributeDescription *ad,
01905        MatchingRule *mr,
01906        unsigned usage,
01907        struct berval *in,
01908        struct berval *out,
01909        const char ** text,
01910        void *ctx ));
01911 
01912 LDAP_SLAPD_F (int) value_match LDAP_P((
01913        int *match,
01914        AttributeDescription *ad,
01915        MatchingRule *mr,
01916        unsigned flags,
01917        struct berval *v1,
01918        void *v2,
01919        const char ** text ));
01920 LDAP_SLAPD_F (int) value_find_ex LDAP_P((
01921        AttributeDescription *ad,
01922        unsigned flags,
01923        BerVarray values,
01924        struct berval *value,
01925        void *ctx ));
01926 
01927 LDAP_SLAPD_F (int) ordered_value_add LDAP_P((
01928        Entry *e,
01929        AttributeDescription *ad,
01930        Attribute *a,
01931        BerVarray vals,
01932        BerVarray nvals ));
01933 
01934 LDAP_SLAPD_F (int) ordered_value_validate LDAP_P((
01935        AttributeDescription *ad,
01936        struct berval *in,
01937        int mop ));
01938 
01939 LDAP_SLAPD_F (int) ordered_value_pretty LDAP_P((
01940        AttributeDescription *ad,
01941        struct berval *val,
01942        struct berval *out,
01943        void *ctx ));
01944 
01945 LDAP_SLAPD_F (int) ordered_value_normalize LDAP_P((
01946        slap_mask_t usage,
01947        AttributeDescription *ad,
01948        MatchingRule *mr,
01949        struct berval *val,
01950        struct berval *normalized,
01951        void *ctx ));
01952 
01953 LDAP_SLAPD_F (int) ordered_value_match LDAP_P((
01954        int *match,
01955        AttributeDescription *ad,
01956        MatchingRule *mr,
01957        unsigned flags,
01958        struct berval *v1,
01959        struct berval *v2,
01960        const char ** text ));
01961 
01962 LDAP_SLAPD_F (void) ordered_value_renumber LDAP_P((
01963        Attribute *a ));
01964 
01965 LDAP_SLAPD_F (int) ordered_value_sort LDAP_P((
01966        Attribute *a,
01967        int do_renumber ));
01968 
01969 LDAP_SLAPD_F (int) value_add LDAP_P((
01970        BerVarray *vals,
01971        BerVarray addvals ));
01972 LDAP_SLAPD_F (int) value_add_one LDAP_P((
01973        BerVarray *vals,
01974        struct berval *addval ));
01975 
01976 /* assumes (x) > (y) returns 1 if true, 0 otherwise */
01977 #define SLAP_PTRCMP(x, y) ((x) < (y) ? -1 : (x) > (y))
01978 
01979 #ifdef SLAP_ZONE_ALLOC
01980 /*
01981  * zn_malloc.c
01982  */
01983 LDAP_SLAPD_F (void *) slap_zn_malloc LDAP_P((ber_len_t, void *));
01984 LDAP_SLAPD_F (void *) slap_zn_realloc LDAP_P((void *, ber_len_t, void *));
01985 LDAP_SLAPD_F (void *) slap_zn_calloc LDAP_P((ber_len_t, ber_len_t, void *));
01986 LDAP_SLAPD_F (void) slap_zn_free LDAP_P((void *, void *));
01987 
01988 LDAP_SLAPD_F (void *) slap_zn_mem_create LDAP_P((
01989                                                  ber_len_t, ber_len_t, ber_len_t, ber_len_t));
01990 LDAP_SLAPD_F (void) slap_zn_mem_destroy LDAP_P((void *));
01991 LDAP_SLAPD_F (int) slap_zn_validate LDAP_P((void *, void *, int));
01992 LDAP_SLAPD_F (int) slap_zn_invalidate LDAP_P((void *, void *));
01993 LDAP_SLAPD_F (int) slap_zh_rlock LDAP_P((void*));
01994 LDAP_SLAPD_F (int) slap_zh_runlock LDAP_P((void*));
01995 LDAP_SLAPD_F (int) slap_zh_wlock LDAP_P((void*));
01996 LDAP_SLAPD_F (int) slap_zh_wunlock LDAP_P((void*));
01997 LDAP_SLAPD_F (int) slap_zn_rlock LDAP_P((void*, void*));
01998 LDAP_SLAPD_F (int) slap_zn_runlock LDAP_P((void*, void*));
01999 LDAP_SLAPD_F (int) slap_zn_wlock LDAP_P((void*, void*));
02000 LDAP_SLAPD_F (int) slap_zn_wunlock LDAP_P((void*, void*));
02001 #endif
02002 
02003 /*
02004  * Other...
02005  */
02006 LDAP_SLAPD_V (unsigned int) index_substr_if_minlen;
02007 LDAP_SLAPD_V (unsigned int) index_substr_if_maxlen;
02008 LDAP_SLAPD_V (unsigned int) index_substr_any_len;
02009 LDAP_SLAPD_V (unsigned int) index_substr_any_step;
02010 LDAP_SLAPD_V (unsigned int) index_intlen;
02011 /* all signed integers from strings of this size need more than intlen bytes */
02012 /* i.e. log(10)*(index_intlen_strlen-2) > log(2)*(8*(index_intlen)-1) */
02013 LDAP_SLAPD_V (unsigned int) index_intlen_strlen;
02014 #define SLAP_INDEX_INTLEN_STRLEN(intlen) ((8*(intlen)-1) * 146/485 + 3)
02015 
02016 LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming;
02017 LDAP_SLAPD_V (ber_len_t) sockbuf_max_incoming_auth;
02018 LDAP_SLAPD_V (int)          slap_conn_max_pending;
02019 LDAP_SLAPD_V (int)          slap_conn_max_pending_auth;
02020 
02021 LDAP_SLAPD_V (slap_mask_t)  global_allows;
02022 LDAP_SLAPD_V (slap_mask_t)  global_disallows;
02023 
02024 LDAP_SLAPD_V (BerVarray)    default_referral;
02025 LDAP_SLAPD_V (const char)   Versionstr[];
02026 
02027 LDAP_SLAPD_V (int)          global_gentlehup;
02028 LDAP_SLAPD_V (int)          global_idletimeout;
02029 LDAP_SLAPD_V (int)          global_writetimeout;
02030 LDAP_SLAPD_V (char *)       global_host;
02031 LDAP_SLAPD_V (struct berval)       global_host_bv;
02032 LDAP_SLAPD_V (char *)       global_realm;
02033 LDAP_SLAPD_V (char *)       sasl_host;
02034 LDAP_SLAPD_V (char *)       slap_sasl_auxprops;
02035 LDAP_SLAPD_V (char **)      default_passwd_hash;
02036 LDAP_SLAPD_V (int)          lber_debug;
02037 LDAP_SLAPD_V (int)          ldap_syslog;
02038 LDAP_SLAPD_V (struct berval)       default_search_base;
02039 LDAP_SLAPD_V (struct berval)       default_search_nbase;
02040 
02041 LDAP_SLAPD_V (slap_counters_t)     slap_counters;
02042 
02043 LDAP_SLAPD_V (char *)              slapd_pid_file;
02044 LDAP_SLAPD_V (char *)              slapd_args_file;
02045 LDAP_SLAPD_V (time_t)              starttime;
02046 
02047 /* use time(3) -- no mutex */
02048 #define slap_get_time()     time( NULL )
02049 
02050 LDAP_SLAPD_V (ldap_pvt_thread_pool_t)     connection_pool;
02051 LDAP_SLAPD_V (int)                 connection_pool_max;
02052 LDAP_SLAPD_V (int)                 slap_tool_thread_max;
02053 
02054 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t)    entry2str_mutex;
02055 
02056 #ifndef LDAP_DEVEL
02057        /* to be removed with 2.5 */
02058 #define gmtime_mutex ldap_int_gmtime_mutex
02059 #endif /* ! LDAP_DEVEL */
02060 
02061 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t)    ad_index_mutex;
02062 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t)    ad_undef_mutex;
02063 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t)    oc_undef_mutex;
02064 
02065 LDAP_SLAPD_V (ber_socket_t) dtblsize;
02066 
02067 LDAP_SLAPD_V (int)          use_reverse_lookup;
02068 
02069 /*
02070  * operations
02071  */
02072 LDAP_SLAPD_F (int) do_abandon LDAP_P((Operation *op, SlapReply *rs));
02073 LDAP_SLAPD_F (int) do_add LDAP_P((Operation *op, SlapReply *rs));
02074 LDAP_SLAPD_F (int) do_bind LDAP_P((Operation *op, SlapReply *rs));
02075 LDAP_SLAPD_F (int) do_compare LDAP_P((Operation *op, SlapReply *rs));
02076 LDAP_SLAPD_F (int) do_delete LDAP_P((Operation *op, SlapReply *rs));
02077 LDAP_SLAPD_F (int) do_modify LDAP_P((Operation *op, SlapReply *rs));
02078 LDAP_SLAPD_F (int) do_modrdn LDAP_P((Operation *op, SlapReply *rs));
02079 LDAP_SLAPD_F (int) do_search LDAP_P((Operation *op, SlapReply *rs));
02080 LDAP_SLAPD_F (int) do_unbind LDAP_P((Operation *op, SlapReply *rs));
02081 LDAP_SLAPD_F (int) do_extended LDAP_P((Operation *op, SlapReply *rs));
02082 
02083 /*
02084  * frontend operations
02085  */
02086 LDAP_SLAPD_F (int) fe_op_abandon LDAP_P((Operation *op, SlapReply *rs));
02087 LDAP_SLAPD_F (int) fe_op_add LDAP_P((Operation *op, SlapReply *rs));
02088 LDAP_SLAPD_F (int) fe_op_bind LDAP_P((Operation *op, SlapReply *rs));
02089 LDAP_SLAPD_F (int) fe_op_bind_success LDAP_P(( Operation *op, SlapReply *rs ));
02090 LDAP_SLAPD_F (int) fe_op_compare LDAP_P((Operation *op, SlapReply *rs));
02091 LDAP_SLAPD_F (int) fe_op_delete LDAP_P((Operation *op, SlapReply *rs));
02092 LDAP_SLAPD_F (int) fe_op_modify LDAP_P((Operation *op, SlapReply *rs));
02093 LDAP_SLAPD_F (int) fe_op_modrdn LDAP_P((Operation *op, SlapReply *rs));
02094 LDAP_SLAPD_F (int) fe_op_search LDAP_P((Operation *op, SlapReply *rs));
02095 LDAP_SLAPD_F (int) fe_aux_operational LDAP_P((Operation *op, SlapReply *rs));
02096 #if 0
02097 LDAP_SLAPD_F (int) fe_op_unbind LDAP_P((Operation *op, SlapReply *rs));
02098 #endif
02099 LDAP_SLAPD_F (int) fe_extended LDAP_P((Operation *op, SlapReply *rs));
02100 LDAP_SLAPD_F (int) fe_acl_group LDAP_P((
02101        Operation *op,
02102        Entry  *target,
02103        struct berval *gr_ndn,
02104        struct berval *op_ndn,
02105        ObjectClass *group_oc,
02106        AttributeDescription *group_at ));
02107 LDAP_SLAPD_F (int) fe_acl_attribute LDAP_P((
02108        Operation *op,
02109        Entry  *target,
02110        struct berval *edn,
02111        AttributeDescription *entry_at,
02112        BerVarray *vals,
02113        slap_access_t access ));
02114 LDAP_SLAPD_F (int) fe_access_allowed LDAP_P((
02115        Operation            *op,
02116        Entry                *e,
02117        AttributeDescription *desc,
02118        struct berval        *val,
02119        slap_access_t        access,
02120        AccessControlState   *state,
02121        slap_mask_t          *maskp ));
02122 
02123 /* NOTE: this macro assumes that bv has been allocated
02124  * by ber_* malloc functions or is { 0L, NULL } */
02125 #ifdef USE_MP_BIGNUM
02126 # define UI2BVX(bv,ui,ctx) \
02127        do { \
02128               char          *val; \
02129               ber_len_t     len; \
02130               val = BN_bn2dec(ui); \
02131               if (val) { \
02132                      len = strlen(val); \
02133                      if ( len > (bv)->bv_len ) { \
02134                             (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \
02135                      } \
02136                      AC_MEMCPY((bv)->bv_val, val, len + 1); \
02137                      (bv)->bv_len = len; \
02138                      OPENSSL_free(val); \
02139               } else { \
02140                      ber_memfree_x( (bv)->bv_val, (ctx) ); \
02141                      BER_BVZERO( (bv) ); \
02142               } \
02143        } while ( 0 )
02144 
02145 #elif defined( USE_MP_GMP )
02146 /* NOTE: according to the documentation, the result 
02147  * of mpz_sizeinbase() can exceed the length of the
02148  * string representation of the number by 1
02149  */
02150 # define UI2BVX(bv,ui,ctx) \
02151        do { \
02152               ber_len_t     len = mpz_sizeinbase( (ui), 10 ); \
02153               if ( len > (bv)->bv_len ) { \
02154                      (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \
02155               } \
02156               (void)mpz_get_str( (bv)->bv_val, 10, (ui) ); \
02157               if ( (bv)->bv_val[ len - 1 ] == '\0' ) { \
02158                      len--; \
02159               } \
02160               (bv)->bv_len = len; \
02161        } while ( 0 )
02162 
02163 #else
02164 # ifdef USE_MP_LONG_LONG
02165 #  define UI2BV_FORMAT      "%llu"
02166 # elif defined USE_MP_LONG
02167 #  define UI2BV_FORMAT      "%lu"
02168 # elif defined HAVE_LONG_LONG
02169 #  define UI2BV_FORMAT      "%llu"
02170 # else
02171 #  define UI2BV_FORMAT      "%lu"
02172 # endif
02173 
02174 # define UI2BVX(bv,ui,ctx) \
02175        do { \
02176               char          buf[LDAP_PVT_INTTYPE_CHARS(long)]; \
02177               ber_len_t     len; \
02178               len = snprintf( buf, sizeof( buf ), UI2BV_FORMAT, (ui) ); \
02179               if ( len > (bv)->bv_len ) { \
02180                      (bv)->bv_val = ber_memrealloc_x( (bv)->bv_val, len + 1, (ctx) ); \
02181               } \
02182               (bv)->bv_len = len; \
02183               AC_MEMCPY( (bv)->bv_val, buf, len + 1 ); \
02184        } while ( 0 )
02185 #endif
02186 
02187 #define UI2BV(bv,ui) UI2BVX(bv,ui,NULL)
02188 
02189 LDAP_END_DECL
02190 
02191 #endif /* PROTO_SLAP_H */