]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/proto-slap.h
Align Operation buffers using LBER_ALIGNED_BUFFER
[openldap] / servers / slapd / proto-slap.h
index b571762887ba6403a50d63bdc42681b960a89827..995bc053595b633bf441eb8efb431d57c8173d46 100644 (file)
 
 LDAP_BEGIN_DECL
 
+/*
+ * aci.c
+ */
+#ifdef SLAPD_ACI_ENABLED
+LDAP_SLAPD_F (int) aci_mask LDAP_P((
+       Operation *op, Entry *e,
+       AttributeDescription *desc,
+       struct berval *val,
+       struct berval *aci,
+       int nmatch,
+       regmatch_t *matches,
+       slap_access_t *grant,
+       slap_access_t *deny,
+       slap_aci_scope_t scope));
+#ifdef SLAP_DYNACL
+LDAP_SLAPD_F (int) dynacl_aci_init LDAP_P(( void ));
+#else /* !SLAP_DYNACL */
+LDAP_SLAPD_F (int) aci_init LDAP_P(( void ));
+LDAP_SLAPD_V (AttributeDescription *) slap_ad_aci;
+#endif /* !SLAP_DYNACL */
+#endif /* SLAPD_ACI_ENABLED */
+
 /*
  * acl.c
  */
@@ -71,6 +93,22 @@ 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 ));
 
+LDAP_SLAPD_V (const struct berval) aci_bv[];
+
+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,
+       int setref ));
+LDAP_SLAPD_F (int) acl_string_expand LDAP_P((
+       struct berval *newbuf, struct berval *pattern,
+       char *match, int nmatch, regmatch_t *matches ));
+
 /*
  * aclparse.c
  */
@@ -121,12 +159,18 @@ LDAP_SLAPD_F (int) ad_inlist LDAP_P((
 LDAP_SLAPD_F (int) slap_str2undef_ad LDAP_P((
        const char *,
        AttributeDescription **ad,
-       const char **text ));
+       const char **text,
+       unsigned proxied ));
 
 LDAP_SLAPD_F (int) slap_bv2undef_ad LDAP_P((
        struct berval *bv,
        AttributeDescription **ad,
-       const char **text ));
+       const char **text,
+       unsigned proxied ));
+
+LDAP_SLAPD_F (int) slap_ad_undef_promote LDAP_P((
+       char *name,
+       AttributeType *nat ));
 
 LDAP_SLAPD_F (AttributeDescription *) ad_find_tags LDAP_P((
        AttributeType *type,
@@ -157,7 +201,7 @@ LDAP_SLAPD_V( AttributeName * ) slap_anlist_all_attributes;
  * add.c
  */
 LDAP_SLAPD_F (int) slap_mods2entry LDAP_P(( Modifications *mods, Entry **e,
-       int repl_user, int dup, const char **text, char *textbuf, size_t textlen ));
+       int initial, int dup, const char **text, char *textbuf, size_t textlen ));
 
 LDAP_SLAPD_F (int) slap_entry2mods LDAP_P(( Entry *e,
                                                Modifications **mods, const char **text,
@@ -256,6 +300,10 @@ LDAP_SLAPD_F (void) ava_free LDAP_P((
 /*
  * backend.c
  */
+
+#define be_match( be1, be2 )   ( (be1) == (be2) || \
+                                 ( (be1) && (be2) && (be1)->be_nsuffix == (be2)->be_nsuffix ) )
+
 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));
@@ -264,7 +312,7 @@ LDAP_SLAPD_F (int) backend_startup_one LDAP_P((Backend *be));
 LDAP_SLAPD_F (int) backend_sync LDAP_P((Backend *be));
 LDAP_SLAPD_F (int) backend_shutdown LDAP_P((Backend *be));
 LDAP_SLAPD_F (int) backend_destroy LDAP_P((void));
-LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd));
+LDAP_SLAPD_F (void) backend_destroy_one LDAP_P((BackendDB *bd, int dynamic));
 
 LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
 LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type ));
@@ -346,13 +394,14 @@ LDAP_SLAPD_V(BackendInfo) slap_binfo[];
  * backglue.c
  */
 
-LDAP_SLAPD_F (int) glue_back_initialize( BackendInfo *bi );
 LDAP_SLAPD_F (int) glue_sub_init( void );
+LDAP_SLAPD_F (int) glue_sub_attach( void );
+LDAP_SLAPD_F (int) glue_sub_add( BackendDB *be, int advert, int online );
+LDAP_SLAPD_F (int) glue_sub_del( BackendDB *be );
 
 /*
  * backover.c
  */
