summaryrefslogtreecommitdiff
path: root/storage/bdb/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'storage/bdb/rpc_server')
-rw-r--r--storage/bdb/rpc_server/c/db_server_proc.c.in2500
-rw-r--r--storage/bdb/rpc_server/c/db_server_util.c815
-rw-r--r--storage/bdb/rpc_server/clsrv.html453
-rw-r--r--storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp2200
-rw-r--r--storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp746
-rw-r--r--storage/bdb/rpc_server/java/DbDispatcher.java590
-rw-r--r--storage/bdb/rpc_server/java/DbServer.java301
-rw-r--r--storage/bdb/rpc_server/java/FreeList.java102
-rw-r--r--storage/bdb/rpc_server/java/LocalIterator.java23
-rw-r--r--storage/bdb/rpc_server/java/README24
-rw-r--r--storage/bdb/rpc_server/java/RpcDb.java694
-rw-r--r--storage/bdb/rpc_server/java/RpcDbEnv.java269
-rw-r--r--storage/bdb/rpc_server/java/RpcDbTxn.java123
-rw-r--r--storage/bdb/rpc_server/java/RpcDbc.java238
-rw-r--r--storage/bdb/rpc_server/java/Timer.java22
-rw-r--r--storage/bdb/rpc_server/java/gen/DbServerStub.java495
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_associate_msg.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_associate_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_bt_maxkey_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_bt_maxkey_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_bt_minkey_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_bt_minkey_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_close_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_close_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_create_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_create_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_cursor_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_cursor_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_del_msg.java53
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_del_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_encrypt_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_encrypt_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_extentsize_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_extentsize_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_flags_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_flags_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_get_msg.java68
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_get_reply.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_h_ffactor_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_h_ffactor_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_h_nelem_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_h_nelem_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_join_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_join_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_key_range_msg.java53
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_key_range_reply.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_lorder_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_lorder_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_open_msg.java50
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_open_reply.java44
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_pagesize_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_pagesize_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_pget_msg.java83
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_pget_reply.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_put_msg.java68
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_put_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_delim_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_delim_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_len_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_len_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_pad_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_re_pad_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_remove_msg.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_remove_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_rename_msg.java44
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_rename_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_stat_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_stat_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_sync_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_sync_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_truncate_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__db_truncate_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_close_msg.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_close_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_count_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_count_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_del_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_del_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_dup_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_dup_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_get_msg.java65
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_get_reply.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_pget_msg.java80
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_pget_reply.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_put_msg.java65
-rw-r--r--storage/bdb/rpc_server/java/gen/__dbc_put_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_cachesize_msg.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_cachesize_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_close_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_close_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_create_msg.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_create_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_dbremove_msg.java44
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_dbremove_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_dbrename_msg.java47
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_dbrename_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_encrypt_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_encrypt_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_flags_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_flags_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_open_msg.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_open_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_remove_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__env_remove_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_abort_msg.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_abort_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_begin_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_begin_reply.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_commit_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_commit_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_discard_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_discard_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_prepare_msg.java35
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_prepare_reply.java32
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_recover_msg.java38
-rw-r--r--storage/bdb/rpc_server/java/gen/__txn_recover_reply.java41
-rw-r--r--storage/bdb/rpc_server/java/gen/db_server.java67
-rw-r--r--storage/bdb/rpc_server/java/jrpcgen.jarbin0 -> 57125 bytes
-rw-r--r--storage/bdb/rpc_server/java/oncrpc.jarbin0 -> 84122 bytes
-rw-r--r--storage/bdb/rpc_server/java/s_jrpcgen3
-rw-r--r--storage/bdb/rpc_server/rpc.src718
121 files changed, 14171 insertions, 0 deletions
diff --git a/storage/bdb/rpc_server/c/db_server_proc.c.in b/storage/bdb/rpc_server/c/db_server_proc.c.in
new file mode 100644
index 00000000000..d5d1f49508a
--- /dev/null
+++ b/storage/bdb/rpc_server/c/db_server_proc.c.in
@@ -0,0 +1,2500 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2000-2002
+ * Sleepycat Software. All rights reserved.
+ */
+
+#include "db_config.h"
+
+#ifdef HAVE_RPC
+#ifndef lint
+static const char revid[] = "$Id: db_server_proc.c,v 1.92 2002/07/29 15:21:20 sue Exp $";
+#endif /* not lint */
+
+#ifndef NO_SYSTEM_INCLUDES
+#include <sys/types.h>
+
+#include <rpc/rpc.h>
+
+#include <string.h>
+#endif
+#include "dbinc_auto/db_server.h"
+
+#include "db_int.h"
+#include "dbinc/db_server_int.h"
+#include "dbinc_auto/rpc_server_ext.h"
+
+/* BEGIN __env_cachesize_proc */
+/*
+ * PUBLIC: void __env_cachesize_proc __P((long, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, __env_cachesize_reply *));
+ */
+void
+__env_cachesize_proc(dbenvcl_id, gbytes, bytes,
+ ncache, replyp)
+ long dbenvcl_id;
+ u_int32_t gbytes;
+ u_int32_t bytes;
+ u_int32_t ncache;
+ __env_cachesize_reply *replyp;
+/* END __env_cachesize_proc */
+{
+ DB_ENV *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_cachesize(dbenv, gbytes, bytes, ncache);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_close_proc */
+/*
+ * PUBLIC: void __env_close_proc __P((long, u_int32_t, __env_close_reply *));
+ */
+void
+__env_close_proc(dbenvcl_id, flags, replyp)
+ long dbenvcl_id;
+ u_int32_t flags;
+ __env_close_reply *replyp;
+/* END __env_close_proc */
+{
+ ct_entry *dbenv_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ replyp->status = __dbenv_close_int(dbenvcl_id, flags, 0);
+ return;
+}
+
+/* BEGIN __env_create_proc */
+/*
+ * PUBLIC: void __env_create_proc __P((u_int32_t, __env_create_reply *));
+ */
+void
+__env_create_proc(timeout, replyp)
+ u_int32_t timeout;
+ __env_create_reply *replyp;
+/* END __env_create_proc */
+{
+ DB_ENV *dbenv;
+ ct_entry *ctp;
+ int ret;
+
+ ctp = new_ct_ent(&replyp->status);
+ if (ctp == NULL)
+ return;
+ if ((ret = db_env_create(&dbenv, 0)) == 0) {
+ ctp->ct_envp = dbenv;
+ ctp->ct_type = CT_ENV;
+ ctp->ct_parent = NULL;
+ ctp->ct_envparent = ctp;
+ __dbsrv_settimeout(ctp, timeout);
+ __dbsrv_active(ctp);
+ replyp->envcl_id = ctp->ct_id;
+ } else
+ __dbclear_ctp(ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_dbremove_proc */
+/*
+ * PUBLIC: void __env_dbremove_proc __P((long, long, char *, char *, u_int32_t,
+ * PUBLIC: __env_dbremove_reply *));
+ */
+void
+__env_dbremove_proc(dbenvcl_id, txnpcl_id, name,
+ subdb, flags, replyp)
+ long dbenvcl_id;
+ long txnpcl_id;
+ char *name;
+ char *subdb;
+ u_int32_t flags;
+ __env_dbremove_reply *replyp;
+/* END __env_dbremove_proc */
+{
+ int ret;
+ DB_ENV * dbenv;
+ ct_entry *dbenv_ctp;
+ DB_TXN * txnp;
+ ct_entry *txnp_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbenv->dbremove(dbenv, txnp, name, subdb, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_dbrename_proc */
+/*
+ * PUBLIC: void __env_dbrename_proc __P((long, long, char *, char *, char *,
+ * PUBLIC: u_int32_t, __env_dbrename_reply *));
+ */
+void
+__env_dbrename_proc(dbenvcl_id, txnpcl_id, name,
+ subdb, newname, flags, replyp)
+ long dbenvcl_id;
+ long txnpcl_id;
+ char *name;
+ char *subdb;
+ char *newname;
+ u_int32_t flags;
+ __env_dbrename_reply *replyp;
+/* END __env_dbrename_proc */
+{
+ int ret;
+ DB_ENV * dbenv;
+ ct_entry *dbenv_ctp;
+ DB_TXN * txnp;
+ ct_entry *txnp_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbenv->dbrename(dbenv, txnp, name, subdb, newname, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_encrypt_proc */
+/*
+ * PUBLIC: void __env_encrypt_proc __P((long, char *, u_int32_t,
+ * PUBLIC: __env_encrypt_reply *));
+ */
+void
+__env_encrypt_proc(dbenvcl_id, passwd, flags, replyp)
+ long dbenvcl_id;
+ char *passwd;
+ u_int32_t flags;
+ __env_encrypt_reply *replyp;
+/* END __env_encrypt_proc */
+{
+ int ret;
+ DB_ENV * dbenv;
+ ct_entry *dbenv_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_encrypt(dbenv, passwd, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_flags_proc */
+/*
+ * PUBLIC: void __env_flags_proc __P((long, u_int32_t, u_int32_t,
+ * PUBLIC: __env_flags_reply *));
+ */
+void
+__env_flags_proc(dbenvcl_id, flags, onoff, replyp)
+ long dbenvcl_id;
+ u_int32_t flags;
+ u_int32_t onoff;
+ __env_flags_reply *replyp;
+/* END __env_flags_proc */
+{
+ DB_ENV *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_flags(dbenv, flags, onoff);
+ if (onoff)
+ dbenv_ctp->ct_envdp.onflags = flags;
+ else
+ dbenv_ctp->ct_envdp.offflags = flags;
+
+ replyp->status = ret;
+ return;
+}
+/* BEGIN __env_open_proc */
+/*
+ * PUBLIC: void __env_open_proc __P((long, char *, u_int32_t, u_int32_t,
+ * PUBLIC: __env_open_reply *));
+ */
+void
+__env_open_proc(dbenvcl_id, home, flags,
+ mode, replyp)
+ long dbenvcl_id;
+ char *home;
+ u_int32_t flags;
+ u_int32_t mode;
+ __env_open_reply *replyp;
+/* END __env_open_proc */
+{
+ DB_ENV *dbenv;
+ ct_entry *dbenv_ctp, *new_ctp;
+ u_int32_t newflags, shareflags;
+ int ret;
+ home_entry *fullhome;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+ fullhome = get_home(home);
+ if (fullhome == NULL) {
+ ret = DB_NOSERVER_HOME;
+ goto out;
+ }
+
+ /*
+ * If they are using locking do deadlock detection for them,
+ * internally.
+ */
+ if ((flags & DB_INIT_LOCK) &&
+ (ret = dbenv->set_lk_detect(dbenv, DB_LOCK_DEFAULT)) != 0)
+ goto out;
+
+ if (__dbsrv_verbose) {
+ dbenv->set_errfile(dbenv, stderr);
+ dbenv->set_errpfx(dbenv, fullhome->home);
+ }
+
+ /*
+ * Mask off flags we ignore
+ */
+ newflags = (flags & ~DB_SERVER_FLAGMASK);
+ shareflags = (newflags & DB_SERVER_ENVFLAGS);
+ /*
+ * Check now whether we can share a handle for this env.
+ */
+ replyp->envcl_id = dbenvcl_id;
+ if ((new_ctp = __dbsrv_shareenv(dbenv_ctp, fullhome, shareflags))
+ != NULL) {
+ /*
+ * We can share, clean up old ID, set new one.
+ */
+ if (__dbsrv_verbose)
+ printf("Sharing env ID %ld\n", new_ctp->ct_id);
+ replyp->envcl_id = new_ctp->ct_id;
+ ret = __dbenv_close_int(dbenvcl_id, 0, 0);
+ } else {
+ ret = dbenv->open(dbenv, fullhome->home, newflags, mode);
+ dbenv_ctp->ct_envdp.home = fullhome;
+ dbenv_ctp->ct_envdp.envflags = shareflags;
+ }
+out: replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_remove_proc */
+/*
+ * PUBLIC: void __env_remove_proc __P((long, char *, u_int32_t,
+ * PUBLIC: __env_remove_reply *));
+ */
+void
+__env_remove_proc(dbenvcl_id, home, flags, replyp)
+ long dbenvcl_id;
+ char *home;
+ u_int32_t flags;
+ __env_remove_reply *replyp;
+/* END __env_remove_proc */
+{
+ DB_ENV *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+ home_entry *fullhome;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ fullhome = get_home(home);
+ if (fullhome == NULL) {
+ replyp->status = DB_NOSERVER_HOME;
+ return;
+ }
+
+ ret = dbenv->remove(dbenv, fullhome->home, flags);
+ __dbdel_ctp(dbenv_ctp);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_abort_proc */
+/*
+ * PUBLIC: void __txn_abort_proc __P((long, __txn_abort_reply *));
+ */
+void
+__txn_abort_proc(txnpcl_id, replyp)
+ long txnpcl_id;
+ __txn_abort_reply *replyp;
+/* END __txn_abort_proc */
+{
+ DB_TXN *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+ ret = txnp->abort(txnp);
+ __dbdel_ctp(txnp_ctp);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_begin_proc */
+/*
+ * PUBLIC: void __txn_begin_proc __P((long, long, u_int32_t,
+ * PUBLIC: __txn_begin_reply *));
+ */
+void
+__txn_begin_proc(dbenvcl_id, parentcl_id,
+ flags, replyp)
+ long dbenvcl_id;
+ long parentcl_id;
+ u_int32_t flags;
+ __txn_begin_reply *replyp;
+/* END __txn_begin_proc */
+{
+ DB_ENV *dbenv;
+ DB_TXN *parent, *txnp;
+ ct_entry *ctp, *dbenv_ctp, *parent_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+ parent_ctp = NULL;
+
+ ctp = new_ct_ent(&replyp->status);
+ if (ctp == NULL)
+ return;
+
+ if (parentcl_id != 0) {
+ ACTIVATE_CTP(parent_ctp, parentcl_id, CT_TXN);
+ parent = (DB_TXN *)parent_ctp->ct_anyp;
+ ctp->ct_activep = parent_ctp->ct_activep;
+ } else
+ parent = NULL;
+
+ ret = dbenv->txn_begin(dbenv, parent, &txnp, flags);
+ if (ret == 0) {
+ ctp->ct_txnp = txnp;
+ ctp->ct_type = CT_TXN;
+ ctp->ct_parent = parent_ctp;
+ ctp->ct_envparent = dbenv_ctp;
+ replyp->txnidcl_id = ctp->ct_id;
+ __dbsrv_settimeout(ctp, dbenv_ctp->ct_timeout);
+ __dbsrv_active(ctp);
+ } else
+ __dbclear_ctp(ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_commit_proc */
+/*
+ * PUBLIC: void __txn_commit_proc __P((long, u_int32_t,
+ * PUBLIC: __txn_commit_reply *));
+ */
+void
+__txn_commit_proc(txnpcl_id, flags, replyp)
+ long txnpcl_id;
+ u_int32_t flags;
+ __txn_commit_reply *replyp;
+/* END __txn_commit_proc */
+{
+ DB_TXN *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+ ret = txnp->commit(txnp, flags);
+ __dbdel_ctp(txnp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_discard_proc */
+/*
+ * PUBLIC: void __txn_discard_proc __P((long, u_int32_t,
+ * PUBLIC: __txn_discard_reply *));
+ */
+void
+__txn_discard_proc(txnpcl_id, flags, replyp)
+ long txnpcl_id;
+ u_int32_t flags;
+ __txn_discard_reply *replyp;
+/* END __txn_discard_proc */
+{
+ DB_TXN *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+ ret = txnp->discard(txnp, flags);
+ __dbdel_ctp(txnp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_prepare_proc */
+/*
+ * PUBLIC: void __txn_prepare_proc __P((long, u_int8_t *,
+ * PUBLIC: __txn_prepare_reply *));
+ */
+void
+__txn_prepare_proc(txnpcl_id, gid, replyp)
+ long txnpcl_id;
+ u_int8_t *gid;
+ __txn_prepare_reply *replyp;
+/* END __txn_prepare_proc */
+{
+ DB_TXN *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+
+ ret = txnp->prepare(txnp, gid);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_recover_proc */
+/*
+ * PUBLIC: void __txn_recover_proc __P((long, u_int32_t, u_int32_t,
+ * PUBLIC: __txn_recover_reply *, int *));
+ */
+void
+__txn_recover_proc(dbenvcl_id, count,
+ flags, replyp, freep)
+ long dbenvcl_id;
+ u_int32_t count;
+ u_int32_t flags;
+ __txn_recover_reply *replyp;
+ int * freep;
+/* END __txn_recover_proc */
+{
+ DB_ENV *dbenv;
+ DB_PREPLIST *dbprep, *p;
+ ct_entry *dbenv_ctp, *ctp;
+ long erri, i, retcount;
+ u_int32_t *txnidp;
+ int ret;
+ u_int8_t *gid;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+ dbprep = NULL;
+ *freep = 0;
+
+ if ((ret =
+ __os_malloc(dbenv, count * sizeof(DB_PREPLIST), &dbprep)) != 0)
+ goto out;
+ if ((ret =
+ dbenv->txn_recover(dbenv, dbprep, count, &retcount, flags)) != 0)
+ goto out;
+ /*
+ * If there is nothing, success, but it's easy.
+ */
+ replyp->retcount = retcount;
+ if (retcount == 0) {
+ replyp->txn.txn_val = NULL;
+ replyp->txn.txn_len = 0;
+ replyp->gid.gid_val = NULL;
+ replyp->gid.gid_len = 0;
+ }
+
+ /*
+ * We have our txn list. Now we need to allocate the space for
+ * the txn ID array and the GID array and set them up.
+ */
+ if ((ret = __os_calloc(dbenv, retcount, sizeof(u_int32_t),
+ &replyp->txn.txn_val)) != 0)
+ goto out;
+ replyp->txn.txn_len = retcount * sizeof(u_int32_t);
+ if ((ret = __os_calloc(dbenv, retcount, DB_XIDDATASIZE,
+ &replyp->gid.gid_val)) != 0) {
+ __os_free(dbenv, replyp->txn.txn_val);
+ goto out;
+ }
+ replyp->gid.gid_len = retcount * DB_XIDDATASIZE;
+
+ /*
+ * Now walk through our results, creating parallel arrays
+ * to send back. For each entry we need to create a new
+ * txn ctp and then fill in the array info.
+ */
+ i = 0;
+ p = dbprep;
+ gid = replyp->gid.gid_val;
+ txnidp = replyp->txn.txn_val;
+ while (i++ < retcount) {
+ ctp = new_ct_ent(&ret);
+ if (ret != 0) {
+ i--;
+ goto out2;
+ }
+ ctp->ct_txnp = p->txn;
+ ctp->ct_type = CT_TXN;
+ ctp->ct_parent = NULL;
+ ctp->ct_envparent = dbenv_ctp;
+ __dbsrv_settimeout(ctp, dbenv_ctp->ct_timeout);
+ __dbsrv_active(ctp);
+
+ *txnidp = ctp->ct_id;
+ memcpy(gid, p->gid, DB_XIDDATASIZE);
+
+ p++;
+ txnidp++;
+ gid += DB_XIDDATASIZE;
+ }
+ /*
+ * If we get here, we have success and we have to set freep
+ * so it'll get properly freed next time.
+ */
+ *freep = 1;
+out:
+ if (dbprep != NULL)
+ __os_free(dbenv, dbprep);
+ replyp->status = ret;
+ return;
+out2:
+ /*
+ * We had an error in the middle of creating our new txn
+ * ct entries. We have to unwind all that we have done. Ugh.
+ */
+ for (txnidp = replyp->txn.txn_val, erri = 0;
+ erri < i; erri++, txnidp++) {
+ ctp = get_tableent(*txnidp);
+ __dbclear_ctp(ctp);
+ }
+ __os_free(dbenv, replyp->txn.txn_val);
+ __os_free(dbenv, replyp->gid.gid_val);
+ __os_free(dbenv, dbprep);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_bt_maxkey_proc */
+/*
+ * PUBLIC: void __db_bt_maxkey_proc __P((long, u_int32_t,
+ * PUBLIC: __db_bt_maxkey_reply *));
+ */
+void
+__db_bt_maxkey_proc(dbpcl_id, maxkey, replyp)
+ long dbpcl_id;
+ u_int32_t maxkey;
+ __db_bt_maxkey_reply *replyp;
+/* END __db_bt_maxkey_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_bt_maxkey(dbp, maxkey);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_associate_proc */
+/*
+ * PUBLIC: void __db_associate_proc __P((long, long, long, u_int32_t,
+ * PUBLIC: __db_associate_reply *));
+ */
+void
+__db_associate_proc(dbpcl_id, txnpcl_id, sdbpcl_id,
+ flags, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ long sdbpcl_id;
+ u_int32_t flags;
+ __db_associate_reply *replyp;
+/* END __db_associate_proc */
+{
+ DB *dbp, *sdbp;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *sdbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ ACTIVATE_CTP(sdbp_ctp, sdbpcl_id, CT_DB);
+ sdbp = (DB *)sdbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+
+ /*
+ * We do not support DB_CREATE for associate. Users
+ * can only access secondary indices on a read-only basis,
+ * so whatever they are looking for needs to be there already.
+ */
+ if (flags != 0)
+ ret = EINVAL;
+ else
+ ret = dbp->associate(dbp, txnp, sdbp, NULL, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_bt_minkey_proc */
+/*
+ * PUBLIC: void __db_bt_minkey_proc __P((long, u_int32_t,
+ * PUBLIC: __db_bt_minkey_reply *));
+ */
+void
+__db_bt_minkey_proc(dbpcl_id, minkey, replyp)
+ long dbpcl_id;
+ u_int32_t minkey;
+ __db_bt_minkey_reply *replyp;
+/* END __db_bt_minkey_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_bt_minkey(dbp, minkey);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_close_proc */
+/*
+ * PUBLIC: void __db_close_proc __P((long, u_int32_t, __db_close_reply *));
+ */
+void
+__db_close_proc(dbpcl_id, flags, replyp)
+ long dbpcl_id;
+ u_int32_t flags;
+ __db_close_reply *replyp;
+/* END __db_close_proc */
+{
+ ct_entry *dbp_ctp;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ replyp->status = __db_close_int(dbpcl_id, flags);
+ return;
+}
+
+/* BEGIN __db_create_proc */
+/*
+ * PUBLIC: void __db_create_proc __P((long, u_int32_t, __db_create_reply *));
+ */
+void
+__db_create_proc(dbenvcl_id, flags, replyp)
+ long dbenvcl_id;
+ u_int32_t flags;
+ __db_create_reply *replyp;
+/* END __db_create_proc */
+{
+ DB *dbp;
+ DB_ENV *dbenv;
+ ct_entry *dbenv_ctp, *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DB_ENV *)dbenv_ctp->ct_anyp;
+
+ dbp_ctp = new_ct_ent(&replyp->status);
+ if (dbp_ctp == NULL)
+ return ;
+ /*
+ * We actually require env's for databases. The client should
+ * have caught it, but just in case.
+ */
+ DB_ASSERT(dbenv != NULL);
+ if ((ret = db_create(&dbp, dbenv, flags)) == 0) {
+ dbp_ctp->ct_dbp = dbp;
+ dbp_ctp->ct_type = CT_DB;
+ dbp_ctp->ct_parent = dbenv_ctp;
+ dbp_ctp->ct_envparent = dbenv_ctp;
+ replyp->dbcl_id = dbp_ctp->ct_id;
+ } else
+ __dbclear_ctp(dbp_ctp);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_del_proc */
+/*
+ * PUBLIC: void __db_del_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, __db_del_reply *));
+ */
+void
+__db_del_proc(dbpcl_id, txnpcl_id, keydlen,
+ keydoff, keyulen, keyflags, keydata,
+ keysize, flags, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t flags;
+ __db_del_reply *replyp;
+/* END __db_del_proc */
+{
+ DB *dbp;
+ DBT key;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ memset(&key, 0, sizeof(key));
+
+ /* Set up key DBT */
+ key.dlen = keydlen;
+ key.ulen = keyulen;
+ key.doff = keydoff;
+ key.flags = keyflags;
+ key.size = keysize;
+ key.data = keydata;
+
+ ret = dbp->del(dbp, txnp, &key, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_encrypt_proc */
+/*
+ * PUBLIC: void __db_encrypt_proc __P((long, char *, u_int32_t,
+ * PUBLIC: __db_encrypt_reply *));
+ */
+void
+__db_encrypt_proc(dbpcl_id, passwd, flags, replyp)
+ long dbpcl_id;
+ char *passwd;
+ u_int32_t flags;
+ __db_encrypt_reply *replyp;
+/* END __db_encrypt_proc */
+{
+ int ret;
+ DB * dbp;
+ ct_entry *dbp_ctp;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_encrypt(dbp, passwd, flags);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_extentsize_proc */
+/*
+ * PUBLIC: void __db_extentsize_proc __P((long, u_int32_t,
+ * PUBLIC: __db_extentsize_reply *));
+ */
+void
+__db_extentsize_proc(dbpcl_id, extentsize, replyp)
+ long dbpcl_id;
+ u_int32_t extentsize;
+ __db_extentsize_reply *replyp;
+/* END __db_extentsize_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_q_extentsize(dbp, extentsize);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_flags_proc */
+/*
+ * PUBLIC: void __db_flags_proc __P((long, u_int32_t, __db_flags_reply *));
+ */
+void
+__db_flags_proc(dbpcl_id, flags, replyp)
+ long dbpcl_id;
+ u_int32_t flags;
+ __db_flags_reply *replyp;
+/* END __db_flags_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_flags(dbp, flags);
+ dbp_ctp->ct_dbdp.setflags |= flags;
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_get_proc */
+/*
+ * PUBLIC: void __db_get_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, __db_get_reply *, int *));
+ */
+void
+__db_get_proc(dbpcl_id, txnpcl_id, keydlen,
+ keydoff, keyulen, keyflags, keydata,
+ keysize, datadlen, datadoff, dataulen,
+ dataflags, datadata, datasize, flags, replyp, freep)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __db_get_reply *replyp;
+ int * freep;
+/* END __db_get_proc */
+{
+ DB *dbp;
+ DBT key, data;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int key_alloc, bulk_alloc, ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+ bulk_alloc = 0;
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
+
+ /* Set up key and data DBT */
+ key.dlen = keydlen;
+ key.doff = keydoff;
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.flags = DB_DBT_MALLOC;
+ if (keyflags & DB_DBT_PARTIAL)
+ key.flags |= DB_DBT_PARTIAL;
+ key.size = keysize;
+ key.ulen = keyulen;
+ key.data = keydata;
+
+ data.dlen = datadlen;
+ data.doff = datadoff;
+ data.ulen = dataulen;
+ /*
+ * Ignore memory related flags on server.
+ */
+ data.size = datasize;
+ data.data = datadata;
+ if (flags & DB_MULTIPLE) {
+ if (data.data == 0) {
+ ret = __os_umalloc(dbp->dbenv,
+ data.ulen, &data.data);
+ if (ret != 0)
+ goto err;
+ bulk_alloc = 1;
+ }
+ data.flags |= DB_DBT_USERMEM;
+ } else
+ data.flags |= DB_DBT_MALLOC;
+ if (dataflags & DB_DBT_PARTIAL)
+ data.flags |= DB_DBT_PARTIAL;
+
+ /* Got all our stuff, now do the get */
+ ret = dbp->get(dbp, txnp, &key, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (key.data == keydata) {
+ ret = __os_umalloc(dbp->dbenv,
+ key.size, &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, key.data);
+ __os_ufree(dbp->dbenv, data.data);
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->keydata.keydata_val, key.data, key.size);
+ } else
+ replyp->keydata.keydata_val = key.data;
+
+ replyp->keydata.keydata_len = key.size;
+
+ /*
+ * Data
+ */
+ if (data.data == datadata) {
+ ret = __os_umalloc(dbp->dbenv,
+ data.size, &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, key.data);
+ __os_ufree(dbp->dbenv, data.data);
+ if (key_alloc)
+ __os_ufree(dbp->dbenv,
+ replyp->keydata.keydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.data,
+ data.size);
+ } else
+ replyp->datadata.datadata_val = data.data;
+ replyp->datadata.datadata_len = data.size;
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ if (bulk_alloc)
+ __os_ufree(dbp->dbenv, data.data);
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_h_ffactor_proc */
+/*
+ * PUBLIC: void __db_h_ffactor_proc __P((long, u_int32_t,
+ * PUBLIC: __db_h_ffactor_reply *));
+ */
+void
+__db_h_ffactor_proc(dbpcl_id, ffactor, replyp)
+ long dbpcl_id;
+ u_int32_t ffactor;
+ __db_h_ffactor_reply *replyp;
+/* END __db_h_ffactor_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_h_ffactor(dbp, ffactor);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_h_nelem_proc */
+/*
+ * PUBLIC: void __db_h_nelem_proc __P((long, u_int32_t,
+ * PUBLIC: __db_h_nelem_reply *));
+ */
+void
+__db_h_nelem_proc(dbpcl_id, nelem, replyp)
+ long dbpcl_id;
+ u_int32_t nelem;
+ __db_h_nelem_reply *replyp;
+/* END __db_h_nelem_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_h_nelem(dbp, nelem);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_key_range_proc */
+/*
+ * PUBLIC: void __db_key_range_proc __P((long, long, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, __db_key_range_reply *));
+ */
+void
+__db_key_range_proc(dbpcl_id, txnpcl_id, keydlen,
+ keydoff, keyulen, keyflags, keydata,
+ keysize, flags, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t flags;
+ __db_key_range_reply *replyp;
+/* END __db_key_range_proc */
+{
+ DB *dbp;
+ DBT key;
+ DB_KEY_RANGE range;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ memset(&key, 0, sizeof(key));
+ /* Set up key and data DBT */
+ key.dlen = keydlen;
+ key.ulen = keyulen;
+ key.doff = keydoff;
+ key.size = keysize;
+ key.data = keydata;
+ key.flags = keyflags;
+
+ ret = dbp->key_range(dbp, txnp, &key, &range, flags);
+
+ replyp->status = ret;
+ replyp->less = range.less;
+ replyp->equal = range.equal;
+ replyp->greater = range.greater;
+ return;
+}
+
+/* BEGIN __db_lorder_proc */
+/*
+ * PUBLIC: void __db_lorder_proc __P((long, u_int32_t, __db_lorder_reply *));
+ */
+void
+__db_lorder_proc(dbpcl_id, lorder, replyp)
+ long dbpcl_id;
+ u_int32_t lorder;
+ __db_lorder_reply *replyp;
+/* END __db_lorder_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_lorder(dbp, lorder);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_open_proc */
+/*
+ * PUBLIC: void __db_open_proc __P((long, long, char *, char *, u_int32_t,
+ * PUBLIC: u_int32_t, u_int32_t, __db_open_reply *));
+ */
+void
+__db_open_proc(dbpcl_id, txnpcl_id, name,
+ subdb, type, flags, mode, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ char *name;
+ char *subdb;
+ u_int32_t type;
+ u_int32_t flags;
+ u_int32_t mode;
+ __db_open_reply *replyp;
+/* END __db_open_proc */
+{
+ DB *dbp;
+ DB_TXN *txnp;
+ DBTYPE dbtype;
+ ct_entry *dbp_ctp, *new_ctp, *txnp_ctp;
+ int isswapped, ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ replyp->dbcl_id = dbpcl_id;
+ if ((new_ctp = __dbsrv_sharedb(dbp_ctp, name, subdb, type, flags))
+ != NULL) {
+ /*
+ * We can share, clean up old ID, set new one.
+ */
+ if (__dbsrv_verbose)
+ printf("Sharing db ID %ld\n", new_ctp->ct_id);
+ replyp->dbcl_id = new_ctp->ct_id;
+ ret = __db_close_int(dbpcl_id, 0);
+ goto out;
+ }
+ ret = dbp->open(dbp, txnp, name, subdb, (DBTYPE)type, flags, mode);
+ if (ret == 0) {
+ (void)dbp->get_type(dbp, &dbtype);
+ replyp->type = dbtype;
+ /* XXX
+ * Tcl needs to peek at dbp->flags for DB_AM_DUP. Send
+ * this dbp's flags back.
+ */
+ replyp->dbflags = (int) dbp->flags;
+ /*
+ * We need to determine the byte order of the database
+ * and send it back to the client. Determine it by
+ * the server's native order and the swapped value of
+ * the DB itself.
+ */
+ (void)dbp->get_byteswapped(dbp, &isswapped);
+ if (__db_byteorder(NULL, 1234) == 0) {
+ if (isswapped == 0)
+ replyp->lorder = 1234;
+ else
+ replyp->lorder = 4321;
+ } else {
+ if (isswapped == 0)
+ replyp->lorder = 4321;
+ else
+ replyp->lorder = 1234;
+ }
+ dbp_ctp->ct_dbdp.type = dbtype;
+ dbp_ctp->ct_dbdp.dbflags = LF_ISSET(DB_SERVER_DBFLAGS);
+ if (name == NULL)
+ dbp_ctp->ct_dbdp.db = NULL;
+ else if ((ret = __os_strdup(dbp->dbenv, name,
+ &dbp_ctp->ct_dbdp.db)) != 0)
+ goto out;
+ if (subdb == NULL)
+ dbp_ctp->ct_dbdp.subdb = NULL;
+ else if ((ret = __os_strdup(dbp->dbenv, subdb,
+ &dbp_ctp->ct_dbdp.subdb)) != 0)
+ goto out;
+ }
+out:
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_pagesize_proc */
+/*
+ * PUBLIC: void __db_pagesize_proc __P((long, u_int32_t,
+ * PUBLIC: __db_pagesize_reply *));
+ */
+void
+__db_pagesize_proc(dbpcl_id, pagesize, replyp)
+ long dbpcl_id;
+ u_int32_t pagesize;
+ __db_pagesize_reply *replyp;
+/* END __db_pagesize_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_pagesize(dbp, pagesize);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_pget_proc */
+/*
+ * PUBLIC: void __db_pget_proc __P((long, long, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, __db_pget_reply *, int *));
+ */
+void
+__db_pget_proc(dbpcl_id, txnpcl_id, skeydlen,
+ skeydoff, skeyulen, skeyflags, skeydata,
+ skeysize, pkeydlen, pkeydoff, pkeyulen,
+ pkeyflags, pkeydata, pkeysize, datadlen,
+ datadoff, dataulen, dataflags, datadata,
+ datasize, flags, replyp, freep)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t skeydlen;
+ u_int32_t skeydoff;
+ u_int32_t skeyulen;
+ u_int32_t skeyflags;
+ void *skeydata;
+ u_int32_t skeysize;
+ u_int32_t pkeydlen;
+ u_int32_t pkeydoff;
+ u_int32_t pkeyulen;
+ u_int32_t pkeyflags;
+ void *pkeydata;
+ u_int32_t pkeysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __db_pget_reply *replyp;
+ int * freep;
+/* END __db_pget_proc */
+{
+ DB *dbp;
+ DBT skey, pkey, data;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int key_alloc, ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+ memset(&skey, 0, sizeof(skey));
+ memset(&pkey, 0, sizeof(pkey));
+ memset(&data, 0, sizeof(data));
+
+ /*
+ * Ignore memory related flags on server.
+ */
+ /* Set up key and data DBT */
+ skey.flags = DB_DBT_MALLOC;
+ skey.dlen = skeydlen;
+ skey.ulen = skeyulen;
+ skey.doff = skeydoff;
+ if (skeyflags & DB_DBT_PARTIAL)
+ skey.flags |= DB_DBT_PARTIAL;
+ skey.size = skeysize;
+ skey.data = skeydata;
+
+ pkey.flags = DB_DBT_MALLOC;
+ pkey.dlen = pkeydlen;
+ pkey.ulen = pkeyulen;
+ pkey.doff = pkeydoff;
+ if (pkeyflags & DB_DBT_PARTIAL)
+ pkey.flags |= DB_DBT_PARTIAL;
+ pkey.size = pkeysize;
+ pkey.data = pkeydata;
+
+ data.flags = DB_DBT_MALLOC;
+ data.dlen = datadlen;
+ data.ulen = dataulen;
+ data.doff = datadoff;
+ if (dataflags & DB_DBT_PARTIAL)
+ data.flags |= DB_DBT_PARTIAL;
+ data.size = datasize;
+ data.data = datadata;
+
+ /* Got all our stuff, now do the get */
+ ret = dbp->pget(dbp, txnp, &skey, &pkey, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (skey.data == skeydata) {
+ ret = __os_umalloc(dbp->dbenv,
+ skey.size, &replyp->skeydata.skeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, skey.data);
+ __os_ufree(dbp->dbenv, pkey.data);
+ __os_ufree(dbp->dbenv, data.data);
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->skeydata.skeydata_val, skey.data,
+ skey.size);
+ } else
+ replyp->skeydata.skeydata_val = skey.data;
+
+ replyp->skeydata.skeydata_len = skey.size;
+
+ /*
+ * Primary key
+ */
+ if (pkey.data == pkeydata) {
+ ret = __os_umalloc(dbp->dbenv,
+ pkey.size, &replyp->pkeydata.pkeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, skey.data);
+ __os_ufree(dbp->dbenv, pkey.data);
+ __os_ufree(dbp->dbenv, data.data);
+ if (key_alloc)
+ __os_ufree(dbp->dbenv,
+ replyp->skeydata.skeydata_val);
+ goto err;
+ }
+ /*
+ * We can set it to 2, because they cannot send the
+ * pkey over without sending the skey over too.
+ * So if they did send a pkey, they must have sent
+ * the skey as well.
+ */
+ key_alloc = 2;
+ memcpy(replyp->pkeydata.pkeydata_val, pkey.data,
+ pkey.size);
+ } else
+ replyp->pkeydata.pkeydata_val = pkey.data;
+ replyp->pkeydata.pkeydata_len = pkey.size;
+
+ /*
+ * Data
+ */
+ if (data.data == datadata) {
+ ret = __os_umalloc(dbp->dbenv,
+ data.size, &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, skey.data);
+ __os_ufree(dbp->dbenv, pkey.data);
+ __os_ufree(dbp->dbenv, data.data);
+ /*
+ * If key_alloc is 1, just skey needs to be
+ * freed, if key_alloc is 2, both skey and pkey
+ * need to be freed.
+ */
+ if (key_alloc--)
+ __os_ufree(dbp->dbenv,
+ replyp->skeydata.skeydata_val);
+ if (key_alloc)
+ __os_ufree(dbp->dbenv,
+ replyp->pkeydata.pkeydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.data,
+ data.size);
+ } else
+ replyp->datadata.datadata_val = data.data;
+ replyp->datadata.datadata_len = data.size;
+ } else {
+err: replyp->skeydata.skeydata_val = NULL;
+ replyp->skeydata.skeydata_len = 0;
+ replyp->pkeydata.pkeydata_val = NULL;
+ replyp->pkeydata.pkeydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_put_proc */
+/*
+ * PUBLIC: void __db_put_proc __P((long, long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, __db_put_reply *, int *));
+ */
+void
+__db_put_proc(dbpcl_id, txnpcl_id, keydlen,
+ keydoff, keyulen, keyflags, keydata,
+ keysize, datadlen, datadoff, dataulen,
+ dataflags, datadata, datasize, flags, replyp, freep)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __db_put_reply *replyp;
+ int * freep;
+/* END __db_put_proc */
+{
+ DB *dbp;
+ DBT key, data;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
+
+ /* Set up key and data DBT */
+ key.dlen = keydlen;
+ key.ulen = keyulen;
+ key.doff = keydoff;
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.flags = DB_DBT_MALLOC;
+ if (keyflags & DB_DBT_PARTIAL)
+ key.flags |= DB_DBT_PARTIAL;
+ key.size = keysize;
+ key.data = keydata;
+
+ data.dlen = datadlen;
+ data.ulen = dataulen;
+ data.doff = datadoff;
+ data.flags = dataflags;
+ data.size = datasize;
+ data.data = datadata;
+
+ /* Got all our stuff, now do the put */
+ ret = dbp->put(dbp, txnp, &key, &data, flags);
+ /*
+ * If the client did a DB_APPEND, set up key in reply.
+ * Otherwise just status.
+ */
+ if (ret == 0 && (flags == DB_APPEND)) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ if (key.data == keydata) {
+ ret = __os_umalloc(dbp->dbenv,
+ key.size, &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->dbenv, key.data);
+ goto err;
+ }
+ memcpy(replyp->keydata.keydata_val, key.data, key.size);
+ } else
+ replyp->keydata.keydata_val = key.data;
+
+ replyp->keydata.keydata_len = key.size;
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_delim_proc */
+/*
+ * PUBLIC: void __db_re_delim_proc __P((long, u_int32_t,
+ * PUBLIC: __db_re_delim_reply *));
+ */
+void
+__db_re_delim_proc(dbpcl_id, delim, replyp)
+ long dbpcl_id;
+ u_int32_t delim;
+ __db_re_delim_reply *replyp;
+/* END __db_re_delim_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_delim(dbp, delim);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_len_proc */
+/*
+ * PUBLIC: void __db_re_len_proc __P((long, u_int32_t, __db_re_len_reply *));
+ */
+void
+__db_re_len_proc(dbpcl_id, len, replyp)
+ long dbpcl_id;
+ u_int32_t len;
+ __db_re_len_reply *replyp;
+/* END __db_re_len_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_len(dbp, len);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_pad_proc */
+/*
+ * PUBLIC: void __db_re_pad_proc __P((long, u_int32_t, __db_re_pad_reply *));
+ */
+void
+__db_re_pad_proc(dbpcl_id, pad, replyp)
+ long dbpcl_id;
+ u_int32_t pad;
+ __db_re_pad_reply *replyp;
+/* END __db_re_pad_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_pad(dbp, pad);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_remove_proc */
+/*
+ * PUBLIC: void __db_remove_proc __P((long, char *, char *, u_int32_t,
+ * PUBLIC: __db_remove_reply *));
+ */
+void
+__db_remove_proc(dbpcl_id, name, subdb,
+ flags, replyp)
+ long dbpcl_id;
+ char *name;
+ char *subdb;
+ u_int32_t flags;
+ __db_remove_reply *replyp;
+/* END __db_remove_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->remove(dbp, name, subdb, flags);
+ __dbdel_ctp(dbp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_rename_proc */
+/*
+ * PUBLIC: void __db_rename_proc __P((long, char *, char *, char *, u_int32_t,
+ * PUBLIC: __db_rename_reply *));
+ */
+void
+__db_rename_proc(dbpcl_id, name, subdb,
+ newname, flags, replyp)
+ long dbpcl_id;
+ char *name;
+ char *subdb;
+ char *newname;
+ u_int32_t flags;
+ __db_rename_reply *replyp;
+/* END __db_rename_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->rename(dbp, name, subdb, newname, flags);
+ __dbdel_ctp(dbp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_stat_proc */
+/*
+ * PUBLIC: void __db_stat_proc __P((long, u_int32_t, __db_stat_reply *,
+ * PUBLIC: int *));
+ */
+void
+__db_stat_proc(dbpcl_id, flags, replyp, freep)
+ long dbpcl_id;
+ u_int32_t flags;
+ __db_stat_reply *replyp;
+ int * freep;
+/* END __db_stat_proc */
+{
+ DB *dbp;
+ DBTYPE type;
+ ct_entry *dbp_ctp;
+ u_int32_t *q, *p, *retsp;
+ int i, len, ret;
+ void *sp;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->stat(dbp, &sp, flags);
+ replyp->status = ret;
+ if (ret != 0)
+ return;
+ /*
+ * We get here, we have success. Allocate an array so that
+ * we can use the list generator. Generate the reply, free
+ * up the space.
+ */
+ /*
+ * XXX This assumes that all elements of all stat structures
+ * are u_int32_t fields. They are, currently.
+ */
+ (void)dbp->get_type(dbp, &type);
+ if (type == DB_HASH)
+ len = sizeof(DB_HASH_STAT);
+ else if (type == DB_QUEUE)
+ len = sizeof(DB_QUEUE_STAT);
+ else /* BTREE or RECNO are same stats */
+ len = sizeof(DB_BTREE_STAT);
+ replyp->stats.stats_len = len / sizeof(u_int32_t);
+
+ if ((ret = __os_umalloc(dbp->dbenv, len * replyp->stats.stats_len,
+ &retsp)) != 0)
+ goto out;
+ for (i = 0, q = retsp, p = sp; i < len;
+ i++, q++, p++)
+ *q = *p;
+ replyp->stats.stats_val = retsp;
+ __os_ufree(dbp->dbenv, sp);
+ if (ret == 0)
+ *freep = 1;
+out:
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_sync_proc */
+/*
+ * PUBLIC: void __db_sync_proc __P((long, u_int32_t, __db_sync_reply *));
+ */
+void
+__db_sync_proc(dbpcl_id, flags, replyp)
+ long dbpcl_id;
+ u_int32_t flags;
+ __db_sync_reply *replyp;
+/* END __db_sync_proc */
+{
+ DB *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ ret = dbp->sync(dbp, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_truncate_proc */
+/*
+ * PUBLIC: void __db_truncate_proc __P((long, long, u_int32_t,
+ * PUBLIC: __db_truncate_reply *));
+ */
+void
+__db_truncate_proc(dbpcl_id, txnpcl_id,
+ flags, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t flags;
+ __db_truncate_reply *replyp;
+/* END __db_truncate_proc */
+{
+ DB *dbp;
+ DB_TXN *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ u_int32_t count;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbp->truncate(dbp, txnp, &count, flags);
+ replyp->status = ret;
+ if (ret == 0)
+ replyp->count = count;
+ return;
+}
+
+/* BEGIN __db_cursor_proc */
+/*
+ * PUBLIC: void __db_cursor_proc __P((long, long, u_int32_t,
+ * PUBLIC: __db_cursor_reply *));
+ */
+void
+__db_cursor_proc(dbpcl_id, txnpcl_id,
+ flags, replyp)
+ long dbpcl_id;
+ long txnpcl_id;
+ u_int32_t flags;
+ __db_cursor_reply *replyp;
+/* END __db_cursor_proc */
+{
+ DB *dbp;
+ DBC *dbc;
+ DB_TXN *txnp;
+ ct_entry *dbc_ctp, *env_ctp, *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+ dbc_ctp = new_ct_ent(&replyp->status);
+ if (dbc_ctp == NULL)
+ return;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DB_TXN *)txnp_ctp->ct_anyp;
+ dbc_ctp->ct_activep = txnp_ctp->ct_activep;
+ } else
+ txnp = NULL;
+
+ if ((ret = dbp->cursor(dbp, txnp, &dbc, flags)) == 0) {
+ dbc_ctp->ct_dbc = dbc;
+ dbc_ctp->ct_type = CT_CURSOR;
+ dbc_ctp->ct_parent = dbp_ctp;
+ env_ctp = dbp_ctp->ct_envparent;
+ dbc_ctp->ct_envparent = env_ctp;
+ __dbsrv_settimeout(dbc_ctp, env_ctp->ct_timeout);
+ __dbsrv_active(dbc_ctp);
+ replyp->dbcidcl_id = dbc_ctp->ct_id;
+ } else
+ __dbclear_ctp(dbc_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_join_proc */
+/*
+ * PUBLIC: void __db_join_proc __P((long, u_int32_t *, u_int32_t, u_int32_t,
+ * PUBLIC: __db_join_reply *));
+ */
+void
+__db_join_proc(dbpcl_id, curs, curslen,
+ flags, replyp)
+ long dbpcl_id;
+ u_int32_t * curs;
+ u_int32_t curslen;
+ u_int32_t flags;
+ __db_join_reply *replyp;
+/* END __db_join_proc */
+{
+ DB *dbp;
+ DBC **jcurs, **c;
+ DBC *dbc;
+ ct_entry *dbc_ctp, *ctp, *dbp_ctp;
+ size_t size;
+ u_int32_t *cl, i;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (DB *)dbp_ctp->ct_anyp;
+
+ dbc_ctp = new_ct_ent(&replyp->status);
+ if (dbc_ctp == NULL)
+ return;
+
+ size = (curslen + 1) * sizeof(DBC *);
+ if ((ret = __os_calloc(dbp->dbenv,
+ curslen + 1, sizeof(DBC *), &jcurs)) != 0) {
+ replyp->status = ret;
+ __dbclear_ctp(dbc_ctp);
+ return;
+ }
+ /*
+ * If our curslist has a parent txn, we need to use it too
+ * for the activity timeout. All cursors must be part of
+ * the same transaction, so just check the first.
+ */
+ ctp = get_tableent(*curs);
+ DB_ASSERT(ctp->ct_type == CT_CURSOR);
+ /*
+ * If we are using a transaction, set the join activity timer
+ * to point to the parent transaction.
+ */
+ if (ctp->ct_activep != &ctp->ct_active)
+ dbc_ctp->ct_activep = ctp->ct_activep;
+ for (i = 0, cl = curs, c = jcurs; i < curslen; i++, cl++, c++) {
+ ctp = get_tableent(*cl);
+ if (ctp == NULL) {
+ replyp->status = DB_NOSERVER_ID;
+ goto out;
+ }
+ /*
+ * If we are using a txn, the join cursor points to the
+ * transaction timeout. If we are not using a transaction,
+ * then all the curslist cursors must point to the join
+ * cursor's timeout so that we do not timeout any of the
+ * curlist cursors while the join cursor is active.
+ * Change the type of the curslist ctps to CT_JOIN so that
+ * we know they are part of a join list and we can distinguish
+ * them and later restore them when the join cursor is closed.
+ */
+ DB_ASSERT(ctp->ct_type == CT_CURSOR);
+ ctp->ct_type |= CT_JOIN;
+ ctp->ct_origp = ctp->ct_activep;
+ /*
+ * Setting this to the ct_active field of the dbc_ctp is
+ * really just a way to distinguish which join dbc this
+ * cursor is part of. The ct_activep of this cursor is
+ * not used at all during its lifetime as part of a join
+ * cursor.
+ */
+ ctp->ct_activep = &dbc_ctp->ct_active;
+ *c = ctp->ct_dbc;
+ }
+ *c = NULL;
+ if ((ret = dbp->join(dbp, jcurs, &dbc, flags)) == 0) {
+ dbc_ctp->ct_dbc = dbc;
+ dbc_ctp->ct_type = (CT_JOINCUR | CT_CURSOR);
+ dbc_ctp->ct_parent = dbp_ctp;
+ dbc_ctp->ct_envparent = dbp_ctp->ct_envparent;
+ __dbsrv_settimeout(dbc_ctp, dbp_ctp->ct_envparent->ct_timeout);
+ __dbsrv_active(dbc_ctp);
+ replyp->dbcidcl_id = dbc_ctp->ct_id;
+ } else {
+ __dbclear_ctp(dbc_ctp);
+ /*
+ * If we get an error, undo what we did above to any cursors.
+ */
+ for (cl = curs; *cl != 0; cl++) {
+ ctp = get_tableent(*cl);
+ ctp->ct_type = CT_CURSOR;
+ ctp->ct_activep = ctp->ct_origp;
+ }
+ }
+
+ replyp->status = ret;
+out:
+ __os_free(dbp->dbenv, jcurs);
+ return;
+}
+
+/* BEGIN __dbc_close_proc */
+/*
+ * PUBLIC: void __dbc_close_proc __P((long, __dbc_close_reply *));
+ */
+void
+__dbc_close_proc(dbccl_id, replyp)
+ long dbccl_id;
+ __dbc_close_reply *replyp;
+/* END __dbc_close_proc */
+{
+ ct_entry *dbc_ctp;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ replyp->status = __dbc_close_int(dbc_ctp);
+ return;
+}
+
+/* BEGIN __dbc_count_proc */
+/*
+ * PUBLIC: void __dbc_count_proc __P((long, u_int32_t, __dbc_count_reply *));
+ */
+void
+__dbc_count_proc(dbccl_id, flags, replyp)
+ long dbccl_id;
+ u_int32_t flags;
+ __dbc_count_reply *replyp;
+/* END __dbc_count_proc */
+{
+ DBC *dbc;
+ ct_entry *dbc_ctp;
+ db_recno_t num;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+
+ ret = dbc->c_count(dbc, &num, flags);
+ replyp->status = ret;
+ if (ret == 0)
+ replyp->dupcount = num;
+ return;
+}
+
+/* BEGIN __dbc_del_proc */
+/*
+ * PUBLIC: void __dbc_del_proc __P((long, u_int32_t, __dbc_del_reply *));
+ */
+void
+__dbc_del_proc(dbccl_id, flags, replyp)
+ long dbccl_id;
+ u_int32_t flags;
+ __dbc_del_reply *replyp;
+/* END __dbc_del_proc */
+{
+ DBC *dbc;
+ ct_entry *dbc_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+
+ ret = dbc->c_del(dbc, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_dup_proc */
+/*
+ * PUBLIC: void __dbc_dup_proc __P((long, u_int32_t, __dbc_dup_reply *));
+ */
+void
+__dbc_dup_proc(dbccl_id, flags, replyp)
+ long dbccl_id;
+ u_int32_t flags;
+ __dbc_dup_reply *replyp;
+/* END __dbc_dup_proc */
+{
+ DBC *dbc, *newdbc;
+ ct_entry *dbc_ctp, *new_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+
+ new_ctp = new_ct_ent(&replyp->status);
+ if (new_ctp == NULL)
+ return;
+
+ if ((ret = dbc->c_dup(dbc, &newdbc, flags)) == 0) {
+ new_ctp->ct_dbc = newdbc;
+ new_ctp->ct_type = CT_CURSOR;
+ new_ctp->ct_parent = dbc_ctp->ct_parent;
+ new_ctp->ct_envparent = dbc_ctp->ct_envparent;
+ /*
+ * If our cursor has a parent txn, we need to use it too.
+ */
+ if (dbc_ctp->ct_activep != &dbc_ctp->ct_active)
+ new_ctp->ct_activep = dbc_ctp->ct_activep;
+ __dbsrv_settimeout(new_ctp, dbc_ctp->ct_timeout);
+ __dbsrv_active(new_ctp);
+ replyp->dbcidcl_id = new_ctp->ct_id;
+ } else
+ __dbclear_ctp(new_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_get_proc */
+/*
+ * PUBLIC: void __dbc_get_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, __dbc_get_reply *, int *));
+ */
+void
+__dbc_get_proc(dbccl_id, keydlen, keydoff,
+ keyulen, keyflags, keydata, keysize,
+ datadlen, datadoff, dataulen, dataflags,
+ datadata, datasize, flags, replyp, freep)
+ long dbccl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __dbc_get_reply *replyp;
+ int * freep;
+/* END __dbc_get_proc */
+{
+ DBC *dbc;
+ DBT key, data;
+ DB_ENV *dbenv;
+ ct_entry *dbc_ctp;
+ int key_alloc, bulk_alloc, ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+ dbenv = dbc->dbp->dbenv;
+
+ *freep = 0;
+ bulk_alloc = 0;
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
+
+ /* Set up key and data DBT */
+ key.dlen = keydlen;
+ key.ulen = keyulen;
+ key.doff = keydoff;
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.flags = DB_DBT_MALLOC;
+ if (keyflags & DB_DBT_PARTIAL)
+ key.flags |= DB_DBT_PARTIAL;
+ key.size = keysize;
+ key.data = keydata;
+
+ data.dlen = datadlen;
+ data.ulen = dataulen;
+ data.doff = datadoff;
+ data.size = datasize;
+ data.data = datadata;
+ if (flags & DB_MULTIPLE || flags & DB_MULTIPLE_KEY) {
+ if (data.data == 0) {
+ ret = __os_umalloc(dbenv, data.ulen, &data.data);
+ if (ret != 0)
+ goto err;
+ bulk_alloc = 1;
+ }
+ data.flags |= DB_DBT_USERMEM;
+ } else
+ data.flags |= DB_DBT_MALLOC;
+ if (dataflags & DB_DBT_PARTIAL)
+ data.flags |= DB_DBT_PARTIAL;
+
+ /* Got all our stuff, now do the get */
+ ret = dbc->c_get(dbc, &key, &data, flags);
+
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (key.data == keydata) {
+ ret = __os_umalloc(dbenv, key.size,
+ &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv, key.data);
+ __os_ufree(dbenv, data.data);
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->keydata.keydata_val, key.data, key.size);
+ } else
+ replyp->keydata.keydata_val = key.data;
+
+ replyp->keydata.keydata_len = key.size;
+
+ /*
+ * Data
+ */
+ if (data.data == datadata) {
+ ret = __os_umalloc(dbenv, data.size,
+ &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv, key.data);
+ __os_ufree(dbenv, data.data);
+ if (key_alloc)
+ __os_ufree(dbenv, replyp->keydata.keydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.data,
+ data.size);
+ } else
+ replyp->datadata.datadata_val = data.data;
+ replyp->datadata.datadata_len = data.size;
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ if (bulk_alloc)
+ __os_ufree(dbenv, data.data);
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_pget_proc */
+/*
+ * PUBLIC: void __dbc_pget_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *, u_int32_t,
+ * PUBLIC: u_int32_t, __dbc_pget_reply *, int *));
+ */
+void
+__dbc_pget_proc(dbccl_id, skeydlen, skeydoff,
+ skeyulen, skeyflags, skeydata, skeysize,
+ pkeydlen, pkeydoff, pkeyulen, pkeyflags,
+ pkeydata, pkeysize, datadlen, datadoff,
+ dataulen, dataflags, datadata, datasize,
+ flags, replyp, freep)
+ long dbccl_id;
+ u_int32_t skeydlen;
+ u_int32_t skeydoff;
+ u_int32_t skeyulen;
+ u_int32_t skeyflags;
+ void *skeydata;
+ u_int32_t skeysize;
+ u_int32_t pkeydlen;
+ u_int32_t pkeydoff;
+ u_int32_t pkeyulen;
+ u_int32_t pkeyflags;
+ void *pkeydata;
+ u_int32_t pkeysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __dbc_pget_reply *replyp;
+ int * freep;
+/* END __dbc_pget_proc */
+{
+ DBC *dbc;
+ DBT skey, pkey, data;
+ DB_ENV *dbenv;
+ ct_entry *dbc_ctp;
+ int key_alloc, ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+ dbenv = dbc->dbp->dbenv;
+
+ *freep = 0;
+ memset(&skey, 0, sizeof(skey));
+ memset(&pkey, 0, sizeof(pkey));
+ memset(&data, 0, sizeof(data));
+
+ /*
+ * Ignore memory related flags on server.
+ */
+ /* Set up key and data DBT */
+ skey.flags = DB_DBT_MALLOC;
+ skey.dlen = skeydlen;
+ skey.ulen = skeyulen;
+ skey.doff = skeydoff;
+ if (skeyflags & DB_DBT_PARTIAL)
+ skey.flags |= DB_DBT_PARTIAL;
+ skey.size = skeysize;
+ skey.data = skeydata;
+
+ pkey.flags = DB_DBT_MALLOC;
+ pkey.dlen = pkeydlen;
+ pkey.ulen = pkeyulen;
+ pkey.doff = pkeydoff;
+ if (pkeyflags & DB_DBT_PARTIAL)
+ pkey.flags |= DB_DBT_PARTIAL;
+ pkey.size = pkeysize;
+ pkey.data = pkeydata;
+
+ data.flags = DB_DBT_MALLOC;
+ data.dlen = datadlen;
+ data.ulen = dataulen;
+ data.doff = datadoff;
+ if (dataflags & DB_DBT_PARTIAL)
+ data.flags |= DB_DBT_PARTIAL;
+ data.size = datasize;
+ data.data = datadata;
+
+ /* Got all our stuff, now do the get */
+ ret = dbc->c_pget(dbc, &skey, &pkey, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (skey.data == skeydata) {
+ ret = __os_umalloc(dbenv,
+ skey.size, &replyp->skeydata.skeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv, skey.data);
+ __os_ufree(dbenv, pkey.data);
+ __os_ufree(dbenv, data.data);
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->skeydata.skeydata_val, skey.data,
+ skey.size);
+ } else
+ replyp->skeydata.skeydata_val = skey.data;
+ replyp->skeydata.skeydata_len = skey.size;
+
+ /*
+ * Primary key
+ */
+ if (pkey.data == pkeydata) {
+ ret = __os_umalloc(dbenv,
+ pkey.size, &replyp->pkeydata.pkeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv, skey.data);
+ __os_ufree(dbenv, pkey.data);
+ __os_ufree(dbenv, data.data);
+ if (key_alloc)
+ __os_ufree(dbenv,
+ replyp->skeydata.skeydata_val);
+ goto err;
+ }
+ /*
+ * We can set it to 2, because they cannot send the
+ * pkey over without sending the skey over too.
+ * So if they did send a pkey, they must have sent
+ * the skey as well.
+ */
+ key_alloc = 2;
+ memcpy(replyp->pkeydata.pkeydata_val, pkey.data,
+ pkey.size);
+ } else
+ replyp->pkeydata.pkeydata_val = pkey.data;
+ replyp->pkeydata.pkeydata_len = pkey.size;
+
+ /*
+ * Data
+ */
+ if (data.data == datadata) {
+ ret = __os_umalloc(dbenv,
+ data.size, &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv, skey.data);
+ __os_ufree(dbenv, pkey.data);
+ __os_ufree(dbenv, data.data);
+ /*
+ * If key_alloc is 1, just skey needs to be
+ * freed, if key_alloc is 2, both skey and pkey
+ * need to be freed.
+ */
+ if (key_alloc--)
+ __os_ufree(dbenv,
+ replyp->skeydata.skeydata_val);
+ if (key_alloc)
+ __os_ufree(dbenv,
+ replyp->pkeydata.pkeydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.data,
+ data.size);
+ } else
+ replyp->datadata.datadata_val = data.data;
+ replyp->datadata.datadata_len = data.size;
+ } else {
+err: replyp->skeydata.skeydata_val = NULL;
+ replyp->skeydata.skeydata_len = 0;
+ replyp->pkeydata.pkeydata_val = NULL;
+ replyp->pkeydata.pkeydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_put_proc */
+/*
+ * PUBLIC: void __dbc_put_proc __P((long, u_int32_t, u_int32_t, u_int32_t,
+ * PUBLIC: u_int32_t, void *, u_int32_t, u_int32_t, u_int32_t, u_int32_t, u_int32_t, void *,
+ * PUBLIC: u_int32_t, u_int32_t, __dbc_put_reply *, int *));
+ */
+void
+__dbc_put_proc(dbccl_id, keydlen, keydoff,
+ keyulen, keyflags, keydata, keysize,
+ datadlen, datadoff, dataulen, dataflags,
+ datadata, datasize, flags, replyp, freep)
+ long dbccl_id;
+ u_int32_t keydlen;
+ u_int32_t keydoff;
+ u_int32_t keyulen;
+ u_int32_t keyflags;
+ void *keydata;
+ u_int32_t keysize;
+ u_int32_t datadlen;
+ u_int32_t datadoff;
+ u_int32_t dataulen;
+ u_int32_t dataflags;
+ void *datadata;
+ u_int32_t datasize;
+ u_int32_t flags;
+ __dbc_put_reply *replyp;
+ int * freep;
+/* END __dbc_put_proc */
+{
+ DB *dbp;
+ DBC *dbc;
+ DBT key, data;
+ ct_entry *dbc_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+ dbp = (DB *)dbc_ctp->ct_parent->ct_anyp;
+
+ memset(&key, 0, sizeof(key));
+ memset(&data, 0, sizeof(data));
+
+ /* Set up key and data DBT */
+ key.dlen = keydlen;
+ key.ulen = keyulen;
+ key.doff = keydoff;
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.flags = 0;
+ if (keyflags & DB_DBT_PARTIAL)
+ key.flags |= DB_DBT_PARTIAL;
+ key.size = keysize;
+ key.data = keydata;
+
+ data.dlen = datadlen;
+ data.ulen = dataulen;
+ data.doff = datadoff;
+ data.flags = dataflags;
+ data.size = datasize;
+ data.data = datadata;
+
+ /* Got all our stuff, now do the put */
+ ret = dbc->c_put(dbc, &key, &data, flags);
+
+ *freep = 0;
+ if (ret == 0 && (flags == DB_AFTER || flags == DB_BEFORE) &&
+ dbp->type == DB_RECNO) {
+ /*
+ * We need to xdr_free whatever we are returning, next time.
+ */
+ replyp->keydata.keydata_val = key.data;
+ replyp->keydata.keydata_len = key.size;
+ } else {
+ replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+#endif /* HAVE_RPC */
diff --git a/storage/bdb/rpc_server/c/db_server_util.c b/storage/bdb/rpc_server/c/db_server_util.c
new file mode 100644
index 00000000000..2ea270c2d19
--- /dev/null
+++ b/storage/bdb/rpc_server/c/db_server_util.c
@@ -0,0 +1,815 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2000-2002
+ * Sleepycat Software. All rights reserved.
+ */
+
+#include "db_config.h"
+
+#ifndef lint
+static const char revid[] = "$Id: db_server_util.c,v 1.59 2002/03/27 04:32:50 bostic Exp $";
+#endif /* not lint */
+
+#ifndef NO_SYSTEM_INCLUDES
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+
+#include <rpc/rpc.h>
+
+#include <limits.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#endif
+#include "dbinc_auto/db_server.h"
+
+#include "db_int.h"
+#include "dbinc_auto/clib_ext.h"
+#include "dbinc/db_server_int.h"
+#include "dbinc_auto/rpc_server_ext.h"
+#include "dbinc_auto/common_ext.h"
+
+extern int __dbsrv_main __P((void));
+static int add_home __P((char *));
+static int add_passwd __P((char *));
+static int env_recover __P((char *));
+static void __dbclear_child __P((ct_entry *));
+
+static LIST_HEAD(cthead, ct_entry) __dbsrv_head;
+static LIST_HEAD(homehead, home_entry) __dbsrv_home;
+static long __dbsrv_defto = DB_SERVER_TIMEOUT;
+static long __dbsrv_maxto = DB_SERVER_MAXTIMEOUT;
+static long __dbsrv_idleto = DB_SERVER_IDLETIMEOUT;
+static char *logfile = NULL;
+static char *prog;
+
+static void usage __P((char *));
+static void version_check __P((void));
+
+int __dbsrv_verbose = 0;
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ extern char *optarg;
+ CLIENT *cl;
+ int ch, ret;
+ char *passwd;
+
+ prog = argv[0];
+
+ version_check();
+
+ ret = 0;
+ /*
+ * Check whether another server is running or not. There
+ * is a race condition where two servers could be racing to
+ * register with the portmapper. The goal of this check is to
+ * forbid running additional servers (like those started from
+ * the test suite) if the user is already running one.
+ *
+ * XXX
+ * This does not solve nor prevent two servers from being
+ * started at the same time and running recovery at the same
+ * time on the same environments.
+ */
+ if ((cl = clnt_create("localhost",
+ DB_RPC_SERVERPROG, DB_RPC_SERVERVERS, "tcp")) != NULL) {
+ fprintf(stderr,
+ "%s: Berkeley DB RPC server already running.\n", prog);
+ clnt_destroy(cl);
+ return (EXIT_FAILURE);
+ }
+
+ LIST_INIT(&__dbsrv_home);
+ while ((ch = getopt(argc, argv, "h:I:L:P:t:T:Vv")) != EOF)
+ switch (ch) {
+ case 'h':
+ (void)add_home(optarg);
+ break;
+ case 'I':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_idleto))
+ return (EXIT_FAILURE);
+ break;
+ case 'L':
+ logfile = optarg;
+ break;
+ case 'P':
+ passwd = strdup(optarg);
+ memset(optarg, 0, strlen(optarg));
+ if (passwd == NULL) {
+ fprintf(stderr, "%s: strdup: %s\n",
+ prog, strerror(errno));
+ return (EXIT_FAILURE);
+ }
+ if ((ret = add_passwd(passwd)) != 0) {
+ fprintf(stderr, "%s: strdup: %s\n",
+ prog, strerror(ret));
+ return (EXIT_FAILURE);
+ }
+ break;
+ case 't':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_defto))
+ return (EXIT_FAILURE);
+ break;
+ case 'T':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_maxto))
+ return (EXIT_FAILURE);
+ break;
+ case 'V':
+ printf("%s\n", db_version(NULL, NULL, NULL));
+ return (EXIT_SUCCESS);
+ case 'v':
+ __dbsrv_verbose = 1;
+ break;
+ default:
+ usage(prog);
+ }
+ /*
+ * Check default timeout against maximum timeout
+ */
+ if (__dbsrv_defto > __dbsrv_maxto)
+ __dbsrv_defto = __dbsrv_maxto;
+
+ /*
+ * Check default timeout against idle timeout
+ * It would be bad to timeout environments sooner than txns.
+ */
+ if (__dbsrv_defto > __dbsrv_idleto)
+ fprintf(stderr,
+ "%s: WARNING: Idle timeout %ld is less than resource timeout %ld\n",
+ prog, __dbsrv_idleto, __dbsrv_defto);
+
+ LIST_INIT(&__dbsrv_head);
+
+ /*
+ * If a client crashes during an RPC, our reply to it
+ * generates a SIGPIPE. Ignore SIGPIPE so we don't exit unnecessarily.
+ */
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+#endif
+
+ if (logfile != NULL && __db_util_logset("berkeley_db_svc", logfile))
+ return (EXIT_FAILURE);
+
+ /*
+ * Now that we are ready to start, run recovery on all the
+ * environments specified.
+ */
+ if (env_recover(prog) != 0)
+ return (EXIT_FAILURE);
+
+ /*
+ * We've done our setup, now call the generated server loop
+ */
+ if (__dbsrv_verbose)
+ printf("%s: Ready to receive requests\n", prog);
+ __dbsrv_main();
+
+ /* NOTREACHED */
+ abort();
+}
+
+static void
+usage(prog)
+ char *prog;
+{
+ fprintf(stderr, "usage: %s %s\n\t%s\n", prog,
+ "[-Vv] [-h home] [-P passwd]",
+ "[-I idletimeout] [-L logfile] [-t def_timeout] [-T maxtimeout]");
+ exit(EXIT_FAILURE);
+}
+
+static void
+version_check()
+{
+ int v_major, v_minor, v_patch;
+
+ /* Make sure we're loaded with the right version of the DB library. */
+ (void)db_version(&v_major, &v_minor, &v_patch);
+ if (v_major != DB_VERSION_MAJOR ||
+ v_minor != DB_VERSION_MINOR || v_patch != DB_VERSION_PATCH) {
+ fprintf(stderr,
+ "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n",
+ prog, DB_VERSION_MAJOR, DB_VERSION_MINOR,
+ DB_VERSION_PATCH, v_major, v_minor, v_patch);
+ exit(EXIT_FAILURE);
+ }
+}
+
+/*
+ * PUBLIC: void __dbsrv_settimeout __P((ct_entry *, u_int32_t));
+ */
+void
+__dbsrv_settimeout(ctp, to)
+ ct_entry *ctp;
+ u_int32_t to;
+{
+ if (to > (u_int32_t)__dbsrv_maxto)
+ ctp->ct_timeout = __dbsrv_maxto;
+ else if (to <= 0)
+ ctp->ct_timeout = __dbsrv_defto;
+ else
+ ctp->ct_timeout = to;
+}
+
+/*
+ * PUBLIC: void __dbsrv_timeout __P((int));
+ */
+void
+__dbsrv_timeout(force)
+ int force;
+{
+ static long to_hint = -1;
+ time_t t;
+ long to;
+ ct_entry *ctp, *nextctp;
+
+ if ((t = time(NULL)) == -1)
+ return;
+
+ /*
+ * Check hint. If hint is further in the future
+ * than now, no work to do.
+ */
+ if (!force && to_hint > 0 && t < to_hint)
+ return;
+ to_hint = -1;
+ /*
+ * Timeout transactions or cursors holding DB resources.
+ * Do this before timing out envs to properly release resources.
+ *
+ * !!!
+ * We can just loop through this list looking for cursors and txns.
+ * We do not need to verify txn and cursor relationships at this
+ * point because we maintain the list in LIFO order *and* we
+ * maintain activity in the ultimate txn parent of any cursor
+ * so either everything in a txn is timing out, or nothing.
+ * So, since we are LIFO, we will correctly close/abort all the
+ * appropriate handles, in the correct order.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ switch (ctp->ct_type) {
+ case CT_TXN:
+ to = *(ctp->ct_activep) + ctp->ct_timeout;
+ /* TIMEOUT */
+ if (to < t) {
+ if (__dbsrv_verbose)
+ printf("Timing out txn id %ld\n",
+ ctp->ct_id);
+ (void)((DB_TXN *)ctp->ct_anyp)->
+ abort((DB_TXN *)ctp->ct_anyp);
+ __dbdel_ctp(ctp);
+ /*
+ * If we timed out an txn, we may have closed
+ * all sorts of ctp's.
+ * So start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ } else if ((to_hint > 0 && to_hint > to) ||
+ to_hint == -1)
+ to_hint = to;
+ break;
+ case CT_CURSOR:
+ case (CT_JOINCUR | CT_CURSOR):
+ to = *(ctp->ct_activep) + ctp->ct_timeout;
+ /* TIMEOUT */
+ if (to < t) {
+ if (__dbsrv_verbose)
+ printf("Timing out cursor %ld\n",
+ ctp->ct_id);
+ (void)__dbc_close_int(ctp);
+ /*
+ * Start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ } else if ((to_hint > 0 && to_hint > to) ||
+ to_hint == -1)
+ to_hint = to;
+ break;
+ default:
+ break;
+ }
+ }
+ /*
+ * Timeout idle handles.
+ * If we are forcing a timeout, we'll close all env handles.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ if (ctp->ct_type != CT_ENV)
+ continue;
+ to = *(ctp->ct_activep) + ctp->ct_idle;
+ /* TIMEOUT */
+ if (to < t || force) {
+ if (__dbsrv_verbose)
+ printf("Timing out env id %ld\n", ctp->ct_id);
+ (void)__dbenv_close_int(ctp->ct_id, 0, 1);
+ /*
+ * If we timed out an env, we may have closed
+ * all sorts of ctp's (maybe even all of them.
+ * So start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ }
+ }
+}
+
+/*
+ * RECURSIVE FUNCTION. We need to clear/free any number of levels of nested
+ * layers.
+ */
+static void
+__dbclear_child(parent)
+ ct_entry *parent;
+{
+ ct_entry *ctp, *nextctp;
+
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ if (ctp->ct_type == 0)
+ continue;
+ if (ctp->ct_parent == parent) {
+ __dbclear_child(ctp);
+ /*
+ * Need to do this here because le_next may
+ * have changed with the recursive call and we
+ * don't want to point to a removed entry.
+ */
+ nextctp = LIST_NEXT(ctp, entries);
+ __dbclear_ctp(ctp);
+ }
+ }
+}
+
+/*
+ * PUBLIC: void __dbclear_ctp __P((ct_entry *));
+ */
+void
+__dbclear_ctp(ctp)
+ ct_entry *ctp;
+{
+ LIST_REMOVE(ctp, entries);
+ __os_free(NULL, ctp);
+}
+
+/*
+ * PUBLIC: void __dbdel_ctp __P((ct_entry *));
+ */
+void
+__dbdel_ctp(parent)
+ ct_entry *parent;
+{
+ __dbclear_child(parent);
+ __dbclear_ctp(parent);
+}
+
+/*
+ * PUBLIC: ct_entry *new_ct_ent __P((int *));
+ */
+ct_entry *
+new_ct_ent(errp)
+ int *errp;
+{
+ time_t t;
+ ct_entry *ctp, *octp;
+ int ret;
+
+ if ((ret = __os_malloc(NULL, sizeof(ct_entry), &ctp)) != 0) {
+ *errp = ret;
+ return (NULL);
+ }
+ memset(ctp, 0, sizeof(ct_entry));
+ /*
+ * Get the time as ID. We may service more than one request per
+ * second however. If we are, then increment id value until we
+ * find an unused one. We insert entries in LRU fashion at the
+ * head of the list. So, if the first entry doesn't match, then
+ * we know for certain that we can use our entry.
+ */
+ if ((t = time(NULL)) == -1) {
+ *errp = __os_get_errno();
+ __os_free(NULL, ctp);
+ return (NULL);
+ }
+ octp = LIST_FIRST(&__dbsrv_head);
+ if (octp != NULL && octp->ct_id >= t)
+ t = octp->ct_id + 1;
+ ctp->ct_id = t;
+ ctp->ct_idle = __dbsrv_idleto;
+ ctp->ct_activep = &ctp->ct_active;
+ ctp->ct_origp = NULL;
+ ctp->ct_refcount = 1;
+
+ LIST_INSERT_HEAD(&__dbsrv_head, ctp, entries);
+ return (ctp);
+}
+
+/*
+ * PUBLIC: ct_entry *get_tableent __P((long));
+ */
+ct_entry *
+get_tableent(id)
+ long id;
+{
+ ct_entry *ctp;
+
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries))
+ if (ctp->ct_id == id)
+ return (ctp);
+ return (NULL);
+}
+
+/*
+ * PUBLIC: ct_entry *__dbsrv_sharedb __P((ct_entry *, const char *,
+ * PUBLIC: const char *, DBTYPE, u_int32_t));
+ */
+ct_entry *
+__dbsrv_sharedb(db_ctp, name, subdb, type, flags)
+ ct_entry *db_ctp;
+ const char *name, *subdb;
+ DBTYPE type;
+ u_int32_t flags;
+{
+ ct_entry *ctp;
+
+ /*
+ * Check if we can share a db handle. Criteria for sharing are:
+ * If any of the non-sharable flags are set, we cannot share.
+ * Must be a db ctp, obviously.
+ * Must share the same env parent.
+ * Must be the same type, or current one DB_UNKNOWN.
+ * Must be same byteorder, or current one must not care.
+ * All flags must match.
+ * Must be same name, but don't share in-memory databases.
+ * Must be same subdb name.
+ */
+ if (flags & DB_SERVER_DBNOSHARE)
+ return (NULL);
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Skip ourselves.
+ */
+ if (ctp == db_ctp)
+ continue;
+ if (ctp->ct_type != CT_DB)
+ continue;
+ if (ctp->ct_envparent != db_ctp->ct_envparent)
+ continue;
+ if (type != DB_UNKNOWN && ctp->ct_dbdp.type != type)
+ continue;
+ if (ctp->ct_dbdp.dbflags != LF_ISSET(DB_SERVER_DBFLAGS))
+ continue;
+ if (db_ctp->ct_dbdp.setflags != 0 &&
+ ctp->ct_dbdp.setflags != db_ctp->ct_dbdp.setflags)
+ continue;
+ if (name == NULL || ctp->ct_dbdp.db == NULL ||
+ strcmp(name, ctp->ct_dbdp.db) != 0)
+ continue;
+ if (subdb != ctp->ct_dbdp.subdb &&
+ (subdb == NULL || ctp->ct_dbdp.subdb == NULL ||
+ strcmp(subdb, ctp->ct_dbdp.subdb) != 0))
+ continue;
+ /*
+ * If we get here, then we match.
+ */
+ ctp->ct_refcount++;
+ return (ctp);
+ }
+
+ return (NULL);
+}
+
+/*
+ * PUBLIC: ct_entry *__dbsrv_shareenv __P((ct_entry *, home_entry *, u_int32_t));
+ */
+ct_entry *
+__dbsrv_shareenv(env_ctp, home, flags)
+ ct_entry *env_ctp;
+ home_entry *home;
+ u_int32_t flags;
+{
+ ct_entry *ctp;
+
+ /*
+ * Check if we can share an env. Criteria for sharing are:
+ * Must be an env ctp, obviously.
+ * Must share the same home env.
+ * All flags must match.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Skip ourselves.
+ */
+ if (ctp == env_ctp)
+ continue;
+ if (ctp->ct_type != CT_ENV)
+ continue;
+ if (ctp->ct_envdp.home != home)
+ continue;
+ if (ctp->ct_envdp.envflags != flags)
+ continue;
+ if (ctp->ct_envdp.onflags != env_ctp->ct_envdp.onflags)
+ continue;
+ if (ctp->ct_envdp.offflags != env_ctp->ct_envdp.offflags)
+ continue;
+ /*
+ * If we get here, then we match. The only thing left to
+ * check is the timeout. Since the server timeout set by
+ * the client is a hint, for sharing we'll give them the
+ * benefit of the doubt and grant them the longer timeout.
+ */
+ if (ctp->ct_timeout < env_ctp->ct_timeout)
+ ctp->ct_timeout = env_ctp->ct_timeout;
+ ctp->ct_refcount++;
+ return (ctp);
+ }
+
+ return (NULL);
+}
+
+/*
+ * PUBLIC: void __dbsrv_active __P((ct_entry *));
+ */
+void
+__dbsrv_active(ctp)
+ ct_entry *ctp;
+{
+ time_t t;
+ ct_entry *envctp;
+
+ if (ctp == NULL)
+ return;
+ if ((t = time(NULL)) == -1)
+ return;
+ *(ctp->ct_activep) = t;
+ if ((envctp = ctp->ct_envparent) == NULL)
+ return;
+ *(envctp->ct_activep) = t;
+ return;
+}
+
+/*
+ * PUBLIC: int __db_close_int __P((long, u_int32_t));
+ */
+int
+__db_close_int(id, flags)
+ long id;
+ u_int32_t flags;
+{
+ DB *dbp;
+ int ret;
+ ct_entry *ctp;
+
+ ret = 0;
+ ctp = get_tableent(id);
+ if (ctp == NULL)
+ return (DB_NOSERVER_ID);
+ DB_ASSERT(ctp->ct_type == CT_DB);
+ if (__dbsrv_verbose && ctp->ct_refcount != 1)
+ printf("Deref'ing dbp id %ld, refcount %d\n",
+ id, ctp->ct_refcount);
+ if (--ctp->ct_refcount != 0)
+ return (ret);
+ dbp = ctp->ct_dbp;
+ if (__dbsrv_verbose)
+ printf("Closing dbp id %ld\n", id);
+
+ ret = dbp->close(dbp, flags);
+ __dbdel_ctp(ctp);
+ return (ret);
+}
+
+/*
+ * PUBLIC: int __dbc_close_int __P((ct_entry *));
+ */
+int
+__dbc_close_int(dbc_ctp)
+ ct_entry *dbc_ctp;
+{
+ DBC *dbc;
+ int ret;
+ ct_entry *ctp;
+
+ dbc = (DBC *)dbc_ctp->ct_anyp;
+
+ ret = dbc->c_close(dbc);
+ /*
+ * If this cursor is a join cursor then we need to fix up the
+ * cursors that it was joined from so that they are independent again.
+ */
+ if (dbc_ctp->ct_type & CT_JOINCUR)
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Test if it is a join cursor, and if it is part
+ * of this one.
+ */
+ if ((ctp->ct_type & CT_JOIN) &&
+ ctp->ct_activep == &dbc_ctp->ct_active) {
+ ctp->ct_type &= ~CT_JOIN;
+ ctp->ct_activep = ctp->ct_origp;
+ __dbsrv_active(ctp);
+ }
+ }
+ __dbclear_ctp(dbc_ctp);
+ return (ret);
+
+}
+
+/*
+ * PUBLIC: int __dbenv_close_int __P((long, u_int32_t, int));
+ */
+int
+__dbenv_close_int(id, flags, force)
+ long id;
+ u_int32_t flags;
+ int force;
+{
+ DB_ENV *dbenv;
+ int ret;
+ ct_entry *ctp;
+
+ ret = 0;
+ ctp = get_tableent(id);
+ if (ctp == NULL)
+ return (DB_NOSERVER_ID);
+ DB_ASSERT(ctp->ct_type == CT_ENV);
+ if (__dbsrv_verbose && ctp->ct_refcount != 1)
+ printf("Deref'ing env id %ld, refcount %d\n",
+ id, ctp->ct_refcount);
+ /*
+ * If we are timing out, we need to force the close, no matter
+ * what the refcount.
+ */
+ if (--ctp->ct_refcount != 0 && !force)
+ return (ret);
+ dbenv = ctp->ct_envp;
+ if (__dbsrv_verbose)
+ printf("Closing env id %ld\n", id);
+
+ ret = dbenv->close(dbenv, flags);
+ __dbdel_ctp(ctp);
+ return (ret);
+}
+
+static int
+add_home(home)
+ char *home;
+{
+ home_entry *hp, *homep;
+ int ret;
+
+ if ((ret = __os_malloc(NULL, sizeof(home_entry), &hp)) != 0)
+ return (ret);
+ if ((ret = __os_malloc(NULL, strlen(home)+1, &hp->home)) != 0)
+ return (ret);
+ memcpy(hp->home, home, strlen(home)+1);
+ hp->dir = home;
+ hp->passwd = NULL;
+ /*
+ * This loop is to remove any trailing path separators,
+ * to assure hp->name points to the last component.
+ */
+ hp->name = __db_rpath(home);
+ *(hp->name) = '\0';
+ hp->name++;
+ while (*(hp->name) == '\0') {
+ hp->name = __db_rpath(home);
+ *(hp->name) = '\0';
+ hp->name++;
+ }
+ /*
+ * Now we have successfully added it. Make sure there are no
+ * identical names.
+ */
+ for (homep = LIST_FIRST(&__dbsrv_home); homep != NULL;
+ homep = LIST_NEXT(homep, entries))
+ if (strcmp(homep->name, hp->name) == 0) {
+ printf("Already added home name %s, at directory %s\n",
+ hp->name, homep->dir);
+ __os_free(NULL, hp->home);
+ __os_free(NULL, hp);
+ return (-1);
+ }
+ LIST_INSERT_HEAD(&__dbsrv_home, hp, entries);
+ if (__dbsrv_verbose)
+ printf("Added home %s in dir %s\n", hp->name, hp->dir);
+ return (0);
+}
+
+static int
+add_passwd(passwd)
+ char *passwd;
+{
+ home_entry *hp;
+
+ /*
+ * We add the passwd to the last given home dir. If there
+ * isn't a home dir, or the most recent one already has a
+ * passwd, then there is a user error.
+ */
+ hp = LIST_FIRST(&__dbsrv_home);
+ if (hp == NULL || hp->passwd != NULL)
+ return (EINVAL);
+ /*
+ * We've already strdup'ed the passwd above, so we don't need
+ * to malloc new space, just point to it.
+ */
+ hp->passwd = passwd;
+ return (0);
+}
+
+/*
+ * PUBLIC: home_entry *get_home __P((char *));
+ */
+home_entry *
+get_home(name)
+ char *name;
+{
+ home_entry *hp;
+
+ for (hp = LIST_FIRST(&__dbsrv_home); hp != NULL;
+ hp = LIST_NEXT(hp, entries))
+ if (strcmp(name, hp->name) == 0)
+ return (hp);
+ return (NULL);
+}
+
+static int
+env_recover(progname)
+ char *progname;
+{
+ DB_ENV *dbenv;
+ home_entry *hp;
+ u_int32_t flags;
+ int exitval, ret;
+
+ for (hp = LIST_FIRST(&__dbsrv_home); hp != NULL;
+ hp = LIST_NEXT(hp, entries)) {
+ exitval = 0;
+ if ((ret = db_env_create(&dbenv, 0)) != 0) {
+ fprintf(stderr, "%s: db_env_create: %s\n",
+ progname, db_strerror(ret));
+ exit(EXIT_FAILURE);
+ }
+ if (__dbsrv_verbose == 1) {
+ (void)dbenv->set_verbose(dbenv, DB_VERB_RECOVERY, 1);
+ (void)dbenv->set_verbose(dbenv, DB_VERB_CHKPOINT, 1);
+ }
+ dbenv->set_errfile(dbenv, stderr);
+ dbenv->set_errpfx(dbenv, progname);
+ if (hp->passwd != NULL)
+ (void)dbenv->set_encrypt(dbenv, hp->passwd,
+ DB_ENCRYPT_AES);
+
+ /*
+ * Initialize the env with DB_RECOVER. That is all we
+ * have to do to run recovery.
+ */
+ if (__dbsrv_verbose)
+ printf("Running recovery on %s\n", hp->home);
+ flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |
+ DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER;
+ if ((ret = dbenv->open(dbenv, hp->home, flags, 0)) != 0) {
+ dbenv->err(dbenv, ret, "DB_ENV->open");
+ goto error;
+ }
+
+ if (0) {
+error: exitval = 1;
+ }
+ if ((ret = dbenv->close(dbenv, 0)) != 0) {
+ exitval = 1;
+ fprintf(stderr, "%s: dbenv->close: %s\n",
+ progname, db_strerror(ret));
+ }
+ if (exitval)
+ return (exitval);
+ }
+ return (0);
+}
diff --git a/storage/bdb/rpc_server/clsrv.html b/storage/bdb/rpc_server/clsrv.html
new file mode 100644
index 00000000000..599ad56f557
--- /dev/null
+++ b/storage/bdb/rpc_server/clsrv.html
@@ -0,0 +1,453 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.76 [en] (X11; U; FreeBSD 4.3-RELEASE i386) [Netscape]">
+</head>
+<body>
+
+<center>
+<h1>
+&nbsp;Client/Server Interface for Berkeley DB</h1></center>
+
+<center><i>Susan LoVerso</i>
+<br><i>sue@sleepycat.com</i>
+<br><i>Rev 1.3</i>
+<br><i>1999 Nov 29</i></center>
+
+<p>We provide an interface allowing client/server access to Berkeley DB.&nbsp;&nbsp;
+Our goal is to provide a client and server library to allow users to separate
+the functionality of their applications yet still have access to the full
+benefits of Berkeley DB.&nbsp; The goal is to provide a totally seamless
+interface with minimal modification to existing applications as well.
+<p>The client/server interface for Berkeley DB can be broken up into several
+layers.&nbsp; At the lowest level there is the transport mechanism to send
+out the messages over the network.&nbsp; Above that layer is the messaging
+layer to interpret what comes over the wire, and bundle/unbundle message
+contents.&nbsp; The next layer is Berkeley DB itself.
+<p>The transport layer uses ONC RPC (RFC 1831) and XDR (RFC 1832).&nbsp;
+We declare our message types and operations supported by our program and
+the RPC library and utilities pretty much take care of the rest.&nbsp;
+The
+<i>rpcgen</i> program generates all of the low level code needed.&nbsp;
+We need to define both sides of the RPC.
+<br>&nbsp;
+<h2>
+<a NAME="DB Modifications"></a>DB Modifications</h2>
+To achieve the goal of a seamless interface, it is necessary to impose
+a constraint on the application. That constraint is simply that all database
+access must be done through an open environment.&nbsp; I.e. this model
+does not support standalone databases.&nbsp; The reason for this constraint
+is so that we have an environment structure internally to store our connection
+to the server.&nbsp; Imposing this constraint means that we can provide
+the seamless interface just by adding a single environment method: <a href="../docs/api_c/env_set_rpc_server.html">DBENV->set_rpc_server()</a>.
+<p>The planned interface for this method is:
+<pre>DBENV->set_rpc_server(dbenv,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* DB_ENV structure */
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hostname&nbsp;&nbsp;&nbsp; /* Host of server */
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cl_timeout, /* Client timeout (sec) */
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srv_timeout,/* Server timeout (sec) */
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flags);&nbsp;&nbsp;&nbsp;&nbsp; /* Flags: unused */</pre>
+This new method takes the hostname of the server, establishes our connection
+and an environment on the server.&nbsp; If a server timeout is specified,
+then we send that to the server as well (and the server may or may not
+choose to use that value).&nbsp; This timeout is how long the server will
+allow the environment to remain idle before declaring it dead and releasing
+resources on the server.&nbsp; The pointer to the connection is stored
+on the client in the DBENV structure and is used by all other methods to
+figure out with whom to communicate.&nbsp; If a client timeout is specified,
+it indicates how long the client is willing to wait for a reply from the
+server.&nbsp; If the values are 0, then defaults are used.&nbsp; Flags
+is currently unused, but exists because we always need to have a placeholder
+for flags and it would be used for specifying authentication desired (were
+we to provide an authentication scheme at some point) or other uses not
+thought of yet!
+<p>This client code is part of the monolithic DB library.&nbsp; The user
+accesses the client functions via a new flag to <a href="../docs/api_c/db_env_create.html">db_env_create()</a>.&nbsp;
+That flag is DB_CLIENT.&nbsp; By using this flag the user indicates they
+want to have the client methods rather than the standard methods for the
+environment.&nbsp; Also by issuing this flag, the user needs to connect
+to the server via the <a href="../docs/api_c/env_set_rpc_server.html">DBENV->set_rpc_server()</a>
+method.
+<p>We need two new fields in the <i>DB_ENV </i>structure.&nbsp; One is
+the socket descriptor to communicate to the server, the other field is
+the client identifier the server gives to us.&nbsp; The <i>DB, </i>and<i>
+DBC </i>only need one additional field, the client identifier.&nbsp; The
+<i>DB_TXN</i>
+structure does not need modification, we are overloading the <i>txn_id
+</i>field.
+<h2>
+Issues</h2>
+We need to figure out what to do in case of client and server crashes.&nbsp;
+Both the client library and the server program are stateful.&nbsp; They
+both consume local resources during the lifetime of the connection.&nbsp;
+Should one end drop that connection, the other side needs to release those
+resources.
+<p>If the server crashes, then the client will get an error back.&nbsp;
+I have chosen to implement time-outs on the client side, using a default
+or allowing the application to specify one through the <a href="../docs/api_c/env_set_rpc_server.html">DBENV->set_rpc_server()</a>
+method.&nbsp; Either the current operation will time-out waiting for the
+reply or the next operation called will time out (or get back some other
+kind of error regarding the server's non-existence).&nbsp; In any case,
+if the client application gets back such an error, it should abort any
+open transactions locally, close any databases, and close its environment.&nbsp;
+It may then decide to retry to connect to the server periodically or whenever
+it comes back.&nbsp; If the last operation a client did was a transaction
+commit that did not return or timed out from the server, the client cannot
+determine if the transaction was committed or not but must release the
+local transaction resources. Once the server is back up, recovery must
+be run on the server.&nbsp;&nbsp; If the transaction commit completed on
+the server before the crash, then the operation is redone, if the transaction
+commit did not get to the server, the pieces of the transaction are undone
+on recover.&nbsp; The client can then re-establish its connection and begin
+again.&nbsp; This is effectively like beginning over.&nbsp; The client
+cannot use ID's from its previous connection to the server.&nbsp; However,
+if recovery is run, then consistency is assured.
+<p>If the client crashes, the server needs to somehow figure this out.&nbsp;
+The server is just sitting there waiting for a request to come in.&nbsp;
+A server must be able to time-out a client.&nbsp; Similar to ftpd, if a
+connection is idle for N seconds, then the server decides the client is
+dead and releases that client's resources, aborting any open transactions,
+closing any open databases and environments.&nbsp;&nbsp; The server timing
+out a client is not a trivial issue however.&nbsp; The generated function
+for the server just calls <i>svc_run()</i>.&nbsp; The server code I write
+contains procedures to do specific things.&nbsp; We do not have access
+to the code calling <i>select()</i>.&nbsp; Timing out the select is not
+good enough even if we could do so.&nbsp; We want to time-out idle environments,
+not simply cause a time-out if the server is idle a while.&nbsp; See the
+discussion of the <a href="#The Server Program">server program</a> for
+a description of how we accomplish this.
+<p>Since rpcgen generates the main() function of the server, I do not yet
+know how we are going to have the server multi-threaded or multi-process
+without changing the generated code.&nbsp; The RPC book indicates that
+the only way to accomplish this is through modifying the generated code
+in the server.&nbsp; <b>For the moment we will ignore this issue while
+we get the core server working, as it is only a performance issue.</b>
+<p>We do not do any security or authentication.&nbsp; Someone could get
+the code and modify it to spoof messages, trick the server, etc.&nbsp;
+RPC has some amount of authentication built into it.&nbsp; I haven't yet
+looked into it much to know if we want to use it or just point a user at
+it.&nbsp; The changes to the client code are fairly minor, the changes
+to our server procs are fairly minor.&nbsp; We would have to add code to
+a <i>sed</i> script or <i>awk</i> script to change the generated server
+code (yet again) in the dispatch routine to perform authentication.
+<p>We will need to get an official program number from Sun.&nbsp; We can
+get this by sending mail to <i>rpc@sun.com</i> and presumably at some point
+they will send us back a program number that we will encode into our XDR
+description file.&nbsp; Until we release this we can use a program number
+in the "user defined" number space.
+<br>&nbsp;
+<h2>
+<a NAME="The Server Program"></a>The Server Program</h2>
+The server is a standalone program that the user builds and runs, probably
+as a daemon like process.&nbsp; This program is linked against the Berkeley
+DB library and the RPC library (which is part of the C library on my FreeBSD
+machine, others may have/need <i>-lrpclib</i>).&nbsp; The server basically
+is a slave to the client process.&nbsp; All messages from the client are
+synchronous and two-way.&nbsp; The server handles messages one at a time,
+and sends a reply back before getting another message.&nbsp; There are
+no asynchronous messages generated by the server to the client.
+<p>We have made a choice to modify the generated code for the server.&nbsp;
+The changes will be minimal, generally calling functions we write, that
+are in other source files.&nbsp; The first change is adding a call to our
+time-out function as described below.&nbsp; The second change is changing
+the name of the generated <i>main()</i> function to <i>__dbsrv_main()</i>,
+and adding our own <i>main()</i> function so that we can parse options,
+and set up other initialization we require.&nbsp; I have a <i>sed</i> script
+that is run from the distribution scripts that massages the generated code
+to make these minor changes.
+<p>Primarily the code needed for the server is the collection of the specified
+RPC functions.&nbsp; Each function receives the structure indicated, and
+our code takes out what it needs and passes the information into DB itself.&nbsp;
+The server needs to maintain a translation table for identifiers that we
+pass back to the client for the environment, transaction and database handles.
+<p>The table that the server maintains, assuming one client per server
+process/thread, should contain the handle to the environment, database
+or transaction, a link to maintain parent/child relationships between transactions,
+or databases and cursors, this handle's identifier, a type so that we can
+error if the client passes us a bad id for this call, and a link to this
+handle's environment entry (for time out/activity purposes).&nbsp; The
+table contains, in entries used by environments, a time-out value and an
+activity time stamp.&nbsp; Its use is described below for timing out idle
+clients.
+<p>Here is how we time out clients in the server.&nbsp; We have to modify
+the generated server code, but only to add one line during the dispatch
+function to run the time-out function.&nbsp; The call is made right before
+the return of the dispatch function, after the reply is sent to the client,
+so that client's aren't kept waiting for server bookkeeping activities.&nbsp;
+This time-out function then runs every time the server processes a request.&nbsp;
+In the time-out function we maintain a time-out hint that is the youngest
+environment to time-out.&nbsp; If the current time is less than the hint
+we know we do not need to run through the list of open handles.&nbsp; If
+the hint is expired, then we go through the list of open environment handles,
+and if they are past their expiration, then we close them and clean up.&nbsp;
+If they are not, we set up the hint for the next time.
+<p>Each entry in the open handle table has a pointer back to its environment's
+entry.&nbsp; Every operation within this environment can then update the
+single environment activity record.&nbsp; Every environment can have a
+different time-out.&nbsp; The <a href="../docs/api_c/env_set_rpc_server.html">DBENV->set_rpc_server
+</a>call
+takes a server time-out value.&nbsp; If this value is 0 then a default
+(currently 5 minutes) is used.&nbsp; This time-out value is only a hint
+to the server.&nbsp; It may choose to disregard this value or set the time-out
+based on its own implementation.
+<p>For completeness, the flaws of this time-out implementation should be
+pointed out.&nbsp; First, it is possible that a client could crash with
+open handles, and no other requests come in to the server.&nbsp; Therefore
+the time-out function never gets run and those resources are not released
+(until a request does come in).&nbsp; Similarly, this time-out is not exact.&nbsp;
+The time-out function uses its hint and if it computes a hint on one run,
+an earlier time-out might be created before that time-out expires.&nbsp;
+This issue simply yields a handle that doesn't get released until that
+original hint expires.&nbsp; To illustrate, consider that at the time that
+the time-out function is run, the youngest time-out is 5 minutes in the
+future.&nbsp; Soon after, a new environment is opened that has a time-out
+of 1 minute.&nbsp; If this environment becomes idle (and other operations
+are going on), the time-out function will not release that environment
+until the original 5 minute hint expires.&nbsp; This is not a problem since
+the resources will eventually be released.
+<p>On a similar note, if a client crashes during an RPC, our reply generates
+a SIGPIPE, and our server crashes unless we catch it.&nbsp; Using <i>signal(SIGPIPE,
+SIG_IGN) </i>we can ignore it, and the server will go on.&nbsp; This is
+a call&nbsp; in our <i>main()</i> function that we write.&nbsp; Eventually
+this client's handles would be timed out as described above.&nbsp; We need
+this only for the unfortunate window of a client crashing during the RPC.
+<p>The options below are primarily for control of the program itself,.&nbsp;
+Details relating to databases and environments should be passed from the
+client to the server, since the server can serve many clients, many environments
+and many databases.&nbsp; Therefore it makes more sense for the client
+to set the cache size of its own environment, rather than setting a default
+cachesize on the server that applies as a blanket to any environment it
+may be called upon to open.&nbsp; Options are:
+<ul>
+<li>
+<b>-t&nbsp;</b> to set the default time-out given to an environment.</li>
+
+<li>
+<b>-T</b> to set the maximum time-out allowed for the server.</li>
+
+<li>
+<b>-L</b> to log the execution of the server process to a specified file.</li>
+
+<li>
+<b>-v</b> to run in verbose mode.</li>
+
+<li>
+<b>-M</b>&nbsp; to specify the maximum number of outstanding child server
+processes/threads we can have at any given time.&nbsp; The default is 10.
+<b>[We
+are not yet doing multiple threads/processes.]</b></li>
+</ul>
+
+<h2>
+The Client Code</h2>
+The client code contains all of the supported functions and methods used
+in this model.&nbsp; There are several methods in the <i>__db_env
+</i>and
+<i>__db</i>
+structures that currently do not apply, such as the callbacks.&nbsp; Those
+fields that are not applicable to the client model point to NULL to notify
+the user of their error.&nbsp; Some method functions remain unchanged,
+as well such as the error calls.
+<p>The client code contains each method function that goes along with the
+<a href="#Remote Procedure Calls">RPC
+calls</a> described elsewhere.&nbsp; The client library also contains its
+own version of <a href="../docs/api_c/env_create.html">db_env_create()</a>,
+which does not result in any messages going over to the server (since we
+do not yet know what server we are talking to).&nbsp; This function sets
+up the pointers to the correct client functions.
+<p>All of the method functions that handle the messaging have a basic flow
+similar to this:
+<ul>
+<li>
+Local arg parsing that may be needed</li>
+
+<li>
+Marshalling the message header and the arguments we need to send to the
+server</li>
+
+<li>
+Sending the message</li>
+
+<li>
+Receiving a reply</li>
+
+<li>
+Unmarshalling the reply</li>
+
+<li>
+Local results processing that may be needed</li>
+</ul>
+
+<h2>
+Generated Code</h2>
+Almost all of the code is generated from a source file describing the interface
+and an <i>awk</i> script.&nbsp;&nbsp; This awk script generates six (6)
+files for us.&nbsp; It also modifies one.&nbsp; The files are:
+<ol>
+<li>
+Client file - The C source file created containing the client code.</li>
+
+<li>
+Client template file - The C template source file created containing interfaces
+for handling client-local issues such as resource allocation, but with
+a consistent interface with the client code generated.</li>
+
+<li>
+Server file - The C source file created containing the server code.</li>
+
+<li>
+Server template file - The C template source file created containing interfaces
+for handling server-local issues such as resource allocation, calling into
+the DB library but with a consistent interface with the server code generated.</li>
+
+<li>
+XDR file - The XDR message description file created.</li>
+
+<li>
+Server sed file - A sed script that contains commands to apply to the server
+procedure file (i.e. the real source file that the server template file
+becomes) so that minor interface changes can be consistently and easily
+applied to the real code.</li>
+
+<li>
+Server procedure file - This is the file that is modified by the sed script
+generated.&nbsp; It originated from the server template file.</li>
+</ol>
+The awk script reads a source file, <i>db_server/rpc.src </i>that describes
+each operation and what sorts of arguments it takes and what it returns
+from the server.&nbsp; The syntax of the source file describes the interface
+to that operation.&nbsp; There are four (4) parts to the syntax:
+<ol>
+<li>
+<b>BEGIN</b> <b><i>function version# codetype</i></b> - begins a new functional
+interface for the given <b><i>function</i></b>.&nbsp; Each function has
+a <b><i>version number</i></b>, currently all of them are at version number
+one (1).&nbsp; The <b><i>code type</i></b> indicates to the awk script
+what kind of code to generate.&nbsp; The choices are:</li>
+
+<ul>
+<li>
+<b>CODE </b>- Generate all code, and return a status value.&nbsp; If specified,
+the client code will simply return the status to the user upon completion
+of the RPC call.</li>
+
+<li>
+<b>RETCODE </b>- Generate all code and call a return function in the client
+template file to deal with client issues or with other returned items.&nbsp;
+If specified, the client code generated will call a function of the form
+<i>__dbcl_&lt;name>_ret()
+</i>where
+&lt;name> is replaced with the function name given here.&nbsp; This function
+is placed in the template file because this indicates that something special
+must occur on return.&nbsp; The arguments to this function are the same
+as those for the client function, with the addition of the reply message
+structure.</li>
+
+<li>
+<b>NOCLNTCODE - </b>Generate XDR and server code, but no corresponding
+client code. (This is used for functions that are not named the same thing
+on both sides.&nbsp; The only use of this at the moment is db_env_create
+and db_create.&nbsp; The environment create call to the server is actually
+called from the <a href="../docs/api_c/env_set_rpc_server.html">DBENV->set_rpc_server()</a>
+method.&nbsp; The db_create code exists elsewhere in the library and we
+modify that code for the client call.)</li>
+</ul>
+
+<li>
+<b>ARG <i>RPC-type C-type varname [list-type]</i></b>- each line of this
+describes an argument to the function.&nbsp; The argument is called <b><i>varname</i></b>.&nbsp;
+The <b><i>C-type</i></b> given is what it should look like in the C code
+generated, such as <b>DB *, u_int32_t, const char *</b>.&nbsp; The
+<b><i>RPC-type</i></b>
+is an indication about how the RPC request message should be constructed.&nbsp;
+The RPC-types allowed are described below.</li>
+
+<li>
+<b>RET <i>RPC-type C-type varname [list-type]</i></b>- each line of this
+describes what the server should return from this procedure call (in addition
+to a status, which is always returned and should not be specified).&nbsp;
+The argument is called <b><i>varname</i></b>.&nbsp; The <b><i>C-type</i></b>
+given is what it should look like in the C code generated, such as <b>DB
+*, u_int32_t, const char *</b>.&nbsp; The <b><i>RPC-type</i></b> is an
+indication about how the RPC reply message should be constructed.&nbsp;
+The RPC-types are described below.</li>
+
+<li>
+<b>END </b>- End the description of this function.&nbsp; The result is
+that when the awk script encounters the <b>END</b> tag, it now has all
+the information it needs to construct the generated code for this function.</li>
+</ol>
+The <b><i>RPC-type</i></b> must be one of the following:
+<ul>
+<li>
+<b>IGNORE </b>- This argument is not passed to the server and should be
+ignored when constructing the XDR code.&nbsp; <b>Only allowed for an ARG
+specfication.</b></li>
+
+<li>
+<b>STRING</b> - This argument is a string.</li>
+
+<li>
+<b>INT </b>- This argument is an integer of some sort.</li>
+
+<li>
+<b>DBT </b>- This argument is a DBT, resulting in its decomposition into
+the request message.</li>
+
+<li>
+<b>LIST</b> - This argument is an opaque list passed to the server (NULL-terminated).&nbsp;
+If an argument of this type is given, it must have a <b><i>list-type</i></b>
+specified that is one of:</li>
+
+<ul>
+<li>
+<b>STRING</b></li>
+
+<li>
+<b>INT</b></li>
+
+<li>
+<b>ID</b>.</li>
+</ul>
+
+<li>
+<b>ID</b> - This argument is an identifier.</li>
+</ul>
+So, for example, the source for the DB->join RPC call looks like:
+<pre>BEGIN&nbsp;&nbsp; dbjoin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RETCODE
+ARG&nbsp;&nbsp;&nbsp;&nbsp; ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DB *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbp&nbsp;
+ARG&nbsp;&nbsp;&nbsp;&nbsp; LIST&nbsp;&nbsp;&nbsp; DBC **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; curs&nbsp;&nbsp;&nbsp; ID
+ARG&nbsp;&nbsp;&nbsp;&nbsp; IGNORE&nbsp; DBC **&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbcpp&nbsp;
+ARG&nbsp;&nbsp;&nbsp;&nbsp; INT&nbsp;&nbsp;&nbsp;&nbsp; u_int32_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; flags
+RET&nbsp;&nbsp;&nbsp;&nbsp; ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbcid
+END</pre>
+Our first line tells us we are writing the dbjoin function.&nbsp; It requires
+special code on the client so we indicate that with the RETCODE.&nbsp;
+This method takes four arguments.&nbsp; For the RPC request we need the
+database ID from the dbp, we construct a NULL-terminated list of IDs for
+the cursor list, we ignore the argument to return the cursor handle to
+the user, and we pass along the flags.&nbsp; On the return, the reply contains
+a status, by default, and additionally, it contains the ID of the newly
+created cursor.
+<h2>
+Building and Installing</h2>
+I need to verify with Don Anderson, but I believe we should just build
+the server program, just like we do for db_stat, db_checkpoint, etc.&nbsp;
+Basically it can be treated as a utility program from the building and
+installation perspective.
+<p>As mentioned early on, in the section on <a href="#DB Modifications">DB
+Modifications</a>, we have a single library, but allowing the user to access
+the client portion by sending a flag to <a href="../docs/api_c/env_create.html">db_env_create()</a>.&nbsp;
+The Makefile is modified to include the new files.
+<p>Testing is performed in two ways.&nbsp; First I have a new example program,
+that should become part of the example directory.&nbsp; It is basically
+a merging of ex_access.c and ex_env.c.&nbsp; This example is adequate to
+test basic functionality, as it does just does database put/get calls and
+appropriate open and close calls.&nbsp; However, in order to test the full
+set of functions a more generalized scheme is required.&nbsp; For the moment,
+I am going to modify the Tcl interface to accept the server information.&nbsp;
+Nothing else should need to change in Tcl.&nbsp; Then we can either write
+our own test modules or use a subset of the existing ones to test functionality
+on a regular basis.
+</body>
+</html>
diff --git a/storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp b/storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp
new file mode 100644
index 00000000000..25278273555
--- /dev/null
+++ b/storage/bdb/rpc_server/cxx/db_server_cxxproc.cpp
@@ -0,0 +1,2200 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ */
+
+#include "db_config.h"
+
+#ifdef HAVE_RPC
+#ifndef lint
+static const char revid[] = "$Id: db_server_cxxproc.cpp,v 1.12 2002/08/09 01:56:08 bostic Exp $";
+#endif /* not lint */
+
+#ifndef NO_SYSTEM_INCLUDES
+#include <sys/types.h>
+
+#include <rpc/rpc.h>
+
+#include <string.h>
+#endif
+#include "dbinc_auto/db_server.h"
+
+#include "db_int.h"
+#include "db_cxx.h"
+
+extern "C" {
+#include "dbinc/db_server_int.h"
+#include "dbinc_auto/rpc_server_ext.h"
+}
+
+/* BEGIN __env_cachesize_proc */
+extern "C" void
+__env_cachesize_proc(
+ long dbenvcl_id,
+ u_int32_t gbytes,
+ u_int32_t bytes,
+ u_int32_t ncache,
+ __env_cachesize_reply *replyp)
+/* END __env_cachesize_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_cachesize(gbytes, bytes, ncache);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_close_proc */
+extern "C" void
+__env_close_proc(
+ long dbenvcl_id,
+ u_int32_t flags,
+ __env_close_reply *replyp)
+/* END __env_close_proc */
+{
+ ct_entry *dbenv_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ replyp->status = __dbenv_close_int(dbenvcl_id, flags, 0);
+ return;
+}
+
+/* BEGIN __env_create_proc */
+extern "C" void
+__env_create_proc(
+ u_int32_t timeout,
+ __env_create_reply *replyp)
+/* END __env_create_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *ctp;
+
+ ctp = new_ct_ent(&replyp->status);
+ if (ctp == NULL)
+ return;
+
+ dbenv = new DbEnv(DB_CXX_NO_EXCEPTIONS);
+ ctp->ct_envp = dbenv;
+ ctp->ct_type = CT_ENV;
+ ctp->ct_parent = NULL;
+ ctp->ct_envparent = ctp;
+ __dbsrv_settimeout(ctp, timeout);
+ __dbsrv_active(ctp);
+ replyp->envcl_id = ctp->ct_id;
+
+ replyp->status = 0;
+ return;
+}
+
+/* BEGIN __env_dbremove_proc */
+extern "C" void
+__env_dbremove_proc(
+ long dbenvcl_id,
+ long txnpcl_id,
+ char *name,
+ char *subdb,
+ u_int32_t flags,
+ __env_dbremove_reply *replyp)
+/* END __env_dbremove_proc */
+{
+ int ret;
+ DbEnv *dbenv;
+ DbTxn *txnp;
+ ct_entry *dbenv_ctp, *txnp_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbenv->dbremove(txnp, name, subdb, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_dbrename_proc */
+void
+__env_dbrename_proc(
+ long dbenvcl_id,
+ long txnpcl_id,
+ char *name,
+ char *subdb,
+ char *newname,
+ u_int32_t flags,
+ __env_dbrename_reply *replyp)
+/* END __env_dbrename_proc */
+{
+ int ret;
+ DbEnv *dbenv;
+ DbTxn *txnp;
+ ct_entry *dbenv_ctp, *txnp_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbenv->dbrename(txnp, name, subdb, newname, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_encrypt_proc */
+extern "C" void
+__env_encrypt_proc(
+ long dbenvcl_id,
+ char *passwd,
+ u_int32_t flags,
+ __env_encrypt_reply *replyp)
+/* END __env_encrypt_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_encrypt(passwd, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_flags_proc */
+extern "C" void
+__env_flags_proc(
+ long dbenvcl_id,
+ u_int32_t flags,
+ u_int32_t onoff,
+ __env_flags_reply *replyp)
+/* END __env_flags_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ ret = dbenv->set_flags(flags, onoff);
+ if (onoff)
+ dbenv_ctp->ct_envdp.onflags = flags;
+ else
+ dbenv_ctp->ct_envdp.offflags = flags;
+
+ replyp->status = ret;
+ return;
+}
+/* BEGIN __env_open_proc */
+extern "C" void
+__env_open_proc(
+ long dbenvcl_id,
+ char *home,
+ u_int32_t flags,
+ u_int32_t mode,
+ __env_open_reply *replyp)
+/* END __env_open_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp, *new_ctp;
+ u_int32_t newflags, shareflags;
+ int ret;
+ home_entry *fullhome;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+ fullhome = get_home(home);
+ if (fullhome == NULL) {
+ ret = DB_NOSERVER_HOME;
+ goto out;
+ }
+
+ /*
+ * If they are using locking do deadlock detection for them,
+ * internally.
+ */
+ if ((flags & DB_INIT_LOCK) &&
+ (ret = dbenv->set_lk_detect(DB_LOCK_DEFAULT)) != 0)
+ goto out;
+
+ if (__dbsrv_verbose) {
+ dbenv->set_errfile(stderr);
+ dbenv->set_errpfx(fullhome->home);
+ }
+
+ /*
+ * Mask off flags we ignore
+ */
+ newflags = (flags & ~DB_SERVER_FLAGMASK);
+ shareflags = (newflags & DB_SERVER_ENVFLAGS);
+ /*
+ * Check now whether we can share a handle for this env.
+ */
+ replyp->envcl_id = dbenvcl_id;
+ if ((new_ctp = __dbsrv_shareenv(dbenv_ctp, fullhome, shareflags))
+ != NULL) {
+ /*
+ * We can share, clean up old ID, set new one.
+ */
+ if (__dbsrv_verbose)
+ printf("Sharing env ID %ld\n", new_ctp->ct_id);
+ replyp->envcl_id = new_ctp->ct_id;
+ ret = __dbenv_close_int(dbenvcl_id, 0, 0);
+ } else {
+ ret = dbenv->open(fullhome->home, newflags, mode);
+ dbenv_ctp->ct_envdp.home = fullhome;
+ dbenv_ctp->ct_envdp.envflags = shareflags;
+ }
+out: replyp->status = ret;
+ return;
+}
+
+/* BEGIN __env_remove_proc */
+extern "C" void
+__env_remove_proc(
+ long dbenvcl_id,
+ char *home,
+ u_int32_t flags,
+ __env_remove_reply *replyp)
+/* END __env_remove_proc */
+{
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp;
+ int ret;
+ home_entry *fullhome;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+ fullhome = get_home(home);
+ if (fullhome == NULL) {
+ replyp->status = DB_NOSERVER_HOME;
+ return;
+ }
+
+ ret = dbenv->remove(fullhome->home, flags);
+ __dbdel_ctp(dbenv_ctp);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_abort_proc */
+extern "C" void
+__txn_abort_proc(
+ long txnpcl_id,
+ __txn_abort_reply *replyp)
+/* END __txn_abort_proc */
+{
+ DbTxn *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+
+ ret = txnp->abort();
+ __dbdel_ctp(txnp_ctp);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_begin_proc */
+extern "C" void
+__txn_begin_proc(
+ long dbenvcl_id,
+ long parentcl_id,
+ u_int32_t flags,
+ __txn_begin_reply *replyp)
+/* END __txn_begin_proc */
+{
+ DbEnv *dbenv;
+ DbTxn *parent, *txnp;
+ ct_entry *ctp, *dbenv_ctp, *parent_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+ parent_ctp = NULL;
+
+ ctp = new_ct_ent(&replyp->status);
+ if (ctp == NULL)
+ return;
+
+ if (parentcl_id != 0) {
+ ACTIVATE_CTP(parent_ctp, parentcl_id, CT_TXN);
+ parent = (DbTxn *)parent_ctp->ct_anyp;
+ ctp->ct_activep = parent_ctp->ct_activep;
+ } else
+ parent = NULL;
+
+ ret = dbenv->txn_begin(parent, &txnp, flags);
+ if (ret == 0) {
+ ctp->ct_txnp = txnp;
+ ctp->ct_type = CT_TXN;
+ ctp->ct_parent = parent_ctp;
+ ctp->ct_envparent = dbenv_ctp;
+ replyp->txnidcl_id = ctp->ct_id;
+ __dbsrv_settimeout(ctp, dbenv_ctp->ct_timeout);
+ __dbsrv_active(ctp);
+ } else
+ __dbclear_ctp(ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_commit_proc */
+extern "C" void
+__txn_commit_proc(
+ long txnpcl_id,
+ u_int32_t flags,
+ __txn_commit_reply *replyp)
+/* END __txn_commit_proc */
+{
+ DbTxn *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+
+ ret = txnp->commit(flags);
+ __dbdel_ctp(txnp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_discard_proc */
+extern "C" void
+__txn_discard_proc(
+ long txnpcl_id,
+ u_int32_t flags,
+ __txn_discard_reply *replyp)
+/* END __txn_discard_proc */
+{
+ DbTxn *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+
+ ret = txnp->discard(flags);
+ __dbdel_ctp(txnp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_prepare_proc */
+extern "C" void
+__txn_prepare_proc(
+ long txnpcl_id,
+ u_int8_t *gid,
+ __txn_prepare_reply *replyp)
+/* END __txn_prepare_proc */
+{
+ DbTxn *txnp;
+ ct_entry *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+
+ ret = txnp->prepare(gid);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __txn_recover_proc */
+extern "C" void
+__txn_recover_proc(
+ long dbenvcl_id,
+ u_int32_t count,
+ u_int32_t flags,
+ __txn_recover_reply *replyp,
+ int * freep)
+/* END __txn_recover_proc */
+{
+ DbEnv *dbenv;
+ DbPreplist *dbprep, *p;
+ ct_entry *dbenv_ctp, *ctp;
+ long erri, i, retcount;
+ u_int32_t *txnidp;
+ int ret;
+ char *gid;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+ *freep = 0;
+
+ if ((ret =
+ __os_malloc(dbenv->get_DB_ENV(), count * sizeof(DbPreplist), &dbprep)) != 0)
+ goto out;
+ if ((ret =
+ dbenv->txn_recover(dbprep, count, &retcount, flags)) != 0)
+ goto out;
+ /*
+ * If there is nothing, success, but it's easy.
+ */
+ replyp->retcount = retcount; // TODO: fix C++ txn_recover
+ if (retcount == 0) {
+ replyp->txn.txn_val = NULL;
+ replyp->txn.txn_len = 0;
+ replyp->gid.gid_val = NULL;
+ replyp->gid.gid_len = 0;
+ }
+
+ /*
+ * We have our txn list. Now we need to allocate the space for
+ * the txn ID array and the GID array and set them up.
+ */
+ if ((ret = __os_calloc(dbenv->get_DB_ENV(), retcount, sizeof(u_int32_t),
+ &replyp->txn.txn_val)) != 0)
+ goto out;
+ replyp->txn.txn_len = retcount * sizeof(u_int32_t);
+ if ((ret = __os_calloc(dbenv->get_DB_ENV(), retcount, DB_XIDDATASIZE,
+ &replyp->gid.gid_val)) != 0) {
+ __os_free(dbenv->get_DB_ENV(), replyp->txn.txn_val);
+ goto out;
+ }
+ replyp->gid.gid_len = retcount * DB_XIDDATASIZE;
+
+ /*
+ * Now walk through our results, creating parallel arrays
+ * to send back. For each entry we need to create a new
+ * txn ctp and then fill in the array info.
+ */
+ i = 0;
+ p = dbprep;
+ gid = replyp->gid.gid_val;
+ txnidp = replyp->txn.txn_val;
+ while (i++ < retcount) {
+ ctp = new_ct_ent(&ret);
+ if (ret != 0) {
+ i--;
+ goto out2;
+ }
+ ctp->ct_txnp = p->txn;
+ ctp->ct_type = CT_TXN;
+ ctp->ct_parent = NULL;
+ ctp->ct_envparent = dbenv_ctp;
+ __dbsrv_settimeout(ctp, dbenv_ctp->ct_timeout);
+ __dbsrv_active(ctp);
+
+ *txnidp = ctp->ct_id;
+ memcpy(gid, p->gid, DB_XIDDATASIZE);
+
+ p++;
+ txnidp++;
+ gid += DB_XIDDATASIZE;
+ }
+ /*
+ * If we get here, we have success and we have to set freep
+ * so it'll get properly freed next time.
+ */
+ *freep = 1;
+out:
+ if (dbprep != NULL)
+ __os_free(dbenv->get_DB_ENV(), dbprep);
+ replyp->status = ret;
+ return;
+out2:
+ /*
+ * We had an error in the middle of creating our new txn
+ * ct entries. We have to unwind all that we have done. Ugh.
+ */
+ for (txnidp = replyp->txn.txn_val, erri = 0;
+ erri < i; erri++, txnidp++) {
+ ctp = get_tableent(*txnidp);
+ __dbclear_ctp(ctp);
+ }
+ __os_free(dbenv->get_DB_ENV(), replyp->txn.txn_val);
+ __os_free(dbenv->get_DB_ENV(), replyp->gid.gid_val);
+ __os_free(dbenv->get_DB_ENV(), dbprep);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_bt_maxkey_proc */
+extern "C" void
+__db_bt_maxkey_proc(
+ long dbpcl_id,
+ u_int32_t maxkey,
+ __db_bt_maxkey_reply *replyp)
+/* END __db_bt_maxkey_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_bt_maxkey(maxkey);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_associate_proc */
+extern "C" void
+__db_associate_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ long sdbpcl_id,
+ u_int32_t flags,
+ __db_associate_reply *replyp)
+/* END __db_associate_proc */
+{
+ Db *dbp, *sdbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *sdbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ ACTIVATE_CTP(sdbp_ctp, sdbpcl_id, CT_DB);
+ sdbp = (Db *)sdbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ /*
+ * We do not support DB_CREATE for associate. Users
+ * can only access secondary indices on a read-only basis,
+ * so whatever they are looking for needs to be there already.
+ */
+ if (flags != 0)
+ ret = EINVAL;
+ else
+ ret = dbp->associate(txnp, sdbp, NULL, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_bt_minkey_proc */
+extern "C" void
+__db_bt_minkey_proc(
+ long dbpcl_id,
+ u_int32_t minkey,
+ __db_bt_minkey_reply *replyp)
+/* END __db_bt_minkey_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_bt_minkey(minkey);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_close_proc */
+extern "C" void
+__db_close_proc(
+ long dbpcl_id,
+ u_int32_t flags,
+ __db_close_reply *replyp)
+/* END __db_close_proc */
+{
+ ct_entry *dbp_ctp;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ replyp->status = __db_close_int(dbpcl_id, flags);
+ return;
+}
+
+/* BEGIN __db_create_proc */
+extern "C" void
+__db_create_proc(
+ long dbenvcl_id,
+ u_int32_t flags,
+ __db_create_reply *replyp)
+/* END __db_create_proc */
+{
+ Db *dbp;
+ DbEnv *dbenv;
+ ct_entry *dbenv_ctp, *dbp_ctp;
+
+ ACTIVATE_CTP(dbenv_ctp, dbenvcl_id, CT_ENV);
+ dbenv = (DbEnv *)dbenv_ctp->ct_anyp;
+
+ dbp_ctp = new_ct_ent(&replyp->status);
+ if (dbp_ctp == NULL)
+ return ;
+ /*
+ * We actually require env's for databases. The client should
+ * have caught it, but just in case.
+ */
+ DB_ASSERT(dbenv != NULL);
+ dbp = new Db(dbenv, flags);
+ dbp_ctp->ct_dbp = dbp;
+ dbp_ctp->ct_type = CT_DB;
+ dbp_ctp->ct_parent = dbenv_ctp;
+ dbp_ctp->ct_envparent = dbenv_ctp;
+ replyp->dbcl_id = dbp_ctp->ct_id;
+ replyp->status = 0;
+ return;
+}
+
+/* BEGIN __db_del_proc */
+extern "C" void
+__db_del_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t flags,
+ __db_del_reply *replyp)
+/* END __db_del_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ /* Set up key */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ key.set_flags(keyflags);
+
+ ret = dbp->del(txnp, &key, flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_encrypt_proc */
+extern "C" void
+__db_encrypt_proc(
+ long dbpcl_id,
+ char *passwd,
+ u_int32_t flags,
+ __db_encrypt_reply *replyp)
+/* END __db_encrypt_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_encrypt(passwd, flags);
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_extentsize_proc */
+extern "C" void
+__db_extentsize_proc(
+ long dbpcl_id,
+ u_int32_t extentsize,
+ __db_extentsize_reply *replyp)
+/* END __db_extentsize_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_q_extentsize(extentsize);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_flags_proc */
+extern "C" void
+__db_flags_proc(
+ long dbpcl_id,
+ u_int32_t flags,
+ __db_flags_reply *replyp)
+/* END __db_flags_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_flags(flags);
+ dbp_ctp->ct_dbdp.setflags = flags;
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_get_proc */
+extern "C" void
+__db_get_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __db_get_reply *replyp,
+ int * freep)
+/* END __db_get_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int key_alloc, bulk_alloc, ret;
+ void *tmpdata;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+ bulk_alloc = 0;
+
+ /* Set up key and data */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.set_flags(DB_DBT_MALLOC | (keyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ /*
+ * Ignore memory related flags on server.
+ */
+ dataflags &= DB_DBT_PARTIAL;
+ if (flags & DB_MULTIPLE) {
+ if (data.get_data() == 0) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ dataulen, &tmpdata);
+ if (ret != 0)
+ goto err;
+ data.set_data(tmpdata);
+ bulk_alloc = 1;
+ }
+ dataflags |= DB_DBT_USERMEM;
+ } else
+ dataflags |= DB_DBT_MALLOC;
+ data.set_flags(dataflags);
+
+ /* Got all our stuff, now do the get */
+ ret = dbp->get(txnp, &key, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (key.get_data() == keydata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ key.get_size(), &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, key.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->keydata.keydata_val, key.get_data(), key.get_size());
+ } else
+ replyp->keydata.keydata_val = (char *)key.get_data();
+
+ replyp->keydata.keydata_len = key.get_size();
+
+ /*
+ * Data
+ */
+ if (data.get_data() == datadata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ data.get_size(), &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, key.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ if (key_alloc)
+ __os_ufree(dbp->get_DB()->dbenv,
+ replyp->keydata.keydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.get_data(),
+ data.get_size());
+ } else
+ replyp->datadata.datadata_val = (char *)data.get_data();
+ replyp->datadata.datadata_len = data.get_size();
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ if (bulk_alloc)
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_h_ffactor_proc */
+extern "C" void
+__db_h_ffactor_proc(
+ long dbpcl_id,
+ u_int32_t ffactor,
+ __db_h_ffactor_reply *replyp)
+/* END __db_h_ffactor_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_h_ffactor(ffactor);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_h_nelem_proc */
+extern "C" void
+__db_h_nelem_proc(
+ long dbpcl_id,
+ u_int32_t nelem,
+ __db_h_nelem_reply *replyp)
+/* END __db_h_nelem_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_h_nelem(nelem);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_key_range_proc */
+extern "C" void
+__db_key_range_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t flags,
+ __db_key_range_reply *replyp)
+/* END __db_key_range_proc */
+{
+ Db *dbp;
+ DB_KEY_RANGE range;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ /* Set up key */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ key.set_flags(keyflags);
+
+ ret = dbp->key_range(txnp, &key, &range, flags);
+
+ replyp->status = ret;
+ replyp->less = range.less;
+ replyp->equal = range.equal;
+ replyp->greater = range.greater;
+ return;
+}
+
+/* BEGIN __db_lorder_proc */
+extern "C" void
+__db_lorder_proc(
+ long dbpcl_id,
+ u_int32_t lorder,
+ __db_lorder_reply *replyp)
+/* END __db_lorder_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_lorder(lorder);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_open_proc */
+extern "C" void
+__db_open_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ char *name,
+ char *subdb,
+ u_int32_t type,
+ u_int32_t flags,
+ u_int32_t mode,
+ __db_open_reply *replyp)
+/* END __db_open_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ DBTYPE dbtype;
+ ct_entry *dbp_ctp, *new_ctp, *txnp_ctp;
+ int isswapped, ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ replyp->dbcl_id = dbpcl_id;
+ if ((new_ctp = __dbsrv_sharedb(dbp_ctp, name, subdb, (DBTYPE)type, flags))
+ != NULL) {
+ /*
+ * We can share, clean up old ID, set new one.
+ */
+ if (__dbsrv_verbose)
+ printf("Sharing db ID %ld\n", new_ctp->ct_id);
+ replyp->dbcl_id = new_ctp->ct_id;
+ ret = __db_close_int(dbpcl_id, 0);
+ goto out;
+ }
+ ret = dbp->open(txnp, name, subdb, (DBTYPE)type, flags, mode);
+ if (ret == 0) {
+ (void)dbp->get_type(&dbtype);
+ replyp->type = dbtype;
+ /* XXX
+ * Tcl needs to peek at dbp->flags for DB_AM_DUP. Send
+ * this dbp's flags back.
+ */
+ replyp->dbflags = (int) dbp->get_DB()->flags;
+ /*
+ * We need to determine the byte order of the database
+ * and send it back to the client. Determine it by
+ * the server's native order and the swapped value of
+ * the DB itself.
+ */
+ (void)dbp->get_byteswapped(&isswapped);
+ if (__db_byteorder(NULL, 1234) == 0) {
+ if (isswapped == 0)
+ replyp->lorder = 1234;
+ else
+ replyp->lorder = 4321;
+ } else {
+ if (isswapped == 0)
+ replyp->lorder = 4321;
+ else
+ replyp->lorder = 1234;
+ }
+ dbp_ctp->ct_dbdp.type = dbtype;
+ dbp_ctp->ct_dbdp.dbflags = LF_ISSET(DB_SERVER_DBFLAGS);
+ if (name == NULL)
+ dbp_ctp->ct_dbdp.db = NULL;
+ else if ((ret = __os_strdup(dbp->get_DB()->dbenv, name,
+ &dbp_ctp->ct_dbdp.db)) != 0)
+ goto out;
+ if (subdb == NULL)
+ dbp_ctp->ct_dbdp.subdb = NULL;
+ else if ((ret = __os_strdup(dbp->get_DB()->dbenv, subdb,
+ &dbp_ctp->ct_dbdp.subdb)) != 0)
+ goto out;
+ }
+out:
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_pagesize_proc */
+extern "C" void
+__db_pagesize_proc(
+ long dbpcl_id,
+ u_int32_t pagesize,
+ __db_pagesize_reply *replyp)
+/* END __db_pagesize_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_pagesize(pagesize);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_pget_proc */
+extern "C" void
+__db_pget_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t skeydlen,
+ u_int32_t skeydoff,
+ u_int32_t skeyulen,
+ u_int32_t skeyflags,
+ void *skeydata,
+ u_int32_t skeysize,
+ u_int32_t pkeydlen,
+ u_int32_t pkeydoff,
+ u_int32_t pkeyulen,
+ u_int32_t pkeyflags,
+ void *pkeydata,
+ u_int32_t pkeysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __db_pget_reply *replyp,
+ int * freep)
+/* END __db_pget_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int key_alloc, ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+
+ /*
+ * Ignore memory related flags on server.
+ */
+ /* Set up key and data */
+ Dbt skey(skeydata, skeysize);
+ skey.set_dlen(skeydlen);
+ skey.set_ulen(skeyulen);
+ skey.set_doff(skeydoff);
+ skey.set_flags(DB_DBT_MALLOC | (skeyflags & DB_DBT_PARTIAL));
+
+ Dbt pkey(pkeydata, pkeysize);
+ pkey.set_dlen(pkeydlen);
+ pkey.set_ulen(pkeyulen);
+ pkey.set_doff(pkeydoff);
+ pkey.set_flags(DB_DBT_MALLOC | (pkeyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ data.set_flags(DB_DBT_MALLOC | (dataflags & DB_DBT_PARTIAL));
+
+ /* Got all our stuff, now do the get */
+ ret = dbp->pget(txnp, &skey, &pkey, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (skey.get_data() == skeydata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ skey.get_size(), &replyp->skeydata.skeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, skey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, pkey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->skeydata.skeydata_val, skey.get_data(),
+ skey.get_size());
+ } else
+ replyp->skeydata.skeydata_val = (char *)skey.get_data();
+
+ replyp->skeydata.skeydata_len = skey.get_size();
+
+ /*
+ * Primary key
+ */
+ if (pkey.get_data() == pkeydata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ pkey.get_size(), &replyp->pkeydata.pkeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, skey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, pkey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ if (key_alloc)
+ __os_ufree(dbp->get_DB()->dbenv,
+ replyp->skeydata.skeydata_val);
+ goto err;
+ }
+ /*
+ * We can set it to 2, because they cannot send the
+ * pkey over without sending the skey over too.
+ * So if they did send a pkey, they must have sent
+ * the skey as well.
+ */
+ key_alloc = 2;
+ memcpy(replyp->pkeydata.pkeydata_val, pkey.get_data(),
+ pkey.get_size());
+ } else
+ replyp->pkeydata.pkeydata_val = (char *)pkey.get_data();
+ replyp->pkeydata.pkeydata_len = pkey.get_size();
+
+ /*
+ * Data
+ */
+ if (data.get_data() == datadata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ data.get_size(), &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, skey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, pkey.get_data());
+ __os_ufree(dbp->get_DB()->dbenv, data.get_data());
+ /*
+ * If key_alloc is 1, just skey needs to be
+ * freed, if key_alloc is 2, both skey and pkey
+ * need to be freed.
+ */
+ if (key_alloc--)
+ __os_ufree(dbp->get_DB()->dbenv,
+ replyp->skeydata.skeydata_val);
+ if (key_alloc)
+ __os_ufree(dbp->get_DB()->dbenv,
+ replyp->pkeydata.pkeydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.get_data(),
+ data.get_size());
+ } else
+ replyp->datadata.datadata_val = (char *)data.get_data();
+ replyp->datadata.datadata_len = data.get_size();
+ } else {
+err: replyp->skeydata.skeydata_val = NULL;
+ replyp->skeydata.skeydata_len = 0;
+ replyp->pkeydata.pkeydata_val = NULL;
+ replyp->pkeydata.pkeydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_put_proc */
+extern "C" void
+__db_put_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __db_put_reply *replyp,
+ int * freep)
+/* END __db_put_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ *freep = 0;
+
+ /* Set up key and data */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ key.set_flags(DB_DBT_MALLOC | (keyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ data.set_flags(dataflags);
+
+ /* Got all our stuff, now do the put */
+ ret = dbp->put(txnp, &key, &data, flags);
+ /*
+ * If the client did a DB_APPEND, set up key in reply.
+ * Otherwise just status.
+ */
+ if (ret == 0 && (flags == DB_APPEND)) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ if (key.get_data() == keydata) {
+ ret = __os_umalloc(dbp->get_DB()->dbenv,
+ key.get_size(), &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbp->get_DB()->dbenv, key.get_data());
+ goto err;
+ }
+ memcpy(replyp->keydata.keydata_val, key.get_data(), key.get_size());
+ } else
+ replyp->keydata.keydata_val = (char *)key.get_data();
+
+ replyp->keydata.keydata_len = key.get_size();
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_delim_proc */
+extern "C" void
+__db_re_delim_proc(
+ long dbpcl_id,
+ u_int32_t delim,
+ __db_re_delim_reply *replyp)
+/* END __db_re_delim_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_delim(delim);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_len_proc */
+extern "C" void
+__db_re_len_proc(
+ long dbpcl_id,
+ u_int32_t len,
+ __db_re_len_reply *replyp)
+/* END __db_re_len_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_len(len);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_re_pad_proc */
+extern "C" void
+__db_re_pad_proc(
+ long dbpcl_id,
+ u_int32_t pad,
+ __db_re_pad_reply *replyp)
+/* END __db_re_pad_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->set_re_pad(pad);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_remove_proc */
+extern "C" void
+__db_remove_proc(
+ long dbpcl_id,
+ char *name,
+ char *subdb,
+ u_int32_t flags,
+ __db_remove_reply *replyp)
+/* END __db_remove_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->remove(name, subdb, flags);
+ __dbdel_ctp(dbp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_rename_proc */
+extern "C" void
+__db_rename_proc(
+ long dbpcl_id,
+ char *name,
+ char *subdb,
+ char *newname,
+ u_int32_t flags,
+ __db_rename_reply *replyp)
+/* END __db_rename_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->rename(name, subdb, newname, flags);
+ __dbdel_ctp(dbp_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_stat_proc */
+extern "C" void
+__db_stat_proc(
+ long dbpcl_id,
+ u_int32_t flags,
+ __db_stat_reply *replyp,
+ int * freep)
+/* END __db_stat_proc */
+{
+ Db *dbp;
+ DBTYPE type;
+ ct_entry *dbp_ctp;
+ u_int32_t *q, *p, *retsp;
+ int i, len, ret;
+ void *sp;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->stat(&sp, flags);
+ replyp->status = ret;
+ if (ret != 0)
+ return;
+ /*
+ * We get here, we have success. Allocate an array so that
+ * we can use the list generator. Generate the reply, free
+ * up the space.
+ */
+ /*
+ * XXX This assumes that all elements of all stat structures
+ * are u_int32_t fields. They are, currently.
+ */
+ (void)dbp->get_type(&type);
+ if (type == DB_HASH)
+ len = sizeof(DB_HASH_STAT);
+ else if (type == DB_QUEUE)
+ len = sizeof(DB_QUEUE_STAT);
+ else /* BTREE or RECNO are same stats */
+ len = sizeof(DB_BTREE_STAT);
+ replyp->stats.stats_len = len / sizeof(u_int32_t);
+
+ if ((ret = __os_umalloc(dbp->get_DB()->dbenv,
+ len * replyp->stats.stats_len, &retsp)) != 0)
+ goto out;
+ for (i = 0, q = retsp, p = (u_int32_t *)sp; i < len;
+ i++, q++, p++)
+ *q = *p;
+ replyp->stats.stats_val = retsp;
+ __os_ufree(dbp->get_DB()->dbenv, sp);
+ if (ret == 0)
+ *freep = 1;
+out:
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_sync_proc */
+extern "C" void
+__db_sync_proc(
+ long dbpcl_id,
+ u_int32_t flags,
+ __db_sync_reply *replyp)
+/* END __db_sync_proc */
+{
+ Db *dbp;
+ ct_entry *dbp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ ret = dbp->sync(flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_truncate_proc */
+extern "C" void
+__db_truncate_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t flags,
+ __db_truncate_reply *replyp)
+/* END __db_truncate_proc */
+{
+ Db *dbp;
+ DbTxn *txnp;
+ ct_entry *dbp_ctp, *txnp_ctp;
+ u_int32_t count;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ } else
+ txnp = NULL;
+
+ ret = dbp->truncate(txnp, &count, flags);
+ replyp->status = ret;
+ if (ret == 0)
+ replyp->count = count;
+ return;
+}
+
+/* BEGIN __db_cursor_proc */
+extern "C" void
+__db_cursor_proc(
+ long dbpcl_id,
+ long txnpcl_id,
+ u_int32_t flags,
+ __db_cursor_reply *replyp)
+/* END __db_cursor_proc */
+{
+ Db *dbp;
+ Dbc *dbc;
+ DbTxn *txnp;
+ ct_entry *dbc_ctp, *env_ctp, *dbp_ctp, *txnp_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+ dbc_ctp = new_ct_ent(&replyp->status);
+ if (dbc_ctp == NULL)
+ return;
+
+ if (txnpcl_id != 0) {
+ ACTIVATE_CTP(txnp_ctp, txnpcl_id, CT_TXN);
+ txnp = (DbTxn *)txnp_ctp->ct_anyp;
+ dbc_ctp->ct_activep = txnp_ctp->ct_activep;
+ } else
+ txnp = NULL;
+
+ if ((ret = dbp->cursor(txnp, &dbc, flags)) == 0) {
+ dbc_ctp->ct_dbc = dbc;
+ dbc_ctp->ct_type = CT_CURSOR;
+ dbc_ctp->ct_parent = dbp_ctp;
+ env_ctp = dbp_ctp->ct_envparent;
+ dbc_ctp->ct_envparent = env_ctp;
+ __dbsrv_settimeout(dbc_ctp, env_ctp->ct_timeout);
+ __dbsrv_active(dbc_ctp);
+ replyp->dbcidcl_id = dbc_ctp->ct_id;
+ } else
+ __dbclear_ctp(dbc_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __db_join_proc */
+extern "C" void
+__db_join_proc(
+ long dbpcl_id,
+ u_int32_t *curs,
+ u_int32_t curslen,
+ u_int32_t flags,
+ __db_join_reply *replyp)
+/* END __db_join_proc */
+{
+ Db *dbp;
+ Dbc **jcurs, **c;
+ Dbc *dbc;
+ ct_entry *dbc_ctp, *ctp, *dbp_ctp;
+ size_t size;
+ u_int32_t *cl, i;
+ int ret;
+
+ ACTIVATE_CTP(dbp_ctp, dbpcl_id, CT_DB);
+ dbp = (Db *)dbp_ctp->ct_anyp;
+
+ dbc_ctp = new_ct_ent(&replyp->status);
+ if (dbc_ctp == NULL)
+ return;
+
+ size = (curslen + 1) * sizeof(Dbc *);
+ if ((ret = __os_calloc(dbp->get_DB()->dbenv,
+ curslen + 1, sizeof(Dbc *), &jcurs)) != 0) {
+ replyp->status = ret;
+ __dbclear_ctp(dbc_ctp);
+ return;
+ }
+ /*
+ * If our curslist has a parent txn, we need to use it too
+ * for the activity timeout. All cursors must be part of
+ * the same transaction, so just check the first.
+ */
+ ctp = get_tableent(*curs);
+ DB_ASSERT(ctp->ct_type == CT_CURSOR);
+ /*
+ * If we are using a transaction, set the join activity timer
+ * to point to the parent transaction.
+ */
+ if (ctp->ct_activep != &ctp->ct_active)
+ dbc_ctp->ct_activep = ctp->ct_activep;
+ for (i = 0, cl = curs, c = jcurs; i < curslen; i++, cl++, c++) {
+ ctp = get_tableent(*cl);
+ if (ctp == NULL) {
+ replyp->status = DB_NOSERVER_ID;
+ goto out;
+ }
+ /*
+ * If we are using a txn, the join cursor points to the
+ * transaction timeout. If we are not using a transaction,
+ * then all the curslist cursors must point to the join
+ * cursor's timeout so that we do not timeout any of the
+ * curlist cursors while the join cursor is active.
+ * Change the type of the curslist ctps to CT_JOIN so that
+ * we know they are part of a join list and we can distinguish
+ * them and later restore them when the join cursor is closed.
+ */
+ DB_ASSERT(ctp->ct_type == CT_CURSOR);
+ ctp->ct_type |= CT_JOIN;
+ ctp->ct_origp = ctp->ct_activep;
+ /*
+ * Setting this to the ct_active field of the dbc_ctp is
+ * really just a way to distinguish which join dbc this
+ * cursor is part of. The ct_activep of this cursor is
+ * not used at all during its lifetime as part of a join
+ * cursor.
+ */
+ ctp->ct_activep = &dbc_ctp->ct_active;
+ *c = ctp->ct_dbc;
+ }
+ *c = NULL;
+ if ((ret = dbp->join(jcurs, &dbc, flags)) == 0) {
+ dbc_ctp->ct_dbc = dbc;
+ dbc_ctp->ct_type = (CT_JOINCUR | CT_CURSOR);
+ dbc_ctp->ct_parent = dbp_ctp;
+ dbc_ctp->ct_envparent = dbp_ctp->ct_envparent;
+ __dbsrv_settimeout(dbc_ctp, dbp_ctp->ct_envparent->ct_timeout);
+ __dbsrv_active(dbc_ctp);
+ replyp->dbcidcl_id = dbc_ctp->ct_id;
+ } else {
+ __dbclear_ctp(dbc_ctp);
+ /*
+ * If we get an error, undo what we did above to any cursors.
+ */
+ for (cl = curs; *cl != 0; cl++) {
+ ctp = get_tableent(*cl);
+ ctp->ct_type = CT_CURSOR;
+ ctp->ct_activep = ctp->ct_origp;
+ }
+ }
+
+ replyp->status = ret;
+out:
+ __os_free(dbp->get_DB()->dbenv, jcurs);
+ return;
+}
+
+/* BEGIN __dbc_close_proc */
+extern "C" void
+__dbc_close_proc(
+ long dbccl_id,
+ __dbc_close_reply *replyp)
+/* END __dbc_close_proc */
+{
+ ct_entry *dbc_ctp;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ replyp->status = __dbc_close_int(dbc_ctp);
+ return;
+}
+
+/* BEGIN __dbc_count_proc */
+extern "C" void
+__dbc_count_proc(
+ long dbccl_id,
+ u_int32_t flags,
+ __dbc_count_reply *replyp)
+/* END __dbc_count_proc */
+{
+ Dbc *dbc;
+ ct_entry *dbc_ctp;
+ db_recno_t num;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+
+ ret = dbc->count(&num, flags);
+ replyp->status = ret;
+ if (ret == 0)
+ replyp->dupcount = num;
+ return;
+}
+
+/* BEGIN __dbc_del_proc */
+extern "C" void
+__dbc_del_proc(
+ long dbccl_id,
+ u_int32_t flags,
+ __dbc_del_reply *replyp)
+/* END __dbc_del_proc */
+{
+ Dbc *dbc;
+ ct_entry *dbc_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+
+ ret = dbc->del(flags);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_dup_proc */
+extern "C" void
+__dbc_dup_proc(
+ long dbccl_id,
+ u_int32_t flags,
+ __dbc_dup_reply *replyp)
+/* END __dbc_dup_proc */
+{
+ Dbc *dbc, *newdbc;
+ ct_entry *dbc_ctp, *new_ctp;
+ int ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+
+ new_ctp = new_ct_ent(&replyp->status);
+ if (new_ctp == NULL)
+ return;
+
+ if ((ret = dbc->dup(&newdbc, flags)) == 0) {
+ new_ctp->ct_dbc = newdbc;
+ new_ctp->ct_type = CT_CURSOR;
+ new_ctp->ct_parent = dbc_ctp->ct_parent;
+ new_ctp->ct_envparent = dbc_ctp->ct_envparent;
+ /*
+ * If our cursor has a parent txn, we need to use it too.
+ */
+ if (dbc_ctp->ct_activep != &dbc_ctp->ct_active)
+ new_ctp->ct_activep = dbc_ctp->ct_activep;
+ __dbsrv_settimeout(new_ctp, dbc_ctp->ct_timeout);
+ __dbsrv_active(new_ctp);
+ replyp->dbcidcl_id = new_ctp->ct_id;
+ } else
+ __dbclear_ctp(new_ctp);
+
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_get_proc */
+extern "C" void
+__dbc_get_proc(
+ long dbccl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __dbc_get_reply *replyp,
+ int * freep)
+/* END __dbc_get_proc */
+{
+ Dbc *dbc;
+ DbEnv *dbenv;
+ ct_entry *dbc_ctp;
+ int key_alloc, bulk_alloc, ret;
+ void *tmpdata;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+ dbenv = DbEnv::get_DbEnv(((DBC *)dbc)->dbp->dbenv);
+
+ *freep = 0;
+ bulk_alloc = 0;
+
+ /* Set up key and data */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ key.set_flags(DB_DBT_MALLOC | (keyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ dataflags &= DB_DBT_PARTIAL;
+ if (flags & DB_MULTIPLE || flags & DB_MULTIPLE_KEY) {
+ if (data.get_data() == NULL) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(),
+ data.get_ulen(), &tmpdata);
+ if (ret != 0)
+ goto err;
+ data.set_data(tmpdata);
+ bulk_alloc = 1;
+ }
+ dataflags |= DB_DBT_USERMEM;
+ } else
+ dataflags |= DB_DBT_MALLOC;
+ data.set_flags(dataflags);
+
+ /* Got all our stuff, now do the get */
+ ret = dbc->get(&key, &data, flags);
+
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (key.get_data() == keydata) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(), key.get_size(),
+ &replyp->keydata.keydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv->get_DB_ENV(), key.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->keydata.keydata_val, key.get_data(), key.get_size());
+ } else
+ replyp->keydata.keydata_val = (char *)key.get_data();
+
+ replyp->keydata.keydata_len = key.get_size();
+
+ /*
+ * Data
+ */
+ if (data.get_data() == datadata) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(), data.get_size(),
+ &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv->get_DB_ENV(), key.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ if (key_alloc)
+ __os_ufree(dbenv->get_DB_ENV(),
+ replyp->keydata.keydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.get_data(),
+ data.get_size());
+ } else
+ replyp->datadata.datadata_val = (char *)data.get_data();
+ replyp->datadata.datadata_len = data.get_size();
+ } else {
+err: replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ if (bulk_alloc)
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_pget_proc */
+extern "C" void
+__dbc_pget_proc(
+ long dbccl_id,
+ u_int32_t skeydlen,
+ u_int32_t skeydoff,
+ u_int32_t skeyulen,
+ u_int32_t skeyflags,
+ void *skeydata,
+ u_int32_t skeysize,
+ u_int32_t pkeydlen,
+ u_int32_t pkeydoff,
+ u_int32_t pkeyulen,
+ u_int32_t pkeyflags,
+ void *pkeydata,
+ u_int32_t pkeysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __dbc_pget_reply *replyp,
+ int * freep)
+/* END __dbc_pget_proc */
+{
+ Dbc *dbc;
+ DbEnv *dbenv;
+ ct_entry *dbc_ctp;
+ int key_alloc, ret;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+ dbenv = DbEnv::get_DbEnv(((DBC *)dbc)->dbp->dbenv);
+
+ *freep = 0;
+
+ /*
+ * Ignore memory related flags on server.
+ */
+ /* Set up key and data */
+ Dbt skey(skeydata, skeysize);
+ skey.set_dlen(skeydlen);
+ skey.set_ulen(skeyulen);
+ skey.set_doff(skeydoff);
+ skey.set_flags(DB_DBT_MALLOC | (skeyflags & DB_DBT_PARTIAL));
+
+ Dbt pkey(pkeydata, pkeysize);
+ pkey.set_dlen(pkeydlen);
+ pkey.set_ulen(pkeyulen);
+ pkey.set_doff(pkeydoff);
+ pkey.set_flags(DB_DBT_MALLOC | (pkeyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ data.set_flags(DB_DBT_MALLOC | (dataflags & DB_DBT_PARTIAL));
+
+ /* Got all our stuff, now do the get */
+ ret = dbc->pget(&skey, &pkey, &data, flags);
+ /*
+ * Otherwise just status.
+ */
+ if (ret == 0) {
+ /*
+ * XXX
+ * We need to xdr_free whatever we are returning, next time.
+ * However, DB does not allocate a new key if one was given
+ * and we'd be free'ing up space allocated in the request.
+ * So, allocate a new key/data pointer if it is the same one
+ * as in the request.
+ */
+ *freep = 1;
+ /*
+ * Key
+ */
+ key_alloc = 0;
+ if (skey.get_data() == skeydata) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(),
+ skey.get_size(), &replyp->skeydata.skeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv->get_DB_ENV(), skey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), pkey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ goto err;
+ }
+ key_alloc = 1;
+ memcpy(replyp->skeydata.skeydata_val, skey.get_data(),
+ skey.get_size());
+ } else
+ replyp->skeydata.skeydata_val = (char *)skey.get_data();
+ replyp->skeydata.skeydata_len = skey.get_size();
+
+ /*
+ * Primary key
+ */
+ if (pkey.get_data() == pkeydata) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(),
+ pkey.get_size(), &replyp->pkeydata.pkeydata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv->get_DB_ENV(), skey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), pkey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ if (key_alloc)
+ __os_ufree(dbenv->get_DB_ENV(),
+ replyp->skeydata.skeydata_val);
+ goto err;
+ }
+ /*
+ * We can set it to 2, because they cannot send the
+ * pkey over without sending the skey over too.
+ * So if they did send a pkey, they must have sent
+ * the skey as well.
+ */
+ key_alloc = 2;
+ memcpy(replyp->pkeydata.pkeydata_val, pkey.get_data(),
+ pkey.get_size());
+ } else
+ replyp->pkeydata.pkeydata_val = (char *)pkey.get_data();
+ replyp->pkeydata.pkeydata_len = pkey.get_size();
+
+ /*
+ * Data
+ */
+ if (data.get_data() == datadata) {
+ ret = __os_umalloc(dbenv->get_DB_ENV(),
+ data.get_size(), &replyp->datadata.datadata_val);
+ if (ret != 0) {
+ __os_ufree(dbenv->get_DB_ENV(), skey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), pkey.get_data());
+ __os_ufree(dbenv->get_DB_ENV(), data.get_data());
+ /*
+ * If key_alloc is 1, just skey needs to be
+ * freed, if key_alloc is 2, both skey and pkey
+ * need to be freed.
+ */
+ if (key_alloc--)
+ __os_ufree(dbenv->get_DB_ENV(),
+ replyp->skeydata.skeydata_val);
+ if (key_alloc)
+ __os_ufree(dbenv->get_DB_ENV(),
+ replyp->pkeydata.pkeydata_val);
+ goto err;
+ }
+ memcpy(replyp->datadata.datadata_val, data.get_data(),
+ data.get_size());
+ } else
+ replyp->datadata.datadata_val = (char *)data.get_data();
+ replyp->datadata.datadata_len = data.get_size();
+ } else {
+err: replyp->skeydata.skeydata_val = NULL;
+ replyp->skeydata.skeydata_len = 0;
+ replyp->pkeydata.pkeydata_val = NULL;
+ replyp->pkeydata.pkeydata_len = 0;
+ replyp->datadata.datadata_val = NULL;
+ replyp->datadata.datadata_len = 0;
+ *freep = 0;
+ }
+ replyp->status = ret;
+ return;
+}
+
+/* BEGIN __dbc_put_proc */
+extern "C" void
+__dbc_put_proc(
+ long dbccl_id,
+ u_int32_t keydlen,
+ u_int32_t keydoff,
+ u_int32_t keyulen,
+ u_int32_t keyflags,
+ void *keydata,
+ u_int32_t keysize,
+ u_int32_t datadlen,
+ u_int32_t datadoff,
+ u_int32_t dataulen,
+ u_int32_t dataflags,
+ void *datadata,
+ u_int32_t datasize,
+ u_int32_t flags,
+ __dbc_put_reply *replyp,
+ int * freep)
+/* END __dbc_put_proc */
+{
+ Db *dbp;
+ Dbc *dbc;
+ ct_entry *dbc_ctp;
+ int ret;
+ DBTYPE dbtype;
+
+ ACTIVATE_CTP(dbc_ctp, dbccl_id, CT_CURSOR);
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+ dbp = (Db *)dbc_ctp->ct_parent->ct_anyp;
+
+ /* Set up key and data */
+ Dbt key(keydata, keysize);
+ key.set_dlen(keydlen);
+ key.set_ulen(keyulen);
+ key.set_doff(keydoff);
+ /*
+ * Ignore memory related flags on server.
+ */
+ key.set_flags(DB_DBT_MALLOC | (keyflags & DB_DBT_PARTIAL));
+
+ Dbt data(datadata, datasize);
+ data.set_dlen(datadlen);
+ data.set_ulen(dataulen);
+ data.set_doff(datadoff);
+ data.set_flags(dataflags);
+
+ /* Got all our stuff, now do the put */
+ ret = dbc->put(&key, &data, flags);
+
+ *freep = 0;
+ replyp->keydata.keydata_val = NULL;
+ replyp->keydata.keydata_len = 0;
+ if (ret == 0 && (flags == DB_AFTER || flags == DB_BEFORE)) {
+ ret = dbp->get_type(&dbtype);
+ if (ret == 0 && dbtype == DB_RECNO) {
+ /*
+ * We need to xdr_free whatever we are returning, next time.
+ */
+ replyp->keydata.keydata_val = (char *)key.get_data();
+ replyp->keydata.keydata_len = key.get_size();
+ }
+ }
+ replyp->status = ret;
+ return;
+}
+#endif /* HAVE_RPC */
diff --git a/storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp b/storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp
new file mode 100644
index 00000000000..60865264c00
--- /dev/null
+++ b/storage/bdb/rpc_server/cxx/db_server_cxxutil.cpp
@@ -0,0 +1,746 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2000-2002
+ * Sleepycat Software. All rights reserved.
+ */
+
+#include "db_config.h"
+
+#ifndef lint
+static const char revid[] = "$Id: db_server_cxxutil.cpp,v 1.8 2002/05/23 07:49:34 mjc Exp $";
+#endif /* not lint */
+
+#ifndef NO_SYSTEM_INCLUDES
+#include <sys/types.h>
+
+#if TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#if HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+
+#include <rpc/rpc.h>
+
+#include <limits.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#endif
+#include "dbinc_auto/db_server.h"
+
+#include "db_int.h"
+#include "db_cxx.h"
+#include "dbinc_auto/clib_ext.h"
+
+extern "C" {
+#include "dbinc/db_server_int.h"
+#include "dbinc_auto/rpc_server_ext.h"
+#include "dbinc_auto/common_ext.h"
+
+extern int __dbsrv_main __P((void));
+}
+
+static int add_home __P((char *));
+static int add_passwd __P((char *));
+static int env_recover __P((char *));
+static void __dbclear_child __P((ct_entry *));
+
+static LIST_HEAD(cthead, ct_entry) __dbsrv_head;
+static LIST_HEAD(homehead, home_entry) __dbsrv_home;
+static long __dbsrv_defto = DB_SERVER_TIMEOUT;
+static long __dbsrv_maxto = DB_SERVER_MAXTIMEOUT;
+static long __dbsrv_idleto = DB_SERVER_IDLETIMEOUT;
+static char *logfile = NULL;
+static char *prog;
+
+static void usage __P((char *));
+static void version_check __P((void));
+
+int __dbsrv_verbose = 0;
+
+int
+main(
+ int argc,
+ char **argv)
+{
+ extern char *optarg;
+ CLIENT *cl;
+ int ch, ret;
+ char *passwd;
+
+ prog = argv[0];
+
+ version_check();
+
+ /*
+ * Check whether another server is running or not. There
+ * is a race condition where two servers could be racing to
+ * register with the portmapper. The goal of this check is to
+ * forbid running additional servers (like those started from
+ * the test suite) if the user is already running one.
+ *
+ * XXX
+ * This does not solve nor prevent two servers from being
+ * started at the same time and running recovery at the same
+ * time on the same environments.
+ */
+ if ((cl = clnt_create("localhost",
+ DB_RPC_SERVERPROG, DB_RPC_SERVERVERS, "tcp")) != NULL) {
+ fprintf(stderr,
+ "%s: Berkeley DB RPC server already running.\n", prog);
+ clnt_destroy(cl);
+ return (EXIT_FAILURE);
+ }
+
+ LIST_INIT(&__dbsrv_home);
+ while ((ch = getopt(argc, argv, "h:I:L:P:t:T:Vv")) != EOF)
+ switch (ch) {
+ case 'h':
+ (void)add_home(optarg);
+ break;
+ case 'I':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_idleto))
+ return (EXIT_FAILURE);
+ break;
+ case 'L':
+ logfile = optarg;
+ break;
+ case 'P':
+ passwd = strdup(optarg);
+ memset(optarg, 0, strlen(optarg));
+ if (passwd == NULL) {
+ fprintf(stderr, "%s: strdup: %s\n",
+ prog, strerror(errno));
+ return (EXIT_FAILURE);
+ }
+ if ((ret = add_passwd(passwd)) != 0) {
+ fprintf(stderr, "%s: strdup: %s\n",
+ prog, strerror(ret));
+ return (EXIT_FAILURE);
+ }
+ break;
+ case 't':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_defto))
+ return (EXIT_FAILURE);
+ break;
+ case 'T':
+ if (__db_getlong(NULL, prog,
+ optarg, 1, LONG_MAX, &__dbsrv_maxto))
+ return (EXIT_FAILURE);
+ break;
+ case 'V':
+ printf("%s\n", db_version(NULL, NULL, NULL));
+ return (EXIT_SUCCESS);
+ case 'v':
+ __dbsrv_verbose = 1;
+ break;
+ default:
+ usage(prog);
+ }
+ /*
+ * Check default timeout against maximum timeout
+ */
+ if (__dbsrv_defto > __dbsrv_maxto)
+ __dbsrv_defto = __dbsrv_maxto;
+
+ /*
+ * Check default timeout against idle timeout
+ * It would be bad to timeout environments sooner than txns.
+ */
+ if (__dbsrv_defto > __dbsrv_idleto)
+ fprintf(stderr,
+ "%s: WARNING: Idle timeout %ld is less than resource timeout %ld\n",
+ prog, __dbsrv_idleto, __dbsrv_defto);
+
+ LIST_INIT(&__dbsrv_head);
+
+ /*
+ * If a client crashes during an RPC, our reply to it
+ * generates a SIGPIPE. Ignore SIGPIPE so we don't exit unnecessarily.
+ */
+#ifdef SIGPIPE
+ signal(SIGPIPE, SIG_IGN);
+#endif
+
+ if (logfile != NULL && __db_util_logset("berkeley_db_svc", logfile))
+ return (EXIT_FAILURE);
+
+ /*
+ * Now that we are ready to start, run recovery on all the
+ * environments specified.
+ */
+ if (env_recover(prog) != 0)
+ return (EXIT_FAILURE);
+
+ /*
+ * We've done our setup, now call the generated server loop
+ */
+ if (__dbsrv_verbose)
+ printf("%s: Ready to receive requests\n", prog);
+ __dbsrv_main();
+
+ /* NOTREACHED */
+ abort();
+}
+
+static void
+usage(char *prog)
+{
+ fprintf(stderr, "usage: %s %s\n\t%s\n", prog,
+ "[-Vv] [-h home] [-P passwd]",
+ "[-I idletimeout] [-L logfile] [-t def_timeout] [-T maxtimeout]");
+ exit(EXIT_FAILURE);
+}
+
+static void
+version_check()
+{
+ int v_major, v_minor, v_patch;
+
+ /* Make sure we're loaded with the right version of the DB library. */
+ (void)db_version(&v_major, &v_minor, &v_patch);
+ if (v_major != DB_VERSION_MAJOR ||
+ v_minor != DB_VERSION_MINOR || v_patch != DB_VERSION_PATCH) {
+ fprintf(stderr,
+ "%s: version %d.%d.%d doesn't match library version %d.%d.%d\n",
+ prog, DB_VERSION_MAJOR, DB_VERSION_MINOR,
+ DB_VERSION_PATCH, v_major, v_minor, v_patch);
+ exit(EXIT_FAILURE);
+ }
+}
+
+extern "C" void
+__dbsrv_settimeout(
+ ct_entry *ctp,
+ u_int32_t to)
+{
+ if (to > (u_int32_t)__dbsrv_maxto)
+ ctp->ct_timeout = __dbsrv_maxto;
+ else if (to <= 0)
+ ctp->ct_timeout = __dbsrv_defto;
+ else
+ ctp->ct_timeout = to;
+}
+
+extern "C" void
+__dbsrv_timeout(int force)
+{
+ static long to_hint = -1;
+ time_t t;
+ long to;
+ ct_entry *ctp, *nextctp;
+
+ if ((t = time(NULL)) == -1)
+ return;
+
+ /*
+ * Check hint. If hint is further in the future
+ * than now, no work to do.
+ */
+ if (!force && to_hint > 0 && t < to_hint)
+ return;
+ to_hint = -1;
+ /*
+ * Timeout transactions or cursors holding DB resources.
+ * Do this before timing out envs to properly release resources.
+ *
+ * !!!
+ * We can just loop through this list looking for cursors and txns.
+ * We do not need to verify txn and cursor relationships at this
+ * point because we maintain the list in LIFO order *and* we
+ * maintain activity in the ultimate txn parent of any cursor
+ * so either everything in a txn is timing out, or nothing.
+ * So, since we are LIFO, we will correctly close/abort all the
+ * appropriate handles, in the correct order.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ switch (ctp->ct_type) {
+ case CT_TXN:
+ to = *(ctp->ct_activep) + ctp->ct_timeout;
+ /* TIMEOUT */
+ if (to < t) {
+ if (__dbsrv_verbose)
+ printf("Timing out txn id %ld\n",
+ ctp->ct_id);
+ (void)((DbTxn *)ctp->ct_anyp)->abort();
+ __dbdel_ctp(ctp);
+ /*
+ * If we timed out an txn, we may have closed
+ * all sorts of ctp's.
+ * So start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ } else if ((to_hint > 0 && to_hint > to) ||
+ to_hint == -1)
+ to_hint = to;
+ break;
+ case CT_CURSOR:
+ case (CT_JOINCUR | CT_CURSOR):
+ to = *(ctp->ct_activep) + ctp->ct_timeout;
+ /* TIMEOUT */
+ if (to < t) {
+ if (__dbsrv_verbose)
+ printf("Timing out cursor %ld\n",
+ ctp->ct_id);
+ (void)__dbc_close_int(ctp);
+ /*
+ * Start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ } else if ((to_hint > 0 && to_hint > to) ||
+ to_hint == -1)
+ to_hint = to;
+ break;
+ default:
+ break;
+ }
+ }
+ /*
+ * Timeout idle handles.
+ * If we are forcing a timeout, we'll close all env handles.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL; ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ if (ctp->ct_type != CT_ENV)
+ continue;
+ to = *(ctp->ct_activep) + ctp->ct_idle;
+ /* TIMEOUT */
+ if (to < t || force) {
+ if (__dbsrv_verbose)
+ printf("Timing out env id %ld\n", ctp->ct_id);
+ (void)__dbenv_close_int(ctp->ct_id, 0, 1);
+ /*
+ * If we timed out an env, we may have closed
+ * all sorts of ctp's (maybe even all of them.
+ * So start over with a guaranteed good ctp.
+ */
+ nextctp = LIST_FIRST(&__dbsrv_head);
+ }
+ }
+}
+
+/*
+ * RECURSIVE FUNCTION. We need to clear/free any number of levels of nested
+ * layers.
+ */
+static void
+__dbclear_child(ct_entry *parent)
+{
+ ct_entry *ctp, *nextctp;
+
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = nextctp) {
+ nextctp = LIST_NEXT(ctp, entries);
+ if (ctp->ct_type == 0)
+ continue;
+ if (ctp->ct_parent == parent) {
+ __dbclear_child(ctp);
+ /*
+ * Need to do this here because le_next may
+ * have changed with the recursive call and we
+ * don't want to point to a removed entry.
+ */
+ nextctp = LIST_NEXT(ctp, entries);
+ __dbclear_ctp(ctp);
+ }
+ }
+}
+
+extern "C" void
+__dbclear_ctp(ct_entry *ctp)
+{
+ LIST_REMOVE(ctp, entries);
+ __os_free(NULL, ctp);
+}
+
+extern "C" void
+__dbdel_ctp(ct_entry *parent)
+{
+ __dbclear_child(parent);
+ __dbclear_ctp(parent);
+}
+
+extern "C" ct_entry *
+new_ct_ent(int *errp)
+{
+ time_t t;
+ ct_entry *ctp, *octp;
+ int ret;
+
+ if ((ret = __os_malloc(NULL, sizeof(ct_entry), &ctp)) != 0) {
+ *errp = ret;
+ return (NULL);
+ }
+ memset(ctp, 0, sizeof(ct_entry));
+ /*
+ * Get the time as ID. We may service more than one request per
+ * second however. If we are, then increment id value until we
+ * find an unused one. We insert entries in LRU fashion at the
+ * head of the list. So, if the first entry doesn't match, then
+ * we know for certain that we can use our entry.
+ */
+ if ((t = time(NULL)) == -1) {
+ *errp = __os_get_errno();
+ __os_free(NULL, ctp);
+ return (NULL);
+ }
+ octp = LIST_FIRST(&__dbsrv_head);
+ if (octp != NULL && octp->ct_id >= t)
+ t = octp->ct_id + 1;
+ ctp->ct_id = t;
+ ctp->ct_idle = __dbsrv_idleto;
+ ctp->ct_activep = &ctp->ct_active;
+ ctp->ct_origp = NULL;
+ ctp->ct_refcount = 1;
+
+ LIST_INSERT_HEAD(&__dbsrv_head, ctp, entries);
+ return (ctp);
+}
+
+extern "C" ct_entry *
+get_tableent(long id)
+{
+ ct_entry *ctp;
+
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries))
+ if (ctp->ct_id == id)
+ return (ctp);
+ return (NULL);
+}
+
+extern "C" ct_entry *
+__dbsrv_sharedb(ct_entry *db_ctp, const char *name, const char *subdb, DBTYPE type, u_int32_t flags)
+{
+ ct_entry *ctp;
+
+ /*
+ * Check if we can share a db handle. Criteria for sharing are:
+ * If any of the non-sharable flags are set, we cannot share.
+ * Must be a db ctp, obviously.
+ * Must share the same env parent.
+ * Must be the same type, or current one DB_UNKNOWN.
+ * Must be same byteorder, or current one must not care.
+ * All flags must match.
+ * Must be same name, but don't share in-memory databases.
+ * Must be same subdb name.
+ */
+ if (flags & DB_SERVER_DBNOSHARE)
+ return (NULL);
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Skip ourselves.
+ */
+ if (ctp == db_ctp)
+ continue;
+ if (ctp->ct_type != CT_DB)
+ continue;
+ if (ctp->ct_envparent != db_ctp->ct_envparent)
+ continue;
+ if (type != DB_UNKNOWN && ctp->ct_dbdp.type != type)
+ continue;
+ if (ctp->ct_dbdp.dbflags != LF_ISSET(DB_SERVER_DBFLAGS))
+ continue;
+ if (db_ctp->ct_dbdp.setflags != 0 &&
+ ctp->ct_dbdp.setflags != db_ctp->ct_dbdp.setflags)
+ continue;
+ if (name == NULL || ctp->ct_dbdp.db == NULL ||
+ strcmp(name, ctp->ct_dbdp.db) != 0)
+ continue;
+ if (subdb != ctp->ct_dbdp.subdb &&
+ (subdb == NULL || ctp->ct_dbdp.subdb == NULL ||
+ strcmp(subdb, ctp->ct_dbdp.subdb) != 0))
+ continue;
+ /*
+ * If we get here, then we match.
+ */
+ ctp->ct_refcount++;
+ return (ctp);
+ }
+
+ return (NULL);
+}
+
+extern "C" ct_entry *
+__dbsrv_shareenv(ct_entry *env_ctp, home_entry *home, u_int32_t flags)
+{
+ ct_entry *ctp;
+
+ /*
+ * Check if we can share an env. Criteria for sharing are:
+ * Must be an env ctp, obviously.
+ * Must share the same home env.
+ * All flags must match.
+ */
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Skip ourselves.
+ */
+ if (ctp == env_ctp)
+ continue;
+ if (ctp->ct_type != CT_ENV)
+ continue;
+ if (ctp->ct_envdp.home != home)
+ continue;
+ if (ctp->ct_envdp.envflags != flags)
+ continue;
+ if (ctp->ct_envdp.onflags != env_ctp->ct_envdp.onflags)
+ continue;
+ if (ctp->ct_envdp.offflags != env_ctp->ct_envdp.offflags)
+ continue;
+ /*
+ * If we get here, then we match. The only thing left to
+ * check is the timeout. Since the server timeout set by
+ * the client is a hint, for sharing we'll give them the
+ * benefit of the doubt and grant them the longer timeout.
+ */
+ if (ctp->ct_timeout < env_ctp->ct_timeout)
+ ctp->ct_timeout = env_ctp->ct_timeout;
+ ctp->ct_refcount++;
+ return (ctp);
+ }
+
+ return (NULL);
+}
+
+extern "C" void
+__dbsrv_active(ct_entry *ctp)
+{
+ time_t t;
+ ct_entry *envctp;
+
+ if (ctp == NULL)
+ return;
+ if ((t = time(NULL)) == -1)
+ return;
+ *(ctp->ct_activep) = t;
+ if ((envctp = ctp->ct_envparent) == NULL)
+ return;
+ *(envctp->ct_activep) = t;
+ return;
+}
+
+extern "C" int
+__db_close_int(long id, u_int32_t flags)
+{
+ Db *dbp;
+ int ret;
+ ct_entry *ctp;
+
+ ret = 0;
+ ctp = get_tableent(id);
+ if (ctp == NULL)
+ return (DB_NOSERVER_ID);
+ DB_ASSERT(ctp->ct_type == CT_DB);
+ if (__dbsrv_verbose && ctp->ct_refcount != 1)
+ printf("Deref'ing dbp id %ld, refcount %d\n",
+ id, ctp->ct_refcount);
+ if (--ctp->ct_refcount != 0)
+ return (ret);
+ dbp = ctp->ct_dbp;
+ if (__dbsrv_verbose)
+ printf("Closing dbp id %ld\n", id);
+
+ ret = dbp->close(flags);
+ __dbdel_ctp(ctp);
+ return (ret);
+}
+
+extern "C" int
+__dbc_close_int(ct_entry *dbc_ctp)
+{
+ Dbc *dbc;
+ int ret;
+ ct_entry *ctp;
+
+ dbc = (Dbc *)dbc_ctp->ct_anyp;
+
+ ret = dbc->close();
+ /*
+ * If this cursor is a join cursor then we need to fix up the
+ * cursors that it was joined from so that they are independent again.
+ */
+ if (dbc_ctp->ct_type & CT_JOINCUR)
+ for (ctp = LIST_FIRST(&__dbsrv_head); ctp != NULL;
+ ctp = LIST_NEXT(ctp, entries)) {
+ /*
+ * Test if it is a join cursor, and if it is part
+ * of this one.
+ */
+ if ((ctp->ct_type & CT_JOIN) &&
+ ctp->ct_activep == &dbc_ctp->ct_active) {
+ ctp->ct_type &= ~CT_JOIN;
+ ctp->ct_activep = ctp->ct_origp;
+ __dbsrv_active(ctp);
+ }
+ }
+ __dbclear_ctp(dbc_ctp);
+ return (ret);
+
+}
+
+extern "C" int
+__dbenv_close_int(long id, u_int32_t flags, int force)
+{
+ DbEnv *dbenv;
+ int ret;
+ ct_entry *ctp;
+
+ ret = 0;
+ ctp = get_tableent(id);
+ if (ctp == NULL)
+ return (DB_NOSERVER_ID);
+ DB_ASSERT(ctp->ct_type == CT_ENV);
+ if (__dbsrv_verbose && ctp->ct_refcount != 1)
+ printf("Deref'ing env id %ld, refcount %d\n",
+ id, ctp->ct_refcount);
+ /*
+ * If we are timing out, we need to force the close, no matter
+ * what the refcount.
+ */
+ if (--ctp->ct_refcount != 0 && !force)
+ return (ret);
+ dbenv = ctp->ct_envp;
+ if (__dbsrv_verbose)
+ printf("Closing env id %ld\n", id);
+
+ ret = dbenv->close(flags);
+ __dbdel_ctp(ctp);
+ return (ret);
+}
+
+static int
+add_home(char *home)
+{
+ home_entry *hp, *homep;
+ int ret;
+
+ if ((ret = __os_malloc(NULL, sizeof(home_entry), &hp)) != 0)
+ return (ret);
+ if ((ret = __os_malloc(NULL, strlen(home)+1, &hp->home)) != 0)
+ return (ret);
+ memcpy(hp->home, home, strlen(home)+1);
+ hp->dir = home;
+ hp->passwd = NULL;
+ /*
+ * This loop is to remove any trailing path separators,
+ * to assure hp->name points to the last component.
+ */
+ hp->name = __db_rpath(home);
+ *(hp->name) = '\0';
+ hp->name++;
+ while (*(hp->name) == '\0') {
+ hp->name = __db_rpath(home);
+ *(hp->name) = '\0';
+ hp->name++;
+ }
+ /*
+ * Now we have successfully added it. Make sure there are no
+ * identical names.
+ */
+ for (homep = LIST_FIRST(&__dbsrv_home); homep != NULL;
+ homep = LIST_NEXT(homep, entries))
+ if (strcmp(homep->name, hp->name) == 0) {
+ printf("Already added home name %s, at directory %s\n",
+ hp->name, homep->dir);
+ return (-1);
+ }
+ LIST_INSERT_HEAD(&__dbsrv_home, hp, entries);
+ if (__dbsrv_verbose)
+ printf("Added home %s in dir %s\n", hp->name, hp->dir);
+ return (0);
+}
+
+static int
+add_passwd(char *passwd)
+{
+ home_entry *hp;
+
+ /*
+ * We add the passwd to the last given home dir. If there
+ * isn't a home dir, or the most recent one already has a
+ * passwd, then there is a user error.
+ */
+ hp = LIST_FIRST(&__dbsrv_home);
+ if (hp == NULL || hp->passwd != NULL)
+ return (EINVAL);
+ /*
+ * We've already strdup'ed the passwd above, so we don't need
+ * to malloc new space, just point to it.
+ */
+ hp->passwd = passwd;
+ return (0);
+}
+
+extern "C" home_entry *
+get_home(char *name)
+{
+ home_entry *hp;
+
+ for (hp = LIST_FIRST(&__dbsrv_home); hp != NULL;
+ hp = LIST_NEXT(hp, entries))
+ if (strcmp(name, hp->name) == 0)
+ return (hp);
+ return (NULL);
+}
+
+static int
+env_recover(char *progname)
+{
+ DbEnv *dbenv;
+ home_entry *hp;
+ u_int32_t flags;
+ int exitval, ret;
+
+ for (hp = LIST_FIRST(&__dbsrv_home); hp != NULL;
+ hp = LIST_NEXT(hp, entries)) {
+ exitval = 0;
+ dbenv = new DbEnv(DB_CXX_NO_EXCEPTIONS);
+ if (__dbsrv_verbose == 1) {
+ (void)dbenv->set_verbose(DB_VERB_RECOVERY, 1);
+ (void)dbenv->set_verbose(DB_VERB_CHKPOINT, 1);
+ }
+ dbenv->set_errfile(stderr);
+ dbenv->set_errpfx(progname);
+ if (hp->passwd != NULL)
+ (void)dbenv->set_encrypt(hp->passwd, DB_ENCRYPT_AES);
+
+ /*
+ * Initialize the env with DB_RECOVER. That is all we
+ * have to do to run recovery.
+ */
+ if (__dbsrv_verbose)
+ printf("Running recovery on %s\n", hp->home);
+ flags = DB_CREATE | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_MPOOL |
+ DB_INIT_TXN | DB_USE_ENVIRON | DB_RECOVER;
+ if ((ret = dbenv->open(hp->home, flags, 0)) != 0) {
+ dbenv->err(ret, "DbEnv->open");
+ goto error;
+ }
+
+ if (0) {
+error: exitval = 1;
+ }
+ if ((ret = dbenv->close(0)) != 0) {
+ exitval = 1;
+ fprintf(stderr, "%s: dbenv->close: %s\n",
+ progname, db_strerror(ret));
+ }
+ if (exitval)
+ return (exitval);
+ }
+ return (0);
+}
diff --git a/storage/bdb/rpc_server/java/DbDispatcher.java b/storage/bdb/rpc_server/java/DbDispatcher.java
new file mode 100644
index 00000000000..5c5e63fc2ad
--- /dev/null
+++ b/storage/bdb/rpc_server/java/DbDispatcher.java
@@ -0,0 +1,590 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: DbDispatcher.java,v 1.5 2002/08/09 01:56:08 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.IOException;
+import org.acplt.oncrpc.OncRpcException;
+
+/**
+ * Dispatcher for RPC messages for the Java RPC server.
+ * These are hooks that translate between RPC msg/reply structures and
+ * DB calls, which keeps the real implementation code in Rpc* classes cleaner.
+ */
+public abstract class DbDispatcher extends DbServerStub
+{
+ abstract int addEnv(RpcDbEnv rdbenv);
+ abstract int addDb(RpcDb rdb);
+ abstract int addTxn(RpcDbTxn rtxn);
+ abstract int addCursor(RpcDbc rdbc);
+ abstract void delEnv(RpcDbEnv rdbenv);
+ abstract void delDb(RpcDb rdb);
+ abstract void delTxn(RpcDbTxn rtxn);
+ abstract void delCursor(RpcDbc rdbc);
+ abstract RpcDbEnv getEnv(int envid);
+ abstract RpcDb getDb(int dbid);
+ abstract RpcDbTxn getTxn(int txnbid);
+ abstract RpcDbc getCursor(int dbcid);
+
+ public DbDispatcher() throws IOException, OncRpcException
+ {
+ super();
+ }
+
+ //// Db methods
+
+ public __db_associate_reply __DB_db_associate_4001(__db_associate_msg args)
+ {
+ __db_associate_reply reply = new __db_associate_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.associate(this, args, reply);
+ return reply;
+ }
+
+ public __db_bt_maxkey_reply __DB_db_bt_maxkey_4001(__db_bt_maxkey_msg args)
+ {
+ __db_bt_maxkey_reply reply = new __db_bt_maxkey_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_bt_maxkey(this, args, reply);
+ return reply;
+ }
+
+ public __db_bt_minkey_reply __DB_db_bt_minkey_4001(__db_bt_minkey_msg args)
+ {
+ __db_bt_minkey_reply reply = new __db_bt_minkey_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_bt_minkey(this, args, reply);
+ return reply;
+ }
+
+ public __db_close_reply __DB_db_close_4001(__db_close_msg args)
+ {
+ __db_close_reply reply = new __db_close_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.close(this, args, reply);
+ return reply;
+ }
+
+ public __db_create_reply __DB_db_create_4001(__db_create_msg args)
+ {
+ __db_create_reply reply = new __db_create_reply();
+ RpcDb rdb = new RpcDb(getEnv(args.dbenvcl_id));
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.create(this, args, reply);
+ return reply;
+ }
+
+ public __db_cursor_reply __DB_db_cursor_4001(__db_cursor_msg args)
+ {
+ __db_cursor_reply reply = new __db_cursor_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.cursor(this, args, reply);
+ return reply;
+ }
+
+ public __db_del_reply __DB_db_del_4001(__db_del_msg args)
+ {
+ __db_del_reply reply = new __db_del_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.del(this, args, reply);
+ return reply;
+ }
+
+ public __db_encrypt_reply __DB_db_encrypt_4001(__db_encrypt_msg args)
+ {
+ __db_encrypt_reply reply = new __db_encrypt_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_encrypt(this, args, reply);
+ return reply;
+ }
+
+ public __db_extentsize_reply __DB_db_extentsize_4001(__db_extentsize_msg args)
+ {
+ __db_extentsize_reply reply = new __db_extentsize_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_q_extentsize(this, args, reply);
+ return reply;
+ }
+
+ public __db_flags_reply __DB_db_flags_4001(__db_flags_msg args)
+ {
+ __db_flags_reply reply = new __db_flags_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_flags(this, args, reply);
+ return reply;
+ }
+
+ public __db_get_reply __DB_db_get_4001(__db_get_msg args)
+ {
+ __db_get_reply reply = new __db_get_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.get(this, args, reply);
+ return reply;
+ }
+
+ public __db_h_ffactor_reply __DB_db_h_ffactor_4001(__db_h_ffactor_msg args)
+ {
+ __db_h_ffactor_reply reply = new __db_h_ffactor_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_h_ffactor(this, args, reply);
+ return reply;
+ }
+
+ public __db_h_nelem_reply __DB_db_h_nelem_4001(__db_h_nelem_msg args)
+ {
+ __db_h_nelem_reply reply = new __db_h_nelem_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_h_nelem(this, args, reply);
+ return reply;
+ }
+
+ public __db_join_reply __DB_db_join_4001(__db_join_msg args)
+ {
+ __db_join_reply reply = new __db_join_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.join(this, args, reply);
+ return reply;
+ }
+
+ public __db_key_range_reply __DB_db_key_range_4001(__db_key_range_msg args)
+ {
+ __db_key_range_reply reply = new __db_key_range_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.key_range(this, args, reply);
+ return reply;
+ }
+
+ public __db_lorder_reply __DB_db_lorder_4001(__db_lorder_msg args)
+ {
+ __db_lorder_reply reply = new __db_lorder_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_lorder(this, args, reply);
+ return reply;
+ }
+
+ public __db_open_reply __DB_db_open_4001(__db_open_msg args)
+ {
+ __db_open_reply reply = new __db_open_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.open(this, args, reply);
+ return reply;
+ }
+
+ public __db_pagesize_reply __DB_db_pagesize_4001(__db_pagesize_msg args)
+ {
+ __db_pagesize_reply reply = new __db_pagesize_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_pagesize(this, args, reply);
+ return reply;
+ }
+
+ public __db_pget_reply __DB_db_pget_4001(__db_pget_msg args)
+ {
+ __db_pget_reply reply = new __db_pget_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.pget(this, args, reply);
+ return reply;
+ }
+
+ public __db_put_reply __DB_db_put_4001(__db_put_msg args)
+ {
+ __db_put_reply reply = new __db_put_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.put(this, args, reply);
+ return reply;
+ }
+
+ public __db_remove_reply __DB_db_remove_4001(__db_remove_msg args)
+ {
+ __db_remove_reply reply = new __db_remove_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.remove(this, args, reply);
+ return reply;
+ }
+
+ public __db_rename_reply __DB_db_rename_4001(__db_rename_msg args)
+ {
+ __db_rename_reply reply = new __db_rename_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.rename(this, args, reply);
+ return reply;
+ }
+
+ public __db_re_delim_reply __DB_db_re_delim_4001(__db_re_delim_msg args)
+ {
+ __db_re_delim_reply reply = new __db_re_delim_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_re_delim(this, args, reply);
+ return reply;
+ }
+
+ public __db_re_len_reply __DB_db_re_len_4001(__db_re_len_msg args)
+ {
+ __db_re_len_reply reply = new __db_re_len_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_re_len(this, args, reply);
+ return reply;
+ }
+
+ public __db_re_pad_reply __DB_db_re_pad_4001(__db_re_pad_msg args)
+ {
+ __db_re_pad_reply reply = new __db_re_pad_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.set_re_pad(this, args, reply);
+ return reply;
+ }
+
+ public __db_stat_reply __DB_db_stat_4001(__db_stat_msg args)
+ {
+ __db_stat_reply reply = new __db_stat_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.stat(this, args, reply);
+ return reply;
+ }
+
+ public __db_sync_reply __DB_db_sync_4001(__db_sync_msg args)
+ {
+ __db_sync_reply reply = new __db_sync_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.sync(this, args, reply);
+ return reply;
+ }
+
+ public __db_truncate_reply __DB_db_truncate_4001(__db_truncate_msg args)
+ {
+ __db_truncate_reply reply = new __db_truncate_reply();
+ RpcDb rdb = getDb(args.dbpcl_id);
+ if (rdb == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdb.truncate(this, args, reply);
+ return reply;
+ }
+
+ //// Cursor methods
+
+ public __dbc_close_reply __DB_dbc_close_4001(__dbc_close_msg args)
+ {
+ __dbc_close_reply reply = new __dbc_close_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.close(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_count_reply __DB_dbc_count_4001(__dbc_count_msg args)
+ {
+ __dbc_count_reply reply = new __dbc_count_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.count(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_del_reply __DB_dbc_del_4001(__dbc_del_msg args)
+ {
+ __dbc_del_reply reply = new __dbc_del_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.del(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_dup_reply __DB_dbc_dup_4001(__dbc_dup_msg args)
+ {
+ __dbc_dup_reply reply = new __dbc_dup_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.dup(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_get_reply __DB_dbc_get_4001(__dbc_get_msg args)
+ {
+ __dbc_get_reply reply = new __dbc_get_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.get(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_pget_reply __DB_dbc_pget_4001(__dbc_pget_msg args) {
+ __dbc_pget_reply reply = new __dbc_pget_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.pget(this, args, reply);
+ return reply;
+ }
+
+ public __dbc_put_reply __DB_dbc_put_4001(__dbc_put_msg args) {
+ __dbc_put_reply reply = new __dbc_put_reply();
+ RpcDbc rdbc = getCursor(args.dbccl_id);
+ if (rdbc == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbc.put(this, args, reply);
+ return reply;
+ }
+
+ //// Environment methods
+
+ public __env_cachesize_reply __DB_env_cachesize_4001(__env_cachesize_msg args)
+ {
+ __env_cachesize_reply reply = new __env_cachesize_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.set_cachesize(this, args, reply);
+ return reply;
+ }
+
+ public __env_close_reply __DB_env_close_4001(__env_close_msg args)
+ {
+ __env_close_reply reply = new __env_close_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.close(this, args, reply);
+ return reply;
+ }
+
+ public __env_create_reply __DB_env_create_4001(__env_create_msg args)
+ {
+ __env_create_reply reply = new __env_create_reply();
+ RpcDbEnv rdbenv = new RpcDbEnv();
+ rdbenv.create(this, args, reply);
+ return reply;
+ }
+
+ public __env_dbremove_reply __DB_env_dbremove_4001(__env_dbremove_msg args)
+ {
+ __env_dbremove_reply reply = new __env_dbremove_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.dbremove(this, args, reply);
+ return reply;
+ }
+
+ public __env_dbrename_reply __DB_env_dbrename_4001(__env_dbrename_msg args)
+ {
+ __env_dbrename_reply reply = new __env_dbrename_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.dbrename(this, args, reply);
+ return reply;
+ }
+
+ public __env_encrypt_reply __DB_env_encrypt_4001(__env_encrypt_msg args)
+ {
+ __env_encrypt_reply reply = new __env_encrypt_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.set_encrypt(this, args, reply);
+ return reply;
+ }
+
+ public __env_flags_reply __DB_env_flags_4001(__env_flags_msg args)
+ {
+ __env_flags_reply reply = new __env_flags_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.set_flags(this, args, reply);
+ return reply;
+ }
+
+ public __env_open_reply __DB_env_open_4001(__env_open_msg args)
+ {
+ __env_open_reply reply = new __env_open_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.open(this, args, reply);
+ return reply;
+ }
+
+ public __env_remove_reply __DB_env_remove_4001(__env_remove_msg args)
+ {
+ __env_remove_reply reply = new __env_remove_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.remove(this, args, reply);
+ return reply;
+ }
+
+ //// Transaction methods
+
+ public __txn_abort_reply __DB_txn_abort_4001(__txn_abort_msg args)
+ {
+ __txn_abort_reply reply = new __txn_abort_reply();
+ RpcDbTxn rdbtxn = getTxn(args.txnpcl_id);
+ if (rdbtxn == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbtxn.abort(this, args, reply);
+ return reply;
+ }
+
+ public __txn_begin_reply __DB_txn_begin_4001(__txn_begin_msg args)
+ {
+ __txn_begin_reply reply = new __txn_begin_reply();
+ RpcDbTxn rdbtxn = new RpcDbTxn(getEnv(args.dbenvcl_id), null);
+ rdbtxn.begin(this, args, reply);
+ return reply;
+ }
+
+ public __txn_commit_reply __DB_txn_commit_4001(__txn_commit_msg args)
+ {
+ __txn_commit_reply reply = new __txn_commit_reply();
+ RpcDbTxn rdbtxn = getTxn(args.txnpcl_id);
+ if (rdbtxn == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbtxn.commit(this, args, reply);
+ return reply;
+ }
+
+ public __txn_discard_reply __DB_txn_discard_4001(__txn_discard_msg args)
+ {
+ __txn_discard_reply reply = new __txn_discard_reply();
+ RpcDbTxn rdbtxn = getTxn(args.txnpcl_id);
+ if (rdbtxn == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbtxn.discard(this, args, reply);
+ return reply;
+ }
+
+ public __txn_prepare_reply __DB_txn_prepare_4001(__txn_prepare_msg args)
+ {
+ __txn_prepare_reply reply = new __txn_prepare_reply();
+ RpcDbTxn rdbtxn = getTxn(args.txnpcl_id);
+ if (rdbtxn == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbtxn.prepare(this, args, reply);
+ return reply;
+ }
+
+ public __txn_recover_reply __DB_txn_recover_4001(__txn_recover_msg args)
+ {
+ __txn_recover_reply reply = new __txn_recover_reply();
+ RpcDbEnv rdbenv = getEnv(args.dbenvcl_id);
+ if (rdbenv == null)
+ reply.status = Db.DB_NOSERVER_ID;
+ else
+ rdbenv.txn_recover(this, args, reply);
+ return reply;
+ }
+}
diff --git a/storage/bdb/rpc_server/java/DbServer.java b/storage/bdb/rpc_server/java/DbServer.java
new file mode 100644
index 00000000000..9b20becbcdc
--- /dev/null
+++ b/storage/bdb/rpc_server/java/DbServer.java
@@ -0,0 +1,301 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: DbServer.java,v 1.5 2002/08/09 01:56:09 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.*;
+import java.util.*;
+import org.acplt.oncrpc.OncRpcException;
+import org.acplt.oncrpc.server.OncRpcCallInformation;
+
+/**
+ * Main entry point for the Java version of the Berkeley DB RPC server
+ */
+public class DbServer extends DbDispatcher
+{
+ public static long idleto = 10 * 60 * 1000; // 5 minutes
+ public static long defto = 5 * 60 * 1000; // 5 minutes
+ public static long maxto = 60 * 60 * 1000; // 1 hour
+ public static String passwd = null;
+ public static PrintWriter err;
+
+ long now, hint; // updated each operation
+ FreeList env_list = new FreeList();
+ FreeList db_list = new FreeList();
+ FreeList txn_list = new FreeList();
+ FreeList cursor_list = new FreeList();
+
+ public DbServer() throws IOException, OncRpcException
+ {
+ super();
+ init_lists();
+ }
+
+ public void dispatchOncRpcCall(OncRpcCallInformation call, int program,
+ int version, int procedure) throws OncRpcException, IOException
+ {
+ long newnow = System.currentTimeMillis();
+ // DbServer.err.println("Dispatching RPC call " + procedure + " after delay of " + (newnow - now));
+ now = newnow;
+ // DbServer.err.flush();
+ super.dispatchOncRpcCall(call, program, version, procedure);
+
+ try {
+ doTimeouts();
+ } catch(Throwable t) {
+ System.err.println("Caught " + t + " during doTimeouts()");
+ t.printStackTrace(System.err);
+ }
+ }
+
+ // Internal methods to track context
+ private void init_lists()
+ {
+ // We do this so that getEnv/Db/etc(0) == null
+ env_list.add(null);
+ db_list.add(null);
+ txn_list.add(null);
+ cursor_list.add(null);
+ }
+
+ int addEnv(RpcDbEnv rdbenv)
+ {
+ rdbenv.timer.last_access = now;
+ int id = env_list.add(rdbenv);
+ return id;
+ }
+
+ int addDb(RpcDb rdb)
+ {
+ int id = db_list.add(rdb);
+ return id;
+ }
+
+ int addTxn(RpcDbTxn rtxn)
+ {
+ rtxn.timer.last_access = now;
+ int id = txn_list.add(rtxn);
+ return id;
+ }
+
+ int addCursor(RpcDbc rdbc)
+ {
+ rdbc.timer.last_access = now;
+ int id = cursor_list.add(rdbc);
+ return id;
+ }
+
+ void delEnv(RpcDbEnv rdbenv)
+ {
+ // cursors and transactions will already have been cleaned up
+ for(LocalIterator i = db_list.iterator(); i.hasNext(); ) {
+ RpcDb rdb = (RpcDb)i.next();
+ if (rdb != null && rdb.rdbenv == rdbenv)
+ delDb(rdb);
+ }
+
+ env_list.del(rdbenv);
+ rdbenv.dispose();
+ }
+
+ void delDb(RpcDb rdb)
+ {
+ db_list.del(rdb);
+ rdb.dispose();
+
+ for(LocalIterator i = cursor_list.iterator(); i.hasNext(); ) {
+ RpcDbc rdbc = (RpcDbc)i.next();
+ if (rdbc != null && rdbc.timer == rdb)
+ i.remove();
+ }
+ }
+
+ void delTxn(RpcDbTxn rtxn)
+ {
+ txn_list.del(rtxn);
+ rtxn.dispose();
+
+ for(LocalIterator i = cursor_list.iterator(); i.hasNext(); ) {
+ RpcDbc rdbc = (RpcDbc)i.next();
+ if (rdbc != null && rdbc.timer == rtxn)
+ i.remove();
+ }
+
+ for(LocalIterator i = txn_list.iterator(); i.hasNext(); ) {
+ RpcDbTxn rtxn_child = (RpcDbTxn)i.next();
+ if (rtxn_child != null && rtxn_child.timer == rtxn)
+ i.remove();
+ }
+ }
+
+ void delCursor(RpcDbc rdbc)
+ {
+ cursor_list.del(rdbc);
+ rdbc.dispose();
+ }
+
+ RpcDbEnv getEnv(int envid)
+ {
+ RpcDbEnv rdbenv = (RpcDbEnv)env_list.get(envid);
+ if (rdbenv != null)
+ rdbenv.timer.last_access = now;
+ return rdbenv;
+ }
+
+ RpcDb getDb(int dbid)
+ {
+ RpcDb rdb = (RpcDb)db_list.get(dbid);
+ if (rdb != null)
+ rdb.rdbenv.timer.last_access = now;
+ return rdb;
+ }
+
+ RpcDbTxn getTxn(int txnid)
+ {
+ RpcDbTxn rtxn = (RpcDbTxn)txn_list.get(txnid);
+ if (rtxn != null)
+ rtxn.timer.last_access = rtxn.rdbenv.timer.last_access = now;
+ return rtxn;
+ }
+
+ RpcDbc getCursor(int dbcid)
+ {
+ RpcDbc rdbc = (RpcDbc)cursor_list.get(dbcid);
+ if (rdbc != null)
+ rdbc.last_access = rdbc.timer.last_access = rdbc.rdbenv.timer.last_access = now;
+ return rdbc;
+ }
+
+ void doTimeouts()
+ {
+ if (now < hint) {
+ // DbServer.err.println("Skipping cleaner sweep - now = " + now + ", hint = " + hint);
+ return;
+ }
+
+ // DbServer.err.println("Starting a cleaner sweep");
+ hint = now + DbServer.maxto;
+
+ for(LocalIterator i = cursor_list.iterator(); i.hasNext(); ) {
+ RpcDbc rdbc = (RpcDbc)i.next();
+ if (rdbc == null)
+ continue;
+
+ long end_time = rdbc.timer.last_access + rdbc.rdbenv.timeout;
+ // DbServer.err.println("Examining " + rdbc + ", time left = " + (end_time - now));
+ if (end_time < now) {
+ DbServer.err.println("Cleaning up " + rdbc);
+ delCursor(rdbc);
+ } else if (end_time < hint)
+ hint = end_time;
+ }
+
+ for(LocalIterator i = txn_list.iterator(); i.hasNext(); ) {
+ RpcDbTxn rtxn = (RpcDbTxn)i.next();
+ if (rtxn == null)
+ continue;
+
+ long end_time = rtxn.timer.last_access + rtxn.rdbenv.timeout;
+ // DbServer.err.println("Examining " + rtxn + ", time left = " + (end_time - now));
+ if (end_time < now) {
+ DbServer.err.println("Cleaning up " + rtxn);
+ delTxn(rtxn);
+ } else if (end_time < hint)
+ hint = end_time;
+ }
+
+ for(LocalIterator i = env_list.iterator(); i.hasNext(); ) {
+ RpcDbEnv rdbenv = (RpcDbEnv)i.next();
+ if (rdbenv == null)
+ continue;
+
+ long end_time = rdbenv.timer.last_access + rdbenv.idletime;
+ // DbServer.err.println("Examining " + rdbenv + ", time left = " + (end_time - now));
+ if (end_time < now) {
+ DbServer.err.println("Cleaning up " + rdbenv);
+ delEnv(rdbenv);
+ }
+ }
+
+ // if we didn't find anything, reset the hint
+ if (hint == now + DbServer.maxto)
+ hint = 0;
+
+ // DbServer.err.println("Finishing a cleaner sweep");
+ }
+
+ // Some constants that aren't available elsewhere
+ static final int DB_SERVER_FLAGMASK = Db.DB_LOCKDOWN |
+ Db.DB_PRIVATE | Db.DB_RECOVER | Db.DB_RECOVER_FATAL |
+ Db.DB_SYSTEM_MEM | Db.DB_USE_ENVIRON |
+ Db.DB_USE_ENVIRON_ROOT;
+ static final int DB_SERVER_ENVFLAGS = Db.DB_INIT_CDB |
+ Db.DB_INIT_LOCK | Db.DB_INIT_LOG | Db.DB_INIT_MPOOL |
+ Db.DB_INIT_TXN | Db.DB_JOINENV;
+ static final int DB_SERVER_DBFLAGS = Db.DB_DIRTY_READ |
+ Db.DB_NOMMAP | Db.DB_RDONLY;
+ static final int DB_SERVER_DBNOSHARE = Db.DB_EXCL | Db.DB_TRUNCATE;
+
+ public static void main(String[] args)
+ {
+ System.out.println("Starting DbServer...");
+ for (int i = 0; i < args.length; i++) {
+ if (args[i].charAt(0) != '-')
+ usage();
+
+ switch (args[i].charAt(1)) {
+ case 'h':
+ ++i; // add_home(args[++i]);
+ break;
+ case 'I':
+ idleto = Long.parseLong(args[++i]) * 1000L;
+ break;
+ case 'P':
+ passwd = args[++i];
+ break;
+ case 't':
+ defto = Long.parseLong(args[++i]) * 1000L;
+ break;
+ case 'T':
+ maxto = Long.parseLong(args[++i]) * 1000L;
+ break;
+ case 'V':
+ // version;
+ break;
+ case 'v':
+ // verbose
+ break;
+ default:
+ usage();
+ }
+ }
+
+ try {
+ DbServer.err = new PrintWriter(new FileOutputStream("JavaRPCServer.trace", true));
+ DbServer server = new DbServer();
+ server.run();
+ } catch (Throwable e) {
+ System.out.println("DbServer exception:");
+ e.printStackTrace(DbServer.err);
+ } finally {
+ if (DbServer.err != null)
+ DbServer.err.close();
+ }
+
+ System.out.println("DbServer stopped.");
+ }
+
+ static void usage()
+ {
+ System.err.println("usage: java com.sleepycat.db.rpcserver.DbServer \\");
+ System.err.println("[-Vv] [-h home] [-P passwd] [-I idletimeout] [-L logfile] [-t def_timeout] [-T maxtimeout]");
+ System.exit(1);
+ }
+}
diff --git a/storage/bdb/rpc_server/java/FreeList.java b/storage/bdb/rpc_server/java/FreeList.java
new file mode 100644
index 00000000000..e831c466137
--- /dev/null
+++ b/storage/bdb/rpc_server/java/FreeList.java
@@ -0,0 +1,102 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: FreeList.java,v 1.3 2002/08/09 01:56:09 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import java.util.*;
+
+/**
+ * Keep track of a list of objects by id with a free list.
+ * Intentionally package-protected exposure.
+ */
+class FreeList
+{
+ class FreeIndex {
+ int index;
+ FreeIndex(int index) { this.index = index; }
+ int getIndex() { return index; }
+ }
+
+ Vector items = new Vector();
+ FreeIndex free_head = null;
+
+ public synchronized int add(Object obj) {
+ int pos;
+ if (free_head == null) {
+ pos = items.size();
+ items.addElement(obj);
+ if (pos % 1000 == 0)
+ DbServer.err.println(this + " grew to size " + pos);
+ } else {
+ pos = free_head.getIndex();
+ free_head = (FreeIndex)items.elementAt(pos);
+ items.setElementAt(obj, pos);
+ }
+ return pos;
+ }
+
+ public synchronized void del(int pos) {
+ Object obj = items.elementAt(pos);
+ if (obj != null && obj instanceof FreeIndex)
+ throw new NoSuchElementException("index " + pos + " has already been freed");
+ items.setElementAt(free_head, pos);
+ free_head = new FreeIndex(pos);
+ }
+
+ public void del(Object obj) {
+ del(items.indexOf(obj));
+ }
+
+ public Object get(int pos) {
+ Object obj = items.elementAt(pos);
+ if (obj instanceof FreeIndex)
+ obj = null;
+ return obj;
+ }
+
+ public LocalIterator iterator() {
+ return new FreeListIterator();
+ }
+
+ /**
+ * Iterator for a FreeList. Note that this class doesn't implement
+ * java.util.Iterator to maintain compatibility with Java 1.1
+ * Intentionally package-protected exposure.
+ */
+ class FreeListIterator implements LocalIterator {
+ int current;
+
+ FreeListIterator() { current = findNext(-1); }
+
+ private int findNext(int start) {
+ int next = start;
+ while (++next < items.size()) {
+ Object obj = items.elementAt(next);
+ if (obj == null || !(obj instanceof FreeIndex))
+ break;
+ }
+ return next;
+ }
+
+ public boolean hasNext() {
+ return (findNext(current) < items.size());
+ }
+
+ public Object next() {
+ current = findNext(current);
+ if (current == items.size())
+ throw new NoSuchElementException("enumerated past end of FreeList");
+ return items.elementAt(current);
+ }
+
+ public void remove() {
+ del(current);
+ }
+ }
+}
diff --git a/storage/bdb/rpc_server/java/LocalIterator.java b/storage/bdb/rpc_server/java/LocalIterator.java
new file mode 100644
index 00000000000..eecb0b5e78d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/LocalIterator.java
@@ -0,0 +1,23 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: LocalIterator.java,v 1.2 2002/08/09 01:56:09 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import java.util.*;
+
+/**
+ * Iterator interface. Note that this matches java.util.Iterator
+ * but maintains compatibility with Java 1.1
+ * Intentionally package-protected exposure.
+ */
+interface LocalIterator {
+ boolean hasNext();
+ Object next();
+ void remove();
+}
diff --git a/storage/bdb/rpc_server/java/README b/storage/bdb/rpc_server/java/README
new file mode 100644
index 00000000000..c2d8f3abd57
--- /dev/null
+++ b/storage/bdb/rpc_server/java/README
@@ -0,0 +1,24 @@
+Berkeley DB Java RPC server, copyright (C) 2002 Sleepycat Software
+
+The Java implementation of the Berkeley DB RPC server is intended
+primarily for testing purposes. It provides the same interface
+as the C and C++ RPC servers, but is implemented via the Java API
+rather than the C or C++ APIs. This allows the existing Tcl test
+suite to exercise the Java API without modification.
+
+The Java RPC server relies on a Java version of rpcgen to
+automatically generate appropriate Java classes from the RPC
+interface specification (../db_server.x). We use jrpcgen, which
+is part of the Remote Tea for Java project:
+ acplt.plt.rwth-aachen.de/ks/english/remotetea.html
+
+To rebuild the Java stubs from db_server.x, you will need to
+download the full Remote Tea package, but if you just want to
+compile the Java sources and run the Java RPC server, the runtime
+component of Remote Tea is included in oncrpc.jar. Building
+the Java RPC server is automatic when Berkeley DB is configured
+with the both --enable-rpc and --enable-java.
+
+All of the Remote Tea project is licensed under the Library GNU
+Public License, and we have made no modifications to their
+released code.
diff --git a/storage/bdb/rpc_server/java/RpcDb.java b/storage/bdb/rpc_server/java/RpcDb.java
new file mode 100644
index 00000000000..59da9be67dc
--- /dev/null
+++ b/storage/bdb/rpc_server/java/RpcDb.java
@@ -0,0 +1,694 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: RpcDb.java,v 1.8 2002/08/09 01:56:09 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.IOException;
+import java.io.*;
+import java.util.*;
+
+/**
+ * RPC wrapper around a db object for the Java RPC server.
+ */
+public class RpcDb extends Timer
+{
+ static final byte[] empty = new byte[0];
+ Db db;
+ RpcDbEnv rdbenv;
+ int refcount = 1;
+ String dbname, subdbname;
+ int type, setflags, openflags;
+
+ public RpcDb(RpcDbEnv rdbenv)
+ {
+ this.rdbenv = rdbenv;
+ }
+
+ void dispose()
+ {
+ if (db != null) {
+ try {
+ db.close(0);
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ }
+ db = null;
+ }
+ }
+
+ public void associate(DbDispatcher server,
+ __db_associate_msg args, __db_associate_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ /*
+ * We do not support DB_CREATE for associate. Users
+ * can only access secondary indices on a read-only basis,
+ * so whatever they are looking for needs to be there already.
+ */
+ db.associate(txn, server.getDb(args.sdbpcl_id).db, null, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void close(DbDispatcher server,
+ __db_close_msg args, __db_close_reply reply)
+ {
+ if (--refcount != 0) {
+ reply.status = 0;
+ return;
+ }
+
+ try {
+ db.close(args.flags);
+ db = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delDb(this);
+ }
+ }
+
+ public void create(DbDispatcher server,
+ __db_create_msg args, __db_create_reply reply)
+ {
+ try {
+ db = new Db(server.getEnv(args.dbenvcl_id).dbenv, args.flags);
+ reply.dbcl_id = server.addDb(this);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void cursor(DbDispatcher server,
+ __db_cursor_msg args, __db_cursor_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ Dbc dbc = db.cursor(txn, args.flags);
+ RpcDbc rdbc = new RpcDbc(this, dbc, false);
+ rdbc.timer = (rtxn != null) ? rtxn.timer : this;
+ reply.dbcidcl_id = server.addCursor(rdbc);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void del(DbDispatcher server,
+ __db_del_msg args, __db_del_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_doff(args.keydoff);
+ key.set_ulen(args.keyulen);
+ key.set_flags(args.keyflags);
+
+ db.del(txn, key, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void get(DbDispatcher server,
+ __db_get_msg args, __db_get_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_doff(args.keydoff);
+ key.set_ulen(args.keyulen);
+ key.set_flags(Db.DB_DBT_MALLOC |
+ (args.keyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_doff(args.datadoff);
+ data.set_ulen(args.dataulen);
+ if ((args.flags & Db.DB_MULTIPLE) != 0) {
+ if (data.get_data().length == 0)
+ data.set_data(new byte[data.get_ulen()]);
+ data.set_flags(Db.DB_DBT_USERMEM |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+ } else
+ data.set_flags(Db.DB_DBT_MALLOC |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+
+ reply.status = db.get(txn, key, data, args.flags);
+
+ if (key.get_data() == args.keydata ||
+ key.get_data().length != key.get_size()) {
+ reply.keydata = new byte[key.get_size()];
+ System.arraycopy(key.get_data(), 0, reply.keydata, 0, key.get_size());
+ } else
+ reply.keydata = key.get_data();
+
+ if (data.get_data() == args.datadata ||
+ data.get_data().length != data.get_size()) {
+ reply.datadata = new byte[data.get_size()];
+ System.arraycopy(data.get_data(), 0, reply.datadata, 0, data.get_size());
+ } else
+ reply.datadata = data.get_data();
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ reply.keydata = reply.datadata = empty;
+ }
+ }
+
+ public void join(DbDispatcher server,
+ __db_join_msg args, __db_join_reply reply)
+ {
+ try {
+ Dbc[] cursors = new Dbc[args.curs.length + 1];
+ for(int i = 0; i < args.curs.length; i++) {
+ RpcDbc rdbc = server.getCursor(args.curs[i]);
+ if (rdbc == null) {
+ reply.status = Db.DB_NOSERVER_ID;
+ return;
+ }
+ cursors[i] = rdbc.dbc;
+ }
+ cursors[args.curs.length] = null;
+
+ Dbc jdbc = db.join(cursors, args.flags);
+
+ RpcDbc rjdbc = new RpcDbc(this, jdbc, true);
+ /*
+ * If our curslist has a parent txn, we need to use it too
+ * for the activity timeout. All cursors must be part of
+ * the same transaction, so just check the first.
+ */
+ RpcDbc rdbc0 = server.getCursor(args.curs[0]);
+ if (rdbc0.timer != rdbc0)
+ rjdbc.timer = rdbc0.timer;
+
+ /*
+ * All of the curslist cursors must point to the join
+ * cursor's timeout so that we do not timeout any of the
+ * curlist cursors while the join cursor is active.
+ */
+ for(int i = 0; i < args.curs.length; i++) {
+ RpcDbc rdbc = server.getCursor(args.curs[i]);
+ rdbc.orig_timer = rdbc.timer;
+ rdbc.timer = rjdbc;
+ }
+ reply.dbcidcl_id = server.addCursor(rjdbc);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void key_range(DbDispatcher server,
+ __db_key_range_msg args, __db_key_range_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_doff(args.keydoff);
+ key.set_ulen(args.keyulen);
+ key.set_flags(args.keyflags);
+
+ DbKeyRange range = new DbKeyRange();
+
+ db.key_range(txn, key, range, args.flags);
+ reply.status = 0;
+ reply.less = range.less;
+ reply.equal = range.equal;
+ reply.greater = range.greater;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ private boolean findSharedDb(DbDispatcher server, __db_open_reply reply)
+ throws DbException
+ {
+ RpcDb rdb = null;
+ boolean matchFound = false;
+ LocalIterator i = ((DbServer)server).db_list.iterator();
+
+ while (!matchFound && i.hasNext()) {
+ rdb = (RpcDb)i.next();
+ if (rdb != null && rdb != this && rdb.rdbenv == rdbenv &&
+ (type == Db.DB_UNKNOWN || rdb.type == type) &&
+ openflags == rdb.openflags &&
+ setflags == rdb.setflags &&
+ dbname != null && rdb.dbname != null &&
+ dbname.equals(rdb.dbname) &&
+ (subdbname == rdb.subdbname ||
+ (subdbname != null && rdb.subdbname != null &&
+ subdbname.equals(rdb.subdbname))))
+ matchFound = true;
+ }
+
+ if (matchFound) {
+ ++rdb.refcount;
+ reply.dbcl_id = ((FreeList.FreeListIterator)i).current;
+ reply.type = rdb.db.get_type();
+ reply.dbflags = rdb.db.get_flags_raw();
+ // FIXME: not possible to work out byteorder from Java?
+ reply.lorder = rdb.db.get_byteswapped() ? 4321 : 1234;
+ reply.status = 0;
+
+ DbServer.err.println("Sharing Db: " + reply.dbcl_id);
+ }
+
+ return matchFound;
+ }
+
+ public void open(DbDispatcher server,
+ __db_open_msg args, __db_open_reply reply)
+ {
+ try {
+ dbname = (args.name.length() > 0) ? args.name : null;
+ subdbname = (args.subdb.length() > 0) ? args.subdb : null;
+ type = args.type;
+ openflags = args.flags & DbServer.DB_SERVER_DBFLAGS;
+
+ if (findSharedDb(server, reply)) {
+ db.close(0);
+ db = null;
+ server.delDb(this);
+ } else {
+ DbServer.err.println("Calling db.open(" + null + ", " + dbname + ", " + subdbname + ", " + args.type + ", " + Integer.toHexString(args.flags) + ", " + args.mode + ")");
+ db.open(null, dbname, subdbname, args.type, args.flags, args.mode);
+
+ reply.dbcl_id = args.dbpcl_id;
+ reply.type = this.type = db.get_type();
+ reply.dbflags = db.get_flags_raw();
+ // FIXME: not possible to work out byteorder from Java?
+ reply.lorder = db.get_byteswapped() ? 4321 : 1234;
+ reply.status = 0;
+ }
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } catch(FileNotFoundException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = Db.DB_NOTFOUND;
+ }
+
+ // System.err.println("Db.open: reply.status = " + reply.status + ", reply.dbcl_id = " + reply.dbcl_id);
+ }
+
+ public void pget(DbDispatcher server,
+ __db_pget_msg args, __db_pget_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ Dbt skey = new Dbt(args.skeydata);
+ skey.set_dlen(args.skeydlen);
+ skey.set_doff(args.skeydoff);
+ skey.set_ulen(args.skeyulen);
+ skey.set_flags(Db.DB_DBT_MALLOC |
+ (args.skeyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt pkey = new Dbt(args.pkeydata);
+ pkey.set_dlen(args.pkeydlen);
+ pkey.set_doff(args.pkeydoff);
+ pkey.set_ulen(args.pkeyulen);
+ pkey.set_flags(Db.DB_DBT_MALLOC |
+ (args.pkeyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_doff(args.datadoff);
+ data.set_ulen(args.dataulen);
+ data.set_flags(Db.DB_DBT_MALLOC |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+
+ db.pget(txn, skey, pkey, data, args.flags);
+
+ if (skey.get_data() == args.skeydata ||
+ skey.get_data().length != skey.get_size()) {
+ reply.skeydata = new byte[skey.get_size()];
+ System.arraycopy(skey.get_data(), 0, reply.skeydata, 0, skey.get_size());
+ } else
+ reply.skeydata = skey.get_data();
+
+ if (pkey.get_data() == args.pkeydata ||
+ pkey.get_data().length != pkey.get_size()) {
+ reply.pkeydata = new byte[pkey.get_size()];
+ System.arraycopy(pkey.get_data(), 0, reply.pkeydata, 0, pkey.get_size());
+ } else
+ reply.pkeydata = pkey.get_data();
+
+ if (data.get_data() == args.datadata ||
+ data.get_data().length != data.get_size()) {
+ reply.datadata = new byte[data.get_size()];
+ System.arraycopy(data.get_data(), 0, reply.datadata, 0, data.get_size());
+ } else
+ reply.datadata = data.get_data();
+
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ reply.skeydata = reply.pkeydata = reply.datadata = empty;
+ }
+ }
+
+ public void put(DbDispatcher server,
+ __db_put_msg args, __db_put_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_doff(args.keydoff);
+ key.set_ulen(args.keyulen);
+ key.set_flags(Db.DB_DBT_MALLOC |
+ (args.keyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_doff(args.datadoff);
+ data.set_ulen(args.dataulen);
+ data.set_flags(args.dataflags);
+
+ reply.status = db.put(txn, key, data, args.flags);
+
+ /*
+ * If the client did a DB_APPEND, set up key in reply.
+ * Otherwise just status.
+ */
+ if ((args.flags & Db.DB_APPEND) != 0) {
+ if (key.get_data() == args.keydata ||
+ key.get_data().length != key.get_size()) {
+ reply.keydata = new byte[key.get_size()];
+ System.arraycopy(key.get_data(), 0, reply.keydata, 0, key.get_size());
+ } else
+ reply.keydata = key.get_data();
+ } else
+ reply.keydata = empty;
+ } catch(DbException e) {
+ reply.keydata = empty;
+ reply.status = e.get_errno();
+ DbServer.err.println("Exception, setting status to " + reply.status);
+ e.printStackTrace(DbServer.err);
+ }
+ }
+
+ public void remove(DbDispatcher server,
+ __db_remove_msg args, __db_remove_reply reply)
+ {
+ try {
+ args.name = (args.name.length() > 0) ? args.name : null;
+ args.subdb = (args.subdb.length() > 0) ? args.subdb : null;
+ db.remove(args.name, args.subdb, args.flags);
+ db = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } catch(FileNotFoundException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = Db.DB_NOTFOUND;
+ } finally {
+ server.delDb(this);
+ }
+ }
+
+ public void rename(DbDispatcher server,
+ __db_rename_msg args, __db_rename_reply reply)
+ {
+ try {
+ args.name = (args.name.length() > 0) ? args.name : null;
+ args.subdb = (args.subdb.length() > 0) ? args.subdb : null;
+ args.newname = (args.newname.length() > 0) ? args.newname : null;
+ db.rename(args.name, args.subdb, args.newname, args.flags);
+ db = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } catch(FileNotFoundException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = Db.DB_NOTFOUND;
+ } finally {
+ server.delDb(this);
+ }
+ }
+
+ public void set_bt_maxkey(DbDispatcher server,
+ __db_bt_maxkey_msg args, __db_bt_maxkey_reply reply)
+ {
+ try {
+ db.set_bt_maxkey(args.maxkey);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_bt_minkey(DbDispatcher server,
+ __db_bt_minkey_msg args, __db_bt_minkey_reply reply)
+ {
+ try {
+ db.set_bt_minkey(args.minkey);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_encrypt(DbDispatcher server,
+ __db_encrypt_msg args, __db_encrypt_reply reply)
+ {
+ try {
+ db.set_encrypt(args.passwd, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_flags(DbDispatcher server,
+ __db_flags_msg args, __db_flags_reply reply)
+ {
+ try {
+ // DbServer.err.println("Calling db.setflags(" + Integer.toHexString(args.flags) + ")");
+ db.set_flags(args.flags);
+ setflags |= args.flags;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_h_ffactor(DbDispatcher server,
+ __db_h_ffactor_msg args, __db_h_ffactor_reply reply)
+ {
+ try {
+ db.set_h_ffactor(args.ffactor);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_h_nelem(DbDispatcher server,
+ __db_h_nelem_msg args, __db_h_nelem_reply reply)
+ {
+ try {
+ db.set_h_nelem(args.nelem);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_lorder(DbDispatcher server,
+ __db_lorder_msg args, __db_lorder_reply reply)
+ {
+ try {
+ db.set_lorder(args.lorder);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_pagesize(DbDispatcher server,
+ __db_pagesize_msg args, __db_pagesize_reply reply)
+ {
+ try {
+ db.set_pagesize(args.pagesize);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_q_extentsize(DbDispatcher server,
+ __db_extentsize_msg args, __db_extentsize_reply reply)
+ {
+ try {
+ db.set_q_extentsize(args.extentsize);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_re_delim(DbDispatcher server,
+ __db_re_delim_msg args, __db_re_delim_reply reply)
+ {
+ try {
+ db.set_re_delim(args.delim);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_re_len(DbDispatcher server,
+ __db_re_len_msg args, __db_re_len_reply reply)
+ {
+ try {
+ db.set_re_len(args.len);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_re_pad(DbDispatcher server,
+ __db_re_pad_msg args, __db_re_pad_reply reply)
+ {
+ try {
+ db.set_re_pad(args.pad);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void stat(DbDispatcher server,
+ __db_stat_msg args, __db_stat_reply reply)
+ {
+ try {
+ Object raw_stat = db.stat(args.flags);
+
+ if (raw_stat instanceof DbHashStat) {
+ DbHashStat hs = (DbHashStat)raw_stat;
+ int[] raw_stats = {
+ hs.hash_magic, hs.hash_version,
+ hs.hash_metaflags, hs.hash_nkeys,
+ hs.hash_ndata, hs.hash_pagesize,
+ hs.hash_ffactor, hs.hash_buckets,
+ hs.hash_free, hs.hash_bfree,
+ hs.hash_bigpages, hs.hash_big_bfree,
+ hs.hash_overflows, hs.hash_ovfl_free,
+ hs.hash_dup, hs.hash_dup_free
+ };
+ reply.stats = raw_stats;
+ } else if (raw_stat instanceof DbQueueStat) {
+ DbQueueStat qs = (DbQueueStat)raw_stat;
+ int[] raw_stats = {
+ qs.qs_magic, qs.qs_version,
+ qs.qs_metaflags, qs.qs_nkeys,
+ qs.qs_ndata, qs.qs_pagesize,
+ qs.qs_extentsize, qs.qs_pages,
+ qs.qs_re_len, qs.qs_re_pad,
+ qs.qs_pgfree, qs.qs_first_recno,
+ qs.qs_cur_recno
+ };
+ reply.stats = raw_stats;
+ } else if (raw_stat instanceof DbBtreeStat) {
+ DbBtreeStat bs = (DbBtreeStat)raw_stat;
+ int[] raw_stats = {
+ bs.bt_magic, bs.bt_version,
+ bs.bt_metaflags, bs.bt_nkeys,
+ bs.bt_ndata, bs.bt_pagesize,
+ bs.bt_maxkey, bs.bt_minkey,
+ bs.bt_re_len, bs.bt_re_pad,
+ bs.bt_levels, bs.bt_int_pg,
+ bs.bt_leaf_pg, bs.bt_dup_pg,
+ bs.bt_over_pg, bs.bt_free,
+ bs.bt_int_pgfree, bs.bt_leaf_pgfree,
+ bs.bt_dup_pgfree, bs.bt_over_pgfree
+ };
+ reply.stats = raw_stats;
+ } else
+ throw new DbException("Invalid return type from db.stat()", Db.DB_NOTFOUND);
+
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ reply.stats = new int[0];
+ }
+ }
+
+ public void sync(DbDispatcher server,
+ __db_sync_msg args, __db_sync_reply reply)
+ {
+ try {
+ db.sync(args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void truncate(DbDispatcher server,
+ __db_truncate_msg args, __db_truncate_reply reply)
+ {
+ try {
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ reply.count = db.truncate(txn, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+}
diff --git a/storage/bdb/rpc_server/java/RpcDbEnv.java b/storage/bdb/rpc_server/java/RpcDbEnv.java
new file mode 100644
index 00000000000..9d9f1ba4324
--- /dev/null
+++ b/storage/bdb/rpc_server/java/RpcDbEnv.java
@@ -0,0 +1,269 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: RpcDbEnv.java,v 1.6 2002/08/23 08:45:59 mjc Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.IOException;
+import java.io.*;
+import java.util.*;
+
+/**
+ * RPC wrapper around a dbenv for the Java RPC server.
+ */
+public class RpcDbEnv extends Timer
+{
+ DbEnv dbenv;
+ String home;
+ long idletime, timeout;
+ int openflags, onflags, offflags;
+ int refcount = 1;
+
+ void dispose()
+ {
+ if (dbenv != null) {
+ try {
+ dbenv.close(0);
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ }
+ dbenv = null;
+ }
+ }
+
+ public void close(DbDispatcher server,
+ __env_close_msg args, __env_close_reply reply)
+ {
+ if (--refcount != 0) {
+ reply.status = 0;
+ return;
+ }
+
+ try {
+ dbenv.close(args.flags);
+ dbenv = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delEnv(this);
+ }
+ }
+
+ public void create(DbDispatcher server,
+ __env_create_msg args, __env_create_reply reply)
+ {
+ this.idletime = (args.timeout != 0) ? args.timeout : DbServer.idleto;
+ this.timeout = DbServer.defto;
+ try {
+ dbenv = new DbEnv(0);
+ reply.envcl_id = server.addEnv(this);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void dbremove(DbDispatcher server,
+ __env_dbremove_msg args, __env_dbremove_reply reply)
+ {
+ try {
+ args.name = (args.name.length() > 0) ? args.name : null;
+ args.subdb = (args.subdb.length() > 0) ? args.subdb : null;
+
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ dbenv.dbremove(txn, args.name, args.subdb, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void dbrename(DbDispatcher server,
+ __env_dbrename_msg args, __env_dbrename_reply reply)
+ {
+ try {
+ args.name = (args.name.length() > 0) ? args.name : null;
+ args.subdb = (args.subdb.length() > 0) ? args.subdb : null;
+ args.newname = (args.newname.length() > 0) ? args.newname : null;
+
+ RpcDbTxn rtxn = server.getTxn(args.txnpcl_id);
+ DbTxn txn = (rtxn != null) ? rtxn.txn : null;
+ dbenv.dbrename(txn, args.name, args.subdb, args.newname, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ private boolean findSharedDbEnv(DbDispatcher server, __env_open_reply reply)
+ throws DbException
+ {
+ RpcDbEnv rdbenv = null;
+ boolean matchFound = false;
+ LocalIterator i = ((DbServer)server).env_list.iterator();
+
+ while (!matchFound && i.hasNext()) {
+ rdbenv = (RpcDbEnv)i.next();
+ if (rdbenv != null && rdbenv != this &&
+ (home == rdbenv.home ||
+ (home != null && home.equals(rdbenv.home))) &&
+ openflags == rdbenv.openflags &&
+ onflags == rdbenv.onflags &&
+ offflags == rdbenv.offflags)
+ matchFound = true;
+ }
+
+ if (matchFound) {
+ /*
+ * The only thing left to check is the timeout.
+ * Since the server timeout set by the client is a hint, for sharing
+ * we'll give them the benefit of the doubt and grant them the
+ * longer timeout.
+ */
+ if (rdbenv.timeout < timeout)
+ rdbenv.timeout = timeout;
+
+ ++rdbenv.refcount;
+ reply.envcl_id = ((FreeList.FreeListIterator)i).current;
+ reply.status = 0;
+
+ DbServer.err.println("Sharing DbEnv: " + reply.envcl_id);
+ }
+
+ return matchFound;
+ }
+
+ public void open(DbDispatcher server,
+ __env_open_msg args, __env_open_reply reply)
+ {
+ try {
+ home = (args.home.length() > 0) ? args.home : null;
+
+ /*
+ * If they are using locking do deadlock detection for them,
+ * internally.
+ */
+ if ((args.flags & Db.DB_INIT_LOCK) != 0)
+ dbenv.set_lk_detect(Db.DB_LOCK_DEFAULT);
+
+ // adjust flags for RPC
+ int newflags = (args.flags & ~DbServer.DB_SERVER_FLAGMASK);
+ openflags = (newflags & DbServer.DB_SERVER_ENVFLAGS);
+
+ if (findSharedDbEnv(server, reply)) {
+ dbenv.close(0);
+ dbenv = null;
+ server.delEnv(this);
+ } else {
+ // TODO: check home?
+ dbenv.open(home, newflags, args.mode);
+ reply.status = 0;
+ reply.envcl_id = args.dbenvcl_id;
+ }
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } catch(FileNotFoundException e) {
+ reply.status = Db.DB_NOTFOUND;
+ }
+
+ // System.err.println("DbEnv.open: reply.status = " + reply.status + ", reply.envcl_id = " + reply.envcl_id);
+ }
+
+ public void remove(DbDispatcher server,
+ __env_remove_msg args, __env_remove_reply reply)
+ {
+ try {
+ args.home = (args.home.length() > 0) ? args.home : null;
+ // TODO: check home?
+
+ dbenv.remove(args.home, args.flags);
+ dbenv = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } catch(FileNotFoundException e) {
+ reply.status = Db.DB_NOTFOUND;
+ } finally {
+ server.delEnv(this);
+ }
+ }
+
+ public void set_cachesize(DbDispatcher server,
+ __env_cachesize_msg args, __env_cachesize_reply reply)
+ {
+ try {
+ dbenv.set_cachesize(args.gbytes, args.bytes, args.ncache);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_encrypt(DbDispatcher server,
+ __env_encrypt_msg args, __env_encrypt_reply reply)
+ {
+ try {
+ dbenv.set_encrypt(args.passwd, args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void set_flags(DbDispatcher server,
+ __env_flags_msg args, __env_flags_reply reply)
+ {
+ try {
+ dbenv.set_flags(args.flags, args.onoff != 0);
+ if (args.onoff != 0)
+ onflags |= args.flags;
+ else
+ offflags |= args.flags;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ // txn_recover implementation
+ public void txn_recover(DbDispatcher server,
+ __txn_recover_msg args, __txn_recover_reply reply)
+ {
+ try {
+ DbPreplist[] prep_list = dbenv.txn_recover(args.count, args.flags);
+ if (prep_list != null && prep_list.length > 0) {
+ int count = prep_list.length;
+ reply.retcount = count;
+ reply.txn = new int[count];
+ reply.gid = new byte[count * Db.DB_XIDDATASIZE];
+
+ for(int i = 0; i < count; i++) {
+ reply.txn[i] = server.addTxn(new RpcDbTxn(this, prep_list[i].txn));
+ System.arraycopy(prep_list[i].gid, 0, reply.gid, i * Db.DB_XIDDATASIZE, Db.DB_XIDDATASIZE);
+ }
+ }
+
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+}
diff --git a/storage/bdb/rpc_server/java/RpcDbTxn.java b/storage/bdb/rpc_server/java/RpcDbTxn.java
new file mode 100644
index 00000000000..a3207b5e35d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/RpcDbTxn.java
@@ -0,0 +1,123 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: RpcDbTxn.java,v 1.2 2002/08/09 01:56:10 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.IOException;
+import java.io.*;
+import java.util.*;
+
+/**
+ * RPC wrapper around a txn object for the Java RPC server.
+ */
+public class RpcDbTxn extends Timer
+{
+ RpcDbEnv rdbenv;
+ DbTxn txn;
+
+ public RpcDbTxn(RpcDbEnv rdbenv, DbTxn txn)
+ {
+ this.rdbenv = rdbenv;
+ this.txn = txn;
+ }
+
+ void dispose()
+ {
+ if (txn != null) {
+ try {
+ txn.abort();
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ }
+ txn = null;
+ }
+ }
+
+ public void abort(DbDispatcher server,
+ __txn_abort_msg args, __txn_abort_reply reply)
+ {
+ try {
+ txn.abort();
+ txn = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delTxn(this);
+ }
+ }
+
+ public void begin(DbDispatcher server,
+ __txn_begin_msg args, __txn_begin_reply reply)
+ {
+ try {
+ if (rdbenv == null) {
+ reply.status = Db.DB_NOSERVER_ID;
+ return;
+ }
+ DbEnv dbenv = rdbenv.dbenv;
+ RpcDbTxn rparent = server.getTxn(args.parentcl_id);
+ DbTxn parent = (rparent != null) ? rparent.txn : null;
+
+ txn = dbenv.txn_begin(parent, args.flags);
+
+ if (rparent != null)
+ timer = rparent.timer;
+ reply.txnidcl_id = server.addTxn(this);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void commit(DbDispatcher server,
+ __txn_commit_msg args, __txn_commit_reply reply)
+ {
+ try {
+ txn.commit(args.flags);
+ txn = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delTxn(this);
+ }
+ }
+
+ public void discard(DbDispatcher server,
+ __txn_discard_msg args, __txn_discard_reply reply)
+ {
+ try {
+ txn.discard(args.flags);
+ txn = null;
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delTxn(this);
+ }
+ }
+
+ public void prepare(DbDispatcher server,
+ __txn_prepare_msg args, __txn_prepare_reply reply)
+ {
+ try {
+ txn.prepare(args.gid);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+}
diff --git a/storage/bdb/rpc_server/java/RpcDbc.java b/storage/bdb/rpc_server/java/RpcDbc.java
new file mode 100644
index 00000000000..a37b4ee4896
--- /dev/null
+++ b/storage/bdb/rpc_server/java/RpcDbc.java
@@ -0,0 +1,238 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: RpcDbc.java,v 1.3 2002/08/09 01:56:10 bostic Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+import com.sleepycat.db.*;
+import java.io.IOException;
+import java.io.*;
+import java.util.*;
+
+/**
+ * RPC wrapper around a dbc object for the Java RPC server.
+ */
+public class RpcDbc extends Timer
+{
+ static final byte[] empty = new byte[0];
+ RpcDbEnv rdbenv;
+ RpcDb rdb;
+ Dbc dbc;
+ Timer orig_timer;
+ boolean isJoin;
+
+ public RpcDbc(RpcDb rdb, Dbc dbc, boolean isJoin)
+ {
+ this.rdb = rdb;
+ this.rdbenv = rdb.rdbenv;
+ this.dbc = dbc;
+ this.isJoin = isJoin;
+ }
+
+ void dispose()
+ {
+ if (dbc != null) {
+ try {
+ dbc.close();
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ }
+ dbc = null;
+ }
+ }
+
+ public void close(DbDispatcher server,
+ __dbc_close_msg args, __dbc_close_reply reply)
+ {
+ try {
+ dbc.close();
+ dbc = null;
+
+ if (isJoin)
+ for(LocalIterator i = ((DbServer)server).cursor_list.iterator(); i.hasNext(); ) {
+ RpcDbc rdbc = (RpcDbc)i.next();
+ // Unjoin cursors that were joined to create this
+ if (rdbc != null && rdbc.timer == this)
+ rdbc.timer = rdbc.orig_timer;
+ }
+
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ } finally {
+ server.delCursor(this);
+ }
+ }
+
+ public void count(DbDispatcher server,
+ __dbc_count_msg args, __dbc_count_reply reply)
+ {
+ try {
+ reply.dupcount = dbc.count(args.flags);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void del(DbDispatcher server,
+ __dbc_del_msg args, __dbc_del_reply reply)
+ {
+ try {
+ reply.status = dbc.del(args.flags);
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void dup(DbDispatcher server,
+ __dbc_dup_msg args, __dbc_dup_reply reply)
+ {
+ try {
+ Dbc newdbc = dbc.dup(args.flags);
+ RpcDbc rdbc = new RpcDbc(rdb, newdbc, false);
+ /* If this cursor has a parent txn, we need to use it too. */
+ if (timer != this)
+ rdbc.timer = timer;
+ reply.dbcidcl_id = server.addCursor(rdbc);
+ reply.status = 0;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void get(DbDispatcher server,
+ __dbc_get_msg args, __dbc_get_reply reply)
+ {
+ try {
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_ulen(args.keyulen);
+ key.set_doff(args.keydoff);
+ key.set_flags(Db.DB_DBT_MALLOC |
+ (args.keyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_ulen(args.dataulen);
+ data.set_doff(args.datadoff);
+ if ((args.flags & Db.DB_MULTIPLE) != 0 ||
+ (args.flags & Db.DB_MULTIPLE_KEY) != 0) {
+ if (data.get_data().length == 0)
+ data.set_data(new byte[data.get_ulen()]);
+ data.set_flags(Db.DB_DBT_USERMEM |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+ } else
+ data.set_flags(Db.DB_DBT_MALLOC |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+
+ reply.status = dbc.get(key, data, args.flags);
+
+ if (key.get_data() == args.keydata) {
+ reply.keydata = new byte[key.get_size()];
+ System.arraycopy(key.get_data(), 0, reply.keydata, 0, key.get_size());
+ } else
+ reply.keydata = key.get_data();
+
+ if (data.get_data() == args.datadata) {
+ reply.datadata = new byte[data.get_size()];
+ System.arraycopy(data.get_data(), 0, reply.datadata, 0, data.get_size());
+ } else
+ reply.datadata = data.get_data();
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ reply.keydata = reply.datadata = empty;
+ }
+ }
+
+ public void pget(DbDispatcher server,
+ __dbc_pget_msg args, __dbc_pget_reply reply)
+ {
+ try {
+ Dbt skey = new Dbt(args.skeydata);
+ skey.set_dlen(args.skeydlen);
+ skey.set_doff(args.skeydoff);
+ skey.set_ulen(args.skeyulen);
+ skey.set_flags(Db.DB_DBT_MALLOC |
+ (args.skeyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt pkey = new Dbt(args.pkeydata);
+ pkey.set_dlen(args.pkeydlen);
+ pkey.set_doff(args.pkeydoff);
+ pkey.set_ulen(args.pkeyulen);
+ pkey.set_flags(Db.DB_DBT_MALLOC |
+ (args.pkeyflags & Db.DB_DBT_PARTIAL));
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_doff(args.datadoff);
+ data.set_ulen(args.dataulen);
+ data.set_flags(Db.DB_DBT_MALLOC |
+ (args.dataflags & Db.DB_DBT_PARTIAL));
+
+ reply.status = dbc.pget(skey, pkey, data, args.flags);
+
+ if (skey.get_data() == args.skeydata) {
+ reply.skeydata = new byte[skey.get_size()];
+ System.arraycopy(skey.get_data(), 0, reply.skeydata, 0, skey.get_size());
+ } else
+ reply.skeydata = skey.get_data();
+
+ if (pkey.get_data() == args.pkeydata) {
+ reply.pkeydata = new byte[pkey.get_size()];
+ System.arraycopy(pkey.get_data(), 0, reply.pkeydata, 0, pkey.get_size());
+ } else
+ reply.pkeydata = pkey.get_data();
+
+ if (data.get_data() == args.datadata) {
+ reply.datadata = new byte[data.get_size()];
+ System.arraycopy(data.get_data(), 0, reply.datadata, 0, data.get_size());
+ } else
+ reply.datadata = data.get_data();
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ }
+ }
+
+ public void put(DbDispatcher server,
+ __dbc_put_msg args, __dbc_put_reply reply)
+ {
+ try {
+ Dbt key = new Dbt(args.keydata);
+ key.set_dlen(args.keydlen);
+ key.set_ulen(args.keyulen);
+ key.set_doff(args.keydoff);
+ key.set_flags(args.keyflags & Db.DB_DBT_PARTIAL);
+
+ Dbt data = new Dbt(args.datadata);
+ data.set_dlen(args.datadlen);
+ data.set_ulen(args.dataulen);
+ data.set_doff(args.datadoff);
+ data.set_flags(args.dataflags);
+
+ reply.status = dbc.put(key, data, args.flags);
+
+ if (reply.status == 0 &&
+ (args.flags == Db.DB_AFTER || args.flags == Db.DB_BEFORE) &&
+ rdb.db.get_type() == Db.DB_RECNO)
+ reply.keydata = key.get_data();
+ else
+ reply.keydata = empty;
+ } catch(DbException e) {
+ e.printStackTrace(DbServer.err);
+ reply.status = e.get_errno();
+ reply.keydata = empty;
+ }
+ }
+}
diff --git a/storage/bdb/rpc_server/java/Timer.java b/storage/bdb/rpc_server/java/Timer.java
new file mode 100644
index 00000000000..e16f3084f95
--- /dev/null
+++ b/storage/bdb/rpc_server/java/Timer.java
@@ -0,0 +1,22 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2001-2002
+ * Sleepycat Software. All rights reserved.
+ *
+ * $Id: Timer.java,v 1.1 2002/01/03 02:59:39 mjc Exp $
+ */
+
+package com.sleepycat.db.rpcserver;
+
+/**
+ * Class to keep track of access times. This is slightly devious by having
+ * both the access_time and a reference to another Timer that can be
+ * used to group/share access times. This is done to keep the Java code
+ * close to the canonical C implementation of the RPC server.
+ */
+public class Timer
+{
+ Timer timer = this;
+ long last_access;
+}
diff --git a/storage/bdb/rpc_server/java/gen/DbServerStub.java b/storage/bdb/rpc_server/java/gen/DbServerStub.java
new file mode 100644
index 00000000000..90fc13a6d9c
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/DbServerStub.java
@@ -0,0 +1,495 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+import org.acplt.oncrpc.server.*;
+
+/**
+ */
+public abstract class DbServerStub extends OncRpcServerStub implements OncRpcDispatchable {
+
+ public DbServerStub()
+ throws OncRpcException, IOException {
+ this(0);
+ }
+
+ public DbServerStub(int port)
+ throws OncRpcException, IOException {
+ info = new OncRpcServerTransportRegistrationInfo [] {
+ new OncRpcServerTransportRegistrationInfo(db_server.DB_RPC_SERVERPROG, 4001),
+ };
+ transports = new OncRpcServerTransport [] {
+ new OncRpcUdpServerTransport(this, port, info, 32768),
+ new OncRpcTcpServerTransport(this, port, info, 32768)
+ };
+ }
+
+ public void dispatchOncRpcCall(OncRpcCallInformation call, int program, int version, int procedure)
+ throws OncRpcException, IOException {
+ if ( version == 4001 ) {
+ switch ( procedure ) {
+ case 1: {
+ __env_cachesize_msg args$ = new __env_cachesize_msg();
+ call.retrieveCall(args$);
+ __env_cachesize_reply result$ = __DB_env_cachesize_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 2: {
+ __env_close_msg args$ = new __env_close_msg();
+ call.retrieveCall(args$);
+ __env_close_reply result$ = __DB_env_close_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 3: {
+ __env_create_msg args$ = new __env_create_msg();
+ call.retrieveCall(args$);
+ __env_create_reply result$ = __DB_env_create_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 4: {
+ __env_dbremove_msg args$ = new __env_dbremove_msg();
+ call.retrieveCall(args$);
+ __env_dbremove_reply result$ = __DB_env_dbremove_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 5: {
+ __env_dbrename_msg args$ = new __env_dbrename_msg();
+ call.retrieveCall(args$);
+ __env_dbrename_reply result$ = __DB_env_dbrename_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 6: {
+ __env_encrypt_msg args$ = new __env_encrypt_msg();
+ call.retrieveCall(args$);
+ __env_encrypt_reply result$ = __DB_env_encrypt_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 7: {
+ __env_flags_msg args$ = new __env_flags_msg();
+ call.retrieveCall(args$);
+ __env_flags_reply result$ = __DB_env_flags_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 8: {
+ __env_open_msg args$ = new __env_open_msg();
+ call.retrieveCall(args$);
+ __env_open_reply result$ = __DB_env_open_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 9: {
+ __env_remove_msg args$ = new __env_remove_msg();
+ call.retrieveCall(args$);
+ __env_remove_reply result$ = __DB_env_remove_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 10: {
+ __txn_abort_msg args$ = new __txn_abort_msg();
+ call.retrieveCall(args$);
+ __txn_abort_reply result$ = __DB_txn_abort_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 11: {
+ __txn_begin_msg args$ = new __txn_begin_msg();
+ call.retrieveCall(args$);
+ __txn_begin_reply result$ = __DB_txn_begin_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 12: {
+ __txn_commit_msg args$ = new __txn_commit_msg();
+ call.retrieveCall(args$);
+ __txn_commit_reply result$ = __DB_txn_commit_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 13: {
+ __txn_discard_msg args$ = new __txn_discard_msg();
+ call.retrieveCall(args$);
+ __txn_discard_reply result$ = __DB_txn_discard_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 14: {
+ __txn_prepare_msg args$ = new __txn_prepare_msg();
+ call.retrieveCall(args$);
+ __txn_prepare_reply result$ = __DB_txn_prepare_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 15: {
+ __txn_recover_msg args$ = new __txn_recover_msg();
+ call.retrieveCall(args$);
+ __txn_recover_reply result$ = __DB_txn_recover_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 16: {
+ __db_associate_msg args$ = new __db_associate_msg();
+ call.retrieveCall(args$);
+ __db_associate_reply result$ = __DB_db_associate_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 17: {
+ __db_bt_maxkey_msg args$ = new __db_bt_maxkey_msg();
+ call.retrieveCall(args$);
+ __db_bt_maxkey_reply result$ = __DB_db_bt_maxkey_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 18: {
+ __db_bt_minkey_msg args$ = new __db_bt_minkey_msg();
+ call.retrieveCall(args$);
+ __db_bt_minkey_reply result$ = __DB_db_bt_minkey_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 19: {
+ __db_close_msg args$ = new __db_close_msg();
+ call.retrieveCall(args$);
+ __db_close_reply result$ = __DB_db_close_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 20: {
+ __db_create_msg args$ = new __db_create_msg();
+ call.retrieveCall(args$);
+ __db_create_reply result$ = __DB_db_create_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 21: {
+ __db_del_msg args$ = new __db_del_msg();
+ call.retrieveCall(args$);
+ __db_del_reply result$ = __DB_db_del_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 22: {
+ __db_encrypt_msg args$ = new __db_encrypt_msg();
+ call.retrieveCall(args$);
+ __db_encrypt_reply result$ = __DB_db_encrypt_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 23: {
+ __db_extentsize_msg args$ = new __db_extentsize_msg();
+ call.retrieveCall(args$);
+ __db_extentsize_reply result$ = __DB_db_extentsize_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 24: {
+ __db_flags_msg args$ = new __db_flags_msg();
+ call.retrieveCall(args$);
+ __db_flags_reply result$ = __DB_db_flags_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 25: {
+ __db_get_msg args$ = new __db_get_msg();
+ call.retrieveCall(args$);
+ __db_get_reply result$ = __DB_db_get_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 26: {
+ __db_h_ffactor_msg args$ = new __db_h_ffactor_msg();
+ call.retrieveCall(args$);
+ __db_h_ffactor_reply result$ = __DB_db_h_ffactor_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 27: {
+ __db_h_nelem_msg args$ = new __db_h_nelem_msg();
+ call.retrieveCall(args$);
+ __db_h_nelem_reply result$ = __DB_db_h_nelem_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 28: {
+ __db_key_range_msg args$ = new __db_key_range_msg();
+ call.retrieveCall(args$);
+ __db_key_range_reply result$ = __DB_db_key_range_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 29: {
+ __db_lorder_msg args$ = new __db_lorder_msg();
+ call.retrieveCall(args$);
+ __db_lorder_reply result$ = __DB_db_lorder_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 30: {
+ __db_open_msg args$ = new __db_open_msg();
+ call.retrieveCall(args$);
+ __db_open_reply result$ = __DB_db_open_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 31: {
+ __db_pagesize_msg args$ = new __db_pagesize_msg();
+ call.retrieveCall(args$);
+ __db_pagesize_reply result$ = __DB_db_pagesize_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 32: {
+ __db_pget_msg args$ = new __db_pget_msg();
+ call.retrieveCall(args$);
+ __db_pget_reply result$ = __DB_db_pget_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 33: {
+ __db_put_msg args$ = new __db_put_msg();
+ call.retrieveCall(args$);
+ __db_put_reply result$ = __DB_db_put_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 34: {
+ __db_re_delim_msg args$ = new __db_re_delim_msg();
+ call.retrieveCall(args$);
+ __db_re_delim_reply result$ = __DB_db_re_delim_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 35: {
+ __db_re_len_msg args$ = new __db_re_len_msg();
+ call.retrieveCall(args$);
+ __db_re_len_reply result$ = __DB_db_re_len_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 36: {
+ __db_re_pad_msg args$ = new __db_re_pad_msg();
+ call.retrieveCall(args$);
+ __db_re_pad_reply result$ = __DB_db_re_pad_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 37: {
+ __db_remove_msg args$ = new __db_remove_msg();
+ call.retrieveCall(args$);
+ __db_remove_reply result$ = __DB_db_remove_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 38: {
+ __db_rename_msg args$ = new __db_rename_msg();
+ call.retrieveCall(args$);
+ __db_rename_reply result$ = __DB_db_rename_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 39: {
+ __db_stat_msg args$ = new __db_stat_msg();
+ call.retrieveCall(args$);
+ __db_stat_reply result$ = __DB_db_stat_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 40: {
+ __db_sync_msg args$ = new __db_sync_msg();
+ call.retrieveCall(args$);
+ __db_sync_reply result$ = __DB_db_sync_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 41: {
+ __db_truncate_msg args$ = new __db_truncate_msg();
+ call.retrieveCall(args$);
+ __db_truncate_reply result$ = __DB_db_truncate_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 42: {
+ __db_cursor_msg args$ = new __db_cursor_msg();
+ call.retrieveCall(args$);
+ __db_cursor_reply result$ = __DB_db_cursor_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 43: {
+ __db_join_msg args$ = new __db_join_msg();
+ call.retrieveCall(args$);
+ __db_join_reply result$ = __DB_db_join_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 44: {
+ __dbc_close_msg args$ = new __dbc_close_msg();
+ call.retrieveCall(args$);
+ __dbc_close_reply result$ = __DB_dbc_close_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 45: {
+ __dbc_count_msg args$ = new __dbc_count_msg();
+ call.retrieveCall(args$);
+ __dbc_count_reply result$ = __DB_dbc_count_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 46: {
+ __dbc_del_msg args$ = new __dbc_del_msg();
+ call.retrieveCall(args$);
+ __dbc_del_reply result$ = __DB_dbc_del_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 47: {
+ __dbc_dup_msg args$ = new __dbc_dup_msg();
+ call.retrieveCall(args$);
+ __dbc_dup_reply result$ = __DB_dbc_dup_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 48: {
+ __dbc_get_msg args$ = new __dbc_get_msg();
+ call.retrieveCall(args$);
+ __dbc_get_reply result$ = __DB_dbc_get_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 49: {
+ __dbc_pget_msg args$ = new __dbc_pget_msg();
+ call.retrieveCall(args$);
+ __dbc_pget_reply result$ = __DB_dbc_pget_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ case 50: {
+ __dbc_put_msg args$ = new __dbc_put_msg();
+ call.retrieveCall(args$);
+ __dbc_put_reply result$ = __DB_dbc_put_4001(args$);
+ call.reply(result$);
+ break;
+ }
+ default:
+ call.failProcedureUnavailable();
+ }
+ } else {
+ call.failProcedureUnavailable();
+ }
+ }
+
+ public abstract __env_cachesize_reply __DB_env_cachesize_4001(__env_cachesize_msg arg1);
+
+ public abstract __env_close_reply __DB_env_close_4001(__env_close_msg arg1);
+
+ public abstract __env_create_reply __DB_env_create_4001(__env_create_msg arg1);
+
+ public abstract __env_dbremove_reply __DB_env_dbremove_4001(__env_dbremove_msg arg1);
+
+ public abstract __env_dbrename_reply __DB_env_dbrename_4001(__env_dbrename_msg arg1);
+
+ public abstract __env_encrypt_reply __DB_env_encrypt_4001(__env_encrypt_msg arg1);
+
+ public abstract __env_flags_reply __DB_env_flags_4001(__env_flags_msg arg1);
+
+ public abstract __env_open_reply __DB_env_open_4001(__env_open_msg arg1);
+
+ public abstract __env_remove_reply __DB_env_remove_4001(__env_remove_msg arg1);
+
+ public abstract __txn_abort_reply __DB_txn_abort_4001(__txn_abort_msg arg1);
+
+ public abstract __txn_begin_reply __DB_txn_begin_4001(__txn_begin_msg arg1);
+
+ public abstract __txn_commit_reply __DB_txn_commit_4001(__txn_commit_msg arg1);
+
+ public abstract __txn_discard_reply __DB_txn_discard_4001(__txn_discard_msg arg1);
+
+ public abstract __txn_prepare_reply __DB_txn_prepare_4001(__txn_prepare_msg arg1);
+
+ public abstract __txn_recover_reply __DB_txn_recover_4001(__txn_recover_msg arg1);
+
+ public abstract __db_associate_reply __DB_db_associate_4001(__db_associate_msg arg1);
+
+ public abstract __db_bt_maxkey_reply __DB_db_bt_maxkey_4001(__db_bt_maxkey_msg arg1);
+
+ public abstract __db_bt_minkey_reply __DB_db_bt_minkey_4001(__db_bt_minkey_msg arg1);
+
+ public abstract __db_close_reply __DB_db_close_4001(__db_close_msg arg1);
+
+ public abstract __db_create_reply __DB_db_create_4001(__db_create_msg arg1);
+
+ public abstract __db_del_reply __DB_db_del_4001(__db_del_msg arg1);
+
+ public abstract __db_encrypt_reply __DB_db_encrypt_4001(__db_encrypt_msg arg1);
+
+ public abstract __db_extentsize_reply __DB_db_extentsize_4001(__db_extentsize_msg arg1);
+
+ public abstract __db_flags_reply __DB_db_flags_4001(__db_flags_msg arg1);
+
+ public abstract __db_get_reply __DB_db_get_4001(__db_get_msg arg1);
+
+ public abstract __db_h_ffactor_reply __DB_db_h_ffactor_4001(__db_h_ffactor_msg arg1);
+
+ public abstract __db_h_nelem_reply __DB_db_h_nelem_4001(__db_h_nelem_msg arg1);
+
+ public abstract __db_key_range_reply __DB_db_key_range_4001(__db_key_range_msg arg1);
+
+ public abstract __db_lorder_reply __DB_db_lorder_4001(__db_lorder_msg arg1);
+
+ public abstract __db_open_reply __DB_db_open_4001(__db_open_msg arg1);
+
+ public abstract __db_pagesize_reply __DB_db_pagesize_4001(__db_pagesize_msg arg1);
+
+ public abstract __db_pget_reply __DB_db_pget_4001(__db_pget_msg arg1);
+
+ public abstract __db_put_reply __DB_db_put_4001(__db_put_msg arg1);
+
+ public abstract __db_re_delim_reply __DB_db_re_delim_4001(__db_re_delim_msg arg1);
+
+ public abstract __db_re_len_reply __DB_db_re_len_4001(__db_re_len_msg arg1);
+
+ public abstract __db_re_pad_reply __DB_db_re_pad_4001(__db_re_pad_msg arg1);
+
+ public abstract __db_remove_reply __DB_db_remove_4001(__db_remove_msg arg1);
+
+ public abstract __db_rename_reply __DB_db_rename_4001(__db_rename_msg arg1);
+
+ public abstract __db_stat_reply __DB_db_stat_4001(__db_stat_msg arg1);
+
+ public abstract __db_sync_reply __DB_db_sync_4001(__db_sync_msg arg1);
+
+ public abstract __db_truncate_reply __DB_db_truncate_4001(__db_truncate_msg arg1);
+
+ public abstract __db_cursor_reply __DB_db_cursor_4001(__db_cursor_msg arg1);
+
+ public abstract __db_join_reply __DB_db_join_4001(__db_join_msg arg1);
+
+ public abstract __dbc_close_reply __DB_dbc_close_4001(__dbc_close_msg arg1);
+
+ public abstract __dbc_count_reply __DB_dbc_count_4001(__dbc_count_msg arg1);
+
+ public abstract __dbc_del_reply __DB_dbc_del_4001(__dbc_del_msg arg1);
+
+ public abstract __dbc_dup_reply __DB_dbc_dup_4001(__dbc_dup_msg arg1);
+
+ public abstract __dbc_get_reply __DB_dbc_get_4001(__dbc_get_msg arg1);
+
+ public abstract __dbc_pget_reply __DB_dbc_pget_4001(__dbc_pget_msg arg1);
+
+ public abstract __dbc_put_reply __DB_dbc_put_4001(__dbc_put_msg arg1);
+
+}
+// End of DbServerStub.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_associate_msg.java b/storage/bdb/rpc_server/java/gen/__db_associate_msg.java
new file mode 100644
index 00000000000..8977303b99a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_associate_msg.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 4/25/02 11:01 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_associate_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int sdbpcl_id;
+ public int flags;
+
+ public __db_associate_msg() {
+ }
+
+ public __db_associate_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(sdbpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ sdbpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_associate_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_associate_reply.java b/storage/bdb/rpc_server/java/gen/__db_associate_reply.java
new file mode 100644
index 00000000000..476d0868b33
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_associate_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_associate_reply implements XdrAble {
+ public int status;
+
+ public __db_associate_reply() {
+ }
+
+ public __db_associate_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_associate_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_msg.java b/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_msg.java
new file mode 100644
index 00000000000..007ce16a974
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_bt_maxkey_msg implements XdrAble {
+ public int dbpcl_id;
+ public int maxkey;
+
+ public __db_bt_maxkey_msg() {
+ }
+
+ public __db_bt_maxkey_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(maxkey);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ maxkey = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_bt_maxkey_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_reply.java b/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_reply.java
new file mode 100644
index 00000000000..855573271b3
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_bt_maxkey_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_bt_maxkey_reply implements XdrAble {
+ public int status;
+
+ public __db_bt_maxkey_reply() {
+ }
+
+ public __db_bt_maxkey_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_bt_maxkey_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_bt_minkey_msg.java b/storage/bdb/rpc_server/java/gen/__db_bt_minkey_msg.java
new file mode 100644
index 00000000000..c86ec382456
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_bt_minkey_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_bt_minkey_msg implements XdrAble {
+ public int dbpcl_id;
+ public int minkey;
+
+ public __db_bt_minkey_msg() {
+ }
+
+ public __db_bt_minkey_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(minkey);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ minkey = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_bt_minkey_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_bt_minkey_reply.java b/storage/bdb/rpc_server/java/gen/__db_bt_minkey_reply.java
new file mode 100644
index 00000000000..4d944b6bf33
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_bt_minkey_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_bt_minkey_reply implements XdrAble {
+ public int status;
+
+ public __db_bt_minkey_reply() {
+ }
+
+ public __db_bt_minkey_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_bt_minkey_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_close_msg.java b/storage/bdb/rpc_server/java/gen/__db_close_msg.java
new file mode 100644
index 00000000000..ce8d213701b
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_close_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_close_msg implements XdrAble {
+ public int dbpcl_id;
+ public int flags;
+
+ public __db_close_msg() {
+ }
+
+ public __db_close_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_close_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_close_reply.java b/storage/bdb/rpc_server/java/gen/__db_close_reply.java
new file mode 100644
index 00000000000..a9380e9c053
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_close_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_close_reply implements XdrAble {
+ public int status;
+
+ public __db_close_reply() {
+ }
+
+ public __db_close_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_close_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_create_msg.java b/storage/bdb/rpc_server/java/gen/__db_create_msg.java
new file mode 100644
index 00000000000..d21ca50f807
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_create_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_create_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int flags;
+
+ public __db_create_msg() {
+ }
+
+ public __db_create_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_create_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_create_reply.java b/storage/bdb/rpc_server/java/gen/__db_create_reply.java
new file mode 100644
index 00000000000..e3dcbbab14e
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_create_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_create_reply implements XdrAble {
+ public int status;
+ public int dbcl_id;
+
+ public __db_create_reply() {
+ }
+
+ public __db_create_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dbcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dbcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_create_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_cursor_msg.java b/storage/bdb/rpc_server/java/gen/__db_cursor_msg.java
new file mode 100644
index 00000000000..60e09db6ebb
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_cursor_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_cursor_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int flags;
+
+ public __db_cursor_msg() {
+ }
+
+ public __db_cursor_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_cursor_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_cursor_reply.java b/storage/bdb/rpc_server/java/gen/__db_cursor_reply.java
new file mode 100644
index 00000000000..bafd2817c67
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_cursor_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_cursor_reply implements XdrAble {
+ public int status;
+ public int dbcidcl_id;
+
+ public __db_cursor_reply() {
+ }
+
+ public __db_cursor_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dbcidcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dbcidcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_cursor_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_del_msg.java b/storage/bdb/rpc_server/java/gen/__db_del_msg.java
new file mode 100644
index 00000000000..fdf47907dd6
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_del_msg.java
@@ -0,0 +1,53 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_del_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int flags;
+
+ public __db_del_msg() {
+ }
+
+ public __db_del_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_del_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_del_reply.java b/storage/bdb/rpc_server/java/gen/__db_del_reply.java
new file mode 100644
index 00000000000..8a55445944f
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_del_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_del_reply implements XdrAble {
+ public int status;
+
+ public __db_del_reply() {
+ }
+
+ public __db_del_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_del_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_encrypt_msg.java b/storage/bdb/rpc_server/java/gen/__db_encrypt_msg.java
new file mode 100644
index 00000000000..46d9f8ee7e8
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_encrypt_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 2/13/02 1:05 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_encrypt_msg implements XdrAble {
+ public int dbpcl_id;
+ public String passwd;
+ public int flags;
+
+ public __db_encrypt_msg() {
+ }
+
+ public __db_encrypt_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeString(passwd);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ passwd = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_encrypt_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_encrypt_reply.java b/storage/bdb/rpc_server/java/gen/__db_encrypt_reply.java
new file mode 100644
index 00000000000..a97cc98c90b
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_encrypt_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 2/13/02 1:05 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_encrypt_reply implements XdrAble {
+ public int status;
+
+ public __db_encrypt_reply() {
+ }
+
+ public __db_encrypt_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_encrypt_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_extentsize_msg.java b/storage/bdb/rpc_server/java/gen/__db_extentsize_msg.java
new file mode 100644
index 00000000000..41a51cff9c4
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_extentsize_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_extentsize_msg implements XdrAble {
+ public int dbpcl_id;
+ public int extentsize;
+
+ public __db_extentsize_msg() {
+ }
+
+ public __db_extentsize_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(extentsize);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ extentsize = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_extentsize_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_extentsize_reply.java b/storage/bdb/rpc_server/java/gen/__db_extentsize_reply.java
new file mode 100644
index 00000000000..409625486c7
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_extentsize_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_extentsize_reply implements XdrAble {
+ public int status;
+
+ public __db_extentsize_reply() {
+ }
+
+ public __db_extentsize_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_extentsize_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_flags_msg.java b/storage/bdb/rpc_server/java/gen/__db_flags_msg.java
new file mode 100644
index 00000000000..d8752e2e4dd
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_flags_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_flags_msg implements XdrAble {
+ public int dbpcl_id;
+ public int flags;
+
+ public __db_flags_msg() {
+ }
+
+ public __db_flags_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_flags_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_flags_reply.java b/storage/bdb/rpc_server/java/gen/__db_flags_reply.java
new file mode 100644
index 00000000000..c4ec253db83
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_flags_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_flags_reply implements XdrAble {
+ public int status;
+
+ public __db_flags_reply() {
+ }
+
+ public __db_flags_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_flags_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_get_msg.java b/storage/bdb/rpc_server/java/gen/__db_get_msg.java
new file mode 100644
index 00000000000..3dfe8e9d86e
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_get_msg.java
@@ -0,0 +1,68 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_get_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __db_get_msg() {
+ }
+
+ public __db_get_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_get_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_get_reply.java b/storage/bdb/rpc_server/java/gen/__db_get_reply.java
new file mode 100644
index 00000000000..64ce525728a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_get_reply.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_get_reply implements XdrAble {
+ public int status;
+ public byte [] keydata;
+ public byte [] datadata;
+
+ public __db_get_reply() {
+ }
+
+ public __db_get_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __db_get_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_h_ffactor_msg.java b/storage/bdb/rpc_server/java/gen/__db_h_ffactor_msg.java
new file mode 100644
index 00000000000..8d2ed1b1c0b
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_h_ffactor_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_h_ffactor_msg implements XdrAble {
+ public int dbpcl_id;
+ public int ffactor;
+
+ public __db_h_ffactor_msg() {
+ }
+
+ public __db_h_ffactor_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(ffactor);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ ffactor = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_h_ffactor_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_h_ffactor_reply.java b/storage/bdb/rpc_server/java/gen/__db_h_ffactor_reply.java
new file mode 100644
index 00000000000..1885ec50240
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_h_ffactor_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_h_ffactor_reply implements XdrAble {
+ public int status;
+
+ public __db_h_ffactor_reply() {
+ }
+
+ public __db_h_ffactor_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_h_ffactor_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_h_nelem_msg.java b/storage/bdb/rpc_server/java/gen/__db_h_nelem_msg.java
new file mode 100644
index 00000000000..7d084351755
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_h_nelem_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_h_nelem_msg implements XdrAble {
+ public int dbpcl_id;
+ public int nelem;
+
+ public __db_h_nelem_msg() {
+ }
+
+ public __db_h_nelem_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(nelem);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ nelem = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_h_nelem_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_h_nelem_reply.java b/storage/bdb/rpc_server/java/gen/__db_h_nelem_reply.java
new file mode 100644
index 00000000000..20c5c774e69
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_h_nelem_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_h_nelem_reply implements XdrAble {
+ public int status;
+
+ public __db_h_nelem_reply() {
+ }
+
+ public __db_h_nelem_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_h_nelem_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_join_msg.java b/storage/bdb/rpc_server/java/gen/__db_join_msg.java
new file mode 100644
index 00000000000..88c72dbd6ba
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_join_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_join_msg implements XdrAble {
+ public int dbpcl_id;
+ public int [] curs;
+ public int flags;
+
+ public __db_join_msg() {
+ }
+
+ public __db_join_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeIntVector(curs);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ curs = xdr.xdrDecodeIntVector();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_join_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_join_reply.java b/storage/bdb/rpc_server/java/gen/__db_join_reply.java
new file mode 100644
index 00000000000..80980e23d6c
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_join_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_join_reply implements XdrAble {
+ public int status;
+ public int dbcidcl_id;
+
+ public __db_join_reply() {
+ }
+
+ public __db_join_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dbcidcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dbcidcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_join_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_key_range_msg.java b/storage/bdb/rpc_server/java/gen/__db_key_range_msg.java
new file mode 100644
index 00000000000..233077e0964
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_key_range_msg.java
@@ -0,0 +1,53 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_key_range_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int flags;
+
+ public __db_key_range_msg() {
+ }
+
+ public __db_key_range_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_key_range_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_key_range_reply.java b/storage/bdb/rpc_server/java/gen/__db_key_range_reply.java
new file mode 100644
index 00000000000..09244c13d1d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_key_range_reply.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_key_range_reply implements XdrAble {
+ public int status;
+ public double less;
+ public double equal;
+ public double greater;
+
+ public __db_key_range_reply() {
+ }
+
+ public __db_key_range_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDouble(less);
+ xdr.xdrEncodeDouble(equal);
+ xdr.xdrEncodeDouble(greater);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ less = xdr.xdrDecodeDouble();
+ equal = xdr.xdrDecodeDouble();
+ greater = xdr.xdrDecodeDouble();
+ }
+
+}
+// End of __db_key_range_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_lorder_msg.java b/storage/bdb/rpc_server/java/gen/__db_lorder_msg.java
new file mode 100644
index 00000000000..3399ad8daf0
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_lorder_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_lorder_msg implements XdrAble {
+ public int dbpcl_id;
+ public int lorder;
+
+ public __db_lorder_msg() {
+ }
+
+ public __db_lorder_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(lorder);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ lorder = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_lorder_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_lorder_reply.java b/storage/bdb/rpc_server/java/gen/__db_lorder_reply.java
new file mode 100644
index 00000000000..cdcda4d4f43
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_lorder_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_lorder_reply implements XdrAble {
+ public int status;
+
+ public __db_lorder_reply() {
+ }
+
+ public __db_lorder_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_lorder_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_open_msg.java b/storage/bdb/rpc_server/java/gen/__db_open_msg.java
new file mode 100644
index 00000000000..14dbd9e3b0c
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_open_msg.java
@@ -0,0 +1,50 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 2/13/02 1:05 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_open_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public String name;
+ public String subdb;
+ public int type;
+ public int flags;
+ public int mode;
+
+ public __db_open_msg() {
+ }
+
+ public __db_open_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeString(name);
+ xdr.xdrEncodeString(subdb);
+ xdr.xdrEncodeInt(type);
+ xdr.xdrEncodeInt(flags);
+ xdr.xdrEncodeInt(mode);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ name = xdr.xdrDecodeString();
+ subdb = xdr.xdrDecodeString();
+ type = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ mode = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_open_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_open_reply.java b/storage/bdb/rpc_server/java/gen/__db_open_reply.java
new file mode 100644
index 00000000000..d90c3754c2f
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_open_reply.java
@@ -0,0 +1,44 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_open_reply implements XdrAble {
+ public int status;
+ public int dbcl_id;
+ public int type;
+ public int dbflags;
+ public int lorder;
+
+ public __db_open_reply() {
+ }
+
+ public __db_open_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dbcl_id);
+ xdr.xdrEncodeInt(type);
+ xdr.xdrEncodeInt(dbflags);
+ xdr.xdrEncodeInt(lorder);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dbcl_id = xdr.xdrDecodeInt();
+ type = xdr.xdrDecodeInt();
+ dbflags = xdr.xdrDecodeInt();
+ lorder = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_open_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_pagesize_msg.java b/storage/bdb/rpc_server/java/gen/__db_pagesize_msg.java
new file mode 100644
index 00000000000..a452ea4e381
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_pagesize_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_pagesize_msg implements XdrAble {
+ public int dbpcl_id;
+ public int pagesize;
+
+ public __db_pagesize_msg() {
+ }
+
+ public __db_pagesize_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(pagesize);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ pagesize = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_pagesize_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_pagesize_reply.java b/storage/bdb/rpc_server/java/gen/__db_pagesize_reply.java
new file mode 100644
index 00000000000..830b2078b34
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_pagesize_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_pagesize_reply implements XdrAble {
+ public int status;
+
+ public __db_pagesize_reply() {
+ }
+
+ public __db_pagesize_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_pagesize_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_pget_msg.java b/storage/bdb/rpc_server/java/gen/__db_pget_msg.java
new file mode 100644
index 00000000000..11d27ca9e46
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_pget_msg.java
@@ -0,0 +1,83 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_pget_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int skeydlen;
+ public int skeydoff;
+ public int skeyulen;
+ public int skeyflags;
+ public byte [] skeydata;
+ public int pkeydlen;
+ public int pkeydoff;
+ public int pkeyulen;
+ public int pkeyflags;
+ public byte [] pkeydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __db_pget_msg() {
+ }
+
+ public __db_pget_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(skeydlen);
+ xdr.xdrEncodeInt(skeydoff);
+ xdr.xdrEncodeInt(skeyulen);
+ xdr.xdrEncodeInt(skeyflags);
+ xdr.xdrEncodeDynamicOpaque(skeydata);
+ xdr.xdrEncodeInt(pkeydlen);
+ xdr.xdrEncodeInt(pkeydoff);
+ xdr.xdrEncodeInt(pkeyulen);
+ xdr.xdrEncodeInt(pkeyflags);
+ xdr.xdrEncodeDynamicOpaque(pkeydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ skeydlen = xdr.xdrDecodeInt();
+ skeydoff = xdr.xdrDecodeInt();
+ skeyulen = xdr.xdrDecodeInt();
+ skeyflags = xdr.xdrDecodeInt();
+ skeydata = xdr.xdrDecodeDynamicOpaque();
+ pkeydlen = xdr.xdrDecodeInt();
+ pkeydoff = xdr.xdrDecodeInt();
+ pkeyulen = xdr.xdrDecodeInt();
+ pkeyflags = xdr.xdrDecodeInt();
+ pkeydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_pget_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_pget_reply.java b/storage/bdb/rpc_server/java/gen/__db_pget_reply.java
new file mode 100644
index 00000000000..86c9c2111b9
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_pget_reply.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_pget_reply implements XdrAble {
+ public int status;
+ public byte [] skeydata;
+ public byte [] pkeydata;
+ public byte [] datadata;
+
+ public __db_pget_reply() {
+ }
+
+ public __db_pget_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(skeydata);
+ xdr.xdrEncodeDynamicOpaque(pkeydata);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ skeydata = xdr.xdrDecodeDynamicOpaque();
+ pkeydata = xdr.xdrDecodeDynamicOpaque();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __db_pget_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_put_msg.java b/storage/bdb/rpc_server/java/gen/__db_put_msg.java
new file mode 100644
index 00000000000..b6159cff3a8
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_put_msg.java
@@ -0,0 +1,68 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_put_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __db_put_msg() {
+ }
+
+ public __db_put_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_put_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_put_reply.java b/storage/bdb/rpc_server/java/gen/__db_put_reply.java
new file mode 100644
index 00000000000..fc89ae1c3bd
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_put_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_put_reply implements XdrAble {
+ public int status;
+ public byte [] keydata;
+
+ public __db_put_reply() {
+ }
+
+ public __db_put_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __db_put_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_delim_msg.java b/storage/bdb/rpc_server/java/gen/__db_re_delim_msg.java
new file mode 100644
index 00000000000..c386bddd256
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_delim_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_delim_msg implements XdrAble {
+ public int dbpcl_id;
+ public int delim;
+
+ public __db_re_delim_msg() {
+ }
+
+ public __db_re_delim_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(delim);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ delim = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_delim_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_delim_reply.java b/storage/bdb/rpc_server/java/gen/__db_re_delim_reply.java
new file mode 100644
index 00000000000..aa8a797f53d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_delim_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_delim_reply implements XdrAble {
+ public int status;
+
+ public __db_re_delim_reply() {
+ }
+
+ public __db_re_delim_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_delim_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_len_msg.java b/storage/bdb/rpc_server/java/gen/__db_re_len_msg.java
new file mode 100644
index 00000000000..664de5c899c
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_len_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_len_msg implements XdrAble {
+ public int dbpcl_id;
+ public int len;
+
+ public __db_re_len_msg() {
+ }
+
+ public __db_re_len_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(len);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ len = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_len_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_len_reply.java b/storage/bdb/rpc_server/java/gen/__db_re_len_reply.java
new file mode 100644
index 00000000000..dda27c8c123
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_len_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_len_reply implements XdrAble {
+ public int status;
+
+ public __db_re_len_reply() {
+ }
+
+ public __db_re_len_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_len_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_pad_msg.java b/storage/bdb/rpc_server/java/gen/__db_re_pad_msg.java
new file mode 100644
index 00000000000..2c1290b6e74
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_pad_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_pad_msg implements XdrAble {
+ public int dbpcl_id;
+ public int pad;
+
+ public __db_re_pad_msg() {
+ }
+
+ public __db_re_pad_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(pad);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ pad = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_pad_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_re_pad_reply.java b/storage/bdb/rpc_server/java/gen/__db_re_pad_reply.java
new file mode 100644
index 00000000000..f0aaa9a3a70
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_re_pad_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_re_pad_reply implements XdrAble {
+ public int status;
+
+ public __db_re_pad_reply() {
+ }
+
+ public __db_re_pad_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_re_pad_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_remove_msg.java b/storage/bdb/rpc_server/java/gen/__db_remove_msg.java
new file mode 100644
index 00000000000..dfa9066a7ec
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_remove_msg.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_remove_msg implements XdrAble {
+ public int dbpcl_id;
+ public String name;
+ public String subdb;
+ public int flags;
+
+ public __db_remove_msg() {
+ }
+
+ public __db_remove_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeString(name);
+ xdr.xdrEncodeString(subdb);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ name = xdr.xdrDecodeString();
+ subdb = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_remove_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_remove_reply.java b/storage/bdb/rpc_server/java/gen/__db_remove_reply.java
new file mode 100644
index 00000000000..a2b86c04985
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_remove_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_remove_reply implements XdrAble {
+ public int status;
+
+ public __db_remove_reply() {
+ }
+
+ public __db_remove_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_remove_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_rename_msg.java b/storage/bdb/rpc_server/java/gen/__db_rename_msg.java
new file mode 100644
index 00000000000..12b434e3375
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_rename_msg.java
@@ -0,0 +1,44 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_rename_msg implements XdrAble {
+ public int dbpcl_id;
+ public String name;
+ public String subdb;
+ public String newname;
+ public int flags;
+
+ public __db_rename_msg() {
+ }
+
+ public __db_rename_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeString(name);
+ xdr.xdrEncodeString(subdb);
+ xdr.xdrEncodeString(newname);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ name = xdr.xdrDecodeString();
+ subdb = xdr.xdrDecodeString();
+ newname = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_rename_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_rename_reply.java b/storage/bdb/rpc_server/java/gen/__db_rename_reply.java
new file mode 100644
index 00000000000..4e4a22be570
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_rename_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_rename_reply implements XdrAble {
+ public int status;
+
+ public __db_rename_reply() {
+ }
+
+ public __db_rename_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_rename_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_stat_msg.java b/storage/bdb/rpc_server/java/gen/__db_stat_msg.java
new file mode 100644
index 00000000000..af536b5f707
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_stat_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_stat_msg implements XdrAble {
+ public int dbpcl_id;
+ public int flags;
+
+ public __db_stat_msg() {
+ }
+
+ public __db_stat_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_stat_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_stat_reply.java b/storage/bdb/rpc_server/java/gen/__db_stat_reply.java
new file mode 100644
index 00000000000..8df1460149a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_stat_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_stat_reply implements XdrAble {
+ public int status;
+ public int [] stats;
+
+ public __db_stat_reply() {
+ }
+
+ public __db_stat_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeIntVector(stats);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ stats = xdr.xdrDecodeIntVector();
+ }
+
+}
+// End of __db_stat_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_sync_msg.java b/storage/bdb/rpc_server/java/gen/__db_sync_msg.java
new file mode 100644
index 00000000000..c6594670fc6
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_sync_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_sync_msg implements XdrAble {
+ public int dbpcl_id;
+ public int flags;
+
+ public __db_sync_msg() {
+ }
+
+ public __db_sync_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_sync_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_sync_reply.java b/storage/bdb/rpc_server/java/gen/__db_sync_reply.java
new file mode 100644
index 00000000000..d0a8bc8b196
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_sync_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_sync_reply implements XdrAble {
+ public int status;
+
+ public __db_sync_reply() {
+ }
+
+ public __db_sync_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_sync_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_truncate_msg.java b/storage/bdb/rpc_server/java/gen/__db_truncate_msg.java
new file mode 100644
index 00000000000..38810d65660
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_truncate_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_truncate_msg implements XdrAble {
+ public int dbpcl_id;
+ public int txnpcl_id;
+ public int flags;
+
+ public __db_truncate_msg() {
+ }
+
+ public __db_truncate_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbpcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbpcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_truncate_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__db_truncate_reply.java b/storage/bdb/rpc_server/java/gen/__db_truncate_reply.java
new file mode 100644
index 00000000000..c4f68869007
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__db_truncate_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __db_truncate_reply implements XdrAble {
+ public int status;
+ public int count;
+
+ public __db_truncate_reply() {
+ }
+
+ public __db_truncate_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(count);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ count = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __db_truncate_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_close_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_close_msg.java
new file mode 100644
index 00000000000..eb1ca7f7e17
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_close_msg.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_close_msg implements XdrAble {
+ public int dbccl_id;
+
+ public __dbc_close_msg() {
+ }
+
+ public __dbc_close_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_close_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_close_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_close_reply.java
new file mode 100644
index 00000000000..47459aace36
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_close_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_close_reply implements XdrAble {
+ public int status;
+
+ public __dbc_close_reply() {
+ }
+
+ public __dbc_close_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_close_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_count_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_count_msg.java
new file mode 100644
index 00000000000..5f554e18a1b
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_count_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_count_msg implements XdrAble {
+ public int dbccl_id;
+ public int flags;
+
+ public __dbc_count_msg() {
+ }
+
+ public __dbc_count_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_count_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_count_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_count_reply.java
new file mode 100644
index 00000000000..4daecdd2296
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_count_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_count_reply implements XdrAble {
+ public int status;
+ public int dupcount;
+
+ public __dbc_count_reply() {
+ }
+
+ public __dbc_count_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dupcount);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dupcount = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_count_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_del_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_del_msg.java
new file mode 100644
index 00000000000..bc4bd05f573
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_del_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_del_msg implements XdrAble {
+ public int dbccl_id;
+ public int flags;
+
+ public __dbc_del_msg() {
+ }
+
+ public __dbc_del_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_del_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_del_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_del_reply.java
new file mode 100644
index 00000000000..e55ac9ffaf6
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_del_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_del_reply implements XdrAble {
+ public int status;
+
+ public __dbc_del_reply() {
+ }
+
+ public __dbc_del_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_del_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_dup_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_dup_msg.java
new file mode 100644
index 00000000000..9a3894e6158
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_dup_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_dup_msg implements XdrAble {
+ public int dbccl_id;
+ public int flags;
+
+ public __dbc_dup_msg() {
+ }
+
+ public __dbc_dup_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_dup_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_dup_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_dup_reply.java
new file mode 100644
index 00000000000..6b942f1a61a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_dup_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_dup_reply implements XdrAble {
+ public int status;
+ public int dbcidcl_id;
+
+ public __dbc_dup_reply() {
+ }
+
+ public __dbc_dup_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(dbcidcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ dbcidcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_dup_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_get_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_get_msg.java
new file mode 100644
index 00000000000..672ace43fdd
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_get_msg.java
@@ -0,0 +1,65 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_get_msg implements XdrAble {
+ public int dbccl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __dbc_get_msg() {
+ }
+
+ public __dbc_get_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_get_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_get_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_get_reply.java
new file mode 100644
index 00000000000..8671fec6335
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_get_reply.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_get_reply implements XdrAble {
+ public int status;
+ public byte [] keydata;
+ public byte [] datadata;
+
+ public __dbc_get_reply() {
+ }
+
+ public __dbc_get_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __dbc_get_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_pget_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_pget_msg.java
new file mode 100644
index 00000000000..8ca3c6171a1
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_pget_msg.java
@@ -0,0 +1,80 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_pget_msg implements XdrAble {
+ public int dbccl_id;
+ public int skeydlen;
+ public int skeydoff;
+ public int skeyulen;
+ public int skeyflags;
+ public byte [] skeydata;
+ public int pkeydlen;
+ public int pkeydoff;
+ public int pkeyulen;
+ public int pkeyflags;
+ public byte [] pkeydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __dbc_pget_msg() {
+ }
+
+ public __dbc_pget_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(skeydlen);
+ xdr.xdrEncodeInt(skeydoff);
+ xdr.xdrEncodeInt(skeyulen);
+ xdr.xdrEncodeInt(skeyflags);
+ xdr.xdrEncodeDynamicOpaque(skeydata);
+ xdr.xdrEncodeInt(pkeydlen);
+ xdr.xdrEncodeInt(pkeydoff);
+ xdr.xdrEncodeInt(pkeyulen);
+ xdr.xdrEncodeInt(pkeyflags);
+ xdr.xdrEncodeDynamicOpaque(pkeydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ skeydlen = xdr.xdrDecodeInt();
+ skeydoff = xdr.xdrDecodeInt();
+ skeyulen = xdr.xdrDecodeInt();
+ skeyflags = xdr.xdrDecodeInt();
+ skeydata = xdr.xdrDecodeDynamicOpaque();
+ pkeydlen = xdr.xdrDecodeInt();
+ pkeydoff = xdr.xdrDecodeInt();
+ pkeyulen = xdr.xdrDecodeInt();
+ pkeyflags = xdr.xdrDecodeInt();
+ pkeydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_pget_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_pget_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_pget_reply.java
new file mode 100644
index 00000000000..16cc795878d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_pget_reply.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_pget_reply implements XdrAble {
+ public int status;
+ public byte [] skeydata;
+ public byte [] pkeydata;
+ public byte [] datadata;
+
+ public __dbc_pget_reply() {
+ }
+
+ public __dbc_pget_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(skeydata);
+ xdr.xdrEncodeDynamicOpaque(pkeydata);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ skeydata = xdr.xdrDecodeDynamicOpaque();
+ pkeydata = xdr.xdrDecodeDynamicOpaque();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __dbc_pget_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_put_msg.java b/storage/bdb/rpc_server/java/gen/__dbc_put_msg.java
new file mode 100644
index 00000000000..98d12423dc5
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_put_msg.java
@@ -0,0 +1,65 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_put_msg implements XdrAble {
+ public int dbccl_id;
+ public int keydlen;
+ public int keydoff;
+ public int keyulen;
+ public int keyflags;
+ public byte [] keydata;
+ public int datadlen;
+ public int datadoff;
+ public int dataulen;
+ public int dataflags;
+ public byte [] datadata;
+ public int flags;
+
+ public __dbc_put_msg() {
+ }
+
+ public __dbc_put_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbccl_id);
+ xdr.xdrEncodeInt(keydlen);
+ xdr.xdrEncodeInt(keydoff);
+ xdr.xdrEncodeInt(keyulen);
+ xdr.xdrEncodeInt(keyflags);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ xdr.xdrEncodeInt(datadlen);
+ xdr.xdrEncodeInt(datadoff);
+ xdr.xdrEncodeInt(dataulen);
+ xdr.xdrEncodeInt(dataflags);
+ xdr.xdrEncodeDynamicOpaque(datadata);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbccl_id = xdr.xdrDecodeInt();
+ keydlen = xdr.xdrDecodeInt();
+ keydoff = xdr.xdrDecodeInt();
+ keyulen = xdr.xdrDecodeInt();
+ keyflags = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ datadlen = xdr.xdrDecodeInt();
+ datadoff = xdr.xdrDecodeInt();
+ dataulen = xdr.xdrDecodeInt();
+ dataflags = xdr.xdrDecodeInt();
+ datadata = xdr.xdrDecodeDynamicOpaque();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __dbc_put_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__dbc_put_reply.java b/storage/bdb/rpc_server/java/gen/__dbc_put_reply.java
new file mode 100644
index 00000000000..385f9f783fb
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__dbc_put_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __dbc_put_reply implements XdrAble {
+ public int status;
+ public byte [] keydata;
+
+ public __dbc_put_reply() {
+ }
+
+ public __dbc_put_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeDynamicOpaque(keydata);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ keydata = xdr.xdrDecodeDynamicOpaque();
+ }
+
+}
+// End of __dbc_put_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_cachesize_msg.java b/storage/bdb/rpc_server/java/gen/__env_cachesize_msg.java
new file mode 100644
index 00000000000..d1fce1ffa35
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_cachesize_msg.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_cachesize_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int gbytes;
+ public int bytes;
+ public int ncache;
+
+ public __env_cachesize_msg() {
+ }
+
+ public __env_cachesize_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(gbytes);
+ xdr.xdrEncodeInt(bytes);
+ xdr.xdrEncodeInt(ncache);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ gbytes = xdr.xdrDecodeInt();
+ bytes = xdr.xdrDecodeInt();
+ ncache = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_cachesize_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_cachesize_reply.java b/storage/bdb/rpc_server/java/gen/__env_cachesize_reply.java
new file mode 100644
index 00000000000..193f8355d71
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_cachesize_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_cachesize_reply implements XdrAble {
+ public int status;
+
+ public __env_cachesize_reply() {
+ }
+
+ public __env_cachesize_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_cachesize_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_close_msg.java b/storage/bdb/rpc_server/java/gen/__env_close_msg.java
new file mode 100644
index 00000000000..5e657bacfa5
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_close_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_close_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int flags;
+
+ public __env_close_msg() {
+ }
+
+ public __env_close_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_close_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_close_reply.java b/storage/bdb/rpc_server/java/gen/__env_close_reply.java
new file mode 100644
index 00000000000..11e61f7c8c3
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_close_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_close_reply implements XdrAble {
+ public int status;
+
+ public __env_close_reply() {
+ }
+
+ public __env_close_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_close_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_create_msg.java b/storage/bdb/rpc_server/java/gen/__env_create_msg.java
new file mode 100644
index 00000000000..dbe546ae23a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_create_msg.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_create_msg implements XdrAble {
+ public int timeout;
+
+ public __env_create_msg() {
+ }
+
+ public __env_create_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(timeout);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ timeout = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_create_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_create_reply.java b/storage/bdb/rpc_server/java/gen/__env_create_reply.java
new file mode 100644
index 00000000000..5427fc4bc1e
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_create_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_create_reply implements XdrAble {
+ public int status;
+ public int envcl_id;
+
+ public __env_create_reply() {
+ }
+
+ public __env_create_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(envcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ envcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_create_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_dbremove_msg.java b/storage/bdb/rpc_server/java/gen/__env_dbremove_msg.java
new file mode 100644
index 00000000000..9730a92c590
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_dbremove_msg.java
@@ -0,0 +1,44 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_dbremove_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int txnpcl_id;
+ public String name;
+ public String subdb;
+ public int flags;
+
+ public __env_dbremove_msg() {
+ }
+
+ public __env_dbremove_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeString(name);
+ xdr.xdrEncodeString(subdb);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ name = xdr.xdrDecodeString();
+ subdb = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_dbremove_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_dbremove_reply.java b/storage/bdb/rpc_server/java/gen/__env_dbremove_reply.java
new file mode 100644
index 00000000000..75cc5a940cc
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_dbremove_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_dbremove_reply implements XdrAble {
+ public int status;
+
+ public __env_dbremove_reply() {
+ }
+
+ public __env_dbremove_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_dbremove_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_dbrename_msg.java b/storage/bdb/rpc_server/java/gen/__env_dbrename_msg.java
new file mode 100644
index 00000000000..0bbda262b64
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_dbrename_msg.java
@@ -0,0 +1,47 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_dbrename_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int txnpcl_id;
+ public String name;
+ public String subdb;
+ public String newname;
+ public int flags;
+
+ public __env_dbrename_msg() {
+ }
+
+ public __env_dbrename_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeString(name);
+ xdr.xdrEncodeString(subdb);
+ xdr.xdrEncodeString(newname);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ txnpcl_id = xdr.xdrDecodeInt();
+ name = xdr.xdrDecodeString();
+ subdb = xdr.xdrDecodeString();
+ newname = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_dbrename_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_dbrename_reply.java b/storage/bdb/rpc_server/java/gen/__env_dbrename_reply.java
new file mode 100644
index 00000000000..0cc8882305d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_dbrename_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_dbrename_reply implements XdrAble {
+ public int status;
+
+ public __env_dbrename_reply() {
+ }
+
+ public __env_dbrename_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_dbrename_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_encrypt_msg.java b/storage/bdb/rpc_server/java/gen/__env_encrypt_msg.java
new file mode 100644
index 00000000000..84e9a36d372
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_encrypt_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 2/13/02 1:05 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_encrypt_msg implements XdrAble {
+ public int dbenvcl_id;
+ public String passwd;
+ public int flags;
+
+ public __env_encrypt_msg() {
+ }
+
+ public __env_encrypt_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeString(passwd);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ passwd = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_encrypt_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_encrypt_reply.java b/storage/bdb/rpc_server/java/gen/__env_encrypt_reply.java
new file mode 100644
index 00000000000..e202a3089d0
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_encrypt_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 2/13/02 1:05 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_encrypt_reply implements XdrAble {
+ public int status;
+
+ public __env_encrypt_reply() {
+ }
+
+ public __env_encrypt_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_encrypt_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_flags_msg.java b/storage/bdb/rpc_server/java/gen/__env_flags_msg.java
new file mode 100644
index 00000000000..25cd5f85f6d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_flags_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_flags_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int flags;
+ public int onoff;
+
+ public __env_flags_msg() {
+ }
+
+ public __env_flags_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(flags);
+ xdr.xdrEncodeInt(onoff);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ onoff = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_flags_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_flags_reply.java b/storage/bdb/rpc_server/java/gen/__env_flags_reply.java
new file mode 100644
index 00000000000..d348a9224ea
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_flags_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_flags_reply implements XdrAble {
+ public int status;
+
+ public __env_flags_reply() {
+ }
+
+ public __env_flags_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_flags_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_open_msg.java b/storage/bdb/rpc_server/java/gen/__env_open_msg.java
new file mode 100644
index 00000000000..e4649b41f9e
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_open_msg.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_open_msg implements XdrAble {
+ public int dbenvcl_id;
+ public String home;
+ public int flags;
+ public int mode;
+
+ public __env_open_msg() {
+ }
+
+ public __env_open_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeString(home);
+ xdr.xdrEncodeInt(flags);
+ xdr.xdrEncodeInt(mode);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ home = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ mode = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_open_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_open_reply.java b/storage/bdb/rpc_server/java/gen/__env_open_reply.java
new file mode 100644
index 00000000000..1994afb4cf2
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_open_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_open_reply implements XdrAble {
+ public int status;
+ public int envcl_id;
+
+ public __env_open_reply() {
+ }
+
+ public __env_open_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(envcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ envcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_open_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_remove_msg.java b/storage/bdb/rpc_server/java/gen/__env_remove_msg.java
new file mode 100644
index 00000000000..b32d758f0f5
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_remove_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_remove_msg implements XdrAble {
+ public int dbenvcl_id;
+ public String home;
+ public int flags;
+
+ public __env_remove_msg() {
+ }
+
+ public __env_remove_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeString(home);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ home = xdr.xdrDecodeString();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_remove_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__env_remove_reply.java b/storage/bdb/rpc_server/java/gen/__env_remove_reply.java
new file mode 100644
index 00000000000..19e4d52f662
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__env_remove_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __env_remove_reply implements XdrAble {
+ public int status;
+
+ public __env_remove_reply() {
+ }
+
+ public __env_remove_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __env_remove_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_abort_msg.java b/storage/bdb/rpc_server/java/gen/__txn_abort_msg.java
new file mode 100644
index 00000000000..ff44c534e46
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_abort_msg.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_abort_msg implements XdrAble {
+ public int txnpcl_id;
+
+ public __txn_abort_msg() {
+ }
+
+ public __txn_abort_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(txnpcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ txnpcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_abort_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_abort_reply.java b/storage/bdb/rpc_server/java/gen/__txn_abort_reply.java
new file mode 100644
index 00000000000..58f275c1a8f
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_abort_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_abort_reply implements XdrAble {
+ public int status;
+
+ public __txn_abort_reply() {
+ }
+
+ public __txn_abort_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_abort_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_begin_msg.java b/storage/bdb/rpc_server/java/gen/__txn_begin_msg.java
new file mode 100644
index 00000000000..877031e8d3a
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_begin_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_begin_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int parentcl_id;
+ public int flags;
+
+ public __txn_begin_msg() {
+ }
+
+ public __txn_begin_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(parentcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ parentcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_begin_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_begin_reply.java b/storage/bdb/rpc_server/java/gen/__txn_begin_reply.java
new file mode 100644
index 00000000000..65a0c4016c2
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_begin_reply.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_begin_reply implements XdrAble {
+ public int status;
+ public int txnidcl_id;
+
+ public __txn_begin_reply() {
+ }
+
+ public __txn_begin_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeInt(txnidcl_id);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ txnidcl_id = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_begin_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_commit_msg.java b/storage/bdb/rpc_server/java/gen/__txn_commit_msg.java
new file mode 100644
index 00000000000..4b988d0c282
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_commit_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_commit_msg implements XdrAble {
+ public int txnpcl_id;
+ public int flags;
+
+ public __txn_commit_msg() {
+ }
+
+ public __txn_commit_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ txnpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_commit_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_commit_reply.java b/storage/bdb/rpc_server/java/gen/__txn_commit_reply.java
new file mode 100644
index 00000000000..b26937b82dd
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_commit_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_commit_reply implements XdrAble {
+ public int status;
+
+ public __txn_commit_reply() {
+ }
+
+ public __txn_commit_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_commit_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_discard_msg.java b/storage/bdb/rpc_server/java/gen/__txn_discard_msg.java
new file mode 100644
index 00000000000..87f5d4f77a7
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_discard_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_discard_msg implements XdrAble {
+ public int txnpcl_id;
+ public int flags;
+
+ public __txn_discard_msg() {
+ }
+
+ public __txn_discard_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ txnpcl_id = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_discard_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_discard_reply.java b/storage/bdb/rpc_server/java/gen/__txn_discard_reply.java
new file mode 100644
index 00000000000..9792211afcc
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_discard_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_discard_reply implements XdrAble {
+ public int status;
+
+ public __txn_discard_reply() {
+ }
+
+ public __txn_discard_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_discard_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_prepare_msg.java b/storage/bdb/rpc_server/java/gen/__txn_prepare_msg.java
new file mode 100644
index 00000000000..6e09f2c7771
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_prepare_msg.java
@@ -0,0 +1,35 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_prepare_msg implements XdrAble {
+ public int txnpcl_id;
+ public byte [] gid;
+
+ public __txn_prepare_msg() {
+ }
+
+ public __txn_prepare_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(txnpcl_id);
+ xdr.xdrEncodeOpaque(gid, 128);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ txnpcl_id = xdr.xdrDecodeInt();
+ gid = xdr.xdrDecodeOpaque(128);
+ }
+
+}
+// End of __txn_prepare_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_prepare_reply.java b/storage/bdb/rpc_server/java/gen/__txn_prepare_reply.java
new file mode 100644
index 00000000000..d7590117952
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_prepare_reply.java
@@ -0,0 +1,32 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_prepare_reply implements XdrAble {
+ public int status;
+
+ public __txn_prepare_reply() {
+ }
+
+ public __txn_prepare_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_prepare_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_recover_msg.java b/storage/bdb/rpc_server/java/gen/__txn_recover_msg.java
new file mode 100644
index 00000000000..65153334403
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_recover_msg.java
@@ -0,0 +1,38 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_recover_msg implements XdrAble {
+ public int dbenvcl_id;
+ public int count;
+ public int flags;
+
+ public __txn_recover_msg() {
+ }
+
+ public __txn_recover_msg(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(dbenvcl_id);
+ xdr.xdrEncodeInt(count);
+ xdr.xdrEncodeInt(flags);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ dbenvcl_id = xdr.xdrDecodeInt();
+ count = xdr.xdrDecodeInt();
+ flags = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_recover_msg.java
diff --git a/storage/bdb/rpc_server/java/gen/__txn_recover_reply.java b/storage/bdb/rpc_server/java/gen/__txn_recover_reply.java
new file mode 100644
index 00000000000..0161ec949da
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/__txn_recover_reply.java
@@ -0,0 +1,41 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 12/18/01 7:23 PM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+public class __txn_recover_reply implements XdrAble {
+ public int status;
+ public int [] txn;
+ public byte [] gid;
+ public int retcount;
+
+ public __txn_recover_reply() {
+ }
+
+ public __txn_recover_reply(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ xdrDecode(xdr);
+ }
+
+ public void xdrEncode(XdrEncodingStream xdr)
+ throws OncRpcException, IOException {
+ xdr.xdrEncodeInt(status);
+ xdr.xdrEncodeIntVector(txn);
+ xdr.xdrEncodeDynamicOpaque(gid);
+ xdr.xdrEncodeInt(retcount);
+ }
+
+ public void xdrDecode(XdrDecodingStream xdr)
+ throws OncRpcException, IOException {
+ status = xdr.xdrDecodeInt();
+ txn = xdr.xdrDecodeIntVector();
+ gid = xdr.xdrDecodeDynamicOpaque();
+ retcount = xdr.xdrDecodeInt();
+ }
+
+}
+// End of __txn_recover_reply.java
diff --git a/storage/bdb/rpc_server/java/gen/db_server.java b/storage/bdb/rpc_server/java/gen/db_server.java
new file mode 100644
index 00000000000..a14a77028a2
--- /dev/null
+++ b/storage/bdb/rpc_server/java/gen/db_server.java
@@ -0,0 +1,67 @@
+/*
+ * Automatically generated by jrpcgen 0.95.1 on 3/19/02 10:30 AM
+ * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
+ * See http://acplt.org/ks/remotetea.html for details
+ */
+package com.sleepycat.db.rpcserver;
+import org.acplt.oncrpc.*;
+import java.io.IOException;
+
+/**
+ * A collection of constants used by the "db_server" ONC/RPC program.
+ */
+public interface db_server {
+ public static final int __DB_db_close_4001 = 19;
+ public static final int __DB_db_flags_4001 = 24;
+ public static final int __DB_dbc_dup_4001 = 47;
+ public static final int __DB_db_encrypt_4001 = 22;
+ public static final int __DB_env_dbrename_4001 = 5;
+ public static final int __DB_env_remove_4001 = 9;
+ public static final int __DB_dbc_pget_4001 = 49;
+ public static final int __DB_env_cachesize_4001 = 1;
+ public static final int __DB_db_lorder_4001 = 29;
+ public static final int __DB_db_key_range_4001 = 28;
+ public static final int __DB_db_bt_minkey_4001 = 18;
+ public static final int __DB_db_sync_4001 = 40;
+ public static final int __DB_dbc_close_4001 = 44;
+ public static final int __DB_db_join_4001 = 43;
+ public static final int __DB_db_pagesize_4001 = 31;
+ public static final int DB_RPC_SERVERVERS = 4001;
+ public static final int __DB_db_open_4001 = 30;
+ public static final int __DB_dbc_get_4001 = 48;
+ public static final int __DB_db_cursor_4001 = 42;
+ public static final int __DB_txn_commit_4001 = 12;
+ public static final int __DB_dbc_del_4001 = 46;
+ public static final int __DB_env_create_4001 = 3;
+ public static final int __DB_env_open_4001 = 8;
+ public static final int __DB_txn_prepare_4001 = 14;
+ public static final int __DB_db_pget_4001 = 32;
+ public static final int __DB_db_stat_4001 = 39;
+ public static final int __DB_db_h_nelem_4001 = 27;
+ public static final int __DB_db_remove_4001 = 37;
+ public static final int __DB_db_re_delim_4001 = 34;
+ public static final int __DB_db_re_pad_4001 = 36;
+ public static final int __DB_txn_abort_4001 = 10;
+ public static final int __DB_txn_recover_4001 = 15;
+ public static final int __DB_db_get_4001 = 25;
+ public static final int __DB_db_extentsize_4001 = 23;
+ public static final int DB_RPC_SERVERPROG = 351457;
+ public static final int __DB_dbc_put_4001 = 50;
+ public static final int __DB_db_truncate_4001 = 41;
+ public static final int __DB_db_del_4001 = 21;
+ public static final int __DB_db_bt_maxkey_4001 = 17;
+ public static final int __DB_env_dbremove_4001 = 4;
+ public static final int __DB_txn_discard_4001 = 13;
+ public static final int __DB_db_re_len_4001 = 35;
+ public static final int __DB_env_close_4001 = 2;
+ public static final int __DB_env_flags_4001 = 7;
+ public static final int __DB_db_rename_4001 = 38;
+ public static final int __DB_db_associate_4001 = 16;
+ public static final int __DB_txn_begin_4001 = 11;
+ public static final int __DB_env_encrypt_4001 = 6;
+ public static final int __DB_db_h_ffactor_4001 = 26;
+ public static final int __DB_db_put_4001 = 33;
+ public static final int __DB_db_create_4001 = 20;
+ public static final int __DB_dbc_count_4001 = 45;
+}
+// End of db_server.java
diff --git a/storage/bdb/rpc_server/java/jrpcgen.jar b/storage/bdb/rpc_server/java/jrpcgen.jar
new file mode 100644
index 00000000000..338825b848d
--- /dev/null
+++ b/storage/bdb/rpc_server/java/jrpcgen.jar
Binary files differ
diff --git a/storage/bdb/rpc_server/java/oncrpc.jar b/storage/bdb/rpc_server/java/oncrpc.jar
new file mode 100644
index 00000000000..e0f5cfa6966
--- /dev/null
+++ b/storage/bdb/rpc_server/java/oncrpc.jar
Binary files differ
diff --git a/storage/bdb/rpc_server/java/s_jrpcgen b/storage/bdb/rpc_server/java/s_jrpcgen
new file mode 100644
index 00000000000..fed8cbf56bb
--- /dev/null
+++ b/storage/bdb/rpc_server/java/s_jrpcgen
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+java -jar jrpcgen.jar -d gen -noclient -nobackup -p com.sleepycat.db.rpcserver -s DbServerStub ../db_server.x
diff --git a/storage/bdb/rpc_server/rpc.src b/storage/bdb/rpc_server/rpc.src
new file mode 100644
index 00000000000..7afee49b066
--- /dev/null
+++ b/storage/bdb/rpc_server/rpc.src
@@ -0,0 +1,718 @@
+# See the file LICENSE for redistribution information.
+#
+# Copyright (c) 1999-2002
+# Sleepycat Software. All rights reserved.
+#
+# $Id: rpc.src,v 1.75 2002/07/18 02:57:19 margo Exp $
+#
+# Syntax:
+# BEGIN function_name {CODE | RETCODE | NOFUNC}
+# CODE: generate XDR and client code, return status
+# Used for functions that just return a status and nothing else.
+# RETCODE:generate XDR and client code, call return function
+# (generate template return function)
+# Used for functions that returns data.
+# NOFUNC: generate a client "unsupported function" with right args
+# Used for unsupported functions.
+#
+# ARG {IGNORE | STRING | INT | DBT | LIST | ID | CONST} C-type varname
+# IGNORE: not passed to server
+# STRING: string passed to server
+# DBT: DBT arg passed to server
+# LIST: list passed to server (NULL-terminated list of something)
+# INT: integer passed to server
+# ID: cl_id from arg passed to server
+# GID: global id passed to server
+# CONST: do not generate COMPQUIET (for NOFUNC only)
+# FUNCPROT prototype
+# FUNCARG functiontype
+# These two *MUST* go together and FUNCPROT *MUST* be first. These
+# are for the tricky user-supplied functions to some methods. They
+# are not supported in RPC, so will be ignored, but the complicated
+# syntax of their argument requires we have a special flag for them
+# that contains the verbatim text to use in the prototype and the
+# c-type, respectively. The FUNCARG must include the function, and
+# must call it 'funcN', where N is the count of functions. Almost
+# always it must be func0. A *very* few methods have more than one
+# user-supplied functions, in those cases, it must be func0, func1, etc.
+#
+# All messages automatically return "status" and return that from
+# the call to the function. RET's are additional things the server
+# may return. RET is like ARG but does not need the IGNORE option.
+# RET {STRING | INT | DBT | LIST | ID} varname [GID | INT | ID]
+# STRING: string from server
+# DBT: DBT arg from server
+# LIST: list from server (NULL-terminated list)
+# Must have list type of GID, ID or INT specified
+# INT: integer from server
+# ID: id from server stored in cl_id
+# END function end.
+
+#
+# Environment functions
+#
+BEGIN env_alloc NOFUNC
+ARG ID DB_ENV * dbenv
+FUNCPROT void *(*)(size_t)
+FUNCARG void *(*func0) __P((size_t))
+FUNCPROT void *(*)(void *, size_t)
+FUNCARG void *(*func1) __P((void *, size_t))
+FUNCPROT void (*)(void *)
+FUNCARG void (*func2) __P((void *))
+END
+BEGIN set_app_dispatch NOFUNC
+ARG ID DB_ENV * dbenv
+FUNCPROT int (*)(DB_ENV *, DBT *, DB_LSN *, db_recops)
+FUNCARG int (*func0) __P((DB_ENV *, DBT *, DB_LSN *, db_recops))
+END
+BEGIN env_cachesize CODE
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t gbytes
+ARG INT u_int32_t bytes
+ARG INT int ncache
+END
+BEGIN env_close RETCODE
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t flags
+END
+BEGIN env_create RETCODE
+ARG IGNORE DB_ENV * dbenv
+ARG INT long timeout
+RET ID long env
+END
+BEGIN set_data_dir NOFUNC
+ARG ID DB_ENV * dbenv
+ARG STRING const char * dir
+END
+BEGIN env_dbremove CODE
+ARG ID DB_ENV * dbenv
+ARG ID DB_TXN * txnp
+ARG STRING const char * name
+ARG STRING const char * subdb
+ARG INT u_int32_t flags
+END
+BEGIN env_dbrename CODE
+ARG ID DB_ENV * dbenv
+ARG ID DB_TXN * txnp
+ARG STRING const char * name
+ARG STRING const char * subdb
+ARG STRING const char * newname
+ARG INT u_int32_t flags
+END
+BEGIN env_encrypt CODE
+ARG ID DB_ENV * dbenv
+ARG STRING const char * passwd
+ARG INT u_int32_t flags
+END
+BEGIN env_set_feedback NOFUNC
+ARG ID DB_ENV * dbenv
+FUNCPROT void (*)(DB_ENV *, int, int)
+FUNCARG void (*func0) __P((DB_ENV *, int, int))
+END
+BEGIN env_flags CODE
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t flags
+ARG INT int onoff
+END
+BEGIN set_lg_bsize NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t bsize
+END
+BEGIN set_lg_dir NOFUNC
+ARG ID DB_ENV * dbenv
+ARG STRING const char * dir
+END
+BEGIN set_lg_max NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_lg_regionmax NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_lk_conflict NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int8_t * conflicts
+ARG INT int modes
+END
+BEGIN set_lk_detect NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t detect
+END
+BEGIN set_lk_max NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_lk_max_locks NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_lk_max_lockers NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_lk_max_objects NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_mp_mmapsize NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT size_t mmapsize
+END
+BEGIN env_open RETCODE
+ARG ID DB_ENV * dbenv
+ARG STRING const char * home
+ARG INT u_int32_t flags
+ARG INT int mode
+RET ID long env
+END
+BEGIN env_paniccall NOFUNC
+ARG ID DB_ENV * dbenv
+FUNCPROT void (*)(DB_ENV *, int)
+FUNCARG void (*func0) __P((DB_ENV *, int))
+END
+BEGIN env_remove RETCODE
+ARG ID DB_ENV * dbenv
+ARG STRING const char * home
+ARG INT u_int32_t flags
+END
+BEGIN set_shm_key NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT long shm_key
+END
+BEGIN set_tas_spins NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t tas_spins
+END
+BEGIN set_timeout NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t timeout
+ARG INT u_int32_t flags
+END
+BEGIN set_tmp_dir NOFUNC
+ARG ID DB_ENV * dbenv
+ARG STRING const char * dir
+END
+BEGIN set_tx_max NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t max
+END
+BEGIN set_tx_timestamp NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT time_t * max
+END
+BEGIN set_verbose NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t which
+ARG INT int onoff
+END
+#
+# Transaction functions
+#
+BEGIN txn_abort RETCODE
+ARG ID DB_TXN * txnp
+END
+BEGIN txn_begin RETCODE
+ARG ID DB_ENV * dbenv
+ARG ID DB_TXN * parent
+ARG IGNORE DB_TXN ** txnpp
+ARG INT u_int32_t flags
+RET ID long txnid
+END
+BEGIN txn_checkpoint NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t kbyte
+ARG INT u_int32_t min
+ARG INT u_int32_t flags
+END
+BEGIN txn_commit RETCODE
+ARG ID DB_TXN * txnp
+ARG INT u_int32_t flags
+END
+BEGIN txn_discard RETCODE
+ARG ID DB_TXN * txnp
+ARG INT u_int32_t flags
+END
+BEGIN txn_prepare CODE
+ARG ID DB_TXN * txnp
+ARG GID u_int8_t * gid
+END
+BEGIN txn_recover RETCODE
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_PREPLIST * preplist
+ARG INT long count
+ARG IGNORE long * retp
+ARG INT u_int32_t flags
+RET LIST DB_TXN * txn ID
+RET LIST u_int8_t * gid GID
+RET INT long retcount
+END
+BEGIN txn_stat NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_TXN_STAT ** statp
+ARG INT u_int32_t flags
+END
+BEGIN txn_timeout NOFUNC
+ARG ID DB_TXN * txnp
+ARG INT u_int32_t timeout
+ARG INT u_int32_t flags
+END
+#
+# Replication functions
+#
+BEGIN rep_elect NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT int nsites
+ARG INT int pri
+ARG INT u_int32_t timeout
+ARG IGNORE int * idp
+END
+BEGIN rep_flush NOFUNC
+ARG ID DB_ENV * dbenv
+END
+BEGIN rep_process_message NOFUNC
+ARG ID DB_ENV * dbenv
+ARG DBT DBT * rec
+ARG DBT DBT * control
+ARG IGNORE int * idp
+END
+BEGIN rep_set_limit NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t mbytes
+ARG INT u_int32_t bytes
+END
+BEGIN rep_set_request NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t min
+ARG INT u_int32_t max
+END
+BEGIN rep_set_rep_transport NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT int id
+FUNCPROT int (*)(DB_ENV *, const DBT *, const DBT *, int, u_int32_t)
+FUNCARG int (*func0) __P((DB_ENV *, const DBT *, const DBT *, int, u_int32_t))
+END
+BEGIN rep_start NOFUNC
+ARG ID DB_ENV * dbenv
+ARG DBT DBT * cdata
+ARG INT u_int32_t flags
+END
+BEGIN rep_stat NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_REP_STAT ** statp
+ARG INT u_int32_t flags
+END
+
+#
+# Database functions
+#
+BEGIN db_alloc NOFUNC
+ARG ID DB * dbp
+FUNCPROT void *(*)(size_t)
+FUNCARG void *(*func0) __P((size_t))
+FUNCPROT void *(*)(void *, size_t)
+FUNCARG void *(*func1) __P((void *, size_t))
+FUNCPROT void (*)(void *)
+FUNCARG void (*func2) __P((void *))
+END
+BEGIN db_associate CODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG ID DB * sdbp
+FUNCPROT int (*)(DB *, const DBT *, const DBT *, DBT *)
+FUNCARG int (*func0) __P((DB *, const DBT *, const DBT *, DBT *))
+ARG INT u_int32_t flags
+END
+BEGIN db_bt_compare NOFUNC
+ARG ID DB * dbp
+FUNCPROT int (*)(DB *, const DBT *, const DBT *)
+FUNCARG int (*func0) __P((DB *, const DBT *, const DBT *))
+END
+BEGIN db_bt_maxkey CODE
+ARG ID DB * dbp
+ARG INT u_int32_t maxkey
+END
+BEGIN db_bt_minkey CODE
+ARG ID DB * dbp
+ARG INT u_int32_t minkey
+END
+BEGIN db_bt_prefix NOFUNC
+ARG ID DB * dbp
+FUNCPROT size_t(*)(DB *, const DBT *, const DBT *)
+FUNCARG size_t (*func0) __P((DB *, const DBT *, const DBT *))
+END
+BEGIN db_set_append_recno NOFUNC
+ARG ID DB * dbp
+FUNCPROT int (*)(DB *, DBT *, db_recno_t)
+FUNCARG int (*func0) __P((DB *, DBT *, db_recno_t))
+END
+BEGIN db_cache_priority NOFUNC
+ARG ID DB * dbp
+ARG INT DB_CACHE_PRIORITY priority
+END
+BEGIN db_cachesize NOFUNC
+ARG ID DB * dbp
+ARG INT u_int32_t gbytes
+ARG INT u_int32_t bytes
+ARG INT int ncache
+END
+BEGIN db_close RETCODE
+ARG ID DB * dbp
+ARG INT u_int32_t flags
+END
+BEGIN db_create RETCODE
+ARG IGNORE DB * dbp
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t flags
+RET ID long db
+END
+BEGIN db_del CODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG DBT DBT * key
+ARG INT u_int32_t flags
+END
+BEGIN db_dup_compare NOFUNC
+ARG ID DB * dbp
+FUNCPROT int (*)(DB *, const DBT *, const DBT *)
+FUNCARG int (*func0) __P((DB *, const DBT *, const DBT *))
+END
+BEGIN db_encrypt CODE
+ARG ID DB * dbp
+ARG STRING const char * passwd
+ARG INT u_int32_t flags
+END
+BEGIN db_extentsize CODE
+ARG ID DB * dbp
+ARG INT u_int32_t extentsize
+END
+BEGIN db_fd NOFUNC
+ARG ID DB * dbp
+ARG IGNORE int * fdp
+END
+BEGIN db_feedback NOFUNC
+ARG ID DB * dbp
+FUNCPROT void (*)(DB *, int, int)
+FUNCARG void (*func0) __P((DB *, int, int))
+END
+BEGIN db_flags CODE
+ARG ID DB * dbp
+ARG INT u_int32_t flags
+END
+BEGIN db_get RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG DBT DBT * key
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * key
+RET DBT DBT * data
+END
+BEGIN db_h_ffactor CODE
+ARG ID DB * dbp
+ARG INT u_int32_t ffactor
+END
+BEGIN db_h_hash NOFUNC
+ARG ID DB * dbp
+FUNCPROT u_int32_t(*)(DB *, const void *, u_int32_t)
+FUNCARG u_int32_t (*func0) __P((DB *, const void *, u_int32_t))
+END
+BEGIN db_h_nelem CODE
+ARG ID DB * dbp
+ARG INT u_int32_t nelem
+END
+BEGIN db_key_range RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG DBT DBT * key
+ARG IGNORE DB_KEY_RANGE * range
+ARG INT u_int32_t flags
+RET DBL double less
+RET DBL double equal
+RET DBL double greater
+END
+BEGIN db_lorder CODE
+ARG ID DB * dbp
+ARG INT int lorder
+END
+# XXX
+# The line:
+# RET INT u_int32_t dbflags
+# should go away when a get_flags method exists. It is
+# needed now because Tcl looks at dbp->flags.
+#
+BEGIN db_open RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG STRING const char * name
+ARG STRING const char * subdb
+ARG INT DBTYPE type
+ARG INT u_int32_t flags
+ARG INT int mode
+RET ID long db
+RET INT DBTYPE type
+RET INT u_int32_t dbflags
+RET INT int lorder
+END
+BEGIN db_pagesize CODE
+ARG ID DB * dbp
+ARG INT u_int32_t pagesize
+END
+BEGIN db_panic NOFUNC
+ARG ID DB * dbp
+FUNCPROT void (*)(DB_ENV *, int)
+FUNCARG void (*func0) __P((DB_ENV *, int))
+END
+BEGIN db_pget RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG DBT DBT * skey
+ARG DBT DBT * pkey
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * skey
+RET DBT DBT * pkey
+RET DBT DBT * data
+END
+BEGIN db_put RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG DBT DBT * key
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * key
+END
+BEGIN db_re_delim CODE
+ARG ID DB * dbp
+ARG INT int delim
+END
+BEGIN db_re_len CODE
+ARG ID DB * dbp
+ARG INT u_int32_t len
+END
+BEGIN db_re_pad CODE
+ARG ID DB * dbp
+ARG INT int pad
+END
+BEGIN db_re_source NOFUNC
+ARG ID DB * dbp
+ARG STRING const char * re_source
+END
+BEGIN db_remove RETCODE
+ARG ID DB * dbp
+ARG STRING const char * name
+ARG STRING const char * subdb
+ARG INT u_int32_t flags
+END
+BEGIN db_rename RETCODE
+ARG ID DB * dbp
+ARG STRING const char * name
+ARG STRING const char * subdb
+ARG STRING const char * newname
+ARG INT u_int32_t flags
+END
+BEGIN db_stat RETCODE
+ARG ID DB * dbp
+ARG IGNORE void * sp
+ARG INT u_int32_t flags
+RET LIST u_int32_t * stats INT
+END
+BEGIN db_sync CODE
+ARG ID DB * dbp
+ARG INT u_int32_t flags
+END
+BEGIN db_truncate RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG IGNORE u_int32_t * countp
+ARG INT u_int32_t flags
+RET INT u_int32_t count
+END
+BEGIN db_upgrade NOFUNC
+ARG ID DB * dbp
+ARG STRING const char * fname
+ARG INT u_int32_t flags
+END
+BEGIN db_verify NOFUNC
+ARG ID DB * dbp
+ARG STRING const char * fname
+ARG STRING const char * subdb
+ARG IGNORE FILE * outfile
+ARG INT u_int32_t flags
+END
+#
+# Cursor functions
+#
+BEGIN db_cursor RETCODE
+ARG ID DB * dbp
+ARG ID DB_TXN * txnp
+ARG IGNORE DBC ** dbcpp
+ARG INT u_int32_t flags
+RET ID long dbcid
+END
+BEGIN db_join RETCODE
+ARG ID DB * dbp
+ARG LIST DBC ** curs ID
+ARG IGNORE DBC ** dbcp
+ARG INT u_int32_t flags
+RET ID long dbcid
+END
+BEGIN dbc_close RETCODE
+ARG ID DBC * dbc
+END
+BEGIN dbc_count RETCODE
+ARG ID DBC * dbc
+ARG IGNORE db_recno_t * countp
+ARG INT u_int32_t flags
+RET INT db_recno_t dupcount
+END
+BEGIN dbc_del CODE
+ARG ID DBC * dbc
+ARG INT u_int32_t flags
+END
+BEGIN dbc_dup RETCODE
+ARG ID DBC * dbc
+ARG IGNORE DBC ** dbcp
+ARG INT u_int32_t flags
+RET ID long dbcid
+END
+BEGIN dbc_get RETCODE
+ARG ID DBC * dbc
+ARG DBT DBT * key
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * key
+RET DBT DBT * data
+END
+BEGIN dbc_pget RETCODE
+ARG ID DBC * dbc
+ARG DBT DBT * skey
+ARG DBT DBT * pkey
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * skey
+RET DBT DBT * pkey
+RET DBT DBT * data
+END
+BEGIN dbc_put RETCODE
+ARG ID DBC * dbc
+ARG DBT DBT * key
+ARG DBT DBT * data
+ARG INT u_int32_t flags
+RET DBT DBT * key
+END
+
+#
+# Unsupported environment subsystems
+#
+#
+# Locking subsystem
+#
+BEGIN lock_detect NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t flags
+ARG INT u_int32_t atype
+ARG IGNORE int * aborted
+END
+BEGIN lock_get NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t locker
+ARG INT u_int32_t flags
+ARG CONST const DBT * obj
+ARG INT db_lockmode_t mode
+ARG IGNORE DB_LOCK * lock
+END
+BEGIN lock_id NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t * idp
+END
+BEGIN lock_id_free NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t id
+END
+BEGIN lock_put NOFUNC
+ARG ID DB_ENV * dbenv
+ARG ID DB_LOCK * lock
+END
+BEGIN lock_stat NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_LOCK_STAT ** statp
+ARG INT u_int32_t flags
+END
+BEGIN lock_vec NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT u_int32_t locker
+ARG INT u_int32_t flags
+ARG IGNORE DB_LOCKREQ * list
+ARG INT int nlist
+ARG IGNORE DB_LOCKREQ ** elistp
+END
+#
+# Logging subsystem
+#
+BEGIN log_archive NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE char *** listp
+ARG INT u_int32_t flags
+END
+BEGIN log_cursor NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_LOGC ** logcp
+ARG INT u_int32_t flags
+END
+#
+# Don't do log_compare. It doesn't have an env we can get at,
+# and it doesn't manipulate DB internal information.
+#
+BEGIN log_file NOFUNC
+ARG ID DB_ENV * dbenv
+ARG CONST const DB_LSN * lsn
+ARG STRING char * namep
+ARG INT size_t len
+END
+BEGIN log_flush NOFUNC
+ARG ID DB_ENV * dbenv
+ARG CONST const DB_LSN * lsn
+END
+BEGIN log_put NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_LSN * lsn
+ARG DBT const DBT * data
+ARG INT u_int32_t flags
+END
+BEGIN log_stat NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_LOG_STAT ** statp
+ARG INT u_int32_t flags
+END
+#
+# Mpool Subsystem
+#
+BEGIN memp_fcreate NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_MPOOLFILE ** mpf
+ARG IGNORE u_int32_t flags
+END
+BEGIN memp_register NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT int ftype
+FUNCPROT int (*)(DB_ENV *, db_pgno_t, void *, DBT *)
+FUNCARG int (*func0) __P((DB_ENV *, db_pgno_t, void *, DBT *))
+FUNCPROT int (*)(DB_ENV *, db_pgno_t, void *, DBT *)
+FUNCARG int (*func1) __P((DB_ENV *, db_pgno_t, void *, DBT *))
+END
+BEGIN memp_stat NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_MPOOL_STAT ** gstatp
+ARG IGNORE DB_MPOOL_FSTAT *** fstatp
+ARG INT u_int32_t flags
+END
+BEGIN memp_sync NOFUNC
+ARG ID DB_ENV * dbenv
+ARG IGNORE DB_LSN * lsn
+END
+BEGIN memp_trickle NOFUNC
+ARG ID DB_ENV * dbenv
+ARG INT int pct
+ARG IGNORE int * nwrotep
+END