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

#include "klm_prot.h"

bool_t
xdr_klm_stats (XDR *xdrs, klm_stats *objp)
{
	register int32_t *buf;

	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_lock (XDR *xdrs, klm_lock *objp)
{
	register int32_t *buf;

	 if (!xdr_string (xdrs, &objp->server_name, LM_MAXSTRLEN))
		 return FALSE;
	 if (!xdr_netobj (xdrs, &objp->fh))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->pid))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->l_offset))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->l_len))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_holder (XDR *xdrs, klm_holder *objp)
{
	register int32_t *buf;


	if (xdrs->x_op == XDR_ENCODE) {
		buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			 if (!xdr_bool (xdrs, &objp->exclusive))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->svid))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->l_offset))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->l_len))
				 return FALSE;
		} else {
			IXDR_PUT_BOOL(buf, objp->exclusive);
			IXDR_PUT_LONG(buf, objp->svid);
			IXDR_PUT_U_LONG(buf, objp->l_offset);
			IXDR_PUT_U_LONG(buf, objp->l_len);
		}
		return TRUE;
	} else if (xdrs->x_op == XDR_DECODE) {
		buf = XDR_INLINE (xdrs, 4 * BYTES_PER_XDR_UNIT);
		if (buf == NULL) {
			 if (!xdr_bool (xdrs, &objp->exclusive))
				 return FALSE;
			 if (!xdr_int (xdrs, &objp->svid))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->l_offset))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->l_len))
				 return FALSE;
		} else {
			objp->exclusive = IXDR_GET_BOOL(buf);
			objp->svid = IXDR_GET_LONG(buf);
			objp->l_offset = IXDR_GET_U_LONG(buf);
			objp->l_len = IXDR_GET_U_LONG(buf);
		}
	 return TRUE;
	}

	 if (!xdr_bool (xdrs, &objp->exclusive))
		 return FALSE;
	 if (!xdr_int (xdrs, &objp->svid))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->l_offset))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->l_len))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_stat (XDR *xdrs, klm_stat *objp)
{
	register int32_t *buf;

	 if (!xdr_klm_stats (xdrs, &objp->stat))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_testrply (XDR *xdrs, klm_testrply *objp)
{
	register int32_t *buf;

	 if (!xdr_klm_stats (xdrs, &objp->stat))
		 return FALSE;
	switch (objp->stat) {
	case klm_denied:
		 if (!xdr_klm_holder (xdrs, &objp->klm_testrply_u.holder))
			 return FALSE;
		break;
	default:
		break;
	}
	return TRUE;
}

bool_t
xdr_klm_lockargs (XDR *xdrs, klm_lockargs *objp)
{
	register int32_t *buf;

	 if (!xdr_bool (xdrs, &objp->block))
		 return FALSE;
	 if (!xdr_bool (xdrs, &objp->exclusive))
		 return FALSE;
	 if (!xdr_klm_lock (xdrs, &objp->alock))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_testargs (XDR *xdrs, klm_testargs *objp)
{
	register int32_t *buf;

	 if (!xdr_bool (xdrs, &objp->exclusive))
		 return FALSE;
	 if (!xdr_klm_lock (xdrs, &objp->alock))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_klm_unlockargs (XDR *xdrs, klm_unlockargs *objp)
{
	register int32_t *buf;

	 if (!xdr_klm_lock (xdrs, &objp->alock))
		 return FALSE;
	return TRUE;
}
