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)
55 struct rpcbs_addrlist **pnext;
57 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
60 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
63 if (!xdr_int(xdrs, &objp->success)) {
66 if (!xdr_int(xdrs, &objp->failure)) {
69 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
75 if (!xdr_pointer(xdrs, (char **) pnext,
76 sizeof (rpcbs_addrlist),
77 (xdrproc_t)xdr_rpcbs_addrlist)) {
84 /* Link list of all the stats about rmtcall */
87 xdr_rpcbs_rmtcalllist(xdrs, objp)
89 rpcbs_rmtcalllist *objp;
92 struct rpcbs_rmtcalllist **pnext;
94 if (xdrs->x_op == XDR_ENCODE) {
95 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
97 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
100 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
103 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
106 if (!xdr_int(xdrs, &objp->success)) {
109 if (!xdr_int(xdrs, &objp->failure)) {
112 if (!xdr_int(xdrs, &objp->indirect)) {
116 IXDR_PUT_U_INT32(buf, objp->prog);
117 IXDR_PUT_U_INT32(buf, objp->vers);
118 IXDR_PUT_U_INT32(buf, objp->proc);
119 IXDR_PUT_INT32(buf, objp->success);
120 IXDR_PUT_INT32(buf, objp->failure);
121 IXDR_PUT_INT32(buf, objp->indirect);
123 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
127 if (!xdr_pointer(xdrs, (char **) pnext,
128 sizeof (rpcbs_rmtcalllist),
129 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
133 } else if (xdrs->x_op == XDR_DECODE) {
134 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
136 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
139 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
142 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
145 if (!xdr_int(xdrs, &objp->success)) {
148 if (!xdr_int(xdrs, &objp->failure)) {
151 if (!xdr_int(xdrs, &objp->indirect)) {
155 objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
156 objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
157 objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
158 objp->success = (int)IXDR_GET_INT32(buf);
159 objp->failure = (int)IXDR_GET_INT32(buf);
160 objp->indirect = (int)IXDR_GET_INT32(buf);
162 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
165 if (!xdr_pointer(xdrs, (char **) pnext,
166 sizeof (rpcbs_rmtcalllist),
167 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
172 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
175 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
178 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
181 if (!xdr_int(xdrs, &objp->success)) {
184 if (!xdr_int(xdrs, &objp->failure)) {
187 if (!xdr_int(xdrs, &objp->indirect)) {
190 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
193 if (!xdr_pointer(xdrs, (char **) pnext,
194 sizeof (rpcbs_rmtcalllist),
195 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
202 xdr_rpcbs_proc(xdrs, objp)
206 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
207 sizeof (int), (xdrproc_t)xdr_int)) {
214 xdr_rpcbs_addrlist_ptr(xdrs, objp)
216 rpcbs_addrlist_ptr *objp;
218 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
219 (xdrproc_t)xdr_rpcbs_addrlist)) {
226 xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
228 rpcbs_rmtcalllist_ptr *objp;
230 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
231 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
238 xdr_rpcb_stat(xdrs, objp)
243 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
246 if (!xdr_int(xdrs, &objp->setinfo)) {
249 if (!xdr_int(xdrs, &objp->unsetinfo)) {
252 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
255 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
262 * One rpcb_stat structure is returned for each version of rpcbind
266 xdr_rpcb_stat_byvers(xdrs, objp)
268 rpcb_stat_byvers objp;
270 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
271 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {