pmap_prot.c revision 331722
177542Swpaul/* $NetBSD: pmap_prot.c,v 1.10 2000/01/22 22:19:18 mycroft Exp $ */ 277542Swpaul 377542Swpaul/*- 477542Swpaul * Copyright (c) 2009, Sun Microsystems, Inc. 577542Swpaul * All rights reserved. 677542Swpaul * 777542Swpaul * Redistribution and use in source and binary forms, with or without 877542Swpaul * modification, are permitted provided that the following conditions are met: 977542Swpaul * - Redistributions of source code must retain the above copyright notice, 1077542Swpaul * this list of conditions and the following disclaimer. 1177542Swpaul * - Redistributions in binary form must reproduce the above copyright notice, 1277542Swpaul * this list of conditions and the following disclaimer in the documentation 1377542Swpaul * and/or other materials provided with the distribution. 1477542Swpaul * - Neither the name of Sun Microsystems, Inc. nor the names of its 1577542Swpaul * contributors may be used to endorse or promote products derived 1677542Swpaul * from this software without specific prior written permission. 1777542Swpaul * 1877542Swpaul * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1977542Swpaul * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2077542Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2177542Swpaul * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 2277542Swpaul * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2377542Swpaul * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2477542Swpaul * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2577542Swpaul * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2677542Swpaul * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2777542Swpaul * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2877542Swpaul * POSSIBILITY OF SUCH DAMAGE. 2977542Swpaul */ 3077542Swpaul 3177542Swpaul#if defined(LIBC_SCCS) && !defined(lint) 3277542Swpaulstatic char *sccsid2 = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro"; 3377542Swpaulstatic char *sccsid = "@(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC"; 3477542Swpaul#endif 3577542Swpaul#include <sys/cdefs.h> 3677542Swpaul__FBSDID("$FreeBSD: stable/11/lib/libc/rpc/pmap_prot.c 331722 2018-03-29 02:50:57Z eadler $"); 3777542Swpaul 3877542Swpaul/* 3977542Swpaul * pmap_prot.c 4077542Swpaul * Protocol for the local binder service, or pmap. 4177542Swpaul * 4277542Swpaul * Copyright (C) 1984, Sun Microsystems, Inc. 4377542Swpaul */ 4477542Swpaul 4577542Swpaul#include "namespace.h" 4677542Swpaul#include <assert.h> 4777542Swpaul 4877542Swpaul#include <rpc/types.h> 4977542Swpaul#include <rpc/xdr.h> 5077542Swpaul#include <rpc/pmap_prot.h> 5177542Swpaul#include "un-namespace.h" 5277542Swpaul 5377542Swpaul 5477542Swpaulbool_t 5577542Swpaulxdr_pmap(XDR *xdrs, struct pmap *regs) 5677542Swpaul{ 5777542Swpaul 5877542Swpaul assert(xdrs != NULL); 5977542Swpaul assert(regs != NULL); 6077542Swpaul 6177542Swpaul if (xdr_u_long(xdrs, ®s->pm_prog) && 6277542Swpaul xdr_u_long(xdrs, ®s->pm_vers) && 6377542Swpaul xdr_u_long(xdrs, ®s->pm_prot)) 6477542Swpaul return (xdr_u_long(xdrs, ®s->pm_port)); 6577542Swpaul return (FALSE); 6677542Swpaul} 6777542Swpaul