1 /* $NetBSD: rpcb_st_xdr.c,v 1.3 2000/07/14 08:40:42 fvdl Exp $ */
4 * Copyright (c) 2009, Sun Microsystems, Inc.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * - Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright notice,
12 * this list of conditions and the following disclaimer in the documentation
13 * and/or other materials provided with the distribution.
14 * - Neither the name of Sun Microsystems, Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
31 * Copyright 1991 Sun Microsystems, Inc.
36 * This file was generated from rpcb_prot.x, but includes only those
37 * routines used with the rpcbind stats facility.
40 #include <sys/cdefs.h>
41 __FBSDID("$FreeBSD$");
43 #include "namespace.h"
45 #include "un-namespace.h"
47 /* Link list of all the stats about getport and getaddr */
50 xdr_rpcbs_addrlist(xdrs, objp)
54 struct rpcbs_addrlist **pnext;
56 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
59 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
62 if (!xdr_int(xdrs, &objp->success)) {
65 if (!xdr_int(xdrs, &objp->failure)) {
68 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
74 if (!xdr_pointer(xdrs, (char **) pnext,
75 sizeof (rpcbs_addrlist),
76 (xdrproc_t)xdr_rpcbs_addrlist)) {
83 /* Link list of all the stats about rmtcall */
86 xdr_rpcbs_rmtcalllist(xdrs, objp)
88 rpcbs_rmtcalllist *objp;
91 struct rpcbs_rmtcalllist **pnext;
93 if (xdrs->x_op == XDR_ENCODE) {
94 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
96 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
99 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
102 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
105 if (!xdr_int(xdrs, &objp->success)) {
108 if (!xdr_int(xdrs, &objp->failure)) {
111 if (!xdr_int(xdrs, &objp->indirect)) {
115 IXDR_PUT_U_INT32(buf, objp->prog);
116 IXDR_PUT_U_INT32(buf, objp->vers);
117 IXDR_PUT_U_INT32(buf, objp->proc);
118 IXDR_PUT_INT32(buf, objp->success);
119 IXDR_PUT_INT32(buf, objp->failure);
120 IXDR_PUT_INT32(buf, objp->indirect);
122 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
126 if (!xdr_pointer(xdrs, (char **) pnext,
127 sizeof (rpcbs_rmtcalllist),
128 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
132 } else if (xdrs->x_op == XDR_DECODE) {
133 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
135 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
138 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
141 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
144 if (!xdr_int(xdrs, &objp->success)) {
147 if (!xdr_int(xdrs, &objp->failure)) {
150 if (!xdr_int(xdrs, &objp->indirect)) {
154 objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
155 objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
156 objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
157 objp->success = (int)IXDR_GET_INT32(buf);
158 objp->failure = (int)IXDR_GET_INT32(buf);
159 objp->indirect = (int)IXDR_GET_INT32(buf);
161 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
164 if (!xdr_pointer(xdrs, (char **) pnext,
165 sizeof (rpcbs_rmtcalllist),
166 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
171 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
174 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
177 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
180 if (!xdr_int(xdrs, &objp->success)) {
183 if (!xdr_int(xdrs, &objp->failure)) {
186 if (!xdr_int(xdrs, &objp->indirect)) {
189 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
192 if (!xdr_pointer(xdrs, (char **) pnext,
193 sizeof (rpcbs_rmtcalllist),
194 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
201 xdr_rpcbs_proc(xdrs, objp)
205 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
206 sizeof (int), (xdrproc_t)xdr_int)) {
213 xdr_rpcbs_addrlist_ptr(xdrs, objp)
215 rpcbs_addrlist_ptr *objp;
217 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
218 (xdrproc_t)xdr_rpcbs_addrlist)) {
225 xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
227 rpcbs_rmtcalllist_ptr *objp;
229 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
230 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
237 xdr_rpcb_stat(xdrs, objp)
242 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
245 if (!xdr_int(xdrs, &objp->setinfo)) {
248 if (!xdr_int(xdrs, &objp->unsetinfo)) {
251 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
254 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
261 * One rpcb_stat structure is returned for each version of rpcbind
265 xdr_rpcb_stat_byvers(xdrs, objp)
267 rpcb_stat_byvers objp;
269 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
270 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {