]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/proto-bdb.h
Cancel exop updates
[openldap] / servers / slapd / back-bdb / proto-bdb.h
index 4fd1c3f02a9d04b8cd9a84bd56faf2c32c369b9c..5ec4228d434f27007586aed40c257c16dfbbaa35 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2003 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -15,7 +15,7 @@ LDAP_BEGIN_DECL
 Entry *bdb_deref_internal_r LDAP_P((
        BackendDB *be,
        Entry *e,
-       const char *dn,
+       struct berval *dn,
        int *err,
        Entry **matched,
        const char **text ));
@@ -43,10 +43,7 @@ void bdb_attr_index_destroy LDAP_P(( Avlnode *tree ));
  * attribute.c
  */
 
-int
-bdb_attribute LDAP_P(( Backend *be, Connection *conn, Operation *op,
-       Entry *target, const char *e_ndn, AttributeDescription *entry_at,
-       struct berval ***vals ));
+BI_acl_attribute bdb_attribute;
 
 /*
  * dbcache.c
@@ -60,8 +57,13 @@ bdb_db_cache(
 /*
  * dn2entry.c
  */
-int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
-       const char *dn, Entry **e, Entry **matched, int flags ));
+int bdb_dn2entry_rw LDAP_P(( BackendDB *be, DB_TXN *tid,
+       struct berval *dn, Entry **e, Entry **matched, int flags, int rw,
+       u_int32_t locker, DB_LOCK *lock));
+#define bdb_dn2entry_r(be, tid, dn, e, m, f, locker, lock) \
+       bdb_dn2entry_rw((be), (tid), (dn), (e), (m), (f), 0, locker, lock)
+#define bdb_dn2entry_w(be, tid, dn, e, m, f, locker, lock) \
+       bdb_dn2entry_rw((be), (tid), (dn), (e), (m), (f), 1, locker, lock)
 
 /*
  * dn2id.c
@@ -69,44 +71,48 @@ int bdb_dn2entry LDAP_P(( BackendDB *be, DB_TXN *tid,
 int bdb_dn2id(
        BackendDB *be,
        DB_TXN *tid,
-       const char *dn,
-       ID *id );
+       struct berval *dn,
+       ID *id,
+       int flags );
 
 int bdb_dn2id_matched(
        BackendDB *be,
        DB_TXN *tid,
-       const char *dn,
+       struct berval *dn,
        ID *id,
-       char **matchedDN );
+       ID *id2,
+       int flags );
 
 int bdb_dn2id_add(
        BackendDB *be,
        DB_TXN *tid,
-       const char *dn,
-       ID id );
+       struct berval *pdn,
+       Entry *e );
 
 int bdb_dn2id_delete(
        BackendDB *be,
        DB_TXN *tid,
-       const char *dn,
-       ID id );
+       char *pdn,
+       Entry *e );
 
 int bdb_dn2id_children(
        BackendDB *be,
        DB_TXN *tid,
-       const char *dn );
+       struct berval *dn,
+       int flags );
 
 int
 bdb_dn2idl(
        BackendDB       *be,
-       const char      *dn,
+       struct berval   *dn,
        int prefix,
        ID *ids );
 
 /*
  * entry.c
  */
-int bdb_entry_return( BackendDB *be, Entry *e );
+int bdb_entry_return( Entry *e );
+BI_entry_release_rw bdb_entry_release;
 
 /*
  * error.c
@@ -119,24 +125,18 @@ void bdb_errcall( const char *pfx, char * msg );
 int bdb_filter_candidates(
        Backend *be,
        Filter  *f,
-       ID *ids );
+       ID *ids,
+       ID *tmp,
+       ID *stack );
 
 /*
  * group.c
  */
 
