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

#include "rpc.h"
#include "xdr_impl_inline.h"

bool_t
xdr_rpc_auth_flavor (XDR *xdrs, rpc_auth_flavor *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_msg_type (XDR *xdrs, rpc_msg_type *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_reply_stat (XDR *xdrs, rpc_reply_stat *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_accept_stat (XDR *xdrs, rpc_accept_stat *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_reject_stat (XDR *xdrs, rpc_reject_stat *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_auth_stat (XDR *xdrs, rpc_auth_stat *objp)
{
	
	 if (!xdr_enum (xdrs, (enum_t *) objp))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_opaque_auth (XDR *xdrs, rpc_opaque_auth *objp)
{
	
	 if (!xdr_rpc_auth_flavor (xdrs, &objp->flavor))
		 return FALSE;
	 if (!xdr_bytes(xdrs, &objp->body, 400))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_call_body (XDR *xdrs, rpc_call_body *objp)
{
	

	if (xdrs->x_op == XDR_ENCODE) {
				if (1) {
			 if (!xdr_u_int (xdrs, &objp->rpcvers))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->prog))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->vers))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->proc))
				 return FALSE;

		} else {
		IXDR_PUT_U_LONG(buf, objp->rpcvers);
		IXDR_PUT_U_LONG(buf, objp->prog);
		IXDR_PUT_U_LONG(buf, objp->vers);
		IXDR_PUT_U_LONG(buf, objp->proc);
		}
		 if (!xdr_rpc_opaque_auth (xdrs, &objp->cred))
			 return FALSE;
		 if (!xdr_rpc_opaque_auth (xdrs, &objp->verf))
			 return FALSE;
		return TRUE;
	} else if (xdrs->x_op == XDR_DECODE) {
				if (1) {
			 if (!xdr_u_int (xdrs, &objp->rpcvers))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->prog))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->vers))
				 return FALSE;
			 if (!xdr_u_int (xdrs, &objp->proc))
				 return FALSE;

		} else {
		objp->rpcvers = IXDR_GET_U_LONG(buf);
		objp->prog = IXDR_GET_U_LONG(buf);
		objp->vers = IXDR_GET_U_LONG(buf);
		objp->proc = IXDR_GET_U_LONG(buf);
		}
		 if (!xdr_rpc_opaque_auth (xdrs, &objp->cred))
			 return FALSE;
		 if (!xdr_rpc_opaque_auth (xdrs, &objp->verf))
			 return FALSE;
	 return TRUE;
	}

	 if (!xdr_u_int (xdrs, &objp->rpcvers))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->prog))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->vers))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->proc))
		 return FALSE;
	 if (!xdr_rpc_opaque_auth (xdrs, &objp->cred))
		 return FALSE;
	 if (!xdr_rpc_opaque_auth (xdrs, &objp->verf))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_mismatch_info (XDR *xdrs, rpc_mismatch_info *objp)
{
	
	 if (!xdr_u_int (xdrs, &objp->min_version))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->max_version))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_accepted_reply_body (XDR *xdrs, rpc_accepted_reply_body *objp)
{
	
	 if (!xdr_rpc_accept_stat (xdrs, &objp->stat))
		 return FALSE;
	switch (objp->stat) {
	case RPC_SUCCESS:
		break;
	case RPC_PROG_MISMATCH:
		 if (!xdr_rpc_mismatch_info (xdrs, &objp->mismatch_info))
			 return FALSE;
		break;
	default:
		break;
	}
	return TRUE;
}

bool_t
xdr_rpc_accepted_reply (XDR *xdrs, rpc_accepted_reply *objp)
{
	
	 if (!xdr_rpc_opaque_auth (xdrs, &objp->verf))
		 return FALSE;
	 if (!xdr_rpc_accepted_reply_body (xdrs, &objp->reply_data))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_rpc_rejected_reply (XDR *xdrs, rpc_rejected_reply *objp)
{
	
	 if (!xdr_rpc_reject_stat (xdrs, &objp->stat))
		 return FALSE;
	switch (objp->stat) {
	case RPC_MISMATCH:
		 if (!xdr_rpc_mismatch_info (xdrs, &objp->mismatch_info))
			 return FALSE;
		break;
	case RPC_AUTH_ERROR:
		 if (!xdr_rpc_auth_stat (xdrs, &objp->auth_stat))
			 return FALSE;
		break;
	default:
		return FALSE;
	}
	return TRUE;
}

bool_t
xdr_rpc_reply_body (XDR *xdrs, rpc_reply_body *objp)
{
	
	 if (!xdr_rpc_reply_stat (xdrs, &objp->stat))
		 return FALSE;
	switch (objp->stat) {
	case RPC_MSG_ACCEPTED:
		 if (!xdr_rpc_accepted_reply (xdrs, &objp->areply))
			 return FALSE;
		break;
	case RPC_MSG_DENIED:
		 if (!xdr_rpc_rejected_reply (xdrs, &objp->rreply))
			 return FALSE;
		break;
	default:
		return FALSE;
	}
	return TRUE;
}

bool_t
xdr_rpc_msg_body (XDR *xdrs, rpc_msg_body *objp)
{
	
	 if (!xdr_rpc_msg_type (xdrs, &objp->dir))
		 return FALSE;
	switch (objp->dir) {
	case RPC_CALL:
		 if (!xdr_rpc_call_body (xdrs, &objp->cbody))
			 return FALSE;
		break;
	case RPC_REPLY:
		 if (!xdr_rpc_reply_body (xdrs, &objp->rbody))
			 return FALSE;
		break;
	default:
		return FALSE;
	}
	return TRUE;
}

bool_t
xdr_rpc_msg (XDR *xdrs, rpc_msg *objp)
{
	
	 if (!xdr_u_int (xdrs, &objp->xid))
		 return FALSE;
	 if (!xdr_rpc_msg_body (xdrs, &objp->body))
		 return FALSE;
	return TRUE;
}

bool_t
xdr_authsys_parms (XDR *xdrs, authsys_parms *objp)
{
	
	 if (!xdr_u_int (xdrs, &objp->stamp))
		 return FALSE;
	 if (!xdr_string (xdrs, &objp->machinename, 255))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->uid))
		 return FALSE;
	 if (!xdr_u_int (xdrs, &objp->gid))
		 return FALSE;
	 if (!xdr_array (xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, 16,
		sizeof (u_int), (xdrproc_t) xdr_u_int))
		 return FALSE;
	return TRUE;
}
