dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / fs.d / nfs / nfslog / nfs_log_xdr.c
blob88ed4f1efe104a8c1962202cc0fc5fce92501154
1 /*
2 * CDDL HEADER START
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
7 * with the License.
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]
20 * CDDL HEADER END
23 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <nfs/nfs.h>
30 #include <nfs/nfs_log.h>
32 static bool_t xdr_timestruc32_t(XDR *, timestruc32_t *);
33 static bool_t xdr_nfs2_timeval(XDR *, nfs2_timeval *);
34 static bool_t xdr_ftype3(XDR *, ftype3 *);
35 static bool_t xdr_stable_how(XDR *, stable_how *);
36 static bool_t xdr_createmode3(XDR *, createmode3 *);
37 static bool_t xdr_size3(XDR *, size3 *);
38 static bool_t xdr_count3(XDR *, count3 *);
39 static bool_t xdr_set_size3(XDR *, set_size3 *);
40 static bool_t xdr_offset3(XDR *, offset3 *);
41 static bool_t xdr_post_op_fh3(XDR *, post_op_fh3 *);
42 static bool_t xdr_nfsreadargs(XDR *, struct nfsreadargs *);
43 static bool_t xdr_nfslog_record_header(XDR *, nfslog_record_header *);
44 static bool_t xdr_nfslog_drok(XDR *, nfslog_drok *);
45 static bool_t xdr_nfslog_rrok(XDR *, nfslog_rrok *);
46 static bool_t xdr_nfslog_sattr(XDR *, nfslog_sattr *);
47 static bool_t xdr_nfslog_rdok(XDR *, nfslog_rdok *);
48 static bool_t xdr_nfslog_createhow3(XDR *, nfslog_createhow3 *);
49 static bool_t xdr_nfslog_CREATE3resok(XDR *, nfslog_CREATE3resok *);
50 static bool_t xdr_nfslog_READ3resok(XDR *, nfslog_READ3resok *);
51 static bool_t xdr_nfslog_WRITE3resok(XDR *, nfslog_WRITE3resok *);
52 static bool_t xdr_nfslog_entryplus3(XDR *, nfslog_entryplus3 *);
53 static bool_t xdr_nfslog_dirlistplus3(XDR *, nfslog_dirlistplus3 *);
54 static bool_t xdr_nfslog_READDIRPLUS3resok(XDR *, nfslog_READDIRPLUS3resok *);
56 static bool_t
57 xdr_timestruc32_t(XDR *xdrs, timestruc32_t *objp)
59 if (!xdr_int(xdrs, &objp->tv_sec))
60 return (FALSE);
61 if (!xdr_int(xdrs, &objp->tv_nsec))
62 return (FALSE);
63 return (TRUE);
66 static bool_t
67 xdr_nfs2_timeval(XDR *xdrs, nfs2_timeval *objp)
69 if (!xdr_u_int(xdrs, &objp->tv_sec))
70 return (FALSE);
71 if (!xdr_u_int(xdrs, &objp->tv_usec))
72 return (FALSE);
73 return (TRUE);
76 bool_t
77 xdr_nfsstat(XDR *xdrs, nfsstat *objp)
79 if (!xdr_enum(xdrs, (enum_t *)objp))
80 return (FALSE);
81 return (TRUE);
84 bool_t
85 xdr_uint64(XDR *xdrs, uint64 *objp)
87 return (xdr_u_longlong_t(xdrs, objp));
90 bool_t
91 xdr_uint32(XDR *xdrs, uint32 *objp)
93 return (xdr_u_int(xdrs, objp));
96 static bool_t
97 xdr_ftype3(XDR *xdrs, ftype3 *objp)
99 return (xdr_enum(xdrs, (enum_t *)objp));
102 static bool_t
103 xdr_stable_how(XDR *xdrs, stable_how *objp)
105 return (xdr_enum(xdrs, (enum_t *)objp));
108 static bool_t
109 xdr_createmode3(XDR *xdrs, createmode3 *objp)
111 return (xdr_enum(xdrs, (enum_t *)objp));
114 static bool_t
115 xdr_size3(XDR *xdrs, size3 *objp)
117 return (xdr_uint64(xdrs, objp));
120 static bool_t
121 xdr_count3(XDR *xdrs, count3 *objp)
123 return (xdr_uint32(xdrs, objp));
126 static bool_t
127 xdr_set_size3(XDR *xdrs, set_size3 *objp)
129 if (!xdr_bool(xdrs, &objp->set_it))
130 return (FALSE);
131 switch (objp->set_it) {
132 case TRUE:
133 if (!xdr_size3(xdrs, &objp->size))
134 return (FALSE);
135 break;
137 return (TRUE);
140 static bool_t
141 xdr_offset3(XDR *xdrs, offset3 *objp)
143 return (xdr_uint64(xdrs, objp));
146 bool_t
147 xdr_fhandle(XDR *xdrs, fhandle_t *fh)
149 if (xdrs->x_op == XDR_FREE)
150 return (TRUE);
152 return (xdr_opaque(xdrs, (caddr_t)fh, NFS_FHSIZE));
156 bool_t
157 xdr_nfs_fh3(XDR *xdrs, nfs_fh3 *objp)
159 if (!xdr_u_int(xdrs, &objp->fh3_length))
160 return (FALSE);
162 if (objp->fh3_length > NFS3_FHSIZE)
163 return (FALSE);
165 if (xdrs->x_op == XDR_DECODE || xdrs->x_op == XDR_ENCODE)
166 return (xdr_opaque(xdrs, objp->fh3_u.data, objp->fh3_length));
168 if (xdrs->x_op == XDR_FREE)
169 return (TRUE);
171 return (FALSE);
174 static bool_t
175 xdr_post_op_fh3(XDR *xdrs, post_op_fh3 *objp)
177 if (!xdr_bool(xdrs, &objp->handle_follows))
178 return (FALSE);
179 switch (objp->handle_follows) {
180 case TRUE:
181 if (!xdr_nfs_fh3(xdrs, &objp->handle))
182 return (FALSE);
183 break;
184 case FALSE:
185 break;
186 default:
187 return (FALSE);
189 return (TRUE);
192 bool_t
193 xdr_nfsstat3(XDR *xdrs, nfsstat3 *objp)
195 return (xdr_enum(xdrs, (enum_t *)objp));
198 static bool_t
199 xdr_nfsreadargs(XDR *xdrs, struct nfsreadargs *ra)
201 if (xdr_fhandle(xdrs, &ra->ra_fhandle) &&
202 xdr_u_int(xdrs, &ra->ra_offset) &&
203 xdr_u_int(xdrs, &ra->ra_count) &&
204 xdr_u_int(xdrs, &ra->ra_totcount)) {
205 return (TRUE);
207 return (FALSE);
211 bool_t
212 xdr_nfslog_buffer_header(XDR *xdrs, nfslog_buffer_header *objp)
214 if (!xdr_u_int(xdrs, &objp->bh_length))
215 return (FALSE);
216 if (!xdr_rpcvers(xdrs, &objp->bh_version))
217 return (FALSE);
218 if (objp->bh_version > 1) {
219 if (!xdr_u_longlong_t(xdrs, &objp->bh_offset))
220 return (FALSE);
221 if (!xdr_u_int(xdrs, &objp->bh_flags))
222 return (FALSE);
223 } else {
224 uint_t bh_offset;
226 if (!xdr_u_int(xdrs, &objp->bh_flags))
227 return (FALSE);
228 if (xdrs->x_op == XDR_ENCODE)
229 bh_offset = (uint_t)objp->bh_offset;
230 if (!xdr_u_int(xdrs, &bh_offset))
231 return (FALSE);
232 if (xdrs->x_op == XDR_DECODE)
233 objp->bh_offset = (uoff_t)bh_offset;
235 if (!xdr_timestruc32_t(xdrs, &objp->bh_timestamp))
236 return (FALSE);
237 return (TRUE);
240 static bool_t
241 xdr_nfslog_record_header(XDR *xdrs, nfslog_record_header *objp)
243 if (!xdr_u_int(xdrs, &objp->rh_reclen))
244 return (FALSE);
245 if (!xdr_u_int(xdrs, &objp->rh_rec_id))
246 return (FALSE);
247 if (!xdr_rpcprog(xdrs, &objp->rh_prognum))
248 return (FALSE);
249 if (!xdr_rpcproc(xdrs, &objp->rh_procnum))
250 return (FALSE);
251 if (!xdr_rpcvers(xdrs, &objp->rh_version))
252 return (FALSE);
253 if (!xdr_u_int(xdrs, &objp->rh_auth_flavor))
254 return (FALSE);
255 if (!xdr_timestruc32_t(xdrs, &objp->rh_timestamp))
256 return (FALSE);
257 if (!xdr_uid_t(xdrs, &objp->rh_uid))
258 return (FALSE);
259 if (!xdr_gid_t(xdrs, &objp->rh_gid))
260 return (FALSE);
261 return (TRUE);
264 bool_t
265 xdr_nfslog_request_record(XDR *xdrs, nfslog_request_record *objp)
267 if (!xdr_nfslog_record_header(xdrs, &objp->re_header))
268 return (FALSE);
269 if (!xdr_string(xdrs, &objp->re_principal_name, ~0))
270 return (FALSE);
271 if (!xdr_string(xdrs, &objp->re_netid, ~0))
272 return (FALSE);
273 if (!xdr_string(xdrs, &objp->re_tag, ~0))
274 return (FALSE);
275 if (!xdr_netbuf(xdrs, &objp->re_ipaddr))
276 return (FALSE);
277 return (TRUE);
280 bool_t
281 xdr_nfslog_sharefsargs(XDR *xdrs, nfslog_sharefsargs *objp)
283 if (!xdr_int(xdrs, &objp->sh_flags))
284 return (FALSE);
285 if (!xdr_u_int(xdrs, &objp->sh_anon))
286 return (FALSE);
287 if (!xdr_string(xdrs, &objp->sh_path, ~0))
288 return (FALSE);
289 if (!xdr_fhandle(xdrs, &objp->sh_fh_buf))
290 return (FALSE);
291 return (TRUE);
294 bool_t
295 xdr_nfslog_sharefsres(XDR *xdrs, nfslog_sharefsres *objp)
297 if (!xdr_nfsstat(xdrs, objp))
298 return (FALSE);
299 return (TRUE);
302 bool_t
303 xdr_nfslog_getfhargs(XDR *xdrs, nfslog_getfhargs *objp)
305 if (!xdr_fhandle(xdrs, &objp->gfh_fh_buf))
306 return (FALSE);
307 if (!xdr_string(xdrs, &objp->gfh_path, ~0))
308 return (FALSE);
309 return (TRUE);
312 bool_t
313 xdr_nfslog_diropargs(XDR *xdrs, nfslog_diropargs *objp)
315 if (!xdr_fhandle(xdrs, &objp->da_fhandle))
316 return (FALSE);
317 if (!xdr_string(xdrs, &objp->da_name, ~0))
318 return (FALSE);
319 return (TRUE);
322 static bool_t
323 xdr_nfslog_drok(XDR *xdrs, nfslog_drok *objp)
325 if (!xdr_fhandle(xdrs, &objp->drok_fhandle))
326 return (FALSE);
327 return (TRUE);
330 bool_t
331 xdr_nfslog_diropres(XDR *xdrs, nfslog_diropres *objp)
333 if (!xdr_nfsstat(xdrs, &objp->dr_status))
334 return (FALSE);
335 switch (objp->dr_status) {
336 case NFS_OK:
337 if (!xdr_nfslog_drok(xdrs, &objp->nfslog_diropres_u.dr_ok))
338 return (FALSE);
339 break;
341 return (TRUE);
344 bool_t
345 xdr_nfslog_nfsreadargs(XDR *xdrs, nfslog_nfsreadargs *objp)
347 if (!xdr_nfsreadargs(xdrs, objp))
348 return (FALSE);
349 return (TRUE);
352 static bool_t
353 xdr_nfslog_rrok(XDR *xdrs, nfslog_rrok *objp)
355 if (!xdr_u_int(xdrs, &objp->filesize))
356 return (FALSE);
357 if (!xdr_u_int(xdrs, &objp->rrok_count))
358 return (FALSE);
359 return (TRUE);
362 bool_t
363 xdr_nfslog_rdresult(XDR *xdrs, nfslog_rdresult *objp)
365 if (!xdr_nfsstat(xdrs, &objp->r_status))
366 return (FALSE);
367 switch (objp->r_status) {
368 case NFS_OK:
369 if (!xdr_nfslog_rrok(xdrs, &objp->nfslog_rdresult_u.r_ok))
370 return (FALSE);
371 break;
373 return (TRUE);
376 bool_t
377 xdr_nfslog_writeargs(XDR *xdrs, nfslog_writeargs *objp)
379 if (!xdr_fhandle(xdrs, &objp->waargs_fhandle))
380 return (FALSE);
381 if (!xdr_u_int(xdrs, &objp->waargs_begoff))
382 return (FALSE);
383 if (!xdr_u_int(xdrs, &objp->waargs_offset))
384 return (FALSE);
385 if (!xdr_u_int(xdrs, &objp->waargs_totcount))
386 return (FALSE);
387 if (!xdr_u_int(xdrs, &objp->waargs_count))
388 return (FALSE);
389 return (TRUE);
392 bool_t
393 xdr_nfslog_writeresult(XDR *xdrs, nfslog_writeresult *objp)
395 if (!xdr_nfsstat(xdrs, &objp->wr_status))
396 return (FALSE);
397 switch (objp->wr_status) {
398 case NFS_OK:
399 if (!xdr_u_int(xdrs, &objp->nfslog_writeresult_u.wr_size))
400 return (FALSE);
401 break;
403 return (TRUE);
406 static bool_t
407 xdr_nfslog_sattr(XDR *xdrs, nfslog_sattr *objp)
409 if (!xdr_u_int(xdrs, &objp->sa_mode))
410 return (FALSE);
411 if (!xdr_u_int(xdrs, &objp->sa_uid))
412 return (FALSE);
413 if (!xdr_u_int(xdrs, &objp->sa_gid))
414 return (FALSE);
415 if (!xdr_u_int(xdrs, &objp->sa_size))
416 return (FALSE);
417 if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_atime))
418 return (FALSE);
419 if (!xdr_nfs2_timeval(xdrs, (nfs2_timeval *)&objp->sa_mtime))
420 return (FALSE);
421 return (TRUE);
424 bool_t
425 xdr_nfslog_createargs(XDR *xdrs, nfslog_createargs *objp)
427 if (!xdr_nfslog_sattr(xdrs, &objp->ca_sa))
428 return (FALSE);
429 if (!xdr_nfslog_diropargs(xdrs, &objp->ca_da))
430 return (FALSE);
431 return (TRUE);
434 bool_t
435 xdr_nfslog_setattrargs(XDR *xdrs, nfslog_setattrargs *objp)
437 if (!xdr_fhandle(xdrs, &objp->saa_fh))
438 return (FALSE);
439 if (!xdr_nfslog_sattr(xdrs, &objp->saa_sa))
440 return (FALSE);
441 return (TRUE);
444 bool_t
445 xdr_nfslog_rdlnres(XDR *xdrs, nfslog_rdlnres *objp)
447 if (!xdr_nfsstat(xdrs, &objp->rl_status))
448 return (FALSE);
449 switch (objp->rl_status) {
450 case NFS_OK:
451 if (!xdr_string(xdrs, &objp->nfslog_rdlnres_u.rl_ok, ~0))
452 return (FALSE);
453 break;
455 return (TRUE);
458 bool_t
459 xdr_nfslog_rnmargs(XDR *xdrs, nfslog_rnmargs *objp)
461 if (!xdr_nfslog_diropargs(xdrs, &objp->rna_from))
462 return (FALSE);
463 if (!xdr_nfslog_diropargs(xdrs, &objp->rna_to))
464 return (FALSE);
465 return (TRUE);
468 bool_t
469 xdr_nfslog_linkargs(XDR *xdrs, nfslog_linkargs *objp)
471 if (!xdr_fhandle(xdrs, &objp->la_from))
472 return (FALSE);
473 if (!xdr_nfslog_diropargs(xdrs, &objp->la_to))
474 return (FALSE);
475 return (TRUE);
478 bool_t
479 xdr_nfslog_symlinkargs(XDR *xdrs, nfslog_symlinkargs *objp)
481 if (!xdr_nfslog_diropargs(xdrs, &objp->sla_from))
482 return (FALSE);
483 if (!xdr_string(xdrs, &objp->sla_tnm, ~0))
484 return (FALSE);
485 if (!xdr_nfslog_sattr(xdrs, &objp->sla_sa))
486 return (FALSE);
487 return (TRUE);
490 bool_t
491 xdr_nfslog_rddirargs(XDR *xdrs, nfslog_rddirargs *objp)
493 if (!xdr_fhandle(xdrs, &objp->rda_fh))
494 return (FALSE);
495 if (!xdr_u_int(xdrs, &objp->rda_offset))
496 return (FALSE);
497 if (!xdr_u_int(xdrs, &objp->rda_count))
498 return (FALSE);
499 return (TRUE);
502 static bool_t
503 xdr_nfslog_rdok(XDR *xdrs, nfslog_rdok *objp)
505 if (!xdr_u_int(xdrs, &objp->rdok_offset))
506 return (FALSE);
507 if (!xdr_u_int(xdrs, &objp->rdok_size))
508 return (FALSE);
509 if (!xdr_bool(xdrs, &objp->rdok_eof))
510 return (FALSE);
511 return (TRUE);
514 bool_t
515 xdr_nfslog_rddirres(XDR *xdrs, nfslog_rddirres *objp)
517 if (!xdr_nfsstat(xdrs, &objp->rd_status))
518 return (FALSE);
519 switch (objp->rd_status) {
520 case NFS_OK:
521 if (!xdr_nfslog_rdok(xdrs, &objp->nfslog_rddirres_u.rd_ok))
522 return (FALSE);
523 break;
525 return (TRUE);
528 bool_t
529 xdr_nfslog_diropargs3(XDR *xdrs, nfslog_diropargs3 *objp)
531 if (!xdr_nfs_fh3(xdrs, &objp->dir))
532 return (FALSE);
533 if (!xdr_string(xdrs, &objp->name, ~0))
534 return (FALSE);
535 return (TRUE);
538 bool_t
539 xdr_nfslog_LOOKUP3res(XDR *xdrs, nfslog_LOOKUP3res *objp)
541 if (!xdr_nfsstat3(xdrs, &objp->status))
542 return (FALSE);
543 switch (objp->status) {
544 case NFS3_OK:
545 if (!xdr_nfs_fh3(xdrs, &objp->nfslog_LOOKUP3res_u.object))
546 return (FALSE);
547 break;
549 return (TRUE);
552 static bool_t
553 xdr_nfslog_createhow3(XDR *xdrs, nfslog_createhow3 *objp)
555 if (!xdr_createmode3(xdrs, &objp->mode))
556 return (FALSE);
557 switch (objp->mode) {
558 case UNCHECKED:
559 case GUARDED:
560 if (!xdr_set_size3(xdrs, &objp->nfslog_createhow3_u.size))
561 return (FALSE);
562 break;
563 case EXCLUSIVE:
564 break;
565 default:
566 return (FALSE);
568 return (TRUE);
571 bool_t
572 xdr_nfslog_CREATE3args(XDR *xdrs, nfslog_CREATE3args *objp)
574 if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
575 return (FALSE);
576 if (!xdr_nfslog_createhow3(xdrs, &objp->how))
577 return (FALSE);
578 return (TRUE);
581 static bool_t
582 xdr_nfslog_CREATE3resok(XDR *xdrs, nfslog_CREATE3resok *objp)
584 if (!xdr_post_op_fh3(xdrs, &objp->obj))
585 return (FALSE);
586 return (TRUE);
589 bool_t
590 xdr_nfslog_CREATE3res(XDR *xdrs, nfslog_CREATE3res *objp)
592 if (!xdr_nfsstat3(xdrs, &objp->status))
593 return (FALSE);
594 switch (objp->status) {
595 case NFS3_OK:
596 if (!xdr_nfslog_CREATE3resok(
597 xdrs, &objp->nfslog_CREATE3res_u.ok))
598 return (FALSE);
599 break;
601 return (TRUE);
604 bool_t
605 xdr_nfslog_SETATTR3args(XDR *xdrs, nfslog_SETATTR3args *objp)
607 if (!xdr_nfs_fh3(xdrs, &objp->object))
608 return (FALSE);
609 if (!xdr_set_size3(xdrs, &objp->size))
610 return (FALSE);
611 return (TRUE);
614 bool_t
615 xdr_nfslog_READLINK3res(XDR *xdrs, nfslog_READLINK3res *objp)
617 if (!xdr_nfsstat3(xdrs, &objp->status))
618 return (FALSE);
619 switch (objp->status) {
620 case NFS3_OK:
621 if (!xdr_string(xdrs, &objp->nfslog_READLINK3res_u.data, ~0))
622 return (FALSE);
623 break;
625 return (TRUE);
628 bool_t
629 xdr_nfslog_READ3args(XDR *xdrs, nfslog_READ3args *objp)
631 if (!xdr_nfs_fh3(xdrs, &objp->file))
632 return (FALSE);
633 if (!xdr_offset3(xdrs, &objp->offset))
634 return (FALSE);
635 if (!xdr_count3(xdrs, &objp->count))
636 return (FALSE);
637 return (TRUE);
640 static bool_t
641 xdr_nfslog_READ3resok(XDR *xdrs, nfslog_READ3resok *objp)
643 if (!xdr_size3(xdrs, &objp->filesize))
644 return (FALSE);
645 if (!xdr_count3(xdrs, &objp->count))
646 return (FALSE);
647 if (!xdr_bool(xdrs, &objp->eof))
648 return (FALSE);
649 if (!xdr_u_int(xdrs, &objp->size))
650 return (FALSE);
651 return (TRUE);
654 bool_t
655 xdr_nfslog_READ3res(XDR *xdrs, nfslog_READ3res *objp)
657 if (!xdr_nfsstat3(xdrs, &objp->status))
658 return (FALSE);
659 switch (objp->status) {
660 case NFS3_OK:
661 if (!xdr_nfslog_READ3resok(xdrs, &objp->nfslog_READ3res_u.ok))
662 return (FALSE);
663 break;
665 return (TRUE);
668 bool_t
669 xdr_nfslog_WRITE3args(XDR *xdrs, nfslog_WRITE3args *objp)
671 if (!xdr_nfs_fh3(xdrs, &objp->file))
672 return (FALSE);
673 if (!xdr_offset3(xdrs, &objp->offset))
674 return (FALSE);
675 if (!xdr_count3(xdrs, &objp->count))
676 return (FALSE);
677 if (!xdr_stable_how(xdrs, &objp->stable))
678 return (FALSE);
679 return (TRUE);
682 static bool_t
683 xdr_nfslog_WRITE3resok(XDR *xdrs, nfslog_WRITE3resok *objp)
685 if (!xdr_size3(xdrs, &objp->filesize))
686 return (FALSE);
687 if (!xdr_count3(xdrs, &objp->count))
688 return (FALSE);
689 if (!xdr_stable_how(xdrs, &objp->committed))
690 return (FALSE);
691 return (TRUE);
694 bool_t
695 xdr_nfslog_WRITE3res(XDR *xdrs, nfslog_WRITE3res *objp)
697 if (!xdr_nfsstat3(xdrs, &objp->status))
698 return (FALSE);
699 switch (objp->status) {
700 case NFS3_OK:
701 if (!xdr_nfslog_WRITE3resok(xdrs, &objp->nfslog_WRITE3res_u.ok))
702 return (FALSE);
703 break;
705 return (TRUE);
708 bool_t
709 xdr_nfslog_MKDIR3args(XDR *xdrs, nfslog_MKDIR3args *objp)
711 if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
712 return (FALSE);
713 return (TRUE);
716 bool_t
717 xdr_nfslog_MKDIR3res(XDR *xdrs, nfslog_MKDIR3res *objp)
719 if (!xdr_nfsstat3(xdrs, &objp->status))
720 return (FALSE);
721 switch (objp->status) {
722 case NFS3_OK:
723 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKDIR3res_u.obj))
724 return (FALSE);
725 break;
727 return (TRUE);
730 bool_t
731 xdr_nfslog_SYMLINK3args(XDR *xdrs, nfslog_SYMLINK3args *objp)
733 if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
734 return (FALSE);
735 if (!xdr_string(xdrs, &objp->symlink_data, ~0))
736 return (FALSE);
737 return (TRUE);
740 bool_t
741 xdr_nfslog_SYMLINK3res(XDR *xdrs, nfslog_SYMLINK3res *objp)
743 if (!xdr_nfsstat3(xdrs, &objp->status))
744 return (FALSE);
745 switch (objp->status) {
746 case NFS3_OK:
747 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_SYMLINK3res_u.obj))
748 return (FALSE);
749 break;
751 return (TRUE);
754 bool_t
755 xdr_nfslog_MKNOD3args(XDR *xdrs, nfslog_MKNOD3args *objp)
757 if (!xdr_nfslog_diropargs3(xdrs, &objp->where))
758 return (FALSE);
759 if (!xdr_ftype3(xdrs, &objp->type))
760 return (FALSE);
761 return (TRUE);
764 bool_t
765 xdr_nfslog_MKNOD3res(XDR *xdrs, nfslog_MKNOD3res *objp)
767 if (!xdr_nfsstat3(xdrs, &objp->status))
768 return (FALSE);
769 switch (objp->status) {
770 case NFS3_OK:
771 if (!xdr_post_op_fh3(xdrs, &objp->nfslog_MKNOD3res_u.obj))
772 return (FALSE);
773 break;
775 return (TRUE);
778 bool_t
779 xdr_nfslog_REMOVE3args(XDR *xdrs, nfslog_REMOVE3args *objp)
781 if (!xdr_nfslog_diropargs3(xdrs, &objp->object))
782 return (FALSE);
783 return (TRUE);
786 bool_t
787 xdr_nfslog_RMDIR3args(XDR *xdrs, nfslog_RMDIR3args *objp)
789 if (!xdr_nfslog_diropargs3(xdrs, &objp->object))
790 return (FALSE);
791 return (TRUE);
794 bool_t
795 xdr_nfslog_RENAME3args(XDR *xdrs, nfslog_RENAME3args *objp)
797 if (!xdr_nfslog_diropargs3(xdrs, &objp->from))
798 return (FALSE);
799 if (!xdr_nfslog_diropargs3(xdrs, &objp->to))
800 return (FALSE);
801 return (TRUE);
804 bool_t
805 xdr_nfslog_LINK3args(XDR *xdrs, nfslog_LINK3args *objp)
807 if (!xdr_nfs_fh3(xdrs, &objp->file))
808 return (FALSE);
809 if (!xdr_nfslog_diropargs3(xdrs, &objp->link))
810 return (FALSE);
811 return (TRUE);
814 bool_t
815 xdr_nfslog_READDIRPLUS3args(XDR *xdrs, nfslog_READDIRPLUS3args *objp)
817 if (!xdr_nfs_fh3(xdrs, &objp->dir))
818 return (FALSE);
819 if (!xdr_count3(xdrs, &objp->dircount))
820 return (FALSE);
821 if (!xdr_count3(xdrs, &objp->maxcount))
822 return (FALSE);
823 return (TRUE);
826 static bool_t
827 xdr_nfslog_entryplus3(XDR *xdrs, nfslog_entryplus3 *objp)
829 if (!xdr_post_op_fh3(xdrs, &objp->name_handle))
830 return (FALSE);
831 if (!xdr_string(xdrs, &objp->name, ~0))
832 return (FALSE);
833 if (!xdr_pointer(xdrs, (char **)&objp->nextentry,
834 sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3))
835 return (FALSE);
836 return (TRUE);
839 static bool_t
840 xdr_nfslog_dirlistplus3(XDR *xdrs, nfslog_dirlistplus3 *objp)
842 if (!xdr_pointer(xdrs, (char **)&objp->entries,
843 sizeof (nfslog_entryplus3), (xdrproc_t)xdr_nfslog_entryplus3))
844 return (FALSE);
845 if (!xdr_bool(xdrs, &objp->eof))
846 return (FALSE);
847 return (TRUE);
850 static bool_t
851 xdr_nfslog_READDIRPLUS3resok(XDR *xdrs, nfslog_READDIRPLUS3resok *objp)
853 if (!xdr_nfslog_dirlistplus3(xdrs, &objp->reply))
854 return (FALSE);
855 return (TRUE);
858 bool_t
859 xdr_nfslog_READDIRPLUS3res(XDR *xdrs, nfslog_READDIRPLUS3res *objp)
861 if (!xdr_nfsstat3(xdrs, &objp->status))
862 return (FALSE);
863 switch (objp->status) {
864 case NFS3_OK:
865 if (!xdr_nfslog_READDIRPLUS3resok(
866 xdrs, &objp->nfslog_READDIRPLUS3res_u.ok))
867 return (FALSE);
868 break;
870 return (TRUE);
873 bool_t
874 xdr_nfslog_COMMIT3args(XDR *xdrs, nfslog_COMMIT3args *objp)
876 if (!xdr_nfs_fh3(xdrs, &objp->file))
877 return (FALSE);
878 if (!xdr_offset3(xdrs, &objp->offset))
879 return (FALSE);
880 if (!xdr_count3(xdrs, &objp->count))
881 return (FALSE);
882 return (TRUE);