2 * Copyright (c) 2009, Sun Microsystems, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * - Redistributions of source code must retain the above copyright notice,
8 * this list of conditions and the following disclaimer.
9 * - Redistributions in binary form must reproduce the above copyright notice,
10 * this list of conditions and the following disclaimer in the documentation
11 * and/or other materials provided with the distribution.
12 * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 * contributors may be used to endorse or promote products derived
14 * from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE.
29 * Copyright 1991 Sun Microsystems, Inc.
34 * This file was generated from rpcb_prot.x, but includes only those
35 * routines used with the rpcbind stats facility.
38 #include <sys/cdefs.h>
42 /* Link list of all the stats about getport and getaddr */
45 xdr_rpcbs_addrlist(xdrs, objp)
50 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
53 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
56 if (!xdr_int(xdrs, &objp->success)) {
59 if (!xdr_int(xdrs, &objp->failure)) {
62 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
66 if (!xdr_pointer(xdrs, (char **)&objp->next,
67 sizeof (rpcbs_addrlist),
68 (xdrproc_t)xdr_rpcbs_addrlist)) {
75 /* Link list of all the stats about rmtcall */
78 xdr_rpcbs_rmtcalllist(xdrs, objp)
80 rpcbs_rmtcalllist *objp;
84 if (xdrs->x_op == XDR_ENCODE) {
85 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
87 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
90 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
93 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
96 if (!xdr_int(xdrs, &objp->success)) {
99 if (!xdr_int(xdrs, &objp->failure)) {
102 if (!xdr_int(xdrs, &objp->indirect)) {
106 IXDR_PUT_U_INT32(buf, objp->prog);
107 IXDR_PUT_U_INT32(buf, objp->vers);
108 IXDR_PUT_U_INT32(buf, objp->proc);
109 IXDR_PUT_INT32(buf, objp->success);
110 IXDR_PUT_INT32(buf, objp->failure);
111 IXDR_PUT_INT32(buf, objp->indirect);
113 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
116 if (!xdr_pointer(xdrs, (char **)&objp->next,
117 sizeof (rpcbs_rmtcalllist),
118 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
122 } else if (xdrs->x_op == XDR_DECODE) {
123 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
125 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
128 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
131 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
134 if (!xdr_int(xdrs, &objp->success)) {
137 if (!xdr_int(xdrs, &objp->failure)) {
140 if (!xdr_int(xdrs, &objp->indirect)) {
144 objp->prog = (rpcprog_t)IXDR_GET_U_INT32(buf);
145 objp->vers = (rpcvers_t)IXDR_GET_U_INT32(buf);
146 objp->proc = (rpcproc_t)IXDR_GET_U_INT32(buf);
147 objp->success = (int)IXDR_GET_INT32(buf);
148 objp->failure = (int)IXDR_GET_INT32(buf);
149 objp->indirect = (int)IXDR_GET_INT32(buf);
151 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
154 if (!xdr_pointer(xdrs, (char **)&objp->next,
155 sizeof (rpcbs_rmtcalllist),
156 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
161 if (!xdr_u_int32_t(xdrs, &objp->prog)) {
164 if (!xdr_u_int32_t(xdrs, &objp->vers)) {
167 if (!xdr_u_int32_t(xdrs, &objp->proc)) {
170 if (!xdr_int(xdrs, &objp->success)) {
173 if (!xdr_int(xdrs, &objp->failure)) {
176 if (!xdr_int(xdrs, &objp->indirect)) {
179 if (!xdr_string(xdrs, &objp->netid, (u_int)~0)) {
182 if (!xdr_pointer(xdrs, (char **)&objp->next,
183 sizeof (rpcbs_rmtcalllist),
184 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
191 xdr_rpcbs_proc(xdrs, objp)
195 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBSTAT_HIGHPROC,
196 sizeof (int), (xdrproc_t)xdr_int)) {
203 xdr_rpcbs_addrlist_ptr(xdrs, objp)
205 rpcbs_addrlist_ptr *objp;
207 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_addrlist),
208 (xdrproc_t)xdr_rpcbs_addrlist)) {
215 xdr_rpcbs_rmtcalllist_ptr(xdrs, objp)
217 rpcbs_rmtcalllist_ptr *objp;
219 if (!xdr_pointer(xdrs, (char **)objp, sizeof (rpcbs_rmtcalllist),
220 (xdrproc_t)xdr_rpcbs_rmtcalllist)) {
227 xdr_rpcb_stat(xdrs, objp)
232 if (!xdr_rpcbs_proc(xdrs, objp->info)) {
235 if (!xdr_int(xdrs, &objp->setinfo)) {
238 if (!xdr_int(xdrs, &objp->unsetinfo)) {
241 if (!xdr_rpcbs_addrlist_ptr(xdrs, &objp->addrinfo)) {
244 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs, &objp->rmtinfo)) {
251 * One rpcb_stat structure is returned for each version of rpcbind
255 xdr_rpcb_stat_byvers(xdrs, objp)
257 rpcb_stat_byvers objp;
259 if (!xdr_vector(xdrs, (char *)(void *)objp, RPCBVERS_STAT,
260 sizeof (rpcb_stat), (xdrproc_t)xdr_rpcb_stat)) {