/* Machine generated file -- Do NOT edit */

#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
#include "rmtsys.h"

#include <rx/rx.h>
#include <rx/rx_null.h>
#define RMTSYS_SERVICEID 4 /* shared between client+server */
#define AFSCONF_RMTSYSPORT 7009
#define AFSCONF_RMTSYSSERVICE "afsrmtsys"
#define NIL_PATHP "__FOO__"
static afs_int32 _RMTSYS_SetPag(struct rx_call *z_call, XDR *z_xdrs)
{
	afs_int32 z_result;
	clientcred cred;
	afs_int32 newpag, errornumber;


	memset(&cred, 0, sizeof(cred));
	memset(&newpag, 0, sizeof(newpag));
	memset(&errornumber, 0, sizeof(errornumber));

	if ((!xdr_clientcred(z_xdrs, &cred))) {
		z_result = RXGEN_SS_UNMARSHAL;
		goto fail;
	}

	z_result = SRMTSYS_SetPag(z_call, &cred, &newpag, &errornumber);
	if (z_result)
		goto fail;
	z_xdrs->x_op = XDR_ENCODE;
	if ((!xdr_afs_int32(z_xdrs, &newpag))
	     || (!xdr_afs_int32(z_xdrs, &errornumber)))
		z_result = RXGEN_SS_MARSHAL;
fail:
	return z_result;
}

static afs_int32 _RMTSYS_Pioctl(struct rx_call *z_call, XDR *z_xdrs)
{
	afs_int32 z_result;
	clientcred cred;
	char * path=(char *)0;
	afs_int32 cmd, follow;
	rmtbulk InData, OutData;
	afs_int32 errornumber;


	memset(&cred, 0, sizeof(cred));
	memset(&path, 0, sizeof(path));
	memset(&cmd, 0, sizeof(cmd));
	memset(&follow, 0, sizeof(follow));
	memset(&InData, 0, sizeof(InData));
	memset(&OutData, 0, sizeof(OutData));
	memset(&errornumber, 0, sizeof(errornumber));

	if ((!xdr_clientcred(z_xdrs, &cred))
	     || (!xdr_string(z_xdrs, &path, 4096))
	     || (!xdr_afs_int32(z_xdrs, &cmd))
	     || (!xdr_afs_int32(z_xdrs, &follow))
	     || (!xdr_rmtbulk(z_xdrs, &InData))
	     || (!xdr_rmtbulk(z_xdrs, &OutData))) {
		z_result = RXGEN_SS_UNMARSHAL;
		goto fail;
	}

	z_result = SRMTSYS_Pioctl(z_call, &cred, path, cmd, follow, &InData, &OutData, &errornumber);
	if (z_result)
		goto fail;
	z_xdrs->x_op = XDR_ENCODE;
	if ((!xdr_rmtbulk(z_xdrs, &OutData))
	     || (!xdr_afs_int32(z_xdrs, &errornumber)))
		z_result = RXGEN_SS_MARSHAL;
fail:
	z_xdrs->x_op = XDR_FREE;
	if ((!xdr_string(z_xdrs, &path, 4096))
	    || (!xdr_rmtbulk(z_xdrs, &InData))
	    || (!xdr_rmtbulk(z_xdrs, &OutData)))
		z_result = RXGEN_SS_XDRFREE;

	return z_result;
}



static afs_int32 (*StubProcsArray0[])(struct rx_call *z_call, XDR *z_xdrs) = {_RMTSYS_SetPag, _RMTSYS_Pioctl};

int RMTSYS_ExecuteRequest(struct rx_call *z_call)
{
	int op;
	XDR z_xdrs;
	afs_int32 z_result;

	xdrrx_create(&z_xdrs, z_call, XDR_DECODE);
	if (!xdr_int(&z_xdrs, &op))
		z_result = RXGEN_DECODE;
	else if (op < RMTSYS_LOWEST_OPCODE || op > RMTSYS_HIGHEST_OPCODE)
		z_result = RXGEN_OPCODE;
	else
		z_result = (*StubProcsArray0[op - RMTSYS_LOWEST_OPCODE])(z_call, &z_xdrs);
	return hton_syserr_conv(z_result);
}
