Beispiel #1
0
static bool_t libnfs_rpc_call_body(ZDR *zdrs, struct call_body *cmb)
{
	if (!libnfs_zdr_u_int(zdrs, &cmb->rpcvers)) {
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->prog)) {
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->vers)) {
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->proc)) {
		return FALSE;
	}

	if (!libnfs_opaque_auth(zdrs, &cmb->cred)) {
		return FALSE;
	}

	if (!libnfs_opaque_auth(zdrs, &cmb->verf)) {
		return FALSE;
	}

	return TRUE;
}
Beispiel #2
0
static bool_t libnfs_accepted_reply(ZDR *zdrs, struct accepted_reply *ar)
{
	if (!libnfs_opaque_auth(zdrs, &ar->verf)) {
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &ar->stat)) {
		return FALSE;
	}

	switch (ar->stat) {
	case SUCCESS:
		if (!ar->reply_data.results.proc(zdrs, ar->reply_data.results.where)) {
			return FALSE;
		}
		return TRUE;
	case PROG_MISMATCH:
		if (!libnfs_zdr_u_int(zdrs, &ar->reply_data.mismatch_info.low)) {
			return FALSE;
		}
		if (!libnfs_zdr_u_int(zdrs, &ar->reply_data.mismatch_info.high)) {
			return FALSE;
		}
		return TRUE;
	default:
		return TRUE;
	}

	return FALSE;
}
Beispiel #3
0
static bool_t libnfs_rpc_call_body(struct rpc_context *rpc, ZDR *zdrs, struct call_body *cmb)
{
	if (!libnfs_zdr_u_int(zdrs, &cmb->rpcvers)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"RPCVERS");
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->prog)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"PROG");
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->vers)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"VERS");
		return FALSE;
	}

	if (!libnfs_zdr_u_int(zdrs, &cmb->proc)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"PROC");
		return FALSE;
	}

	if (!libnfs_opaque_auth(zdrs, &cmb->cred)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"CRED");
		return FALSE;
	}

	if (!libnfs_opaque_auth(zdrs, &cmb->verf)) {
		rpc_set_error(rpc, "libnfs_rpc_call_body failed to encode "
			"VERF");
		return FALSE;
	}

	return TRUE;
}