1*85858ec2Sguenther /* $OpenBSD: pmap_prot.c,v 1.8 2015/09/13 15:36:56 guenther Exp $ */
2cb7760d1Smillert
3df930be7Sderaadt /*
4cb7760d1Smillert * Copyright (c) 2010, Oracle America, Inc.
5df930be7Sderaadt *
6cb7760d1Smillert * Redistribution and use in source and binary forms, with or without
7cb7760d1Smillert * modification, are permitted provided that the following conditions are
8cb7760d1Smillert * met:
9df930be7Sderaadt *
10cb7760d1Smillert * * Redistributions of source code must retain the above copyright
11cb7760d1Smillert * notice, this list of conditions and the following disclaimer.
12cb7760d1Smillert * * Redistributions in binary form must reproduce the above
13cb7760d1Smillert * copyright notice, this list of conditions and the following
14cb7760d1Smillert * disclaimer in the documentation and/or other materials
15cb7760d1Smillert * provided with the distribution.
16cb7760d1Smillert * * Neither the name of the "Oracle America, Inc." nor the names of its
17cb7760d1Smillert * contributors may be used to endorse or promote products derived
18cb7760d1Smillert * from this software without specific prior written permission.
19df930be7Sderaadt *
20cb7760d1Smillert * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21cb7760d1Smillert * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22cb7760d1Smillert * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23cb7760d1Smillert * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24cb7760d1Smillert * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25cb7760d1Smillert * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26cb7760d1Smillert * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27cb7760d1Smillert * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28cb7760d1Smillert * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29cb7760d1Smillert * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30cb7760d1Smillert * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31cb7760d1Smillert * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32df930be7Sderaadt */
33df930be7Sderaadt
34df930be7Sderaadt /*
35df930be7Sderaadt * pmap_prot.c
36df930be7Sderaadt * Protocol for the local binder service, or pmap.
37df930be7Sderaadt */
38df930be7Sderaadt
39df930be7Sderaadt #include <rpc/types.h>
40df930be7Sderaadt #include <rpc/xdr.h>
41df930be7Sderaadt #include <rpc/pmap_prot.h>
42df930be7Sderaadt
43df930be7Sderaadt
44df930be7Sderaadt bool_t
xdr_pmap(XDR * xdrs,struct pmap * regs)45384ec30aSotto xdr_pmap(XDR *xdrs, struct pmap *regs)
46df930be7Sderaadt {
47df930be7Sderaadt
48df930be7Sderaadt if (xdr_u_long(xdrs, ®s->pm_prog) &&
49df930be7Sderaadt xdr_u_long(xdrs, ®s->pm_vers) &&
50df930be7Sderaadt xdr_u_long(xdrs, ®s->pm_prot))
51df930be7Sderaadt return (xdr_u_long(xdrs, ®s->pm_port));
52df930be7Sderaadt return (FALSE);
53df930be7Sderaadt }
54*85858ec2Sguenther DEF_WEAK(xdr_pmap);
55