1 /* $NetBSD: rpcb_st_xdr.c,v 1.3 2000/07/14 08:40:42 fvdl Exp $ */
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
5 * unrestricted use provided that this legend is included on all tape
6 * media and as a part of the software program in whole or part. Users
7 * may copy or modify Sun RPC without charge, but are not authorized
8 * to license or distribute it to anyone else except as part of a product or
9 * program developed by the user.
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
15 * Sun RPC is provided with no support and without any obligation on the
16 * part of Sun Microsystems, Inc. to assist in its use, correction,
17 * modification or enhancement.
19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
21 * OR ANY PART THEREOF.
23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
24 * or profits or other special, indirect and consequential damages, even if
25 * Sun has been advised of the possibility of such damages.
27 * Sun Microsystems, Inc.
29 * Mountain View, California 94043
32 * Copyright 1991 Sun Microsystems, Inc.
37 * This file was generated from rpcb_prot.x, but includes only those
38 * routines used with the rpcbind stats facility.
41 #include <sys/cdefs.h>
42 __FBSDID("$FreeBSD$");
44 #include "namespace.h"
46 #include "un-namespace.h"
48 /* Link list of all the stats about getport and getaddr */
51 xdr_rpcbs_addrlist(xdrs, objp)
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)) {
72 if (!xdr_pointer(xdrs, (char **)&objp->next,
73 sizeof (rpcbs_addrlist),
74 (xdrproc_t)xdr_rpcbs_addrlist)) {
81 /* Link list of all the stats about rmtcall */
84 xdr_rpcbs_rmtcalllist(xdrs, objp)
86 rpcbs_rmtcalllist *objp;
90 if (xdrs->x_op == XDR_ENCODE) {
91 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
93 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
96 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
99 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
102 if (!xdr_int(xdrs, &objp->success)) {
105 if (!xdr_int(xdrs, &objp->failure)) {
108 if (!xdr_int(xdrs, &objp->indirect)) {
112 IXDR_PUT_U_INT32(buf, objp->prog);
113 IXDR_PUT_U_INT32(buf, objp->vers);
114 IXDR_PUT_U_INT32(buf, objp->proc);
115 IXDR_PUT_INT32(buf, objp->success);
116 IXDR_PUT_INT32(buf, objp->failure);
117 IXDR_PUT_INT32(buf, objp->indirect);
119 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
122 if (!xdr_pointer(xdrs, (char **)&objp->next,
123 sizeof (rpcbs_rmtcalllist),
124 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
128 } else if (xdrs->x_op == XDR_DECODE) {
129 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
131 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
134 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
137 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
140 if (!xdr_int(xdrs, &objp->success)) {
143 if (!xdr_int(xdrs, &objp->failure)) {
146 if (!xdr_int(xdrs, &objp->indirect)) {
150 objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
151 objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
152 objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
153 objp->success = (int)IXDR_GET_INT32(buf);
154 objp->failure = (int)IXDR_GET_INT32(buf);
155 objp->indirect = (int)IXDR_GET_INT32(buf);
157 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
160 if (!xdr_pointer(xdrs, (char **)&objp->next,
161 sizeof (rpcbs_rmtcalllist),
162 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
167 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
170 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
173 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
176 if (!xdr_int(xdrs, &objp->success)) {
179 if (!xdr_int(xdrs, &objp->failure)) {
182 if (!xdr_int(xdrs, &objp->indirect)) {
185 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
188 if (!xdr_pointer(xdrs, (char **)&objp->next,
189 sizeof (rpcbs_rmtcalllist),
190 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
197 xdr_rpcbs_proc(xdrs, objp)
201 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
202 sizeof (int), (xdrproc_t)xdr_int)) {
209 xdr_rpcbs_addrlist_ptr(xdrs, objp)
211 rpcbs_addrlist_ptr *objp;
213 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
214 (xdrproc_t)xdr_rpcbs_addrlist)) {
221 xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
223 rpcbs_rmtcalllist_ptr *objp;
225 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
226 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
233 xdr_rpcb_stat(xdrs, objp)
238 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
241 if (!xdr_int(xdrs, &objp->setinfo)) {
244 if (!xdr_int(xdrs, &objp->unsetinfo)) {
247 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
250 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
257 * One rpcb_stat structure is returned for each version of rpcbind
261 xdr_rpcb_stat_byvers(xdrs, objp)
263 rpcb_stat_byvers objp;
265 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
266 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {