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

#include "sm_inter.h"
#include <stdio.h>
#include <stdlib.h>
#include <rpc/pmap_clnt.h>
#include <string.h>
#include <memory.h>
#include <sys/socket.h>
#include <netinet/in.h>

#ifndef SIG_PF
#define SIG_PF void(*)(int)
#endif
#define SM_INTER_X

void
sm_prog_1(struct svc_req *rqstp, register SVCXPRT *transp)
{
	union {
		struct sm_name sm_stat_1_arg;
		struct mon sm_mon_1_arg;
		struct mon_id sm_unmon_1_arg;
		struct my_id sm_unmon_all_1_arg;
		struct stat_chge sm_notify_1_arg;
	} argument;
	char *result;
	xdrproc_t _xdr_argument, _xdr_result;
	char *(*local)(char *, struct svc_req *);

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

	case SM_STAT:
		_xdr_argument = (xdrproc_t) xdr_sm_name;
		_xdr_result = (xdrproc_t) xdr_sm_stat_res;
		local = (char *(*)(char *, struct svc_req *)) sm_stat_1_svc;
		break;

	case SM_MON:
		_xdr_argument = (xdrproc_t) xdr_mon;
		_xdr_result = (xdrproc_t) xdr_sm_stat_res;
		local = (char *(*)(char *, struct svc_req *)) sm_mon_1_svc;
		break;

	case SM_UNMON:
		_xdr_argument = (xdrproc_t) xdr_mon_id;
		_xdr_result = (xdrproc_t) xdr_sm_stat;
		local = (char *(*)(char *, struct svc_req *)) sm_unmon_1_svc;
		break;

	case SM_UNMON_ALL:
		_xdr_argument = (xdrproc_t) xdr_my_id;
		_xdr_result = (xdrproc_t) xdr_sm_stat;
		local = (char *(*)(char *, struct svc_req *)) sm_unmon_all_1_svc;
		break;

	case SM_SIMU_CRASH:
		_xdr_argument = (xdrproc_t) xdr_void;
		_xdr_result = (xdrproc_t) xdr_void;
		local = (char *(*)(char *, struct svc_req *)) sm_simu_crash_1_svc;
		break;

	case SM_NOTIFY:
		_xdr_argument = (xdrproc_t) xdr_stat_chge;
		_xdr_result = (xdrproc_t) xdr_void;
		local = (char *(*)(char *, struct svc_req *)) sm_notify_1_svc;
		break;

	default:
		svcerr_noproc (transp);
		return;
	}
	memset ((char *)&argument, 0, sizeof (argument));
	if (!svc_getargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
		svcerr_decode (transp);
		return;
	}
	result = (*local)((char *)&argument, rqstp);
	if (result != NULL && !svc_sendreply(transp, (xdrproc_t) _xdr_result, result)) {
		svcerr_systemerr (transp);
	}
	if (!svc_freeargs (transp, (xdrproc_t) _xdr_argument, (caddr_t) &argument)) {
		fprintf (stderr, "%s", "unable to free arguments");
		exit (1);
	}
	return;
}
