1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate * CDDL HEADER START
3*0Sstevel@tonic-gate *
4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance
7*0Sstevel@tonic-gate * with the License.
8*0Sstevel@tonic-gate *
9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate * and limitations under the License.
13*0Sstevel@tonic-gate *
14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate *
20*0Sstevel@tonic-gate * CDDL HEADER END
21*0Sstevel@tonic-gate */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate * Copyright (c) 1999 by Sun Microsystems, Inc.
24*0Sstevel@tonic-gate * All rights reserved.
25*0Sstevel@tonic-gate */
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gate #include <nfs/nfs.h>
30*0Sstevel@tonic-gate #include <nfs/nfs_log.h>
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate static bool_t xdr_timestruc32_t(XDR *, timestruc32_t *);
33*0Sstevel@tonic-gate static bool_t xdr_nfs2_timeval(XDR *, nfs2_timeval *);
34*0Sstevel@tonic-gate static bool_t xdr_ftype3(XDR *, ftype3 *);
35*0Sstevel@tonic-gate static bool_t xdr_stable_how(XDR *, stable_how *);
36*0Sstevel@tonic-gate static bool_t xdr_createmode3(XDR *, createmode3 *);
37*0Sstevel@tonic-gate static bool_t xdr_size3(XDR *, size3 *);
38*0Sstevel@tonic-gate static bool_t xdr_count3(XDR *, count3 *);
39*0Sstevel@tonic-gate static bool_t xdr_set_size3(XDR *, set_size3 *);
40*0Sstevel@tonic-gate static bool_t xdr_offset3(XDR *, offset3 *);
41*0Sstevel@tonic-gate static bool_t xdr_post_op_fh3(XDR *, post_op_fh3 *);
42*0Sstevel@tonic-gate static bool_t xdr_nfsreadargs(XDR *, struct nfsreadargs *);
43*0Sstevel@tonic-gate static bool_t xdr_nfslog_record_header(XDR *, nfslog_record_header *);
44*0Sstevel@tonic-gate static bool_t xdr_nfslog_drok(XDR *, nfslog_drok *);
45*0Sstevel@tonic-gate static bool_t xdr_nfslog_rrok(XDR *, nfslog_rrok *);
46*0Sstevel@tonic-gate static bool_t xdr_nfslog_sattr(XDR *, nfslog_sattr *);
47*0Sstevel@tonic-gate static bool_t xdr_nfslog_rdok(XDR *, nfslog_rdok *);
48*0Sstevel@tonic-gate static bool_t xdr_nfslog_createhow3(XDR *, nfslog_createhow3 *);
49*0Sstevel@tonic-gate static bool_t xdr_nfslog_CREATE3resok(XDR *, nfslog_CREATE3resok *);
50*0Sstevel@tonic-gate static bool_t xdr_nfslog_READ3resok(XDR *, nfslog_READ3resok *);
51*0Sstevel@tonic-gate static bool_t xdr_nfslog_WRITE3resok(XDR *, nfslog_WRITE3resok *);
52*0Sstevel@tonic-gate static bool_t xdr_nfslog_entryplus3(XDR *, nfslog_entryplus3 *);
53*0Sstevel@tonic-gate static bool_t xdr_nfslog_dirlistplus3(XDR *, nfslog_dirlistplus3 *);
54*0Sstevel@tonic-gate static bool_t xdr_nfslog_READDIRPLUS3resok(XDR *, nfslog_READDIRPLUS3resok *);
55*0Sstevel@tonic-gate
56*0Sstevel@tonic-gate static bool_t
xdr_timestruc32_t(XDR * xdrs,timestruc32_t * objp)57*0Sstevel@tonic-gate xdr_timestruc32_t(XDR *xdrs, timestruc32_t *objp)
58*0Sstevel@tonic-gate {
59*0Sstevel@tonic-gate if (!xdr_int(xdrs, &objp->tv_sec))
60*0Sstevel@tonic-gate return (FALSE);
61*0Sstevel@tonic-gate if (!xdr_int(xdrs, &objp->tv_nsec))
62*0Sstevel@tonic-gate return (FALSE);
63*0Sstevel@tonic-gate return (TRUE);
64*0Sstevel@tonic-gate }
65*0Sstevel@tonic-gate
66*0Sstevel@tonic-gate static bool_t
xdr_nfs2_timeval(XDR * xdrs,nfs2_timeval * objp)67*0Sstevel@tonic-gate xdr_nfs2_timeval(XDR *xdrs, nfs2_timeval *objp)
68*0Sstevel@tonic-gate {
69*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->tv_sec))
70*0Sstevel@tonic-gate return (FALSE);
71*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->tv_usec))
72*0Sstevel@tonic-gate return (FALSE);
73*0Sstevel@tonic-gate return (TRUE);
74*0Sstevel@tonic-gate }
75*0Sstevel@tonic-gate
76*0Sstevel@tonic-gate bool_t
xdr_nfsstat(XDR * xdrs,nfsstat * objp)77*0Sstevel@tonic-gate xdr_nfsstat(XDR *xdrs, nfsstat *objp)
78*0Sstevel@tonic-gate {
79*0Sstevel@tonic-gate if (!xdr_enum(xdrs, (enum_t *)objp))
80*0Sstevel@tonic-gate return (FALSE);
81*0Sstevel@tonic-gate return (TRUE);
82*0Sstevel@tonic-gate }
83*0Sstevel@tonic-gate
84*0Sstevel@tonic-gate bool_t
xdr_uint64(XDR * xdrs,uint64 * objp)85*0Sstevel@tonic-gate xdr_uint64(XDR *xdrs, uint64 *objp)
86*0Sstevel@tonic-gate {
87*0Sstevel@tonic-gate return (xdr_u_longlong_t(xdrs, objp));
88*0Sstevel@tonic-gate }
89*0Sstevel@tonic-gate
90*0Sstevel@tonic-gate bool_t
xdr_uint32(XDR * xdrs,uint32 * objp)91*0Sstevel@tonic-gate xdr_uint32(XDR *xdrs, uint32 *objp)
92*0Sstevel@tonic-gate {
93*0Sstevel@tonic-gate return (xdr_u_int(xdrs, objp));
94*0Sstevel@tonic-gate }
95*0Sstevel@tonic-gate
96*0Sstevel@tonic-gate static bool_t
xdr_ftype3(XDR * xdrs,ftype3 * objp)97*0Sstevel@tonic-gate xdr_ftype3(XDR *xdrs, ftype3 *objp)
98*0Sstevel@tonic-gate {
99*0Sstevel@tonic-gate return (xdr_enum(xdrs, (enum_t *)objp));
100*0Sstevel@tonic-gate }
101*0Sstevel@tonic-gate
102*0Sstevel@tonic-gate static bool_t
xdr_stable_how(XDR * xdrs,stable_how * objp)103*0Sstevel@tonic-gate xdr_stable_how(XDR *xdrs, stable_how *objp)
104*0Sstevel@tonic-gate {
105*0Sstevel@tonic-gate return (xdr_enum(xdrs, (enum_t *)objp));
106*0Sstevel@tonic-gate }
107*0Sstevel@tonic-gate
108*0Sstevel@tonic-gate static bool_t
xdr_createmode3(XDR * xdrs,createmode3 * objp)109*0Sstevel@tonic-gate xdr_createmode3(XDR *xdrs, createmode3 *objp)
110*0Sstevel@tonic-gate {
111*0Sstevel@tonic-gate return (xdr_enum(xdrs, (enum_t *)objp));
112*0Sstevel@tonic-gate }
113*0Sstevel@tonic-gate
114*0Sstevel@tonic-gate static bool_t
xdr_size3(XDR * xdrs,size3 * objp)115*0Sstevel@tonic-gate xdr_size3(XDR *xdrs, size3 *objp)
116*0Sstevel@tonic-gate {
117*0Sstevel@tonic-gate return (xdr_uint64(xdrs, objp));
118*0Sstevel@tonic-gate }
119*0Sstevel@tonic-gate
120*0Sstevel@tonic-gate static bool_t
xdr_count3(XDR * xdrs,count3 * objp)121*0Sstevel@tonic-gate xdr_count3(XDR *xdrs, count3 *objp)
122*0Sstevel@tonic-gate {
123*0Sstevel@tonic-gate return (xdr_uint32(xdrs, objp));
124*0Sstevel@tonic-gate }
125*0Sstevel@tonic-gate
126*0Sstevel@tonic-gate static bool_t
xdr_set_size3(XDR * xdrs,set_size3 * objp)127*0Sstevel@tonic-gate xdr_set_size3(XDR *xdrs, set_size3 *objp)
128*0Sstevel@tonic-gate {
129*0Sstevel@tonic-gate if (!xdr_bool(xdrs, &objp->set_it))
130*0Sstevel@tonic-gate return (FALSE);
131*0Sstevel@tonic-gate switch (objp->set_it) {
132*0Sstevel@tonic-gate case TRUE:
133*0Sstevel@tonic-gate if (!xdr_size3(xdrs, &objp->size))
134*0Sstevel@tonic-gate return (FALSE);
135*0Sstevel@tonic-gate break;
136*0Sstevel@tonic-gate }
137*0Sstevel@tonic-gate return (TRUE);
138*0Sstevel@tonic-gate }
139*0Sstevel@tonic-gate
140*0Sstevel@tonic-gate static bool_t
xdr_offset3(XDR * xdrs,offset3 * objp)141*0Sstevel@tonic-gate xdr_offset3(XDR *xdrs, offset3 *objp)
142*0Sstevel@tonic-gate {
143*0Sstevel@tonic-gate return (xdr_uint64(xdrs, objp));
144*0Sstevel@tonic-gate }
145*0Sstevel@tonic-gate
146*0Sstevel@tonic-gate bool_t
xdr_fhandle(XDR * xdrs,fhandle_t * fh)147*0Sstevel@tonic-gate xdr_fhandle(XDR *xdrs, fhandle_t *fh)
148*0Sstevel@tonic-gate {
149*0Sstevel@tonic-gate if (xdrs->x_op == XDR_FREE)
150*0Sstevel@tonic-gate return (TRUE);
151*0Sstevel@tonic-gate
152*0Sstevel@tonic-gate return (xdr_opaque(xdrs, (caddr_t)fh, NFS_FHSIZE));
153*0Sstevel@tonic-gate }
154*0Sstevel@tonic-gate
155*0Sstevel@tonic-gate
156*0Sstevel@tonic-gate bool_t
xdr_nfs_fh3(XDR * xdrs,nfs_fh3 * objp)157*0Sstevel@tonic-gate xdr_nfs_fh3(XDR *xdrs, nfs_fh3 *objp)
158*0Sstevel@tonic-gate {
159*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->fh3_length))
160*0Sstevel@tonic-gate return (FALSE);
161*0Sstevel@tonic-gate
162*0Sstevel@tonic-gate if (objp->fh3_length > NFS3_FHSIZE)
163*0Sstevel@tonic-gate return (FALSE);
164*0Sstevel@tonic-gate
165*0Sstevel@tonic-gate if (xdrs->x_op == XDR_DECODE || xdrs->x_op == XDR_ENCODE)
166*0Sstevel@tonic-gate return (xdr_opaque(xdrs, objp->fh3_u.data, objp->fh3_length));
167*0Sstevel@tonic-gate
168*0Sstevel@tonic-gate if (xdrs->x_op == XDR_FREE)
169*0Sstevel@tonic-gate return (TRUE);
170*0Sstevel@tonic-gate
171*0Sstevel@tonic-gate return (FALSE);
172*0Sstevel@tonic-gate }
173*0Sstevel@tonic-gate
174*0Sstevel@tonic-gate static bool_t
xdr_post_op_fh3(XDR * xdrs,post_op_fh3 * objp)175*0Sstevel@tonic-gate xdr_post_op_fh3(XDR *xdrs, post_op_fh3 *objp)
176*0Sstevel@tonic-gate {
177*0Sstevel@tonic-gate if (!xdr_bool(xdrs, &objp->handle_follows))
178*0Sstevel@tonic-gate return (FALSE);
179*0Sstevel@tonic-gate switch (objp->handle_follows) {
180*0Sstevel@tonic-gate case TRUE:
181*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->handle))
182*0Sstevel@tonic-gate return (FALSE);
183*0Sstevel@tonic-gate break;
184*0Sstevel@tonic-gate case FALSE:
185*0Sstevel@tonic-gate break;
186*0Sstevel@tonic-gate default:
187*0Sstevel@tonic-gate return (FALSE);
188*0Sstevel@tonic-gate }
189*0Sstevel@tonic-gate return (TRUE);
190*0Sstevel@tonic-gate }
191*0Sstevel@tonic-gate
192*0Sstevel@tonic-gate bool_t
xdr_nfsstat3(XDR * xdrs,nfsstat3 * objp)193*0Sstevel@tonic-gate xdr_nfsstat3(XDR *xdrs, nfsstat3 *objp)
194*0Sstevel@tonic-gate {
195*0Sstevel@tonic-gate return (xdr_enum(xdrs, (enum_t *)objp));
196*0Sstevel@tonic-gate }
197*0Sstevel@tonic-gate
198*0Sstevel@tonic-gate static bool_t
xdr_nfsreadargs(XDR * xdrs,struct nfsreadargs * ra)199*0Sstevel@tonic-gate xdr_nfsreadargs(XDR *xdrs, struct nfsreadargs *ra)
200*0Sstevel@tonic-gate {
201*0Sstevel@tonic-gate if (xdr_fhandle(xdrs, &ra->ra_fhandle) &&
202*0Sstevel@tonic-gate xdr_u_int(xdrs, &ra->ra_offset) &&
203*0Sstevel@tonic-gate xdr_u_int(xdrs, &ra->ra_count) &&
204*0Sstevel@tonic-gate xdr_u_int(xdrs, &ra->ra_totcount)) {
205*0Sstevel@tonic-gate return (TRUE);
206*0Sstevel@tonic-gate }
207*0Sstevel@tonic-gate return (FALSE);
208*0Sstevel@tonic-gate }
209*0Sstevel@tonic-gate
210*0Sstevel@tonic-gate
211*0Sstevel@tonic-gate bool_t
xdr_nfslog_buffer_header(XDR * xdrs,nfslog_buffer_header * objp)212*0Sstevel@tonic-gate xdr_nfslog_buffer_header(XDR *xdrs, nfslog_buffer_header *objp)
213*0Sstevel@tonic-gate {
214*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->bh_length))
215*0Sstevel@tonic-gate return (FALSE);
216*0Sstevel@tonic-gate if (!xdr_rpcvers(xdrs, &objp->bh_version))
217*0Sstevel@tonic-gate return (FALSE);
218*0Sstevel@tonic-gate if (objp->bh_version > 1) {
219*0Sstevel@tonic-gate if (!xdr_u_longlong_t(xdrs, &objp->bh_offset))
220*0Sstevel@tonic-gate return (FALSE);
221*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->bh_flags))
222*0Sstevel@tonic-gate return (FALSE);
223*0Sstevel@tonic-gate } else {
224*0Sstevel@tonic-gate uint_t bh_offset;
225*0Sstevel@tonic-gate
226*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->bh_flags))
227*0Sstevel@tonic-gate return (FALSE);
228*0Sstevel@tonic-gate if (xdrs->x_op == XDR_ENCODE)
229*0Sstevel@tonic-gate bh_offset = (uint_t)objp->bh_offset;
230*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &bh_offset))
231*0Sstevel@tonic-gate return (FALSE);
232*0Sstevel@tonic-gate if (xdrs->x_op == XDR_DECODE)
233*0Sstevel@tonic-gate objp->bh_offset = (u_offset_t)bh_offset;
234*0Sstevel@tonic-gate }
235*0Sstevel@tonic-gate if (!xdr_timestruc32_t(xdrs, &objp->bh_timestamp))
236*0Sstevel@tonic-gate return (FALSE);
237*0Sstevel@tonic-gate return (TRUE);
238*0Sstevel@tonic-gate }
239*0Sstevel@tonic-gate
240*0Sstevel@tonic-gate static bool_t
xdr_nfslog_record_header(XDR * xdrs,nfslog_record_header * objp)241*0Sstevel@tonic-gate xdr_nfslog_record_header(XDR *xdrs, nfslog_record_header *objp)
242*0Sstevel@tonic-gate {
243*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rh_reclen))
244*0Sstevel@tonic-gate return (FALSE);
245*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rh_rec_id))
246*0Sstevel@tonic-gate return (FALSE);
247*0Sstevel@tonic-gate if (!xdr_rpcprog(xdrs, &objp->rh_prognum))
248*0Sstevel@tonic-gate return (FALSE);
249*0Sstevel@tonic-gate if (!xdr_rpcproc(xdrs, &objp->rh_procnum))
250*0Sstevel@tonic-gate return (FALSE);
251*0Sstevel@tonic-gate if (!xdr_rpcvers(xdrs, &objp->rh_version))
252*0Sstevel@tonic-gate return (FALSE);
253*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rh_auth_flavor))
254*0Sstevel@tonic-gate return (FALSE);
255*0Sstevel@tonic-gate if (!xdr_timestruc32_t(xdrs, &objp->rh_timestamp))
256*0Sstevel@tonic-gate return (FALSE);
257*0Sstevel@tonic-gate if (!xdr_uid_t(xdrs, &objp->rh_uid))
258*0Sstevel@tonic-gate return (FALSE);
259*0Sstevel@tonic-gate if (!xdr_gid_t(xdrs, &objp->rh_gid))
260*0Sstevel@tonic-gate return (FALSE);
261*0Sstevel@tonic-gate return (TRUE);
262*0Sstevel@tonic-gate }
263*0Sstevel@tonic-gate
264*0Sstevel@tonic-gate bool_t
xdr_nfslog_request_record(XDR * xdrs,nfslog_request_record * objp)265*0Sstevel@tonic-gate xdr_nfslog_request_record(XDR *xdrs, nfslog_request_record *objp)
266*0Sstevel@tonic-gate {
267*0Sstevel@tonic-gate if (!xdr_nfslog_record_header(xdrs, &objp->re_header))
268*0Sstevel@tonic-gate return (FALSE);
269*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->re_principal_name, ~0))
270*0Sstevel@tonic-gate return (FALSE);
271*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->re_netid, ~0))
272*0Sstevel@tonic-gate return (FALSE);
273*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->re_tag, ~0))
274*0Sstevel@tonic-gate return (FALSE);
275*0Sstevel@tonic-gate if (!xdr_netbuf(xdrs, &objp->re_ipaddr))
276*0Sstevel@tonic-gate return (FALSE);
277*0Sstevel@tonic-gate return (TRUE);
278*0Sstevel@tonic-gate }
279*0Sstevel@tonic-gate
280*0Sstevel@tonic-gate bool_t
xdr_nfslog_sharefsargs(XDR * xdrs,nfslog_sharefsargs * objp)281*0Sstevel@tonic-gate xdr_nfslog_sharefsargs(XDR *xdrs, nfslog_sharefsargs *objp)
282*0Sstevel@tonic-gate {
283*0Sstevel@tonic-gate if (!xdr_int(xdrs, &objp->sh_flags))
284*0Sstevel@tonic-gate return (FALSE);
285*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->sh_anon))
286*0Sstevel@tonic-gate return (FALSE);
287*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->sh_path, ~0))
288*0Sstevel@tonic-gate return (FALSE);
289*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->sh_fh_buf))
290*0Sstevel@tonic-gate return (FALSE);
291*0Sstevel@tonic-gate return (TRUE);
292*0Sstevel@tonic-gate }
293*0Sstevel@tonic-gate
294*0Sstevel@tonic-gate bool_t
xdr_nfslog_sharefsres(XDR * xdrs,nfslog_sharefsres * objp)295*0Sstevel@tonic-gate xdr_nfslog_sharefsres(XDR *xdrs, nfslog_sharefsres *objp)
296*0Sstevel@tonic-gate {
297*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, objp))
298*0Sstevel@tonic-gate return (FALSE);
299*0Sstevel@tonic-gate return (TRUE);
300*0Sstevel@tonic-gate }
301*0Sstevel@tonic-gate
302*0Sstevel@tonic-gate bool_t
xdr_nfslog_getfhargs(XDR * xdrs,nfslog_getfhargs * objp)303*0Sstevel@tonic-gate xdr_nfslog_getfhargs(XDR *xdrs, nfslog_getfhargs *objp)
304*0Sstevel@tonic-gate {
305*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->gfh_fh_buf))
306*0Sstevel@tonic-gate return (FALSE);
307*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->gfh_path, ~0))
308*0Sstevel@tonic-gate return (FALSE);
309*0Sstevel@tonic-gate return (TRUE);
310*0Sstevel@tonic-gate }
311*0Sstevel@tonic-gate
312*0Sstevel@tonic-gate bool_t
xdr_nfslog_diropargs(XDR * xdrs,nfslog_diropargs * objp)313*0Sstevel@tonic-gate xdr_nfslog_diropargs(XDR *xdrs, nfslog_diropargs *objp)
314*0Sstevel@tonic-gate {
315*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->da_fhandle))
316*0Sstevel@tonic-gate return (FALSE);
317*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->da_name, ~0))
318*0Sstevel@tonic-gate return (FALSE);
319*0Sstevel@tonic-gate return (TRUE);
320*0Sstevel@tonic-gate }
321*0Sstevel@tonic-gate
322*0Sstevel@tonic-gate static bool_t
xdr_nfslog_drok(XDR * xdrs,nfslog_drok * objp)323*0Sstevel@tonic-gate xdr_nfslog_drok(XDR *xdrs, nfslog_drok *objp)
324*0Sstevel@tonic-gate {
325*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->drok_fhandle))
326*0Sstevel@tonic-gate return (FALSE);
327*0Sstevel@tonic-gate return (TRUE);
328*0Sstevel@tonic-gate }
329*0Sstevel@tonic-gate
330*0Sstevel@tonic-gate bool_t
xdr_nfslog_diropres(XDR * xdrs,nfslog_diropres * objp)331*0Sstevel@tonic-gate xdr_nfslog_diropres(XDR *xdrs, nfslog_diropres *objp)
332*0Sstevel@tonic-gate {
333*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, &objp->dr_status))
334*0Sstevel@tonic-gate return (FALSE);
335*0Sstevel@tonic-gate switch (objp->dr_status) {
336*0Sstevel@tonic-gate case NFS_OK:
337*0Sstevel@tonic-gate if (!xdr_nfslog_drok(xdrs, &objp->nfslog_diropres_u.dr_ok))
338*0Sstevel@tonic-gate return (FALSE);
339*0Sstevel@tonic-gate break;
340*0Sstevel@tonic-gate }
341*0Sstevel@tonic-gate return (TRUE);
342*0Sstevel@tonic-gate }
343*0Sstevel@tonic-gate
344*0Sstevel@tonic-gate bool_t
xdr_nfslog_nfsreadargs(XDR * xdrs,nfslog_nfsreadargs * objp)345*0Sstevel@tonic-gate xdr_nfslog_nfsreadargs(XDR *xdrs, nfslog_nfsreadargs *objp)
346*0Sstevel@tonic-gate {
347*0Sstevel@tonic-gate if (!xdr_nfsreadargs(xdrs, objp))
348*0Sstevel@tonic-gate return (FALSE);
349*0Sstevel@tonic-gate return (TRUE);
350*0Sstevel@tonic-gate }
351*0Sstevel@tonic-gate
352*0Sstevel@tonic-gate static bool_t
xdr_nfslog_rrok(XDR * xdrs,nfslog_rrok * objp)353*0Sstevel@tonic-gate xdr_nfslog_rrok(XDR *xdrs, nfslog_rrok *objp)
354*0Sstevel@tonic-gate {
355*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->filesize))
356*0Sstevel@tonic-gate return (FALSE);
357*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rrok_count))
358*0Sstevel@tonic-gate return (FALSE);
359*0Sstevel@tonic-gate return (TRUE);
360*0Sstevel@tonic-gate }
361*0Sstevel@tonic-gate
362*0Sstevel@tonic-gate bool_t
xdr_nfslog_rdresult(XDR * xdrs,nfslog_rdresult * objp)363*0Sstevel@tonic-gate xdr_nfslog_rdresult(XDR *xdrs, nfslog_rdresult *objp)
364*0Sstevel@tonic-gate {
365*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, &objp->r_status))
366*0Sstevel@tonic-gate return (FALSE);
367*0Sstevel@tonic-gate switch (objp->r_status) {
368*0Sstevel@tonic-gate case NFS_OK:
369*0Sstevel@tonic-gate if (!xdr_nfslog_rrok(xdrs, &objp->nfslog_rdresult_u.r_ok))
370*0Sstevel@tonic-gate return (FALSE);
371*0Sstevel@tonic-gate break;
372*0Sstevel@tonic-gate }
373*0Sstevel@tonic-gate return (TRUE);
374*0Sstevel@tonic-gate }
375*0Sstevel@tonic-gate
376*0Sstevel@tonic-gate bool_t
xdr_nfslog_writeargs(XDR * xdrs,nfslog_writeargs * objp)377*0Sstevel@tonic-gate xdr_nfslog_writeargs(XDR *xdrs, nfslog_writeargs *objp)
378*0Sstevel@tonic-gate {
379*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->waargs_fhandle))
380*0Sstevel@tonic-gate return (FALSE);
381*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->waargs_begoff))
382*0Sstevel@tonic-gate return (FALSE);
383*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->waargs_offset))
384*0Sstevel@tonic-gate return (FALSE);
385*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->waargs_totcount))
386*0Sstevel@tonic-gate return (FALSE);
387*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->waargs_count))
388*0Sstevel@tonic-gate return (FALSE);
389*0Sstevel@tonic-gate return (TRUE);
390*0Sstevel@tonic-gate }
391*0Sstevel@tonic-gate
392*0Sstevel@tonic-gate bool_t
xdr_nfslog_writeresult(XDR * xdrs,nfslog_writeresult * objp)393*0Sstevel@tonic-gate xdr_nfslog_writeresult(XDR *xdrs, nfslog_writeresult *objp)
394*0Sstevel@tonic-gate {
395*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, &objp->wr_status))
396*0Sstevel@tonic-gate return (FALSE);
397*0Sstevel@tonic-gate switch (objp->wr_status) {
398*0Sstevel@tonic-gate case NFS_OK:
399*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->nfslog_writeresult_u.wr_size))
400*0Sstevel@tonic-gate return (FALSE);
401*0Sstevel@tonic-gate break;
402*0Sstevel@tonic-gate }
403*0Sstevel@tonic-gate return (TRUE);
404*0Sstevel@tonic-gate }
405*0Sstevel@tonic-gate
406*0Sstevel@tonic-gate static bool_t
xdr_nfslog_sattr(XDR * xdrs,nfslog_sattr * objp)407*0Sstevel@tonic-gate xdr_nfslog_sattr(XDR *xdrs, nfslog_sattr *objp)
408*0Sstevel@tonic-gate {
409*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->sa_mode))
410*0Sstevel@tonic-gate return (FALSE);
411*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->sa_uid))
412*0Sstevel@tonic-gate return (FALSE);
413*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->sa_gid))
414*0Sstevel@tonic-gate return (FALSE);
415*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->sa_size))
416*0Sstevel@tonic-gate return (FALSE);
417*0Sstevel@tonic-gate if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_atime))
418*0Sstevel@tonic-gate return (FALSE);
419*0Sstevel@tonic-gate if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_mtime))
420*0Sstevel@tonic-gate return (FALSE);
421*0Sstevel@tonic-gate return (TRUE);
422*0Sstevel@tonic-gate }
423*0Sstevel@tonic-gate
424*0Sstevel@tonic-gate bool_t
xdr_nfslog_createargs(XDR * xdrs,nfslog_createargs * objp)425*0Sstevel@tonic-gate xdr_nfslog_createargs(XDR *xdrs, nfslog_createargs *objp)
426*0Sstevel@tonic-gate {
427*0Sstevel@tonic-gate if (!xdr_nfslog_sattr(xdrs, &objp->ca_sa))
428*0Sstevel@tonic-gate return (FALSE);
429*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs(xdrs, &objp->ca_da))
430*0Sstevel@tonic-gate return (FALSE);
431*0Sstevel@tonic-gate return (TRUE);
432*0Sstevel@tonic-gate }
433*0Sstevel@tonic-gate
434*0Sstevel@tonic-gate bool_t
xdr_nfslog_setattrargs(XDR * xdrs,nfslog_setattrargs * objp)435*0Sstevel@tonic-gate xdr_nfslog_setattrargs(XDR *xdrs, nfslog_setattrargs *objp)
436*0Sstevel@tonic-gate {
437*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->saa_fh))
438*0Sstevel@tonic-gate return (FALSE);
439*0Sstevel@tonic-gate if (!xdr_nfslog_sattr(xdrs, &objp->saa_sa))
440*0Sstevel@tonic-gate return (FALSE);
441*0Sstevel@tonic-gate return (TRUE);
442*0Sstevel@tonic-gate }
443*0Sstevel@tonic-gate
444*0Sstevel@tonic-gate bool_t
xdr_nfslog_rdlnres(XDR * xdrs,nfslog_rdlnres * objp)445*0Sstevel@tonic-gate xdr_nfslog_rdlnres(XDR *xdrs, nfslog_rdlnres *objp)
446*0Sstevel@tonic-gate {
447*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, &objp->rl_status))
448*0Sstevel@tonic-gate return (FALSE);
449*0Sstevel@tonic-gate switch (objp->rl_status) {
450*0Sstevel@tonic-gate case NFS_OK:
451*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->nfslog_rdlnres_u.rl_ok, ~0))
452*0Sstevel@tonic-gate return (FALSE);
453*0Sstevel@tonic-gate break;
454*0Sstevel@tonic-gate }
455*0Sstevel@tonic-gate return (TRUE);
456*0Sstevel@tonic-gate }
457*0Sstevel@tonic-gate
458*0Sstevel@tonic-gate bool_t
xdr_nfslog_rnmargs(XDR * xdrs,nfslog_rnmargs * objp)459*0Sstevel@tonic-gate xdr_nfslog_rnmargs(XDR *xdrs, nfslog_rnmargs *objp)
460*0Sstevel@tonic-gate {
461*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs(xdrs, &objp->rna_from))
462*0Sstevel@tonic-gate return (FALSE);
463*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs(xdrs, &objp->rna_to))
464*0Sstevel@tonic-gate return (FALSE);
465*0Sstevel@tonic-gate return (TRUE);
466*0Sstevel@tonic-gate }
467*0Sstevel@tonic-gate
468*0Sstevel@tonic-gate bool_t
xdr_nfslog_linkargs(XDR * xdrs,nfslog_linkargs * objp)469*0Sstevel@tonic-gate xdr_nfslog_linkargs(XDR *xdrs, nfslog_linkargs *objp)
470*0Sstevel@tonic-gate {
471*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->la_from))
472*0Sstevel@tonic-gate return (FALSE);
473*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs(xdrs, &objp->la_to))
474*0Sstevel@tonic-gate return (FALSE);
475*0Sstevel@tonic-gate return (TRUE);
476*0Sstevel@tonic-gate }
477*0Sstevel@tonic-gate
478*0Sstevel@tonic-gate bool_t
xdr_nfslog_symlinkargs(XDR * xdrs,nfslog_symlinkargs * objp)479*0Sstevel@tonic-gate xdr_nfslog_symlinkargs(XDR *xdrs, nfslog_symlinkargs *objp)
480*0Sstevel@tonic-gate {
481*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs(xdrs, &objp->sla_from))
482*0Sstevel@tonic-gate return (FALSE);
483*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->sla_tnm, ~0))
484*0Sstevel@tonic-gate return (FALSE);
485*0Sstevel@tonic-gate if (!xdr_nfslog_sattr(xdrs, &objp->sla_sa))
486*0Sstevel@tonic-gate return (FALSE);
487*0Sstevel@tonic-gate return (TRUE);
488*0Sstevel@tonic-gate }
489*0Sstevel@tonic-gate
490*0Sstevel@tonic-gate bool_t
xdr_nfslog_rddirargs(XDR * xdrs,nfslog_rddirargs * objp)491*0Sstevel@tonic-gate xdr_nfslog_rddirargs(XDR *xdrs, nfslog_rddirargs *objp)
492*0Sstevel@tonic-gate {
493*0Sstevel@tonic-gate if (!xdr_fhandle(xdrs, &objp->rda_fh))
494*0Sstevel@tonic-gate return (FALSE);
495*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rda_offset))
496*0Sstevel@tonic-gate return (FALSE);
497*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rda_count))
498*0Sstevel@tonic-gate return (FALSE);
499*0Sstevel@tonic-gate return (TRUE);
500*0Sstevel@tonic-gate }
501*0Sstevel@tonic-gate
502*0Sstevel@tonic-gate static bool_t
xdr_nfslog_rdok(XDR * xdrs,nfslog_rdok * objp)503*0Sstevel@tonic-gate xdr_nfslog_rdok(XDR *xdrs, nfslog_rdok *objp)
504*0Sstevel@tonic-gate {
505*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rdok_offset))
506*0Sstevel@tonic-gate return (FALSE);
507*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->rdok_size))
508*0Sstevel@tonic-gate return (FALSE);
509*0Sstevel@tonic-gate if (!xdr_bool(xdrs, &objp->rdok_eof))
510*0Sstevel@tonic-gate return (FALSE);
511*0Sstevel@tonic-gate return (TRUE);
512*0Sstevel@tonic-gate }
513*0Sstevel@tonic-gate
514*0Sstevel@tonic-gate bool_t
xdr_nfslog_rddirres(XDR * xdrs,nfslog_rddirres * objp)515*0Sstevel@tonic-gate xdr_nfslog_rddirres(XDR *xdrs, nfslog_rddirres *objp)
516*0Sstevel@tonic-gate {
517*0Sstevel@tonic-gate if (!xdr_nfsstat(xdrs, &objp->rd_status))
518*0Sstevel@tonic-gate return (FALSE);
519*0Sstevel@tonic-gate switch (objp->rd_status) {
520*0Sstevel@tonic-gate case NFS_OK:
521*0Sstevel@tonic-gate if (!xdr_nfslog_rdok(xdrs, &objp->nfslog_rddirres_u.rd_ok))
522*0Sstevel@tonic-gate return (FALSE);
523*0Sstevel@tonic-gate break;
524*0Sstevel@tonic-gate }
525*0Sstevel@tonic-gate return (TRUE);
526*0Sstevel@tonic-gate }
527*0Sstevel@tonic-gate
528*0Sstevel@tonic-gate bool_t
xdr_nfslog_diropargs3(XDR * xdrs,nfslog_diropargs3 * objp)529*0Sstevel@tonic-gate xdr_nfslog_diropargs3(XDR *xdrs, nfslog_diropargs3 *objp)
530*0Sstevel@tonic-gate {
531*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->dir))
532*0Sstevel@tonic-gate return (FALSE);
533*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->name, ~0))
534*0Sstevel@tonic-gate return (FALSE);
535*0Sstevel@tonic-gate return (TRUE);
536*0Sstevel@tonic-gate }
537*0Sstevel@tonic-gate
538*0Sstevel@tonic-gate bool_t
xdr_nfslog_LOOKUP3res(XDR * xdrs,nfslog_LOOKUP3res * objp)539*0Sstevel@tonic-gate xdr_nfslog_LOOKUP3res(XDR *xdrs, nfslog_LOOKUP3res *objp)
540*0Sstevel@tonic-gate {
541*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
542*0Sstevel@tonic-gate return (FALSE);
543*0Sstevel@tonic-gate switch (objp->status) {
544*0Sstevel@tonic-gate case NFS3_OK:
545*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->nfslog_LOOKUP3res_u.object))
546*0Sstevel@tonic-gate return (FALSE);
547*0Sstevel@tonic-gate break;
548*0Sstevel@tonic-gate }
549*0Sstevel@tonic-gate return (TRUE);
550*0Sstevel@tonic-gate }
551*0Sstevel@tonic-gate
552*0Sstevel@tonic-gate static bool_t
xdr_nfslog_createhow3(XDR * xdrs,nfslog_createhow3 * objp)553*0Sstevel@tonic-gate xdr_nfslog_createhow3(XDR *xdrs, nfslog_createhow3 *objp)
554*0Sstevel@tonic-gate {
555*0Sstevel@tonic-gate if (!xdr_createmode3(xdrs, &objp->mode))
556*0Sstevel@tonic-gate return (FALSE);
557*0Sstevel@tonic-gate switch (objp->mode) {
558*0Sstevel@tonic-gate case UNCHECKED:
559*0Sstevel@tonic-gate case GUARDED:
560*0Sstevel@tonic-gate if (!xdr_set_size3(xdrs, &objp->nfslog_createhow3_u.size))
561*0Sstevel@tonic-gate return (FALSE);
562*0Sstevel@tonic-gate break;
563*0Sstevel@tonic-gate case EXCLUSIVE:
564*0Sstevel@tonic-gate break;
565*0Sstevel@tonic-gate default:
566*0Sstevel@tonic-gate return (FALSE);
567*0Sstevel@tonic-gate }
568*0Sstevel@tonic-gate return (TRUE);
569*0Sstevel@tonic-gate }
570*0Sstevel@tonic-gate
571*0Sstevel@tonic-gate bool_t
xdr_nfslog_CREATE3args(XDR * xdrs,nfslog_CREATE3args * objp)572*0Sstevel@tonic-gate xdr_nfslog_CREATE3args(XDR *xdrs, nfslog_CREATE3args *objp)
573*0Sstevel@tonic-gate {
574*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
575*0Sstevel@tonic-gate return (FALSE);
576*0Sstevel@tonic-gate if (!xdr_nfslog_createhow3(xdrs, &objp->how))
577*0Sstevel@tonic-gate return (FALSE);
578*0Sstevel@tonic-gate return (TRUE);
579*0Sstevel@tonic-gate }
580*0Sstevel@tonic-gate
581*0Sstevel@tonic-gate static bool_t
xdr_nfslog_CREATE3resok(XDR * xdrs,nfslog_CREATE3resok * objp)582*0Sstevel@tonic-gate xdr_nfslog_CREATE3resok(XDR *xdrs, nfslog_CREATE3resok *objp)
583*0Sstevel@tonic-gate {
584*0Sstevel@tonic-gate if (!xdr_post_op_fh3(xdrs, &objp->obj))
585*0Sstevel@tonic-gate return (FALSE);
586*0Sstevel@tonic-gate return (TRUE);
587*0Sstevel@tonic-gate }
588*0Sstevel@tonic-gate
589*0Sstevel@tonic-gate bool_t
xdr_nfslog_CREATE3res(XDR * xdrs,nfslog_CREATE3res * objp)590*0Sstevel@tonic-gate xdr_nfslog_CREATE3res(XDR *xdrs, nfslog_CREATE3res *objp)
591*0Sstevel@tonic-gate {
592*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
593*0Sstevel@tonic-gate return (FALSE);
594*0Sstevel@tonic-gate switch (objp->status) {
595*0Sstevel@tonic-gate case NFS3_OK:
596*0Sstevel@tonic-gate if (!xdr_nfslog_CREATE3resok(
597*0Sstevel@tonic-gate xdrs, &objp->nfslog_CREATE3res_u.ok))
598*0Sstevel@tonic-gate return (FALSE);
599*0Sstevel@tonic-gate break;
600*0Sstevel@tonic-gate }
601*0Sstevel@tonic-gate return (TRUE);
602*0Sstevel@tonic-gate }
603*0Sstevel@tonic-gate
604*0Sstevel@tonic-gate bool_t
xdr_nfslog_SETATTR3args(XDR * xdrs,nfslog_SETATTR3args * objp)605*0Sstevel@tonic-gate xdr_nfslog_SETATTR3args(XDR *xdrs, nfslog_SETATTR3args *objp)
606*0Sstevel@tonic-gate {
607*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->object))
608*0Sstevel@tonic-gate return (FALSE);
609*0Sstevel@tonic-gate if (!xdr_set_size3(xdrs, &objp->size))
610*0Sstevel@tonic-gate return (FALSE);
611*0Sstevel@tonic-gate return (TRUE);
612*0Sstevel@tonic-gate }
613*0Sstevel@tonic-gate
614*0Sstevel@tonic-gate bool_t
xdr_nfslog_READLINK3res(XDR * xdrs,nfslog_READLINK3res * objp)615*0Sstevel@tonic-gate xdr_nfslog_READLINK3res(XDR *xdrs, nfslog_READLINK3res *objp)
616*0Sstevel@tonic-gate {
617*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
618*0Sstevel@tonic-gate return (FALSE);
619*0Sstevel@tonic-gate switch (objp->status) {
620*0Sstevel@tonic-gate case NFS3_OK:
621*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->nfslog_READLINK3res_u.data, ~0))
622*0Sstevel@tonic-gate return (FALSE);
623*0Sstevel@tonic-gate break;
624*0Sstevel@tonic-gate }
625*0Sstevel@tonic-gate return (TRUE);
626*0Sstevel@tonic-gate }
627*0Sstevel@tonic-gate
628*0Sstevel@tonic-gate bool_t
xdr_nfslog_READ3args(XDR * xdrs,nfslog_READ3args * objp)629*0Sstevel@tonic-gate xdr_nfslog_READ3args(XDR *xdrs, nfslog_READ3args *objp)
630*0Sstevel@tonic-gate {
631*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->file))
632*0Sstevel@tonic-gate return (FALSE);
633*0Sstevel@tonic-gate if (!xdr_offset3(xdrs, &objp->offset))
634*0Sstevel@tonic-gate return (FALSE);
635*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->count))
636*0Sstevel@tonic-gate return (FALSE);
637*0Sstevel@tonic-gate return (TRUE);
638*0Sstevel@tonic-gate }
639*0Sstevel@tonic-gate
640*0Sstevel@tonic-gate static bool_t
xdr_nfslog_READ3resok(XDR * xdrs,nfslog_READ3resok * objp)641*0Sstevel@tonic-gate xdr_nfslog_READ3resok(XDR *xdrs, nfslog_READ3resok *objp)
642*0Sstevel@tonic-gate {
643*0Sstevel@tonic-gate if (!xdr_size3(xdrs, &objp->filesize))
644*0Sstevel@tonic-gate return (FALSE);
645*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->count))
646*0Sstevel@tonic-gate return (FALSE);
647*0Sstevel@tonic-gate if (!xdr_bool(xdrs, &objp->eof))
648*0Sstevel@tonic-gate return (FALSE);
649*0Sstevel@tonic-gate if (!xdr_u_int(xdrs, &objp->size))
650*0Sstevel@tonic-gate return (FALSE);
651*0Sstevel@tonic-gate return (TRUE);
652*0Sstevel@tonic-gate }
653*0Sstevel@tonic-gate
654*0Sstevel@tonic-gate bool_t
xdr_nfslog_READ3res(XDR * xdrs,nfslog_READ3res * objp)655*0Sstevel@tonic-gate xdr_nfslog_READ3res(XDR *xdrs, nfslog_READ3res *objp)
656*0Sstevel@tonic-gate {
657*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
658*0Sstevel@tonic-gate return (FALSE);
659*0Sstevel@tonic-gate switch (objp->status) {
660*0Sstevel@tonic-gate case NFS3_OK:
661*0Sstevel@tonic-gate if (!xdr_nfslog_READ3resok(xdrs, &objp->nfslog_READ3res_u.ok))
662*0Sstevel@tonic-gate return (FALSE);
663*0Sstevel@tonic-gate break;
664*0Sstevel@tonic-gate }
665*0Sstevel@tonic-gate return (TRUE);
666*0Sstevel@tonic-gate }
667*0Sstevel@tonic-gate
668*0Sstevel@tonic-gate bool_t
xdr_nfslog_WRITE3args(XDR * xdrs,nfslog_WRITE3args * objp)669*0Sstevel@tonic-gate xdr_nfslog_WRITE3args(XDR *xdrs, nfslog_WRITE3args *objp)
670*0Sstevel@tonic-gate {
671*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->file))
672*0Sstevel@tonic-gate return (FALSE);
673*0Sstevel@tonic-gate if (!xdr_offset3(xdrs, &objp->offset))
674*0Sstevel@tonic-gate return (FALSE);
675*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->count))
676*0Sstevel@tonic-gate return (FALSE);
677*0Sstevel@tonic-gate if (!xdr_stable_how(xdrs, &objp->stable))
678*0Sstevel@tonic-gate return (FALSE);
679*0Sstevel@tonic-gate return (TRUE);
680*0Sstevel@tonic-gate }
681*0Sstevel@tonic-gate
682*0Sstevel@tonic-gate static bool_t
xdr_nfslog_WRITE3resok(XDR * xdrs,nfslog_WRITE3resok * objp)683*0Sstevel@tonic-gate xdr_nfslog_WRITE3resok(XDR *xdrs, nfslog_WRITE3resok *objp)
684*0Sstevel@tonic-gate {
685*0Sstevel@tonic-gate if (!xdr_size3(xdrs, &objp->filesize))
686*0Sstevel@tonic-gate return (FALSE);
687*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->count))
688*0Sstevel@tonic-gate return (FALSE);
689*0Sstevel@tonic-gate if (!xdr_stable_how(xdrs, &objp->committed))
690*0Sstevel@tonic-gate return (FALSE);
691*0Sstevel@tonic-gate return (TRUE);
692*0Sstevel@tonic-gate }
693*0Sstevel@tonic-gate
694*0Sstevel@tonic-gate bool_t
xdr_nfslog_WRITE3res(XDR * xdrs,nfslog_WRITE3res * objp)695*0Sstevel@tonic-gate xdr_nfslog_WRITE3res(XDR *xdrs, nfslog_WRITE3res *objp)
696*0Sstevel@tonic-gate {
697*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
698*0Sstevel@tonic-gate return (FALSE);
699*0Sstevel@tonic-gate switch (objp->status) {
700*0Sstevel@tonic-gate case NFS3_OK:
701*0Sstevel@tonic-gate if (!xdr_nfslog_WRITE3resok(xdrs, &objp->nfslog_WRITE3res_u.ok))
702*0Sstevel@tonic-gate return (FALSE);
703*0Sstevel@tonic-gate break;
704*0Sstevel@tonic-gate }
705*0Sstevel@tonic-gate return (TRUE);
706*0Sstevel@tonic-gate }
707*0Sstevel@tonic-gate
708*0Sstevel@tonic-gate bool_t
xdr_nfslog_MKDIR3args(XDR * xdrs,nfslog_MKDIR3args * objp)709*0Sstevel@tonic-gate xdr_nfslog_MKDIR3args(XDR *xdrs, nfslog_MKDIR3args *objp)
710*0Sstevel@tonic-gate {
711*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
712*0Sstevel@tonic-gate return (FALSE);
713*0Sstevel@tonic-gate return (TRUE);
714*0Sstevel@tonic-gate }
715*0Sstevel@tonic-gate
716*0Sstevel@tonic-gate bool_t
xdr_nfslog_MKDIR3res(XDR * xdrs,nfslog_MKDIR3res * objp)717*0Sstevel@tonic-gate xdr_nfslog_MKDIR3res(XDR *xdrs, nfslog_MKDIR3res *objp)
718*0Sstevel@tonic-gate {
719*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
720*0Sstevel@tonic-gate return (FALSE);
721*0Sstevel@tonic-gate switch (objp->status) {
722*0Sstevel@tonic-gate case NFS3_OK:
723*0Sstevel@tonic-gate if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKDIR3res_u.obj))
724*0Sstevel@tonic-gate return (FALSE);
725*0Sstevel@tonic-gate break;
726*0Sstevel@tonic-gate }
727*0Sstevel@tonic-gate return (TRUE);
728*0Sstevel@tonic-gate }
729*0Sstevel@tonic-gate
730*0Sstevel@tonic-gate bool_t
xdr_nfslog_SYMLINK3args(XDR * xdrs,nfslog_SYMLINK3args * objp)731*0Sstevel@tonic-gate xdr_nfslog_SYMLINK3args(XDR *xdrs, nfslog_SYMLINK3args *objp)
732*0Sstevel@tonic-gate {
733*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
734*0Sstevel@tonic-gate return (FALSE);
735*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->symlink_data, ~0))
736*0Sstevel@tonic-gate return (FALSE);
737*0Sstevel@tonic-gate return (TRUE);
738*0Sstevel@tonic-gate }
739*0Sstevel@tonic-gate
740*0Sstevel@tonic-gate bool_t
xdr_nfslog_SYMLINK3res(XDR * xdrs,nfslog_SYMLINK3res * objp)741*0Sstevel@tonic-gate xdr_nfslog_SYMLINK3res(XDR *xdrs, nfslog_SYMLINK3res *objp)
742*0Sstevel@tonic-gate {
743*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
744*0Sstevel@tonic-gate return (FALSE);
745*0Sstevel@tonic-gate switch (objp->status) {
746*0Sstevel@tonic-gate case NFS3_OK:
747*0Sstevel@tonic-gate if (!xdr_post_op_fh3(xdrs, &objp->nfslog_SYMLINK3res_u.obj))
748*0Sstevel@tonic-gate return (FALSE);
749*0Sstevel@tonic-gate break;
750*0Sstevel@tonic-gate }
751*0Sstevel@tonic-gate return (TRUE);
752*0Sstevel@tonic-gate }
753*0Sstevel@tonic-gate
754*0Sstevel@tonic-gate bool_t
xdr_nfslog_MKNOD3args(XDR * xdrs,nfslog_MKNOD3args * objp)755*0Sstevel@tonic-gate xdr_nfslog_MKNOD3args(XDR *xdrs, nfslog_MKNOD3args *objp)
756*0Sstevel@tonic-gate {
757*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
758*0Sstevel@tonic-gate return (FALSE);
759*0Sstevel@tonic-gate if (!xdr_ftype3(xdrs, &objp->type))
760*0Sstevel@tonic-gate return (FALSE);
761*0Sstevel@tonic-gate return (TRUE);
762*0Sstevel@tonic-gate }
763*0Sstevel@tonic-gate
764*0Sstevel@tonic-gate bool_t
xdr_nfslog_MKNOD3res(XDR * xdrs,nfslog_MKNOD3res * objp)765*0Sstevel@tonic-gate xdr_nfslog_MKNOD3res(XDR *xdrs, nfslog_MKNOD3res *objp)
766*0Sstevel@tonic-gate {
767*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
768*0Sstevel@tonic-gate return (FALSE);
769*0Sstevel@tonic-gate switch (objp->status) {
770*0Sstevel@tonic-gate case NFS3_OK:
771*0Sstevel@tonic-gate if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKNOD3res_u.obj))
772*0Sstevel@tonic-gate return (FALSE);
773*0Sstevel@tonic-gate break;
774*0Sstevel@tonic-gate }
775*0Sstevel@tonic-gate return (TRUE);
776*0Sstevel@tonic-gate }
777*0Sstevel@tonic-gate
778*0Sstevel@tonic-gate bool_t
xdr_nfslog_REMOVE3args(XDR * xdrs,nfslog_REMOVE3args * objp)779*0Sstevel@tonic-gate xdr_nfslog_REMOVE3args(XDR *xdrs, nfslog_REMOVE3args *objp)
780*0Sstevel@tonic-gate {
781*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->object))
782*0Sstevel@tonic-gate return (FALSE);
783*0Sstevel@tonic-gate return (TRUE);
784*0Sstevel@tonic-gate }
785*0Sstevel@tonic-gate
786*0Sstevel@tonic-gate bool_t
xdr_nfslog_RMDIR3args(XDR * xdrs,nfslog_RMDIR3args * objp)787*0Sstevel@tonic-gate xdr_nfslog_RMDIR3args(XDR *xdrs, nfslog_RMDIR3args *objp)
788*0Sstevel@tonic-gate {
789*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->object))
790*0Sstevel@tonic-gate return (FALSE);
791*0Sstevel@tonic-gate return (TRUE);
792*0Sstevel@tonic-gate }
793*0Sstevel@tonic-gate
794*0Sstevel@tonic-gate bool_t
xdr_nfslog_RENAME3args(XDR * xdrs,nfslog_RENAME3args * objp)795*0Sstevel@tonic-gate xdr_nfslog_RENAME3args(XDR *xdrs, nfslog_RENAME3args *objp)
796*0Sstevel@tonic-gate {
797*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->from))
798*0Sstevel@tonic-gate return (FALSE);
799*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->to))
800*0Sstevel@tonic-gate return (FALSE);
801*0Sstevel@tonic-gate return (TRUE);
802*0Sstevel@tonic-gate }
803*0Sstevel@tonic-gate
804*0Sstevel@tonic-gate bool_t
xdr_nfslog_LINK3args(XDR * xdrs,nfslog_LINK3args * objp)805*0Sstevel@tonic-gate xdr_nfslog_LINK3args(XDR *xdrs, nfslog_LINK3args *objp)
806*0Sstevel@tonic-gate {
807*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->file))
808*0Sstevel@tonic-gate return (FALSE);
809*0Sstevel@tonic-gate if (!xdr_nfslog_diropargs3(xdrs, &objp->link))
810*0Sstevel@tonic-gate return (FALSE);
811*0Sstevel@tonic-gate return (TRUE);
812*0Sstevel@tonic-gate }
813*0Sstevel@tonic-gate
814*0Sstevel@tonic-gate bool_t
xdr_nfslog_READDIRPLUS3args(XDR * xdrs,nfslog_READDIRPLUS3args * objp)815*0Sstevel@tonic-gate xdr_nfslog_READDIRPLUS3args(XDR *xdrs, nfslog_READDIRPLUS3args *objp)
816*0Sstevel@tonic-gate {
817*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->dir))
818*0Sstevel@tonic-gate return (FALSE);
819*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->dircount))
820*0Sstevel@tonic-gate return (FALSE);
821*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->maxcount))
822*0Sstevel@tonic-gate return (FALSE);
823*0Sstevel@tonic-gate return (TRUE);
824*0Sstevel@tonic-gate }
825*0Sstevel@tonic-gate
826*0Sstevel@tonic-gate static bool_t
xdr_nfslog_entryplus3(XDR * xdrs,nfslog_entryplus3 * objp)827*0Sstevel@tonic-gate xdr_nfslog_entryplus3(XDR *xdrs, nfslog_entryplus3 *objp)
828*0Sstevel@tonic-gate {
829*0Sstevel@tonic-gate if (!xdr_post_op_fh3(xdrs, &objp->name_handle))
830*0Sstevel@tonic-gate return (FALSE);
831*0Sstevel@tonic-gate if (!xdr_string(xdrs, &objp->name, ~0))
832*0Sstevel@tonic-gate return (FALSE);
833*0Sstevel@tonic-gate if (!xdr_pointer(xdrs, (char **)&objp->nextentry,
834*0Sstevel@tonic-gate sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3))
835*0Sstevel@tonic-gate return (FALSE);
836*0Sstevel@tonic-gate return (TRUE);
837*0Sstevel@tonic-gate }
838*0Sstevel@tonic-gate
839*0Sstevel@tonic-gate static bool_t
xdr_nfslog_dirlistplus3(XDR * xdrs,nfslog_dirlistplus3 * objp)840*0Sstevel@tonic-gate xdr_nfslog_dirlistplus3(XDR *xdrs, nfslog_dirlistplus3 *objp)
841*0Sstevel@tonic-gate {
842*0Sstevel@tonic-gate if (!xdr_pointer(xdrs, (char **)&objp->entries,
843*0Sstevel@tonic-gate sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3))
844*0Sstevel@tonic-gate return (FALSE);
845*0Sstevel@tonic-gate if (!xdr_bool(xdrs, &objp->eof))
846*0Sstevel@tonic-gate return (FALSE);
847*0Sstevel@tonic-gate return (TRUE);
848*0Sstevel@tonic-gate }
849*0Sstevel@tonic-gate
850*0Sstevel@tonic-gate static bool_t
xdr_nfslog_READDIRPLUS3resok(XDR * xdrs,nfslog_READDIRPLUS3resok * objp)851*0Sstevel@tonic-gate xdr_nfslog_READDIRPLUS3resok(XDR *xdrs, nfslog_READDIRPLUS3resok *objp)
852*0Sstevel@tonic-gate {
853*0Sstevel@tonic-gate if (!xdr_nfslog_dirlistplus3(xdrs, &objp->reply))
854*0Sstevel@tonic-gate return (FALSE);
855*0Sstevel@tonic-gate return (TRUE);
856*0Sstevel@tonic-gate }
857*0Sstevel@tonic-gate
858*0Sstevel@tonic-gate bool_t
xdr_nfslog_READDIRPLUS3res(XDR * xdrs,nfslog_READDIRPLUS3res * objp)859*0Sstevel@tonic-gate xdr_nfslog_READDIRPLUS3res(XDR *xdrs, nfslog_READDIRPLUS3res *objp)
860*0Sstevel@tonic-gate {
861*0Sstevel@tonic-gate if (!xdr_nfsstat3(xdrs, &objp->status))
862*0Sstevel@tonic-gate return (FALSE);
863*0Sstevel@tonic-gate switch (objp->status) {
864*0Sstevel@tonic-gate case NFS3_OK:
865*0Sstevel@tonic-gate if (!xdr_nfslog_READDIRPLUS3resok(
866*0Sstevel@tonic-gate xdrs, &objp->nfslog_READDIRPLUS3res_u.ok))
867*0Sstevel@tonic-gate return (FALSE);
868*0Sstevel@tonic-gate break;
869*0Sstevel@tonic-gate }
870*0Sstevel@tonic-gate return (TRUE);
871*0Sstevel@tonic-gate }
872*0Sstevel@tonic-gate
873*0Sstevel@tonic-gate bool_t
xdr_nfslog_COMMIT3args(XDR * xdrs,nfslog_COMMIT3args * objp)874*0Sstevel@tonic-gate xdr_nfslog_COMMIT3args(XDR *xdrs, nfslog_COMMIT3args *objp)
875*0Sstevel@tonic-gate {
876*0Sstevel@tonic-gate if (!xdr_nfs_fh3(xdrs, &objp->file))
877*0Sstevel@tonic-gate return (FALSE);
878*0Sstevel@tonic-gate if (!xdr_offset3(xdrs, &objp->offset))
879*0Sstevel@tonic-gate return (FALSE);
880*0Sstevel@tonic-gate if (!xdr_count3(xdrs, &objp->count))
881*0Sstevel@tonic-gate return (FALSE);
882*0Sstevel@tonic-gate return (TRUE);
883*0Sstevel@tonic-gate }
884