/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include "db_server.h"
#include <stdio.h>
#include <stdlib.h> /* getenv, exit */
#include <memory.h>
#include <sys/socket.h>
#include <netinet/in.h>
extern void __dbsrv_timeout();

#ifdef DEBUG
#define	RPC_SVC_FG
#endif

static void
db_serverprog_1(rqstp, transp)
	struct svc_req *rqstp;
	register SVCXPRT *transp;
{
	union {
		__envcachesize_msg __db_envcachesize_1_arg;
		__envclose_msg __db_envclose_1_arg;
		__envcreate_msg __db_envcreate_1_arg;
		__envopen_msg __db_envopen_1_arg;
		__envremove_msg __db_envremove_1_arg;
		__txnabort_msg __db_txnabort_1_arg;
		__txnbegin_msg __db_txnbegin_1_arg;
		__txncommit_msg __db_txncommit_1_arg;
		__dbbtmaxkey_msg __db_dbbtmaxkey_1_arg;
		__dbbtminkey_msg __db_dbbtminkey_1_arg;
		__dbclose_msg __db_dbclose_1_arg;
		__dbcreate_msg __db_dbcreate_1_arg;
		__dbdel_msg __db_dbdel_1_arg;
		__dbflags_msg __db_dbflags_1_arg;
		__dbget_msg __db_dbget_1_arg;
		__dbhffactor_msg __db_dbhffactor_1_arg;
		__dbhnelem_msg __db_dbhnelem_1_arg;
		__dblorder_msg __db_dblorder_1_arg;
		__dbopen_msg __db_dbopen_1_arg;
		__dbpagesize_msg __db_dbpagesize_1_arg;
		__dbput_msg __db_dbput_1_arg;
		__dbredelim_msg __db_dbredelim_1_arg;
		__dbrelen_msg __db_dbrelen_1_arg;
		__dbrepad_msg __db_dbrepad_1_arg;
		__dbremove_msg __db_dbremove_1_arg;
		__dbstat_msg __db_dbstat_1_arg;
		__dbswapped_msg __db_dbswapped_1_arg;
		__dbsync_msg __db_dbsync_1_arg;
		__dbcursor_msg __db_dbcursor_1_arg;
		__dbjoin_msg __db_dbjoin_1_arg;
		__dbc_close_msg __db_dbc_close_1_arg;
		__dbc_count_msg __db_dbc_count_1_arg;
		__dbc_del_msg __db_dbc_del_1_arg;
		__dbc_dup_msg __db_dbc_dup_1_arg;
		__dbc_get_msg __db_dbc_get_1_arg;
		__dbc_put_msg __db_dbc_put_1_arg;
	} argument;
	char *result;
	bool_t (*xdr_argument)(), (*xdr_result)();
	char *(*local)();

	switch (rqstp->rq_proc) {
	case NULLPROC:
		(void) svc_sendreply(transp, xdr_void,
			(char *)NULL);
		return;

	case __DB_envcachesize:
		xdr_argument = xdr___envcachesize_msg;
		xdr_result = xdr___envcachesize_reply;
		local = (char *(*)()) __db_envcachesize_1;
		break;

	case __DB_envclose:
		xdr_argument = xdr___envclose_msg;
		xdr_result = xdr___envclose_reply;
		local = (char *(*)()) __db_envclose_1;
		break;

	case __DB_envcreate:
		xdr_argument = xdr___envcreate_msg;
		xdr_result = xdr___envcreate_reply;
		local = (char *(*)()) __db_envcreate_1;
		break;

	case __DB_envopen:
		xdr_argument = xdr___envopen_msg;
		xdr_result = xdr___envopen_reply;
		local = (char *(*)()) __db_envopen_1;
		break;

	case __DB_envremove:
		xdr_argument = xdr___envremove_msg;
		xdr_result = xdr___envremove_reply;
		local = (char *(*)()) __db_envremove_1;
		break;

	case __DB_txnabort:
		xdr_argument = xdr___txnabort_msg;
		xdr_result = xdr___txnabort_reply;
		local = (char *(*)()) __db_txnabort_1;
		break;

	case __DB_txnbegin:
		xdr_argument = xdr___txnbegin_msg;
		xdr_result = xdr___txnbegin_reply;
		local = (char *(*)()) __db_txnbegin_1;
		break;

	case __DB_txncommit:
		xdr_argument = xdr___txncommit_msg;
		xdr_result = xdr___txncommit_reply;
		local = (char *(*)()) __db_txncommit_1;
		break;

	case __DB_dbbtmaxkey:
		xdr_argument = xdr___dbbtmaxkey_msg;
		xdr_result = xdr___dbbtmaxkey_reply;
		local = (char *(*)()) __db_dbbtmaxkey_1;
		break;

	case __DB_dbbtminkey:
		xdr_argument = xdr___dbbtminkey_msg;
		xdr_result = xdr___dbbtminkey_reply;
		local = (char *(*)()) __db_dbbtminkey_1;
		break;

	case __DB_dbclose:
		xdr_argument = xdr___dbclose_msg;
		xdr_result = xdr___dbclose_reply;
		local = (char *(*)()) __db_dbclose_1;
		break;

	case __DB_dbcreate:
		xdr_argument = xdr___dbcreate_msg;
		xdr_result = xdr___dbcreate_reply;
		local = (char *(*)()) __db_dbcreate_1;
		break;

	case __DB_dbdel:
		xdr_argument = xdr___dbdel_msg;
		xdr_result = xdr___dbdel_reply;
		local = (char *(*)()) __db_dbdel_1;
		break;

	case __DB_dbflags:
		xdr_argument = xdr___dbflags_msg;
		xdr_result = xdr___dbflags_reply;
		local = (char *(*)()) __db_dbflags_1;
		break;

	case __DB_dbget:
		xdr_argument = xdr___dbget_msg;
		xdr_result = xdr___dbget_reply;
		local = (char *(*)()) __db_dbget_1;
		break;

	case __DB_dbhffactor:
		xdr_argument = xdr___dbhffactor_msg;
		xdr_result = xdr___dbhffactor_reply;
		local = (char *(*)()) __db_dbhffactor_1;
		break;

	case __DB_dbhnelem:
		xdr_argument = xdr___dbhnelem_msg;
		xdr_result = xdr___dbhnelem_reply;
		local = (char *(*)()) __db_dbhnelem_1;
		break;

	case __DB_dblorder:
		xdr_argument = xdr___dblorder_msg;
		xdr_result = xdr___dblorder_reply;
		local = (char *(*)()) __db_dblorder_1;
		break;

	case __DB_dbopen:
		xdr_argument = xdr___dbopen_msg;
		xdr_result = xdr___dbopen_reply;
		local = (char *(*)()) __db_dbopen_1;
		break;

	case __DB_dbpagesize:
		xdr_argument = xdr___dbpagesize_msg;
		xdr_result = xdr___dbpagesize_reply;
		local = (char *(*)()) __db_dbpagesize_1;
		break;

	case __DB_dbput:
		xdr_argument = xdr___dbput_msg;
		xdr_result = xdr___dbput_reply;
		local = (char *(*)()) __db_dbput_1;
		break;

	case __DB_dbredelim:
		xdr_argument = xdr___dbredelim_msg;
		xdr_result = xdr___dbredelim_reply;
		local = (char *(*)()) __db_dbredelim_1;
		break;

	case __DB_dbrelen:
		xdr_argument = xdr___dbrelen_msg;
		xdr_result = xdr___dbrelen_reply;
		local = (char *(*)()) __db_dbrelen_1;
		break;

	case __DB_dbrepad:
		xdr_argument = xdr___dbrepad_msg;
		xdr_result = xdr___dbrepad_reply;
		local = (char *(*)()) __db_dbrepad_1;
		break;

	case __DB_dbremove:
		xdr_argument = xdr___dbremove_msg;
		xdr_result = xdr___dbremove_reply;
		local = (char *(*)()) __db_dbremove_1;
		break;

	case __DB_dbstat:
		xdr_argument = xdr___dbstat_msg;
		xdr_result = xdr___dbstat_reply;
		local = (char *(*)()) __db_dbstat_1;
		break;

	case __DB_dbswapped:
		xdr_argument = xdr___dbswapped_msg;
		xdr_result = xdr___dbswapped_reply;
		local = (char *(*)()) __db_dbswapped_1;
		break;

	case __DB_dbsync:
		xdr_argument = xdr___dbsync_msg;
		xdr_result = xdr___dbsync_reply;
		local = (char *(*)()) __db_dbsync_1;
		break;

	case __DB_dbcursor:
		xdr_argument = xdr___dbcursor_msg;
		xdr_result = xdr___dbcursor_reply;
		local = (char *(*)()) __db_dbcursor_1;
		break;

	case __DB_dbjoin:
		xdr_argument = xdr___dbjoin_msg;
		xdr_result = xdr___dbjoin_reply;
		local = (char *(*)()) __db_dbjoin_1;
		break;

	case __DB_dbc_close:
		xdr_argument = xdr___dbc_close_msg;
		xdr_result = xdr___dbc_close_reply;
		local = (char *(*)()) __db_dbc_close_1;
		break;

	case __DB_dbc_count:
		xdr_argument = xdr___dbc_count_msg;
		xdr_result = xdr___dbc_count_reply;
		local = (char *(*)()) __db_dbc_count_1;
		break;

	case __DB_dbc_del:
		xdr_argument = xdr___dbc_del_msg;
		xdr_result = xdr___dbc_del_reply;
		local = (char *(*)()) __db_dbc_del_1;
		break;

	case __DB_dbc_dup:
		xdr_argument = xdr___dbc_dup_msg;
		xdr_result = xdr___dbc_dup_reply;
		local = (char *(*)()) __db_dbc_dup_1;
		break;

	case __DB_dbc_get:
		xdr_argument = xdr___dbc_get_msg;
		xdr_result = xdr___dbc_get_reply;
		local = (char *(*)()) __db_dbc_get_1;
		break;

	case __DB_dbc_put:
		xdr_argument = xdr___dbc_put_msg;
		xdr_result = xdr___dbc_put_reply;
		local = (char *(*)()) __db_dbc_put_1;
		break;

	default:
		svcerr_noproc(transp);
		return;
	}
	(void) memset((char *)&argument, 0, sizeof (argument));
	if (!svc_getargs(transp, xdr_argument, &argument)) {
		svcerr_decode(transp);
		return;
	}
	result = (*local)(&argument, rqstp);
	if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
		svcerr_systemerr(transp);
	}
	if (!svc_freeargs(transp, xdr_argument, &argument)) {
		fprintf(stderr, "unable to free arguments");
		exit(1);
	}
	__dbsrv_timeout();
	return;
}

void __dbsrv_main()
{
	register SVCXPRT *transp;

	(void) pmap_unset(DB_SERVERPROG, DB_SERVERVERS);

	transp = svctcp_create(RPC_ANYSOCK, 0, 0);
	if (transp == NULL) {
		fprintf(stderr, "cannot create tcp service.");
		exit(1);
	}
	if (!svc_register(transp, DB_SERVERPROG, DB_SERVERVERS, db_serverprog_1, IPPROTO_TCP)) {
		fprintf(stderr, "unable to register (DB_SERVERPROG, DB_SERVERVERS, tcp).");
		exit(1);
	}

	svc_run();
	fprintf(stderr, "svc_run returned");
	exit(1);
	/* NOTREACHED */
}
