head/sys/rpc/rpc_prot.c
/*
 * XDR the MSG_ACCEPTED part of a reply message union
 */
XDR the MSG_ACCEPTED part of a reply message union
XDR the MSG_ACCEPTED part of a reply message union
bool_t
xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar)
{
	enum accept_stat *par_stat;
	assert(xdrs != NULL);
	assert(ar != NULL);
	par_stat = &ar->ar_stat;
	if (! xdr_opaque_auth(xdrs, &(ar->ar_verf)))
		return (FALSE);
	if (! xdr_enum(xdrs, (enum_t *) par_stat))
		return (FALSE);
	switch (ar->ar_stat) {
	case SUCCESS:
		if (ar->ar_results.proc != (xdrproc_t) xdr_void)
			return ((*(ar->ar_results.proc))(xdrs,
				ar->ar_results.where));
		else
			return (TRUE);
	case PROG_MISMATCH:
		if (! xdr_uint32_t(xdrs, &(ar->ar_vers.low)))
			return (FALSE);
		return (xdr_uint32_t(xdrs, &(ar->ar_vers.high)));
	case GARBAGE_ARGS:
	case SYSTEM_ERR:
	case PROC_UNAVAIL:
	case PROG_UNAVAIL:
		break;
	}
	return (TRUE);  
}
bool_t xdr_accepted_reply ( XDR * xdrs , struct accepted_reply * ar ) { enum accept_stat * par_stat ; assert ( xdrs != NULL ) ; assert ( ar != NULL ) ; par_stat = & ar -> ar_stat ; if ( ! xdr_opaque_auth ( xdrs , & ( ar -> ar_verf ) ) ) return ( FALSE ) ; if ( ! xdr_enum ( xdrs , ( enum_t * ) par_stat ) ) return ( FALSE ) ; switch ( ar -> ar_stat ) { case SUCCESS : if ( ar -> ar_results . proc != ( xdrproc_t ) xdr_void ) return ( ( * ( ar -> ar_results . proc ) ) ( xdrs , ar -> ar_results . where ) ) ; else return ( TRUE ) ; case PROG_MISMATCH : if ( ! xdr_uint32_t ( xdrs , & ( ar -> ar_vers . low ) ) ) return ( FALSE ) ; return ( xdr_uint32_t ( xdrs , & ( ar -> ar_vers . high ) ) ) ; case GARBAGE_ARGS : case SYSTEM_ERR : case PROC_UNAVAIL : case PROG_UNAVAIL : break ; } return ( TRUE ) ; }
XDR the MSG_ACCEPTED part of a reply message union
XDR the MSG_ACCEPTED part of a reply message union
/* personalized union, rather than calling xdr_union */ /* TRUE => open ended set of problems */