pmap_prot.c revision 1.12
11.12Stron/* $NetBSD: pmap_prot.c,v 1.12 2013/03/11 20:19:29 tron Exp $ */ 21.2Scgd 31.1Scgd/* 41.12Stron * Copyright (c) 2010, Oracle America, Inc. 51.12Stron * 61.12Stron * Redistribution and use in source and binary forms, with or without 71.12Stron * modification, are permitted provided that the following conditions are 81.12Stron * met: 91.12Stron * 101.12Stron * * Redistributions of source code must retain the above copyright 111.12Stron * notice, this list of conditions and the following disclaimer. 121.12Stron * * Redistributions in binary form must reproduce the above 131.12Stron * copyright notice, this list of conditions and the following 141.12Stron * disclaimer in the documentation and/or other materials 151.12Stron * provided with the distribution. 161.12Stron * * Neither the name of the "Oracle America, Inc." nor the names of its 171.12Stron * contributors may be used to endorse or promote products derived 181.12Stron * from this software without specific prior written permission. 191.12Stron * 201.12Stron * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 211.12Stron * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 221.12Stron * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 231.12Stron * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 241.12Stron * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 251.12Stron * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261.12Stron * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 271.12Stron * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 281.12Stron * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 291.12Stron * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 301.12Stron * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 311.12Stron * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 321.1Scgd */ 331.1Scgd 341.3Schristos#include <sys/cdefs.h> 351.1Scgd#if defined(LIBC_SCCS) && !defined(lint) 361.3Schristos#if 0 371.3Schristosstatic char *sccsid = "@(#)pmap_prot.c 1.17 87/08/11 Copyr 1984 Sun Micro"; 381.3Schristosstatic char *sccsid = "@(#)pmap_prot.c 2.1 88/07/29 4.0 RPCSRC"; 391.3Schristos#else 401.12Stron__RCSID("$NetBSD: pmap_prot.c,v 1.12 2013/03/11 20:19:29 tron Exp $"); 411.3Schristos#endif 421.1Scgd#endif 431.1Scgd 441.1Scgd/* 451.1Scgd * pmap_prot.c 461.1Scgd * Protocol for the local binder service, or pmap. 471.1Scgd * 481.1Scgd * Copyright (C) 1984, Sun Microsystems, Inc. 491.1Scgd */ 501.1Scgd 511.4Sjtc#include "namespace.h" 521.7Slukem 531.8Slukem#include <assert.h> 541.8Slukem 551.1Scgd#include <rpc/types.h> 561.1Scgd#include <rpc/xdr.h> 571.1Scgd#include <rpc/pmap_prot.h> 581.4Sjtc 591.4Sjtc#ifdef __weak_alias 601.10Smycroft__weak_alias(xdr_pmap,_xdr_pmap) 611.4Sjtc#endif 621.1Scgd 631.1Scgd 641.1Scgdbool_t 651.11Smattxdr_pmap(XDR *xdrs, struct pmap *regs) 661.1Scgd{ 671.8Slukem 681.8Slukem _DIAGASSERT(xdrs != NULL); 691.8Slukem _DIAGASSERT(regs != NULL); 701.1Scgd 711.6Slukem if (xdr_u_long(xdrs, ®s->pm_prog) && 721.6Slukem xdr_u_long(xdrs, ®s->pm_vers) && 731.6Slukem xdr_u_long(xdrs, ®s->pm_prot)) 741.6Slukem return (xdr_u_long(xdrs, ®s->pm_port)); 751.1Scgd return (FALSE); 761.1Scgd} 77