1 /* $NetBSD: rpcb_st_xdr.c,v 1.7 2006/05/11 17:11:57 mrg 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 #if defined(LIBC_SCCS) && !defined(lint)
43 __RCSID("$NetBSD: rpcb_st_xdr.c,v 1.7 2006/05/11 17:11:57 mrg Exp $");
46 #include "namespace.h"
51 /* Link list of all the stats about getport and getaddr */
54 __weak_alias(xdr_rpcbs_addrlist
,_xdr_rpcbs_addrlist
)
55 __weak_alias(xdr_rpcbs_rmtcalllist
,_xdr_rpcbs_rmtcalllist
)
56 __weak_alias(xdr_rpcbs_proc
,_xdr_rpcbs_proc
)
57 __weak_alias(xdr_rpcbs_addrlist_ptr
,_xdr_rpcbs_addrlist_ptr
)
58 __weak_alias(xdr_rpcbs_rmtcalllist_ptr
,_xdr_rpcbs_rmtcalllist_ptr
)
59 __weak_alias(xdr_rpcb_stat
,_xdr_rpcb_stat
)
60 __weak_alias(xdr_rpcb_stat_byvers
,_xdr_rpcb_stat_byvers
)
64 xdr_rpcbs_addrlist(xdrs
, objp
)
69 _DIAGASSERT(objp
!= NULL
);
71 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
74 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
77 if (!xdr_int(xdrs
, &objp
->success
)) {
80 if (!xdr_int(xdrs
, &objp
->failure
)) {
83 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
87 if (!xdr_pointer(xdrs
, (char **)(void *)&objp
->next
,
88 sizeof (rpcbs_addrlist
),
89 (xdrproc_t
)xdr_rpcbs_addrlist
)) {
96 /* Link list of all the stats about rmtcall */
99 xdr_rpcbs_rmtcalllist(xdrs
, objp
)
101 rpcbs_rmtcalllist
*objp
;
105 _DIAGASSERT(xdrs
!= NULL
);
106 _DIAGASSERT(objp
!= NULL
);
108 if (xdrs
->x_op
== XDR_ENCODE
) {
109 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
111 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
114 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
117 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
120 if (!xdr_int(xdrs
, &objp
->success
)) {
123 if (!xdr_int(xdrs
, &objp
->failure
)) {
126 if (!xdr_int(xdrs
, &objp
->indirect
)) {
130 IXDR_PUT_U_INT32(buf
, objp
->prog
);
131 IXDR_PUT_U_INT32(buf
, objp
->vers
);
132 IXDR_PUT_U_INT32(buf
, objp
->proc
);
133 IXDR_PUT_INT32(buf
, objp
->success
);
134 IXDR_PUT_INT32(buf
, objp
->failure
);
135 IXDR_PUT_INT32(buf
, objp
->indirect
);
137 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
140 if (!xdr_pointer(xdrs
, (char **)(void *)&objp
->next
,
141 sizeof (rpcbs_rmtcalllist
),
142 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
146 } else if (xdrs
->x_op
== XDR_DECODE
) {
147 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
149 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
152 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
155 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
158 if (!xdr_int(xdrs
, &objp
->success
)) {
161 if (!xdr_int(xdrs
, &objp
->failure
)) {
164 if (!xdr_int(xdrs
, &objp
->indirect
)) {
168 objp
->prog
= (rpcprog_t
)IXDR_GET_U_INT32(buf
);
169 objp
->vers
= (rpcvers_t
)IXDR_GET_U_INT32(buf
);
170 objp
->proc
= (rpcproc_t
)IXDR_GET_U_INT32(buf
);
171 objp
->success
= (int)IXDR_GET_INT32(buf
);
172 objp
->failure
= (int)IXDR_GET_INT32(buf
);
173 objp
->indirect
= (int)IXDR_GET_INT32(buf
);
175 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
178 if (!xdr_pointer(xdrs
, (char **)(void *)&objp
->next
,
179 sizeof (rpcbs_rmtcalllist
),
180 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
185 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
188 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
191 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
194 if (!xdr_int(xdrs
, &objp
->success
)) {
197 if (!xdr_int(xdrs
, &objp
->failure
)) {
200 if (!xdr_int(xdrs
, &objp
->indirect
)) {
203 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
206 if (!xdr_pointer(xdrs
, (char **)(void *)&objp
->next
,
207 sizeof (rpcbs_rmtcalllist
),
208 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
215 xdr_rpcbs_proc(xdrs
, objp
)
219 if (!xdr_vector(xdrs
, (char *)(void *)objp
, RPCBSTAT_HIGHPROC
,
220 sizeof (int), (xdrproc_t
)xdr_int
)) {
227 xdr_rpcbs_addrlist_ptr(xdrs
, objp
)
229 rpcbs_addrlist_ptr
*objp
;
231 if (!xdr_pointer(xdrs
, (char **)objp
, sizeof (rpcbs_addrlist
),
232 (xdrproc_t
)xdr_rpcbs_addrlist
)) {
239 xdr_rpcbs_rmtcalllist_ptr(xdrs
, objp
)
241 rpcbs_rmtcalllist_ptr
*objp
;
243 if (!xdr_pointer(xdrs
, (char **)objp
, sizeof (rpcbs_rmtcalllist
),
244 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
251 xdr_rpcb_stat(xdrs
, objp
)
256 _DIAGASSERT(objp
!= NULL
);
258 if (!xdr_rpcbs_proc(xdrs
, objp
->info
)) {
261 if (!xdr_int(xdrs
, &objp
->setinfo
)) {
264 if (!xdr_int(xdrs
, &objp
->unsetinfo
)) {
267 if (!xdr_rpcbs_addrlist_ptr(xdrs
, &objp
->addrinfo
)) {
274 * One rpcb_stat structure is returned for each version of rpcbind
278 xdr_rpcb_stat_byvers(xdrs
, objp
)
280 rpcb_stat_byvers objp
;
282 if (!xdr_vector(xdrs
, (char *)(void *)objp
, RPCBVERS_STAT
,
283 sizeof (rpcb_stat
), (xdrproc_t
)xdr_rpcb_stat
)) {