Blame src/pmap_prot.c

Packit Service 4f68e0
/*
Packit Service 4f68e0
 * Copyright (c) 2009, Sun Microsystems, Inc.
Packit Service 4f68e0
 * All rights reserved.
Packit Service 4f68e0
 *
Packit Service 4f68e0
 * Redistribution and use in source and binary forms, with or without
Packit Service 4f68e0
 * modification, are permitted provided that the following conditions are met:
Packit Service 4f68e0
 * - Redistributions of source code must retain the above copyright notice,
Packit Service 4f68e0
 *   this list of conditions and the following disclaimer.
Packit Service 4f68e0
 * - Redistributions in binary form must reproduce the above copyright notice,
Packit Service 4f68e0
 *   this list of conditions and the following disclaimer in the documentation
Packit Service 4f68e0
 *   and/or other materials provided with the distribution.
Packit Service 4f68e0
 * - Neither the name of Sun Microsystems, Inc. nor the names of its
Packit Service 4f68e0
 *   contributors may be used to endorse or promote products derived
Packit Service 4f68e0
 *   from this software without specific prior written permission.
Packit Service 4f68e0
 *
Packit Service 4f68e0
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Packit Service 4f68e0
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 4f68e0
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 4f68e0
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
Packit Service 4f68e0
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Packit Service 4f68e0
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Packit Service 4f68e0
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit Service 4f68e0
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
Packit Service 4f68e0
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Packit Service 4f68e0
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
Packit Service 4f68e0
 * POSSIBILITY OF SUCH DAMAGE.
Packit Service 4f68e0
 */
Packit Service 4f68e0
Packit Service 4f68e0
/*
Packit Service 4f68e0
 * pmap_prot.c
Packit Service 4f68e0
 * Protocol for the local binder service, or pmap.
Packit Service 4f68e0
 *
Packit Service 4f68e0
 * Copyright (C) 1984, Sun Microsystems, Inc.
Packit Service 4f68e0
 */
Packit Service 4f68e0
Packit Service 4f68e0
#include <assert.h>
Packit Service 4f68e0
Packit Service 4f68e0
#include <rpc/types.h>
Packit Service 4f68e0
#include <rpc/xdr.h>
Packit Service 4f68e0
#include <rpc/pmap_prot.h>
Packit Service 4f68e0
Packit Service 4f68e0
Packit Service 4f68e0
bool_t
Packit Service 4f68e0
xdr_pmap(xdrs, regs)
Packit Service 4f68e0
	XDR *xdrs;
Packit Service 4f68e0
	struct pmap *regs;
Packit Service 4f68e0
{
Packit Service 4f68e0
Packit Service 4f68e0
	assert(xdrs != NULL);
Packit Service 4f68e0
	assert(regs != NULL);
Packit Service 4f68e0
Packit Service 4f68e0
	if (xdr_u_long(xdrs, &regs->pm_prog) &&
Packit Service 4f68e0
		xdr_u_long(xdrs, &regs->pm_vers) &&
Packit Service 4f68e0
		xdr_u_long(xdrs, &regs->pm_prot))
Packit Service 4f68e0
		return (xdr_u_long(xdrs, &regs->pm_port));
Packit Service 4f68e0
	return (FALSE);
Packit Service 4f68e0
}