2000-09-19 05:35:08 +08:00
|
|
|
/* $OpenLDAP$ */
|
2003-11-29 05:08:20 +08:00
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2011-01-05 08:42:37 +08:00
|
|
|
* Copyright 2000-2011 The OpenLDAP Foundation.
|
2003-11-29 05:08:20 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
2000-09-19 05:35:08 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PROTO_BDB_H
|
|
|
|
#define _PROTO_BDB_H
|
|
|
|
|
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#ifdef BDB_HIER
|
|
|
|
#define BDB_SYMBOL(x) LDAP_CONCAT(hdb_,x)
|
2004-11-17 22:53:03 +08:00
|
|
|
#define BDB_UCTYPE "HDB"
|
2003-04-23 14:34:55 +08:00
|
|
|
#else
|
|
|
|
#define BDB_SYMBOL(x) LDAP_CONCAT(bdb_,x)
|
2004-11-17 22:53:03 +08:00
|
|
|
#define BDB_UCTYPE "BDB"
|
2003-04-23 14:34:55 +08:00
|
|
|
#endif
|
2000-09-19 05:35:08 +08:00
|
|
|
|
2001-10-04 05:11:52 +08:00
|
|
|
/*
|
|
|
|
* attr.c
|
|
|
|
*/
|
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_attr_mask BDB_SYMBOL(attr_mask)
|
2005-04-22 03:04:31 +08:00
|
|
|
#define bdb_attr_flush BDB_SYMBOL(attr_flush)
|
2005-10-26 16:31:38 +08:00
|
|
|
#define bdb_attr_slot BDB_SYMBOL(attr_slot)
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_attr_index_config BDB_SYMBOL(attr_index_config)
|
|
|
|
#define bdb_attr_index_destroy BDB_SYMBOL(attr_index_destroy)
|
2005-04-21 20:45:25 +08:00
|
|
|
#define bdb_attr_index_free BDB_SYMBOL(attr_index_free)
|
2005-03-03 00:35:59 +08:00
|
|
|
#define bdb_attr_index_unparse BDB_SYMBOL(attr_index_unparse)
|
2005-10-26 16:31:38 +08:00
|
|
|
#define bdb_attr_info_free BDB_SYMBOL(attr_info_free)
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2005-04-22 03:04:31 +08:00
|
|
|
AttrInfo *bdb_attr_mask( struct bdb_info *bdb,
|
|
|
|
AttributeDescription *desc );
|
2004-12-21 04:28:30 +08:00
|
|
|
|
2005-04-22 03:04:31 +08:00
|
|
|
void bdb_attr_flush( struct bdb_info *bdb );
|
2001-10-04 05:11:52 +08:00
|
|
|
|
2005-10-27 18:34:33 +08:00
|
|
|
int bdb_attr_slot( struct bdb_info *bdb,
|
2008-10-18 07:35:44 +08:00
|
|
|
AttributeDescription *desc, int *insert );
|
2005-10-26 16:31:38 +08:00
|
|
|
|
2001-10-04 05:11:52 +08:00
|
|
|
int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
|
|
|
|
const char *fname, int lineno,
|
2008-09-23 23:30:48 +08:00
|
|
|
int argc, char **argv, struct config_reply_s *cr ));
|
2001-10-04 05:11:52 +08:00
|
|
|
|
2005-03-03 00:35:59 +08:00
|
|
|
void bdb_attr_index_unparse LDAP_P(( struct bdb_info *bdb, BerVarray *bva ));
|
2005-10-26 16:31:38 +08:00
|
|
|
void bdb_attr_index_destroy LDAP_P(( struct bdb_info *bdb ));
|
2005-04-21 20:45:25 +08:00
|
|
|
void bdb_attr_index_free LDAP_P(( struct bdb_info *bdb,
|
|
|
|
AttributeDescription *ad ));
|
2001-10-04 05:11:52 +08:00
|
|
|
|
2005-10-26 16:31:38 +08:00
|
|
|
void bdb_attr_info_free( AttrInfo *ai );
|
|
|
|
|
2005-03-02 12:46:50 +08:00
|
|
|
/*
|
|
|
|
* config.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define bdb_back_init_cf BDB_SYMBOL(back_init_cf)
|
|
|
|
|
|
|
|
int bdb_back_init_cf( BackendInfo *bi );
|
|
|
|
|
2001-10-05 06:29:34 +08:00
|
|
|
/*
|
|
|
|
* dbcache.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_db_cache BDB_SYMBOL(db_cache)
|
2008-10-15 15:41:57 +08:00
|
|
|
#define bdb_db_findsize BDB_SYMBOL(db_findsize)
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2001-10-05 06:29:34 +08:00
|
|
|
int
|
|
|
|
bdb_db_cache(
|
|
|
|
Backend *be,
|
2007-11-19 04:50:20 +08:00
|
|
|
struct berval *name,
|
2001-10-06 01:00:21 +08:00
|
|
|
DB **db );
|
2001-10-05 06:29:34 +08:00
|
|
|
|
2008-10-15 15:41:57 +08:00
|
|
|
int
|
|
|
|
bdb_db_findsize(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
struct berval *name );
|
|
|
|
|
2000-09-25 06:48:13 +08:00
|
|
|
/*
|
|
|
|
* dn2entry.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_dn2entry BDB_SYMBOL(dn2entry)
|
|
|
|
|
2003-05-25 08:53:08 +08:00
|
|
|
int bdb_dn2entry LDAP_P(( Operation *op, DB_TXN *tid,
|
2003-04-17 00:23:36 +08:00
|
|
|
struct berval *dn, EntryInfo **e, int matched,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_LOCK *lock ));
|
2000-09-25 06:48:13 +08:00
|
|
|
|
2000-09-20 04:13:41 +08:00
|
|
|
/*
|
2000-09-20 15:21:09 +08:00
|
|
|
* dn2id.c
|
2000-09-20 04:13:41 +08:00
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_dn2id BDB_SYMBOL(dn2id)
|
|
|
|
#define bdb_dn2id_add BDB_SYMBOL(dn2id_add)
|
|
|
|
#define bdb_dn2id_delete BDB_SYMBOL(dn2id_delete)
|
|
|
|
#define bdb_dn2id_children BDB_SYMBOL(dn2id_children)
|
|
|
|
#define bdb_dn2idl BDB_SYMBOL(dn2idl)
|
|
|
|
|
2000-09-25 06:48:13 +08:00
|
|
|
int bdb_dn2id(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2001-12-27 07:26:17 +08:00
|
|
|
struct berval *dn,
|
2007-12-06 13:48:02 +08:00
|
|
|
EntryInfo *ei,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2010-07-02 00:38:32 +08:00
|
|
|
DBC **cursor );
|
2000-09-25 06:48:13 +08:00
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
int bdb_dn2id_add(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2000-09-20 04:13:41 +08:00
|
|
|
DB_TXN *tid,
|
2003-04-22 12:06:09 +08:00
|
|
|
EntryInfo *eip,
|
2003-05-25 08:53:08 +08:00
|
|
|
Entry *e );
|
2000-09-20 04:13:41 +08:00
|
|
|
|
2000-09-24 14:04:58 +08:00
|
|
|
int bdb_dn2id_delete(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2000-09-24 14:04:58 +08:00
|
|
|
DB_TXN *tid,
|
2003-04-22 12:06:09 +08:00
|
|
|
EntryInfo *eip,
|
2003-05-25 08:53:08 +08:00
|
|
|
Entry *e );
|
2000-09-24 14:04:58 +08:00
|
|
|
|
|
|
|
int bdb_dn2id_children(
|
2003-04-17 08:52:31 +08:00
|
|
|
Operation *op,
|
2000-09-24 14:04:58 +08:00
|
|
|
DB_TXN *tid,
|
2003-04-17 08:52:31 +08:00
|
|
|
Entry *e );
|
2000-09-24 14:04:58 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
int bdb_dn2idl(
|
2003-05-01 19:59:08 +08:00
|
|
|
Operation *op,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2007-02-08 14:43:28 +08:00
|
|
|
struct berval *ndn,
|
|
|
|
EntryInfo *ei,
|
2003-04-22 14:29:13 +08:00
|
|
|
ID *ids,
|
2003-05-01 19:59:08 +08:00
|
|
|
ID *stack );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
2003-04-23 01:06:35 +08:00
|
|
|
#ifdef BDB_HIER
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_dn2id_parent BDB_SYMBOL(dn2id_parent)
|
2007-12-06 23:58:47 +08:00
|
|
|
#define bdb_dup_compare BDB_SYMBOL(dup_compare)
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_fix_dn BDB_SYMBOL(fix_dn)
|
|
|
|
|
|
|
|
int bdb_dn2id_parent(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-04-23 14:34:55 +08:00
|
|
|
EntryInfo *ei,
|
2003-05-25 08:53:08 +08:00
|
|
|
ID *idp );
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2007-12-06 23:58:47 +08:00
|
|
|
int bdb_dup_compare(
|
|
|
|
DB *db,
|
|
|
|
const DBT *usrkey,
|
|
|
|
const DBT *curkey );
|
|
|
|
|
2003-04-23 16:46:23 +08:00
|
|
|
int bdb_fix_dn( Entry *e, int checkit );
|
2003-04-23 01:06:35 +08:00
|
|
|
#endif
|
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
|
2000-09-22 09:40:57 +08:00
|
|
|
/*
|
|
|
|
* error.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_errcall BDB_SYMBOL(errcall)
|
|
|
|
|
2004-10-17 06:10:32 +08:00
|
|
|
#if DB_VERSION_FULL < 0x04030000
|
2000-09-22 09:40:57 +08:00
|
|
|
void bdb_errcall( const char *pfx, char * msg );
|
2004-10-17 06:10:32 +08:00
|
|
|
#else
|
2005-04-16 09:24:00 +08:00
|
|
|
#define bdb_msgcall BDB_SYMBOL(msgcall)
|
2004-11-13 21:22:48 +08:00
|
|
|
void bdb_errcall( const DB_ENV *env, const char *pfx, const char * msg );
|
2005-04-16 09:24:00 +08:00
|
|
|
void bdb_msgcall( const DB_ENV *env, const char * msg );
|
2004-10-17 06:10:32 +08:00
|
|
|
#endif
|
2000-09-22 09:40:57 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#ifdef HAVE_EBCDIC
|
|
|
|
#define ebcdic_dberror BDB_SYMBOL(ebcdic_dberror)
|
|
|
|
|
|
|
|
char *ebcdic_dberror( int rc );
|
|
|
|
#define db_strerror(x) ebcdic_dberror(x)
|
|
|
|
#endif
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
/*
|
|
|
|
* filterentry.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_filter_candidates BDB_SYMBOL(filter_candidates)
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
int bdb_filter_candidates(
|
2003-04-11 09:29:28 +08:00
|
|
|
Operation *op,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2001-06-15 15:08:37 +08:00
|
|
|
Filter *f,
|
2001-11-27 03:32:39 +08:00
|
|
|
ID *ids,
|
2002-03-18 19:40:58 +08:00
|
|
|
ID *tmp,
|
|
|
|
ID *stack );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
/*
|
2002-01-25 15:19:01 +08:00
|
|
|
* id2entry.c
|
2000-09-22 14:46:32 +08:00
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_id2entry BDB_SYMBOL(id2entry)
|
|
|
|
#define bdb_id2entry_add BDB_SYMBOL(id2entry_add)
|
|
|
|
#define bdb_id2entry_update BDB_SYMBOL(id2entry_update)
|
|
|
|
#define bdb_id2entry_delete BDB_SYMBOL(id2entry_delete)
|
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
int bdb_id2entry_add(
|
2000-09-26 07:41:16 +08:00
|
|
|
BackendDB *be,
|
2000-09-22 14:46:32 +08:00
|
|
|
DB_TXN *tid,
|
|
|
|
Entry *e );
|
|
|
|
|
2000-09-28 06:28:59 +08:00
|
|
|
int bdb_id2entry_update(
|
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
|
|
|
Entry *e );
|
|
|
|
|
2000-09-24 14:04:58 +08:00
|
|
|
int bdb_id2entry_delete(
|
2000-09-26 07:41:16 +08:00
|
|
|
BackendDB *be,
|
2000-09-24 14:04:58 +08:00
|
|
|
DB_TXN *tid,
|
2002-01-25 15:19:01 +08:00
|
|
|
Entry *e);
|
2000-09-24 14:04:58 +08:00
|
|
|
|
2004-12-15 01:22:22 +08:00
|
|
|
#ifdef SLAP_ZONE_ALLOC
|
|
|
|
#else
|
2003-04-17 00:23:36 +08:00
|
|
|
int bdb_id2entry(
|
2000-09-26 07:41:16 +08:00
|
|
|
BackendDB *be,
|
2000-09-25 06:48:13 +08:00
|
|
|
DB_TXN *tid,
|
|
|
|
ID id,
|
2003-04-17 00:23:36 +08:00
|
|
|
Entry **e);
|
2004-12-15 01:22:22 +08:00
|
|
|
#endif
|
2002-01-25 15:19:01 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_entry_free BDB_SYMBOL(entry_free)
|
|
|
|
#define bdb_entry_return BDB_SYMBOL(entry_return)
|
|
|
|
#define bdb_entry_release BDB_SYMBOL(entry_release)
|
|
|
|
#define bdb_entry_get BDB_SYMBOL(entry_get)
|
|
|
|
|
2002-01-25 15:19:01 +08:00
|
|
|
void bdb_entry_free ( Entry *e );
|
2004-12-15 01:22:22 +08:00
|
|
|
#ifdef SLAP_ZONE_ALLOC
|
|
|
|
int bdb_entry_return( struct bdb_info *bdb, Entry *e, int seqno );
|
|
|
|
#else
|
2003-04-23 14:34:55 +08:00
|
|
|
int bdb_entry_return( Entry *e );
|
2004-12-15 01:22:22 +08:00
|
|
|
#endif
|
2003-04-23 14:34:55 +08:00
|
|
|
BI_entry_release_rw bdb_entry_release;
|
|
|
|
BI_entry_get_rw bdb_entry_get;
|
|
|
|
|
2000-09-25 06:48:13 +08:00
|
|
|
|
2000-09-20 15:21:09 +08:00
|
|
|
/*
|
|
|
|
* idl.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
|
|
|
|
#define bdb_idl_cache_get BDB_SYMBOL(idl_cache_get)
|
|
|
|
#define bdb_idl_cache_put BDB_SYMBOL(idl_cache_put)
|
|
|
|
#define bdb_idl_cache_del BDB_SYMBOL(idl_cache_del)
|
2005-09-26 15:30:36 +08:00
|
|
|
#define bdb_idl_cache_add_id BDB_SYMBOL(idl_cache_add_id)
|
|
|
|
#define bdb_idl_cache_del_id BDB_SYMBOL(idl_cache_del_id)
|
2003-04-22 13:14:27 +08:00
|
|
|
|
|
|
|
int bdb_idl_cache_get(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
DB *db,
|
|
|
|
DBT *key,
|
|
|
|
ID *ids );
|
|
|
|
|
|
|
|
void
|
|
|
|
bdb_idl_cache_put(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
DB *db,
|
|
|
|
DBT *key,
|
|
|
|
ID *ids,
|
|
|
|
int rc );
|
|
|
|
|
|
|
|
void
|
|
|
|
bdb_idl_cache_del(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
DB *db,
|
|
|
|
DBT *key );
|
2003-03-13 00:36:28 +08:00
|
|
|
|
2005-09-26 15:30:36 +08:00
|
|
|
void
|
|
|
|
bdb_idl_cache_add_id(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
DB *db,
|
|
|
|
DBT *key,
|
|
|
|
ID id );
|
|
|
|
|
|
|
|
void
|
|
|
|
bdb_idl_cache_del_id(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
DB *db,
|
|
|
|
DBT *key,
|
|
|
|
ID id );
|
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_idl_first BDB_SYMBOL(idl_first)
|
|
|
|
#define bdb_idl_next BDB_SYMBOL(idl_next)
|
|
|
|
#define bdb_idl_search BDB_SYMBOL(idl_search)
|
|
|
|
#define bdb_idl_insert BDB_SYMBOL(idl_insert)
|
|
|
|
#define bdb_idl_intersection BDB_SYMBOL(idl_intersection)
|
|
|
|
#define bdb_idl_union BDB_SYMBOL(idl_union)
|
2005-04-13 19:55:25 +08:00
|
|
|
#define bdb_idl_sort BDB_SYMBOL(idl_sort)
|
2005-09-15 16:29:58 +08:00
|
|
|
#define bdb_idl_append BDB_SYMBOL(idl_append)
|
2005-04-13 19:55:25 +08:00
|
|
|
#define bdb_idl_append_one BDB_SYMBOL(idl_append_one)
|
2000-09-26 02:59:15 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_idl_fetch_key BDB_SYMBOL(idl_fetch_key)
|
|
|
|
#define bdb_idl_insert_key BDB_SYMBOL(idl_insert_key)
|
|
|
|
#define bdb_idl_delete_key BDB_SYMBOL(idl_delete_key)
|
|
|
|
|
|
|
|
unsigned bdb_idl_search( ID *ids, ID id );
|
2001-12-06 21:20:18 +08:00
|
|
|
|
2001-10-05 09:19:58 +08:00
|
|
|
int bdb_idl_fetch_key(
|
2004-09-28 21:11:11 +08:00
|
|
|
BackendDB *be,
|
|
|
|
DB *db,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2004-09-28 21:11:11 +08:00
|
|
|
DBT *key,
|
|
|
|
ID *ids,
|
|
|
|
DBC **saved_cursor,
|
|
|
|
int get_flag );
|
2001-10-05 09:19:58 +08:00
|
|
|
|
2003-04-05 17:57:21 +08:00
|
|
|
int bdb_idl_insert( ID *ids, ID id );
|
|
|
|
|
2000-09-20 15:21:09 +08:00
|
|
|
int bdb_idl_insert_key(
|
|
|
|
BackendDB *be,
|
|
|
|
DB *db,
|
|
|
|
DB_TXN *txn,
|
|
|
|
DBT *key,
|
|
|
|
ID id );
|
|
|
|
|
2000-09-24 14:04:58 +08:00
|
|
|
int bdb_idl_delete_key(
|
|
|
|
BackendDB *be,
|
|
|
|
DB *db,
|
|
|
|
DB_TXN *txn,
|
|
|
|
DBT *key,
|
|
|
|
ID id );
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
int
|
|
|
|
bdb_idl_intersection(
|
|
|
|
ID *a,
|
2001-11-27 03:32:39 +08:00
|
|
|
ID *b );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
|
|
|
int
|
|
|
|
bdb_idl_union(
|
|
|
|
ID *a,
|
2001-11-27 03:32:39 +08:00
|
|
|
ID *b );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
|
|
|
ID bdb_idl_first( ID *ids, ID *cursor );
|
|
|
|
ID bdb_idl_next( ID *ids, ID *cursor );
|
|
|
|
|
2005-09-15 16:29:58 +08:00
|
|
|
void bdb_idl_sort( ID *ids, ID *tmp );
|
2005-04-13 19:55:25 +08:00
|
|
|
int bdb_idl_append( ID *a, ID *b );
|
|
|
|
int bdb_idl_append_one( ID *ids, ID id );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
/*
|
|
|
|
* index.c
|
|
|
|
*/
|
2007-11-19 04:50:20 +08:00
|
|
|
#define bdb_index_mask BDB_SYMBOL(index_mask)
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_index_param BDB_SYMBOL(index_param)
|
|
|
|
#define bdb_index_values BDB_SYMBOL(index_values)
|
|
|
|
#define bdb_index_entry BDB_SYMBOL(index_entry)
|
2005-10-27 18:34:33 +08:00
|
|
|
#define bdb_index_recset BDB_SYMBOL(index_recset)
|
|
|
|
#define bdb_index_recrun BDB_SYMBOL(index_recrun)
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2007-11-19 05:48:26 +08:00
|
|
|
extern AttrInfo *
|
2007-11-19 04:50:20 +08:00
|
|
|
bdb_index_mask LDAP_P((
|
2002-01-14 07:23:23 +08:00
|
|
|
Backend *be,
|
2007-11-19 04:50:20 +08:00
|
|
|
AttributeDescription *desc,
|
|
|
|
struct berval *name ));
|
2002-01-14 07:23:23 +08:00
|
|
|
|
|
|
|
extern int
|
2001-10-04 10:55:09 +08:00
|
|
|
bdb_index_param LDAP_P((
|
2001-06-15 15:08:37 +08:00
|
|
|
Backend *be,
|
|
|
|
AttributeDescription *desc,
|
|
|
|
int ftype,
|
2001-10-14 00:55:54 +08:00
|
|
|
DB **db,
|
2001-06-15 15:08:37 +08:00
|
|
|
slap_mask_t *mask,
|
2001-11-16 16:18:58 +08:00
|
|
|
struct berval *prefix ));
|
2001-10-04 10:55:09 +08:00
|
|
|
|
|
|
|
extern int
|
|
|
|
bdb_index_values LDAP_P((
|
2003-04-11 09:29:28 +08:00
|
|
|
Operation *op,
|
2001-10-04 10:55:09 +08:00
|
|
|
DB_TXN *txn,
|
|
|
|
AttributeDescription *desc,
|
2002-01-14 09:43:17 +08:00
|
|
|
BerVarray vals,
|
2001-10-04 10:55:09 +08:00
|
|
|
ID id,
|
2003-04-11 09:29:28 +08:00
|
|
|
int opid ));
|
2001-10-04 10:55:09 +08:00
|
|
|
|
2005-10-27 18:34:33 +08:00
|
|
|
extern int
|
|
|
|
bdb_index_recset LDAP_P((
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
Attribute *a,
|
|
|
|
AttributeType *type,
|
|
|
|
struct berval *tags,
|
|
|
|
IndexRec *ir ));
|
|
|
|
|
|
|
|
extern int
|
|
|
|
bdb_index_recrun LDAP_P((
|
|
|
|
Operation *op,
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
IndexRec *ir,
|
|
|
|
ID id,
|
|
|
|
int base ));
|
|
|
|
|
2003-04-11 09:29:28 +08:00
|
|
|
int bdb_index_entry LDAP_P(( Operation *op, DB_TXN *t, int r, Entry *e ));
|
2001-10-04 10:55:09 +08:00
|
|
|
|
2003-08-30 23:19:35 +08:00
|
|
|
#define bdb_index_entry_add(op,t,e) \
|
|
|
|
bdb_index_entry((op),(t),SLAP_INDEX_ADD_OP,(e))
|
|
|
|
#define bdb_index_entry_del(op,t,e) \
|
|
|
|
bdb_index_entry((op),(t),SLAP_INDEX_DELETE_OP,(e))
|
2001-10-04 10:55:09 +08:00
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
/*
|
|
|
|
* key.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_key_read BDB_SYMBOL(key_read)
|
|
|
|
#define bdb_key_change BDB_SYMBOL(key_change)
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
extern int
|
|
|
|
bdb_key_read(
|
|
|
|
Backend *be,
|
|
|
|
DB *db,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2001-06-15 15:08:37 +08:00
|
|
|
struct berval *k,
|
2004-09-28 21:11:11 +08:00
|
|
|
ID *ids,
|
|
|
|
DBC **saved_cursor,
|
|
|
|
int get_flags );
|
2001-10-05 06:29:34 +08:00
|
|
|
|
|
|
|
extern int
|
|
|
|
bdb_key_change(
|
|
|
|
Backend *be,
|
|
|
|
DB *db,
|
|
|
|
DB_TXN *txn,
|
|
|
|
struct berval *k,
|
|
|
|
ID id,
|
|
|
|
int op );
|
2001-06-15 15:08:37 +08:00
|
|
|
|
2000-09-20 04:13:41 +08:00
|
|
|
/*
|
|
|
|
* nextid.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_next_id BDB_SYMBOL(next_id)
|
|
|
|
#define bdb_last_id BDB_SYMBOL(last_id)
|
|
|
|
|
2008-02-10 08:56:44 +08:00
|
|
|
int bdb_next_id( BackendDB *be, ID *id );
|
2001-07-31 12:24:29 +08:00
|
|
|
int bdb_last_id( BackendDB *be, DB_TXN *tid );
|
2000-09-20 04:13:41 +08:00
|
|
|
|
2000-09-28 06:28:59 +08:00
|
|
|
/*
|
|
|
|
* modify.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_modify_internal BDB_SYMBOL(modify_internal)
|
|
|
|
|
2000-09-28 06:28:59 +08:00
|
|
|
int bdb_modify_internal(
|
|
|
|
Operation *op,
|
|
|
|
DB_TXN *tid,
|
|
|
|
Modifications *modlist,
|
|
|
|
Entry *e,
|
2001-06-15 15:08:37 +08:00
|
|
|
const char **text,
|
|
|
|
char *textbuf,
|
|
|
|
size_t textlen );
|
2000-09-28 06:28:59 +08:00
|
|
|
|
2006-09-06 09:54:54 +08:00
|
|
|
/*
|
|
|
|
* monitor.c
|
|
|
|
*/
|
2006-09-26 16:43:01 +08:00
|
|
|
|
|
|
|
#define bdb_monitor_db_init BDB_SYMBOL(monitor_db_init)
|
|
|
|
#define bdb_monitor_db_open BDB_SYMBOL(monitor_db_open)
|
|
|
|
#define bdb_monitor_db_close BDB_SYMBOL(monitor_db_close)
|
|
|
|
#define bdb_monitor_db_destroy BDB_SYMBOL(monitor_db_destroy)
|
|
|
|
|
2006-09-14 09:05:02 +08:00
|
|
|
int bdb_monitor_db_init( BackendDB *be );
|
|
|
|
int bdb_monitor_db_open( BackendDB *be );
|
|
|
|
int bdb_monitor_db_close( BackendDB *be );
|
|
|
|
int bdb_monitor_db_destroy( BackendDB *be );
|
2002-01-25 15:19:01 +08:00
|
|
|
|
2007-08-08 06:36:04 +08:00
|
|
|
#ifdef BDB_MONITOR_IDX
|
|
|
|
#define bdb_monitor_idx_add BDB_SYMBOL(monitor_idx_add)
|
|
|
|
int
|
|
|
|
bdb_monitor_idx_add(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
AttributeDescription *desc,
|
|
|
|
slap_mask_t type );
|
|
|
|
#endif /* BDB_MONITOR_IDX */
|
|
|
|
|
2002-01-25 15:19:01 +08:00
|
|
|
/*
|
|
|
|
* cache.c
|
|
|
|
*/
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_cache_entry_db_unlock BDB_SYMBOL(cache_entry_db_unlock)
|
2007-11-12 19:16:30 +08:00
|
|
|
#define bdb_cache_return_entry_rw BDB_SYMBOL(cache_return_entry_rw)
|
2002-01-25 15:19:01 +08:00
|
|
|
|
2003-04-17 00:23:36 +08:00
|
|
|
#define bdb_cache_entryinfo_lock(e) \
|
|
|
|
ldap_pvt_thread_mutex_lock( &(e)->bei_kids_mutex )
|
|
|
|
#define bdb_cache_entryinfo_unlock(e) \
|
|
|
|
ldap_pvt_thread_mutex_unlock( &(e)->bei_kids_mutex )
|
2007-01-17 10:43:05 +08:00
|
|
|
#define bdb_cache_entryinfo_trylock(e) \
|
|
|
|
ldap_pvt_thread_mutex_trylock( &(e)->bei_kids_mutex )
|
2003-04-17 00:23:36 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
/* What a mess. Hopefully the current cache scheme will stabilize
|
|
|
|
* and we can trim out all of this stuff.
|
|
|
|
*/
|
2007-01-01 07:37:06 +08:00
|
|
|
void bdb_cache_return_entry_rw( struct bdb_info *bdb, Entry *e,
|
2002-08-27 03:13:44 +08:00
|
|
|
int rw, DB_LOCK *lock );
|
2007-01-01 07:37:06 +08:00
|
|
|
#define bdb_cache_return_entry_r(bdb, e, l) \
|
|
|
|
bdb_cache_return_entry_rw((bdb), (e), 0, (l))
|
|
|
|
#define bdb_cache_return_entry_w(bdb, e, l) \
|
|
|
|
bdb_cache_return_entry_rw((bdb), (e), 1, (l))
|
2003-04-17 00:23:36 +08:00
|
|
|
#if 0
|
2007-01-01 07:37:06 +08:00
|
|
|
void bdb_unlocked_cache_return_entry_rw( struct bdb_info *bdb, Entry *e, int rw );
|
2003-04-17 00:23:36 +08:00
|
|
|
#else
|
2005-07-14 11:06:58 +08:00
|
|
|
#define bdb_unlocked_cache_return_entry_rw( a, b, c ) ((void)0)
|
2003-04-17 00:23:36 +08:00
|
|
|
#endif
|
2002-08-27 03:13:44 +08:00
|
|
|
#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)
|
2003-04-22 12:06:09 +08:00
|
|
|
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_cache_add BDB_SYMBOL(cache_add)
|
|
|
|
#define bdb_cache_children BDB_SYMBOL(cache_children)
|
|
|
|
#define bdb_cache_delete BDB_SYMBOL(cache_delete)
|
2004-12-15 01:22:22 +08:00
|
|
|
#define bdb_cache_delete_cleanup BDB_SYMBOL(cache_delete_cleanup)
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_cache_find_id BDB_SYMBOL(cache_find_id)
|
|
|
|
#define bdb_cache_find_ndn BDB_SYMBOL(cache_find_ndn)
|
2005-10-16 15:37:36 +08:00
|
|
|
#define bdb_cache_find_parent BDB_SYMBOL(cache_find_parent)
|
2003-04-23 14:34:55 +08:00
|
|
|
#define bdb_cache_modify BDB_SYMBOL(cache_modify)
|
|
|
|
#define bdb_cache_modrdn BDB_SYMBOL(cache_modrdn)
|
|
|
|
#define bdb_cache_release_all BDB_SYMBOL(cache_release_all)
|
2003-09-25 15:49:50 +08:00
|
|
|
#define bdb_cache_delete_entry BDB_SYMBOL(cache_delete_entry)
|
2011-02-23 11:53:21 +08:00
|
|
|
#define bdb_cache_deref BDB_SYMBOL(cache_deref)
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2003-04-22 12:06:09 +08:00
|
|
|
int bdb_cache_children(
|
|
|
|
Operation *op,
|
|
|
|
DB_TXN *txn,
|
|
|
|
Entry *e
|
|
|
|
);
|
2003-04-17 00:23:36 +08:00
|
|
|
int bdb_cache_add(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
EntryInfo *pei,
|
2002-06-01 04:49:19 +08:00
|
|
|
Entry *e,
|
2003-04-17 00:23:36 +08:00
|
|
|
struct berval *nrdn,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2006-12-30 20:05:55 +08:00
|
|
|
DB_LOCK *lock
|
2003-04-17 00:23:36 +08:00
|
|
|
);
|
|
|
|
int bdb_cache_modrdn(
|
2005-07-12 21:17:56 +08:00
|
|
|
struct bdb_info *bdb,
|
2003-04-17 00:23:36 +08:00
|
|
|
Entry *e,
|
|
|
|
struct berval *nrdn,
|
|
|
|
Entry *new,
|
|
|
|
EntryInfo *ein,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-04-17 00:23:36 +08:00
|
|
|
DB_LOCK *lock
|
|
|
|
);
|
|
|
|
int bdb_cache_modify(
|
2007-01-01 07:37:06 +08:00
|
|
|
struct bdb_info *bdb,
|
2003-04-17 00:23:36 +08:00
|
|
|
Entry *e,
|
|
|
|
Attribute *newAttrs,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-04-17 00:23:36 +08:00
|
|
|
DB_LOCK *lock
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
2003-04-23 14:34:55 +08:00
|
|
|
int bdb_cache_find_ndn(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-04-17 00:23:36 +08:00
|
|
|
struct berval *ndn,
|
2003-09-22 16:37:32 +08:00
|
|
|
EntryInfo **res
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
2007-11-12 19:16:30 +08:00
|
|
|
|
|
|
|
#define ID_LOCKED 1
|
|
|
|
#define ID_NOCACHE 2
|
2009-05-06 21:57:01 +08:00
|
|
|
#define ID_NOENTRY 4
|
2010-12-23 08:16:19 +08:00
|
|
|
#define ID_CHKPURGE 8
|
2003-04-23 14:34:55 +08:00
|
|
|
int bdb_cache_find_id(
|
2003-05-25 08:53:08 +08:00
|
|
|
Operation *op,
|
2003-04-17 00:23:36 +08:00
|
|
|
DB_TXN *tid,
|
2002-06-01 04:49:19 +08:00
|
|
|
ID id,
|
2003-04-17 00:23:36 +08:00
|
|
|
EntryInfo **eip,
|
2007-11-12 19:16:30 +08:00
|
|
|
int flag,
|
2003-05-25 08:53:08 +08:00
|
|
|
DB_LOCK *lock
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
2005-10-16 15:37:36 +08:00
|
|
|
int
|
|
|
|
bdb_cache_find_parent(
|
|
|
|
Operation *op,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2005-10-16 15:37:36 +08:00
|
|
|
ID id,
|
|
|
|
EntryInfo **res
|
|
|
|
);
|
2003-04-23 14:34:55 +08:00
|
|
|
int bdb_cache_delete(
|
2007-01-01 07:37:06 +08:00
|
|
|
struct bdb_info *bdb,
|
2003-04-17 00:23:36 +08:00
|
|
|
Entry *e,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-04-17 00:23:36 +08:00
|
|
|
DB_LOCK *lock
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
2003-05-23 10:04:03 +08:00
|
|
|
void bdb_cache_delete_cleanup(
|
2003-09-27 12:58:36 +08:00
|
|
|
Cache *cache,
|
2004-11-08 12:23:37 +08:00
|
|
|
EntryInfo *ei
|
2003-05-23 10:04:03 +08:00
|
|
|
);
|
2002-01-25 15:19:01 +08:00
|
|
|
void bdb_cache_release_all( Cache *cache );
|
2011-02-23 11:53:21 +08:00
|
|
|
void bdb_cache_deref( EntryInfo *ei );
|
2002-01-25 15:19:01 +08:00
|
|
|
|
2003-09-22 18:11:10 +08:00
|
|
|
#ifdef BDB_HIER
|
|
|
|
int hdb_cache_load(
|
|
|
|
struct bdb_info *bdb,
|
|
|
|
EntryInfo *ei,
|
|
|
|
EntryInfo **res
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2003-08-23 19:58:33 +08:00
|
|
|
#define bdb_cache_entry_db_relock BDB_SYMBOL(cache_entry_db_relock)
|
2003-08-23 10:51:33 +08:00
|
|
|
int bdb_cache_entry_db_relock(
|
2007-01-01 07:37:06 +08:00
|
|
|
struct bdb_info *bdb,
|
2008-08-27 09:45:35 +08:00
|
|
|
DB_TXN *txn,
|
2003-08-23 10:51:33 +08:00
|
|
|
EntryInfo *ei,
|
|
|
|
int rw,
|
|
|
|
int tryOnly,
|
|
|
|
DB_LOCK *lock );
|
|
|
|
|
2003-09-30 07:32:11 +08:00
|
|
|
int bdb_cache_entry_db_unlock(
|
2007-01-01 07:37:06 +08:00
|
|
|
struct bdb_info *bdb,
|
2003-09-30 07:32:11 +08:00
|
|
|
DB_LOCK *lock );
|
|
|
|
|
2008-08-27 09:45:35 +08:00
|
|
|
#define bdb_reader_get BDB_SYMBOL(reader_get)
|
|
|
|
#define bdb_reader_flush BDB_SYMBOL(reader_flush)
|
|
|
|
int bdb_reader_get( Operation *op, DB_ENV *env, DB_TXN **txn );
|
|
|
|
void bdb_reader_flush( DB_ENV *env );
|
2003-04-23 14:34:55 +08:00
|
|
|
|
2003-07-01 19:55:18 +08:00
|
|
|
/*
|
|
|
|
* trans.c
|
|
|
|
*/
|
2003-08-27 02:57:09 +08:00
|
|
|
#define bdb_trans_backoff BDB_SYMBOL(trans_backoff)
|
2003-07-01 19:55:18 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
bdb_trans_backoff( int num_retries );
|
2002-08-22 12:39:59 +08:00
|
|
|
|
2004-11-11 08:38:11 +08:00
|
|
|
/*
|
|
|
|
* former external.h
|
|
|
|
*/
|
|
|
|
|
2004-11-16 03:45:49 +08:00
|
|
|
#define bdb_back_initialize BDB_SYMBOL(back_initialize)
|
2004-11-11 08:38:11 +08:00
|
|
|
#define bdb_db_config BDB_SYMBOL(db_config)
|
|
|
|
#define bdb_add BDB_SYMBOL(add)
|
|
|
|
#define bdb_bind BDB_SYMBOL(bind)
|
|
|
|
#define bdb_compare BDB_SYMBOL(compare)
|
|
|
|
#define bdb_delete BDB_SYMBOL(delete)
|
|
|
|
#define bdb_modify BDB_SYMBOL(modify)
|
|
|
|
#define bdb_modrdn BDB_SYMBOL(modrdn)
|
|
|
|
#define bdb_search BDB_SYMBOL(search)
|
|
|
|
#define bdb_extended BDB_SYMBOL(extended)
|
|
|
|
#define bdb_referrals BDB_SYMBOL(referrals)
|
|
|
|
#define bdb_operational BDB_SYMBOL(operational)
|
|
|
|
#define bdb_hasSubordinates BDB_SYMBOL(hasSubordinates)
|
|
|
|
#define bdb_tool_entry_open BDB_SYMBOL(tool_entry_open)
|
|
|
|
#define bdb_tool_entry_close BDB_SYMBOL(tool_entry_close)
|
2010-01-18 23:00:40 +08:00
|
|
|
#define bdb_tool_entry_first_x BDB_SYMBOL(tool_entry_first_x)
|
2004-11-11 08:38:11 +08:00
|
|
|
#define bdb_tool_entry_next BDB_SYMBOL(tool_entry_next)
|
|
|
|
#define bdb_tool_entry_get BDB_SYMBOL(tool_entry_get)
|
|
|
|
#define bdb_tool_entry_put BDB_SYMBOL(tool_entry_put)
|
|
|
|
#define bdb_tool_entry_reindex BDB_SYMBOL(tool_entry_reindex)
|
|
|
|
#define bdb_tool_dn2id_get BDB_SYMBOL(tool_dn2id_get)
|
|
|
|
#define bdb_tool_entry_modify BDB_SYMBOL(tool_entry_modify)
|
2005-10-23 05:41:58 +08:00
|
|
|
#define bdb_tool_idl_add BDB_SYMBOL(tool_idl_add)
|
2004-11-11 08:38:11 +08:00
|
|
|
|
2004-11-16 03:45:49 +08:00
|
|
|
extern BI_init bdb_back_initialize;
|
|
|
|
|
2004-11-11 08:38:11 +08:00
|
|
|
extern BI_db_config bdb_db_config;
|
|
|
|
|
|
|
|
extern BI_op_add bdb_add;
|
|
|
|
extern BI_op_bind bdb_bind;
|
|
|
|
extern BI_op_compare bdb_compare;
|
|
|
|
extern BI_op_delete bdb_delete;
|
|
|
|
extern BI_op_modify bdb_modify;
|
|
|
|
extern BI_op_modrdn bdb_modrdn;
|
|
|
|
extern BI_op_search bdb_search;
|
|
|
|
extern BI_op_extended bdb_extended;
|
|
|
|
|
|
|
|
extern BI_chk_referrals bdb_referrals;
|
|
|
|
|
|
|
|
extern BI_operational bdb_operational;
|
|
|
|
|
|
|
|
extern BI_has_subordinates bdb_hasSubordinates;
|
|
|
|
|
|
|
|
/* tools.c */
|
|
|
|
extern BI_tool_entry_open bdb_tool_entry_open;
|
|
|
|
extern BI_tool_entry_close bdb_tool_entry_close;
|
2010-01-18 23:00:40 +08:00
|
|
|
extern BI_tool_entry_first_x bdb_tool_entry_first_x;
|
2004-11-11 08:38:11 +08:00
|
|
|
extern BI_tool_entry_next bdb_tool_entry_next;
|
|
|
|
extern BI_tool_entry_get bdb_tool_entry_get;
|
|
|
|
extern BI_tool_entry_put bdb_tool_entry_put;
|
|
|
|
extern BI_tool_entry_reindex bdb_tool_entry_reindex;
|
|
|
|
extern BI_tool_dn2id_get bdb_tool_dn2id_get;
|
|
|
|
extern BI_tool_entry_modify bdb_tool_entry_modify;
|
|
|
|
|
2005-10-23 05:41:58 +08:00
|
|
|
int bdb_tool_idl_add( BackendDB *be, DB *db, DB_TXN *txn, DBT *key, ID id );
|
|
|
|
|
2000-09-19 05:35:08 +08:00
|
|
|
LDAP_END_DECL
|
|
|
|
|
|
|
|
#endif /* _PROTO_BDB_H */
|