-int bdb_group(
-       Backend *be,
-       Connection *conn,
-       Operation *op,
-       Entry   *target,
-       const char      *gr_ndn,
-       const char      *op_ndn,
-       ObjectClass *group_oc,
-       AttributeDescription *group_at);
+BI_acl_group bdb_group;
 
 /*
- * id2entry
+ * id2entry.c
  */
 int bdb_id2entry_add(
        BackendDB *be,
@@ -151,19 +151,33 @@ int bdb_id2entry_update(
 int bdb_id2entry_delete(
        BackendDB *be,
        DB_TXN *tid,
-       ID id );
+       Entry *e);
 
-int bdb_id2entry(
+int bdb_id2entry_rw(
        BackendDB *be,
        DB_TXN *tid,
        ID id,
-       Entry **e );
+       Entry **e,
+       int rw,
+       u_int32_t locker,
+       DB_LOCK *lock );
+#define bdb_id2entry_r(be, tid, id, e, locker, lock) \
+       bdb_id2entry_rw((be), (tid), (id), (e), 0, locker, lock)
+#define bdb_id2entry_w(be, tid, id, e, locker, lock) \
+       bdb_id2entry_rw((be), (tid), (id), (e), 1, locker, lock)
+
+void bdb_entry_free ( Entry *e );
 
 /*
  * idl.c
  */
 unsigned bdb_idl_search( ID *ids, ID id );
 
+int bdb_bt_compare(
+       DB *db,
+       const DBT *a,
+       const DBT *b );
+
 int bdb_idl_fetch_key(
        BackendDB *be,
        DB *db,
@@ -185,23 +199,23 @@ int bdb_idl_delete_key(
        DBT *key,
        ID id );
 
+#if 0
 int
 bdb_idl_notin(
     ID         *a,
     ID         *b,
        ID      *ids );
+#endif
 
 int
 bdb_idl_intersection(
        ID *a,
-       ID *b,
-       ID *ids );
+       ID *b );
 
 int
 bdb_idl_union(
        ID *a,
-       ID *b,
-       ID *ids );
+       ID *b );
 
 ID bdb_idl_first( ID *ids, ID *cursor );
 ID bdb_idl_next( ID *ids, ID *cursor );
@@ -211,6 +225,11 @@ ID bdb_idl_next( ID *ids, ID *cursor );
  * index.c
  */
 extern int
