1 /* back-bdb.h - bdb back-end header file */
4 * Copyright 2000-2001 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
18 #define BDB_FILTER_INDICES 1
20 #define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX
21 #define DN_ONE_PREFIX '%'
22 #define DN_SUBTREE_PREFIX '@'
24 #define DBTzero(t) (memset((t), 0, sizeof(DBT)))
25 #define DBT2bv(t,bv) ((bv)->bv_val = (t)->data, \
26 (bv)->bv_len = (t)->size)
27 #define bv2DBT(bv,t) ((t)->data = (bv)->bv_val, \
28 (t)->size = (bv)->bv_len )
30 #define DEFAULT_MODE 0600
32 #define BDB_TXN_RETRIES 16
34 #define BDB_DBENV_HOME LDAP_RUNDIR LDAP_DIRSEP "openldap-bdb"
37 #define BDB_TMP_SUBDIR LDAP_DIRSEP "tmp"
38 #define BDB_LG_SUBDIR LDAP_DIRSEP "log"
39 #define BDB_DATA_SUBDIR LDAP_DIRSEP "data"
42 #define BDB_SUFFIX ".bdb"
43 #define BDB_ID2ENTRY 0
47 /* The bdb on-disk entry format is pretty space-inefficient. Average
48 * sized user entries are 3-4K each. You need at least two entries to
49 * fit into a single database page, more is better. 64K is BDB's
50 * upper bound. The same issues arise with IDLs in the index databases,
51 * but it's nearly impossible to avoid overflows there.
54 #define BDB_PAGESIZE 16384
57 #define BDB_INDICES 128
67 /* DB_ENV parameters */
68 /* The DB_ENV can be tuned via DB_CONFIG */
70 u_int32_t bi_dbenv_xflags; /* extra flags */
74 struct bdb_db_info **bi_databases;
75 ldap_pvt_thread_mutex_t bi_database_mutex;
76 int bi_db_opflags; /* db-specific flags */
78 slap_mask_t bi_defaultmask;
83 u_int32_t bi_txn_cp_min;
84 u_int32_t bi_txn_cp_kbyte;
88 int bi_lock_detect_seconds;
89 ldap_pvt_thread_t bi_lock_detect_tid;
93 ldap_pvt_thread_mutex_t bi_lastid_mutex;
96 #define bi_id2entry bi_databases[BDB_ID2ENTRY]
97 #define bi_dn2id bi_databases[BDB_DN2ID]
107 #include "proto-bdb.h"
109 #endif /* _BACK_BDB_H_ */