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>
43 /* Link list of all the stats about getport and getaddr */
46 xdr_rpcbs_addrlist(xdrs
, objp
)
51 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
54 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
57 if (!xdr_int(xdrs
, &objp
->success
)) {
60 if (!xdr_int(xdrs
, &objp
->failure
)) {
63 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
67 if (!xdr_pointer(xdrs
, (char **)&objp
->next
,
68 sizeof (rpcbs_addrlist
),
69 (xdrproc_t
)xdr_rpcbs_addrlist
)) {
76 /* Link list of all the stats about rmtcall */
79 xdr_rpcbs_rmtcalllist(xdrs
, objp
)
81 rpcbs_rmtcalllist
*objp
;
85 if (xdrs
->x_op
== XDR_ENCODE
) {
86 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
88 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
91 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
94 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
97 if (!xdr_int(xdrs
, &objp
->success
)) {
100 if (!xdr_int(xdrs
, &objp
->failure
)) {
103 if (!xdr_int(xdrs
, &objp
->indirect
)) {
107 IXDR_PUT_U_INT32(buf
, objp
->prog
);
108 IXDR_PUT_U_INT32(buf
, objp
->vers
);
109 IXDR_PUT_U_INT32(buf
, objp
->proc
);
110 IXDR_PUT_INT32(buf
, objp
->success
);
111 IXDR_PUT_INT32(buf
, objp
->failure
);
112 IXDR_PUT_INT32(buf
, objp
->indirect
);
114 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
117 if (!xdr_pointer(xdrs
, (char **)&objp
->next
,
118 sizeof (rpcbs_rmtcalllist
),
119 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
123 } else if (xdrs
->x_op
== XDR_DECODE
) {
124 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
126 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
129 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
132 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
135 if (!xdr_int(xdrs
, &objp
->success
)) {
138 if (!xdr_int(xdrs
, &objp
->failure
)) {
141 if (!xdr_int(xdrs
, &objp
->indirect
)) {
145 objp
->prog
= (rpcprog_t
)IXDR_GET_U_INT32(buf
);
146 objp
->vers
= (rpcvers_t
)IXDR_GET_U_INT32(buf
);
147 objp
->proc
= (rpcproc_t
)IXDR_GET_U_INT32(buf
);
148 objp
->success
= (int)IXDR_GET_INT32(buf
);
149 objp
->failure
= (int)IXDR_GET_INT32(buf
);
150 objp
->indirect
= (int)IXDR_GET_INT32(buf
);
152 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
155 if (!xdr_pointer(xdrs
, (char **)&objp
->next
,
156 sizeof (rpcbs_rmtcalllist
),
157 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
162 if (!xdr_u_int32_t(xdrs
, &objp
->prog
)) {
165 if (!xdr_u_int32_t(xdrs
, &objp
->vers
)) {
168 if (!xdr_u_int32_t(xdrs
, &objp
->proc
)) {
171 if (!xdr_int(xdrs
, &objp
->success
)) {
174 if (!xdr_int(xdrs
, &objp
->failure
)) {
177 if (!xdr_int(xdrs
, &objp
->indirect
)) {
180 if (!xdr_string(xdrs
, &objp
->netid
, (u_int
)~0)) {
183 if (!xdr_pointer(xdrs
, (char **)&objp
->next
,
184 sizeof (rpcbs_rmtcalllist
),
185 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
192 xdr_rpcbs_proc(xdrs
, objp
)
196 if (!xdr_vector(xdrs
, (char *)(void *)objp
, RPCBSTAT_HIGHPROC
,
197 sizeof (int), (xdrproc_t
)xdr_int
)) {
204 xdr_rpcbs_addrlist_ptr(xdrs
, objp
)
206 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(xdrs
, objp
)
218 rpcbs_rmtcalllist_ptr
*objp
;
220 if (!xdr_pointer(xdrs
, (char **)objp
, sizeof (rpcbs_rmtcalllist
),
221 (xdrproc_t
)xdr_rpcbs_rmtcalllist
)) {
228 xdr_rpcb_stat(xdrs
, objp
)
233 if (!xdr_rpcbs_proc(xdrs
, objp
->info
)) {
236 if (!xdr_int(xdrs
, &objp
->setinfo
)) {
239 if (!xdr_int(xdrs
, &objp
->unsetinfo
)) {
242 if (!xdr_rpcbs_addrlist_ptr(xdrs
, &objp
->addrinfo
)) {
245 if (!xdr_rpcbs_rmtcalllist_ptr(xdrs
, &objp
->rmtinfo
)) {
252 * One rpcb_stat structure is returned for each version of rpcbind
256 xdr_rpcb_stat_byvers(xdrs
, objp
)
258 rpcb_stat_byvers objp
;
260 if (!xdr_vector(xdrs
, (char *)(void *)objp
, RPCBVERS_STAT
,
261 sizeof (rpcb_stat
), (xdrproc_t
)xdr_rpcb_stat
)) {