2000-09-19 05:35:08 +08:00
|
|
|
/* $OpenLDAP$ */
|
|
|
|
/*
|
2003-01-04 04:20:47 +08:00
|
|
|
* Copyright 2000-2003 The OpenLDAP Foundation, All Rights Reserved.
|
2000-09-19 05:35:08 +08:00
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PROTO_BDB_H
|
|
|
|
#define _PROTO_BDB_H
|
|
|
|
|
|
|
|
LDAP_BEGIN_DECL
|
|
|
|
|
|
|
|
/*
|
2000-09-22 09:40:57 +08:00
|
|
|
* alias.c
|
2000-09-19 05:35:08 +08:00
|
|
|
*/
|
2000-09-22 09:40:57 +08:00
|
|
|
Entry *bdb_deref_internal_r LDAP_P((
|
2000-09-26 07:41:16 +08:00
|
|
|
BackendDB *be,
|
2000-09-22 09:40:57 +08:00
|
|
|
Entry *e,
|
2001-12-27 08:26:59 +08:00
|
|
|
struct berval *dn,
|
2000-09-22 09:40:57 +08:00
|
|
|
int *err,
|
|
|
|
Entry **matched,
|
|
|
|
const char **text ));
|
|
|
|
|
|
|
|
#define deref_entry_r( be, e, err, matched, text ) \
|
|
|
|
bdb_deref_internal_r( be, e, NULL, err, matched, text )
|
|
|
|
#define deref_dn_r( be, dn, err, matched, text ) \
|
|
|
|
bdb_deref_internal_r( be, NULL, dn, err, matched, text)
|
2000-09-19 05:35:08 +08:00
|
|
|
|
2001-10-04 05:11:52 +08:00
|
|
|
/*
|
|
|
|
* attr.c
|
|
|
|
*/
|
|
|
|
|
2001-10-06 01:00:21 +08:00
|
|
|
void bdb_attr_mask( struct bdb_info *bdb,
|
|
|
|
AttributeDescription *desc,
|
|
|
|
slap_mask_t *indexmask );
|
2001-10-04 05:11:52 +08:00
|
|
|
|
|
|
|
int bdb_attr_index_config LDAP_P(( struct bdb_info *bdb,
|
|
|
|
const char *fname, int lineno,
|
|
|
|
int argc, char **argv ));
|
|
|
|
|
|
|
|
void bdb_attr_index_destroy LDAP_P(( Avlnode *tree ));
|
|
|
|
|
2001-11-13 04:52:25 +08:00
|
|
|
/*
|
|
|
|
* attribute.c
|
|
|
|
*/
|
|
|
|
|
2001-12-26 16:17:44 +08:00
|
|
|
BI_acl_attribute bdb_attribute;
|
2001-11-13 04:52:25 +08:00
|
|
|
|
2001-10-05 06:29:34 +08:00
|
|
|
/*
|
|
|
|
* dbcache.c
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
bdb_db_cache(
|
|
|
|
Backend *be,
|
|
|
|
const char *name,
|
2001-10-06 01:00:21 +08:00
|
|
|
DB **db );
|
2001-10-05 06:29:34 +08:00
|
|
|
|
2000-09-25 06:48:13 +08:00
|
|
|
/*
|
|
|
|
* dn2entry.c
|
|
|
|
*/
|
2002-01-25 15:19:01 +08:00
|
|
|
int bdb_dn2entry_rw LDAP_P(( BackendDB *be, DB_TXN *tid,
|
2002-08-27 03:13:44 +08:00
|
|
|
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)
|
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
|
|
|
*/
|
2000-09-25 06:48:13 +08:00
|
|
|
int bdb_dn2id(
|
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
2001-12-27 07:26:17 +08:00
|
|
|
struct berval *dn,
|
2002-06-11 03:02:25 +08:00
|
|
|
ID *id,
|
|
|
|
int flags );
|
2000-09-25 06:48:13 +08:00
|
|
|
|
|
|
|
int bdb_dn2id_matched(
|
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
2001-12-27 07:26:17 +08:00
|
|
|
struct berval *dn,
|
2000-09-25 06:48:13 +08:00
|
|
|
ID *id,
|
2002-06-11 03:02:25 +08:00
|
|
|
ID *id2,
|
|
|
|
int flags );
|
2000-09-25 06:48:13 +08:00
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
int bdb_dn2id_add(
|
2000-09-20 04:13:41 +08:00
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
2001-12-27 09:38:15 +08:00
|
|
|
struct berval *pdn,
|
2001-12-06 11:26:37 +08:00
|
|
|
Entry *e );
|
2000-09-20 04:13:41 +08:00
|
|
|
|
2000-09-24 14:04:58 +08:00
|
|
|
int bdb_dn2id_delete(
|
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
2001-12-08 18:10:04 +08:00
|
|
|
char *pdn,
|
|
|
|
Entry *e );
|
2000-09-24 14:04:58 +08:00
|
|
|
|
|
|
|
int bdb_dn2id_children(
|
|
|
|
BackendDB *be,
|
|
|
|
DB_TXN *tid,
|
2002-06-11 03:02:25 +08:00
|
|
|
struct berval *dn,
|
|
|
|
int flags );
|
2000-09-24 14:04:58 +08:00
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
int
|
|
|
|
bdb_dn2idl(
|
|
|
|
BackendDB *be,
|
2001-12-27 07:26:17 +08:00
|
|
|
struct berval *dn,
|
2001-06-15 15:08:37 +08:00
|
|
|
int prefix,
|
|
|
|
ID *ids );
|
|
|
|
|
2000-09-22 14:46:32 +08:00
|
|
|
/*
|
|
|
|
* entry.c
|
|
|
|
*/
|
2002-01-25 15:19:01 +08:00
|
|
|
int bdb_entry_return( Entry *e );
|
2001-12-26 16:17:44 +08:00
|
|
|
BI_entry_release_rw bdb_entry_release;
|
2000-09-22 14:46:32 +08:00
|
|
|
|
2000-09-22 09:40:57 +08:00
|
|
|
/*
|
|
|
|
* error.c
|
|
|
|
*/
|
|
|
|
void bdb_errcall( const char *pfx, char * msg );
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
/*
|
|
|
|
* filterentry.c
|
|
|
|
*/
|
|
|
|
int bdb_filter_candidates(
|
|
|
|
Backend *be,
|
|
|
|
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
|
|
|
|
2001-11-13 04:52:25 +08:00
|
|
|
/*
|
|
|
|
* group.c
|
|
|
|
*/
|
|
|
|
|
2001-12-26 16:17:44 +08:00
|
|
|
BI_acl_group bdb_group;
|
2001-11-13 04:52:25 +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
|
|
|
*/
|
|
|
|
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
|
|
|
|
2002-01-25 15:19:01 +08:00
|
|
|
int bdb_id2entry_rw(
|
2000-09-26 07:41:16 +08:00
|
|
|
BackendDB *be,
|
2000-09-25 06:48:13 +08:00
|
|
|
DB_TXN *tid,
|
|
|
|
ID id,
|
2002-01-25 15:19:01 +08:00
|
|
|
Entry **e,
|
2002-06-01 04:49:19 +08:00
|
|
|
int rw,
|
|
|
|
u_int32_t locker,
|
|
|
|
DB_LOCK *lock );
|
2002-08-27 03:13:44 +08:00
|
|
|
#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)
|
2002-01-25 15:19:01 +08:00
|
|
|
|
|
|
|
void bdb_entry_free ( Entry *e );
|
2000-09-25 06:48:13 +08:00
|
|
|
|
2000-09-20 15:21:09 +08:00
|
|
|
/*
|
|
|
|
* idl.c
|
|
|
|
*/
|
2000-09-27 06:22:42 +08:00
|
|
|
unsigned bdb_idl_search( ID *ids, ID id );
|
2000-09-26 02:59:15 +08:00
|
|
|
|
2001-12-06 21:20:18 +08:00
|
|
|
int bdb_bt_compare(
|
|
|
|
DB *db,
|
|
|
|
const DBT *a,
|
|
|
|
const DBT *b );
|
|
|
|
|
2001-10-05 09:19:58 +08:00
|
|
|
int bdb_idl_fetch_key(
|
|
|
|
BackendDB *be,
|
|
|
|
DB *db,
|
|
|
|
DB_TXN *txn,
|
|
|
|
DBT *key,
|
|
|
|
ID *ids );
|
|
|
|
|
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-11-27 03:32:39 +08:00
|
|
|
#if 0
|
2001-06-15 15:08:37 +08:00
|
|
|
int
|
|
|
|
bdb_idl_notin(
|
|
|
|
ID *a,
|
|
|
|
ID *b,
|
|
|
|
ID *ids );
|
2001-11-27 03:32:39 +08:00
|
|
|
#endif
|
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 );
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* index.c
|
|
|
|
*/
|
|
|
|
extern int
|
2002-01-14 07:23:23 +08:00
|
|
|
bdb_index_is_indexed LDAP_P((
|
|
|
|
Backend *be,
|
|
|
|
AttributeDescription *desc ));
|
|
|
|
|
|
|
|
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((
|
|
|
|
Backend *be,
|
|
|
|
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,
|
|
|
|
int op ));
|
|
|
|
|
|
|
|
int bdb_index_entry LDAP_P(( Backend *be, DB_TXN *t,
|
|
|
|
int r, Entry *e, Attribute *ap ));
|
|
|
|
|
|
|
|
#define bdb_index_entry_add(be,t,e,ap) \
|
2001-10-04 14:34:03 +08:00
|
|
|
bdb_index_entry((be),(t),SLAP_INDEX_ADD_OP,(e),(ap))
|
2001-10-04 10:55:09 +08:00
|
|
|
#define bdb_index_entry_del(be,t,e,ap) \
|
2001-10-04 14:34:03 +08:00
|
|
|
bdb_index_entry((be),(t),SLAP_INDEX_DELETE_OP,(e),(ap))
|
2001-10-04 10:55:09 +08:00
|
|
|
|
2002-02-12 01:45:39 +08:00
|
|
|
/*
|
|
|
|
* init.c
|
|
|
|
*/
|
|
|
|
extern struct berval bdb_uuid;
|
|
|
|
|
2001-06-15 15:08:37 +08:00
|
|
|
/*
|
|
|
|
* key.c
|
|
|
|
*/
|
|
|
|
extern int
|
|
|
|
bdb_key_read(
|
|
|
|
Backend *be,
|
|
|
|
DB *db,
|
2001-10-05 06:29:34 +08:00
|
|
|
DB_TXN *txn,
|
2001-06-15 15:08:37 +08:00
|
|
|
struct berval *k,
|
|
|
|
ID *ids );
|
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
|
|
|
|
*/
|
|
|
|
int bdb_next_id( BackendDB *be, DB_TXN *tid, 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
|
|
|
|
*/
|
|
|
|
int bdb_modify_internal(
|
|
|
|
BackendDB *be,
|
|
|
|
Connection *conn,
|
|
|
|
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
|
|
|
|
2002-08-29 18:50:53 +08:00
|
|
|
/*
|
|
|
|
* operational.c
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
bdb_hasSubordinates(
|
|
|
|
BackendDB *be,
|
|
|
|
Connection *conn,
|
|
|
|
Operation *op,
|
|
|
|
Entry *e,
|
|
|
|
int *hasSubordinates );
|
|
|
|
|
2000-09-28 06:28:59 +08:00
|
|
|
/*
|
|
|
|
* passwd.c
|
|
|
|
*/
|
2001-12-26 16:17:44 +08:00
|
|
|
BI_op_extended bdb_exop_passwd;
|
2000-09-28 06:28:59 +08:00
|
|
|
|
2002-01-25 15:19:01 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* cache.c
|
|
|
|
*/
|
|
|
|
|
|
|
|
void bdb_cache_entry_commit( Entry *e );
|
2002-08-27 03:13:44 +08:00
|
|
|
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))
|
2002-06-01 04:49:19 +08:00
|
|
|
void bdb_unlocked_cache_return_entry_rw( Cache *cache, Entry *e, int rw );
|
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)
|
2002-01-25 15:19:01 +08:00
|
|
|
int bdb_cache_add_entry_rw(
|
2002-06-01 04:49:19 +08:00
|
|
|
DB_ENV *env,
|
|
|
|
Cache *cache,
|
|
|
|
Entry *e,
|
|
|
|
int rw,
|
|
|
|
u_int32_t locker,
|
|
|
|
DB_LOCK *lock
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
|
|
|
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(
|
2002-06-01 04:49:19 +08:00
|
|
|
DB_ENV *env,
|
|
|
|
Cache *cache,
|
|
|
|
ID id,
|
|
|
|
int rw,
|
|
|
|
u_int32_t locker,
|
|
|
|
DB_LOCK *lock
|
2002-01-25 15:19:01 +08:00
|
|
|
);
|
|
|
|
int bdb_cache_delete_entry(
|
|
|
|
Cache *cache,
|
|
|
|
Entry *e
|
|
|
|
);
|
|
|
|
void bdb_cache_release_all( Cache *cache );
|
|
|
|
|
2002-10-26 01:51:30 +08:00
|
|
|
#ifdef LDAP_CLIENT_UPDATE
|
|
|
|
int bdb_abandon(
|
|
|
|
BackendDB *be,
|
|
|
|
Connection *conn,
|
|
|
|
ber_int_t id
|
|
|
|
);
|
|
|
|
|
|
|
|
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 bdb_psearch(
|
|
|
|
BackendDB *be,
|
|
|
|
Connection *conn,
|
|
|
|
Operation *op,
|
|
|
|
Operation *ps_op,
|
|
|
|
Entry *entry,
|
|
|
|
int psearch_type
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-08-24 16:11:08 +08:00
|
|
|
#ifdef BDB_REUSE_LOCKERS
|
|
|
|
|
2002-09-19 14:34:53 +08:00
|
|
|
int bdb_locker_id( Operation *op, DB_ENV *env, int *locker );
|
2002-08-24 16:11:08 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-08-22 12:39:59 +08:00
|
|
|
#ifdef HAVE_EBCDIC
|
|
|
|
char *ebcdic_dberror( int rc );
|
|
|
|
|
|
|
|
#define db_strerror(x) ebcdic_dberror(x)
|
|
|
|
#endif
|
|
|
|
|
2000-09-19 05:35:08 +08:00
|
|
|
LDAP_END_DECL
|
|
|
|
|
|
|
|
#endif /* _PROTO_BDB_H */
|