1 /* $NetBSD: xdr_func.c,v 1.1.1.3 2015/01/17 16:34:18 christos Exp $ */
2
3 /*
4 * Copyright (c) 1997-2014 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.
8 * All rights reserved.
9 *
10 * This code is derived from software contributed to Berkeley by
11 * Jan-Simon Pendry at Imperial College, London.
12 *
13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions
15 * are met:
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. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 *
38 * File: am-utils/libamu/xdr_func.c
39 *
40 */
41
42 /*
43 * Complete list of all possible xdr functions which may be needed.
44 */
45 #ifdef HAVE_CONFIG_H
46 # include <config.h>
47 #endif /* HAVE_CONFIG_H */
48 #include <am_defs.h>
49 #include <amu.h>
50
51 #ifdef __RPCSVC_MOUNT_H__
52 # error IRIX6 should not include rpcsvc/mount.h
53 #endif /* __RPCSVC_MOUNT_H__ */
54
55 /*
56 * MACROS:
57 */
58 #ifdef HAVE_FS_AUTOFS
59 # ifndef AUTOFS_MAXCOMPONENTLEN
60 # define AUTOFS_MAXCOMPONENTLEN 255
61 # endif /* not AUTOFS_MAXCOMPONENTLEN */
62 # ifndef AUTOFS_MAXOPTSLEN
63 # define AUTOFS_MAXOPTSLEN 255
64 # endif /* not AUTOFS_MAXOPTSLEN */
65 # ifndef AUTOFS_MAXPATHLEN
66 # define AUTOFS_MAXPATHLEN 1024
67 # endif /* not AUTOFS_MAXPATHLEN */
68 #endif /* HAVE_FS_AUTOFS */
69
70 /* forward definitions, are they needed? */
71 extern bool_t xdr_exportnode(XDR *xdrs, exportnode *objp);
72 extern bool_t xdr_groupnode(XDR *xdrs, groupnode *objp);
73 extern bool_t xdr_name(XDR *xdrs, name *objp);
74
75
76 #ifndef HAVE_XDR_ATTRSTAT
77 bool_t
xdr_attrstat(XDR * xdrs,nfsattrstat * objp)78 xdr_attrstat(XDR *xdrs, nfsattrstat *objp)
79 {
80 if (amuDebug(D_XDRTRACE))
81 plog(XLOG_DEBUG, "xdr_attrstat:");
82
83 if (!xdr_nfsstat(xdrs, &objp->ns_status)) {
84 return (FALSE);
85 }
86 switch (objp->ns_status) {
87 case NFS_OK:
88 if (!xdr_fattr(xdrs, &objp->ns_u.ns_attr_u)) {
89 return (FALSE);
90 }
91 break;
92 default:
93 break;
94 }
95 return (TRUE);
96 }
97 #endif /* not HAVE_XDR_ATTRSTAT */
98
99
100 #ifndef HAVE_XDR_CREATEARGS
101 bool_t
xdr_createargs(XDR * xdrs,nfscreateargs * objp)102 xdr_createargs(XDR *xdrs, nfscreateargs *objp)
103 {
104 if (amuDebug(D_XDRTRACE))
105 plog(XLOG_DEBUG, "xdr_createargs:");
106
107 if (!xdr_diropargs(xdrs, &objp->ca_where)) {
108 return (FALSE);
109 }
110 if (!xdr_sattr(xdrs, &objp->ca_attributes)) {
111 return (FALSE);
112 }
113 return (TRUE);
114 }
115 #endif /* not HAVE_XDR_CREATEARGS */
116
117
118 #ifndef HAVE_XDR_DIRLIST
119 bool_t
xdr_dirlist(XDR * xdrs,nfsdirlist * objp)120 xdr_dirlist(XDR *xdrs, nfsdirlist *objp)
121 {
122 if (amuDebug(D_XDRTRACE))
123 plog(XLOG_DEBUG, "xdr_dirlist:");
124
125 if (!xdr_pointer(xdrs, (char **) &objp->dl_entries, sizeof(nfsentry), (XDRPROC_T_TYPE) xdr_entry)) {
126 return (FALSE);
127 }
128 if (!xdr_bool(xdrs, &objp->dl_eof)) {
129 return (FALSE);
130 }
131 return (TRUE);
132 }
133 #endif /* not HAVE_XDR_DIRLIST */
134
135
136 #ifndef HAVE_XDR_DIROPARGS
137 bool_t
xdr_diropargs(XDR * xdrs,nfsdiropargs * objp)138 xdr_diropargs(XDR *xdrs, nfsdiropargs *objp)
139 {
140 if (amuDebug(D_XDRTRACE))
141 plog(XLOG_DEBUG, "xdr_diropargs:");
142
143 if (!xdr_nfs_fh(xdrs, &objp->da_fhandle)) {
144 return (FALSE);
145 }
146 if (!xdr_filename(xdrs, &objp->da_name)) {
147 return (FALSE);
148 }
149 return (TRUE);
150 }
151 #endif /* not HAVE_XDR_DIROPARGS */
152
153
154 #ifndef HAVE_XDR_DIROPOKRES
155 bool_t
xdr_diropokres(XDR * xdrs,nfsdiropokres * objp)156 xdr_diropokres(XDR *xdrs, nfsdiropokres *objp)
157 {
158 if (amuDebug(D_XDRTRACE))
159 plog(XLOG_DEBUG, "xdr_diropokres:");
160
161 if (!xdr_nfs_fh(xdrs, &objp->drok_fhandle)) {
162 return (FALSE);
163 }
164 if (!xdr_fattr(xdrs, &objp->drok_attributes)) {
165 return (FALSE);
166 }
167 return (TRUE);
168 }
169 #endif /* not HAVE_XDR_DIROPOKRES */
170
171
172 #ifndef HAVE_XDR_DIROPRES
173 bool_t
xdr_diropres(XDR * xdrs,nfsdiropres * objp)174 xdr_diropres(XDR *xdrs, nfsdiropres *objp)
175 {
176 if (amuDebug(D_XDRTRACE))
177 plog(XLOG_DEBUG, "xdr_diropres:");
178
179 if (!xdr_nfsstat(xdrs, &objp->dr_status)) {
180 return (FALSE);
181 }
182 switch (objp->dr_status) {
183 case NFS_OK:
184 if (!xdr_diropokres(xdrs, &objp->dr_u.dr_drok_u)) {
185 return (FALSE);
186 }
187 break;
188 default:
189 break;
190 }
191 return (TRUE);
192 }
193 #endif /* not HAVE_XDR_DIROPRES */
194
195
196 #ifndef HAVE_XDR_DIRPATH
197 bool_t
xdr_dirpath(XDR * xdrs,dirpath * objp)198 xdr_dirpath(XDR *xdrs, dirpath *objp)
199 {
200 if (amuDebug(D_XDRTRACE))
201 plog(XLOG_DEBUG, "xdr_dirpath:");
202
203 if (!xdr_string(xdrs, objp, MNTPATHLEN)) {
204 return (FALSE);
205 }
206 return (TRUE);
207 }
208 #endif /* not HAVE_XDR_DIRPATH */
209
210
211 #ifndef HAVE_XDR_ENTRY
212 bool_t
xdr_entry(XDR * xdrs,nfsentry * objp)213 xdr_entry(XDR *xdrs, nfsentry *objp)
214 {
215 if (amuDebug(D_XDRTRACE))
216 plog(XLOG_DEBUG, "xdr_entry:");
217
218 if (!xdr_u_int(xdrs, &objp->ne_fileid)) {
219 return (FALSE);
220 }
221 if (!xdr_filename(xdrs, &objp->ne_name)) {
222 return (FALSE);
223 }
224 if (!xdr_nfscookie(xdrs, objp->ne_cookie)) {
225 return (FALSE);
226 }
227 if (!xdr_pointer(xdrs, (char **) &objp->ne_nextentry, sizeof(nfsentry), (XDRPROC_T_TYPE) xdr_entry)) {
228 return (FALSE);
229 }
230 return (TRUE);
231 }
232 #endif /* not HAVE_XDR_ENTRY */
233
234
235 #ifndef HAVE_XDR_EXPORTNODE
236 bool_t
xdr_exportnode(XDR * xdrs,exportnode * objp)237 xdr_exportnode(XDR *xdrs, exportnode *objp)
238 {
239 if (amuDebug(D_XDRTRACE))
240 plog(XLOG_DEBUG, "xdr_exportnode:");
241
242 if (!xdr_dirpath(xdrs, &objp->ex_dir)) {
243 return (FALSE);
244 }
245 if (!xdr_groups(xdrs, &objp->ex_groups)) {
246 return (FALSE);
247 }
248 if (!xdr_exports(xdrs, &objp->ex_next)) {
249 return (FALSE);
250 }
251 return (TRUE);
252 }
253 #endif /* not HAVE_XDR_EXPORTNODE */
254
255
256 #ifndef HAVE_XDR_EXPORTS
257 bool_t
xdr_exports(XDR * xdrs,exports * objp)258 xdr_exports(XDR *xdrs, exports *objp)
259 {
260 if (amuDebug(D_XDRTRACE))
261 plog(XLOG_DEBUG, "xdr_exports:");
262
263 if (!xdr_pointer(xdrs, (char **) objp, sizeof(exportnode), (XDRPROC_T_TYPE) xdr_exportnode)) {
264 return (FALSE);
265 }
266 return (TRUE);
267 }
268 #endif /* not HAVE_XDR_EXPORTS */
269
270
271 #ifndef HAVE_XDR_FATTR
272 bool_t
xdr_fattr(XDR * xdrs,nfsfattr * objp)273 xdr_fattr(XDR *xdrs, nfsfattr *objp)
274 {
275 if (amuDebug(D_XDRTRACE))
276 plog(XLOG_DEBUG, "xdr_fattr:");
277
278 if (!xdr_ftype(xdrs, &objp->na_type)) {
279 return (FALSE);
280 }
281 if (!xdr_u_int(xdrs, &objp->na_mode)) {
282 return (FALSE);
283 }
284 if (!xdr_u_int(xdrs, &objp->na_nlink)) {
285 return (FALSE);
286 }
287 if (!xdr_u_int(xdrs, &objp->na_uid)) {
288 return (FALSE);
289 }
290 if (!xdr_u_int(xdrs, &objp->na_gid)) {
291 return (FALSE);
292 }
293 if (!xdr_u_int(xdrs, &objp->na_size)) {
294 return (FALSE);
295 }
296 if (!xdr_u_int(xdrs, &objp->na_blocksize)) {
297 return (FALSE);
298 }
299 if (!xdr_u_int(xdrs, &objp->na_rdev)) {
300 return (FALSE);
301 }
302 if (!xdr_u_int(xdrs, &objp->na_blocks)) {
303 return (FALSE);
304 }
305 if (!xdr_u_int(xdrs, &objp->na_fsid)) {
306 return (FALSE);
307 }
308 if (!xdr_u_int(xdrs, &objp->na_fileid)) {
309 return (FALSE);
310 }
311 if (!xdr_nfstime(xdrs, &objp->na_atime)) {
312 return (FALSE);
313 }
314 if (!xdr_nfstime(xdrs, &objp->na_mtime)) {
315 return (FALSE);
316 }
317 if (!xdr_nfstime(xdrs, &objp->na_ctime)) {
318 return (FALSE);
319 }
320 return (TRUE);
321 }
322 #endif /* not HAVE_XDR_FATTR */
323
324
325 #ifndef HAVE_XDR_FHANDLE
326 bool_t
xdr_fhandle(XDR * xdrs,fhandle objp)327 xdr_fhandle(XDR *xdrs, fhandle objp)
328 {
329 if (amuDebug(D_XDRTRACE))
330 plog(XLOG_DEBUG, "xdr_fhandle:");
331
332 if (!xdr_opaque(xdrs, objp, NFS_FHSIZE)) {
333 return (FALSE);
334 }
335 return (TRUE);
336 }
337 #endif /* not HAVE_XDR_FHANDLE */
338
339
340 #ifndef HAVE_XDR_FHSTATUS
341 bool_t
xdr_fhstatus(XDR * xdrs,fhstatus * objp)342 xdr_fhstatus(XDR *xdrs, fhstatus *objp)
343 {
344 if (amuDebug(D_XDRTRACE))
345 plog(XLOG_DEBUG, "xdr_fhstatus:");
346
347 if (!xdr_u_int(xdrs, &objp->fhs_status)) {
348 return (FALSE);
349 }
350 if (objp->fhs_status == 0 && !xdr_fhandle(xdrs, objp->fhs_fh)) {
351 return (FALSE);
352 }
353 return (TRUE);
354 }
355 #endif /* not HAVE_XDR_FHSTATUS */
356
357
358 #ifndef HAVE_XDR_FILENAME
359 bool_t
xdr_filename(XDR * xdrs,filename * objp)360 xdr_filename(XDR *xdrs, filename *objp)
361 {
362 if (amuDebug(D_XDRTRACE))
363 plog(XLOG_DEBUG, "xdr_filename:");
364
365 if (!xdr_string(xdrs, objp, NFS_MAXNAMLEN)) {
366 return (FALSE);
367 }
368 return (TRUE);
369 }
370 #endif /* not HAVE_XDR_FILENAME */
371
372
373 #ifndef HAVE_XDR_FTYPE
374 bool_t
xdr_ftype(XDR * xdrs,nfsftype * objp)375 xdr_ftype(XDR *xdrs, nfsftype *objp)
376 {
377 enum_t local_obj = *objp;
378
379 if (amuDebug(D_XDRTRACE))
380 plog(XLOG_DEBUG, "xdr_ftype:");
381
382 if (!xdr_enum(xdrs, &local_obj)) {
383 return (FALSE);
384 }
385 return (TRUE);
386 }
387 #endif /* not HAVE_XDR_FTYPE */
388
389
390 #ifndef HAVE_XDR_GROUPNODE
391 bool_t
xdr_groupnode(XDR * xdrs,groupnode * objp)392 xdr_groupnode(XDR *xdrs, groupnode *objp)
393 {
394 if (amuDebug(D_XDRTRACE))
395 plog(XLOG_DEBUG, "xdr_groupnode:");
396
397 if (!xdr_name(xdrs, &objp->gr_name)) {
398 return (FALSE);
399 }
400 if (!xdr_groups(xdrs, &objp->gr_next)) {
401 return (FALSE);
402 }
403 return (TRUE);
404 }
405 #endif /* not HAVE_XDR_GROUPNODE */
406
407
408 #ifndef HAVE_XDR_GROUPS
409 bool_t
xdr_groups(XDR * xdrs,groups * objp)410 xdr_groups(XDR *xdrs, groups *objp)
411 {
412 if (amuDebug(D_XDRTRACE))
413 plog(XLOG_DEBUG, "xdr_groups:");
414
415 if (!xdr_pointer(xdrs, (char **) objp, sizeof(groupnode), (XDRPROC_T_TYPE) xdr_groupnode)) {
416 return (FALSE);
417 }
418 return (TRUE);
419 }
420 #endif /* not HAVE_XDR_GROUPS */
421
422
423 #ifndef HAVE_XDR_LINKARGS
424 bool_t
xdr_linkargs(XDR * xdrs,nfslinkargs * objp)425 xdr_linkargs(XDR *xdrs, nfslinkargs *objp)
426 {
427 if (amuDebug(D_XDRTRACE))
428 plog(XLOG_DEBUG, "xdr_linkargs:");
429
430 if (!xdr_nfs_fh(xdrs, &objp->la_fhandle)) {
431 return (FALSE);
432 }
433 if (!xdr_diropargs(xdrs, &objp->la_to)) {
434 return (FALSE);
435 }
436 return (TRUE);
437 }
438 #endif /* not HAVE_XDR_LINKARGS */
439
440
441 #ifndef HAVE_XDR_MOUNTBODY
442 bool_t
xdr_mountbody(XDR * xdrs,mountbody * objp)443 xdr_mountbody(XDR *xdrs, mountbody *objp)
444 {
445 if (amuDebug(D_XDRTRACE))
446 plog(XLOG_DEBUG, "xdr_mountbody:");
447
448 if (!xdr_name(xdrs, &objp->ml_hostname)) {
449 return (FALSE);
450 }
451 if (!xdr_dirpath(xdrs, &objp->ml_directory)) {
452 return (FALSE);
453 }
454 if (!xdr_mountlist(xdrs, &objp->ml_next)) {
455 return (FALSE);
456 }
457 return (TRUE);
458 }
459 #endif /* not HAVE_XDR_MOUNTBODY */
460
461
462 #ifndef HAVE_XDR_MOUNTLIST
463 bool_t
xdr_mountlist(XDR * xdrs,mountlist * objp)464 xdr_mountlist(XDR *xdrs, mountlist *objp)
465 {
466 if (amuDebug(D_XDRTRACE))
467 plog(XLOG_DEBUG, "xdr_mountlist:");
468
469 if (!xdr_pointer(xdrs, (char **) objp, sizeof(mountbody), (XDRPROC_T_TYPE) xdr_mountbody)) {
470 return (FALSE);
471 }
472 return (TRUE);
473 }
474 #endif /* not HAVE_XDR_MOUNTLIST */
475
476
477 #ifndef HAVE_XDR_NAME
478 bool_t
xdr_name(XDR * xdrs,name * objp)479 xdr_name(XDR *xdrs, name *objp)
480 {
481 if (amuDebug(D_XDRTRACE))
482 plog(XLOG_DEBUG, "xdr_name:");
483
484 if (!xdr_string(xdrs, objp, MNTNAMLEN)) {
485 return (FALSE);
486 }
487 return (TRUE);
488 }
489 #endif /* not HAVE_XDR_NAME */
490
491
492 #ifndef HAVE_XDR_NFS_FH
493 bool_t
xdr_nfs_fh(XDR * xdrs,am_nfs_fh * objp)494 xdr_nfs_fh(XDR *xdrs, am_nfs_fh *objp)
495 {
496 if (amuDebug(D_XDRTRACE))
497 plog(XLOG_DEBUG, "xdr_nfs_fh:");
498
499 if (!xdr_opaque(xdrs, (caddr_t) objp->fh_data, NFS_FHSIZE)) {
500 return (FALSE);
501 }
502 return (TRUE);
503 }
504 #endif /* not HAVE_XDR_NFS_FH */
505
506
507 #ifndef HAVE_XDR_NFSCOOKIE
508 bool_t
xdr_nfscookie(XDR * xdrs,nfscookie objp)509 xdr_nfscookie(XDR *xdrs, nfscookie objp)
510 {
511 if (amuDebug(D_XDRTRACE))
512 plog(XLOG_DEBUG, "xdr_nfscookie:");
513
514 if (!xdr_opaque(xdrs, objp, NFS_COOKIESIZE)) {
515 return (FALSE);
516 }
517 return (TRUE);
518 }
519 #endif /* not HAVE_XDR_NFSCOOKIE */
520
521
522 #ifndef HAVE_XDR_NFSPATH
523 bool_t
xdr_nfspath(XDR * xdrs,nfspath * objp)524 xdr_nfspath(XDR *xdrs, nfspath *objp)
525 {
526 if (amuDebug(D_XDRTRACE))
527 plog(XLOG_DEBUG, "xdr_nfspath:");
528
529 if (!xdr_string(xdrs, objp, NFS_MAXPATHLEN)) {
530 return (FALSE);
531 }
532 return (TRUE);
533 }
534 #endif /* not HAVE_XDR_NFSPATH */
535
536
537 #ifndef HAVE_XDR_NFSSTAT
538 bool_t
xdr_nfsstat(XDR * xdrs,nfsstat * objp)539 xdr_nfsstat(XDR *xdrs, nfsstat *objp)
540 {
541 enum_t local_obj = *objp;
542
543 if (amuDebug(D_XDRTRACE))
544 plog(XLOG_DEBUG, "xdr_nfsstat:");
545
546 if (!xdr_enum(xdrs, &local_obj)) {
547 return (FALSE);
548 }
549 return (TRUE);
550 }
551 #endif /* not HAVE_XDR_NFSSTAT */
552
553
554 #ifndef HAVE_XDR_NFSTIME
555 bool_t
xdr_nfstime(XDR * xdrs,nfstime * objp)556 xdr_nfstime(XDR *xdrs, nfstime *objp)
557 {
558 if (amuDebug(D_XDRTRACE))
559 plog(XLOG_DEBUG, "xdr_nfstime:");
560
561 if (!xdr_u_int(xdrs, (u_int *) &objp->nt_seconds)) {
562 return (FALSE);
563 }
564 if (!xdr_u_int(xdrs, (u_int *) &objp->nt_useconds)) {
565 return (FALSE);
566 }
567 return (TRUE);
568 }
569 #endif /* not HAVE_XDR_NFSTIME */
570
571
572 #ifndef HAVE_XDR_POINTER
573 bool_t
xdr_pointer(register XDR * xdrs,char ** objpp,u_int obj_size,XDRPROC_T_TYPE xdr_obj)574 xdr_pointer(register XDR *xdrs, char **objpp, u_int obj_size, XDRPROC_T_TYPE xdr_obj)
575 {
576 if (amuDebug(D_XDRTRACE))
577 plog(XLOG_DEBUG, "xdr_pointer:");
578
579 bool_t more_data;
580
581 more_data = (*objpp != NULL);
582 if (!xdr_bool(xdrs, &more_data)) {
583 return (FALSE);
584 }
585 if (!more_data) {
586 *objpp = NULL;
587 return (TRUE);
588 }
589
590 return (xdr_reference(xdrs, objpp, obj_size, xdr_obj));
591 }
592 #endif /* not HAVE_XDR_POINTER */
593
594
595 #ifndef HAVE_XDR_READARGS
596 bool_t
xdr_readargs(XDR * xdrs,nfsreadargs * objp)597 xdr_readargs(XDR *xdrs, nfsreadargs *objp)
598 {
599 if (amuDebug(D_XDRTRACE))
600 plog(XLOG_DEBUG, "xdr_readargs:");
601
602 if (!xdr_nfs_fh(xdrs, &objp->ra_fhandle)) {
603 return (FALSE);
604 }
605 if (!xdr_u_int(xdrs, &objp->ra_offset)) {
606 return (FALSE);
607 }
608 if (!xdr_u_int(xdrs, &objp->ra_count)) {
609 return (FALSE);
610 }
611 if (!xdr_u_int(xdrs, &objp->ra_totalcount)) {
612 return (FALSE);
613 }
614 return (TRUE);
615 }
616 #endif /* not HAVE_XDR_READARGS */
617
618
619 #ifndef HAVE_XDR_READDIRARGS
620 bool_t
xdr_readdirargs(XDR * xdrs,nfsreaddirargs * objp)621 xdr_readdirargs(XDR *xdrs, nfsreaddirargs *objp)
622 {
623 if (amuDebug(D_XDRTRACE))
624 plog(XLOG_DEBUG, "xdr_readdirargs:");
625
626 if (!xdr_nfs_fh(xdrs, &objp->rda_fhandle)) {
627 return (FALSE);
628 }
629 if (!xdr_nfscookie(xdrs, objp->rda_cookie)) {
630 return (FALSE);
631 }
632 if (!xdr_u_int(xdrs, &objp->rda_count)) {
633 return (FALSE);
634 }
635 return (TRUE);
636 }
637 #endif /* not HAVE_XDR_READDIRARGS */
638
639
640 #ifndef HAVE_XDR_READDIRRES
641 bool_t
xdr_readdirres(XDR * xdrs,nfsreaddirres * objp)642 xdr_readdirres(XDR *xdrs, nfsreaddirres *objp)
643 {
644 if (amuDebug(D_XDRTRACE))
645 plog(XLOG_DEBUG, "xdr_readdirres:");
646
647 if (!xdr_nfsstat(xdrs, &objp->rdr_status)) {
648 return (FALSE);
649 }
650 switch (objp->rdr_status) {
651 case NFS_OK:
652 if (!xdr_dirlist(xdrs, &objp->rdr_u.rdr_reply_u)) {
653 return (FALSE);
654 }
655 break;
656 default:
657 break;
658 }
659 return (TRUE);
660 }
661 #endif /* not HAVE_XDR_READDIRRES */
662
663
664 #ifndef HAVE_XDR_READLINKRES
665 bool_t
xdr_readlinkres(XDR * xdrs,nfsreadlinkres * objp)666 xdr_readlinkres(XDR *xdrs, nfsreadlinkres *objp)
667 {
668 if (amuDebug(D_XDRTRACE))
669 plog(XLOG_DEBUG, "xdr_readlinkres:");
670
671 if (!xdr_nfsstat(xdrs, &objp->rlr_status)) {
672 return (FALSE);
673 }
674 switch (objp->rlr_status) {
675 case NFS_OK:
676 if (!xdr_nfspath(xdrs, &objp->rlr_u.rlr_data_u)) {
677 return (FALSE);
678 }
679 break;
680 default:
681 break;
682 }
683 return (TRUE);
684 }
685 #endif /* not HAVE_XDR_READLINKRES */
686
687
688 #ifndef HAVE_XDR_READOKRES
689 bool_t
xdr_readokres(XDR * xdrs,nfsreadokres * objp)690 xdr_readokres(XDR *xdrs, nfsreadokres *objp)
691 {
692 if (amuDebug(D_XDRTRACE))
693 plog(XLOG_DEBUG, "xdr_readokres:");
694
695 if (!xdr_fattr(xdrs, &objp->raok_attributes)) {
696 return (FALSE);
697 }
698 if (!xdr_bytes(xdrs,
699 (char **) & objp->raok_u.raok_val_u,
700 (u_int *) & objp->raok_u.raok_len_u,
701 NFS_MAXDATA)) {
702 return (FALSE);
703 }
704 return (TRUE);
705 }
706 #endif /* not HAVE_XDR_READOKRES */
707
708
709 #ifndef HAVE_XDR_READRES
710 bool_t
xdr_readres(XDR * xdrs,nfsreadres * objp)711 xdr_readres(XDR *xdrs, nfsreadres *objp)
712 {
713 if (amuDebug(D_XDRTRACE))
714 plog(XLOG_DEBUG, "xdr_readres:");
715
716 if (!xdr_nfsstat(xdrs, &objp->rr_status)) {
717 return (FALSE);
718 }
719 switch (objp->rr_status) {
720 case NFS_OK:
721 if (!xdr_readokres(xdrs, &objp->rr_u.rr_reply_u)) {
722 return (FALSE);
723 }
724 break;
725 default:
726 break;
727 }
728 return (TRUE);
729 }
730 #endif /* not HAVE_XDR_READRES */
731
732
733 #ifndef HAVE_XDR_RENAMEARGS
734 bool_t
xdr_renameargs(XDR * xdrs,nfsrenameargs * objp)735 xdr_renameargs(XDR *xdrs, nfsrenameargs *objp)
736 {
737 if (amuDebug(D_XDRTRACE))
738 plog(XLOG_DEBUG, "xdr_renameargs:");
739
740 if (!xdr_diropargs(xdrs, &objp->rna_from)) {
741 return (FALSE);
742 }
743 if (!xdr_diropargs(xdrs, &objp->rna_to)) {
744 return (FALSE);
745 }
746 return (TRUE);
747 }
748 #endif /* not HAVE_XDR_RENAMEARGS */
749
750
751 #ifndef HAVE_XDR_SATTR
752 bool_t
xdr_sattr(XDR * xdrs,nfssattr * objp)753 xdr_sattr(XDR *xdrs, nfssattr *objp)
754 {
755 if (amuDebug(D_XDRTRACE))
756 plog(XLOG_DEBUG, "xdr_sattr:");
757
758 if (!xdr_u_int(xdrs, &objp->sa_mode)) {
759 return (FALSE);
760 }
761 if (!xdr_u_int(xdrs, &objp->sa_uid)) {
762 return (FALSE);
763 }
764 if (!xdr_u_int(xdrs, &objp->sa_gid)) {
765 return (FALSE);
766 }
767 if (!xdr_u_int(xdrs, &objp->sa_size)) {
768 return (FALSE);
769 }
770 if (!xdr_nfstime(xdrs, &objp->sa_atime)) {
771 return (FALSE);
772 }
773 if (!xdr_nfstime(xdrs, &objp->sa_mtime)) {
774 return (FALSE);
775 }
776 return (TRUE);
777 }
778 #endif /* not HAVE_XDR_SATTR */
779
780
781 #ifndef HAVE_XDR_SATTRARGS
782 bool_t
xdr_sattrargs(XDR * xdrs,nfssattrargs * objp)783 xdr_sattrargs(XDR *xdrs, nfssattrargs *objp)
784 {
785 if (amuDebug(D_XDRTRACE))
786 plog(XLOG_DEBUG, "xdr_sattrargs:");
787
788 if (!xdr_nfs_fh(xdrs, &objp->sag_fhandle)) {
789 return (FALSE);
790 }
791 if (!xdr_sattr(xdrs, &objp->sag_attributes)) {
792 return (FALSE);
793 }
794 return (TRUE);
795 }
796 #endif /* not HAVE_XDR_SATTRARGS */
797
798
799 #ifndef HAVE_XDR_STATFSOKRES
800 bool_t
xdr_statfsokres(XDR * xdrs,nfsstatfsokres * objp)801 xdr_statfsokres(XDR *xdrs, nfsstatfsokres *objp)
802 {
803 if (amuDebug(D_XDRTRACE))
804 plog(XLOG_DEBUG, "xdr_statfsokres:");
805
806 if (!xdr_u_int(xdrs, &objp->sfrok_tsize)) {
807 return (FALSE);
808 }
809 if (!xdr_u_int(xdrs, &objp->sfrok_bsize)) {
810 return (FALSE);
811 }
812 if (!xdr_u_int(xdrs, &objp->sfrok_blocks)) {
813 return (FALSE);
814 }
815 if (!xdr_u_int(xdrs, &objp->sfrok_bfree)) {
816 return (FALSE);
817 }
818 if (!xdr_u_int(xdrs, &objp->sfrok_bavail)) {
819 return (FALSE);
820 }
821 return (TRUE);
822 }
823 #endif /* not HAVE_XDR_STATFSOKRES */
824
825
826 #ifndef HAVE_XDR_STATFSRES
827 bool_t
xdr_statfsres(XDR * xdrs,nfsstatfsres * objp)828 xdr_statfsres(XDR *xdrs, nfsstatfsres *objp)
829 {
830 if (amuDebug(D_XDRTRACE))
831 plog(XLOG_DEBUG, "xdr_statfsres:");
832
833 if (!xdr_nfsstat(xdrs, &objp->sfr_status)) {
834 return (FALSE);
835 }
836 switch (objp->sfr_status) {
837 case NFS_OK:
838 if (!xdr_statfsokres(xdrs, &objp->sfr_u.sfr_reply_u)) {
839 return (FALSE);
840 }
841 break;
842 default:
843 break;
844 }
845 return (TRUE);
846 }
847 #endif /* not HAVE_XDR_STATFSRES */
848
849
850 #ifndef HAVE_XDR_SYMLINKARGS
851 bool_t
xdr_symlinkargs(XDR * xdrs,nfssymlinkargs * objp)852 xdr_symlinkargs(XDR *xdrs, nfssymlinkargs *objp)
853 {
854 if (amuDebug(D_XDRTRACE))
855 plog(XLOG_DEBUG, "xdr_symlinkargs:");
856
857 if (!xdr_diropargs(xdrs, &objp->sla_from)) {
858 return (FALSE);
859 }
860 if (!xdr_nfspath(xdrs, &objp->sla_to)) {
861 return (FALSE);
862 }
863 if (!xdr_sattr(xdrs, &objp->sla_attributes)) {
864 return (FALSE);
865 }
866 return (TRUE);
867 }
868 #endif /* not HAVE_XDR_SYMLINKARGS */
869
870
871 #ifndef HAVE_XDR_WRITEARGS
872 bool_t
xdr_writeargs(XDR * xdrs,nfswriteargs * objp)873 xdr_writeargs(XDR *xdrs, nfswriteargs *objp)
874 {
875 if (amuDebug(D_XDRTRACE))
876 plog(XLOG_DEBUG, "xdr_writeargs:");
877
878 if (!xdr_nfs_fh(xdrs, &objp->wra_fhandle)) {
879 return (FALSE);
880 }
881 if (!xdr_u_int(xdrs, &objp->wra_beginoffset)) {
882 return (FALSE);
883 }
884 if (!xdr_u_int(xdrs, &objp->wra_offset)) {
885 return (FALSE);
886 }
887 if (!xdr_u_int(xdrs, &objp->wra_totalcount)) {
888 return (FALSE);
889 }
890 if (!xdr_bytes(xdrs,
891 (char **) & objp->wra_u.wra_val_u,
892 (u_int *) & objp->wra_u.wra_len_u,
893 NFS_MAXDATA)) {
894 return (FALSE);
895 }
896 return (TRUE);
897 }
898 #endif /* not HAVE_XDR_WRITEARGS */
899
900
901 /*
902 * NFS V3 XDR FUNCTIONS:
903 */
904 #ifdef HAVE_FS_NFS3
905 bool_t
xdr_am_fhandle3(XDR * xdrs,am_fhandle3 * objp)906 xdr_am_fhandle3(XDR *xdrs, am_fhandle3 *objp)
907 {
908 if (amuDebug(D_XDRTRACE))
909 plog(XLOG_DEBUG, "xdr_am_fhandle3:");
910
911 if (!xdr_bytes(xdrs,
912 (char **) &objp->fhandle3_val,
913 (u_int *) &objp->fhandle3_len,
914 AM_FHSIZE3))
915 return (FALSE);
916 return (TRUE);
917 }
918
919
920 bool_t
xdr_am_mountstat3(XDR * xdrs,am_mountstat3 * objp)921 xdr_am_mountstat3(XDR *xdrs, am_mountstat3 *objp)
922 {
923 enum_t local_obj = *objp;
924
925 if (amuDebug(D_XDRTRACE))
926 plog(XLOG_DEBUG, "xdr_am_mountstat3:");
927
928 if (!xdr_enum(xdrs, &local_obj))
929 return (FALSE);
930 return (TRUE);
931 }
932
933
934 bool_t
xdr_am_mountres3_ok(XDR * xdrs,am_mountres3_ok * objp)935 xdr_am_mountres3_ok(XDR *xdrs, am_mountres3_ok *objp)
936 {
937 if (amuDebug(D_XDRTRACE))
938 plog(XLOG_DEBUG, "xdr_am_mountres3_ok:");
939
940 if (!xdr_am_fhandle3(xdrs, &objp->fhandle))
941 return (FALSE);
942 if (!xdr_array(xdrs,
943 (char **) ((voidp) &objp->auth_flavors.auth_flavors_val),
944 (u_int *) &objp->auth_flavors.auth_flavors_len,
945 ~0,
946 sizeof(int),
947 (XDRPROC_T_TYPE) xdr_int))
948 return (FALSE);
949 return (TRUE);
950 }
951
952 bool_t
xdr_am_mountres3(XDR * xdrs,am_mountres3 * objp)953 xdr_am_mountres3(XDR *xdrs, am_mountres3 *objp)
954 {
955 if (amuDebug(D_XDRTRACE))
956 plog(XLOG_DEBUG, "xdr_am_mountres3:");
957
958 if (!xdr_am_mountstat3(xdrs, &objp->fhs_status))
959 return (FALSE);
960
961 if (objp->fhs_status == AM_MNT3_OK) {
962 if (!xdr_am_mountres3_ok(xdrs, &objp->mountres3_u.mountinfo))
963 return (FALSE);
964 }
965 return (TRUE);
966 }
967
968 bool_t
xdr_am_cookieverf3(XDR * xdrs,am_cookieverf3 objp)969 xdr_am_cookieverf3(XDR *xdrs, am_cookieverf3 objp)
970 {
971 if (amuDebug(D_XDRTRACE))
972 plog(XLOG_DEBUG, "xdr_am_cookieverf3:");
973
974 if (!xdr_opaque(xdrs, objp, AM_NFS3_COOKIEVERFSIZE))
975 return FALSE;
976 return TRUE;
977 }
978
979 /*
980 * Not ideal, xdr_u_int64_t() is not defined in Linux glibc RPC
981 * but xdr_u_quad_t() is. But in libtirpc xdr_u_quad_t() is not
982 * defined and xdr_u_int64_t() is. So xdr_u_int64_t() is probably
983 * an expected standard xdr function so, if it isn't defined use
984 * an internal xdr_u_int64_t() that uses xdr_u_quad_t().
985 */
986 #ifndef HAVE_XDR_U_INT64_T
987 #define xdr_u_int64_t(xdrs, objp) xdr_u_quad_t(xdrs, objp)
988 #endif /* HAVE_XDR_U_INT64_T */
989
990 bool_t
xdr_uint64(XDR * xdrs,uint64 * objp)991 xdr_uint64(XDR *xdrs, uint64 *objp)
992 {
993 if (amuDebug(D_XDRTRACE))
994 plog(XLOG_DEBUG, "xdr_uint64:");
995
996 if (!xdr_u_int64_t(xdrs, objp))
997 return FALSE;
998 return TRUE;
999 }
1000
1001 bool_t
xdr_am_cookie3(XDR * xdrs,am_cookie3 * objp)1002 xdr_am_cookie3(XDR *xdrs, am_cookie3 *objp)
1003 {
1004 if (amuDebug(D_XDRTRACE))
1005 plog(XLOG_DEBUG, "xdr_am_cookie3:");
1006
1007 if (!xdr_uint64(xdrs, objp))
1008 return FALSE;
1009 return TRUE;
1010 }
1011
1012 bool_t
xdr_am_nfs_fh3(XDR * xdrs,am_nfs_fh3 * objp)1013 xdr_am_nfs_fh3(XDR *xdrs, am_nfs_fh3 *objp)
1014 {
1015 if (amuDebug(D_XDRTRACE))
1016 plog(XLOG_DEBUG, "xdr_am_nfs_fh3:");
1017
1018 if (!xdr_u_int(xdrs, &objp->am_fh3_length))
1019 return (FALSE);
1020 if (objp->am_fh3_length > AM_FHSIZE3)
1021 return (FALSE);
1022 if (!xdr_opaque(xdrs, objp->am_fh3_data, objp->am_fh3_length))
1023 return (FALSE);
1024 return (TRUE);
1025 }
1026
1027 bool_t
xdr_am_nfsstat3(XDR * xdrs,am_nfsstat3 * objp)1028 xdr_am_nfsstat3(XDR *xdrs, am_nfsstat3 *objp)
1029 {
1030 if (amuDebug(D_XDRTRACE))
1031 plog(XLOG_DEBUG, "xdr_am_nfsstat3:");
1032
1033 if (!xdr_enum(xdrs, (enum_t *)objp))
1034 return (FALSE);
1035 return (TRUE);
1036 }
1037
1038 bool_t
xdr_am_diropargs3(XDR * xdrs,am_diropargs3 * objp)1039 xdr_am_diropargs3(XDR *xdrs, am_diropargs3 *objp)
1040 {
1041 if (amuDebug(D_XDRTRACE))
1042 plog(XLOG_DEBUG, "xdr_am_diropargs3:");
1043
1044 if (!xdr_am_nfs_fh3(xdrs, &objp->dir))
1045 return (FALSE);
1046 if (!xdr_am_filename3(xdrs, &objp->name))
1047 return (FALSE);
1048 return (TRUE);
1049 }
1050
1051 bool_t
xdr_am_filename3(XDR * xdrs,am_filename3 * objp)1052 xdr_am_filename3(XDR *xdrs, am_filename3 *objp)
1053 {
1054 if (amuDebug(D_XDRTRACE))
1055 plog(XLOG_DEBUG, "xdr_am_filename3:");
1056
1057 if (!xdr_string(xdrs, objp, ~0))
1058 return (FALSE);
1059 return (TRUE);
1060 }
1061
1062 bool_t
xdr_am_ftype3(XDR * xdrs,am_ftype3 * objp)1063 xdr_am_ftype3(XDR *xdrs, am_ftype3 *objp)
1064 {
1065 if (amuDebug(D_XDRTRACE))
1066 plog(XLOG_DEBUG, "xdr_am_ftype3:");
1067
1068 if (!xdr_enum(xdrs, (enum_t *) objp))
1069 return FALSE;
1070 return TRUE;
1071 }
1072
1073 bool_t
xdr_am_mode3(XDR * xdrs,am_mode3 * objp)1074 xdr_am_mode3(XDR *xdrs, am_mode3 *objp)
1075 {
1076 if (amuDebug(D_XDRTRACE))
1077 plog(XLOG_DEBUG, "xdr_am_mode3:");
1078
1079 if (!xdr_u_int(xdrs, objp))
1080 return FALSE;
1081 return TRUE;
1082 }
1083
1084 bool_t
xdr_am_uid3(XDR * xdrs,am_uid3 * objp)1085 xdr_am_uid3(XDR *xdrs, am_uid3 *objp)
1086 {
1087 if (amuDebug(D_XDRTRACE))
1088 plog(XLOG_DEBUG, "xdr_am_uid3:");
1089
1090 if (!xdr_u_int(xdrs, objp))
1091 return FALSE;
1092 return TRUE;
1093 }
1094
1095 bool_t
xdr_am_gid3(XDR * xdrs,am_gid3 * objp)1096 xdr_am_gid3(XDR *xdrs, am_gid3 *objp)
1097 {
1098 if (amuDebug(D_XDRTRACE))
1099 plog(XLOG_DEBUG, "xdr_am_gid3:");
1100
1101 if (!xdr_u_int(xdrs, objp))
1102 return FALSE;
1103 return TRUE;
1104 }
1105
1106 bool_t
xdr_am_size3(XDR * xdrs,am_size3 * objp)1107 xdr_am_size3(XDR *xdrs, am_size3 *objp)
1108 {
1109 if (amuDebug(D_XDRTRACE))
1110 plog(XLOG_DEBUG, "xdr_am_size3:");
1111
1112 if (!xdr_uint64(xdrs, objp))
1113 return FALSE;
1114 return TRUE;
1115 }
1116
1117 bool_t
xdr_am_fileid3(XDR * xdrs,am_fileid3 * objp)1118 xdr_am_fileid3(XDR *xdrs, am_fileid3 *objp)
1119 {
1120 if (amuDebug(D_XDRTRACE))
1121 plog(XLOG_DEBUG, "xdr_am_fileid3:");
1122
1123 if (!xdr_uint64(xdrs, objp))
1124 return FALSE;
1125 return TRUE;
1126 }
1127
1128 bool_t
xdr_am_specdata3(XDR * xdrs,am_specdata3 * objp)1129 xdr_am_specdata3(XDR *xdrs, am_specdata3 *objp)
1130 {
1131 if (amuDebug(D_XDRTRACE))
1132 plog(XLOG_DEBUG, "xdr_am_specdata3:");
1133
1134 if (!xdr_u_int(xdrs, &objp->specdata1))
1135 return FALSE;
1136 if (!xdr_u_int(xdrs, &objp->specdata2))
1137 return FALSE;
1138 return TRUE;
1139 }
1140
1141 bool_t
xdr_am_nfstime3(XDR * xdrs,am_nfstime3 * objp)1142 xdr_am_nfstime3(XDR *xdrs, am_nfstime3 *objp)
1143 {
1144 if (amuDebug(D_XDRTRACE))
1145 plog(XLOG_DEBUG, "xdr_am_nfstime3:");
1146
1147 if (!xdr_u_int(xdrs, &objp->seconds))
1148 return FALSE;
1149 if (!xdr_u_int(xdrs, &objp->nseconds))
1150 return FALSE;
1151 return TRUE;
1152 }
1153
1154 bool_t
xdr_am_fattr3(XDR * xdrs,am_fattr3 * objp)1155 xdr_am_fattr3(XDR *xdrs, am_fattr3 *objp)
1156 {
1157 if (amuDebug(D_XDRTRACE))
1158 plog(XLOG_DEBUG, "xdr_am_fattr3:");
1159
1160 if (!xdr_am_ftype3(xdrs, &objp->type))
1161 return FALSE;
1162 if (!xdr_am_mode3(xdrs, &objp->mode))
1163 return FALSE;
1164 if (!xdr_u_int(xdrs, &objp->nlink))
1165 return FALSE;
1166 if (!xdr_am_uid3(xdrs, &objp->uid))
1167 return FALSE;
1168 if (!xdr_am_gid3(xdrs, &objp->gid))
1169 return FALSE;
1170 if (!xdr_am_size3(xdrs, &objp->size))
1171 return FALSE;
1172 if (!xdr_am_size3(xdrs, &objp->used))
1173 return FALSE;
1174 if (!xdr_am_specdata3(xdrs, &objp->rdev))
1175 return FALSE;
1176 if (!xdr_uint64(xdrs, &objp->fsid))
1177 return FALSE;
1178 if (!xdr_am_fileid3(xdrs, &objp->fileid))
1179 return FALSE;
1180 if (!xdr_am_nfstime3(xdrs, &objp->atime))
1181 return FALSE;
1182 if (!xdr_am_nfstime3(xdrs, &objp->mtime))
1183 return FALSE;
1184 if (!xdr_am_nfstime3(xdrs, &objp->ctime))
1185 return FALSE;
1186 return TRUE;
1187 }
1188
1189 bool_t
xdr_am_post_op_attr(XDR * xdrs,am_post_op_attr * objp)1190 xdr_am_post_op_attr(XDR *xdrs, am_post_op_attr *objp)
1191 {
1192 if (amuDebug(D_XDRTRACE))
1193 plog(XLOG_DEBUG, "xdr_am_post_op_attr:");
1194
1195 if (!xdr_bool(xdrs, &objp->attributes_follow))
1196 return FALSE;
1197 switch (objp->attributes_follow) {
1198 case TRUE:
1199 if (!xdr_am_fattr3(xdrs, &objp->am_post_op_attr_u.attributes))
1200 return FALSE;
1201 break;
1202 case FALSE:
1203 break;
1204 default:
1205 return FALSE;
1206 }
1207 return TRUE;
1208 }
1209
1210 bool_t
xdr_am_stable_how(XDR * xdrs,am_stable_how * objp)1211 xdr_am_stable_how(XDR *xdrs, am_stable_how *objp)
1212 {
1213 if (amuDebug(D_XDRTRACE))
1214 plog(XLOG_DEBUG, "xdr_am_stable_how:");
1215
1216 if (!xdr_enum(xdrs, (enum_t *) objp))
1217 return FALSE;
1218 return TRUE;
1219 }
1220
1221 bool_t
xdr_am_offset3(XDR * xdrs,am_offset3 * objp)1222 xdr_am_offset3(XDR *xdrs, am_offset3 *objp)
1223 {
1224 if (amuDebug(D_XDRTRACE))
1225 plog(XLOG_DEBUG, "xdr_am_offset3:");
1226
1227 if (!xdr_uint64(xdrs, objp))
1228 return FALSE;
1229 return TRUE;
1230 }
1231
1232 bool_t
xdr_am_count3(XDR * xdrs,am_count3 * objp)1233 xdr_am_count3(XDR *xdrs, am_count3 *objp)
1234 {
1235 if (amuDebug(D_XDRTRACE))
1236 plog(XLOG_DEBUG, "xdr_am_count3:");
1237
1238 if (!xdr_u_int(xdrs, objp))
1239 return FALSE;
1240 return TRUE;
1241 }
1242
1243 bool_t
xdr_am_wcc_attr(XDR * xdrs,am_wcc_attr * objp)1244 xdr_am_wcc_attr(XDR *xdrs, am_wcc_attr *objp)
1245 {
1246 if (amuDebug(D_XDRTRACE))
1247 plog(XLOG_DEBUG, "xdr_am_wcc_attr:");
1248
1249 if (!xdr_am_size3(xdrs, &objp->size))
1250 return FALSE;
1251 if (!xdr_am_nfstime3(xdrs, &objp->mtime))
1252 return FALSE;
1253 if (!xdr_am_nfstime3(xdrs, &objp->ctime))
1254 return FALSE;
1255 return TRUE;
1256 }
1257
1258 bool_t
xdr_am_pre_op_attr(XDR * xdrs,am_pre_op_attr * objp)1259 xdr_am_pre_op_attr(XDR *xdrs, am_pre_op_attr *objp)
1260 {
1261 if (amuDebug(D_XDRTRACE))
1262 plog(XLOG_DEBUG, ":xdr_am_pre_op_attr");
1263
1264 if (!xdr_bool(xdrs, &objp->attributes_follow))
1265 return FALSE;
1266 switch (objp->attributes_follow) {
1267 case TRUE:
1268 if (!xdr_am_wcc_attr(xdrs, &objp->am_pre_op_attr_u.attributes))
1269 return FALSE;
1270 break;
1271 case FALSE:
1272 break;
1273 default:
1274 return FALSE;
1275 }
1276 return TRUE;
1277 }
1278
1279 bool_t
xdr_am_wcc_data(XDR * xdrs,am_wcc_data * objp)1280 xdr_am_wcc_data(XDR *xdrs, am_wcc_data *objp)
1281 {
1282 if (amuDebug(D_XDRTRACE))
1283 plog(XLOG_DEBUG, "xdr_am_wcc_data:");
1284
1285 if (!xdr_am_pre_op_attr(xdrs, &objp->before))
1286 return FALSE;
1287 if (!xdr_am_post_op_attr(xdrs, &objp->after))
1288 return FALSE;
1289 return TRUE;
1290 }
1291
1292 bool_t
xdr_am_WRITE3args(XDR * xdrs,am_WRITE3args * objp)1293 xdr_am_WRITE3args(XDR *xdrs, am_WRITE3args *objp)
1294 {
1295 if (amuDebug(D_XDRTRACE))
1296 plog(XLOG_DEBUG, "xdr_am_WRITE3args:");
1297
1298 if (!xdr_am_nfs_fh3(xdrs, &objp->file))
1299 return FALSE;
1300 if (!xdr_am_offset3(xdrs, &objp->offset))
1301 return FALSE;
1302 if (!xdr_am_count3(xdrs, &objp->count))
1303 return FALSE;
1304 if (!xdr_am_stable_how(xdrs, &objp->stable))
1305 return FALSE;
1306 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val,
1307 (u_int *) &objp->data.data_len, ~0))
1308 return FALSE;
1309 return TRUE;
1310 }
1311
1312 bool_t
xdr_am_writeverf3(XDR * xdrs,am_writeverf3 objp)1313 xdr_am_writeverf3(XDR *xdrs, am_writeverf3 objp)
1314 {
1315 if (amuDebug(D_XDRTRACE))
1316 plog(XLOG_DEBUG, "xdr_am_writeverf3:");
1317
1318 if (!xdr_opaque(xdrs, objp, AM_NFS3_WRITEVERFSIZE))
1319 return FALSE;
1320 return TRUE;
1321 }
1322
1323 bool_t
xdr_am_WRITE3resok(XDR * xdrs,am_WRITE3resok * objp)1324 xdr_am_WRITE3resok(XDR *xdrs, am_WRITE3resok *objp)
1325 {
1326 if (amuDebug(D_XDRTRACE))
1327 plog(XLOG_DEBUG, "xdr_am_WRITE3resok:");
1328
1329 if (!xdr_am_wcc_data(xdrs, &objp->file_wcc))
1330 return FALSE;
1331 if (!xdr_am_count3(xdrs, &objp->count))
1332 return FALSE;
1333 if (!xdr_am_stable_how(xdrs, &objp->committed))
1334 return FALSE;
1335 if (!xdr_am_writeverf3(xdrs, objp->verf))
1336 return FALSE;
1337 return TRUE;
1338 }
1339
1340 bool_t
xdr_am_WRITE3resfail(XDR * xdrs,am_WRITE3resfail * objp)1341 xdr_am_WRITE3resfail(XDR *xdrs, am_WRITE3resfail *objp)
1342 {
1343 if (amuDebug(D_XDRTRACE))
1344 plog(XLOG_DEBUG, "xdr_am_WRITE3resfail:");
1345
1346 if (!xdr_am_wcc_data(xdrs, &objp->file_wcc))
1347 return FALSE;
1348 return TRUE;
1349 }
1350
1351 bool_t
xdr_am_WRITE3res(XDR * xdrs,am_WRITE3res * objp)1352 xdr_am_WRITE3res(XDR *xdrs, am_WRITE3res *objp)
1353 {
1354 if (amuDebug(D_XDRTRACE))
1355 plog(XLOG_DEBUG, "xdr_am_WRITE3res:");
1356
1357 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1358 return FALSE;
1359 switch (objp->status) {
1360 case AM_NFS3_OK:
1361 if (!xdr_am_WRITE3resok(xdrs, &objp->res_u.ok))
1362 return FALSE;
1363 break;
1364 default:
1365 if (!xdr_am_WRITE3resfail(xdrs, &objp->res_u.fail))
1366 return FALSE;
1367 break;
1368 }
1369 return TRUE;
1370 }
1371
1372 bool_t
xdr_am_LOOKUP3args(XDR * xdrs,am_LOOKUP3args * objp)1373 xdr_am_LOOKUP3args(XDR *xdrs, am_LOOKUP3args *objp)
1374 {
1375 if (amuDebug(D_XDRTRACE))
1376 plog(XLOG_DEBUG, "xdr_am_LOOKUP3args:");
1377
1378 if (!xdr_am_diropargs3(xdrs, &objp->what))
1379 return (FALSE);
1380 return (TRUE);
1381 }
1382
1383 bool_t
xdr_am_LOOKUP3res(XDR * xdrs,am_LOOKUP3res * objp)1384 xdr_am_LOOKUP3res(XDR *xdrs, am_LOOKUP3res *objp)
1385 {
1386 if (amuDebug(D_XDRTRACE))
1387 plog(XLOG_DEBUG, "xdr_am_LOOKUP3res:");
1388
1389 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1390 return (FALSE);
1391 switch (objp->status) {
1392 case AM_NFS3_OK:
1393 if (!xdr_am_LOOKUP3resok(xdrs, &objp->res_u.ok))
1394 return (FALSE);
1395 break;
1396 default:
1397 if (!xdr_am_LOOKUP3resfail(xdrs, &objp->res_u.fail))
1398 return (FALSE);
1399 break;
1400 }
1401 return (TRUE);
1402 }
1403
1404 bool_t
xdr_am_LOOKUP3resfail(XDR * xdrs,am_LOOKUP3resfail * objp)1405 xdr_am_LOOKUP3resfail(XDR *xdrs, am_LOOKUP3resfail *objp)
1406 {
1407 if (amuDebug(D_XDRTRACE))
1408 plog(XLOG_DEBUG, "xdr_am_LOOKUP3resfail:");
1409
1410 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
1411 return (FALSE);
1412 return (TRUE);
1413 }
1414
1415 bool_t
xdr_am_LOOKUP3resok(XDR * xdrs,am_LOOKUP3resok * objp)1416 xdr_am_LOOKUP3resok(XDR *xdrs, am_LOOKUP3resok *objp)
1417 {
1418 if (amuDebug(D_XDRTRACE))
1419 plog(XLOG_DEBUG, "xdr_am_LOOKUP3resok:");
1420
1421 if (!xdr_am_nfs_fh3(xdrs, &objp->object))
1422 return (FALSE);
1423 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
1424 return (FALSE);
1425 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
1426 return (FALSE);
1427 return (TRUE);
1428 }
1429
1430 bool_t
xdr_am_COMMIT3args(XDR * xdrs,am_COMMIT3args * objp)1431 xdr_am_COMMIT3args(XDR *xdrs, am_COMMIT3args *objp)
1432 {
1433 if (amuDebug(D_XDRTRACE))
1434 plog(XLOG_DEBUG, "xdr_am_COMMIT3args:");
1435
1436 if (!xdr_am_nfs_fh3(xdrs, &objp->file))
1437 return FALSE;
1438 if (!xdr_am_offset3(xdrs, &objp->offset))
1439 return FALSE;
1440 if (!xdr_am_count3(xdrs, &objp->count))
1441 return FALSE;
1442 return TRUE;
1443 }
1444
1445 bool_t
xdr_am_COMMIT3resok(XDR * xdrs,am_COMMIT3resok * objp)1446 xdr_am_COMMIT3resok(XDR *xdrs, am_COMMIT3resok *objp)
1447 {
1448 if (amuDebug(D_XDRTRACE))
1449 plog(XLOG_DEBUG, "xdr_am_COMMIT3resok:");
1450
1451 if (!xdr_am_wcc_data(xdrs, &objp->file_wcc))
1452 return FALSE;
1453 if (!xdr_am_writeverf3(xdrs, objp->verf))
1454 return FALSE;
1455 return TRUE;
1456 }
1457
1458 bool_t
xdr_am_COMMIT3resfail(XDR * xdrs,am_COMMIT3resfail * objp)1459 xdr_am_COMMIT3resfail(XDR *xdrs, am_COMMIT3resfail *objp)
1460 {
1461 if (amuDebug(D_XDRTRACE))
1462 plog(XLOG_DEBUG, "xdr_am_COMMIT3resfail:");
1463
1464 if (!xdr_am_wcc_data(xdrs, &objp->file_wcc))
1465 return FALSE;
1466 return TRUE;
1467 }
1468
1469 bool_t
xdr_am_COMMIT3res(XDR * xdrs,am_COMMIT3res * objp)1470 xdr_am_COMMIT3res(XDR *xdrs, am_COMMIT3res *objp)
1471 {
1472 if (amuDebug(D_XDRTRACE))
1473 plog(XLOG_DEBUG, "xdr_am_COMMIT3res:");
1474
1475 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1476 return FALSE;
1477 switch (objp->status) {
1478 case AM_NFS3_OK:
1479 if (!xdr_am_COMMIT3resok(xdrs, &objp->res_u.ok))
1480 return FALSE;
1481 break;
1482 default:
1483 if (!xdr_am_COMMIT3resfail(xdrs, &objp->res_u.fail))
1484 return FALSE;
1485 break;
1486 }
1487 return TRUE;
1488 }
1489
1490 bool_t
xdr_am_ACCESS3args(XDR * xdrs,am_ACCESS3args * objp)1491 xdr_am_ACCESS3args(XDR *xdrs, am_ACCESS3args *objp)
1492 {
1493 if (amuDebug(D_XDRTRACE))
1494 plog(XLOG_DEBUG, "xdr_am_ACCESS3args:");
1495
1496 if (!xdr_am_nfs_fh3(xdrs, &objp->object))
1497 return FALSE;
1498 if (!xdr_u_int(xdrs, &objp->access))
1499 return FALSE;
1500 return TRUE;
1501 }
1502
1503 bool_t
xdr_am_ACCESS3resok(XDR * xdrs,am_ACCESS3resok * objp)1504 xdr_am_ACCESS3resok(XDR *xdrs, am_ACCESS3resok *objp)
1505 {
1506 if (amuDebug(D_XDRTRACE))
1507 plog(XLOG_DEBUG, "xdr_am_ACCESS3resok:");
1508
1509 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
1510 return FALSE;
1511 if (!xdr_u_int(xdrs, &objp->access))
1512 return FALSE;
1513 return TRUE;
1514 }
1515
1516 bool_t
xdr_am_ACCESS3resfail(XDR * xdrs,am_ACCESS3resfail * objp)1517 xdr_am_ACCESS3resfail(XDR *xdrs, am_ACCESS3resfail *objp)
1518 {
1519 if (amuDebug(D_XDRTRACE))
1520 plog(XLOG_DEBUG, "xdr_am_ACCESS3resfail:");
1521
1522 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
1523 return FALSE;
1524 return TRUE;
1525 }
1526
1527 bool_t
xdr_am_ACCESS3res(XDR * xdrs,am_ACCESS3res * objp)1528 xdr_am_ACCESS3res(XDR *xdrs, am_ACCESS3res *objp)
1529 {
1530 if (amuDebug(D_XDRTRACE))
1531 plog(XLOG_DEBUG, "xdr_am_ACCESS3res:");
1532
1533 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1534 return FALSE;
1535 switch (objp->status) {
1536 case AM_NFS3_OK:
1537 if (!xdr_am_ACCESS3resok(xdrs, &objp->res_u.ok))
1538 return FALSE;
1539 break;
1540 default:
1541 if (!xdr_am_ACCESS3resfail(xdrs, &objp->res_u.fail))
1542 return FALSE;
1543 break;
1544 }
1545 return TRUE;
1546 }
1547
1548 bool_t
xdr_am_GETATTR3args(XDR * xdrs,am_GETATTR3args * objp)1549 xdr_am_GETATTR3args(XDR *xdrs, am_GETATTR3args *objp)
1550 {
1551 if (amuDebug(D_XDRTRACE))
1552 plog(XLOG_DEBUG, "xdr_am_GETATTR3args:");
1553
1554 if (!xdr_am_nfs_fh3(xdrs, &objp->object))
1555 return FALSE;
1556 return TRUE;
1557 }
1558
1559 bool_t
xdr_am_GETATTR3resok(XDR * xdrs,am_GETATTR3resok * objp)1560 xdr_am_GETATTR3resok(XDR *xdrs, am_GETATTR3resok *objp)
1561 {
1562 if (amuDebug(D_XDRTRACE))
1563 plog(XLOG_DEBUG, "xdr_am_GETATTR3resok:");
1564
1565 if (!xdr_am_fattr3(xdrs, &objp->obj_attributes))
1566 return FALSE;
1567 return TRUE;
1568 }
1569
1570 bool_t
xdr_am_GETATTR3res(XDR * xdrs,am_GETATTR3res * objp)1571 xdr_am_GETATTR3res(XDR *xdrs, am_GETATTR3res *objp)
1572 {
1573 if (amuDebug(D_XDRTRACE))
1574 plog(XLOG_DEBUG, "xdr_am_GETATTR3res:");
1575
1576 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1577 return FALSE;
1578 switch (objp->status) {
1579 case AM_NFS3_OK:
1580 if (!xdr_am_GETATTR3resok(xdrs, &objp->res_u.ok))
1581 return FALSE;
1582 break;
1583 default:
1584 break;
1585 }
1586 return TRUE;
1587 }
1588
1589 bool_t
xdr_am_time_how(XDR * xdrs,am_time_how * objp)1590 xdr_am_time_how(XDR *xdrs, am_time_how *objp)
1591 {
1592 if (amuDebug(D_XDRTRACE))
1593 plog(XLOG_DEBUG, "xdr_am_time_how:");
1594
1595 if (!xdr_enum(xdrs, (enum_t *) objp))
1596 return FALSE;
1597 return TRUE;
1598 }
1599
1600 bool_t
xdr_am_set_mode3(XDR * xdrs,am_set_mode3 * objp)1601 xdr_am_set_mode3(XDR *xdrs, am_set_mode3 *objp)
1602 {
1603 if (amuDebug(D_XDRTRACE))
1604 plog(XLOG_DEBUG, "xdr_am_set_mode3:");
1605
1606 if (!xdr_bool(xdrs, &objp->set_it))
1607 return FALSE;
1608 switch (objp->set_it) {
1609 case TRUE:
1610 if (!xdr_am_mode3(xdrs, &objp->am_set_mode3_u.mode))
1611 return FALSE;
1612 break;
1613 default:
1614 break;
1615 }
1616 return TRUE;
1617 }
1618
1619 bool_t
xdr_am_set_uid3(XDR * xdrs,am_set_uid3 * objp)1620 xdr_am_set_uid3(XDR *xdrs, am_set_uid3 *objp)
1621 {
1622 if (amuDebug(D_XDRTRACE))
1623 plog(XLOG_DEBUG, "xdr_am_set_uid3:");
1624
1625 if (!xdr_bool(xdrs, &objp->set_it))
1626 return FALSE;
1627 switch (objp->set_it) {
1628 case TRUE:
1629 if (!xdr_am_uid3(xdrs, &objp->am_set_uid3_u.uid))
1630 return FALSE;
1631 break;
1632 default:
1633 break;
1634 }
1635 return TRUE;
1636 }
1637
1638 bool_t
xdr_am_set_gid3(XDR * xdrs,am_set_gid3 * objp)1639 xdr_am_set_gid3(XDR *xdrs, am_set_gid3 *objp)
1640 {
1641 if (amuDebug(D_XDRTRACE))
1642 plog(XLOG_DEBUG, "xdr_am_set_gid3:");
1643
1644 if (!xdr_bool(xdrs, &objp->set_it))
1645 return FALSE;
1646 switch (objp->set_it) {
1647 case TRUE:
1648 if (!xdr_am_gid3(xdrs, &objp->am_set_gid3_u.gid))
1649 return FALSE;
1650 break;
1651 default:
1652 break;
1653 }
1654 return TRUE;
1655 }
1656
1657 bool_t
xdr_am_set_size3(XDR * xdrs,am_set_size3 * objp)1658 xdr_am_set_size3(XDR *xdrs, am_set_size3 *objp)
1659 {
1660 if (amuDebug(D_XDRTRACE))
1661 plog(XLOG_DEBUG, "xdr_am_set_size3:");
1662
1663 if (!xdr_bool(xdrs, &objp->set_it))
1664 return FALSE;
1665 switch (objp->set_it) {
1666 case TRUE:
1667 if (!xdr_am_size3(xdrs, &objp->am_set_size3_u.size))
1668 return FALSE;
1669 break;
1670 default:
1671 break;
1672 }
1673 return TRUE;
1674 }
1675
1676 bool_t
xdr_am_set_atime(XDR * xdrs,am_set_atime * objp)1677 xdr_am_set_atime(XDR *xdrs, am_set_atime *objp)
1678 {
1679 if (amuDebug(D_XDRTRACE))
1680 plog(XLOG_DEBUG, "xdr_am_set_atime:");
1681
1682 if (!xdr_am_time_how(xdrs, &objp->set_it))
1683 return FALSE;
1684 switch (objp->set_it) {
1685 case AM_SET_TO_CLIENT_TIME:
1686 if (!xdr_am_nfstime3(xdrs, &objp->am_set_atime_u.atime))
1687 return FALSE;
1688 break;
1689 default:
1690 break;
1691 }
1692 return TRUE;
1693 }
1694
1695 bool_t
xdr_am_set_mtime(XDR * xdrs,am_set_mtime * objp)1696 xdr_am_set_mtime(XDR *xdrs, am_set_mtime *objp)
1697 {
1698 if (amuDebug(D_XDRTRACE))
1699 plog(XLOG_DEBUG, "xdr_am_set_mtime:");
1700
1701 if (!xdr_am_time_how(xdrs, &objp->set_it))
1702 return FALSE;
1703 switch (objp->set_it) {
1704 case AM_SET_TO_CLIENT_TIME:
1705 if (!xdr_am_nfstime3(xdrs, &objp->am_set_mtime_u.mtime))
1706 return FALSE;
1707 break;
1708 default:
1709 break;
1710 }
1711 return TRUE;
1712 }
1713
1714 bool_t
xdr_am_sattr3(XDR * xdrs,am_sattr3 * objp)1715 xdr_am_sattr3(XDR *xdrs, am_sattr3 *objp)
1716 {
1717 if (amuDebug(D_XDRTRACE))
1718 plog(XLOG_DEBUG, "xdr_am_sattr3:");
1719
1720 if (!xdr_am_set_mode3(xdrs, &objp->mode))
1721 return FALSE;
1722 if (!xdr_am_set_uid3(xdrs, &objp->uid))
1723 return FALSE;
1724 if (!xdr_am_set_gid3(xdrs, &objp->gid))
1725 return FALSE;
1726 if (!xdr_am_set_size3(xdrs, &objp->size))
1727 return FALSE;
1728 if (!xdr_am_set_atime(xdrs, &objp->atime))
1729 return FALSE;
1730 if (!xdr_am_set_mtime(xdrs, &objp->mtime))
1731 return FALSE;
1732 return TRUE;
1733 }
1734
1735 bool_t
xdr_am_createmode3(XDR * xdrs,am_createmode3 * objp)1736 xdr_am_createmode3(XDR *xdrs, am_createmode3 *objp)
1737 {
1738 if (amuDebug(D_XDRTRACE))
1739 plog(XLOG_DEBUG, "xdr_am_createmode3:");
1740
1741 if (!xdr_enum(xdrs, (enum_t *) objp))
1742 return FALSE;
1743 return TRUE;
1744 }
1745
1746 bool_t
xdr_am_createverf3(XDR * xdrs,am_createverf3 objp)1747 xdr_am_createverf3(XDR *xdrs, am_createverf3 objp)
1748 {
1749 if (amuDebug(D_XDRTRACE))
1750 plog(XLOG_DEBUG, "xdr_am_createverf3:");
1751
1752 if (!xdr_opaque(xdrs, objp, AM_NFS3_CREATEVERFSIZE))
1753 return FALSE;
1754 return TRUE;
1755 }
1756
1757 bool_t
xdr_am_createhow3(XDR * xdrs,am_createhow3 * objp)1758 xdr_am_createhow3(XDR *xdrs, am_createhow3 *objp)
1759 {
1760 if (amuDebug(D_XDRTRACE))
1761 plog(XLOG_DEBUG, "xdr_am_createhow3:");
1762
1763 if (!xdr_am_createmode3(xdrs, &objp->mode))
1764 return FALSE;
1765 switch (objp->mode) {
1766 case AM_UNCHECKED:
1767 if (!xdr_am_sattr3(xdrs, &objp->am_createhow3_u.obj_attributes))
1768 return FALSE;
1769 break;
1770 case AM_GUARDED:
1771 if (!xdr_am_sattr3(xdrs, &objp->am_createhow3_u.g_obj_attributes))
1772 return FALSE;
1773 break;
1774 case AM_EXCLUSIVE:
1775 if (!xdr_am_createverf3(xdrs, objp->am_createhow3_u.verf))
1776 return FALSE;
1777 break;
1778 default:
1779 return FALSE;
1780 }
1781 return TRUE;
1782 }
1783
1784 bool_t
xdr_am_CREATE3args(XDR * xdrs,am_CREATE3args * objp)1785 xdr_am_CREATE3args(XDR *xdrs, am_CREATE3args *objp)
1786 {
1787 if (amuDebug(D_XDRTRACE))
1788 plog(XLOG_DEBUG, "xdr_am_CREATE3args:");
1789
1790 if (!xdr_am_diropargs3(xdrs, &objp->where))
1791 return FALSE;
1792 if (!xdr_am_createhow3(xdrs, &objp->how))
1793 return FALSE;
1794 return TRUE;
1795 }
1796
1797 bool_t
xdr_am_post_op_fh3(XDR * xdrs,am_post_op_fh3 * objp)1798 xdr_am_post_op_fh3(XDR *xdrs, am_post_op_fh3 *objp)
1799 {
1800 if (amuDebug(D_XDRTRACE))
1801 plog(XLOG_DEBUG, "xdr_am_post_op_fh3:");
1802
1803 if (!xdr_bool(xdrs, &objp->handle_follows))
1804 return FALSE;
1805 switch (objp->handle_follows) {
1806 case TRUE:
1807 if (!xdr_am_nfs_fh3(xdrs, &objp->am_post_op_fh3_u.handle))
1808 return FALSE;
1809 break;
1810 case FALSE:
1811 break;
1812 default:
1813 return FALSE;
1814 }
1815 return TRUE;
1816 }
1817
1818 bool_t
xdr_am_CREATE3resok(XDR * xdrs,am_CREATE3resok * objp)1819 xdr_am_CREATE3resok(XDR *xdrs, am_CREATE3resok *objp)
1820 {
1821 if (amuDebug(D_XDRTRACE))
1822 plog(XLOG_DEBUG, "xdr_am_CREATE3resok:");
1823
1824 if (!xdr_am_post_op_fh3(xdrs, &objp->obj))
1825 return FALSE;
1826 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
1827 return FALSE;
1828 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
1829 return FALSE;
1830 return TRUE;
1831 }
1832
1833 bool_t
xdr_am_CREATE3resfail(XDR * xdrs,am_CREATE3resfail * objp)1834 xdr_am_CREATE3resfail(XDR *xdrs, am_CREATE3resfail *objp)
1835 {
1836 if (amuDebug(D_XDRTRACE))
1837 plog(XLOG_DEBUG, "xdr_am_CREATE3resfail:");
1838
1839 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
1840 return FALSE;
1841 return TRUE;
1842 }
1843
1844 bool_t
xdr_am_CREATE3res(XDR * xdrs,am_CREATE3res * objp)1845 xdr_am_CREATE3res(XDR *xdrs, am_CREATE3res *objp)
1846 {
1847 if (amuDebug(D_XDRTRACE))
1848 plog(XLOG_DEBUG, "xdr_am_CREATE3res:");
1849
1850 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1851 return FALSE;
1852 switch (objp->status) {
1853 case AM_NFS3_OK:
1854 if (!xdr_am_CREATE3resok(xdrs, &objp->res_u.ok))
1855 return FALSE;
1856 break;
1857 default:
1858 if (!xdr_am_CREATE3resfail(xdrs, &objp->res_u.fail))
1859 return FALSE;
1860 break;
1861 }
1862 return TRUE;
1863 }
1864
1865 bool_t
xdr_am_REMOVE3args(XDR * xdrs,am_REMOVE3args * objp)1866 xdr_am_REMOVE3args(XDR *xdrs, am_REMOVE3args *objp)
1867 {
1868 if (amuDebug(D_XDRTRACE))
1869 plog(XLOG_DEBUG, "xdr_am_REMOVE3args:");
1870
1871 if (!xdr_am_diropargs3(xdrs, &objp->object))
1872 return FALSE;
1873 return TRUE;
1874 }
1875
1876 bool_t
xdr_am_REMOVE3resok(XDR * xdrs,am_REMOVE3resok * objp)1877 xdr_am_REMOVE3resok(XDR *xdrs, am_REMOVE3resok *objp)
1878 {
1879 if (amuDebug(D_XDRTRACE))
1880 plog(XLOG_DEBUG, "xdr_am_REMOVE3resok:");
1881
1882 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
1883 return FALSE;
1884 return TRUE;
1885 }
1886
1887 bool_t
xdr_am_REMOVE3resfail(XDR * xdrs,am_REMOVE3resfail * objp)1888 xdr_am_REMOVE3resfail(XDR *xdrs, am_REMOVE3resfail *objp)
1889 {
1890 if (amuDebug(D_XDRTRACE))
1891 plog(XLOG_DEBUG, "xdr_am_REMOVE3resfail:");
1892
1893 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
1894 return FALSE;
1895 return TRUE;
1896 }
1897
1898 bool_t
xdr_am_REMOVE3res(XDR * xdrs,am_REMOVE3res * objp)1899 xdr_am_REMOVE3res(XDR *xdrs, am_REMOVE3res *objp)
1900 {
1901 if (amuDebug(D_XDRTRACE))
1902 plog(XLOG_DEBUG, "xdr_am_REMOVE3res:");
1903
1904 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1905 return FALSE;
1906 switch (objp->status) {
1907 case AM_NFS3_OK:
1908 if (!xdr_am_REMOVE3resok(xdrs, &objp->res_u.ok))
1909 return FALSE;
1910 break;
1911 default:
1912 if (!xdr_am_REMOVE3resfail(xdrs, &objp->res_u.fail))
1913 return FALSE;
1914 break;
1915 }
1916 return TRUE;
1917 }
1918
1919 bool_t
xdr_am_READ3args(XDR * xdrs,am_READ3args * objp)1920 xdr_am_READ3args(XDR *xdrs, am_READ3args *objp)
1921 {
1922 if (amuDebug(D_XDRTRACE))
1923 plog(XLOG_DEBUG, "xdr_am_READ3args:");
1924
1925 if (!xdr_am_nfs_fh3(xdrs, &objp->file))
1926 return FALSE;
1927 if (!xdr_am_offset3(xdrs, &objp->offset))
1928 return FALSE;
1929 if (!xdr_am_count3(xdrs, &objp->count))
1930 return FALSE;
1931 return TRUE;
1932 }
1933
1934 bool_t
xdr_am_READ3resok(XDR * xdrs,am_READ3resok * objp)1935 xdr_am_READ3resok(XDR *xdrs, am_READ3resok *objp)
1936 {
1937 if (amuDebug(D_XDRTRACE))
1938 plog(XLOG_DEBUG, "xdr_am_READ3resok:");
1939
1940 if (!xdr_am_post_op_attr(xdrs, &objp->file_attributes))
1941 return FALSE;
1942 if (!xdr_am_count3(xdrs, &objp->count))
1943 return FALSE;
1944 if (!xdr_bool(xdrs, &objp->eof))
1945 return FALSE;
1946 if (!xdr_bytes(xdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
1947 return FALSE;
1948 return TRUE;
1949 }
1950
1951 bool_t
xdr_am_READ3resfail(XDR * xdrs,am_READ3resfail * objp)1952 xdr_am_READ3resfail(XDR *xdrs, am_READ3resfail *objp)
1953 {
1954 if (amuDebug(D_XDRTRACE))
1955 plog(XLOG_DEBUG, "xdr_am_READ3resfail:");
1956
1957 if (!xdr_am_post_op_attr(xdrs, &objp->file_attributes))
1958 return FALSE;
1959 return TRUE;
1960 }
1961
1962 bool_t
xdr_am_READ3res(XDR * xdrs,am_READ3res * objp)1963 xdr_am_READ3res(XDR *xdrs, am_READ3res *objp)
1964 {
1965 if (amuDebug(D_XDRTRACE))
1966 plog(XLOG_DEBUG, "xdr_am_READ3res:");
1967
1968 if (!xdr_am_nfsstat3(xdrs, &objp->status))
1969 return FALSE;
1970 switch (objp->status) {
1971 case AM_NFS3_OK:
1972 if (!xdr_am_READ3resok(xdrs, &objp->res_u.ok))
1973 return FALSE;
1974 break;
1975 default:
1976 if (!xdr_am_READ3resfail(xdrs, &objp->res_u.fail))
1977 return FALSE;
1978 break;
1979 }
1980 return TRUE;
1981 }
1982
1983 bool_t
xdr_am_FSINFO3args(XDR * xdrs,am_FSINFO3args * objp)1984 xdr_am_FSINFO3args(XDR *xdrs, am_FSINFO3args *objp)
1985 {
1986 if (amuDebug(D_XDRTRACE))
1987 plog(XLOG_DEBUG, "xdr_am_FSINFO3args:");
1988
1989 if (!xdr_am_nfs_fh3(xdrs, &objp->fsroot))
1990 return FALSE;
1991 return TRUE;
1992 }
1993
1994 bool_t
xdr_am_FSINFO3resok(XDR * xdrs,am_FSINFO3resok * objp)1995 xdr_am_FSINFO3resok(XDR *xdrs, am_FSINFO3resok *objp)
1996 {
1997 register int32_t *buf;
1998
1999 if (amuDebug(D_XDRTRACE))
2000 plog(XLOG_DEBUG, "xdr_am_FSINFO3resok:");
2001
2002 if (xdrs->x_op == XDR_ENCODE) {
2003 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2004 return FALSE;
2005 buf = XDR_INLINE(xdrs, 7 * BYTES_PER_XDR_UNIT);
2006 if (buf == NULL) {
2007 if (!xdr_u_int(xdrs, &objp->rtmax))
2008 return FALSE;
2009 if (!xdr_u_int(xdrs, &objp->rtpref))
2010 return FALSE;
2011 if (!xdr_u_int(xdrs, &objp->rtmult))
2012 return FALSE;
2013 if (!xdr_u_int(xdrs, &objp->wtmax))
2014 return FALSE;
2015 if (!xdr_u_int(xdrs, &objp->wtpref))
2016 return FALSE;
2017 if (!xdr_u_int(xdrs, &objp->wtmult))
2018 return FALSE;
2019 if (!xdr_u_int(xdrs, &objp->dtpref))
2020 return FALSE;
2021 } else {
2022 IXDR_PUT_U_LONG(buf, objp->rtmax);
2023 IXDR_PUT_U_LONG(buf, objp->rtpref);
2024 IXDR_PUT_U_LONG(buf, objp->rtmult);
2025 IXDR_PUT_U_LONG(buf, objp->wtmax);
2026 IXDR_PUT_U_LONG(buf, objp->wtpref);
2027 IXDR_PUT_U_LONG(buf, objp->wtmult);
2028 IXDR_PUT_U_LONG(buf, objp->dtpref);
2029 }
2030 if (!xdr_am_size3(xdrs, &objp->maxfilesize))
2031 return FALSE;
2032 if (!xdr_am_nfstime3(xdrs, &objp->time_delta))
2033 return FALSE;
2034 if (!xdr_u_int(xdrs, &objp->properties))
2035 return FALSE;
2036 return TRUE;
2037 } else if (xdrs->x_op == XDR_DECODE) {
2038 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2039 return FALSE;
2040 buf = XDR_INLINE(xdrs, 7 * BYTES_PER_XDR_UNIT);
2041 if (buf == NULL) {
2042 if (!xdr_u_int (xdrs, &objp->rtmax))
2043 return FALSE;
2044 if (!xdr_u_int (xdrs, &objp->rtpref))
2045 return FALSE;
2046 if (!xdr_u_int (xdrs, &objp->rtmult))
2047 return FALSE;
2048 if (!xdr_u_int (xdrs, &objp->wtmax))
2049 return FALSE;
2050 if (!xdr_u_int(xdrs, &objp->wtpref))
2051 return FALSE;
2052 if (!xdr_u_int(xdrs, &objp->wtmult))
2053 return FALSE;
2054 if (!xdr_u_int(xdrs, &objp->dtpref))
2055 return FALSE;
2056 } else {
2057 objp->rtmax = IXDR_GET_U_LONG(buf);
2058 objp->rtpref = IXDR_GET_U_LONG(buf);
2059 objp->rtmult = IXDR_GET_U_LONG(buf);
2060 objp->wtmax = IXDR_GET_U_LONG(buf);
2061 objp->wtpref = IXDR_GET_U_LONG(buf);
2062 objp->wtmult = IXDR_GET_U_LONG(buf);
2063 objp->dtpref = IXDR_GET_U_LONG(buf);
2064 }
2065 if (!xdr_am_size3(xdrs, &objp->maxfilesize))
2066 return FALSE;
2067 if (!xdr_am_nfstime3(xdrs, &objp->time_delta))
2068 return FALSE;
2069 if (!xdr_u_int(xdrs, &objp->properties))
2070 return FALSE;
2071 return TRUE;
2072 }
2073
2074 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2075 return FALSE;
2076 if (!xdr_u_int(xdrs, &objp->rtmax))
2077 return FALSE;
2078 if (!xdr_u_int(xdrs, &objp->rtpref))
2079 return FALSE;
2080 if (!xdr_u_int(xdrs, &objp->rtmult))
2081 return FALSE;
2082 if (!xdr_u_int(xdrs, &objp->wtmax))
2083 return FALSE;
2084 if (!xdr_u_int(xdrs, &objp->wtpref))
2085 return FALSE;
2086 if (!xdr_u_int(xdrs, &objp->wtmult))
2087 return FALSE;
2088 if (!xdr_u_int(xdrs, &objp->dtpref))
2089 return FALSE;
2090 if (!xdr_am_size3(xdrs, &objp->maxfilesize))
2091 return FALSE;
2092 if (!xdr_am_nfstime3(xdrs, &objp->time_delta))
2093 return FALSE;
2094 if (!xdr_u_int(xdrs, &objp->properties))
2095 return FALSE;
2096 return TRUE;
2097 }
2098
2099 bool_t
xdr_am_FSINFO3resfail(XDR * xdrs,am_FSINFO3resfail * objp)2100 xdr_am_FSINFO3resfail(XDR *xdrs, am_FSINFO3resfail *objp)
2101 {
2102 if (amuDebug(D_XDRTRACE))
2103 plog(XLOG_DEBUG, "xdr_am_FSINFO3resfail:");
2104
2105 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2106 return FALSE;
2107 return TRUE;
2108 }
2109
2110 bool_t
xdr_am_FSINFO3res(XDR * xdrs,am_FSINFO3res * objp)2111 xdr_am_FSINFO3res(XDR *xdrs, am_FSINFO3res *objp)
2112 {
2113 if (amuDebug(D_XDRTRACE))
2114 plog(XLOG_DEBUG, "xdr_am_FSINFO3res:");
2115
2116 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2117 return FALSE;
2118 switch (objp->status) {
2119 case AM_NFS3_OK:
2120 if (!xdr_am_FSINFO3resok(xdrs, &objp->res_u.ok))
2121 return FALSE;
2122 break;
2123 default:
2124 if (!xdr_am_FSINFO3resfail(xdrs, &objp->res_u.fail))
2125 return FALSE;
2126 break;
2127 }
2128 return TRUE;
2129 }
2130
2131 bool_t
xdr_am_FSSTAT3args(XDR * xdrs,am_FSSTAT3args * objp)2132 xdr_am_FSSTAT3args(XDR *xdrs, am_FSSTAT3args *objp)
2133 {
2134 if (amuDebug(D_XDRTRACE))
2135 plog(XLOG_DEBUG, "xdr_am_FSSTAT3args:");
2136
2137 if (!xdr_am_nfs_fh3(xdrs, &objp->fsroot))
2138 return FALSE;
2139 return TRUE;
2140 }
2141
2142 bool_t
xdr_am_FSSTAT3resok(XDR * xdrs,am_FSSTAT3resok * objp)2143 xdr_am_FSSTAT3resok(XDR *xdrs, am_FSSTAT3resok *objp)
2144 {
2145 if (amuDebug(D_XDRTRACE))
2146 plog(XLOG_DEBUG, "xdr_am_FSSTAT3resok:");
2147
2148 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2149 return FALSE;
2150 if (!xdr_am_size3(xdrs, &objp->tbytes))
2151 return FALSE;
2152 if (!xdr_am_size3(xdrs, &objp->fbytes))
2153 return FALSE;
2154 if (!xdr_am_size3(xdrs, &objp->abytes))
2155 return FALSE;
2156 if (!xdr_am_size3(xdrs, &objp->tfiles))
2157 return FALSE;
2158 if (!xdr_am_size3(xdrs, &objp->ffiles))
2159 return FALSE;
2160 if (!xdr_am_size3(xdrs, &objp->afiles))
2161 return FALSE;
2162 if (!xdr_u_int(xdrs, &objp->invarsec))
2163 return FALSE;
2164 return TRUE;
2165 }
2166
2167 bool_t
xdr_am_FSSTAT3resfail(XDR * xdrs,am_FSSTAT3resfail * objp)2168 xdr_am_FSSTAT3resfail(XDR *xdrs, am_FSSTAT3resfail *objp)
2169 {
2170 if (amuDebug(D_XDRTRACE))
2171 plog(XLOG_DEBUG, "xdr_am_FSSTAT3resfail:");
2172
2173 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2174 return FALSE;
2175 return TRUE;
2176 }
2177
2178 bool_t
xdr_am_FSSTAT3res(XDR * xdrs,am_FSSTAT3res * objp)2179 xdr_am_FSSTAT3res(XDR *xdrs, am_FSSTAT3res *objp)
2180 {
2181 if (amuDebug(D_XDRTRACE))
2182 plog(XLOG_DEBUG, "xdr_am_FSSTAT3res:");
2183
2184 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2185 return FALSE;
2186 switch (objp->status) {
2187 case AM_NFS3_OK:
2188 if (!xdr_am_FSSTAT3resok(xdrs, &objp->res_u.ok))
2189 return FALSE;
2190 break;
2191 default:
2192 if (!xdr_am_FSSTAT3resfail(xdrs, &objp->res_u.fail))
2193 return FALSE;
2194 break;
2195 }
2196 return TRUE;
2197 }
2198
2199 bool_t
xdr_am_PATHCONF3args(XDR * xdrs,am_PATHCONF3args * objp)2200 xdr_am_PATHCONF3args(XDR *xdrs, am_PATHCONF3args *objp)
2201 {
2202 if (amuDebug(D_XDRTRACE))
2203 plog(XLOG_DEBUG, "xdr_am_PATHCONF3args:");
2204
2205 if (!xdr_am_nfs_fh3(xdrs, &objp->object))
2206 return FALSE;
2207 return TRUE;
2208 }
2209
2210 bool_t
xdr_am_PATHCONF3resok(XDR * xdrs,am_PATHCONF3resok * objp)2211 xdr_am_PATHCONF3resok(XDR *xdrs, am_PATHCONF3resok *objp)
2212 {
2213 register int32_t *buf;
2214
2215 if (amuDebug(D_XDRTRACE))
2216 plog(XLOG_DEBUG, "xdr_am_PATHCONF3resok:");
2217
2218 if (xdrs->x_op == XDR_ENCODE) {
2219 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2220 return FALSE;
2221 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
2222 if (buf == NULL) {
2223 if (!xdr_u_int(xdrs, &objp->linkmax))
2224 return FALSE;
2225 if (!xdr_u_int(xdrs, &objp->name_max))
2226 return FALSE;
2227 if (!xdr_bool(xdrs, &objp->no_trunc))
2228 return FALSE;
2229 if (!xdr_bool(xdrs, &objp->chown_restricted))
2230 return FALSE;
2231 if (!xdr_bool(xdrs, &objp->case_insensitive))
2232 return FALSE;
2233 if (!xdr_bool(xdrs, &objp->case_preserving))
2234 return FALSE;
2235 } else {
2236 IXDR_PUT_U_LONG(buf, objp->linkmax);
2237 IXDR_PUT_U_LONG(buf, objp->name_max);
2238 IXDR_PUT_BOOL(buf, objp->no_trunc);
2239 IXDR_PUT_BOOL(buf, objp->chown_restricted);
2240 IXDR_PUT_BOOL(buf, objp->case_insensitive);
2241 IXDR_PUT_BOOL(buf, objp->case_preserving);
2242 }
2243 return TRUE;
2244 } else if (xdrs->x_op == XDR_DECODE) {
2245 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2246 return FALSE;
2247 buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT);
2248 if (buf == NULL) {
2249 if (!xdr_u_int(xdrs, &objp->linkmax))
2250 return FALSE;
2251 if (!xdr_u_int(xdrs, &objp->name_max))
2252 return FALSE;
2253 if (!xdr_bool(xdrs, &objp->no_trunc))
2254 return FALSE;
2255 if (!xdr_bool(xdrs, &objp->chown_restricted))
2256 return FALSE;
2257 if (!xdr_bool(xdrs, &objp->case_insensitive))
2258 return FALSE;
2259 if (!xdr_bool(xdrs, &objp->case_preserving))
2260 return FALSE;
2261 } else {
2262 objp->linkmax = IXDR_GET_U_LONG(buf);
2263 objp->name_max = IXDR_GET_U_LONG(buf);
2264 objp->no_trunc = IXDR_GET_BOOL(buf);
2265 objp->chown_restricted = IXDR_GET_BOOL(buf);
2266 objp->case_insensitive = IXDR_GET_BOOL(buf);
2267 objp->case_preserving = IXDR_GET_BOOL(buf);
2268 }
2269 return TRUE;
2270 }
2271
2272 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2273 return FALSE;
2274 if (!xdr_u_int(xdrs, &objp->linkmax))
2275 return FALSE;
2276 if (!xdr_u_int(xdrs, &objp->name_max))
2277 return FALSE;
2278 if (!xdr_bool(xdrs, &objp->no_trunc))
2279 return FALSE;
2280 if (!xdr_bool(xdrs, &objp->chown_restricted))
2281 return FALSE;
2282 if (!xdr_bool(xdrs, &objp->case_insensitive))
2283 return FALSE;
2284 if (!xdr_bool(xdrs, &objp->case_preserving))
2285 return FALSE;
2286 return TRUE;
2287 }
2288
2289 bool_t
xdr_am_PATHCONF3resfail(XDR * xdrs,am_PATHCONF3resfail * objp)2290 xdr_am_PATHCONF3resfail(XDR *xdrs, am_PATHCONF3resfail *objp)
2291 {
2292 if (amuDebug(D_XDRTRACE))
2293 plog(XLOG_DEBUG, "xdr_am_PATHCONF3resfail:");
2294
2295 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2296 return FALSE;
2297 return TRUE;
2298 }
2299
2300 bool_t
xdr_am_PATHCONF3res(XDR * xdrs,am_PATHCONF3res * objp)2301 xdr_am_PATHCONF3res(XDR *xdrs, am_PATHCONF3res *objp)
2302 {
2303 if (amuDebug(D_XDRTRACE))
2304 plog(XLOG_DEBUG, "xdr_am_PATHCONF3res:");
2305
2306 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2307 return FALSE;
2308 switch (objp->status) {
2309 case AM_NFS3_OK:
2310 if (!xdr_am_PATHCONF3resok(xdrs, &objp->res_u.ok))
2311 return FALSE;
2312 break;
2313 default:
2314 if (!xdr_am_PATHCONF3resfail(xdrs, &objp->res_u.fail))
2315 return FALSE;
2316 break;
2317 }
2318 return TRUE;
2319 }
2320
2321 bool_t
xdr_am_nfspath3(XDR * xdrs,am_nfspath3 * objp)2322 xdr_am_nfspath3(XDR *xdrs, am_nfspath3 *objp)
2323 {
2324 if (amuDebug(D_XDRTRACE))
2325 plog(XLOG_DEBUG, "xdr_am_nfspath3:");
2326
2327 if (!xdr_string(xdrs, objp, ~0))
2328 return FALSE;
2329 return TRUE;
2330 }
2331
2332 bool_t
xdr_am_symlinkdata3(XDR * xdrs,am_symlinkdata3 * objp)2333 xdr_am_symlinkdata3(XDR *xdrs, am_symlinkdata3 *objp)
2334 {
2335 if (amuDebug(D_XDRTRACE))
2336 plog(XLOG_DEBUG, "xdr_am_symlinkdata3:");
2337
2338 if (!xdr_am_sattr3(xdrs, &objp->symlink_attributes))
2339 return FALSE;
2340 if (!xdr_am_nfspath3(xdrs, &objp->symlink_data))
2341 return FALSE;
2342 return TRUE;
2343 }
2344
2345 bool_t
xdr_am_SYMLINK3args(XDR * xdrs,am_SYMLINK3args * objp)2346 xdr_am_SYMLINK3args(XDR *xdrs, am_SYMLINK3args *objp)
2347 {
2348 if (amuDebug(D_XDRTRACE))
2349 plog(XLOG_DEBUG, "xdr_am_SYMLINK3args:");
2350
2351 if (!xdr_am_diropargs3(xdrs, &objp->where))
2352 return FALSE;
2353 if (!xdr_am_symlinkdata3(xdrs, &objp->symlink))
2354 return FALSE;
2355 return TRUE;
2356 }
2357
2358 bool_t
xdr_am_SYMLINK3resok(XDR * xdrs,am_SYMLINK3resok * objp)2359 xdr_am_SYMLINK3resok(XDR *xdrs, am_SYMLINK3resok *objp)
2360 {
2361 if (amuDebug(D_XDRTRACE))
2362 plog(XLOG_DEBUG, "xdr_am_SYMLINK3resok:");
2363
2364 if (!xdr_am_post_op_fh3(xdrs, &objp->obj))
2365 return FALSE;
2366 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2367 return FALSE;
2368 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2369 return FALSE;
2370 return TRUE;
2371 }
2372
2373 bool_t
xdr_am_SYMLINK3resfail(XDR * xdrs,am_SYMLINK3resfail * objp)2374 xdr_am_SYMLINK3resfail(XDR *xdrs, am_SYMLINK3resfail *objp)
2375 {
2376 if (amuDebug(D_XDRTRACE))
2377 plog(XLOG_DEBUG, "xdr_am_SYMLINK3resfail:");
2378
2379 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2380 return FALSE;
2381 return TRUE;
2382 }
2383
2384 bool_t
xdr_am_SYMLINK3res(XDR * xdrs,am_SYMLINK3res * objp)2385 xdr_am_SYMLINK3res(XDR *xdrs, am_SYMLINK3res *objp)
2386 {
2387 if (amuDebug(D_XDRTRACE))
2388 plog(XLOG_DEBUG, "xdr_am_SYMLINK3res:");
2389
2390 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2391 return FALSE;
2392 switch (objp->status) {
2393 case AM_NFS3_OK:
2394 if (!xdr_am_SYMLINK3resok(xdrs, &objp->res_u.ok))
2395 return FALSE;
2396 break;
2397 default:
2398 if (!xdr_am_SYMLINK3resfail(xdrs, &objp->res_u.fail))
2399 return FALSE;
2400 break;
2401 }
2402 return TRUE;
2403 }
2404
2405 bool_t
xdr_am_READLINK3args(XDR * xdrs,am_READLINK3args * objp)2406 xdr_am_READLINK3args(XDR *xdrs, am_READLINK3args *objp)
2407 {
2408 if (amuDebug(D_XDRTRACE))
2409 plog(XLOG_DEBUG, "xdr_am_READLINK3args:");
2410
2411 if (!xdr_am_nfs_fh3(xdrs, &objp->symlink))
2412 return FALSE;
2413 return TRUE;
2414 }
2415
2416 bool_t
xdr_am_READLINK3resok(XDR * xdrs,am_READLINK3resok * objp)2417 xdr_am_READLINK3resok(XDR *xdrs, am_READLINK3resok *objp)
2418 {
2419 if (amuDebug(D_XDRTRACE))
2420 plog(XLOG_DEBUG, "xdr_am_READLINK3resok:");
2421
2422 if (!xdr_am_post_op_attr(xdrs, &objp->symlink_attributes))
2423 return FALSE;
2424 if (!xdr_am_nfspath3(xdrs, &objp->data))
2425 return FALSE;
2426 return TRUE;
2427 }
2428
2429 bool_t
xdr_am_READLINK3resfail(XDR * xdrs,am_READLINK3resfail * objp)2430 xdr_am_READLINK3resfail(XDR *xdrs, am_READLINK3resfail *objp)
2431 {
2432 if (amuDebug(D_XDRTRACE))
2433 plog(XLOG_DEBUG, "xdr_am_READLINK3resfail:");
2434
2435 if (!xdr_am_post_op_attr(xdrs, &objp->symlink_attributes))
2436 return FALSE;
2437 return TRUE;
2438 }
2439
2440 bool_t
xdr_am_READLINK3res(XDR * xdrs,am_READLINK3res * objp)2441 xdr_am_READLINK3res(XDR *xdrs, am_READLINK3res *objp)
2442 {
2443 if (amuDebug(D_XDRTRACE))
2444 plog(XLOG_DEBUG, "xdr_am_READLINK3res:");
2445
2446 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2447 return FALSE;
2448 switch (objp->status) {
2449 case AM_NFS3_OK:
2450 if (!xdr_am_READLINK3resok(xdrs, &objp->res_u.ok))
2451 return FALSE;
2452 break;
2453 default:
2454 if (!xdr_am_READLINK3resfail(xdrs, &objp->res_u.fail))
2455 return FALSE;
2456 break;
2457 }
2458 return TRUE;
2459 }
2460
2461 bool_t
xdr_am_devicedata3(XDR * xdrs,am_devicedata3 * objp)2462 xdr_am_devicedata3(XDR *xdrs, am_devicedata3 *objp)
2463 {
2464 if (amuDebug(D_XDRTRACE))
2465 plog(XLOG_DEBUG, "xdr_am_devicedata3:");
2466
2467 if (!xdr_am_sattr3(xdrs, &objp->dev_attributes))
2468 return FALSE;
2469 if (!xdr_am_specdata3(xdrs, &objp->spec))
2470 return FALSE;
2471 return TRUE;
2472 }
2473
2474 bool_t
xdr_am_mknoddata3(XDR * xdrs,am_mknoddata3 * objp)2475 xdr_am_mknoddata3(XDR *xdrs, am_mknoddata3 *objp)
2476 {
2477 if (amuDebug(D_XDRTRACE))
2478 plog(XLOG_DEBUG, "xdr_am_mknoddata3:");
2479
2480 if (!xdr_am_ftype3(xdrs, &objp->type))
2481 return FALSE;
2482 switch (objp->type) {
2483 case AM_NF3CHR:
2484 if (!xdr_am_devicedata3(xdrs, &objp->am_mknoddata3_u.chr_device))
2485 return FALSE;
2486 break;
2487 case AM_NF3BLK:
2488 if (!xdr_am_devicedata3(xdrs, &objp->am_mknoddata3_u.blk_device))
2489 return FALSE;
2490 break;
2491 case AM_NF3SOCK:
2492 if (!xdr_am_sattr3(xdrs, &objp->am_mknoddata3_u.sock_attributes))
2493 return FALSE;
2494 break;
2495 case AM_NF3FIFO:
2496 if (!xdr_am_sattr3(xdrs, &objp->am_mknoddata3_u.pipe_attributes))
2497 return FALSE;
2498 break;
2499 default:
2500 break;
2501 }
2502 return TRUE;
2503 }
2504
2505 bool_t
xdr_am_MKNOD3args(XDR * xdrs,am_MKNOD3args * objp)2506 xdr_am_MKNOD3args(XDR *xdrs, am_MKNOD3args *objp)
2507 {
2508 if (amuDebug(D_XDRTRACE))
2509 plog(XLOG_DEBUG, "xdr_am_MKNOD3args:");
2510
2511 if (!xdr_am_diropargs3(xdrs, &objp->where))
2512 return FALSE;
2513 if (!xdr_am_mknoddata3(xdrs, &objp->what))
2514 return FALSE;
2515 return TRUE;
2516 }
2517
2518 bool_t
xdr_am_MKNOD3resok(XDR * xdrs,am_MKNOD3resok * objp)2519 xdr_am_MKNOD3resok(XDR *xdrs, am_MKNOD3resok *objp)
2520 {
2521 if (amuDebug(D_XDRTRACE))
2522 plog(XLOG_DEBUG, "xdr_am_MKNOD3resok:");
2523
2524 if (!xdr_am_post_op_fh3(xdrs, &objp->obj))
2525 return FALSE;
2526 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2527 return FALSE;
2528 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2529 return FALSE;
2530 return TRUE;
2531 }
2532
2533 bool_t
xdr_am_MKNOD3resfail(XDR * xdrs,am_MKNOD3resfail * objp)2534 xdr_am_MKNOD3resfail(XDR *xdrs, am_MKNOD3resfail *objp)
2535 {
2536 if (amuDebug(D_XDRTRACE))
2537 plog(XLOG_DEBUG, "xdr_am_MKNOD3resfail:");
2538
2539 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2540 return FALSE;
2541 return TRUE;
2542 }
2543
2544 bool_t
xdr_am_MKNOD3res(XDR * xdrs,am_MKNOD3res * objp)2545 xdr_am_MKNOD3res(XDR *xdrs, am_MKNOD3res *objp)
2546 {
2547 if (amuDebug(D_XDRTRACE))
2548 plog(XLOG_DEBUG, ":");
2549
2550 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2551 return FALSE;
2552 switch (objp->status) {
2553 case AM_NFS3_OK:
2554 if (!xdr_am_MKNOD3resok(xdrs, &objp->res_u.ok))
2555 return FALSE;
2556 break;
2557 default:
2558 if (!xdr_am_MKNOD3resfail(xdrs, &objp->res_u.fail))
2559 return FALSE;
2560 break;
2561 }
2562 return TRUE;
2563 }
2564
2565 bool_t
xdr_am_MKDIR3args(XDR * xdrs,am_MKDIR3args * objp)2566 xdr_am_MKDIR3args(XDR *xdrs, am_MKDIR3args *objp)
2567 {
2568 if (amuDebug(D_XDRTRACE))
2569 plog(XLOG_DEBUG, ":");
2570
2571 if (!xdr_am_diropargs3(xdrs, &objp->where))
2572 return FALSE;
2573 if (!xdr_am_sattr3(xdrs, &objp->attributes))
2574 return FALSE;
2575 return TRUE;
2576 }
2577
2578 bool_t
xdr_am_MKDIR3resok(XDR * xdrs,am_MKDIR3resok * objp)2579 xdr_am_MKDIR3resok(XDR *xdrs, am_MKDIR3resok *objp)
2580 {
2581 if (amuDebug(D_XDRTRACE))
2582 plog(XLOG_DEBUG, "xdr_am_MKDIR3resok:");
2583
2584 if (!xdr_am_post_op_fh3(xdrs, &objp->obj))
2585 return FALSE;
2586 if (!xdr_am_post_op_attr(xdrs, &objp->obj_attributes))
2587 return FALSE;
2588 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2589 return FALSE;
2590 return TRUE;
2591 }
2592
2593 bool_t
xdr_am_MKDIR3resfail(XDR * xdrs,am_MKDIR3resfail * objp)2594 xdr_am_MKDIR3resfail(XDR *xdrs, am_MKDIR3resfail *objp)
2595 {
2596 if (amuDebug(D_XDRTRACE))
2597 plog(XLOG_DEBUG, "xdr_am_MKDIR3resfail:");
2598
2599 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2600 return FALSE;
2601 return TRUE;
2602 }
2603
2604 bool_t
xdr_am_MKDIR3res(XDR * xdrs,am_MKDIR3res * objp)2605 xdr_am_MKDIR3res(XDR *xdrs, am_MKDIR3res *objp)
2606 {
2607 if (amuDebug(D_XDRTRACE))
2608 plog(XLOG_DEBUG, "xdr_am_MKDIR3res:");
2609
2610 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2611 return FALSE;
2612 switch (objp->status) {
2613 case AM_NFS3_OK:
2614 if (!xdr_am_MKDIR3resok(xdrs, &objp->res_u.ok))
2615 return FALSE;
2616 break;
2617 default:
2618 if (!xdr_am_MKDIR3resfail(xdrs, &objp->res_u.fail))
2619 return FALSE;
2620 break;
2621 }
2622 return TRUE;
2623 }
2624
2625 bool_t
xdr_am_RMDIR3args(XDR * xdrs,am_RMDIR3args * objp)2626 xdr_am_RMDIR3args(XDR *xdrs, am_RMDIR3args *objp)
2627 {
2628 if (amuDebug(D_XDRTRACE))
2629 plog(XLOG_DEBUG, "xdr_am_RMDIR3args:");
2630
2631 if (!xdr_am_diropargs3(xdrs, &objp->object))
2632 return FALSE;
2633 return TRUE;
2634 }
2635
2636 bool_t
xdr_am_RMDIR3resok(XDR * xdrs,am_RMDIR3resok * objp)2637 xdr_am_RMDIR3resok(XDR *xdrs, am_RMDIR3resok *objp)
2638 {
2639 if (amuDebug(D_XDRTRACE))
2640 plog(XLOG_DEBUG, "xdr_am_RMDIR3resok:");
2641
2642 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2643 return FALSE;
2644 return TRUE;
2645 }
2646
2647 bool_t
xdr_am_RMDIR3resfail(XDR * xdrs,am_RMDIR3resfail * objp)2648 xdr_am_RMDIR3resfail(XDR *xdrs, am_RMDIR3resfail *objp)
2649 {
2650 if (amuDebug(D_XDRTRACE))
2651 plog(XLOG_DEBUG, "xdr_am_RMDIR3resfail:");
2652
2653 if (!xdr_am_wcc_data(xdrs, &objp->dir_wcc))
2654 return FALSE;
2655 return TRUE;
2656 }
2657
2658 bool_t
xdr_am_RMDIR3res(XDR * xdrs,am_RMDIR3res * objp)2659 xdr_am_RMDIR3res(XDR *xdrs, am_RMDIR3res *objp)
2660 {
2661 if (amuDebug(D_XDRTRACE))
2662 plog(XLOG_DEBUG, "xdr_am_RMDIR3res:");
2663
2664 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2665 return FALSE;
2666 switch (objp->status) {
2667 case AM_NFS3_OK:
2668 if (!xdr_am_RMDIR3resok(xdrs, &objp->res_u.ok))
2669 return FALSE;
2670 break;
2671 default:
2672 if (!xdr_am_RMDIR3resfail(xdrs, &objp->res_u.fail))
2673 return FALSE;
2674 break;
2675 }
2676 return TRUE;
2677 }
2678
2679 bool_t
xdr_am_RENAME3args(XDR * xdrs,am_RENAME3args * objp)2680 xdr_am_RENAME3args(XDR *xdrs, am_RENAME3args *objp)
2681 {
2682 if (amuDebug(D_XDRTRACE))
2683 plog(XLOG_DEBUG, "xdr_am_RENAME3args:");
2684
2685 if (!xdr_am_diropargs3(xdrs, &objp->from))
2686 return FALSE;
2687 if (!xdr_am_diropargs3(xdrs, &objp->to))
2688 return FALSE;
2689 return TRUE;
2690 }
2691
2692 bool_t
xdr_am_RENAME3resok(XDR * xdrs,am_RENAME3resok * objp)2693 xdr_am_RENAME3resok(XDR *xdrs, am_RENAME3resok *objp)
2694 {
2695 if (amuDebug(D_XDRTRACE))
2696 plog(XLOG_DEBUG, "xdr_am_RENAME3resok:");
2697
2698 if (!xdr_am_wcc_data(xdrs, &objp->fromdir_wcc))
2699 return FALSE;
2700 if (!xdr_am_wcc_data(xdrs, &objp->todir_wcc))
2701 return FALSE;
2702 return TRUE;
2703 }
2704
2705 bool_t
xdr_am_RENAME3resfail(XDR * xdrs,am_RENAME3resfail * objp)2706 xdr_am_RENAME3resfail(XDR *xdrs, am_RENAME3resfail *objp)
2707 {
2708 if (amuDebug(D_XDRTRACE))
2709 plog(XLOG_DEBUG, "xdr_am_RENAME3resfail:");
2710
2711 if (!xdr_am_wcc_data(xdrs, &objp->fromdir_wcc))
2712 return FALSE;
2713 if (!xdr_am_wcc_data(xdrs, &objp->todir_wcc))
2714 return FALSE;
2715 return TRUE;
2716 }
2717
2718 bool_t
xdr_am_RENAME3res(XDR * xdrs,am_RENAME3res * objp)2719 xdr_am_RENAME3res(XDR *xdrs, am_RENAME3res *objp)
2720 {
2721 if (amuDebug(D_XDRTRACE))
2722 plog(XLOG_DEBUG, "xdr_am_RENAME3res:");
2723
2724 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2725 return FALSE;
2726 switch (objp->status) {
2727 case AM_NFS3_OK:
2728 if (!xdr_am_RENAME3resok(xdrs, &objp->res_u.ok))
2729 return FALSE;
2730 break;
2731 default:
2732 if (!xdr_am_RENAME3resfail(xdrs, &objp->res_u.fail))
2733 return FALSE;
2734 break;
2735 }
2736 return TRUE;
2737 }
2738
2739 bool_t
xdr_am_READDIRPLUS3args(XDR * xdrs,am_READDIRPLUS3args * objp)2740 xdr_am_READDIRPLUS3args(XDR *xdrs, am_READDIRPLUS3args *objp)
2741 {
2742 if (amuDebug(D_XDRTRACE))
2743 plog(XLOG_DEBUG, "xdr_am_READDIRPLUS3args:");
2744
2745 if (!xdr_am_nfs_fh3(xdrs, &objp->dir))
2746 return FALSE;
2747 if (!xdr_am_cookie3(xdrs, &objp->cookie))
2748 return FALSE;
2749 if (!xdr_am_cookieverf3(xdrs, objp->cookieverf))
2750 return FALSE;
2751 if (!xdr_am_count3(xdrs, &objp->dircount))
2752 return FALSE;
2753 if (!xdr_am_count3(xdrs, &objp->maxcount))
2754 return FALSE;
2755 return TRUE;
2756 }
2757
2758 bool_t
xdr_am_entryplus3(XDR * xdrs,am_entryplus3 * objp)2759 xdr_am_entryplus3(XDR *xdrs, am_entryplus3 *objp)
2760 {
2761 if (amuDebug(D_XDRTRACE))
2762 plog(XLOG_DEBUG, "xdr_am_entryplus3:");
2763
2764 if (!xdr_am_fileid3(xdrs, &objp->fileid))
2765 return FALSE;
2766 if (!xdr_am_filename3(xdrs, &objp->name))
2767 return FALSE;
2768 if (!xdr_am_cookie3(xdrs, &objp->cookie))
2769 return FALSE;
2770 if (!xdr_am_post_op_attr(xdrs, &objp->name_attributes))
2771 return FALSE;
2772 if (!xdr_am_post_op_fh3(xdrs, &objp->name_handle))
2773 return FALSE;
2774 if (!xdr_pointer(xdrs, (char **)&objp->nextentry,
2775 sizeof(am_entryplus3), (xdrproc_t) xdr_am_entryplus3))
2776 return FALSE;
2777 return TRUE;
2778 }
2779
2780 bool_t
xdr_am_dirlistplus3(XDR * xdrs,am_dirlistplus3 * objp)2781 xdr_am_dirlistplus3(XDR *xdrs, am_dirlistplus3 *objp)
2782 {
2783 if (amuDebug(D_XDRTRACE))
2784 plog(XLOG_DEBUG, "xdr_am_dirlistplus3:");
2785
2786 if (!xdr_pointer(xdrs, (char **)&objp->entries,
2787 sizeof(am_entryplus3), (xdrproc_t) xdr_am_entryplus3))
2788 return FALSE;
2789 if (!xdr_bool(xdrs, &objp->eof))
2790 return FALSE;
2791 return TRUE;
2792 }
2793
2794 bool_t
xdr_am_READDIRPLUS3resok(XDR * xdrs,am_READDIRPLUS3resok * objp)2795 xdr_am_READDIRPLUS3resok(XDR *xdrs, am_READDIRPLUS3resok *objp)
2796 {
2797 if (amuDebug(D_XDRTRACE))
2798 plog(XLOG_DEBUG, "xdr_am_READDIRPLUS3resok:");
2799
2800 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
2801 return FALSE;
2802 if (!xdr_am_cookieverf3(xdrs, objp->cookieverf))
2803 return FALSE;
2804 if (!xdr_am_dirlistplus3(xdrs, &objp->reply))
2805 return FALSE;
2806 return TRUE;
2807 }
2808
2809 bool_t
xdr_am_READDIRPLUS3resfail(XDR * xdrs,am_READDIRPLUS3resfail * objp)2810 xdr_am_READDIRPLUS3resfail(XDR *xdrs, am_READDIRPLUS3resfail *objp)
2811 {
2812 if (amuDebug(D_XDRTRACE))
2813 plog(XLOG_DEBUG, "xdr_am_READDIRPLUS3resfail:");
2814
2815 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
2816 return FALSE;
2817 return TRUE;
2818 }
2819
2820 bool_t
xdr_am_READDIRPLUS3res(XDR * xdrs,am_READDIRPLUS3res * objp)2821 xdr_am_READDIRPLUS3res(XDR *xdrs, am_READDIRPLUS3res *objp)
2822 {
2823 if (amuDebug(D_XDRTRACE))
2824 plog(XLOG_DEBUG, "xdr_am_READDIRPLUS3res:");
2825
2826 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2827 return FALSE;
2828 switch (objp->status) {
2829 case AM_NFS3_OK:
2830 if (!xdr_am_READDIRPLUS3resok(xdrs, &objp->res_u.ok))
2831 return FALSE;
2832 break;
2833 default:
2834 if (!xdr_am_READDIRPLUS3resfail(xdrs, &objp->res_u.fail))
2835 return FALSE;
2836 break;
2837 }
2838 return TRUE;
2839 }
2840
2841 bool_t
xdr_am_READDIR3args(XDR * xdrs,am_READDIR3args * objp)2842 xdr_am_READDIR3args(XDR *xdrs, am_READDIR3args *objp)
2843 {
2844 if (amuDebug(D_XDRTRACE))
2845 plog(XLOG_DEBUG, "xdr_am_READDIR3args:");
2846
2847 if (!xdr_am_nfs_fh3(xdrs, &objp->dir))
2848 return FALSE;
2849 if (!xdr_am_cookie3(xdrs, &objp->cookie))
2850 return FALSE;
2851 if (!xdr_am_cookieverf3(xdrs, objp->cookieverf))
2852 return FALSE;
2853 if (!xdr_am_count3(xdrs, &objp->count))
2854 return FALSE;
2855 return TRUE;
2856 }
2857
2858 bool_t
xdr_am_entry3(XDR * xdrs,am_entry3 * objp)2859 xdr_am_entry3(XDR *xdrs, am_entry3 *objp)
2860 {
2861 if (amuDebug(D_XDRTRACE))
2862 plog(XLOG_DEBUG, "xdr_am_entry3:");
2863
2864 if (!xdr_am_fileid3(xdrs, &objp->fileid))
2865 return FALSE;
2866 if (!xdr_am_filename3(xdrs, &objp->name))
2867 return FALSE;
2868 if (!xdr_am_cookie3(xdrs, &objp->cookie))
2869 return FALSE;
2870 if (!xdr_pointer(xdrs, (char **)&objp->nextentry,
2871 sizeof(am_entry3), (xdrproc_t) xdr_am_entry3))
2872 return FALSE;
2873 return TRUE;
2874 }
2875
2876 bool_t
xdr_am_dirlist3(XDR * xdrs,am_dirlist3 * objp)2877 xdr_am_dirlist3(XDR *xdrs, am_dirlist3 *objp)
2878 {
2879 if (amuDebug(D_XDRTRACE))
2880 plog(XLOG_DEBUG, "xdr_am_dirlist3:");
2881
2882 if (!xdr_pointer(xdrs, (char **)&objp->entries,
2883 sizeof(am_entry3), (xdrproc_t) xdr_am_entry3))
2884 return FALSE;
2885 if (!xdr_bool (xdrs, &objp->eof))
2886 return FALSE;
2887 return TRUE;
2888 }
2889
2890 bool_t
xdr_am_READDIR3resok(XDR * xdrs,am_READDIR3resok * objp)2891 xdr_am_READDIR3resok(XDR *xdrs, am_READDIR3resok *objp)
2892 {
2893 if (amuDebug(D_XDRTRACE))
2894 plog(XLOG_DEBUG, "xdr_am_READDIR3resok:");
2895
2896 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
2897 return FALSE;
2898 if (!xdr_am_cookieverf3(xdrs, objp->cookieverf))
2899 return FALSE;
2900 if (!xdr_am_dirlist3(xdrs, &objp->reply))
2901 return FALSE;
2902 return TRUE;
2903 }
2904
2905 bool_t
xdr_am_READDIR3resfail(XDR * xdrs,am_READDIR3resfail * objp)2906 xdr_am_READDIR3resfail(XDR *xdrs, am_READDIR3resfail *objp)
2907 {
2908 if (amuDebug(D_XDRTRACE))
2909 plog(XLOG_DEBUG, "xdr_am_READDIR3resfail:");
2910
2911 if (!xdr_am_post_op_attr(xdrs, &objp->dir_attributes))
2912 return FALSE;
2913 return TRUE;
2914 }
2915
2916 bool_t
xdr_am_READDIR3res(XDR * xdrs,am_READDIR3res * objp)2917 xdr_am_READDIR3res(XDR *xdrs, am_READDIR3res *objp)
2918 {
2919 if (amuDebug(D_XDRTRACE))
2920 plog(XLOG_DEBUG, "xdr_am_READDIR3res:");
2921
2922 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2923 return FALSE;
2924 switch (objp->status) {
2925 case AM_NFS3_OK:
2926 if (!xdr_am_READDIR3resok(xdrs, &objp->res_u.ok))
2927 return FALSE;
2928 break;
2929 default:
2930 if (!xdr_am_READDIR3resfail(xdrs, &objp->res_u.fail))
2931 return FALSE;
2932 break;
2933 }
2934 return TRUE;
2935 }
2936
2937 bool_t
xdr_am_LINK3args(XDR * xdrs,am_LINK3args * objp)2938 xdr_am_LINK3args(XDR *xdrs, am_LINK3args *objp)
2939 {
2940 if (amuDebug(D_XDRTRACE))
2941 plog(XLOG_DEBUG, "xdr_am_LINK3args:");
2942
2943 if (!xdr_am_nfs_fh3(xdrs, &objp->file))
2944 return FALSE;
2945 if (!xdr_am_diropargs3(xdrs, &objp->link))
2946 return FALSE;
2947 return TRUE;
2948 }
2949
2950 bool_t
xdr_am_LINK3resok(XDR * xdrs,am_LINK3resok * objp)2951 xdr_am_LINK3resok(XDR *xdrs, am_LINK3resok *objp)
2952 {
2953 if (amuDebug(D_XDRTRACE))
2954 plog(XLOG_DEBUG, "xdr_am_LINK3resok:");
2955
2956 if (!xdr_am_post_op_attr(xdrs, &objp->file_attributes))
2957 return FALSE;
2958 if (!xdr_am_wcc_data(xdrs, &objp->linkdir_wcc))
2959 return FALSE;
2960 return TRUE;
2961 }
2962
2963 bool_t
xdr_am_LINK3resfail(XDR * xdrs,am_LINK3resfail * objp)2964 xdr_am_LINK3resfail(XDR *xdrs, am_LINK3resfail *objp)
2965 {
2966 if (amuDebug(D_XDRTRACE))
2967 plog(XLOG_DEBUG, "xdr_am_LINK3resfail:");
2968
2969 if (!xdr_am_post_op_attr(xdrs, &objp->file_attributes))
2970 return FALSE;
2971 if (!xdr_am_wcc_data(xdrs, &objp->linkdir_wcc))
2972 return FALSE;
2973 return TRUE;
2974 }
2975
2976 bool_t
xdr_am_LINK3res(XDR * xdrs,am_LINK3res * objp)2977 xdr_am_LINK3res(XDR *xdrs, am_LINK3res *objp)
2978 {
2979 if (amuDebug(D_XDRTRACE))
2980 plog(XLOG_DEBUG, "xdr_am_LINK3res:");
2981
2982 if (!xdr_am_nfsstat3(xdrs, &objp->status))
2983 return FALSE;
2984 switch (objp->status) {
2985 case AM_NFS3_OK:
2986 if (!xdr_am_LINK3resok(xdrs, &objp->res_u.ok))
2987 return FALSE;
2988 break;
2989 default:
2990 if (!xdr_am_LINK3resfail(xdrs, &objp->res_u.fail))
2991 return FALSE;
2992 break;
2993 }
2994 return TRUE;
2995 }
2996
2997 bool_t
xdr_am_sattrguard3(XDR * xdrs,am_sattrguard3 * objp)2998 xdr_am_sattrguard3(XDR *xdrs, am_sattrguard3 *objp)
2999 {
3000 if (amuDebug(D_XDRTRACE))
3001 plog(XLOG_DEBUG, "xdr_am_sattrguard3:");
3002
3003 if (!xdr_bool(xdrs, &objp->check))
3004 return FALSE;
3005 switch (objp->check) {
3006 case TRUE:
3007 if (!xdr_am_nfstime3(xdrs, &objp->am_sattrguard3_u.obj_ctime))
3008 return FALSE;
3009 break;
3010 case FALSE:
3011 break;
3012 default:
3013 return FALSE;
3014 }
3015 return TRUE;
3016 }
3017
3018 bool_t
xdr_am_SETATTR3args(XDR * xdrs,am_SETATTR3args * objp)3019 xdr_am_SETATTR3args(XDR *xdrs, am_SETATTR3args *objp)
3020 {
3021 if (amuDebug(D_XDRTRACE))
3022 plog(XLOG_DEBUG, "xdr_am_SETATTR3args:");
3023
3024 if (!xdr_am_nfs_fh3(xdrs, &objp->object))
3025 return FALSE;
3026 if (!xdr_am_sattr3(xdrs, &objp->new_attributes))
3027 return FALSE;
3028 if (!xdr_am_sattrguard3(xdrs, &objp->guard))
3029 return FALSE;
3030 return TRUE;
3031 }
3032
3033 bool_t
xdr_am_SETATTR3resok(XDR * xdrs,am_SETATTR3resok * objp)3034 xdr_am_SETATTR3resok(XDR *xdrs, am_SETATTR3resok *objp)
3035 {
3036 if (amuDebug(D_XDRTRACE))
3037 plog(XLOG_DEBUG, "xdr_am_SETATTR3resok:");
3038
3039 if (!xdr_am_wcc_data(xdrs, &objp->obj_wcc))
3040 return FALSE;
3041 return TRUE;
3042 }
3043
3044 bool_t
xdr_am_SETATTR3resfail(XDR * xdrs,am_SETATTR3resfail * objp)3045 xdr_am_SETATTR3resfail(XDR *xdrs, am_SETATTR3resfail *objp)
3046 {
3047 if (amuDebug(D_XDRTRACE))
3048 plog(XLOG_DEBUG, "xdr_am_SETATTR3resfail:");
3049
3050 if (!xdr_am_wcc_data(xdrs, &objp->obj_wcc))
3051 return FALSE;
3052 return TRUE;
3053 }
3054
3055 bool_t
xdr_am_SETATTR3res(XDR * xdrs,am_SETATTR3res * objp)3056 xdr_am_SETATTR3res(XDR *xdrs, am_SETATTR3res *objp)
3057 {
3058 if (amuDebug(D_XDRTRACE))
3059 plog(XLOG_DEBUG, "xdr_am_SETATTR3res:");
3060
3061 if (!xdr_am_nfsstat3(xdrs, &objp->status))
3062 return FALSE;
3063 switch (objp->status) {
3064 case AM_NFS3_OK:
3065 if (!xdr_am_SETATTR3resok(xdrs, &objp->res_u.ok))
3066 return FALSE;
3067 break;
3068 default:
3069 if (!xdr_am_SETATTR3resfail(xdrs, &objp->res_u.fail))
3070 return FALSE;
3071 break;
3072 }
3073 return TRUE;
3074 }
3075 #endif /* HAVE_FS_NFS3 */
3076