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

#include <afsconfig.h>
#include <afs/param.h>
#include <roken.h>
#include <afs/opr.h>
#ifdef AFS_PTHREAD_ENV
# include <opr/lock.h>
#endif
#include "rxstat.h"

int RXSTATS_RetrieveProcessRPCStats(struct rx_connection *z_conn,afs_uint32 clientVersion,afs_uint32 * serverVersion,afs_uint32 * clock_sec,afs_uint32 * clock_usec,afs_uint32 * stat_count,rpcStats * stats)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 0;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clientVersion))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, serverVersion))
	     || (!xdr_afs_uint32(&z_xdrs, clock_sec))
	     || (!xdr_afs_uint32(&z_xdrs, clock_usec))
	     || (!xdr_afs_uint32(&z_xdrs, stat_count))
	     || (!xdr_rpcStats(&z_xdrs, stats))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		0, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int StartRXSTATS_RetrieveProcessRPCStats(struct rx_call *z_call,afs_uint32 clientVersion)
{
	static int z_op = 0;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clientVersion))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	return z_result;
}

int EndRXSTATS_RetrieveProcessRPCStats(struct rx_call *z_call,afs_uint32 * serverVersion,afs_uint32 * clock_sec,afs_uint32 * clock_usec,afs_uint32 * stat_count,rpcStats * stats)
{
	int z_result;
	XDR z_xdrs;
	/* Un-marshal the reply arguments */
	xdrrx_create(&z_xdrs, z_call, XDR_DECODE);
	if ((!xdr_afs_uint32(&z_xdrs, serverVersion))
	     || (!xdr_afs_uint32(&z_xdrs, clock_sec))
	     || (!xdr_afs_uint32(&z_xdrs, clock_usec))
	     || (!xdr_afs_uint32(&z_xdrs, stat_count))
	     || (!xdr_rpcStats(&z_xdrs, stats))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		0, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_RetrievePeerRPCStats(struct rx_connection *z_conn,afs_uint32 clientVersion,afs_uint32 * serverVersion,afs_uint32 * stat_count,afs_uint32 * clock_sec,afs_uint32 * clock_usec,rpcStats * stats)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 1;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clientVersion))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, serverVersion))
	     || (!xdr_afs_uint32(&z_xdrs, stat_count))
	     || (!xdr_afs_uint32(&z_xdrs, clock_sec))
	     || (!xdr_afs_uint32(&z_xdrs, clock_usec))
	     || (!xdr_rpcStats(&z_xdrs, stats))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		1, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int StartRXSTATS_RetrievePeerRPCStats(struct rx_call *z_call,afs_uint32 clientVersion)
{
	static int z_op = 1;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clientVersion))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	return z_result;
}

int EndRXSTATS_RetrievePeerRPCStats(struct rx_call *z_call,afs_uint32 * serverVersion,afs_uint32 * stat_count,afs_uint32 * clock_sec,afs_uint32 * clock_usec,rpcStats * stats)
{
	int z_result;
	XDR z_xdrs;
	/* Un-marshal the reply arguments */
	xdrrx_create(&z_xdrs, z_call, XDR_DECODE);
	if ((!xdr_afs_uint32(&z_xdrs, serverVersion))
	     || (!xdr_afs_uint32(&z_xdrs, stat_count))
	     || (!xdr_afs_uint32(&z_xdrs, clock_sec))
	     || (!xdr_afs_uint32(&z_xdrs, clock_usec))
	     || (!xdr_rpcStats(&z_xdrs, stats))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		1, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_QueryProcessRPCStats(struct rx_connection *z_conn,afs_int32 * on)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 2;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_int32(&z_xdrs, on))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		2, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_QueryPeerRPCStats(struct rx_connection *z_conn,afs_int32 * on)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 3;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_int32(&z_xdrs, on))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		3, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_EnableProcessRPCStats(struct rx_connection *z_conn)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 4;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		4, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_EnablePeerRPCStats(struct rx_connection *z_conn)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 5;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		5, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_DisableProcessRPCStats(struct rx_connection *z_conn)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 6;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		6, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_DisablePeerRPCStats(struct rx_connection *z_conn)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 7;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		7, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_QueryRPCStatsVersion(struct rx_connection *z_conn,afs_uint32 * ver)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 8;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	/* Un-marshal the reply arguments */
	z_xdrs.x_op = XDR_DECODE;
	if ((!xdr_afs_uint32(&z_xdrs, ver))) {
		z_result = RXGEN_CC_UNMARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		8, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_ClearProcessRPCStats(struct rx_connection *z_conn,afs_uint32 clearFlag)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 9;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clearFlag))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		9, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

int RXSTATS_ClearPeerRPCStats(struct rx_connection *z_conn,afs_uint32 clearFlag)
{
	struct rx_call *z_call = rx_NewCall(z_conn);
	static int z_op = 10;
	int z_result;
	XDR z_xdrs;
	xdrrx_create(&z_xdrs, z_call, XDR_ENCODE);

	/* Marshal the arguments */
	if ((!xdr_int(&z_xdrs, &z_op))
	     || (!xdr_afs_uint32(&z_xdrs, &clearFlag))) {
		z_result = RXGEN_CC_MARSHAL;
		goto fail;
	}

	z_result = RXGEN_SUCCESS;
fail:
	z_result = rx_EndCall(z_call, z_result);
	if (rx_enable_stats) {
	    rx_RecordCallStatistics(z_call, RXSTATS_STATINDEX,
		10, RXSTATS_NO_OF_STAT_FUNCS, 1);
	}

	return z_result;
}

