4 * Copyright (c) 1997-2009 Erez Zadok
5 * Copyright (c) 1990 Jan-Simon Pendry
6 * Copyright (c) 1990 Imperial College of Science, Technology & Medicine
7 * Copyright (c) 1990 The Regents of the University of California.
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
16 * 1. Redistributions of source code must retain the above copyright
17 * notice, this list of conditions and the following disclaimer.
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the distribution.
21 * 3. All advertising materials mentioning features or use of this software
22 * must display the following acknowledgment:
23 * This product includes software developed by the University of
24 * California, Berkeley and its contributors.
25 * 4. Neither the name of the University nor the names of its contributors
26 * may be used to endorse or promote products derived from this software
27 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
30 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * File: am-utils/libamu/xdr_func.c
47 * Complete list of all possible xdr functions which may be needed.
51 #endif /* HAVE_CONFIG_H */
55 #ifdef __RPCSVC_MOUNT_H__
56 # error IRIX6 should not include rpcsvc/mount.h
57 #endif /* __RPCSVC_MOUNT_H__ */
63 # ifndef AUTOFS_MAXCOMPONENTLEN
64 # define AUTOFS_MAXCOMPONENTLEN 255
65 # endif /* not AUTOFS_MAXCOMPONENTLEN */
66 # ifndef AUTOFS_MAXOPTSLEN
67 # define AUTOFS_MAXOPTSLEN 255
68 # endif /* not AUTOFS_MAXOPTSLEN */
69 # ifndef AUTOFS_MAXPATHLEN
70 # define AUTOFS_MAXPATHLEN 1024
71 # endif /* not AUTOFS_MAXPATHLEN */
72 #endif /* HAVE_FS_AUTOFS */
74 /* forward definitions, are they needed? */
75 extern bool_t
xdr_exportnode(XDR
*xdrs
, exportnode
*objp
);
76 extern bool_t
xdr_groupnode(XDR
*xdrs
, groupnode
*objp
);
77 extern bool_t
xdr_name(XDR
*xdrs
, name
*objp
);
80 #ifndef HAVE_XDR_ATTRSTAT
82 xdr_attrstat(XDR
*xdrs
, nfsattrstat
*objp
)
84 if (amuDebug(D_XDRTRACE
))
85 plog(XLOG_DEBUG
, "xdr_attrstat:");
87 if (!xdr_nfsstat(xdrs
, &objp
->ns_status
)) {
90 switch (objp
->ns_status
) {
92 if (!xdr_fattr(xdrs
, &objp
->ns_u
.ns_attr_u
)) {
101 #endif /* not HAVE_XDR_ATTRSTAT */
104 #ifndef HAVE_XDR_CREATEARGS
106 xdr_createargs(XDR
*xdrs
, nfscreateargs
*objp
)
108 if (amuDebug(D_XDRTRACE
))
109 plog(XLOG_DEBUG
, "xdr_createargs:");
111 if (!xdr_diropargs(xdrs
, &objp
->ca_where
)) {
114 if (!xdr_sattr(xdrs
, &objp
->ca_attributes
)) {
119 #endif /* not HAVE_XDR_CREATEARGS */
122 #ifndef HAVE_XDR_DIRLIST
124 xdr_dirlist(XDR
*xdrs
, nfsdirlist
*objp
)
126 if (amuDebug(D_XDRTRACE
))
127 plog(XLOG_DEBUG
, "xdr_dirlist:");
129 if (!xdr_pointer(xdrs
, (char **) &objp
->dl_entries
, sizeof(nfsentry
), (XDRPROC_T_TYPE
) xdr_entry
)) {
132 if (!xdr_bool(xdrs
, &objp
->dl_eof
)) {
137 #endif /* not HAVE_XDR_DIRLIST */
140 #ifndef HAVE_XDR_DIROPARGS
142 xdr_diropargs(XDR
*xdrs
, nfsdiropargs
*objp
)
144 if (amuDebug(D_XDRTRACE
))
145 plog(XLOG_DEBUG
, "xdr_diropargs:");
147 if (!xdr_nfs_fh(xdrs
, &objp
->da_fhandle
)) {
150 if (!xdr_filename(xdrs
, &objp
->da_name
)) {
155 #endif /* not HAVE_XDR_DIROPARGS */
158 #ifndef HAVE_XDR_DIROPOKRES
160 xdr_diropokres(XDR
*xdrs
, nfsdiropokres
*objp
)
162 if (amuDebug(D_XDRTRACE
))
163 plog(XLOG_DEBUG
, "xdr_diropokres:");
165 if (!xdr_nfs_fh(xdrs
, &objp
->drok_fhandle
)) {
168 if (!xdr_fattr(xdrs
, &objp
->drok_attributes
)) {
173 #endif /* not HAVE_XDR_DIROPOKRES */
176 #ifndef HAVE_XDR_DIROPRES
178 xdr_diropres(XDR
*xdrs
, nfsdiropres
*objp
)
180 if (amuDebug(D_XDRTRACE
))
181 plog(XLOG_DEBUG
, "xdr_diropres:");
183 if (!xdr_nfsstat(xdrs
, &objp
->dr_status
)) {
186 switch (objp
->dr_status
) {
188 if (!xdr_diropokres(xdrs
, &objp
->dr_u
.dr_drok_u
)) {
197 #endif /* not HAVE_XDR_DIROPRES */
200 #ifndef HAVE_XDR_DIRPATH
202 xdr_dirpath(XDR
*xdrs
, dirpath
*objp
)
204 if (amuDebug(D_XDRTRACE
))
205 plog(XLOG_DEBUG
, "xdr_dirpath:");
207 if (!xdr_string(xdrs
, objp
, MNTPATHLEN
)) {
212 #endif /* not HAVE_XDR_DIRPATH */
215 #ifndef HAVE_XDR_ENTRY
217 xdr_entry(XDR
*xdrs
, nfsentry
*objp
)
219 if (amuDebug(D_XDRTRACE
))
220 plog(XLOG_DEBUG
, "xdr_entry:");
222 if (!xdr_u_int(xdrs
, &objp
->ne_fileid
)) {
225 if (!xdr_filename(xdrs
, &objp
->ne_name
)) {
228 if (!xdr_nfscookie(xdrs
, objp
->ne_cookie
)) {
231 if (!xdr_pointer(xdrs
, (char **) &objp
->ne_nextentry
, sizeof(nfsentry
), (XDRPROC_T_TYPE
) xdr_entry
)) {
236 #endif /* not HAVE_XDR_ENTRY */
239 #ifndef HAVE_XDR_EXPORTNODE
241 xdr_exportnode(XDR
*xdrs
, exportnode
*objp
)
243 if (amuDebug(D_XDRTRACE
))
244 plog(XLOG_DEBUG
, "xdr_exportnode:");
246 if (!xdr_dirpath(xdrs
, &objp
->ex_dir
)) {
249 if (!xdr_groups(xdrs
, &objp
->ex_groups
)) {
252 if (!xdr_exports(xdrs
, &objp
->ex_next
)) {
257 #endif /* not HAVE_XDR_EXPORTNODE */
260 #ifndef HAVE_XDR_EXPORTS
262 xdr_exports(XDR
*xdrs
, exports
*objp
)
264 if (amuDebug(D_XDRTRACE
))
265 plog(XLOG_DEBUG
, "xdr_exports:");
267 if (!xdr_pointer(xdrs
, (char **) objp
, sizeof(exportnode
), (XDRPROC_T_TYPE
) xdr_exportnode
)) {
272 #endif /* not HAVE_XDR_EXPORTS */
275 #ifndef HAVE_XDR_FATTR
277 xdr_fattr(XDR
*xdrs
, nfsfattr
*objp
)
279 if (amuDebug(D_XDRTRACE
))
280 plog(XLOG_DEBUG
, "xdr_fattr:");
282 if (!xdr_ftype(xdrs
, &objp
->na_type
)) {
285 if (!xdr_u_int(xdrs
, &objp
->na_mode
)) {
288 if (!xdr_u_int(xdrs
, &objp
->na_nlink
)) {
291 if (!xdr_u_int(xdrs
, &objp
->na_uid
)) {
294 if (!xdr_u_int(xdrs
, &objp
->na_gid
)) {
297 if (!xdr_u_int(xdrs
, &objp
->na_size
)) {
300 if (!xdr_u_int(xdrs
, &objp
->na_blocksize
)) {
303 if (!xdr_u_int(xdrs
, &objp
->na_rdev
)) {
306 if (!xdr_u_int(xdrs
, &objp
->na_blocks
)) {
309 if (!xdr_u_int(xdrs
, &objp
->na_fsid
)) {
312 if (!xdr_u_int(xdrs
, &objp
->na_fileid
)) {
315 if (!xdr_nfstime(xdrs
, &objp
->na_atime
)) {
318 if (!xdr_nfstime(xdrs
, &objp
->na_mtime
)) {
321 if (!xdr_nfstime(xdrs
, &objp
->na_ctime
)) {
326 #endif /* not HAVE_XDR_FATTR */
329 #ifndef HAVE_XDR_FHANDLE
331 xdr_fhandle(XDR
*xdrs
, fhandle objp
)
333 if (amuDebug(D_XDRTRACE
))
334 plog(XLOG_DEBUG
, "xdr_fhandle:");
336 if (!xdr_opaque(xdrs
, objp
, NFS_FHSIZE
)) {
341 #endif /* not HAVE_XDR_FHANDLE */
344 #ifndef HAVE_XDR_FHSTATUS
346 xdr_fhstatus(XDR
*xdrs
, fhstatus
*objp
)
348 if (amuDebug(D_XDRTRACE
))
349 plog(XLOG_DEBUG
, "xdr_fhstatus:");
351 if (!xdr_u_int(xdrs
, &objp
->fhs_status
)) {
354 if (objp
->fhs_status
== 0 && !xdr_fhandle(xdrs
, objp
->fhs_fh
)) {
359 #endif /* not HAVE_XDR_FHSTATUS */
362 #ifndef HAVE_XDR_FILENAME
364 xdr_filename(XDR
*xdrs
, filename
*objp
)
366 if (amuDebug(D_XDRTRACE
))
367 plog(XLOG_DEBUG
, "xdr_filename:");
369 if (!xdr_string(xdrs
, objp
, NFS_MAXNAMLEN
)) {
374 #endif /* not HAVE_XDR_FILENAME */
377 #ifndef HAVE_XDR_FTYPE
379 xdr_ftype(XDR
*xdrs
, nfsftype
*objp
)
381 enum_t local_obj
= *objp
;
383 if (amuDebug(D_XDRTRACE
))
384 plog(XLOG_DEBUG
, "xdr_ftype:");
386 if (!xdr_enum(xdrs
, &local_obj
)) {
391 #endif /* not HAVE_XDR_FTYPE */
394 #ifndef HAVE_XDR_GROUPNODE
396 xdr_groupnode(XDR
*xdrs
, groupnode
*objp
)
398 if (amuDebug(D_XDRTRACE
))
399 plog(XLOG_DEBUG
, "xdr_groupnode:");
401 if (!xdr_name(xdrs
, &objp
->gr_name
)) {
404 if (!xdr_groups(xdrs
, &objp
->gr_next
)) {
409 #endif /* not HAVE_XDR_GROUPNODE */
412 #ifndef HAVE_XDR_GROUPS
414 xdr_groups(XDR
*xdrs
, groups
*objp
)
416 if (amuDebug(D_XDRTRACE
))
417 plog(XLOG_DEBUG
, "xdr_groups:");
419 if (!xdr_pointer(xdrs
, (char **) objp
, sizeof(groupnode
), (XDRPROC_T_TYPE
) xdr_groupnode
)) {
424 #endif /* not HAVE_XDR_GROUPS */
427 #ifndef HAVE_XDR_LINKARGS
429 xdr_linkargs(XDR
*xdrs
, nfslinkargs
*objp
)
431 if (amuDebug(D_XDRTRACE
))
432 plog(XLOG_DEBUG
, "xdr_linkargs:");
434 if (!xdr_nfs_fh(xdrs
, &objp
->la_fhandle
)) {
437 if (!xdr_diropargs(xdrs
, &objp
->la_to
)) {
442 #endif /* not HAVE_XDR_LINKARGS */
445 #ifndef HAVE_XDR_MOUNTBODY
447 xdr_mountbody(XDR
*xdrs
, mountbody
*objp
)
449 if (amuDebug(D_XDRTRACE
))
450 plog(XLOG_DEBUG
, "xdr_mountbody:");
452 if (!xdr_name(xdrs
, &objp
->ml_hostname
)) {
455 if (!xdr_dirpath(xdrs
, &objp
->ml_directory
)) {
458 if (!xdr_mountlist(xdrs
, &objp
->ml_next
)) {
463 #endif /* not HAVE_XDR_MOUNTBODY */
466 #ifndef HAVE_XDR_MOUNTLIST
468 xdr_mountlist(XDR
*xdrs
, mountlist
*objp
)
470 if (amuDebug(D_XDRTRACE
))
471 plog(XLOG_DEBUG
, "xdr_mountlist:");
473 if (!xdr_pointer(xdrs
, (char **) objp
, sizeof(mountbody
), (XDRPROC_T_TYPE
) xdr_mountbody
)) {
478 #endif /* not HAVE_XDR_MOUNTLIST */
481 #ifndef HAVE_XDR_NAME
483 xdr_name(XDR
*xdrs
, name
*objp
)
485 if (amuDebug(D_XDRTRACE
))
486 plog(XLOG_DEBUG
, "xdr_name:");
488 if (!xdr_string(xdrs
, objp
, MNTNAMLEN
)) {
493 #endif /* not HAVE_XDR_NAME */
496 #ifndef HAVE_XDR_NFS_FH
498 xdr_nfs_fh(XDR
*xdrs
, am_nfs_fh
*objp
)
500 if (amuDebug(D_XDRTRACE
))
501 plog(XLOG_DEBUG
, "xdr_nfs_fh:");
503 if (!xdr_opaque(xdrs
, (caddr_t
) objp
->fh_data
, NFS_FHSIZE
)) {
508 #endif /* not HAVE_XDR_NFS_FH */
511 #ifndef HAVE_XDR_NFSCOOKIE
513 xdr_nfscookie(XDR
*xdrs
, nfscookie objp
)
515 if (amuDebug(D_XDRTRACE
))
516 plog(XLOG_DEBUG
, "xdr_nfscookie:");
518 if (!xdr_opaque(xdrs
, objp
, NFS_COOKIESIZE
)) {
523 #endif /* not HAVE_XDR_NFSCOOKIE */
526 #ifndef HAVE_XDR_NFSPATH
528 xdr_nfspath(XDR
*xdrs
, nfspath
*objp
)
530 if (amuDebug(D_XDRTRACE
))
531 plog(XLOG_DEBUG
, "xdr_nfspath:");
533 if (!xdr_string(xdrs
, objp
, NFS_MAXPATHLEN
)) {
538 #endif /* not HAVE_XDR_NFSPATH */
541 #ifndef HAVE_XDR_NFSSTAT
543 xdr_nfsstat(XDR
*xdrs
, nfsstat
*objp
)
545 enum_t local_obj
= *objp
;
547 if (amuDebug(D_XDRTRACE
))
548 plog(XLOG_DEBUG
, "xdr_nfsstat:");
550 if (!xdr_enum(xdrs
, &local_obj
)) {
555 #endif /* not HAVE_XDR_NFSSTAT */
558 #ifndef HAVE_XDR_NFSTIME
560 xdr_nfstime(XDR
*xdrs
, nfstime
*objp
)
562 if (amuDebug(D_XDRTRACE
))
563 plog(XLOG_DEBUG
, "xdr_nfstime:");
565 if (!xdr_u_int(xdrs
, (u_int
*) &objp
->nt_seconds
)) {
568 if (!xdr_u_int(xdrs
, (u_int
*) &objp
->nt_useconds
)) {
573 #endif /* not HAVE_XDR_NFSTIME */
576 #ifndef HAVE_XDR_POINTER
578 xdr_pointer(register XDR
*xdrs
, char **objpp
, u_int obj_size
, XDRPROC_T_TYPE xdr_obj
)
580 if (amuDebug(D_XDRTRACE
))
581 plog(XLOG_DEBUG
, "xdr_pointer:");
585 more_data
= (*objpp
!= NULL
);
586 if (!xdr_bool(xdrs
, &more_data
)) {
594 return (xdr_reference(xdrs
, objpp
, obj_size
, xdr_obj
));
596 #endif /* not HAVE_XDR_POINTER */
599 #ifndef HAVE_XDR_READARGS
601 xdr_readargs(XDR
*xdrs
, nfsreadargs
*objp
)
603 if (amuDebug(D_XDRTRACE
))
604 plog(XLOG_DEBUG
, "xdr_readargs:");
606 if (!xdr_nfs_fh(xdrs
, &objp
->ra_fhandle
)) {
609 if (!xdr_u_int(xdrs
, &objp
->ra_offset
)) {
612 if (!xdr_u_int(xdrs
, &objp
->ra_count
)) {
615 if (!xdr_u_int(xdrs
, &objp
->ra_totalcount
)) {
620 #endif /* not HAVE_XDR_READARGS */
623 #ifndef HAVE_XDR_READDIRARGS
625 xdr_readdirargs(XDR
*xdrs
, nfsreaddirargs
*objp
)
627 if (amuDebug(D_XDRTRACE
))
628 plog(XLOG_DEBUG
, "xdr_readdirargs:");
630 if (!xdr_nfs_fh(xdrs
, &objp
->rda_fhandle
)) {
633 if (!xdr_nfscookie(xdrs
, objp
->rda_cookie
)) {
636 if (!xdr_u_int(xdrs
, &objp
->rda_count
)) {
641 #endif /* not HAVE_XDR_READDIRARGS */
644 #ifndef HAVE_XDR_READDIRRES
646 xdr_readdirres(XDR
*xdrs
, nfsreaddirres
*objp
)
648 if (amuDebug(D_XDRTRACE
))
649 plog(XLOG_DEBUG
, "xdr_readdirres:");
651 if (!xdr_nfsstat(xdrs
, &objp
->rdr_status
)) {
654 switch (objp
->rdr_status
) {
656 if (!xdr_dirlist(xdrs
, &objp
->rdr_u
.rdr_reply_u
)) {
665 #endif /* not HAVE_XDR_READDIRRES */
668 #ifndef HAVE_XDR_READLINKRES
670 xdr_readlinkres(XDR
*xdrs
, nfsreadlinkres
*objp
)
672 if (amuDebug(D_XDRTRACE
))
673 plog(XLOG_DEBUG
, "xdr_readlinkres:");
675 if (!xdr_nfsstat(xdrs
, &objp
->rlr_status
)) {
678 switch (objp
->rlr_status
) {
680 if (!xdr_nfspath(xdrs
, &objp
->rlr_u
.rlr_data_u
)) {
689 #endif /* not HAVE_XDR_READLINKRES */
692 #ifndef HAVE_XDR_READOKRES
694 xdr_readokres(XDR
*xdrs
, nfsreadokres
*objp
)
696 if (amuDebug(D_XDRTRACE
))
697 plog(XLOG_DEBUG
, "xdr_readokres:");
699 if (!xdr_fattr(xdrs
, &objp
->raok_attributes
)) {
703 (char **) & objp
->raok_u
.raok_val_u
,
704 (u_int
*) & objp
->raok_u
.raok_len_u
,
710 #endif /* not HAVE_XDR_READOKRES */
713 #ifndef HAVE_XDR_READRES
715 xdr_readres(XDR
*xdrs
, nfsreadres
*objp
)
717 if (amuDebug(D_XDRTRACE
))
718 plog(XLOG_DEBUG
, "xdr_readres:");
720 if (!xdr_nfsstat(xdrs
, &objp
->rr_status
)) {
723 switch (objp
->rr_status
) {
725 if (!xdr_readokres(xdrs
, &objp
->rr_u
.rr_reply_u
)) {
734 #endif /* not HAVE_XDR_READRES */
737 #ifndef HAVE_XDR_RENAMEARGS
739 xdr_renameargs(XDR
*xdrs
, nfsrenameargs
*objp
)
741 if (amuDebug(D_XDRTRACE
))
742 plog(XLOG_DEBUG
, "xdr_renameargs:");
744 if (!xdr_diropargs(xdrs
, &objp
->rna_from
)) {
747 if (!xdr_diropargs(xdrs
, &objp
->rna_to
)) {
752 #endif /* not HAVE_XDR_RENAMEARGS */
755 #ifndef HAVE_XDR_SATTR
757 xdr_sattr(XDR
*xdrs
, nfssattr
*objp
)
759 if (amuDebug(D_XDRTRACE
))
760 plog(XLOG_DEBUG
, "xdr_sattr:");
762 if (!xdr_u_int(xdrs
, &objp
->sa_mode
)) {
765 if (!xdr_u_int(xdrs
, &objp
->sa_uid
)) {
768 if (!xdr_u_int(xdrs
, &objp
->sa_gid
)) {
771 if (!xdr_u_int(xdrs
, &objp
->sa_size
)) {
774 if (!xdr_nfstime(xdrs
, &objp
->sa_atime
)) {
777 if (!xdr_nfstime(xdrs
, &objp
->sa_mtime
)) {
782 #endif /* not HAVE_XDR_SATTR */
785 #ifndef HAVE_XDR_SATTRARGS
787 xdr_sattrargs(XDR
*xdrs
, nfssattrargs
*objp
)
789 if (amuDebug(D_XDRTRACE
))
790 plog(XLOG_DEBUG
, "xdr_sattrargs:");
792 if (!xdr_nfs_fh(xdrs
, &objp
->sag_fhandle
)) {
795 if (!xdr_sattr(xdrs
, &objp
->sag_attributes
)) {
800 #endif /* not HAVE_XDR_SATTRARGS */
803 #ifndef HAVE_XDR_STATFSOKRES
805 xdr_statfsokres(XDR
*xdrs
, nfsstatfsokres
*objp
)
807 if (amuDebug(D_XDRTRACE
))
808 plog(XLOG_DEBUG
, "xdr_statfsokres:");
810 if (!xdr_u_int(xdrs
, &objp
->sfrok_tsize
)) {
813 if (!xdr_u_int(xdrs
, &objp
->sfrok_bsize
)) {
816 if (!xdr_u_int(xdrs
, &objp
->sfrok_blocks
)) {
819 if (!xdr_u_int(xdrs
, &objp
->sfrok_bfree
)) {
822 if (!xdr_u_int(xdrs
, &objp
->sfrok_bavail
)) {
827 #endif /* not HAVE_XDR_STATFSOKRES */
830 #ifndef HAVE_XDR_STATFSRES
832 xdr_statfsres(XDR
*xdrs
, nfsstatfsres
*objp
)
834 if (amuDebug(D_XDRTRACE
))
835 plog(XLOG_DEBUG
, "xdr_statfsres:");
837 if (!xdr_nfsstat(xdrs
, &objp
->sfr_status
)) {
840 switch (objp
->sfr_status
) {
842 if (!xdr_statfsokres(xdrs
, &objp
->sfr_u
.sfr_reply_u
)) {
851 #endif /* not HAVE_XDR_STATFSRES */
854 #ifndef HAVE_XDR_SYMLINKARGS
856 xdr_symlinkargs(XDR
*xdrs
, nfssymlinkargs
*objp
)
858 if (amuDebug(D_XDRTRACE
))
859 plog(XLOG_DEBUG
, "xdr_symlinkargs:");
861 if (!xdr_diropargs(xdrs
, &objp
->sla_from
)) {
864 if (!xdr_nfspath(xdrs
, &objp
->sla_to
)) {
867 if (!xdr_sattr(xdrs
, &objp
->sla_attributes
)) {
872 #endif /* not HAVE_XDR_SYMLINKARGS */
875 #ifndef HAVE_XDR_WRITEARGS
877 xdr_writeargs(XDR
*xdrs
, nfswriteargs
*objp
)
879 if (amuDebug(D_XDRTRACE
))
880 plog(XLOG_DEBUG
, "xdr_writeargs:");
882 if (!xdr_nfs_fh(xdrs
, &objp
->wra_fhandle
)) {
885 if (!xdr_u_int(xdrs
, &objp
->wra_beginoffset
)) {
888 if (!xdr_u_int(xdrs
, &objp
->wra_offset
)) {
891 if (!xdr_u_int(xdrs
, &objp
->wra_totalcount
)) {
895 (char **) & objp
->wra_u
.wra_val_u
,
896 (u_int
*) & objp
->wra_u
.wra_len_u
,
902 #endif /* not HAVE_XDR_WRITEARGS */
906 * NFS V3 XDR FUNCTIONS:
910 xdr_am_fhandle3(XDR
*xdrs
, am_fhandle3
*objp
)
912 if (amuDebug(D_XDRTRACE
))
913 plog(XLOG_DEBUG
, "xdr_am_fhandle3:");
916 (char **) &objp
->fhandle3_val
,
917 (u_int
*) &objp
->fhandle3_len
,
925 xdr_am_mountstat3(XDR
*xdrs
, am_mountstat3
*objp
)
927 enum_t local_obj
= *objp
;
929 if (amuDebug(D_XDRTRACE
))
930 plog(XLOG_DEBUG
, "xdr_am_mountstat3:");
932 if (!xdr_enum(xdrs
, &local_obj
))
939 xdr_am_mountres3_ok(XDR
*xdrs
, am_mountres3_ok
*objp
)
941 if (amuDebug(D_XDRTRACE
))
942 plog(XLOG_DEBUG
, "xdr_am_mountres3_ok:");
944 if (!xdr_am_fhandle3(xdrs
, &objp
->fhandle
))
947 (char **) ((voidp
) &objp
->auth_flavors
.auth_flavors_val
),
948 (u_int
*) &objp
->auth_flavors
.auth_flavors_len
,
951 (XDRPROC_T_TYPE
) xdr_int
))
958 xdr_am_mountres3(XDR
*xdrs
, am_mountres3
*objp
)
960 if (amuDebug(D_XDRTRACE
))
961 plog(XLOG_DEBUG
, "xdr_am_mountres3:");
963 if (!xdr_am_mountstat3(xdrs
, &objp
->fhs_status
))
966 if (objp
->fhs_status
== AM_MNT3_OK
) {
967 if (!xdr_am_mountres3_ok(xdrs
, &objp
->mountres3_u
.mountinfo
))
975 xdr_am_diropargs3(XDR
*xdrs
, am_diropargs3
*objp
)
977 if (amuDebug(D_XDRTRACE
))
978 plog(XLOG_DEBUG
, "xdr_am_diropargs3:");
980 if (!xdr_am_nfs_fh3(xdrs
, &objp
->dir
))
982 if (!xdr_am_filename3(xdrs
, &objp
->name
))
989 xdr_am_filename3(XDR
*xdrs
, am_filename3
*objp
)
991 if (amuDebug(D_XDRTRACE
))
992 plog(XLOG_DEBUG
, "xdr_am_filename3:");
994 if (!xdr_string(xdrs
, objp
, ~0))
1001 xdr_am_LOOKUP3args(XDR
*xdrs
, am_LOOKUP3args
*objp
)
1003 if (amuDebug(D_XDRTRACE
))
1004 plog(XLOG_DEBUG
, "xdr_am_LOOKUP3args:");
1006 if (!xdr_am_diropargs3(xdrs
, &objp
->what
))
1013 xdr_am_LOOKUP3res(XDR
*xdrs
, am_LOOKUP3res
*objp
)
1015 if (amuDebug(D_XDRTRACE
))
1016 plog(XLOG_DEBUG
, "xdr_am_LOOKUP3res:");
1018 if (!xdr_am_nfsstat3(xdrs
, &objp
->status
))
1020 switch (objp
->status
) {
1022 if (!xdr_am_LOOKUP3resok(xdrs
, &objp
->res_u
.ok
))
1026 if (!xdr_am_LOOKUP3resfail(xdrs
, &objp
->res_u
.fail
))
1035 xdr_am_LOOKUP3resfail(XDR
*xdrs
, am_LOOKUP3resfail
*objp
)
1037 if (amuDebug(D_XDRTRACE
))
1038 plog(XLOG_DEBUG
, "xdr_am_LOOKUP3resfail:");
1041 * Don't xdr post_op_attr: amd doesn't need them, but they require many
1042 * additional xdr functions.
1045 if (!xdr_post_op_attr(xdrs
, &objp
->dir_attributes
))
1053 xdr_am_LOOKUP3resok(XDR
*xdrs
, am_LOOKUP3resok
*objp
)
1055 if (amuDebug(D_XDRTRACE
))
1056 plog(XLOG_DEBUG
, "xdr_am_LOOKUP3resok:");
1058 if (!xdr_am_nfs_fh3(xdrs
, &objp
->object
))
1061 * Don't xdr post_op_attr: amd doesn't need them, but they require many
1062 * additional xdr functions.
1065 if (!xdr_post_op_attr(xdrs
, &objp
->obj_attributes
))
1067 if (!xdr_post_op_attr(xdrs
, &objp
->dir_attributes
))
1075 xdr_am_nfs_fh3(XDR
*xdrs
, am_nfs_fh3
*objp
)
1077 if (amuDebug(D_XDRTRACE
))
1078 plog(XLOG_DEBUG
, "xdr_am_nfs_fh3:");
1080 if (!xdr_u_int(xdrs
, &objp
->am_fh3_length
))
1082 if (objp
->am_fh3_length
> AM_FHSIZE3
)
1084 if (!xdr_opaque(xdrs
, objp
->am_fh3_data
, objp
->am_fh3_length
))
1091 xdr_am_nfsstat3(XDR
*xdrs
, am_nfsstat3
*objp
)
1093 if (amuDebug(D_XDRTRACE
))
1094 plog(XLOG_DEBUG
, "xdr_am_nfsstat3:");
1096 if (!xdr_enum(xdrs
, (enum_t
*)objp
))
1100 #endif /* not HAVE_FS_NFS3 */