-
 LDAP_SLAPD_F (int) overlay_register LDAP_P(( slap_overinst *on ));
 LDAP_SLAPD_F (int) overlay_config LDAP_P(( BackendDB *be, const char *ov ));
 LDAP_SLAPD_F (void) overlay_destroy_one LDAP_P((
@@ -372,6 +421,12 @@ LDAP_SLAPD_F (int) overlay_op_walk LDAP_P((
        slap_overinfo *oi,
        slap_overinst *on ));
 
+/*
+ * bconfig.c
+ */
+LDAP_SLAPD_F (int) slap_loglevel_register LDAP_P (( slap_mask_t m, struct berval *s ));
+LDAP_SLAPD_F (int) str2loglevel LDAP_P(( const char *s, int *l ));
+
 /*
  * ch_malloc.c
  */
@@ -521,6 +576,11 @@ LDAP_SLAPD_F (int) slap_find_control_id LDAP_P ((
        const char *oid, int *cid ));
 LDAP_SLAPD_F (int) slap_global_control LDAP_P ((
        Operation *op, const char *oid, int *cid ));
+LDAP_SLAPD_F (int) slap_remove_control LDAP_P((
+       Operation       *op,
+       SlapReply       *rs,
+       int             ctrl,
+       BI_chk_controls fnc ));
 
 /*
  * config.c
@@ -537,6 +597,10 @@ LDAP_SLAPD_F (int) mask_to_verbs LDAP_P((
        slap_verbmasks *v, slap_mask_t m, BerVarray *bva ));
 LDAP_SLAPD_F (int) enum_to_verb LDAP_P((
        slap_verbmasks *v, slap_mask_t m, struct berval *bv ));
+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 ));
 LDAP_SLAPD_F (int) bindconf_parse LDAP_P((
        const char *word,  slap_bindconf *bc ));
 LDAP_SLAPD_F (int) bindconf_unparse LDAP_P((
@@ -575,13 +639,18 @@ LDAP_SLAPD_F (long) connection_init LDAP_P((
        slap_ssf_t ssf,
        struct berval *id ));
 
-LDAP_SLAPD_F (void) connection_closing LDAP_P(( Connection *c ));
+LDAP_SLAPD_F (void) connection_closing LDAP_P((
+       Connection *c, const char *why ));
 LDAP_SLAPD_F (int) connection_state_closing LDAP_P(( Connection *c ));
 LDAP_SLAPD_F (const char *) connection_state2str LDAP_P(( int state ))
        LDAP_GCCATTR((const));
 
 LDAP_SLAPD_F (int) connection_write LDAP_P((ber_socket_t s));
+#ifdef SLAP_LIGHTWEIGHT_LISTENER
+LDAP_SLAPD_F (int) connection_read LDAP_P((ber_socket_t, Operation **));
+#else
 LDAP_SLAPD_F (int) connection_read LDAP_P((ber_socket_t s));
+#endif
 
 LDAP_SLAPD_F (unsigned long) connections_nextid(void);
 
@@ -720,7 +789,7 @@ LDAP_SLAPD_F (int) dnExtractRdn LDAP_P((
 
 LDAP_SLAPD_F (int) rdn_validate LDAP_P(( struct berval * rdn ));
 
-LDAP_SLAPD_F (int) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
+LDAP_SLAPD_F (ber_len_t) dn_rdnlen LDAP_P(( Backend *be, struct berval *dn ));
 
 LDAP_SLAPD_F (void) build_new_dn LDAP_P((
        struct berval * new_dn,
@@ -888,7 +957,7 @@ LDAP_SLAPD_F (void) slap_compose_sync_cookie LDAP_P((
 LDAP_SLAPD_F (void) slap_sync_cookie_free LDAP_P((
                                struct sync_cookie *, int free_cookie ));
 LDAP_SLAPD_F (int) slap_parse_sync_cookie LDAP_P((
-                               struct sync_cookie * ));
+                               struct sync_cookie *, void *memctx ));
 LDAP_SLAPD_F (int) slap_init_sync_cookie_ctxcsn LDAP_P((
                                struct sync_cookie * ));
 LDAP_SLAPD_F (struct sync_cookie *) slap_dup_sync_cookie LDAP_P((
@@ -913,6 +982,7 @@ LDAP_SLAPD_F (void) limits_unparse_one LDAP_P((
        struct slap_limits_set *limit, int which, struct berval *bv ));
 LDAP_SLAPD_F (void) limits_unparse LDAP_P(( 
        struct slap_limits *limit, struct berval *bv ));
+LDAP_SLAPD_F (void) limits_destroy LDAP_P(( struct slap_limits **lm ));
 
 /*
  * lock.c
@@ -955,6 +1025,13 @@ LDAP_SLAPD_F( int ) slap_mods_no_user_mod_check(
        const char **text,
        char *textbuf, size_t textlen );
 
+LDAP_SLAPD_F ( int ) slap_mods_no_repl_user_mod_check(
+       Operation *op,
+       Modifications *ml,
+       const char **text,
+       char *textbuf,
+       size_t textlen );
+
 LDAP_SLAPD_F( int ) slap_mods_check(
        Modifications *ml,
        const char **text,
@@ -997,7 +1074,7 @@ LDAP_SLAPD_F( int ) modify_increment_values( Entry *e,
        const char **text, char *textbuf, size_t textlen );
 
 LDAP_SLAPD_F( void ) slap_mod_free( Modification *mod, int freeit );
-LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods );
+LDAP_SLAPD_F( void ) slap_mods_free( Modifications *mods, int freevals );
 LDAP_SLAPD_F( void ) slap_modlist_free( LDAPModList *ml );
 
 /*
@@ -1076,39 +1153,41 @@ LDAP_SLAPD_F (int) is_object_subclass LDAP_P((
        ObjectClass *sub ));
 
 LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
-       Entry *, ObjectClass *oc, int set_flags ));
+       Entry *, ObjectClass *oc, unsigned flags ));
+#define        is_entry_objectclass_or_sub(e,oc) \
+       (is_entry_objectclass((e),(oc),SLAP_OCF_CHECK_SUP))
 #define is_entry_alias(e)              \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_ALIAS) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_alias, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_alias, SLAP_OCF_SET_FLAGS))
 #define is_entry_referral(e)   \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_REFERRAL) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_referral, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_referral, SLAP_OCF_SET_FLAGS))
 #define is_entry_subentry(e)   \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_SUBENTRY) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_subentry, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_subentry, SLAP_OCF_SET_FLAGS))
 #define is_entry_collectiveAttributeSubentry(e)        \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributeSubentry, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_collectiveAttributeSubentry, SLAP_OCF_SET_FLAGS))
 #define is_entry_dynamicObject(e)      \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_DYNAMICOBJECT) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, SLAP_OCF_SET_FLAGS))
 #define is_entry_glue(e)       \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_GLUE) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_glue, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_glue, SLAP_OCF_SET_FLAGS))
 #define is_entry_syncProviderSubentry(e)       \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_SYNCPROVIDERSUBENTRY) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_syncProviderSubentry, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_syncProviderSubentry, SLAP_OCF_SET_FLAGS))
 #define is_entry_syncConsumerSubentry(e)       \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_SYNCCONSUMERSUBENTRY) != 0) \
-        : is_entry_objectclass((e), slap_schema.si_oc_syncConsumerSubentry, 1))
+        : is_entry_objectclass((e), slap_schema.si_oc_syncConsumerSubentry, SLAP_OCF_SET_FLAGS))
 
 LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
 LDAP_SLAPD_F (void) oc_unparse LDAP_P((
@@ -1219,6 +1298,7 @@ LDAP_SLAPD_F (int) get_alias_dn LDAP_P((
  */
 LDAP_SLAPD_F (int) add_replica_info LDAP_P(( Backend *be,
        const char *uri, const char *host ));
+LDAP_SLAPD_F (int) destroy_replica_info LDAP_P (( Backend *be ));
 LDAP_SLAPD_F (int) add_replica_suffix LDAP_P(( Backend *be,
        int nr, const char *suffix ));
 LDAP_SLAPD_F (int) add_replica_attrs LDAP_P(( Backend *be,
@@ -1326,6 +1406,31 @@ LDAP_SLAPD_F (int) slap_sasl_rewrite_config LDAP_P((
        int argc, 
        char **argv ));
 #endif /* SLAP_AUTH_REWRITE */
+#ifdef SLAP_AUTHZ_SYNTAX
+LDAP_SLAPD_F (int) authzValidate LDAP_P((
+       Syntax *syn, struct berval *in ));
+#if 0
+LDAP_SLAPD_F (int) authzMatch LDAP_P((
+       int *matchp,
+       slap_mask_t flags,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *value,
+       void *assertedValue ));
+#endif
+LDAP_SLAPD_F (int) authzPretty LDAP_P((
+       Syntax *syntax,
+       struct berval *val,
+       struct berval *out,
+       void *ctx ));
+LDAP_SLAPD_F (int) authzNormalize LDAP_P((
+       slap_mask_t usage,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *val,
+       struct berval *normalized,
+       void *ctx ));
+#endif /* SLAP_AUTHZ_SYNTAX */
 
 /*
  * schema.c
@@ -1348,7 +1453,7 @@ LDAP_SLAPD_F( int ) structural_class(
        char *textbuf, size_t textlen );
 
 LDAP_SLAPD_F( int ) entry_schema_check(
-       Backend *be,
+       Operation *op,
        Entry *e,
        Attribute *attrs,
        int manage,
@@ -1371,6 +1476,16 @@ LDAP_SLAPD_F (void) schema_destroy LDAP_P(( void ));
 LDAP_SLAPD_F( slap_mr_indexer_func ) octetStringIndexer;
 LDAP_SLAPD_F( slap_mr_filter_func ) octetStringFilter;
 
+LDAP_SLAPD_F( int ) numericoidValidate LDAP_P((
+       struct slap_syntax *syntax,
+        struct berval *in ));
+LDAP_SLAPD_F( int ) octetStringMatch LDAP_P((
+       int *matchp,
+       slap_mask_t flags,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *value,
+       void *assertedValue ));
 
 /*
  * schema_prep.c
@@ -1502,6 +1617,24 @@ LDAP_SLAPD_F (int) ordered_value_add LDAP_P((
        BerVarray vals,
        BerVarray nvals ));
 
+LDAP_SLAPD_F (int) ordered_value_validate LDAP_P((
+       AttributeDescription *ad,
+       struct berval *in ));
+
+LDAP_SLAPD_F (int) ordered_value_pretty LDAP_P((
+       AttributeDescription *ad,
+       struct berval *val,
+       struct berval *out,
+       void *ctx ));
+
+LDAP_SLAPD_F (int) ordered_value_normalize LDAP_P((
+       slap_mask_t usage,
+       AttributeDescription *ad,
+       MatchingRule *mr,
+       struct berval *val,
+       struct berval *normalized,
+       void *ctx ));
+
 LDAP_SLAPD_F (int) ordered_value_match LDAP_P((
        int *match,
        AttributeDescription *ad,
@@ -1601,6 +1734,9 @@ LDAP_SLAPD_V (ldap_pvt_thread_mutex_t)    replog_mutex;
 LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) gmtime_mutex;
 #endif
 
+LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) ad_undef_mutex;
+LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) oc_undef_mutex;
+
 LDAP_SLAPD_V (ber_socket_t)    dtblsize;
 
 LDAP_SLAPD_V (int)             use_reverse_lookup;
@@ -1634,10 +1770,33 @@ LDAP_SLAPD_F (int) fe_op_delete LDAP_P((Operation *op, SlapReply *rs));
 LDAP_SLAPD_F (int) fe_op_modify LDAP_P((Operation *op, SlapReply *rs));
 LDAP_SLAPD_F (int) fe_op_modrdn LDAP_P((Operation *op, SlapReply *rs));
 LDAP_SLAPD_F (int) fe_op_search LDAP_P((Operation *op, SlapReply *rs));
+LDAP_SLAPD_F (int) fe_aux_operational LDAP_P((Operation *op, SlapReply *rs));
 #if 0
 LDAP_SLAPD_F (int) fe_op_unbind LDAP_P((Operation *op, SlapReply *rs));
 #endif
 LDAP_SLAPD_F (int) fe_extended LDAP_P((Operation *op, SlapReply *rs));
+LDAP_SLAPD_F (int) fe_acl_group LDAP_P((
+       Operation *op,
+       Entry   *target,
+       struct berval *gr_ndn,
+       struct berval *op_ndn,
+       ObjectClass *group_oc,
+       AttributeDescription *group_at ));
+LDAP_SLAPD_F (int) fe_acl_attribute LDAP_P((
+       Operation *op,
+       Entry   *target,
+       struct berval   *edn,
+       AttributeDescription *entry_at,
+       BerVarray *vals,
+       slap_access_t access ));
+LDAP_SLAPD_F (int) fe_access_allowed LDAP_P((
+       Operation               *op,
+       Entry                   *e,
+       AttributeDescription    *desc,
+       struct berval           *val,
+       slap_access_t           access,
+       AccessControlState      *state,
+       slap_mask_t             *maskp ));
 
 /* NOTE: this macro assumes that bv has been allocated
  * by ber_* malloc functions or is { 0L, NULL } */