4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 #pragma ident "%Z%%M% %I% %E% SMI"
31 * This file was generated from rpcb_prot.x, but includes only those
32 * routines used with the rpcbind stats facility.
38 /* Link list of all the stats about getport and getaddr */
41 xdr_rpcbs_addrlist(XDR
*xdrs
, rpcbs_addrlist
*objp
)
43 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->prog
))
45 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->vers
))
47 if (!xdr_int(xdrs
, &objp
->success
))
49 if (!xdr_int(xdrs
, &objp
->failure
))
51 return (xdr_string(xdrs
, &objp
->netid
, ~0));
54 /* Link list of all the stats about rmtcall */
57 xdr_rpcbs_rmtcalllist(XDR
*xdrs
, rpcbs_rmtcalllist
*objp
)
63 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
65 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->prog
))
67 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->vers
))
69 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->proc
))
71 if (!xdr_int(xdrs
, &objp
->success
))
73 if (!xdr_int(xdrs
, &objp
->failure
))
75 if (!xdr_int(xdrs
, &objp
->indirect
))
78 IXDR_PUT_U_INT32(buf
, objp
->prog
);
79 IXDR_PUT_U_INT32(buf
, objp
->vers
);
80 IXDR_PUT_U_INT32(buf
, objp
->proc
);
81 IXDR_PUT_INT32(buf
, objp
->success
);
82 IXDR_PUT_INT32(buf
, objp
->failure
);
83 IXDR_PUT_INT32(buf
, objp
->indirect
);
85 if (!xdr_string(xdrs
, &objp
->netid
, ~0))
87 return (xdr_pointer(xdrs
, (char **)&objp
->next
,
88 (uint_t
)sizeof (rpcbs_rmtcalllist
),
89 (xdrproc_t
)xdr_rpcbs_rmtcalllist
));
91 buf
= XDR_INLINE(xdrs
, 6 * BYTES_PER_XDR_UNIT
);
93 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->prog
))
95 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->vers
))
97 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->proc
))
99 if (!xdr_int(xdrs
, &objp
->success
))
101 if (!xdr_int(xdrs
, &objp
->failure
))
103 if (!xdr_int(xdrs
, &objp
->indirect
))
106 objp
->prog
= IXDR_GET_U_INT32(buf
);
107 objp
->vers
= IXDR_GET_U_INT32(buf
);
108 objp
->proc
= IXDR_GET_U_INT32(buf
);
109 objp
->success
= IXDR_GET_INT32(buf
);
110 objp
->failure
= IXDR_GET_INT32(buf
);
111 objp
->indirect
= IXDR_GET_INT32(buf
);
113 if (!xdr_string(xdrs
, &objp
->netid
, ~0))
115 return (xdr_pointer(xdrs
, (char **)&objp
->next
,
116 (uint_t
)sizeof (rpcbs_rmtcalllist
),
117 (xdrproc_t
)xdr_rpcbs_rmtcalllist
));
119 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->prog
))
121 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->vers
))
123 if (!xdr_u_int(xdrs
, (uint_t
*)&objp
->proc
))
125 if (!xdr_int(xdrs
, &objp
->success
))
127 if (!xdr_int(xdrs
, &objp
->failure
))
129 if (!xdr_int(xdrs
, &objp
->indirect
))
131 if (!xdr_string(xdrs
, &objp
->netid
, ~0))
133 return (xdr_pointer(xdrs
, (char **)&objp
->next
,
134 (uint_t
)sizeof (rpcbs_rmtcalllist
),
135 (xdrproc_t
)xdr_rpcbs_rmtcalllist
));
142 xdr_rpcbs_proc(XDR
*xdrs
, rpcbs_proc objp
)
144 return (xdr_vector(xdrs
, (char *)objp
, RPCBSTAT_HIGHPROC
, sizeof (int),
145 (xdrproc_t
)xdr_int
));
149 xdr_rpcbs_addrlist_ptr(XDR
*xdrs
, rpcbs_addrlist_ptr
*objp
)
152 rpcbs_addrlist_ptr
*nextp
;
155 more_data
= (*objp
!= NULL
);
157 if (!xdr_bool(xdrs
, &more_data
))
163 if (xdrs
->x_op
== XDR_FREE
)
164 nextp
= &(*objp
)->next
;
166 if (!xdr_reference(xdrs
, (char **)objp
,
167 (uint_t
)sizeof (rpcbs_addrlist
),
168 (xdrproc_t
)xdr_rpcbs_addrlist
))
171 objp
= (xdrs
->x_op
== XDR_FREE
) ? nextp
: &(*objp
)->next
;
179 xdr_rpcbs_rmtcalllist_ptr(XDR
*xdrs
, rpcbs_rmtcalllist_ptr
*objp
)
181 return (xdr_pointer(xdrs
, (char **)objp
, sizeof (rpcbs_rmtcalllist
),
182 (xdrproc_t
)xdr_rpcbs_rmtcalllist
));
186 xdr_rpcb_stat(XDR
*xdrs
, rpcb_stat
*objp
)
188 if (!xdr_rpcbs_proc(xdrs
, objp
->info
))
190 if (!xdr_int(xdrs
, &objp
->setinfo
))
192 if (!xdr_int(xdrs
, &objp
->unsetinfo
))
194 if (!xdr_rpcbs_addrlist_ptr(xdrs
, &objp
->addrinfo
))
196 return (xdr_rpcbs_rmtcalllist_ptr(xdrs
, &objp
->rmtinfo
));
200 * One rpcb_stat structure is returned for each version of rpcbind
204 xdr_rpcb_stat_byvers(XDR
*xdrs
, rpcb_stat_byvers objp
)
206 return (xdr_vector(xdrs
, (char *)objp
, RPCBVERS_STAT
,
207 sizeof (rpcb_stat
), (xdrproc_t
)xdr_rpcb_stat
));