+bdb_index_is_indexed LDAP_P((
+       Backend *be,
+       AttributeDescription *desc ));
+
+extern int
 bdb_index_param LDAP_P((
        Backend *be,
        AttributeDescription *desc,
@@ -224,7 +243,7 @@ bdb_index_values LDAP_P((
        Backend *be,
        DB_TXN *txn,
        AttributeDescription *desc,
-       struct berval **vals,
+       BerVarray vals,
        ID id,
        int op ));
 
@@ -236,6 +255,11 @@ int bdb_index_entry LDAP_P(( Backend *be, DB_TXN *t,
 #define bdb_index_entry_del(be,t,e,ap) \
        bdb_index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
 
+/*
+ * init.c
+ */
+extern struct berval bdb_uuid;
+
 /*
  * key.c
  */
@@ -277,31 +301,180 @@ int bdb_modify_internal(
        size_t textlen );
 
 /*
- * passwd.c
+ * operational.c
  */
 int
-bdb_exop_passwd(
-       Backend         *be,
-       Connection              *conn,
-       Operation               *op,
-       const char              *reqoid,
-       struct berval   *reqdata,
-       char                    **rspoid,
-       struct berval   **rspdata,
-       LDAPControl             *** rspctrls,
-       const char              **text,
-       struct berval   *** refs );
+bdb_hasSubordinates(
+       BackendDB       *be,
+       Connection      *conn, 
+       Operation       *op,
+       Entry           *e,
+       int             *hasSubordinates );
+
+/*
+ * passwd.c
+ */
+BI_op_extended bdb_exop_passwd;
+
+
+/*
+ * cache.c
+ */
+
+void bdb_cache_entry_commit( Entry *e );
+void bdb_cache_return_entry_rw( DB_ENV *env, Cache *cache, Entry *e,
+       int rw, DB_LOCK *lock );
+#define bdb_cache_return_entry_r(env, c, e, l) \
+       bdb_cache_return_entry_rw((env), (c), (e), 0, (l))
+#define bdb_cache_return_entry_w(env, c, e, l) \
+       bdb_cache_return_entry_rw((env), (c), (e), 1, (l))
+void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
+#define bdb_unlocked_cache_return_entry_r( c, e ) \
+       bdb_unlocked_cache_return_entry_rw((c), (e), 0)
+#define bdb_unlocked_cache_return_entry_w( c, e ) \
+       bdb_unlocked_cache_return_entry_rw((c), (e), 1)
+int bdb_cache_add_entry_rw(
+       DB_ENV  *env,
+       Cache   *cache,
+       Entry   *e,
+       int     rw,
+       u_int32_t locker,
+       DB_LOCK *lock
+);
+int bdb_cache_update_entry(
+       Cache   *cache,
+       Entry   *e
+);
+ID bdb_cache_find_entry_ndn2id(
+       Backend *be,
+       Cache   *cache,
+       struct berval   *ndn
+);
+Entry* bdb_cache_find_entry_id(
+       DB_ENV          *env,
+       Cache           *cache,
+       ID              id,
+       int             rw,
+       u_int32_t       locker,
+       DB_LOCK         *lock
+);
+int bdb_cache_delete_entry(
+       Cache   *cache,
+       Entry   *e
+);
+void bdb_cache_release_all( Cache *cache );
+
+/*
+ * lcup.c
+ */
+
+#ifdef LDAP_CLIENT_UPDATE
+int bdb_abandon(
+       BackendDB       *be,
+       Connection      *conn,
+       ber_int_t       id
+);
+#endif
+
+#if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
+int bdb_add_psearch_spec(
+       BackendDB       *be,
+       Connection      *conn,
+       Operation       *op,
+       struct berval   *base,
+       struct berval   *nbase,
+       int             scope,
+       int             deref,
+       int             slimit,
+       int             tlimit,
+       Filter          *filter,
+       struct berval   *fstr,
+       AttributeName   *attrs,
+       int             attrsonly,
+       int             protocol
+);
+
+int bdb_psearch(
+       BackendDB       *be,
+       Connection      *conn,
+       Operation       *op,
+       Operation       *ps_op,
+       Entry           *entry,
+       int             psearch_type
+);
+#endif
 
 /*
- * tools.c
+ * search.c
  */
-int bdb_tool_entry_open( BackendDB *be, int mode );
-int bdb_tool_entry_close( BackendDB *be );
-ID bdb_tool_entry_next( BackendDB *be );
-Entry* bdb_tool_entry_get( BackendDB *be, ID id );
-ID bdb_tool_entry_put( BackendDB *be, Entry *e );
-int bdb_tool_entry_reindex( BackendDB *be, ID id );
 
+#ifdef LDAP_CLIENT_UPDATE
+int
+bdb_build_lcup_update_ctrl(
+       Connection      *conn,
+       Operation       *op,
+       Entry           *e,
+       int             entry_count,
+       LDAPControl     **ctrls,
+       int             num_ctrls,
+       struct berval   *latest_entrycsn_bv,
+       int             isdeleted       );
+
+int
+bdb_build_lcup_done_ctrl(
+       Connection      *conn,
+       Operation       *op,
+       LDAPControl     **ctrls,
+       int             num_ctrls,
+       struct berval   *latest_entrycsn_bv     );
+#endif
+
+#ifdef LDAP_SYNC
+int
+bdb_build_sync_state_ctrl(
+       Connection      *conn,
+       Operation       *op,
+       Entry           *e,
+       int             entry_sync_state,
+       LDAPControl     **ctrls,
+       int             num_ctrls,
+       int             send_cookie,
+       struct berval   *latest_entrycsn_bv     );
+
+int
+bdb_build_sync_done_ctrl(
+       Connection      *conn,
+       Operation       *op,
+       LDAPControl     **ctrls,
+       int             num_ctrls,
+       int             send_cookie,
+       struct berval   *latest_entrycsn_bv     );
+
+int
+bdb_send_ldap_intermediate(
+       Connection  *conn,
+       Operation   *op,
+       ber_int_t   err,
+       const char  *matched,
+       const char  *text,
+       BerVarray   refs,
+       const char  *rspoid,
+       int         state,
+       struct berval *cookie,
+       LDAPControl **ctrls     );
+#endif
+
+#ifdef BDB_REUSE_LOCKERS
+
+int bdb_locker_id( Operation *op, DB_ENV *env, int *locker );
+
+#endif
+
+#ifdef HAVE_EBCDIC
+char *ebcdic_dberror( int rc );
+
+#define db_strerror(x) ebcdic_dberror(x)
+#endif
 
 LDAP_END_DECL