#ifndef _DB_SERVER_INT_H_
#define _DB_SERVER_INT_H_
#define DB_SERVER_TIMEOUT 300
#define DB_SERVER_MAXTIMEOUT 1200
#define DB_SERVER_IDLETIMEOUT 86400
#define DB_SERVER_FLAGMASK ( \
DB_LOCKDOWN | DB_PRIVATE | DB_RECOVER | DB_RECOVER_FATAL | \
DB_SYSTEM_MEM | DB_USE_ENVIRON | DB_USE_ENVIRON_ROOT)
#define CT_CURSOR 0x001
#define CT_DB 0x002
#define CT_ENV 0x004
#define CT_TXN 0x008
#define CT_JOIN 0x10000000
#define CT_JOINCUR 0x20000000
typedef struct home_entry home_entry;
struct home_entry {
LIST_ENTRY(home_entry) entries;
char *home;
char *dir;
char *name;
char *passwd;
};
#define DB_SERVER_ENVFLAGS ( \
DB_INIT_CDB | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL | \
DB_INIT_TXN | DB_JOINENV)
#define DB_SERVER_DBFLAGS (DB_DIRTY_READ | DB_NOMMAP | DB_RDONLY)
#define DB_SERVER_DBNOSHARE (DB_EXCL | DB_TRUNCATE)
typedef struct ct_envdata ct_envdata;
typedef struct ct_dbdata ct_dbdata;
struct ct_envdata {
u_int32_t envflags;
u_int32_t onflags;
u_int32_t offflags;
home_entry *home;
};
struct ct_dbdata {
u_int32_t dbflags;
u_int32_t setflags;
char *db;
char *subdb;
DBTYPE type;
};
typedef struct ct_entry ct_entry;
struct ct_entry {
LIST_ENTRY(ct_entry) entries;
union {
#ifdef __cplusplus
DbEnv *envp;
DbTxn *txnp;
Db *dbp;
Dbc *dbc;
#else
DB_ENV *envp;
DB_TXN *txnp;
DB *dbp;
DBC *dbc;
#endif
void *anyp;
} handle_u;
union {
ct_envdata envdp;
ct_dbdata dbdp;
} private_u;
long ct_id;
long *ct_activep;
long *ct_origp;
long ct_active;
long ct_timeout;
long ct_idle;
u_int32_t ct_refcount;
u_int32_t ct_type;
struct ct_entry *ct_parent;
struct ct_entry *ct_envparent;
};
#define ct_envp handle_u.envp
#define ct_txnp handle_u.txnp
#define ct_dbp handle_u.dbp
#define ct_dbc handle_u.dbc
#define ct_anyp handle_u.anyp
#define ct_envdp private_u.envdp
#define ct_dbdp private_u.dbdp
extern int __dbsrv_verbose;
#define ACTIVATE_CTP(ctp, id, type) { \
(ctp) = get_tableent(id); \
if ((ctp) == NULL) { \
replyp->status = DB_NOSERVER_ID;\
return; \
} \
DB_ASSERT((ctp)->ct_type & (type)); \
__dbsrv_active(ctp); \
}
#endif