2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
29 * $NetBSD: rpcb_st_xdr.c,v 1.3 2000/07/14 08:40:42 fvdl Exp $
30 * $FreeBSD: src/lib/libc/rpc/rpcb_st_xdr.c,v 1.4 2007/11/20 01:51:20 jb Exp $
33 * Copyright 1991 Sun Microsystems, Inc.
38 * This file was generated from rpcb_prot.x, but includes only those
39 * routines used with the rpcbind stats facility.
42 #include "namespace.h"
44 #include "un-namespace.h"
46 /* Link list of all the stats about getport and getaddr */
49 xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp)
51 struct rpcbs_addrlist **pnext;
53 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
56 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
59 if (!xdr_int(xdrs, &objp->success)) {
62 if (!xdr_int(xdrs, &objp->failure)) {
65 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
71 if (!xdr_pointer(xdrs, (char **) pnext,
72 sizeof (rpcbs_addrlist),
73 (xdrproc_t)xdr_rpcbs_addrlist)) {
80 /* Link list of all the stats about rmtcall */
83 xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp)
86 struct rpcbs_rmtcalllist **pnext;
88 if (xdrs->x_op == XDR_ENCODE) {
89 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
91 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
94 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
97 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
100 if (!xdr_int(xdrs, &objp->success)) {
103 if (!xdr_int(xdrs, &objp->failure)) {
106 if (!xdr_int(xdrs, &objp->indirect)) {
110 IXDR_PUT_U_INT32(buf, objp->prog);
111 IXDR_PUT_U_INT32(buf, objp->vers);
112 IXDR_PUT_U_INT32(buf, objp->proc);
113 IXDR_PUT_INT32(buf, objp->success);
114 IXDR_PUT_INT32(buf, objp->failure);
115 IXDR_PUT_INT32(buf, objp->indirect);
117 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
121 if (!xdr_pointer(xdrs, (char **) pnext,
122 sizeof (rpcbs_rmtcalllist),
123 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
127 } else if (xdrs->x_op == XDR_DECODE) {
128 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
130 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
133 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
136 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
139 if (!xdr_int(xdrs, &objp->success)) {
142 if (!xdr_int(xdrs, &objp->failure)) {
145 if (!xdr_int(xdrs, &objp->indirect)) {
149 objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
150 objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
151 objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
152 objp->success = (int)IXDR_GET_INT32(buf);
153 objp->failure = (int)IXDR_GET_INT32(buf);
154 objp->indirect = (int)IXDR_GET_INT32(buf);
156 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
159 if (!xdr_pointer(xdrs, (char **) pnext,
160 sizeof (rpcbs_rmtcalllist),
161 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
166 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
169 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
172 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
175 if (!xdr_int(xdrs, &objp->success)) {
178 if (!xdr_int(xdrs, &objp->failure)) {
181 if (!xdr_int(xdrs, &objp->indirect)) {
184 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
187 if (!xdr_pointer(xdrs, (char **) pnext,
188 sizeof (rpcbs_rmtcalllist),
189 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
196 xdr_rpcbs_proc(XDR *xdrs, rpcbs_proc objp)
198 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
199 sizeof (int), (xdrproc_t)xdr_int)) {
206 xdr_rpcbs_addrlist_ptr(XDR *xdrs, rpcbs_addrlist_ptr *objp)
208 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
209 (xdrproc_t)xdr_rpcbs_addrlist)) {
216 xdr_rpcbs_rmtcalllist_ptr(XDR *xdrs, rpcbs_rmtcalllist_ptr *objp)
218 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
219 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
226 xdr_rpcb_stat(XDR *xdrs, rpcb_stat *objp)
229 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
232 if (!xdr_int(xdrs, &objp->setinfo)) {
235 if (!xdr_int(xdrs, &objp->unsetinfo)) {
238 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
241 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
248 * One rpcb_stat structure is returned for each version of rpcbind
252 xdr_rpcb_stat_byvers(XDR *xdrs, rpcb_stat_byvers objp)
254 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
255 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {