dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / cmd-inet / usr.sbin / snoop / nfs4_xdr.c
blob20da14996c8949c503518ca7d9aef40a0ac51e0f
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
24 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
28 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
29 * Use is subject to license terms.
33 * This file was initially generated using rpcgen. The rpcgen-erated
34 * code used tail recursion to implement linked lists which resulted
35 * in various crashes due to blown stacks. If the NFS4 protocol changes
36 * be sure to either use the NFS4-friendly rpcgen (doesn't use tail
37 * recursion) or do the xdr by hand.
39 * CAUTION: This file is kept in sync with it's uts counterpart:
41 * usr/src/uts/common/fs/nfs/nfs4_xdr.c
43 * However, it is not an exact copy. NEVER copy uts's nfs4_xdr.c
44 * directly over this file. Changes from the uts version must be
45 * integrated by hand into this file.
48 #include <rpcsvc/nfs4_prot.h>
49 #include <nfs/nfs4.h>
50 #include <malloc.h>
52 #define IGNORE_RDWR_DATA
54 extern int nfs4_skip_bytes;
56 bool_t
57 xdr_nfs_ftype4(register XDR *xdrs, nfs_ftype4 *objp)
60 if (!xdr_enum(xdrs, (enum_t *)objp))
61 return (FALSE);
62 return (TRUE);
65 bool_t
66 xdr_nfsstat4(register XDR *xdrs, nfsstat4 *objp)
69 if (!xdr_enum(xdrs, (enum_t *)objp))
70 return (FALSE);
71 return (TRUE);
74 bool_t
75 xdr_bitmap4(register XDR *xdrs, bitmap4 *objp)
78 if (!xdr_array(xdrs, (char **)&objp->bitmap4_val,
79 (uint_t *)&objp->bitmap4_len, ~0,
80 sizeof (uint32_t), (xdrproc_t)xdr_uint32_t))
81 return (FALSE);
82 return (TRUE);
85 bool_t
86 xdr_offset4(register XDR *xdrs, offset4 *objp)
89 if (!xdr_uint64_t(xdrs, objp))
90 return (FALSE);
91 return (TRUE);
94 bool_t
95 xdr_count4(register XDR *xdrs, count4 *objp)
98 if (!xdr_uint32_t(xdrs, objp))
99 return (FALSE);
100 return (TRUE);
103 bool_t
104 xdr_length4(register XDR *xdrs, length4 *objp)
107 if (!xdr_uint64_t(xdrs, objp))
108 return (FALSE);
109 return (TRUE);
112 bool_t
113 xdr_clientid4(register XDR *xdrs, clientid4 *objp)
116 if (!xdr_uint64_t(xdrs, objp))
117 return (FALSE);
118 return (TRUE);
121 bool_t
122 xdr_seqid4(register XDR *xdrs, seqid4 *objp)
125 if (!xdr_uint32_t(xdrs, objp))
126 return (FALSE);
127 return (TRUE);
130 bool_t
131 xdr_utf8string(register XDR *xdrs, utf8string *objp)
134 if (!xdr_bytes(xdrs, (char **)&objp->utf8string_val,
135 (uint_t *)&objp->utf8string_len, NFS4_MAX_UTF8STRING))
136 return (FALSE);
137 return (TRUE);
140 bool_t
141 xdr_component4(register XDR *xdrs, component4 *objp)
144 if (!xdr_utf8string(xdrs, objp))
145 return (FALSE);
146 return (TRUE);
149 bool_t
150 xdr_pathname4(register XDR *xdrs, pathname4 *objp)
153 if (!xdr_array(xdrs, (char **)&objp->pathname4_val,
154 (uint_t *)&objp->pathname4_len, NFS4_MAX_PATHNAME4,
155 sizeof (component4), (xdrproc_t)xdr_component4))
156 return (FALSE);
157 return (TRUE);
160 bool_t
161 xdr_nfs_lockid4(register XDR *xdrs, nfs_lockid4 *objp)
164 if (!xdr_uint64_t(xdrs, objp))
165 return (FALSE);
166 return (TRUE);
169 bool_t
170 xdr_nfs_cookie4(register XDR *xdrs, nfs_cookie4 *objp)
173 if (!xdr_uint64_t(xdrs, objp))
174 return (FALSE);
175 return (TRUE);
178 bool_t
179 xdr_linktext4(register XDR *xdrs, linktext4 *objp)
182 if (!xdr_bytes(xdrs, (char **)&objp->linktext4_val,
183 (uint_t *)&objp->linktext4_len, NFS4_MAX_LINKTEXT4))
184 return (FALSE);
185 return (TRUE);
188 bool_t
189 xdr_ascii_REQUIRED4(register XDR *xdrs, ascii_REQUIRED4 *objp)
192 if (!xdr_utf8string(xdrs, objp))
193 return (FALSE);
194 return (TRUE);
197 bool_t
198 xdr_sec_oid4(register XDR *xdrs, sec_oid4 *objp)
201 if (!xdr_bytes(xdrs, (char **)&objp->sec_oid4_val,
202 (uint_t *)&objp->sec_oid4_len, NFS4_MAX_SECOID4))
203 return (FALSE);
204 return (TRUE);
207 bool_t
208 xdr_qop4(register XDR *xdrs, qop4 *objp)
211 if (!xdr_uint32_t(xdrs, objp))
212 return (FALSE);
213 return (TRUE);
216 bool_t
217 xdr_mode4(register XDR *xdrs, mode4 *objp)
220 if (!xdr_uint32_t(xdrs, objp))
221 return (FALSE);
222 return (TRUE);
225 bool_t
226 xdr_changeid4(register XDR *xdrs, changeid4 *objp)
229 if (!xdr_uint64_t(xdrs, objp))
230 return (FALSE);
231 return (TRUE);
234 bool_t
235 xdr_verifier4(register XDR *xdrs, verifier4 objp)
238 if (!xdr_opaque(xdrs, objp, NFS4_VERIFIER_SIZE))
239 return (FALSE);
240 return (TRUE);
243 bool_t
244 xdr_nfstime4(register XDR *xdrs, nfstime4 *objp)
247 if (!xdr_int64_t(xdrs, &objp->seconds))
248 return (FALSE);
249 if (!xdr_uint32_t(xdrs, &objp->nseconds))
250 return (FALSE);
251 return (TRUE);
254 bool_t
255 xdr_time_how4(register XDR *xdrs, time_how4 *objp)
258 if (!xdr_enum(xdrs, (enum_t *)objp))
259 return (FALSE);
260 return (TRUE);
263 bool_t
264 xdr_settime4(register XDR *xdrs, settime4 *objp)
267 if (!xdr_time_how4(xdrs, &objp->set_it))
268 return (FALSE);
269 switch (objp->set_it) {
270 case SET_TO_CLIENT_TIME4:
271 if (!xdr_nfstime4(xdrs, &objp->settime4_u.time))
272 return (FALSE);
273 break;
275 return (TRUE);
278 bool_t
279 xdr_nfs_fh4(register XDR *xdrs, nfs_fh4 *objp)
282 if (!xdr_bytes(xdrs, (char **)&objp->nfs_fh4_val,
283 (uint_t *)&objp->nfs_fh4_len, NFS4_FHSIZE))
284 return (FALSE);
285 return (TRUE);
288 bool_t
289 xdr_fsid4(register XDR *xdrs, fsid4 *objp)
292 if (!xdr_uint64_t(xdrs, &objp->major))
293 return (FALSE);
294 if (!xdr_uint64_t(xdrs, &objp->minor))
295 return (FALSE);
296 return (TRUE);
299 bool_t
300 xdr_fs_location4(register XDR *xdrs, fs_location4 *objp)
303 if (!xdr_array(xdrs, (char **)&objp->server.server_val,
304 (uint_t *)&objp->server.server_len, ~0,
305 sizeof (utf8string), (xdrproc_t)xdr_utf8string))
306 return (FALSE);
307 if (!xdr_pathname4(xdrs, &objp->rootpath))
308 return (FALSE);
309 return (TRUE);
312 bool_t
313 xdr_fs_locations4(register XDR *xdrs, fs_locations4 *objp)
316 if (!xdr_pathname4(xdrs, &objp->fs_root))
317 return (FALSE);
318 if (!xdr_array(xdrs, (char **)&objp->locations.locations_val,
319 (uint_t *)&objp->locations.locations_len, ~0,
320 sizeof (fs_location4), (xdrproc_t)xdr_fs_location4))
321 return (FALSE);
322 return (TRUE);
325 bool_t
326 xdr_acetype4(register XDR *xdrs, acetype4 *objp)
329 if (!xdr_u_int(xdrs, objp))
330 return (FALSE);
331 return (TRUE);
334 bool_t
335 xdr_aceflag4(register XDR *xdrs, aceflag4 *objp)
338 if (!xdr_u_int(xdrs, objp))
339 return (FALSE);
340 return (TRUE);
343 bool_t
344 xdr_acemask4(register XDR *xdrs, acemask4 *objp)
347 if (!xdr_u_int(xdrs, objp))
348 return (FALSE);
349 return (TRUE);
352 bool_t
353 xdr_nfsace4(register XDR *xdrs, nfsace4 *objp)
355 if (!xdr_acetype4(xdrs, &objp->type))
356 return (FALSE);
357 if (!xdr_aceflag4(xdrs, &objp->flag))
358 return (FALSE);
359 if (!xdr_acemask4(xdrs, &objp->access_mask))
360 return (FALSE);
361 if (xdrs->x_op == XDR_DECODE) {
362 objp->who.utf8string_val = NULL;
363 objp->who.utf8string_len = 0;
365 return (xdr_bytes(xdrs, (char **)&objp->who.utf8string_val,
366 (uint_t *)&objp->who.utf8string_len,
367 NFS4_MAX_UTF8STRING));
370 bool_t
371 xdr_specdata4(register XDR *xdrs, specdata4 *objp)
374 if (!xdr_uint32_t(xdrs, &objp->specdata1))
375 return (FALSE);
376 if (!xdr_uint32_t(xdrs, &objp->specdata2))
377 return (FALSE);
378 return (TRUE);
381 bool_t
382 xdr_fattr4_supported_attrs(register XDR *xdrs, fattr4_supported_attrs *objp)
385 if (!xdr_bitmap4(xdrs, objp))
386 return (FALSE);
387 return (TRUE);
390 bool_t
391 xdr_fattr4_type(register XDR *xdrs, fattr4_type *objp)
394 if (!xdr_nfs_ftype4(xdrs, objp))
395 return (FALSE);
396 return (TRUE);
399 bool_t
400 xdr_fattr4_fh_expire_type(register XDR *xdrs, fattr4_fh_expire_type *objp)
403 if (!xdr_uint32_t(xdrs, objp))
404 return (FALSE);
405 return (TRUE);
408 bool_t
409 xdr_fattr4_change(register XDR *xdrs, fattr4_change *objp)
412 if (!xdr_changeid4(xdrs, objp))
413 return (FALSE);
414 return (TRUE);
417 bool_t
418 xdr_fattr4_size(register XDR *xdrs, fattr4_size *objp)
421 if (!xdr_uint64_t(xdrs, objp))
422 return (FALSE);
423 return (TRUE);
426 bool_t
427 xdr_fattr4_link_support(register XDR *xdrs, fattr4_link_support *objp)
430 if (!xdr_bool(xdrs, objp))
431 return (FALSE);
432 return (TRUE);
435 bool_t
436 xdr_fattr4_symlink_support(register XDR *xdrs, fattr4_symlink_support *objp)
439 if (!xdr_bool(xdrs, objp))
440 return (FALSE);
441 return (TRUE);
444 bool_t
445 xdr_fattr4_named_attr(register XDR *xdrs, fattr4_named_attr *objp)
448 if (!xdr_bool(xdrs, objp))
449 return (FALSE);
450 return (TRUE);
453 bool_t
454 xdr_fattr4_fsid(register XDR *xdrs, fattr4_fsid *objp)
457 if (!xdr_fsid4(xdrs, objp))
458 return (FALSE);
459 return (TRUE);
462 bool_t
463 xdr_fattr4_unique_handles(register XDR *xdrs, fattr4_unique_handles *objp)
466 if (!xdr_bool(xdrs, objp))
467 return (FALSE);
468 return (TRUE);
471 bool_t
472 xdr_fattr4_lease_time(register XDR *xdrs, fattr4_lease_time *objp)
475 if (!xdr_uint32_t(xdrs, objp))
476 return (FALSE);
477 return (TRUE);
480 bool_t
481 xdr_fattr4_rdattr_error(register XDR *xdrs, fattr4_rdattr_error *objp)
484 if (!xdr_nfsstat4(xdrs, objp))
485 return (FALSE);
486 return (TRUE);
489 bool_t
490 xdr_fattr4_acl(register XDR *xdrs, fattr4_acl *objp)
493 if (!xdr_array(xdrs, (char **)&objp->fattr4_acl_val,
494 (uint_t *)&objp->fattr4_acl_len, ~0,
495 sizeof (nfsace4), (xdrproc_t)xdr_nfsace4))
496 return (FALSE);
497 return (TRUE);
500 bool_t
501 xdr_fattr4_aclsupport(register XDR *xdrs, fattr4_aclsupport *objp)
504 if (!xdr_uint32_t(xdrs, objp))
505 return (FALSE);
506 return (TRUE);
509 bool_t
510 xdr_fattr4_archive(register XDR *xdrs, fattr4_archive *objp)
513 if (!xdr_bool(xdrs, objp))
514 return (FALSE);
515 return (TRUE);
518 bool_t
519 xdr_fattr4_cansettime(register XDR *xdrs, fattr4_cansettime *objp)
522 if (!xdr_bool(xdrs, objp))
523 return (FALSE);
524 return (TRUE);
527 bool_t
528 xdr_fattr4_case_insensitive(register XDR *xdrs, fattr4_case_insensitive *objp)
531 if (!xdr_bool(xdrs, objp))
532 return (FALSE);
533 return (TRUE);
536 bool_t
537 xdr_fattr4_case_preserving(register XDR *xdrs, fattr4_case_preserving *objp)
540 if (!xdr_bool(xdrs, objp))
541 return (FALSE);
542 return (TRUE);
545 bool_t
546 xdr_fattr4_chown_restricted(register XDR *xdrs, fattr4_chown_restricted *objp)
549 if (!xdr_bool(xdrs, objp))
550 return (FALSE);
551 return (TRUE);
554 bool_t
555 xdr_fattr4_fileid(register XDR *xdrs, fattr4_fileid *objp)
558 if (!xdr_uint64_t(xdrs, objp))
559 return (FALSE);
560 return (TRUE);
563 bool_t
564 xdr_fattr4_files_avail(register XDR *xdrs, fattr4_files_avail *objp)
567 if (!xdr_uint64_t(xdrs, objp))
568 return (FALSE);
569 return (TRUE);
572 bool_t
573 xdr_fattr4_filehandle(register XDR *xdrs, fattr4_filehandle *objp)
576 if (!xdr_nfs_fh4(xdrs, objp))
577 return (FALSE);
578 return (TRUE);
581 bool_t
582 xdr_fattr4_files_free(register XDR *xdrs, fattr4_files_free *objp)
585 if (!xdr_uint64_t(xdrs, objp))
586 return (FALSE);
587 return (TRUE);
590 bool_t
591 xdr_fattr4_files_total(register XDR *xdrs, fattr4_files_total *objp)
594 if (!xdr_uint64_t(xdrs, objp))
595 return (FALSE);
596 return (TRUE);
599 bool_t
600 xdr_fattr4_fs_locations(register XDR *xdrs, fattr4_fs_locations *objp)
603 if (!xdr_fs_locations4(xdrs, objp))
604 return (FALSE);
605 return (TRUE);
608 bool_t
609 xdr_fattr4_hidden(register XDR *xdrs, fattr4_hidden *objp)
612 if (!xdr_bool(xdrs, objp))
613 return (FALSE);
614 return (TRUE);
617 bool_t
618 xdr_fattr4_homogeneous(register XDR *xdrs, fattr4_homogeneous *objp)
621 if (!xdr_bool(xdrs, objp))
622 return (FALSE);
623 return (TRUE);
626 bool_t
627 xdr_fattr4_maxfilesize(register XDR *xdrs, fattr4_maxfilesize *objp)
630 if (!xdr_uint64_t(xdrs, objp))
631 return (FALSE);
632 return (TRUE);
635 bool_t
636 xdr_fattr4_maxlink(register XDR *xdrs, fattr4_maxlink *objp)
639 if (!xdr_uint32_t(xdrs, objp))
640 return (FALSE);
641 return (TRUE);
644 bool_t
645 xdr_fattr4_maxname(register XDR *xdrs, fattr4_maxname *objp)
648 if (!xdr_uint32_t(xdrs, objp))
649 return (FALSE);
650 return (TRUE);
653 bool_t
654 xdr_fattr4_maxread(register XDR *xdrs, fattr4_maxread *objp)
657 if (!xdr_uint64_t(xdrs, objp))
658 return (FALSE);
659 return (TRUE);
662 bool_t
663 xdr_fattr4_maxwrite(register XDR *xdrs, fattr4_maxwrite *objp)
666 if (!xdr_uint64_t(xdrs, objp))
667 return (FALSE);
668 return (TRUE);
671 bool_t
672 xdr_fattr4_mimetype(register XDR *xdrs, fattr4_mimetype *objp)
675 if (!xdr_ascii_REQUIRED4(xdrs, objp))
676 return (FALSE);
677 return (TRUE);
680 bool_t
681 xdr_fattr4_mode(register XDR *xdrs, fattr4_mode *objp)
684 if (!xdr_mode4(xdrs, objp))
685 return (FALSE);
686 return (TRUE);
689 bool_t
690 xdr_fattr4_mounted_on_fileid(register XDR *xdrs, fattr4_mounted_on_fileid *objp)
693 if (!xdr_uint64_t(xdrs, objp))
694 return (FALSE);
695 return (TRUE);
698 bool_t
699 xdr_fattr4_no_trunc(register XDR *xdrs, fattr4_no_trunc *objp)
702 if (!xdr_bool(xdrs, objp))
703 return (FALSE);
704 return (TRUE);
707 bool_t
708 xdr_fattr4_numlinks(register XDR *xdrs, fattr4_numlinks *objp)
711 if (!xdr_uint32_t(xdrs, objp))
712 return (FALSE);
713 return (TRUE);
716 bool_t
717 xdr_fattr4_owner(register XDR *xdrs, fattr4_owner *objp)
720 if (!xdr_utf8string(xdrs, objp))
721 return (FALSE);
722 return (TRUE);
725 bool_t
726 xdr_fattr4_owner_group(register XDR *xdrs, fattr4_owner_group *objp)
729 if (!xdr_utf8string(xdrs, objp))
730 return (FALSE);
731 return (TRUE);
734 bool_t
735 xdr_fattr4_quota_avail_hard(register XDR *xdrs, fattr4_quota_avail_hard *objp)
738 if (!xdr_uint64_t(xdrs, objp))
739 return (FALSE);
740 return (TRUE);
743 bool_t
744 xdr_fattr4_quota_avail_soft(register XDR *xdrs, fattr4_quota_avail_soft *objp)
747 if (!xdr_uint64_t(xdrs, objp))
748 return (FALSE);
749 return (TRUE);
752 bool_t
753 xdr_fattr4_quota_used(register XDR *xdrs, fattr4_quota_used *objp)
756 if (!xdr_uint64_t(xdrs, objp))
757 return (FALSE);
758 return (TRUE);
761 bool_t
762 xdr_fattr4_rawdev(register XDR *xdrs, fattr4_rawdev *objp)
765 if (!xdr_specdata4(xdrs, objp))
766 return (FALSE);
767 return (TRUE);
770 bool_t
771 xdr_fattr4_space_avail(register XDR *xdrs, fattr4_space_avail *objp)
774 if (!xdr_uint64_t(xdrs, objp))
775 return (FALSE);
776 return (TRUE);
779 bool_t
780 xdr_fattr4_space_free(register XDR *xdrs, fattr4_space_free *objp)
783 if (!xdr_uint64_t(xdrs, objp))
784 return (FALSE);
785 return (TRUE);
788 bool_t
789 xdr_fattr4_space_total(register XDR *xdrs, fattr4_space_total *objp)
792 if (!xdr_uint64_t(xdrs, objp))
793 return (FALSE);
794 return (TRUE);
797 bool_t
798 xdr_fattr4_space_used(register XDR *xdrs, fattr4_space_used *objp)
801 if (!xdr_uint64_t(xdrs, objp))
802 return (FALSE);
803 return (TRUE);
806 bool_t
807 xdr_fattr4_system(register XDR *xdrs, fattr4_system *objp)
810 if (!xdr_bool(xdrs, objp))
811 return (FALSE);
812 return (TRUE);
815 bool_t
816 xdr_fattr4_time_access(register XDR *xdrs, fattr4_time_access *objp)
819 if (!xdr_nfstime4(xdrs, objp))
820 return (FALSE);
821 return (TRUE);
824 bool_t
825 xdr_fattr4_time_access_set(register XDR *xdrs, fattr4_time_access_set *objp)
828 if (!xdr_settime4(xdrs, objp))
829 return (FALSE);
830 return (TRUE);
833 bool_t
834 xdr_fattr4_time_backup(register XDR *xdrs, fattr4_time_backup *objp)
837 if (!xdr_nfstime4(xdrs, objp))
838 return (FALSE);
839 return (TRUE);
842 bool_t
843 xdr_fattr4_time_create(register XDR *xdrs, fattr4_time_create *objp)
846 if (!xdr_nfstime4(xdrs, objp))
847 return (FALSE);
848 return (TRUE);
851 bool_t
852 xdr_fattr4_time_delta(register XDR *xdrs, fattr4_time_delta *objp)
855 if (!xdr_nfstime4(xdrs, objp))
856 return (FALSE);
857 return (TRUE);
860 bool_t
861 xdr_fattr4_time_metadata(register XDR *xdrs, fattr4_time_metadata *objp)
864 if (!xdr_nfstime4(xdrs, objp))
865 return (FALSE);
866 return (TRUE);
869 bool_t
870 xdr_fattr4_time_modify(register XDR *xdrs, fattr4_time_modify *objp)
873 if (!xdr_nfstime4(xdrs, objp))
874 return (FALSE);
875 return (TRUE);
878 bool_t
879 xdr_fattr4_time_modify_set(register XDR *xdrs, fattr4_time_modify_set *objp)
882 if (!xdr_settime4(xdrs, objp))
883 return (FALSE);
884 return (TRUE);
887 bool_t
888 xdr_attrlist4(register XDR *xdrs, attrlist4 *objp)
891 if (!xdr_bytes(xdrs, (char **)&objp->attrlist4_val,
892 (uint_t *)&objp->attrlist4_len, ~0))
893 return (FALSE);
894 return (TRUE);
897 bool_t
898 xdr_fattr4(register XDR *xdrs, fattr4 *objp)
901 if (!xdr_bitmap4(xdrs, &objp->attrmask))
902 return (FALSE);
903 if (!xdr_attrlist4(xdrs, &objp->attr_vals))
904 return (FALSE);
905 return (TRUE);
908 bool_t
909 xdr_change_info4(register XDR *xdrs, change_info4 *objp)
912 if (!xdr_bool(xdrs, &objp->atomic))
913 return (FALSE);
914 if (!xdr_changeid4(xdrs, &objp->before))
915 return (FALSE);
916 if (!xdr_changeid4(xdrs, &objp->after))
917 return (FALSE);
918 return (TRUE);
921 bool_t
922 xdr_clientaddr4(register XDR *xdrs, clientaddr4 *objp)
925 if (!xdr_string(xdrs, &objp->r_netid, ~0))
926 return (FALSE);
927 if (!xdr_string(xdrs, &objp->r_addr, ~0))
928 return (FALSE);
929 return (TRUE);
932 bool_t
933 xdr_cb_client4(register XDR *xdrs, cb_client4 *objp)
936 if (!xdr_u_int(xdrs, &objp->cb_program))
937 return (FALSE);
938 if (!xdr_clientaddr4(xdrs, &objp->cb_location))
939 return (FALSE);
940 return (TRUE);
943 bool_t
944 xdr_stateid4(register XDR *xdrs, stateid4 *objp)
947 if (!xdr_uint32_t(xdrs, &objp->seqid))
948 return (FALSE);
949 if (!xdr_opaque(xdrs, objp->other, 12))
950 return (FALSE);
951 return (TRUE);
954 bool_t
955 xdr_nfs_client_id4(register XDR *xdrs, nfs_client_id4 *objp)
958 if (!xdr_verifier4(xdrs, objp->verifier))
959 return (FALSE);
960 if (!xdr_bytes(xdrs, (char **)&objp->id.id_val,
961 (uint_t *)&objp->id.id_len, NFS4_OPAQUE_LIMIT))
962 return (FALSE);
963 return (TRUE);
966 bool_t
967 xdr_open_owner4(register XDR *xdrs, open_owner4 *objp)
970 if (!xdr_clientid4(xdrs, &objp->clientid))
971 return (FALSE);
972 if (!xdr_bytes(xdrs, (char **)&objp->owner.owner_val,
973 (uint_t *)&objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
974 return (FALSE);
975 return (TRUE);
978 bool_t
979 xdr_lock_owner4(register XDR *xdrs, lock_owner4 *objp)
982 if (!xdr_clientid4(xdrs, &objp->clientid))
983 return (FALSE);
984 if (!xdr_bytes(xdrs, (char **)&objp->owner.owner_val,
985 (uint_t *)&objp->owner.owner_len, NFS4_OPAQUE_LIMIT))
986 return (FALSE);
987 return (TRUE);
990 bool_t
991 xdr_nfs_lock_type4(register XDR *xdrs, nfs_lock_type4 *objp)
994 if (!xdr_enum(xdrs, (enum_t *)objp))
995 return (FALSE);
996 return (TRUE);
999 bool_t
1000 xdr_ACCESS4args(register XDR *xdrs, ACCESS4args *objp)
1003 if (!xdr_uint32_t(xdrs, &objp->access))
1004 return (FALSE);
1005 return (TRUE);
1008 bool_t
1009 xdr_ACCESS4resok(register XDR *xdrs, ACCESS4resok *objp)
1012 if (!xdr_uint32_t(xdrs, &objp->supported))
1013 return (FALSE);
1014 if (!xdr_uint32_t(xdrs, &objp->access))
1015 return (FALSE);
1016 return (TRUE);
1019 bool_t
1020 xdr_ACCESS4res(register XDR *xdrs, ACCESS4res *objp)
1023 if (!xdr_nfsstat4(xdrs, &objp->status))
1024 return (FALSE);
1025 switch (objp->status) {
1026 case NFS4_OK:
1027 if (!xdr_ACCESS4resok(xdrs, &objp->ACCESS4res_u.resok4))
1028 return (FALSE);
1029 break;
1031 return (TRUE);
1034 bool_t
1035 xdr_CLOSE4args(register XDR *xdrs, CLOSE4args *objp)
1038 if (!xdr_seqid4(xdrs, &objp->seqid))
1039 return (FALSE);
1040 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1041 return (FALSE);
1042 return (TRUE);
1045 bool_t
1046 xdr_CLOSE4res(register XDR *xdrs, CLOSE4res *objp)
1049 if (!xdr_nfsstat4(xdrs, &objp->status))
1050 return (FALSE);
1051 switch (objp->status) {
1052 case NFS4_OK:
1053 if (!xdr_stateid4(xdrs, &objp->CLOSE4res_u.open_stateid))
1054 return (FALSE);
1055 break;
1057 return (TRUE);
1060 bool_t
1061 xdr_COMMIT4args(register XDR *xdrs, COMMIT4args *objp)
1064 if (!xdr_offset4(xdrs, &objp->offset))
1065 return (FALSE);
1066 if (!xdr_count4(xdrs, &objp->count))
1067 return (FALSE);
1068 return (TRUE);
1071 bool_t
1072 xdr_COMMIT4resok(register XDR *xdrs, COMMIT4resok *objp)
1075 if (!xdr_verifier4(xdrs, objp->writeverf))
1076 return (FALSE);
1077 return (TRUE);
1080 bool_t
1081 xdr_COMMIT4res(register XDR *xdrs, COMMIT4res *objp)
1084 if (!xdr_nfsstat4(xdrs, &objp->status))
1085 return (FALSE);
1086 switch (objp->status) {
1087 case NFS4_OK:
1088 if (!xdr_COMMIT4resok(xdrs, &objp->COMMIT4res_u.resok4))
1089 return (FALSE);
1090 break;
1092 return (TRUE);
1095 bool_t
1096 xdr_createtype4(register XDR *xdrs, createtype4 *objp)
1099 if (!xdr_nfs_ftype4(xdrs, &objp->type))
1100 return (FALSE);
1101 switch (objp->type) {
1102 case NF4LNK:
1103 if (!xdr_linktext4(xdrs, &objp->createtype4_u.linkdata))
1104 return (FALSE);
1105 break;
1106 case NF4BLK:
1107 case NF4CHR:
1108 if (!xdr_specdata4(xdrs, &objp->createtype4_u.devdata))
1109 return (FALSE);
1110 break;
1111 case NF4SOCK:
1112 case NF4FIFO:
1113 case NF4DIR:
1114 break;
1116 return (TRUE);
1119 bool_t
1120 xdr_CREATE4args(register XDR *xdrs, CREATE4args *objp)
1123 if (!xdr_createtype4(xdrs, &objp->objtype))
1124 return (FALSE);
1125 if (!xdr_component4(xdrs, &objp->objname))
1126 return (FALSE);
1127 if (!xdr_fattr4(xdrs, &objp->createattrs))
1128 return (FALSE);
1129 return (TRUE);
1132 bool_t
1133 xdr_CREATE4resok(register XDR *xdrs, CREATE4resok *objp)
1136 if (!xdr_change_info4(xdrs, &objp->cinfo))
1137 return (FALSE);
1138 if (!xdr_bitmap4(xdrs, &objp->attrset))
1139 return (FALSE);
1140 return (TRUE);
1143 bool_t
1144 xdr_CREATE4res(register XDR *xdrs, CREATE4res *objp)
1147 if (!xdr_nfsstat4(xdrs, &objp->status))
1148 return (FALSE);
1149 switch (objp->status) {
1150 case NFS4_OK:
1151 if (!xdr_CREATE4resok(xdrs, &objp->CREATE4res_u.resok4))
1152 return (FALSE);
1153 break;
1155 return (TRUE);
1158 bool_t
1159 xdr_DELEGPURGE4args(register XDR *xdrs, DELEGPURGE4args *objp)
1162 if (!xdr_clientid4(xdrs, &objp->clientid))
1163 return (FALSE);
1164 return (TRUE);
1167 bool_t
1168 xdr_DELEGPURGE4res(register XDR *xdrs, DELEGPURGE4res *objp)
1171 if (!xdr_nfsstat4(xdrs, &objp->status))
1172 return (FALSE);
1173 return (TRUE);
1176 bool_t
1177 xdr_DELEGRETURN4args(register XDR *xdrs, DELEGRETURN4args *objp)
1180 if (!xdr_stateid4(xdrs, &objp->deleg_stateid))
1181 return (FALSE);
1182 return (TRUE);
1185 bool_t
1186 xdr_DELEGRETURN4res(register XDR *xdrs, DELEGRETURN4res *objp)
1189 if (!xdr_nfsstat4(xdrs, &objp->status))
1190 return (FALSE);
1191 return (TRUE);
1194 bool_t
1195 xdr_GETATTR4args(register XDR *xdrs, GETATTR4args *objp)
1198 if (!xdr_bitmap4(xdrs, &objp->attr_request))
1199 return (FALSE);
1200 return (TRUE);
1203 bool_t
1204 xdr_GETATTR4resok(register XDR *xdrs, GETATTR4resok *objp)
1207 if (!xdr_fattr4(xdrs, &objp->obj_attributes))
1208 return (FALSE);
1209 return (TRUE);
1212 bool_t
1213 xdr_GETATTR4res(register XDR *xdrs, GETATTR4res *objp)
1216 if (!xdr_nfsstat4(xdrs, &objp->status))
1217 return (FALSE);
1218 switch (objp->status) {
1219 case NFS4_OK:
1220 if (!xdr_GETATTR4resok(xdrs, &objp->GETATTR4res_u.resok4))
1221 return (FALSE);
1222 break;
1224 return (TRUE);
1227 bool_t
1228 xdr_GETFH4resok(register XDR *xdrs, GETFH4resok *objp)
1231 if (!xdr_nfs_fh4(xdrs, &objp->object))
1232 return (FALSE);
1233 return (TRUE);
1236 bool_t
1237 xdr_GETFH4res(register XDR *xdrs, GETFH4res *objp)
1240 if (!xdr_nfsstat4(xdrs, &objp->status))
1241 return (FALSE);
1242 switch (objp->status) {
1243 case NFS4_OK:
1244 if (!xdr_GETFH4resok(xdrs, &objp->GETFH4res_u.resok4))
1245 return (FALSE);
1246 break;
1248 return (TRUE);
1251 bool_t
1252 xdr_LINK4args(register XDR *xdrs, LINK4args *objp)
1255 if (!xdr_component4(xdrs, &objp->newname))
1256 return (FALSE);
1257 return (TRUE);
1260 bool_t
1261 xdr_LINK4resok(register XDR *xdrs, LINK4resok *objp)
1264 if (!xdr_change_info4(xdrs, &objp->cinfo))
1265 return (FALSE);
1266 return (TRUE);
1269 bool_t
1270 xdr_LINK4res(register XDR *xdrs, LINK4res *objp)
1273 if (!xdr_nfsstat4(xdrs, &objp->status))
1274 return (FALSE);
1275 switch (objp->status) {
1276 case NFS4_OK:
1277 if (!xdr_LINK4resok(xdrs, &objp->LINK4res_u.resok4))
1278 return (FALSE);
1279 break;
1281 return (TRUE);
1284 bool_t
1285 xdr_open_to_lock_owner4(register XDR *xdrs, open_to_lock_owner4 *objp)
1288 if (!xdr_seqid4(xdrs, &objp->open_seqid))
1289 return (FALSE);
1290 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1291 return (FALSE);
1292 if (!xdr_seqid4(xdrs, &objp->lock_seqid))
1293 return (FALSE);
1294 if (!xdr_lock_owner4(xdrs, &objp->lock_owner))
1295 return (FALSE);
1296 return (TRUE);
1299 bool_t
1300 xdr_exist_lock_owner4(register XDR *xdrs, exist_lock_owner4 *objp)
1303 if (!xdr_stateid4(xdrs, &objp->lock_stateid))
1304 return (FALSE);
1305 if (!xdr_seqid4(xdrs, &objp->lock_seqid))
1306 return (FALSE);
1307 return (TRUE);
1310 bool_t
1311 xdr_locker4(register XDR *xdrs, locker4 *objp)
1314 if (!xdr_bool(xdrs, &objp->new_lock_owner))
1315 return (FALSE);
1316 switch (objp->new_lock_owner) {
1317 case TRUE:
1318 if (!xdr_open_to_lock_owner4(xdrs, &objp->locker4_u.open_owner))
1319 return (FALSE);
1320 break;
1321 case FALSE:
1322 if (!xdr_exist_lock_owner4(xdrs, &objp->locker4_u.lock_owner))
1323 return (FALSE);
1324 break;
1325 default:
1326 return (FALSE);
1328 return (TRUE);
1331 bool_t
1332 xdr_LOCK4args(register XDR *xdrs, LOCK4args *objp)
1335 if (!xdr_nfs_lock_type4(xdrs, &objp->locktype))
1336 return (FALSE);
1337 if (!xdr_bool(xdrs, &objp->reclaim))
1338 return (FALSE);
1339 if (!xdr_offset4(xdrs, &objp->offset))
1340 return (FALSE);
1341 if (!xdr_length4(xdrs, &objp->length))
1342 return (FALSE);
1343 if (!xdr_locker4(xdrs, &objp->locker))
1344 return (FALSE);
1345 return (TRUE);
1348 bool_t
1349 xdr_LOCK4denied(register XDR *xdrs, LOCK4denied *objp)
1352 if (!xdr_offset4(xdrs, &objp->offset))
1353 return (FALSE);
1354 if (!xdr_length4(xdrs, &objp->length))
1355 return (FALSE);
1356 if (!xdr_nfs_lock_type4(xdrs, &objp->locktype))
1357 return (FALSE);
1358 if (!xdr_lock_owner4(xdrs, &objp->owner))
1359 return (FALSE);
1360 return (TRUE);
1363 bool_t
1364 xdr_LOCK4resok(register XDR *xdrs, LOCK4resok *objp)
1367 if (!xdr_stateid4(xdrs, &objp->lock_stateid))
1368 return (FALSE);
1369 return (TRUE);
1372 bool_t
1373 xdr_LOCK4res(register XDR *xdrs, LOCK4res *objp)
1376 if (!xdr_nfsstat4(xdrs, &objp->status))
1377 return (FALSE);
1378 switch (objp->status) {
1379 case NFS4_OK:
1380 if (!xdr_LOCK4resok(xdrs, &objp->LOCK4res_u.resok4))
1381 return (FALSE);
1382 break;
1383 case NFS4ERR_DENIED:
1384 if (!xdr_LOCK4denied(xdrs, &objp->LOCK4res_u.denied))
1385 return (FALSE);
1386 break;
1388 return (TRUE);
1391 bool_t
1392 xdr_LOCKT4args(register XDR *xdrs, LOCKT4args *objp)
1395 if (!xdr_nfs_lock_type4(xdrs, &objp->locktype))
1396 return (FALSE);
1397 if (!xdr_offset4(xdrs, &objp->offset))
1398 return (FALSE);
1399 if (!xdr_length4(xdrs, &objp->length))
1400 return (FALSE);
1401 if (!xdr_lock_owner4(xdrs, &objp->owner))
1402 return (FALSE);
1403 return (TRUE);
1406 bool_t
1407 xdr_LOCKT4res(register XDR *xdrs, LOCKT4res *objp)
1410 if (!xdr_nfsstat4(xdrs, &objp->status))
1411 return (FALSE);
1412 switch (objp->status) {
1413 case NFS4ERR_DENIED:
1414 if (!xdr_LOCK4denied(xdrs, &objp->LOCKT4res_u.denied))
1415 return (FALSE);
1416 break;
1417 case NFS4_OK:
1418 break;
1420 return (TRUE);
1423 bool_t
1424 xdr_LOCKU4args(register XDR *xdrs, LOCKU4args *objp)
1427 if (!xdr_nfs_lock_type4(xdrs, &objp->locktype))
1428 return (FALSE);
1429 if (!xdr_seqid4(xdrs, &objp->seqid))
1430 return (FALSE);
1431 if (!xdr_stateid4(xdrs, &objp->lock_stateid))
1432 return (FALSE);
1433 if (!xdr_offset4(xdrs, &objp->offset))
1434 return (FALSE);
1435 if (!xdr_length4(xdrs, &objp->length))
1436 return (FALSE);
1437 return (TRUE);
1440 bool_t
1441 xdr_LOCKU4res(register XDR *xdrs, LOCKU4res *objp)
1444 if (!xdr_nfsstat4(xdrs, &objp->status))
1445 return (FALSE);
1446 switch (objp->status) {
1447 case NFS4_OK:
1448 if (!xdr_stateid4(xdrs, &objp->LOCKU4res_u.lock_stateid))
1449 return (FALSE);
1450 break;
1452 return (TRUE);
1455 bool_t
1456 xdr_LOOKUP4args(register XDR *xdrs, LOOKUP4args *objp)
1459 if (!xdr_component4(xdrs, &objp->objname))
1460 return (FALSE);
1461 return (TRUE);
1464 bool_t
1465 xdr_LOOKUP4res(register XDR *xdrs, LOOKUP4res *objp)
1468 if (!xdr_nfsstat4(xdrs, &objp->status))
1469 return (FALSE);
1470 return (TRUE);
1473 bool_t
1474 xdr_LOOKUPP4res(register XDR *xdrs, LOOKUPP4res *objp)
1477 if (!xdr_nfsstat4(xdrs, &objp->status))
1478 return (FALSE);
1479 return (TRUE);
1482 bool_t
1483 xdr_NVERIFY4args(register XDR *xdrs, NVERIFY4args *objp)
1486 if (!xdr_fattr4(xdrs, &objp->obj_attributes))
1487 return (FALSE);
1488 return (TRUE);
1491 bool_t
1492 xdr_NVERIFY4res(register XDR *xdrs, NVERIFY4res *objp)
1495 if (!xdr_nfsstat4(xdrs, &objp->status))
1496 return (FALSE);
1497 return (TRUE);
1500 bool_t
1501 xdr_createmode4(register XDR *xdrs, createmode4 *objp)
1504 if (!xdr_enum(xdrs, (enum_t *)objp))
1505 return (FALSE);
1506 return (TRUE);
1509 bool_t
1510 xdr_createhow4(register XDR *xdrs, createhow4 *objp)
1513 if (!xdr_createmode4(xdrs, &objp->mode))
1514 return (FALSE);
1515 switch (objp->mode) {
1516 case UNCHECKED4:
1517 case GUARDED4:
1518 if (!xdr_fattr4(xdrs, &objp->createhow4_u.createattrs))
1519 return (FALSE);
1520 break;
1521 case EXCLUSIVE4:
1522 if (!xdr_verifier4(xdrs, objp->createhow4_u.createverf))
1523 return (FALSE);
1524 break;
1525 default:
1526 return (FALSE);
1528 return (TRUE);
1531 bool_t
1532 xdr_opentype4(register XDR *xdrs, opentype4 *objp)
1535 if (!xdr_enum(xdrs, (enum_t *)objp))
1536 return (FALSE);
1537 return (TRUE);
1540 bool_t
1541 xdr_openflag4(register XDR *xdrs, openflag4 *objp)
1544 if (!xdr_opentype4(xdrs, &objp->opentype))
1545 return (FALSE);
1546 switch (objp->opentype) {
1547 case OPEN4_CREATE:
1548 if (!xdr_createhow4(xdrs, &objp->openflag4_u.how))
1549 return (FALSE);
1550 break;
1552 return (TRUE);
1555 bool_t
1556 xdr_limit_by4(register XDR *xdrs, limit_by4 *objp)
1559 if (!xdr_enum(xdrs, (enum_t *)objp))
1560 return (FALSE);
1561 return (TRUE);
1564 bool_t
1565 xdr_nfs_modified_limit4(register XDR *xdrs, nfs_modified_limit4 *objp)
1568 if (!xdr_uint32_t(xdrs, &objp->num_blocks))
1569 return (FALSE);
1570 if (!xdr_uint32_t(xdrs, &objp->bytes_per_block))
1571 return (FALSE);
1572 return (TRUE);
1575 bool_t
1576 xdr_nfs_space_limit4(register XDR *xdrs, nfs_space_limit4 *objp)
1579 if (!xdr_limit_by4(xdrs, &objp->limitby))
1580 return (FALSE);
1581 switch (objp->limitby) {
1582 case NFS_LIMIT_SIZE:
1583 if (!xdr_uint64_t(xdrs, &objp->nfs_space_limit4_u.filesize))
1584 return (FALSE);
1585 break;
1586 case NFS_LIMIT_BLOCKS:
1587 if (!xdr_nfs_modified_limit4(xdrs, &objp->nfs_space_limit4_u.
1588 mod_blocks))
1589 return (FALSE);
1590 break;
1591 default:
1592 return (FALSE);
1594 return (TRUE);
1597 bool_t
1598 xdr_open_delegation_type4(register XDR *xdrs, open_delegation_type4 *objp)
1601 if (!xdr_enum(xdrs, (enum_t *)objp))
1602 return (FALSE);
1603 return (TRUE);
1606 bool_t
1607 xdr_open_claim_type4(register XDR *xdrs, open_claim_type4 *objp)
1610 if (!xdr_enum(xdrs, (enum_t *)objp))
1611 return (FALSE);
1612 return (TRUE);
1615 bool_t
1616 xdr_open_claim_delegate_cur4(register XDR *xdrs, open_claim_delegate_cur4 *objp)
1619 if (!xdr_stateid4(xdrs, &objp->delegate_stateid))
1620 return (FALSE);
1621 if (!xdr_component4(xdrs, &objp->file))
1622 return (FALSE);
1623 return (TRUE);
1626 bool_t
1627 xdr_open_claim4(register XDR *xdrs, open_claim4 *objp)
1630 if (!xdr_open_claim_type4(xdrs, &objp->claim))
1631 return (FALSE);
1632 switch (objp->claim) {
1633 case CLAIM_NULL:
1634 if (!xdr_component4(xdrs, &objp->open_claim4_u.file))
1635 return (FALSE);
1636 break;
1637 case CLAIM_PREVIOUS:
1638 if (!xdr_open_delegation_type4(xdrs, &objp->open_claim4_u.
1639 delegate_type))
1640 return (FALSE);
1641 break;
1642 case CLAIM_DELEGATE_CUR:
1643 if (!xdr_open_claim_delegate_cur4(xdrs, &objp->open_claim4_u.
1644 delegate_cur_info))
1645 return (FALSE);
1646 break;
1647 case CLAIM_DELEGATE_PREV:
1648 if (!xdr_component4(xdrs, &objp->open_claim4_u.
1649 file_delegate_prev))
1650 return (FALSE);
1651 break;
1652 default:
1653 return (FALSE);
1655 return (TRUE);
1658 bool_t
1659 xdr_OPEN4args(register XDR *xdrs, OPEN4args *objp)
1662 if (!xdr_seqid4(xdrs, &objp->seqid))
1663 return (FALSE);
1664 if (!xdr_uint32_t(xdrs, &objp->share_access))
1665 return (FALSE);
1666 if (!xdr_uint32_t(xdrs, &objp->share_deny))
1667 return (FALSE);
1668 if (!xdr_open_owner4(xdrs, &objp->owner))
1669 return (FALSE);
1670 if (!xdr_openflag4(xdrs, &objp->openhow))
1671 return (FALSE);
1672 if (!xdr_open_claim4(xdrs, &objp->claim))
1673 return (FALSE);
1674 return (TRUE);
1677 bool_t
1678 xdr_open_read_delegation4(register XDR *xdrs, open_read_delegation4 *objp)
1681 if (!xdr_stateid4(xdrs, &objp->stateid))
1682 return (FALSE);
1683 if (!xdr_bool(xdrs, &objp->recall))
1684 return (FALSE);
1685 if (!xdr_nfsace4(xdrs, &objp->permissions))
1686 return (FALSE);
1687 return (TRUE);
1690 bool_t
1691 xdr_open_write_delegation4(register XDR *xdrs, open_write_delegation4 *objp)
1694 if (!xdr_stateid4(xdrs, &objp->stateid))
1695 return (FALSE);
1696 if (!xdr_bool(xdrs, &objp->recall))
1697 return (FALSE);
1698 if (!xdr_nfs_space_limit4(xdrs, &objp->space_limit))
1699 return (FALSE);
1700 if (!xdr_nfsace4(xdrs, &objp->permissions))
1701 return (FALSE);
1702 return (TRUE);
1705 bool_t
1706 xdr_open_delegation4(register XDR *xdrs, open_delegation4 *objp)
1709 if (!xdr_open_delegation_type4(xdrs, &objp->delegation_type))
1710 return (FALSE);
1711 switch (objp->delegation_type) {
1712 case OPEN_DELEGATE_NONE:
1713 break;
1714 case OPEN_DELEGATE_READ:
1715 if (!xdr_open_read_delegation4(xdrs, &objp->open_delegation4_u.
1716 read))
1717 return (FALSE);
1718 break;
1719 case OPEN_DELEGATE_WRITE:
1720 if (!xdr_open_write_delegation4(xdrs, &objp->open_delegation4_u.
1721 write))
1722 return (FALSE);
1723 break;
1724 default:
1725 return (FALSE);
1727 return (TRUE);
1730 bool_t
1731 xdr_OPEN4resok(register XDR *xdrs, OPEN4resok *objp)
1734 if (!xdr_stateid4(xdrs, &objp->stateid))
1735 return (FALSE);
1736 if (!xdr_change_info4(xdrs, &objp->cinfo))
1737 return (FALSE);
1738 if (!xdr_uint32_t(xdrs, &objp->rflags))
1739 return (FALSE);
1740 if (!xdr_bitmap4(xdrs, &objp->attrset))
1741 return (FALSE);
1742 if (!xdr_open_delegation4(xdrs, &objp->delegation))
1743 return (FALSE);
1744 return (TRUE);
1747 bool_t
1748 xdr_OPEN4res(register XDR *xdrs, OPEN4res *objp)
1751 if (!xdr_nfsstat4(xdrs, &objp->status))
1752 return (FALSE);
1753 switch (objp->status) {
1754 case NFS4_OK:
1755 if (!xdr_OPEN4resok(xdrs, &objp->OPEN4res_u.resok4))
1756 return (FALSE);
1757 break;
1759 return (TRUE);
1762 bool_t
1763 xdr_OPENATTR4args(register XDR *xdrs, OPENATTR4args *objp)
1766 if (!xdr_bool(xdrs, &objp->createdir))
1767 return (FALSE);
1768 return (TRUE);
1771 bool_t
1772 xdr_OPENATTR4res(register XDR *xdrs, OPENATTR4res *objp)
1775 if (!xdr_nfsstat4(xdrs, &objp->status))
1776 return (FALSE);
1777 return (TRUE);
1780 bool_t
1781 xdr_OPEN_CONFIRM4args(register XDR *xdrs, OPEN_CONFIRM4args *objp)
1784 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1785 return (FALSE);
1786 if (!xdr_seqid4(xdrs, &objp->seqid))
1787 return (FALSE);
1788 return (TRUE);
1791 bool_t
1792 xdr_OPEN_CONFIRM4resok(register XDR *xdrs, OPEN_CONFIRM4resok *objp)
1795 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1796 return (FALSE);
1797 return (TRUE);
1800 bool_t
1801 xdr_OPEN_CONFIRM4res(register XDR *xdrs, OPEN_CONFIRM4res *objp)
1804 if (!xdr_nfsstat4(xdrs, &objp->status))
1805 return (FALSE);
1806 switch (objp->status) {
1807 case NFS4_OK:
1808 if (!xdr_OPEN_CONFIRM4resok(xdrs, &objp->OPEN_CONFIRM4res_u.
1809 resok4))
1810 return (FALSE);
1811 break;
1813 return (TRUE);
1816 bool_t
1817 xdr_OPEN_DOWNGRADE4args(register XDR *xdrs, OPEN_DOWNGRADE4args *objp)
1820 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1821 return (FALSE);
1822 if (!xdr_seqid4(xdrs, &objp->seqid))
1823 return (FALSE);
1824 if (!xdr_uint32_t(xdrs, &objp->share_access))
1825 return (FALSE);
1826 if (!xdr_uint32_t(xdrs, &objp->share_deny))
1827 return (FALSE);
1828 return (TRUE);
1831 bool_t
1832 xdr_OPEN_DOWNGRADE4resok(register XDR *xdrs, OPEN_DOWNGRADE4resok *objp)
1835 if (!xdr_stateid4(xdrs, &objp->open_stateid))
1836 return (FALSE);
1837 return (TRUE);
1840 bool_t
1841 xdr_OPEN_DOWNGRADE4res(register XDR *xdrs, OPEN_DOWNGRADE4res *objp)
1844 if (!xdr_nfsstat4(xdrs, &objp->status))
1845 return (FALSE);
1846 switch (objp->status) {
1847 case NFS4_OK:
1848 if (!xdr_OPEN_DOWNGRADE4resok(xdrs, &objp->OPEN_DOWNGRADE4res_u.
1849 resok4))
1850 return (FALSE);
1851 break;
1853 return (TRUE);
1856 bool_t
1857 xdr_PUTFH4args(register XDR *xdrs, PUTFH4args *objp)
1860 if (!xdr_nfs_fh4(xdrs, &objp->object))
1861 return (FALSE);
1862 return (TRUE);
1865 bool_t
1866 xdr_PUTFH4res(register XDR *xdrs, PUTFH4res *objp)
1869 if (!xdr_nfsstat4(xdrs, &objp->status))
1870 return (FALSE);
1871 return (TRUE);
1874 bool_t
1875 xdr_PUTPUBFH4res(register XDR *xdrs, PUTPUBFH4res *objp)
1878 if (!xdr_nfsstat4(xdrs, &objp->status))
1879 return (FALSE);
1880 return (TRUE);
1883 bool_t
1884 xdr_PUTROOTFH4res(register XDR *xdrs, PUTROOTFH4res *objp)
1887 if (!xdr_nfsstat4(xdrs, &objp->status))
1888 return (FALSE);
1889 return (TRUE);
1892 bool_t
1893 xdr_READ4args(register XDR *xdrs, READ4args *objp)
1896 if (!xdr_stateid4(xdrs, &objp->stateid))
1897 return (FALSE);
1898 if (!xdr_offset4(xdrs, &objp->offset))
1899 return (FALSE);
1900 if (!xdr_count4(xdrs, &objp->count))
1901 return (FALSE);
1902 return (TRUE);
1905 bool_t
1906 xdr_READ4resok(register XDR *xdrs, READ4resok *objp)
1909 if (!xdr_bool(xdrs, &objp->eof))
1910 return (FALSE);
1912 #ifdef IGNORE_RDWR_DATA
1914 * Try to get length of read, and if that
1915 * fails, default to 0. Don't return FALSE
1916 * because the other read info will not be
1917 * displayed.
1919 objp->data.data_val = NULL;
1920 if (!xdr_u_int(xdrs, &objp->data.data_len))
1921 objp->data.data_len = 0;
1922 nfs4_skip_bytes = objp->data.data_len;
1923 #else
1924 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val,
1925 (uint_t *)&objp->data.data_len, ~0))
1926 return (FALSE);
1927 #endif
1928 return (TRUE);
1931 bool_t
1932 xdr_READ4res(register XDR *xdrs, READ4res *objp)
1935 if (!xdr_nfsstat4(xdrs, &objp->status))
1936 return (FALSE);
1937 switch (objp->status) {
1938 case NFS4_OK:
1939 if (!xdr_READ4resok(xdrs, &objp->READ4res_u.resok4))
1940 return (FALSE);
1941 break;
1943 return (TRUE);
1946 bool_t
1947 xdr_READDIR4args(register XDR *xdrs, READDIR4args *objp)
1950 if (!xdr_nfs_cookie4(xdrs, &objp->cookie))
1951 return (FALSE);
1952 if (!xdr_verifier4(xdrs, objp->cookieverf))
1953 return (FALSE);
1954 if (!xdr_count4(xdrs, &objp->dircount))
1955 return (FALSE);
1956 if (!xdr_count4(xdrs, &objp->maxcount))
1957 return (FALSE);
1958 if (!xdr_bitmap4(xdrs, &objp->attr_request))
1959 return (FALSE);
1960 return (TRUE);
1963 bool_t
1964 xdr_entry4(register XDR *xdrs, entry4 *objp)
1967 entry4 *tmp_entry4;
1968 bool_t more_data = TRUE;
1969 bool_t first_objp = TRUE;
1971 while (more_data) {
1973 if (!xdr_nfs_cookie4(xdrs, &objp->cookie))
1974 return (FALSE);
1975 if (!xdr_component4(xdrs, &objp->name))
1976 return (FALSE);
1977 if (!xdr_fattr4(xdrs, &objp->attrs))
1978 return (FALSE);
1980 if (xdrs->x_op == XDR_DECODE) {
1982 void bzero();
1984 if (!xdr_bool(xdrs, &more_data))
1985 return (FALSE);
1987 if (!more_data) {
1988 objp->nextentry = NULL;
1989 break;
1992 objp->nextentry = (entry4 *)mem_alloc(sizeof (entry4));
1993 if (objp->nextentry == NULL)
1994 return (B_FALSE);
1995 bzero(objp->nextentry, sizeof (entry4));
1996 objp = objp->nextentry;
1998 } else if (xdrs->x_op == XDR_ENCODE) {
1999 objp = objp->nextentry;
2000 if (!objp)
2001 more_data = FALSE;
2003 if (!xdr_bool(xdrs, &more_data))
2004 return (FALSE);
2005 } else {
2006 tmp_entry4 = objp;
2007 objp = objp->nextentry;
2008 if (!objp)
2009 more_data = FALSE;
2010 if (!xdr_bool(xdrs, &more_data))
2011 return (FALSE);
2012 if (!first_objp)
2013 mem_free(tmp_entry4, sizeof (entry4));
2014 else
2015 first_objp = FALSE;
2018 return (TRUE);
2021 bool_t
2022 xdr_dirlist4(register XDR *xdrs, dirlist4 *objp)
2025 if (!xdr_pointer(xdrs, (char **)&objp->entries, sizeof (entry4),
2026 (xdrproc_t)xdr_entry4))
2027 return (FALSE);
2028 if (!xdr_bool(xdrs, &objp->eof))
2029 return (FALSE);
2030 return (TRUE);
2033 bool_t
2034 xdr_READDIR4resok(register XDR *xdrs, READDIR4resok *objp)
2037 if (!xdr_verifier4(xdrs, objp->cookieverf))
2038 return (FALSE);
2039 if (!xdr_dirlist4(xdrs, &objp->reply))
2040 return (FALSE);
2041 return (TRUE);
2044 bool_t
2045 xdr_READDIR4res(register XDR *xdrs, READDIR4res *objp)
2048 if (!xdr_nfsstat4(xdrs, &objp->status))
2049 return (FALSE);
2050 switch (objp->status) {
2051 case NFS4_OK:
2052 if (!xdr_READDIR4resok(xdrs, &objp->READDIR4res_u.resok4))
2053 return (FALSE);
2054 break;
2056 return (TRUE);
2059 bool_t
2060 xdr_READLINK4resok(register XDR *xdrs, READLINK4resok *objp)
2063 if (!xdr_linktext4(xdrs, &objp->link))
2064 return (FALSE);
2065 return (TRUE);
2068 bool_t
2069 xdr_READLINK4res(register XDR *xdrs, READLINK4res *objp)
2072 if (!xdr_nfsstat4(xdrs, &objp->status))
2073 return (FALSE);
2074 switch (objp->status) {
2075 case NFS4_OK:
2076 if (!xdr_READLINK4resok(xdrs, &objp->READLINK4res_u.resok4))
2077 return (FALSE);
2078 break;
2080 return (TRUE);
2083 bool_t
2084 xdr_REMOVE4args(register XDR *xdrs, REMOVE4args *objp)
2087 if (!xdr_component4(xdrs, &objp->target))
2088 return (FALSE);
2089 return (TRUE);
2092 bool_t
2093 xdr_REMOVE4resok(register XDR *xdrs, REMOVE4resok *objp)
2096 if (!xdr_change_info4(xdrs, &objp->cinfo))
2097 return (FALSE);
2098 return (TRUE);
2101 bool_t
2102 xdr_REMOVE4res(register XDR *xdrs, REMOVE4res *objp)
2105 if (!xdr_nfsstat4(xdrs, &objp->status))
2106 return (FALSE);
2107 switch (objp->status) {
2108 case NFS4_OK:
2109 if (!xdr_REMOVE4resok(xdrs, &objp->REMOVE4res_u.resok4))
2110 return (FALSE);
2111 break;
2113 return (TRUE);
2116 bool_t
2117 xdr_RENAME4args(register XDR *xdrs, RENAME4args *objp)
2120 if (!xdr_component4(xdrs, &objp->oldname))
2121 return (FALSE);
2122 if (!xdr_component4(xdrs, &objp->newname))
2123 return (FALSE);
2124 return (TRUE);
2127 bool_t
2128 xdr_RENAME4resok(register XDR *xdrs, RENAME4resok *objp)
2131 if (!xdr_change_info4(xdrs, &objp->source_cinfo))
2132 return (FALSE);
2133 if (!xdr_change_info4(xdrs, &objp->target_cinfo))
2134 return (FALSE);
2135 return (TRUE);
2138 bool_t
2139 xdr_RENAME4res(register XDR *xdrs, RENAME4res *objp)
2142 if (!xdr_nfsstat4(xdrs, &objp->status))
2143 return (FALSE);
2144 switch (objp->status) {
2145 case NFS4_OK:
2146 if (!xdr_RENAME4resok(xdrs, &objp->RENAME4res_u.resok4))
2147 return (FALSE);
2148 break;
2150 return (TRUE);
2153 bool_t
2154 xdr_RENEW4args(register XDR *xdrs, RENEW4args *objp)
2157 if (!xdr_clientid4(xdrs, &objp->clientid))
2158 return (FALSE);
2159 return (TRUE);
2162 bool_t
2163 xdr_RENEW4res(register XDR *xdrs, RENEW4res *objp)
2166 if (!xdr_nfsstat4(xdrs, &objp->status))
2167 return (FALSE);
2168 return (TRUE);
2171 bool_t
2172 xdr_RESTOREFH4res(register XDR *xdrs, RESTOREFH4res *objp)
2175 if (!xdr_nfsstat4(xdrs, &objp->status))
2176 return (FALSE);
2177 return (TRUE);
2180 bool_t
2181 xdr_SAVEFH4res(register XDR *xdrs, SAVEFH4res *objp)
2184 if (!xdr_nfsstat4(xdrs, &objp->status))
2185 return (FALSE);
2186 return (TRUE);
2189 bool_t
2190 xdr_SECINFO4args(register XDR *xdrs, SECINFO4args *objp)
2193 if (!xdr_component4(xdrs, &objp->name))
2194 return (FALSE);
2195 return (TRUE);
2198 bool_t
2199 xdr_rpc_gss_svc_t(register XDR *xdrs, rpc_gss_svc_t *objp)
2202 if (!xdr_enum(xdrs, (enum_t *)objp))
2203 return (FALSE);
2204 return (TRUE);
2207 bool_t
2208 xdr_rpcsec_gss_info(register XDR *xdrs, rpcsec_gss_info *objp)
2211 if (!xdr_sec_oid4(xdrs, &objp->oid))
2212 return (FALSE);
2213 if (!xdr_qop4(xdrs, &objp->qop))
2214 return (FALSE);
2215 if (!xdr_rpc_gss_svc_t(xdrs, &objp->service))
2216 return (FALSE);
2217 return (TRUE);
2220 bool_t
2221 xdr_secinfo4(register XDR *xdrs, secinfo4 *objp)
2224 if (!xdr_uint32_t(xdrs, &objp->flavor))
2225 return (FALSE);
2226 switch (objp->flavor) {
2227 case RPCSEC_GSS:
2228 if (!xdr_rpcsec_gss_info(xdrs, &objp->secinfo4_u.flavor_info))
2229 return (FALSE);
2230 break;
2232 return (TRUE);
2235 bool_t
2236 xdr_SECINFO4resok(register XDR *xdrs, SECINFO4resok *objp)
2239 if (!xdr_array(xdrs, (char **)&objp->SECINFO4resok_val,
2240 (uint_t *)&objp->SECINFO4resok_len, ~0,
2241 sizeof (secinfo4), (xdrproc_t)xdr_secinfo4))
2242 return (FALSE);
2243 return (TRUE);
2246 bool_t
2247 xdr_SECINFO4res(register XDR *xdrs, SECINFO4res *objp)
2250 if (!xdr_nfsstat4(xdrs, &objp->status))
2251 return (FALSE);
2252 switch (objp->status) {
2253 case NFS4_OK:
2254 if (!xdr_SECINFO4resok(xdrs, &objp->SECINFO4res_u.resok4))
2255 return (FALSE);
2256 break;
2258 return (TRUE);
2261 bool_t
2262 xdr_SETATTR4args(register XDR *xdrs, SETATTR4args *objp)
2265 if (!xdr_stateid4(xdrs, &objp->stateid))
2266 return (FALSE);
2267 if (!xdr_fattr4(xdrs, &objp->obj_attributes))
2268 return (FALSE);
2269 return (TRUE);
2272 bool_t
2273 xdr_SETATTR4res(register XDR *xdrs, SETATTR4res *objp)
2276 if (!xdr_nfsstat4(xdrs, &objp->status))
2277 return (FALSE);
2278 if (!xdr_bitmap4(xdrs, &objp->attrsset))
2279 return (FALSE);
2280 return (TRUE);
2283 bool_t
2284 xdr_SETCLIENTID4args(register XDR *xdrs, SETCLIENTID4args *objp)
2287 if (!xdr_nfs_client_id4(xdrs, &objp->client))
2288 return (FALSE);
2289 if (!xdr_cb_client4(xdrs, &objp->callback))
2290 return (FALSE);
2291 if (!xdr_uint32_t(xdrs, &objp->callback_ident))
2292 return (FALSE);
2293 return (TRUE);
2296 bool_t
2297 xdr_SETCLIENTID4resok(register XDR *xdrs, SETCLIENTID4resok *objp)
2300 if (!xdr_clientid4(xdrs, &objp->clientid))
2301 return (FALSE);
2302 if (!xdr_verifier4(xdrs, objp->setclientid_confirm))
2303 return (FALSE);
2304 return (TRUE);
2307 bool_t
2308 xdr_SETCLIENTID4res(register XDR *xdrs, SETCLIENTID4res *objp)
2311 if (!xdr_nfsstat4(xdrs, &objp->status))
2312 return (FALSE);
2313 switch (objp->status) {
2314 case NFS4_OK:
2315 if (!xdr_SETCLIENTID4resok(xdrs, &objp->SETCLIENTID4res_u.
2316 resok4))
2317 return (FALSE);
2318 break;
2319 case NFS4ERR_CLID_INUSE:
2320 if (!xdr_clientaddr4(xdrs, &objp->SETCLIENTID4res_u.
2321 client_using))
2322 return (FALSE);
2323 break;
2325 return (TRUE);
2328 bool_t
2329 xdr_SETCLIENTID_CONFIRM4args(register XDR *xdrs, SETCLIENTID_CONFIRM4args *objp)
2332 if (!xdr_clientid4(xdrs, &objp->clientid))
2333 return (FALSE);
2334 if (!xdr_verifier4(xdrs, objp->setclientid_confirm))
2335 return (FALSE);
2336 return (TRUE);
2339 bool_t
2340 xdr_SETCLIENTID_CONFIRM4res(register XDR *xdrs, SETCLIENTID_CONFIRM4res *objp)
2343 if (!xdr_nfsstat4(xdrs, &objp->status))
2344 return (FALSE);
2345 return (TRUE);
2348 bool_t
2349 xdr_VERIFY4args(register XDR *xdrs, VERIFY4args *objp)
2352 if (!xdr_fattr4(xdrs, &objp->obj_attributes))
2353 return (FALSE);
2354 return (TRUE);
2357 bool_t
2358 xdr_VERIFY4res(register XDR *xdrs, VERIFY4res *objp)
2361 if (!xdr_nfsstat4(xdrs, &objp->status))
2362 return (FALSE);
2363 return (TRUE);
2366 bool_t
2367 xdr_stable_how4(register XDR *xdrs, stable_how4 *objp)
2370 if (!xdr_enum(xdrs, (enum_t *)objp))
2371 return (FALSE);
2372 return (TRUE);
2375 bool_t
2376 xdr_WRITE4args(register XDR *xdrs, WRITE4args *objp)
2379 if (!xdr_stateid4(xdrs, &objp->stateid))
2380 return (FALSE);
2381 if (!xdr_offset4(xdrs, &objp->offset))
2382 return (FALSE);
2383 if (!xdr_stable_how4(xdrs, &objp->stable))
2384 return (FALSE);
2386 #ifdef IGNORE_RDWR_DATA
2388 * try to get length of write, and if that
2389 * fails, default to 0. Don't return FALSE
2390 * because the other write info will not be
2391 * displayed (write stateid).
2393 objp->data.data_val = NULL;
2394 if (!xdr_u_int(xdrs, &objp->data.data_len))
2395 objp->data.data_len = 0;
2396 nfs4_skip_bytes = objp->data.data_len;
2397 #else
2398 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val,
2399 (uint_t *)&objp->data.data_len, ~0))
2400 return (FALSE);
2401 #endif
2402 return (TRUE);
2405 bool_t
2406 xdr_WRITE4resok(register XDR *xdrs, WRITE4resok *objp)
2409 if (!xdr_count4(xdrs, &objp->count))
2410 return (FALSE);
2411 if (!xdr_stable_how4(xdrs, &objp->committed))
2412 return (FALSE);
2413 if (!xdr_verifier4(xdrs, objp->writeverf))
2414 return (FALSE);
2415 return (TRUE);
2418 bool_t
2419 xdr_WRITE4res(register XDR *xdrs, WRITE4res *objp)
2422 if (!xdr_nfsstat4(xdrs, &objp->status))
2423 return (FALSE);
2424 switch (objp->status) {
2425 case NFS4_OK:
2426 if (!xdr_WRITE4resok(xdrs, &objp->WRITE4res_u.resok4))
2427 return (FALSE);
2428 break;
2430 return (TRUE);
2433 bool_t
2434 xdr_RELEASE_LOCKOWNER4args(register XDR *xdrs, RELEASE_LOCKOWNER4args *objp)
2437 if (!xdr_lock_owner4(xdrs, &objp->lock_owner))
2438 return (FALSE);
2439 return (TRUE);
2442 bool_t
2443 xdr_RELEASE_LOCKOWNER4res(register XDR *xdrs, RELEASE_LOCKOWNER4res *objp)
2446 if (!xdr_nfsstat4(xdrs, &objp->status))
2447 return (FALSE);
2448 return (TRUE);
2451 bool_t
2452 xdr_ILLEGAL4res(register XDR *xdrs, ILLEGAL4res *objp)
2455 if (!xdr_nfsstat4(xdrs, &objp->status))
2456 return (FALSE);
2457 return (TRUE);
2460 bool_t
2461 xdr_nfs_opnum4(register XDR *xdrs, nfs_opnum4 *objp)
2464 if (!xdr_enum(xdrs, (enum_t *)objp))
2465 return (FALSE);
2466 return (TRUE);
2469 bool_t
2470 xdr_nfs_argop4(register XDR *xdrs, nfs_argop4 *objp)
2472 nfs4_skip_bytes = 0;
2473 if (!xdr_nfs_opnum4(xdrs, &objp->argop))
2474 return (FALSE);
2475 switch (objp->argop) {
2476 case OP_ACCESS:
2477 if (!xdr_ACCESS4args(xdrs, &objp->nfs_argop4_u.opaccess))
2478 return (FALSE);
2479 break;
2480 case OP_CLOSE:
2481 if (!xdr_CLOSE4args(xdrs, &objp->nfs_argop4_u.opclose))
2482 return (FALSE);
2483 break;
2484 case OP_COMMIT:
2485 if (!xdr_COMMIT4args(xdrs, &objp->nfs_argop4_u.opcommit))
2486 return (FALSE);
2487 break;
2488 case OP_CREATE:
2489 if (!xdr_CREATE4args(xdrs, &objp->nfs_argop4_u.opcreate))
2490 return (FALSE);
2491 break;
2492 case OP_DELEGPURGE:
2493 if (!xdr_DELEGPURGE4args(xdrs, &objp->nfs_argop4_u.
2494 opdelegpurge))
2495 return (FALSE);
2496 break;
2497 case OP_DELEGRETURN:
2498 if (!xdr_DELEGRETURN4args(xdrs, &objp->nfs_argop4_u.
2499 opdelegreturn))
2500 return (FALSE);
2501 break;
2502 case OP_GETATTR:
2503 if (!xdr_GETATTR4args(xdrs, &objp->nfs_argop4_u.
2504 opgetattr))
2505 return (FALSE);
2506 break;
2507 case OP_GETFH:
2508 break;
2509 case OP_LINK:
2510 if (!xdr_LINK4args(xdrs, &objp->nfs_argop4_u.oplink))
2511 return (FALSE);
2512 break;
2513 case OP_LOCK:
2514 if (!xdr_LOCK4args(xdrs, &objp->nfs_argop4_u.oplock))
2515 return (FALSE);
2516 break;
2517 case OP_LOCKT:
2518 if (!xdr_LOCKT4args(xdrs, &objp->nfs_argop4_u.oplockt))
2519 return (FALSE);
2520 break;
2521 case OP_LOCKU:
2522 if (!xdr_LOCKU4args(xdrs, &objp->nfs_argop4_u.oplocku))
2523 return (FALSE);
2524 break;
2525 case OP_LOOKUP:
2526 if (!xdr_LOOKUP4args(xdrs, &objp->nfs_argop4_u.oplookup))
2527 return (FALSE);
2528 break;
2529 case OP_LOOKUPP:
2530 break;
2531 case OP_NVERIFY:
2532 if (!xdr_NVERIFY4args(xdrs, &objp->nfs_argop4_u.opnverify))
2533 return (FALSE);
2534 break;
2535 case OP_OPEN:
2536 if (!xdr_OPEN4args(xdrs, &objp->nfs_argop4_u.opopen))
2537 return (FALSE);
2538 break;
2539 case OP_OPENATTR:
2540 if (!xdr_OPENATTR4args(xdrs, &objp->nfs_argop4_u.opopenattr))
2541 return (FALSE);
2542 break;
2543 case OP_OPEN_CONFIRM:
2544 if (!xdr_OPEN_CONFIRM4args(xdrs, &objp->nfs_argop4_u.
2545 opopen_confirm))
2546 return (FALSE);
2547 break;
2548 case OP_OPEN_DOWNGRADE:
2549 if (!xdr_OPEN_DOWNGRADE4args(xdrs, &objp->nfs_argop4_u.
2550 opopen_downgrade))
2551 return (FALSE);
2552 break;
2553 case OP_PUTFH:
2554 if (!xdr_PUTFH4args(xdrs, &objp->nfs_argop4_u.opputfh))
2555 return (FALSE);
2556 break;
2557 case OP_PUTPUBFH:
2558 break;
2559 case OP_PUTROOTFH:
2560 break;
2561 case OP_READ:
2562 if (!xdr_READ4args(xdrs, &objp->nfs_argop4_u.opread))
2563 return (FALSE);
2564 break;
2565 case OP_READDIR:
2566 if (!xdr_READDIR4args(xdrs, &objp->nfs_argop4_u.opreaddir))
2567 return (FALSE);
2568 break;
2569 case OP_READLINK:
2570 break;
2571 case OP_REMOVE:
2572 if (!xdr_REMOVE4args(xdrs, &objp->nfs_argop4_u.opremove))
2573 return (FALSE);
2574 break;
2575 case OP_RENAME:
2576 if (!xdr_RENAME4args(xdrs, &objp->nfs_argop4_u.oprename))
2577 return (FALSE);
2578 break;
2579 case OP_RENEW:
2580 if (!xdr_RENEW4args(xdrs, &objp->nfs_argop4_u.oprenew))
2581 return (FALSE);
2582 break;
2583 case OP_RESTOREFH:
2584 break;
2585 case OP_SAVEFH:
2586 break;
2587 case OP_SECINFO:
2588 if (!xdr_SECINFO4args(xdrs, &objp->nfs_argop4_u.opsecinfo))
2589 return (FALSE);
2590 break;
2591 case OP_SETATTR:
2592 if (!xdr_SETATTR4args(xdrs, &objp->nfs_argop4_u.opsetattr))
2593 return (FALSE);
2594 break;
2595 case OP_SETCLIENTID:
2596 if (!xdr_SETCLIENTID4args(xdrs, &objp->nfs_argop4_u.
2597 opsetclientid))
2598 return (FALSE);
2599 break;
2600 case OP_SETCLIENTID_CONFIRM:
2601 if (!xdr_SETCLIENTID_CONFIRM4args(xdrs, &objp->nfs_argop4_u.
2602 opsetclientid_confirm))
2603 return (FALSE);
2604 break;
2605 case OP_VERIFY:
2606 if (!xdr_VERIFY4args(xdrs, &objp->nfs_argop4_u.opverify))
2607 return (FALSE);
2608 break;
2609 case OP_WRITE:
2610 if (!xdr_WRITE4args(xdrs, &objp->nfs_argop4_u.opwrite))
2611 return (FALSE);
2612 break;
2613 case OP_RELEASE_LOCKOWNER:
2614 if (!xdr_RELEASE_LOCKOWNER4args(xdrs,
2615 &objp->nfs_argop4_u.oprelease_lockowner))
2616 return (FALSE);
2617 break;
2618 case OP_ILLEGAL:
2619 break;
2620 default:
2621 return (FALSE);
2623 return (TRUE);
2626 bool_t
2627 xdr_nfs_resop4(register XDR *xdrs, nfs_resop4 *objp)
2629 nfs4_skip_bytes = 0;
2630 if (!xdr_nfs_opnum4(xdrs, &objp->resop))
2631 return (FALSE);
2632 switch (objp->resop) {
2633 case OP_ACCESS:
2634 if (!xdr_ACCESS4res(xdrs, &objp->nfs_resop4_u.opaccess))
2635 return (FALSE);
2636 break;
2637 case OP_CLOSE:
2638 if (!xdr_CLOSE4res(xdrs, &objp->nfs_resop4_u.opclose))
2639 return (FALSE);
2640 break;
2641 case OP_COMMIT:
2642 if (!xdr_COMMIT4res(xdrs, &objp->nfs_resop4_u.opcommit))
2643 return (FALSE);
2644 break;
2645 case OP_CREATE:
2646 if (!xdr_CREATE4res(xdrs, &objp->nfs_resop4_u.opcreate))
2647 return (FALSE);
2648 break;
2649 case OP_DELEGPURGE:
2650 if (!xdr_DELEGPURGE4res(xdrs, &objp->nfs_resop4_u.opdelegpurge))
2651 return (FALSE);
2652 break;
2653 case OP_DELEGRETURN:
2654 if (!xdr_DELEGRETURN4res(xdrs, &objp->nfs_resop4_u.
2655 opdelegreturn))
2656 return (FALSE);
2657 break;
2658 case OP_GETATTR:
2659 if (!xdr_GETATTR4res(xdrs, &objp->nfs_resop4_u.opgetattr))
2660 return (FALSE);
2661 break;
2662 case OP_GETFH:
2663 if (!xdr_GETFH4res(xdrs, &objp->nfs_resop4_u.opgetfh))
2664 return (FALSE);
2665 break;
2666 case OP_LINK:
2667 if (!xdr_LINK4res(xdrs, &objp->nfs_resop4_u.oplink))
2668 return (FALSE);
2669 break;
2670 case OP_LOCK:
2671 if (!xdr_LOCK4res(xdrs, &objp->nfs_resop4_u.oplock))
2672 return (FALSE);
2673 break;
2674 case OP_LOCKT:
2675 if (!xdr_LOCKT4res(xdrs, &objp->nfs_resop4_u.oplockt))
2676 return (FALSE);
2677 break;
2678 case OP_LOCKU:
2679 if (!xdr_LOCKU4res(xdrs, &objp->nfs_resop4_u.oplocku))
2680 return (FALSE);
2681 break;
2682 case OP_LOOKUP:
2683 if (!xdr_LOOKUP4res(xdrs, &objp->nfs_resop4_u.oplookup))
2684 return (FALSE);
2685 break;
2686 case OP_LOOKUPP:
2687 if (!xdr_LOOKUPP4res(xdrs, &objp->nfs_resop4_u.oplookupp))
2688 return (FALSE);
2689 break;
2690 case OP_NVERIFY:
2691 if (!xdr_NVERIFY4res(xdrs, &objp->nfs_resop4_u.opnverify))
2692 return (FALSE);
2693 break;
2694 case OP_OPEN:
2695 if (!xdr_OPEN4res(xdrs, &objp->nfs_resop4_u.opopen))
2696 return (FALSE);
2697 break;
2698 case OP_OPENATTR:
2699 if (!xdr_OPENATTR4res(xdrs, &objp->nfs_resop4_u.opopenattr))
2700 return (FALSE);
2701 break;
2702 case OP_OPEN_CONFIRM:
2703 if (!xdr_OPEN_CONFIRM4res(xdrs, &objp->nfs_resop4_u.
2704 opopen_confirm))
2705 return (FALSE);
2706 break;
2707 case OP_OPEN_DOWNGRADE:
2708 if (!xdr_OPEN_DOWNGRADE4res(xdrs, &objp->nfs_resop4_u.
2709 opopen_downgrade))
2710 return (FALSE);
2711 break;
2712 case OP_PUTFH:
2713 if (!xdr_PUTFH4res(xdrs, &objp->nfs_resop4_u.opputfh))
2714 return (FALSE);
2715 break;
2716 case OP_PUTPUBFH:
2717 if (!xdr_PUTPUBFH4res(xdrs, &objp->nfs_resop4_u.opputpubfh))
2718 return (FALSE);
2719 break;
2720 case OP_PUTROOTFH:
2721 if (!xdr_PUTROOTFH4res(xdrs, &objp->nfs_resop4_u.opputrootfh))
2722 return (FALSE);
2723 break;
2724 case OP_READ:
2725 if (!xdr_READ4res(xdrs, &objp->nfs_resop4_u.opread))
2726 return (FALSE);
2727 break;
2728 case OP_READDIR:
2729 if (!xdr_READDIR4res(xdrs, &objp->nfs_resop4_u.opreaddir))
2730 return (FALSE);
2731 break;
2732 case OP_READLINK:
2733 if (!xdr_READLINK4res(xdrs, &objp->nfs_resop4_u.opreadlink))
2734 return (FALSE);
2735 break;
2736 case OP_REMOVE:
2737 if (!xdr_REMOVE4res(xdrs, &objp->nfs_resop4_u.opremove))
2738 return (FALSE);
2739 break;
2740 case OP_RENAME:
2741 if (!xdr_RENAME4res(xdrs, &objp->nfs_resop4_u.oprename))
2742 return (FALSE);
2743 break;
2744 case OP_RENEW:
2745 if (!xdr_RENEW4res(xdrs, &objp->nfs_resop4_u.oprenew))
2746 return (FALSE);
2747 break;
2748 case OP_RESTOREFH:
2749 if (!xdr_RESTOREFH4res(xdrs, &objp->nfs_resop4_u.oprestorefh))
2750 return (FALSE);
2751 break;
2752 case OP_SAVEFH:
2753 if (!xdr_SAVEFH4res(xdrs, &objp->nfs_resop4_u.opsavefh))
2754 return (FALSE);
2755 break;
2756 case OP_SECINFO:
2757 if (!xdr_SECINFO4res(xdrs, &objp->nfs_resop4_u.opsecinfo))
2758 return (FALSE);
2759 break;
2760 case OP_SETATTR:
2761 if (!xdr_SETATTR4res(xdrs, &objp->nfs_resop4_u.opsetattr))
2762 return (FALSE);
2763 break;
2764 case OP_SETCLIENTID:
2765 if (!xdr_SETCLIENTID4res(xdrs, &objp->nfs_resop4_u.
2766 opsetclientid))
2767 return (FALSE);
2768 break;
2769 case OP_SETCLIENTID_CONFIRM:
2770 if (!xdr_SETCLIENTID_CONFIRM4res(xdrs, &objp->nfs_resop4_u.
2771 opsetclientid_confirm))
2772 return (FALSE);
2773 break;
2774 case OP_VERIFY:
2775 if (!xdr_VERIFY4res(xdrs, &objp->nfs_resop4_u.opverify))
2776 return (FALSE);
2777 break;
2778 case OP_WRITE:
2779 if (!xdr_WRITE4res(xdrs, &objp->nfs_resop4_u.opwrite))
2780 return (FALSE);
2781 break;
2782 case OP_RELEASE_LOCKOWNER:
2783 if (!xdr_RELEASE_LOCKOWNER4res(xdrs,
2784 &objp->nfs_resop4_u.oprelease_lockowner))
2785 return (FALSE);
2786 break;
2787 case OP_ILLEGAL:
2788 if (!xdr_ILLEGAL4res(xdrs, &objp->nfs_resop4_u.opillegal))
2789 return (FALSE);
2790 break;
2791 default:
2792 return (FALSE);
2794 return (TRUE);
2797 bool_t
2798 xdr_COMPOUND4args(register XDR *xdrs, COMPOUND4args *objp)
2801 if (!xdr_utf8string(xdrs, &objp->tag))
2802 return (FALSE);
2803 if (!xdr_uint32_t(xdrs, &objp->minorversion))
2804 return (FALSE);
2805 if (!xdr_array(xdrs, (char **)&objp->argarray.argarray_val,
2806 (uint_t *)&objp->argarray.argarray_len, ~0,
2807 sizeof (nfs_argop4), (xdrproc_t)xdr_nfs_argop4))
2808 return (FALSE);
2809 return (TRUE);
2812 bool_t
2813 xdr_COMPOUND4res(register XDR *xdrs, COMPOUND4res *objp)
2816 if (!xdr_nfsstat4(xdrs, &objp->status))
2817 return (FALSE);
2818 if (!xdr_utf8string(xdrs, &objp->tag))
2819 return (FALSE);
2820 if (!xdr_array(xdrs, (char **)&objp->resarray.resarray_val,
2821 (uint_t *)&objp->resarray.resarray_len, ~0,
2822 sizeof (nfs_resop4), (xdrproc_t)xdr_nfs_resop4))
2823 return (FALSE);
2824 return (TRUE);
2827 bool_t
2828 xdr_CB_GETATTR4args(register XDR *xdrs, CB_GETATTR4args *objp)
2831 if (!xdr_nfs_fh4(xdrs, &objp->fh))
2832 return (FALSE);
2833 if (!xdr_bitmap4(xdrs, &objp->attr_request))
2834 return (FALSE);
2835 return (TRUE);
2838 bool_t
2839 xdr_CB_GETATTR4resok(register XDR *xdrs, CB_GETATTR4resok *objp)
2842 if (!xdr_fattr4(xdrs, &objp->obj_attributes))
2843 return (FALSE);
2844 return (TRUE);
2847 bool_t
2848 xdr_CB_GETATTR4res(register XDR *xdrs, CB_GETATTR4res *objp)
2851 if (!xdr_nfsstat4(xdrs, &objp->status))
2852 return (FALSE);
2853 switch (objp->status) {
2854 case NFS4_OK:
2855 if (!xdr_CB_GETATTR4resok(xdrs, &objp->CB_GETATTR4res_u.resok4))
2856 return (FALSE);
2857 break;
2859 return (TRUE);
2862 bool_t
2863 xdr_CB_RECALL4args(register XDR *xdrs, CB_RECALL4args *objp)
2866 if (!xdr_stateid4(xdrs, &objp->stateid))
2867 return (FALSE);
2868 if (!xdr_bool(xdrs, &objp->truncate))
2869 return (FALSE);
2870 if (!xdr_nfs_fh4(xdrs, &objp->fh))
2871 return (FALSE);
2872 return (TRUE);
2875 bool_t
2876 xdr_CB_RECALL4res(register XDR *xdrs, CB_RECALL4res *objp)
2879 if (!xdr_nfsstat4(xdrs, &objp->status))
2880 return (FALSE);
2881 return (TRUE);
2884 bool_t
2885 xdr_CB_ILLEGAL4res(register XDR *xdrs, CB_ILLEGAL4res *objp)
2888 if (!xdr_nfsstat4(xdrs, &objp->status))
2889 return (FALSE);
2890 return (TRUE);
2893 bool_t
2894 xdr_nfs_cb_opnum4(register XDR *xdrs, nfs_cb_opnum4 *objp)
2897 if (!xdr_enum(xdrs, (enum_t *)objp))
2898 return (FALSE);
2899 return (TRUE);
2902 bool_t
2903 xdr_nfs_cb_argop4(register XDR *xdrs, nfs_cb_argop4 *objp)
2906 if (!xdr_u_int(xdrs, &objp->argop))
2907 return (FALSE);
2908 switch (objp->argop) {
2909 case OP_CB_GETATTR:
2910 if (!xdr_CB_GETATTR4args(xdrs, &objp->nfs_cb_argop4_u.
2911 opcbgetattr))
2912 return (FALSE);
2913 break;
2914 case OP_CB_RECALL:
2915 if (!xdr_CB_RECALL4args(xdrs, &objp->nfs_cb_argop4_u.
2916 opcbrecall))
2917 return (FALSE);
2918 break;
2919 case OP_CB_ILLEGAL:
2920 break;
2921 default:
2922 return (FALSE);
2924 return (TRUE);
2927 bool_t
2928 xdr_nfs_cb_resop4(register XDR *xdrs, nfs_cb_resop4 *objp)
2931 if (!xdr_u_int(xdrs, &objp->resop))
2932 return (FALSE);
2933 switch (objp->resop) {
2934 case OP_CB_GETATTR:
2935 if (!xdr_CB_GETATTR4res(xdrs, &objp->nfs_cb_resop4_u.
2936 opcbgetattr))
2937 return (FALSE);
2938 break;
2939 case OP_CB_RECALL:
2940 if (!xdr_CB_RECALL4res(xdrs, &objp->nfs_cb_resop4_u.opcbrecall))
2941 return (FALSE);
2942 break;
2943 case OP_CB_ILLEGAL:
2944 if (!xdr_CB_ILLEGAL4res(xdrs,
2945 &objp->nfs_cb_resop4_u.opcbillegal))
2946 return (FALSE);
2947 break;
2948 default:
2949 return (FALSE);
2951 return (TRUE);
2954 bool_t
2955 xdr_CB_COMPOUND4args(register XDR *xdrs, CB_COMPOUND4args *objp)
2958 if (!xdr_utf8string(xdrs, &objp->tag))
2959 return (FALSE);
2960 if (!xdr_uint32_t(xdrs, &objp->minorversion))
2961 return (FALSE);
2962 if (!xdr_uint32_t(xdrs, &objp->callback_ident))
2963 return (FALSE);
2964 if (!xdr_array(xdrs, (char **)&objp->argarray.argarray_val,
2965 (uint_t *)&objp->argarray.argarray_len, ~0,
2966 sizeof (nfs_cb_argop4), (xdrproc_t)xdr_nfs_cb_argop4))
2967 return (FALSE);
2968 return (TRUE);
2971 bool_t
2972 xdr_CB_COMPOUND4res(register XDR *xdrs, CB_COMPOUND4res *objp)
2975 if (!xdr_nfsstat4(xdrs, &objp->status))
2976 return (FALSE);
2977 if (!xdr_utf8string(xdrs, &objp->tag))
2978 return (FALSE);
2979 if (!xdr_array(xdrs, (char **)&objp->resarray.resarray_val,
2980 (uint_t *)&objp->resarray.resarray_len, ~0,
2981 sizeof (nfs_cb_resop4), (xdrproc_t)xdr_nfs_cb_resop4))
2982 return (FALSE);
2983 return (TRUE);