Merge pull request #99 from mheijkoop/fuse-nfs-usage
[deb_libnfs.git] / nfs / libnfs-raw-nfs.c
CommitLineData
a0c4ea7d
RS
1/*
2Copyright (c) 2014, Ronnie Sahlberg
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
81. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
102. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25The views and conclusions contained in the software and documentation are those
26of the authors and should not be interpreted as representing official policies,
27either expressed or implied, of the FreeBSD Project.
28*/
29
763cd6e3
RS
30/*
31 * Please do not edit this file.
32 * It was generated using rpcgen.
33 */
34
35#include "libnfs-zdr.h"
36#include "libnfs-raw-nfs.h"
37
af8d37c8 38uint32_t
763cd6e3
RS
39zdr_cookieverf3 (ZDR *zdrs, cookieverf3 objp)
40{
41 register int32_t *buf;
9c29b498 42 buf = NULL;
763cd6e3
RS
43
44 if (!zdr_opaque (zdrs, objp, NFS3_COOKIEVERFSIZE))
45 return FALSE;
46 return TRUE;
47}
48
af8d37c8 49uint32_t
763cd6e3
RS
50zdr_cookie3 (ZDR *zdrs, cookie3 *objp)
51{
52 register int32_t *buf;
9c29b498 53 buf = NULL;
763cd6e3 54
a0c4ea7d 55 if (!zdr_u_quad_t (zdrs, objp))
763cd6e3
RS
56 return FALSE;
57 return TRUE;
58}
59
af8d37c8 60uint32_t
763cd6e3
RS
61zdr_nfs_fh3 (ZDR *zdrs, nfs_fh3 *objp)
62{
63 register int32_t *buf;
9c29b498 64 buf = NULL;
763cd6e3
RS
65
66 if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, NFS3_FHSIZE))
67 return FALSE;
68 return TRUE;
69}
70
af8d37c8 71uint32_t
763cd6e3
RS
72zdr_filename3 (ZDR *zdrs, filename3 *objp)
73{
74 register int32_t *buf;
9c29b498 75 buf = NULL;
763cd6e3
RS
76
77 if (!zdr_string (zdrs, objp, ~0))
78 return FALSE;
79 return TRUE;
80}
81
af8d37c8 82uint32_t
763cd6e3
RS
83zdr_diropargs3 (ZDR *zdrs, diropargs3 *objp)
84{
85 register int32_t *buf;
9c29b498 86 buf = NULL;
763cd6e3
RS
87
88 if (!zdr_nfs_fh3 (zdrs, &objp->dir))
89 return FALSE;
90 if (!zdr_filename3 (zdrs, &objp->name))
91 return FALSE;
92 return TRUE;
93}
94
af8d37c8 95uint32_t
763cd6e3
RS
96zdr_ftype3 (ZDR *zdrs, ftype3 *objp)
97{
98 register int32_t *buf;
9c29b498 99 buf = NULL;
763cd6e3
RS
100
101 if (!zdr_enum (zdrs, (enum_t *) objp))
102 return FALSE;
103 return TRUE;
104}
105
af8d37c8 106uint32_t
763cd6e3
RS
107zdr_mode3 (ZDR *zdrs, mode3 *objp)
108{
109 register int32_t *buf;
9c29b498 110 buf = NULL;
763cd6e3
RS
111
112 if (!zdr_u_int (zdrs, objp))
113 return FALSE;
114 return TRUE;
115}
116
af8d37c8 117uint32_t
763cd6e3
RS
118zdr_uid3 (ZDR *zdrs, uid3 *objp)
119{
120 register int32_t *buf;
9c29b498 121 buf = NULL;
763cd6e3
RS
122
123 if (!zdr_u_int (zdrs, objp))
124 return FALSE;
125 return TRUE;
126}
127
af8d37c8 128uint32_t
763cd6e3
RS
129zdr_gid3 (ZDR *zdrs, gid3 *objp)
130{
131 register int32_t *buf;
9c29b498 132 buf = NULL;
763cd6e3
RS
133
134 if (!zdr_u_int (zdrs, objp))
135 return FALSE;
136 return TRUE;
137}
138
af8d37c8 139uint32_t
763cd6e3
RS
140zdr_size3 (ZDR *zdrs, size3 *objp)
141{
142 register int32_t *buf;
9c29b498 143 buf = NULL;
763cd6e3 144
a0c4ea7d 145 if (!zdr_u_quad_t (zdrs, objp))
763cd6e3
RS
146 return FALSE;
147 return TRUE;
148}
149
af8d37c8 150uint32_t
763cd6e3
RS
151zdr_fileid3 (ZDR *zdrs, fileid3 *objp)
152{
153 register int32_t *buf;
9c29b498 154 buf = NULL;
763cd6e3 155
a0c4ea7d 156 if (!zdr_u_quad_t (zdrs, objp))
763cd6e3
RS
157 return FALSE;
158 return TRUE;
159}
160
af8d37c8 161uint32_t
763cd6e3
RS
162zdr_specdata3 (ZDR *zdrs, specdata3 *objp)
163{
164 register int32_t *buf;
9c29b498 165 buf = NULL;
763cd6e3
RS
166
167 if (!zdr_u_int (zdrs, &objp->specdata1))
168 return FALSE;
169 if (!zdr_u_int (zdrs, &objp->specdata2))
170 return FALSE;
171 return TRUE;
172}
173
af8d37c8 174uint32_t
763cd6e3
RS
175zdr_nfstime3 (ZDR *zdrs, nfstime3 *objp)
176{
177 register int32_t *buf;
9c29b498 178 buf = NULL;
763cd6e3
RS
179
180 if (!zdr_u_int (zdrs, &objp->seconds))
181 return FALSE;
182 if (!zdr_u_int (zdrs, &objp->nseconds))
183 return FALSE;
184 return TRUE;
185}
186
af8d37c8 187uint32_t
763cd6e3
RS
188zdr_fattr3 (ZDR *zdrs, fattr3 *objp)
189{
190 register int32_t *buf;
9c29b498 191 buf = NULL;
763cd6e3
RS
192
193 if (!zdr_ftype3 (zdrs, &objp->type))
194 return FALSE;
195 if (!zdr_mode3 (zdrs, &objp->mode))
196 return FALSE;
197 if (!zdr_u_int (zdrs, &objp->nlink))
198 return FALSE;
199 if (!zdr_uid3 (zdrs, &objp->uid))
200 return FALSE;
201 if (!zdr_gid3 (zdrs, &objp->gid))
202 return FALSE;
203 if (!zdr_size3 (zdrs, &objp->size))
204 return FALSE;
205 if (!zdr_size3 (zdrs, &objp->used))
206 return FALSE;
207 if (!zdr_specdata3 (zdrs, &objp->rdev))
208 return FALSE;
a0c4ea7d 209 if (!zdr_u_quad_t (zdrs, &objp->fsid))
763cd6e3
RS
210 return FALSE;
211 if (!zdr_fileid3 (zdrs, &objp->fileid))
212 return FALSE;
213 if (!zdr_nfstime3 (zdrs, &objp->atime))
214 return FALSE;
215 if (!zdr_nfstime3 (zdrs, &objp->mtime))
216 return FALSE;
217 if (!zdr_nfstime3 (zdrs, &objp->ctime))
218 return FALSE;
219 return TRUE;
220}
221
af8d37c8 222uint32_t
763cd6e3
RS
223zdr_post_op_attr (ZDR *zdrs, post_op_attr *objp)
224{
225 register int32_t *buf;
9c29b498 226 buf = NULL;
763cd6e3
RS
227
228 if (!zdr_bool (zdrs, &objp->attributes_follow))
229 return FALSE;
230 switch (objp->attributes_follow) {
231 case TRUE:
232 if (!zdr_fattr3 (zdrs, &objp->post_op_attr_u.attributes))
233 return FALSE;
234 break;
235 case FALSE:
236 break;
237 default:
238 return FALSE;
239 }
240 return TRUE;
241}
242
af8d37c8 243uint32_t
763cd6e3
RS
244zdr_nfsstat3 (ZDR *zdrs, nfsstat3 *objp)
245{
246 register int32_t *buf;
9c29b498 247 buf = NULL;
763cd6e3
RS
248
249 if (!zdr_enum (zdrs, (enum_t *) objp))
250 return FALSE;
251 return TRUE;
252}
253
af8d37c8 254uint32_t
763cd6e3
RS
255zdr_stable_how (ZDR *zdrs, stable_how *objp)
256{
257 register int32_t *buf;
9c29b498 258 buf = NULL;
763cd6e3
RS
259
260 if (!zdr_enum (zdrs, (enum_t *) objp))
261 return FALSE;
262 return TRUE;
263}
264
af8d37c8 265uint32_t
763cd6e3
RS
266zdr_offset3 (ZDR *zdrs, offset3 *objp)
267{
268 register int32_t *buf;
9c29b498 269 buf = NULL;
763cd6e3 270
a0c4ea7d 271 if (!zdr_u_quad_t (zdrs, objp))
763cd6e3
RS
272 return FALSE;
273 return TRUE;
274}
275
af8d37c8 276uint32_t
763cd6e3
RS
277zdr_count3 (ZDR *zdrs, count3 *objp)
278{
279 register int32_t *buf;
9c29b498 280 buf = NULL;
763cd6e3
RS
281
282 if (!zdr_u_int (zdrs, objp))
283 return FALSE;
284 return TRUE;
285}
286
af8d37c8 287uint32_t
763cd6e3
RS
288zdr_wcc_attr (ZDR *zdrs, wcc_attr *objp)
289{
290 register int32_t *buf;
9c29b498 291 buf = NULL;
763cd6e3
RS
292
293 if (!zdr_size3 (zdrs, &objp->size))
294 return FALSE;
295 if (!zdr_nfstime3 (zdrs, &objp->mtime))
296 return FALSE;
297 if (!zdr_nfstime3 (zdrs, &objp->ctime))
298 return FALSE;
299 return TRUE;
300}
301
af8d37c8 302uint32_t
763cd6e3
RS
303zdr_pre_op_attr (ZDR *zdrs, pre_op_attr *objp)
304{
305 register int32_t *buf;
9c29b498 306 buf = NULL;
763cd6e3
RS
307
308 if (!zdr_bool (zdrs, &objp->attributes_follow))
309 return FALSE;
310 switch (objp->attributes_follow) {
311 case TRUE:
312 if (!zdr_wcc_attr (zdrs, &objp->pre_op_attr_u.attributes))
313 return FALSE;
314 break;
315 case FALSE:
316 break;
317 default:
318 return FALSE;
319 }
320 return TRUE;
321}
322
af8d37c8 323uint32_t
763cd6e3
RS
324zdr_wcc_data (ZDR *zdrs, wcc_data *objp)
325{
326 register int32_t *buf;
9c29b498 327 buf = NULL;
763cd6e3
RS
328
329 if (!zdr_pre_op_attr (zdrs, &objp->before))
330 return FALSE;
331 if (!zdr_post_op_attr (zdrs, &objp->after))
332 return FALSE;
333 return TRUE;
334}
335
af8d37c8 336uint32_t
763cd6e3
RS
337zdr_WRITE3args (ZDR *zdrs, WRITE3args *objp)
338{
339 register int32_t *buf;
9c29b498 340 buf = NULL;
763cd6e3
RS
341
342 if (!zdr_nfs_fh3 (zdrs, &objp->file))
343 return FALSE;
344 if (!zdr_offset3 (zdrs, &objp->offset))
345 return FALSE;
346 if (!zdr_count3 (zdrs, &objp->count))
347 return FALSE;
348 if (!zdr_stable_how (zdrs, &objp->stable))
349 return FALSE;
350 if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
351 return FALSE;
352 return TRUE;
353}
354
af8d37c8 355uint32_t
763cd6e3
RS
356zdr_writeverf3 (ZDR *zdrs, writeverf3 objp)
357{
358 register int32_t *buf;
9c29b498 359 buf = NULL;
763cd6e3
RS
360
361 if (!zdr_opaque (zdrs, objp, NFS3_WRITEVERFSIZE))
362 return FALSE;
363 return TRUE;
364}
365
af8d37c8 366uint32_t
763cd6e3
RS
367zdr_WRITE3resok (ZDR *zdrs, WRITE3resok *objp)
368{
369 register int32_t *buf;
9c29b498 370 buf = NULL;
763cd6e3
RS
371
372 if (!zdr_wcc_data (zdrs, &objp->file_wcc))
373 return FALSE;
374 if (!zdr_count3 (zdrs, &objp->count))
375 return FALSE;
376 if (!zdr_stable_how (zdrs, &objp->committed))
377 return FALSE;
378 if (!zdr_writeverf3 (zdrs, objp->verf))
379 return FALSE;
380 return TRUE;
381}
382
af8d37c8 383uint32_t
763cd6e3
RS
384zdr_WRITE3resfail (ZDR *zdrs, WRITE3resfail *objp)
385{
386 register int32_t *buf;
9c29b498 387 buf = NULL;
763cd6e3
RS
388
389 if (!zdr_wcc_data (zdrs, &objp->file_wcc))
390 return FALSE;
391 return TRUE;
392}
393
af8d37c8 394uint32_t
763cd6e3
RS
395zdr_WRITE3res (ZDR *zdrs, WRITE3res *objp)
396{
397 register int32_t *buf;
9c29b498 398 buf = NULL;
763cd6e3
RS
399
400 if (!zdr_nfsstat3 (zdrs, &objp->status))
401 return FALSE;
402 switch (objp->status) {
403 case NFS3_OK:
404 if (!zdr_WRITE3resok (zdrs, &objp->WRITE3res_u.resok))
405 return FALSE;
406 break;
407 default:
408 if (!zdr_WRITE3resfail (zdrs, &objp->WRITE3res_u.resfail))
409 return FALSE;
410 break;
411 }
412 return TRUE;
413}
414
af8d37c8 415uint32_t
763cd6e3
RS
416zdr_LOOKUP3args (ZDR *zdrs, LOOKUP3args *objp)
417{
418 register int32_t *buf;
9c29b498 419 buf = NULL;
763cd6e3
RS
420
421 if (!zdr_diropargs3 (zdrs, &objp->what))
422 return FALSE;
423 return TRUE;
424}
425
af8d37c8 426uint32_t
763cd6e3
RS
427zdr_LOOKUP3resok (ZDR *zdrs, LOOKUP3resok *objp)
428{
429 register int32_t *buf;
9c29b498 430 buf = NULL;
763cd6e3
RS
431
432 if (!zdr_nfs_fh3 (zdrs, &objp->object))
433 return FALSE;
434 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
435 return FALSE;
436 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
437 return FALSE;
438 return TRUE;
439}
440
af8d37c8 441uint32_t
763cd6e3
RS
442zdr_LOOKUP3resfail (ZDR *zdrs, LOOKUP3resfail *objp)
443{
444 register int32_t *buf;
9c29b498 445 buf = NULL;
763cd6e3
RS
446
447 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
448 return FALSE;
449 return TRUE;
450}
451
af8d37c8 452uint32_t
763cd6e3
RS
453zdr_LOOKUP3res (ZDR *zdrs, LOOKUP3res *objp)
454{
455 register int32_t *buf;
9c29b498 456 buf = NULL;
763cd6e3
RS
457
458 if (!zdr_nfsstat3 (zdrs, &objp->status))
459 return FALSE;
460 switch (objp->status) {
461 case NFS3_OK:
462 if (!zdr_LOOKUP3resok (zdrs, &objp->LOOKUP3res_u.resok))
463 return FALSE;
464 break;
465 default:
466 if (!zdr_LOOKUP3resfail (zdrs, &objp->LOOKUP3res_u.resfail))
467 return FALSE;
468 break;
469 }
470 return TRUE;
471}
472
af8d37c8 473uint32_t
763cd6e3
RS
474zdr_COMMIT3args (ZDR *zdrs, COMMIT3args *objp)
475{
476 register int32_t *buf;
9c29b498 477 buf = NULL;
763cd6e3
RS
478
479 if (!zdr_nfs_fh3 (zdrs, &objp->file))
480 return FALSE;
481 if (!zdr_offset3 (zdrs, &objp->offset))
482 return FALSE;
483 if (!zdr_count3 (zdrs, &objp->count))
484 return FALSE;
485 return TRUE;
486}
487
af8d37c8 488uint32_t
763cd6e3
RS
489zdr_COMMIT3resok (ZDR *zdrs, COMMIT3resok *objp)
490{
491 register int32_t *buf;
9c29b498 492 buf = NULL;
763cd6e3
RS
493
494 if (!zdr_wcc_data (zdrs, &objp->file_wcc))
495 return FALSE;
496 if (!zdr_writeverf3 (zdrs, objp->verf))
497 return FALSE;
498 return TRUE;
499}
500
af8d37c8 501uint32_t
763cd6e3
RS
502zdr_COMMIT3resfail (ZDR *zdrs, COMMIT3resfail *objp)
503{
504 register int32_t *buf;
9c29b498 505 buf = NULL;
763cd6e3
RS
506
507 if (!zdr_wcc_data (zdrs, &objp->file_wcc))
508 return FALSE;
509 return TRUE;
510}
511
af8d37c8 512uint32_t
763cd6e3
RS
513zdr_COMMIT3res (ZDR *zdrs, COMMIT3res *objp)
514{
515 register int32_t *buf;
9c29b498 516 buf = NULL;
763cd6e3
RS
517
518 if (!zdr_nfsstat3 (zdrs, &objp->status))
519 return FALSE;
520 switch (objp->status) {
521 case NFS3_OK:
522 if (!zdr_COMMIT3resok (zdrs, &objp->COMMIT3res_u.resok))
523 return FALSE;
524 break;
525 default:
526 if (!zdr_COMMIT3resfail (zdrs, &objp->COMMIT3res_u.resfail))
527 return FALSE;
528 break;
529 }
530 return TRUE;
531}
532
af8d37c8 533uint32_t
763cd6e3
RS
534zdr_ACCESS3args (ZDR *zdrs, ACCESS3args *objp)
535{
536 register int32_t *buf;
9c29b498 537 buf = NULL;
763cd6e3
RS
538
539 if (!zdr_nfs_fh3 (zdrs, &objp->object))
540 return FALSE;
541 if (!zdr_u_int (zdrs, &objp->access))
542 return FALSE;
543 return TRUE;
544}
545
af8d37c8 546uint32_t
763cd6e3
RS
547zdr_ACCESS3resok (ZDR *zdrs, ACCESS3resok *objp)
548{
549 register int32_t *buf;
9c29b498 550 buf = NULL;
763cd6e3
RS
551
552 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
553 return FALSE;
554 if (!zdr_u_int (zdrs, &objp->access))
555 return FALSE;
556 return TRUE;
557}
558
af8d37c8 559uint32_t
763cd6e3
RS
560zdr_ACCESS3resfail (ZDR *zdrs, ACCESS3resfail *objp)
561{
562 register int32_t *buf;
9c29b498 563 buf = NULL;
763cd6e3
RS
564
565 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
566 return FALSE;
567 return TRUE;
568}
569
af8d37c8 570uint32_t
763cd6e3
RS
571zdr_ACCESS3res (ZDR *zdrs, ACCESS3res *objp)
572{
573 register int32_t *buf;
9c29b498 574 buf = NULL;
763cd6e3
RS
575
576 if (!zdr_nfsstat3 (zdrs, &objp->status))
577 return FALSE;
578 switch (objp->status) {
579 case NFS3_OK:
580 if (!zdr_ACCESS3resok (zdrs, &objp->ACCESS3res_u.resok))
581 return FALSE;
582 break;
583 default:
584 if (!zdr_ACCESS3resfail (zdrs, &objp->ACCESS3res_u.resfail))
585 return FALSE;
586 break;
587 }
588 return TRUE;
589}
590
af8d37c8 591uint32_t
763cd6e3
RS
592zdr_GETATTR3args (ZDR *zdrs, GETATTR3args *objp)
593{
594 register int32_t *buf;
9c29b498 595 buf = NULL;
763cd6e3
RS
596
597 if (!zdr_nfs_fh3 (zdrs, &objp->object))
598 return FALSE;
599 return TRUE;
600}
601
af8d37c8 602uint32_t
763cd6e3
RS
603zdr_GETATTR3resok (ZDR *zdrs, GETATTR3resok *objp)
604{
605 register int32_t *buf;
9c29b498 606 buf = NULL;
763cd6e3
RS
607
608 if (!zdr_fattr3 (zdrs, &objp->obj_attributes))
609 return FALSE;
610 return TRUE;
611}
612
af8d37c8 613uint32_t
763cd6e3
RS
614zdr_GETATTR3res (ZDR *zdrs, GETATTR3res *objp)
615{
616 register int32_t *buf;
9c29b498 617 buf = NULL;
763cd6e3
RS
618
619 if (!zdr_nfsstat3 (zdrs, &objp->status))
620 return FALSE;
621 switch (objp->status) {
622 case NFS3_OK:
623 if (!zdr_GETATTR3resok (zdrs, &objp->GETATTR3res_u.resok))
624 return FALSE;
625 break;
626 default:
627 break;
628 }
629 return TRUE;
630}
631
af8d37c8 632uint32_t
763cd6e3
RS
633zdr_time_how (ZDR *zdrs, time_how *objp)
634{
635 register int32_t *buf;
9c29b498 636 buf = NULL;
763cd6e3
RS
637
638 if (!zdr_enum (zdrs, (enum_t *) objp))
639 return FALSE;
640 return TRUE;
641}
642
af8d37c8 643uint32_t
763cd6e3
RS
644zdr_set_mode3 (ZDR *zdrs, set_mode3 *objp)
645{
646 register int32_t *buf;
9c29b498 647 buf = NULL;
763cd6e3 648
cd954dd5 649 if (!zdr_bool (zdrs, &objp->set_it))
763cd6e3
RS
650 return FALSE;
651 switch (objp->set_it) {
652 case TRUE:
653 if (!zdr_mode3 (zdrs, &objp->set_mode3_u.mode))
654 return FALSE;
655 break;
656 default:
657 break;
658 }
659 return TRUE;
660}
661
af8d37c8 662uint32_t
763cd6e3
RS
663zdr_set_uid3 (ZDR *zdrs, set_uid3 *objp)
664{
665 register int32_t *buf;
9c29b498 666 buf = NULL;
763cd6e3
RS
667
668 if (!zdr_bool (zdrs, &objp->set_it))
669 return FALSE;
670 switch (objp->set_it) {
671 case TRUE:
672 if (!zdr_uid3 (zdrs, &objp->set_uid3_u.uid))
673 return FALSE;
674 break;
675 default:
676 break;
677 }
678 return TRUE;
679}
680
af8d37c8 681uint32_t
763cd6e3
RS
682zdr_set_gid3 (ZDR *zdrs, set_gid3 *objp)
683{
684 register int32_t *buf;
9c29b498 685 buf = NULL;
763cd6e3
RS
686
687 if (!zdr_bool (zdrs, &objp->set_it))
688 return FALSE;
689 switch (objp->set_it) {
690 case TRUE:
691 if (!zdr_gid3 (zdrs, &objp->set_gid3_u.gid))
692 return FALSE;
693 break;
694 default:
695 break;
696 }
697 return TRUE;
698}
699
af8d37c8 700uint32_t
763cd6e3
RS
701zdr_set_size3 (ZDR *zdrs, set_size3 *objp)
702{
703 register int32_t *buf;
9c29b498 704 buf = NULL;
763cd6e3
RS
705
706 if (!zdr_bool (zdrs, &objp->set_it))
707 return FALSE;
708 switch (objp->set_it) {
709 case TRUE:
710 if (!zdr_size3 (zdrs, &objp->set_size3_u.size))
711 return FALSE;
712 break;
713 default:
714 break;
715 }
716 return TRUE;
717}
718
af8d37c8 719uint32_t
763cd6e3
RS
720zdr_set_atime (ZDR *zdrs, set_atime *objp)
721{
722 register int32_t *buf;
9c29b498 723 buf = NULL;
763cd6e3
RS
724
725 if (!zdr_time_how (zdrs, &objp->set_it))
726 return FALSE;
727 switch (objp->set_it) {
728 case SET_TO_CLIENT_TIME:
729 if (!zdr_nfstime3 (zdrs, &objp->set_atime_u.atime))
730 return FALSE;
731 break;
732 default:
733 break;
734 }
735 return TRUE;
736}
737
af8d37c8 738uint32_t
763cd6e3
RS
739zdr_set_mtime (ZDR *zdrs, set_mtime *objp)
740{
741 register int32_t *buf;
9c29b498 742 buf = NULL;
763cd6e3
RS
743
744 if (!zdr_time_how (zdrs, &objp->set_it))
745 return FALSE;
746 switch (objp->set_it) {
747 case SET_TO_CLIENT_TIME:
748 if (!zdr_nfstime3 (zdrs, &objp->set_mtime_u.mtime))
749 return FALSE;
750 break;
751 default:
752 break;
753 }
754 return TRUE;
755}
756
af8d37c8 757uint32_t
763cd6e3
RS
758zdr_sattr3 (ZDR *zdrs, sattr3 *objp)
759{
760 register int32_t *buf;
9c29b498 761 buf = NULL;
763cd6e3
RS
762
763 if (!zdr_set_mode3 (zdrs, &objp->mode))
764 return FALSE;
765 if (!zdr_set_uid3 (zdrs, &objp->uid))
766 return FALSE;
767 if (!zdr_set_gid3 (zdrs, &objp->gid))
768 return FALSE;
769 if (!zdr_set_size3 (zdrs, &objp->size))
770 return FALSE;
771 if (!zdr_set_atime (zdrs, &objp->atime))
772 return FALSE;
773 if (!zdr_set_mtime (zdrs, &objp->mtime))
774 return FALSE;
775 return TRUE;
776}
777
af8d37c8 778uint32_t
763cd6e3
RS
779zdr_createmode3 (ZDR *zdrs, createmode3 *objp)
780{
781 register int32_t *buf;
9c29b498 782 buf = NULL;
763cd6e3
RS
783
784 if (!zdr_enum (zdrs, (enum_t *) objp))
785 return FALSE;
786 return TRUE;
787}
788
af8d37c8 789uint32_t
763cd6e3
RS
790zdr_createverf3 (ZDR *zdrs, createverf3 objp)
791{
792 register int32_t *buf;
9c29b498 793 buf = NULL;
763cd6e3
RS
794
795 if (!zdr_opaque (zdrs, objp, NFS3_CREATEVERFSIZE))
796 return FALSE;
797 return TRUE;
798}
799
af8d37c8 800uint32_t
763cd6e3
RS
801zdr_createhow3 (ZDR *zdrs, createhow3 *objp)
802{
803 register int32_t *buf;
9c29b498 804 buf = NULL;
763cd6e3
RS
805
806 if (!zdr_createmode3 (zdrs, &objp->mode))
807 return FALSE;
808 switch (objp->mode) {
809 case UNCHECKED:
810 if (!zdr_sattr3 (zdrs, &objp->createhow3_u.obj_attributes))
811 return FALSE;
812 break;
813 case GUARDED:
814 if (!zdr_sattr3 (zdrs, &objp->createhow3_u.g_obj_attributes))
815 return FALSE;
816 break;
817 case EXCLUSIVE:
818 if (!zdr_createverf3 (zdrs, objp->createhow3_u.verf))
819 return FALSE;
820 break;
821 default:
822 return FALSE;
823 }
824 return TRUE;
825}
826
af8d37c8 827uint32_t
763cd6e3
RS
828zdr_CREATE3args (ZDR *zdrs, CREATE3args *objp)
829{
830 register int32_t *buf;
9c29b498 831 buf = NULL;
763cd6e3
RS
832
833 if (!zdr_diropargs3 (zdrs, &objp->where))
834 return FALSE;
835 if (!zdr_createhow3 (zdrs, &objp->how))
836 return FALSE;
837 return TRUE;
838}
839
af8d37c8 840uint32_t
763cd6e3
RS
841zdr_post_op_fh3 (ZDR *zdrs, post_op_fh3 *objp)
842{
843 register int32_t *buf;
9c29b498 844 buf = NULL;
763cd6e3
RS
845
846 if (!zdr_bool (zdrs, &objp->handle_follows))
847 return FALSE;
848 switch (objp->handle_follows) {
849 case TRUE:
850 if (!zdr_nfs_fh3 (zdrs, &objp->post_op_fh3_u.handle))
851 return FALSE;
852 break;
853 case FALSE:
854 break;
855 default:
856 return FALSE;
857 }
858 return TRUE;
859}
860
af8d37c8 861uint32_t
763cd6e3
RS
862zdr_CREATE3resok (ZDR *zdrs, CREATE3resok *objp)
863{
864 register int32_t *buf;
9c29b498 865 buf = NULL;
763cd6e3
RS
866
867 if (!zdr_post_op_fh3 (zdrs, &objp->obj))
868 return FALSE;
869 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
870 return FALSE;
871 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
872 return FALSE;
873 return TRUE;
874}
875
af8d37c8 876uint32_t
763cd6e3
RS
877zdr_CREATE3resfail (ZDR *zdrs, CREATE3resfail *objp)
878{
879 register int32_t *buf;
9c29b498 880 buf = NULL;
763cd6e3
RS
881
882 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
883 return FALSE;
884 return TRUE;
885}
886
af8d37c8 887uint32_t
763cd6e3
RS
888zdr_CREATE3res (ZDR *zdrs, CREATE3res *objp)
889{
890 register int32_t *buf;
9c29b498 891 buf = NULL;
763cd6e3
RS
892
893 if (!zdr_nfsstat3 (zdrs, &objp->status))
894 return FALSE;
895 switch (objp->status) {
896 case NFS3_OK:
897 if (!zdr_CREATE3resok (zdrs, &objp->CREATE3res_u.resok))
898 return FALSE;
899 break;
900 default:
901 if (!zdr_CREATE3resfail (zdrs, &objp->CREATE3res_u.resfail))
902 return FALSE;
903 break;
904 }
905 return TRUE;
906}
907
af8d37c8 908uint32_t
763cd6e3
RS
909zdr_REMOVE3args (ZDR *zdrs, REMOVE3args *objp)
910{
911 register int32_t *buf;
9c29b498 912 buf = NULL;
763cd6e3
RS
913
914 if (!zdr_diropargs3 (zdrs, &objp->object))
915 return FALSE;
916 return TRUE;
917}
918
af8d37c8 919uint32_t
763cd6e3
RS
920zdr_REMOVE3resok (ZDR *zdrs, REMOVE3resok *objp)
921{
922 register int32_t *buf;
9c29b498 923 buf = NULL;
763cd6e3
RS
924
925 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
926 return FALSE;
927 return TRUE;
928}
929
af8d37c8 930uint32_t
763cd6e3
RS
931zdr_REMOVE3resfail (ZDR *zdrs, REMOVE3resfail *objp)
932{
933 register int32_t *buf;
9c29b498 934 buf = NULL;
763cd6e3
RS
935
936 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
937 return FALSE;
938 return TRUE;
939}
940
af8d37c8 941uint32_t
763cd6e3
RS
942zdr_REMOVE3res (ZDR *zdrs, REMOVE3res *objp)
943{
944 register int32_t *buf;
9c29b498 945 buf = NULL;
763cd6e3
RS
946
947 if (!zdr_nfsstat3 (zdrs, &objp->status))
948 return FALSE;
949 switch (objp->status) {
950 case NFS3_OK:
951 if (!zdr_REMOVE3resok (zdrs, &objp->REMOVE3res_u.resok))
952 return FALSE;
953 break;
954 default:
955 if (!zdr_REMOVE3resfail (zdrs, &objp->REMOVE3res_u.resfail))
956 return FALSE;
957 break;
958 }
959 return TRUE;
960}
961
af8d37c8 962uint32_t
763cd6e3
RS
963zdr_READ3args (ZDR *zdrs, READ3args *objp)
964{
965 register int32_t *buf;
9c29b498 966 buf = NULL;
763cd6e3
RS
967
968 if (!zdr_nfs_fh3 (zdrs, &objp->file))
969 return FALSE;
970 if (!zdr_offset3 (zdrs, &objp->offset))
971 return FALSE;
972 if (!zdr_count3 (zdrs, &objp->count))
973 return FALSE;
974 return TRUE;
975}
976
af8d37c8 977uint32_t
763cd6e3
RS
978zdr_READ3resok (ZDR *zdrs, READ3resok *objp)
979{
980 register int32_t *buf;
9c29b498 981 buf = NULL;
763cd6e3
RS
982
983 if (!zdr_post_op_attr (zdrs, &objp->file_attributes))
984 return FALSE;
985 if (!zdr_count3 (zdrs, &objp->count))
986 return FALSE;
987 if (!zdr_bool (zdrs, &objp->eof))
988 return FALSE;
989 if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
990 return FALSE;
991 return TRUE;
992}
993
af8d37c8 994uint32_t
763cd6e3
RS
995zdr_READ3resfail (ZDR *zdrs, READ3resfail *objp)
996{
997 register int32_t *buf;
9c29b498 998 buf = NULL;
763cd6e3
RS
999
1000 if (!zdr_post_op_attr (zdrs, &objp->file_attributes))
1001 return FALSE;
1002 return TRUE;
1003}
1004
af8d37c8 1005uint32_t
763cd6e3
RS
1006zdr_READ3res (ZDR *zdrs, READ3res *objp)
1007{
1008 register int32_t *buf;
9c29b498 1009 buf = NULL;
763cd6e3
RS
1010
1011 if (!zdr_nfsstat3 (zdrs, &objp->status))
1012 return FALSE;
1013 switch (objp->status) {
1014 case NFS3_OK:
1015 if (!zdr_READ3resok (zdrs, &objp->READ3res_u.resok))
1016 return FALSE;
1017 break;
1018 default:
1019 if (!zdr_READ3resfail (zdrs, &objp->READ3res_u.resfail))
1020 return FALSE;
1021 break;
1022 }
1023 return TRUE;
1024}
1025
af8d37c8 1026uint32_t
763cd6e3
RS
1027zdr_FSINFO3args (ZDR *zdrs, FSINFO3args *objp)
1028{
1029 register int32_t *buf;
9c29b498 1030 buf = NULL;
763cd6e3
RS
1031
1032 if (!zdr_nfs_fh3 (zdrs, &objp->fsroot))
1033 return FALSE;
1034 return TRUE;
1035}
1036
af8d37c8 1037uint32_t
763cd6e3
RS
1038zdr_FSINFO3resok (ZDR *zdrs, FSINFO3resok *objp)
1039{
1040 register int32_t *buf;
9c29b498 1041 buf = NULL;
763cd6e3
RS
1042
1043
1044 if (zdrs->x_op == ZDR_ENCODE) {
1045 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1046 return FALSE;
1047 buf = ZDR_INLINE (zdrs, 7 * BYTES_PER_ZDR_UNIT);
1048 if (buf == NULL) {
1049 if (!zdr_u_int (zdrs, &objp->rtmax))
1050 return FALSE;
1051 if (!zdr_u_int (zdrs, &objp->rtpref))
1052 return FALSE;
1053 if (!zdr_u_int (zdrs, &objp->rtmult))
1054 return FALSE;
1055 if (!zdr_u_int (zdrs, &objp->wtmax))
1056 return FALSE;
1057 if (!zdr_u_int (zdrs, &objp->wtpref))
1058 return FALSE;
1059 if (!zdr_u_int (zdrs, &objp->wtmult))
1060 return FALSE;
1061 if (!zdr_u_int (zdrs, &objp->dtpref))
1062 return FALSE;
1063
1064 } else {
1065 IZDR_PUT_U_LONG(buf, objp->rtmax);
1066 IZDR_PUT_U_LONG(buf, objp->rtpref);
1067 IZDR_PUT_U_LONG(buf, objp->rtmult);
1068 IZDR_PUT_U_LONG(buf, objp->wtmax);
1069 IZDR_PUT_U_LONG(buf, objp->wtpref);
1070 IZDR_PUT_U_LONG(buf, objp->wtmult);
1071 IZDR_PUT_U_LONG(buf, objp->dtpref);
1072 }
1073 if (!zdr_size3 (zdrs, &objp->maxfilesize))
1074 return FALSE;
1075 if (!zdr_nfstime3 (zdrs, &objp->time_delta))
1076 return FALSE;
1077 if (!zdr_u_int (zdrs, &objp->properties))
1078 return FALSE;
1079 return TRUE;
1080 } else if (zdrs->x_op == ZDR_DECODE) {
1081 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1082 return FALSE;
1083 buf = ZDR_INLINE (zdrs, 7 * BYTES_PER_ZDR_UNIT);
1084 if (buf == NULL) {
1085 if (!zdr_u_int (zdrs, &objp->rtmax))
1086 return FALSE;
1087 if (!zdr_u_int (zdrs, &objp->rtpref))
1088 return FALSE;
1089 if (!zdr_u_int (zdrs, &objp->rtmult))
1090 return FALSE;
1091 if (!zdr_u_int (zdrs, &objp->wtmax))
1092 return FALSE;
1093 if (!zdr_u_int (zdrs, &objp->wtpref))
1094 return FALSE;
1095 if (!zdr_u_int (zdrs, &objp->wtmult))
1096 return FALSE;
1097 if (!zdr_u_int (zdrs, &objp->dtpref))
1098 return FALSE;
1099
1100 } else {
1101 objp->rtmax = IZDR_GET_U_LONG(buf);
1102 objp->rtpref = IZDR_GET_U_LONG(buf);
1103 objp->rtmult = IZDR_GET_U_LONG(buf);
1104 objp->wtmax = IZDR_GET_U_LONG(buf);
1105 objp->wtpref = IZDR_GET_U_LONG(buf);
1106 objp->wtmult = IZDR_GET_U_LONG(buf);
1107 objp->dtpref = IZDR_GET_U_LONG(buf);
1108 }
1109 if (!zdr_size3 (zdrs, &objp->maxfilesize))
1110 return FALSE;
1111 if (!zdr_nfstime3 (zdrs, &objp->time_delta))
1112 return FALSE;
1113 if (!zdr_u_int (zdrs, &objp->properties))
1114 return FALSE;
1115 return TRUE;
1116 }
1117
1118 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1119 return FALSE;
1120 if (!zdr_u_int (zdrs, &objp->rtmax))
1121 return FALSE;
1122 if (!zdr_u_int (zdrs, &objp->rtpref))
1123 return FALSE;
1124 if (!zdr_u_int (zdrs, &objp->rtmult))
1125 return FALSE;
1126 if (!zdr_u_int (zdrs, &objp->wtmax))
1127 return FALSE;
1128 if (!zdr_u_int (zdrs, &objp->wtpref))
1129 return FALSE;
1130 if (!zdr_u_int (zdrs, &objp->wtmult))
1131 return FALSE;
1132 if (!zdr_u_int (zdrs, &objp->dtpref))
1133 return FALSE;
1134 if (!zdr_size3 (zdrs, &objp->maxfilesize))
1135 return FALSE;
1136 if (!zdr_nfstime3 (zdrs, &objp->time_delta))
1137 return FALSE;
1138 if (!zdr_u_int (zdrs, &objp->properties))
1139 return FALSE;
1140 return TRUE;
1141}
1142
af8d37c8 1143uint32_t
763cd6e3
RS
1144zdr_FSINFO3resfail (ZDR *zdrs, FSINFO3resfail *objp)
1145{
1146 register int32_t *buf;
9c29b498 1147 buf = NULL;
763cd6e3
RS
1148
1149 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1150 return FALSE;
1151 return TRUE;
1152}
1153
af8d37c8 1154uint32_t
763cd6e3
RS
1155zdr_FSINFO3res (ZDR *zdrs, FSINFO3res *objp)
1156{
1157 register int32_t *buf;
9c29b498 1158 buf = NULL;
763cd6e3
RS
1159
1160 if (!zdr_nfsstat3 (zdrs, &objp->status))
1161 return FALSE;
1162 switch (objp->status) {
1163 case NFS3_OK:
1164 if (!zdr_FSINFO3resok (zdrs, &objp->FSINFO3res_u.resok))
1165 return FALSE;
1166 break;
1167 default:
1168 if (!zdr_FSINFO3resfail (zdrs, &objp->FSINFO3res_u.resfail))
1169 return FALSE;
1170 break;
1171 }
1172 return TRUE;
1173}
1174
af8d37c8 1175uint32_t
763cd6e3
RS
1176zdr_FSSTAT3args (ZDR *zdrs, FSSTAT3args *objp)
1177{
1178 register int32_t *buf;
9c29b498 1179 buf = NULL;
763cd6e3
RS
1180
1181 if (!zdr_nfs_fh3 (zdrs, &objp->fsroot))
1182 return FALSE;
1183 return TRUE;
1184}
1185
af8d37c8 1186uint32_t
763cd6e3
RS
1187zdr_FSSTAT3resok (ZDR *zdrs, FSSTAT3resok *objp)
1188{
1189 register int32_t *buf;
9c29b498 1190 buf = NULL;
763cd6e3
RS
1191
1192 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1193 return FALSE;
1194 if (!zdr_size3 (zdrs, &objp->tbytes))
1195 return FALSE;
1196 if (!zdr_size3 (zdrs, &objp->fbytes))
1197 return FALSE;
1198 if (!zdr_size3 (zdrs, &objp->abytes))
1199 return FALSE;
1200 if (!zdr_size3 (zdrs, &objp->tfiles))
1201 return FALSE;
1202 if (!zdr_size3 (zdrs, &objp->ffiles))
1203 return FALSE;
1204 if (!zdr_size3 (zdrs, &objp->afiles))
1205 return FALSE;
1206 if (!zdr_u_int (zdrs, &objp->invarsec))
1207 return FALSE;
1208 return TRUE;
1209}
1210
af8d37c8 1211uint32_t
763cd6e3
RS
1212zdr_FSSTAT3resfail (ZDR *zdrs, FSSTAT3resfail *objp)
1213{
1214 register int32_t *buf;
9c29b498 1215 buf = NULL;
763cd6e3
RS
1216
1217 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1218 return FALSE;
1219 return TRUE;
1220}
1221
af8d37c8 1222uint32_t
763cd6e3
RS
1223zdr_FSSTAT3res (ZDR *zdrs, FSSTAT3res *objp)
1224{
1225 register int32_t *buf;
9c29b498 1226 buf = NULL;
763cd6e3
RS
1227
1228 if (!zdr_nfsstat3 (zdrs, &objp->status))
1229 return FALSE;
1230 switch (objp->status) {
1231 case NFS3_OK:
1232 if (!zdr_FSSTAT3resok (zdrs, &objp->FSSTAT3res_u.resok))
1233 return FALSE;
1234 break;
1235 default:
1236 if (!zdr_FSSTAT3resfail (zdrs, &objp->FSSTAT3res_u.resfail))
1237 return FALSE;
1238 break;
1239 }
1240 return TRUE;
1241}
1242
af8d37c8 1243uint32_t
763cd6e3
RS
1244zdr_PATHCONF3args (ZDR *zdrs, PATHCONF3args *objp)
1245{
1246 register int32_t *buf;
9c29b498 1247 buf = NULL;
763cd6e3
RS
1248
1249 if (!zdr_nfs_fh3 (zdrs, &objp->object))
1250 return FALSE;
1251 return TRUE;
1252}
1253
af8d37c8 1254uint32_t
763cd6e3
RS
1255zdr_PATHCONF3resok (ZDR *zdrs, PATHCONF3resok *objp)
1256{
1257 register int32_t *buf;
9c29b498 1258 buf = NULL;
763cd6e3
RS
1259
1260
1261 if (zdrs->x_op == ZDR_ENCODE) {
1262 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1263 return FALSE;
1264 buf = ZDR_INLINE (zdrs, 6 * BYTES_PER_ZDR_UNIT);
1265 if (buf == NULL) {
1266 if (!zdr_u_int (zdrs, &objp->linkmax))
1267 return FALSE;
1268 if (!zdr_u_int (zdrs, &objp->name_max))
1269 return FALSE;
1270 if (!zdr_bool (zdrs, &objp->no_trunc))
1271 return FALSE;
1272 if (!zdr_bool (zdrs, &objp->chown_restricted))
1273 return FALSE;
1274 if (!zdr_bool (zdrs, &objp->case_insensitive))
1275 return FALSE;
1276 if (!zdr_bool (zdrs, &objp->case_preserving))
1277 return FALSE;
1278 } else {
1279 IZDR_PUT_U_LONG(buf, objp->linkmax);
1280 IZDR_PUT_U_LONG(buf, objp->name_max);
1281 IZDR_PUT_BOOL(buf, objp->no_trunc);
1282 IZDR_PUT_BOOL(buf, objp->chown_restricted);
1283 IZDR_PUT_BOOL(buf, objp->case_insensitive);
1284 IZDR_PUT_BOOL(buf, objp->case_preserving);
1285 }
1286 return TRUE;
1287 } else if (zdrs->x_op == ZDR_DECODE) {
1288 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1289 return FALSE;
1290 buf = ZDR_INLINE (zdrs, 6 * BYTES_PER_ZDR_UNIT);
1291 if (buf == NULL) {
1292 if (!zdr_u_int (zdrs, &objp->linkmax))
1293 return FALSE;
1294 if (!zdr_u_int (zdrs, &objp->name_max))
1295 return FALSE;
1296 if (!zdr_bool (zdrs, &objp->no_trunc))
1297 return FALSE;
1298 if (!zdr_bool (zdrs, &objp->chown_restricted))
1299 return FALSE;
1300 if (!zdr_bool (zdrs, &objp->case_insensitive))
1301 return FALSE;
1302 if (!zdr_bool (zdrs, &objp->case_preserving))
1303 return FALSE;
1304 } else {
1305 objp->linkmax = IZDR_GET_U_LONG(buf);
1306 objp->name_max = IZDR_GET_U_LONG(buf);
1307 objp->no_trunc = IZDR_GET_BOOL(buf);
1308 objp->chown_restricted = IZDR_GET_BOOL(buf);
1309 objp->case_insensitive = IZDR_GET_BOOL(buf);
1310 objp->case_preserving = IZDR_GET_BOOL(buf);
1311 }
1312 return TRUE;
1313 }
1314
1315 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1316 return FALSE;
1317 if (!zdr_u_int (zdrs, &objp->linkmax))
1318 return FALSE;
1319 if (!zdr_u_int (zdrs, &objp->name_max))
1320 return FALSE;
1321 if (!zdr_bool (zdrs, &objp->no_trunc))
1322 return FALSE;
1323 if (!zdr_bool (zdrs, &objp->chown_restricted))
1324 return FALSE;
1325 if (!zdr_bool (zdrs, &objp->case_insensitive))
1326 return FALSE;
1327 if (!zdr_bool (zdrs, &objp->case_preserving))
1328 return FALSE;
1329 return TRUE;
1330}
1331
af8d37c8 1332uint32_t
763cd6e3
RS
1333zdr_PATHCONF3resfail (ZDR *zdrs, PATHCONF3resfail *objp)
1334{
1335 register int32_t *buf;
9c29b498 1336 buf = NULL;
763cd6e3
RS
1337
1338 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1339 return FALSE;
1340 return TRUE;
1341}
1342
af8d37c8 1343uint32_t
763cd6e3
RS
1344zdr_PATHCONF3res (ZDR *zdrs, PATHCONF3res *objp)
1345{
1346 register int32_t *buf;
9c29b498 1347 buf = NULL;
763cd6e3
RS
1348
1349 if (!zdr_nfsstat3 (zdrs, &objp->status))
1350 return FALSE;
1351 switch (objp->status) {
1352 case NFS3_OK:
1353 if (!zdr_PATHCONF3resok (zdrs, &objp->PATHCONF3res_u.resok))
1354 return FALSE;
1355 break;
1356 default:
1357 if (!zdr_PATHCONF3resfail (zdrs, &objp->PATHCONF3res_u.resfail))
1358 return FALSE;
1359 break;
1360 }
1361 return TRUE;
1362}
1363
af8d37c8 1364uint32_t
763cd6e3
RS
1365zdr_nfspath3 (ZDR *zdrs, nfspath3 *objp)
1366{
1367 register int32_t *buf;
9c29b498 1368 buf = NULL;
763cd6e3
RS
1369
1370 if (!zdr_string (zdrs, objp, ~0))
1371 return FALSE;
1372 return TRUE;
1373}
1374
af8d37c8 1375uint32_t
763cd6e3
RS
1376zdr_symlinkdata3 (ZDR *zdrs, symlinkdata3 *objp)
1377{
1378 register int32_t *buf;
9c29b498 1379 buf = NULL;
763cd6e3
RS
1380
1381 if (!zdr_sattr3 (zdrs, &objp->symlink_attributes))
1382 return FALSE;
1383 if (!zdr_nfspath3 (zdrs, &objp->symlink_data))
1384 return FALSE;
1385 return TRUE;
1386}
1387
af8d37c8 1388uint32_t
763cd6e3
RS
1389zdr_SYMLINK3args (ZDR *zdrs, SYMLINK3args *objp)
1390{
1391 register int32_t *buf;
9c29b498 1392 buf = NULL;
763cd6e3
RS
1393
1394 if (!zdr_diropargs3 (zdrs, &objp->where))
1395 return FALSE;
1396 if (!zdr_symlinkdata3 (zdrs, &objp->symlink))
1397 return FALSE;
1398 return TRUE;
1399}
1400
af8d37c8 1401uint32_t
763cd6e3
RS
1402zdr_SYMLINK3resok (ZDR *zdrs, SYMLINK3resok *objp)
1403{
1404 register int32_t *buf;
9c29b498 1405 buf = NULL;
763cd6e3
RS
1406
1407 if (!zdr_post_op_fh3 (zdrs, &objp->obj))
1408 return FALSE;
1409 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1410 return FALSE;
1411 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1412 return FALSE;
1413 return TRUE;
1414}
1415
af8d37c8 1416uint32_t
763cd6e3
RS
1417zdr_SYMLINK3resfail (ZDR *zdrs, SYMLINK3resfail *objp)
1418{
1419 register int32_t *buf;
9c29b498 1420 buf = NULL;
763cd6e3
RS
1421
1422 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1423 return FALSE;
1424 return TRUE;
1425}
1426
af8d37c8 1427uint32_t
763cd6e3
RS
1428zdr_SYMLINK3res (ZDR *zdrs, SYMLINK3res *objp)
1429{
1430 register int32_t *buf;
9c29b498 1431 buf = NULL;
763cd6e3
RS
1432
1433 if (!zdr_nfsstat3 (zdrs, &objp->status))
1434 return FALSE;
1435 switch (objp->status) {
1436 case NFS3_OK:
1437 if (!zdr_SYMLINK3resok (zdrs, &objp->SYMLINK3res_u.resok))
1438 return FALSE;
1439 break;
1440 default:
1441 if (!zdr_SYMLINK3resfail (zdrs, &objp->SYMLINK3res_u.resfail))
1442 return FALSE;
1443 break;
1444 }
1445 return TRUE;
1446}
1447
af8d37c8 1448uint32_t
763cd6e3
RS
1449zdr_READLINK3args (ZDR *zdrs, READLINK3args *objp)
1450{
1451 register int32_t *buf;
9c29b498 1452 buf = NULL;
763cd6e3
RS
1453
1454 if (!zdr_nfs_fh3 (zdrs, &objp->symlink))
1455 return FALSE;
1456 return TRUE;
1457}
1458
af8d37c8 1459uint32_t
763cd6e3
RS
1460zdr_READLINK3resok (ZDR *zdrs, READLINK3resok *objp)
1461{
1462 register int32_t *buf;
9c29b498 1463 buf = NULL;
763cd6e3
RS
1464
1465 if (!zdr_post_op_attr (zdrs, &objp->symlink_attributes))
1466 return FALSE;
1467 if (!zdr_nfspath3 (zdrs, &objp->data))
1468 return FALSE;
1469 return TRUE;
1470}
1471
af8d37c8 1472uint32_t
763cd6e3
RS
1473zdr_READLINK3resfail (ZDR *zdrs, READLINK3resfail *objp)
1474{
1475 register int32_t *buf;
9c29b498 1476 buf = NULL;
763cd6e3
RS
1477
1478 if (!zdr_post_op_attr (zdrs, &objp->symlink_attributes))
1479 return FALSE;
1480 return TRUE;
1481}
1482
af8d37c8 1483uint32_t
763cd6e3
RS
1484zdr_READLINK3res (ZDR *zdrs, READLINK3res *objp)
1485{
1486 register int32_t *buf;
9c29b498 1487 buf = NULL;
763cd6e3
RS
1488
1489 if (!zdr_nfsstat3 (zdrs, &objp->status))
1490 return FALSE;
1491 switch (objp->status) {
1492 case NFS3_OK:
1493 if (!zdr_READLINK3resok (zdrs, &objp->READLINK3res_u.resok))
1494 return FALSE;
1495 break;
1496 default:
1497 if (!zdr_READLINK3resfail (zdrs, &objp->READLINK3res_u.resfail))
1498 return FALSE;
1499 break;
1500 }
1501 return TRUE;
1502}
1503
af8d37c8 1504uint32_t
763cd6e3
RS
1505zdr_devicedata3 (ZDR *zdrs, devicedata3 *objp)
1506{
1507 register int32_t *buf;
9c29b498 1508 buf = NULL;
763cd6e3
RS
1509
1510 if (!zdr_sattr3 (zdrs, &objp->dev_attributes))
1511 return FALSE;
1512 if (!zdr_specdata3 (zdrs, &objp->spec))
1513 return FALSE;
1514 return TRUE;
1515}
1516
af8d37c8 1517uint32_t
763cd6e3
RS
1518zdr_mknoddata3 (ZDR *zdrs, mknoddata3 *objp)
1519{
1520 register int32_t *buf;
9c29b498 1521 buf = NULL;
763cd6e3
RS
1522
1523 if (!zdr_ftype3 (zdrs, &objp->type))
1524 return FALSE;
1525 switch (objp->type) {
1526 case NF3CHR:
1527 if (!zdr_devicedata3 (zdrs, &objp->mknoddata3_u.chr_device))
1528 return FALSE;
1529 break;
1530 case NF3BLK:
1531 if (!zdr_devicedata3 (zdrs, &objp->mknoddata3_u.blk_device))
1532 return FALSE;
1533 break;
1534 case NF3SOCK:
1535 if (!zdr_sattr3 (zdrs, &objp->mknoddata3_u.sock_attributes))
1536 return FALSE;
1537 break;
1538 case NF3FIFO:
1539 if (!zdr_sattr3 (zdrs, &objp->mknoddata3_u.pipe_attributes))
1540 return FALSE;
1541 break;
1542 default:
1543 break;
1544 }
1545 return TRUE;
1546}
1547
af8d37c8 1548uint32_t
763cd6e3
RS
1549zdr_MKNOD3args (ZDR *zdrs, MKNOD3args *objp)
1550{
1551 register int32_t *buf;
9c29b498 1552 buf = NULL;
763cd6e3
RS
1553
1554 if (!zdr_diropargs3 (zdrs, &objp->where))
1555 return FALSE;
1556 if (!zdr_mknoddata3 (zdrs, &objp->what))
1557 return FALSE;
1558 return TRUE;
1559}
1560
af8d37c8 1561uint32_t
763cd6e3
RS
1562zdr_MKNOD3resok (ZDR *zdrs, MKNOD3resok *objp)
1563{
1564 register int32_t *buf;
9c29b498 1565 buf = NULL;
763cd6e3
RS
1566
1567 if (!zdr_post_op_fh3 (zdrs, &objp->obj))
1568 return FALSE;
1569 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1570 return FALSE;
1571 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1572 return FALSE;
1573 return TRUE;
1574}
1575
af8d37c8 1576uint32_t
763cd6e3
RS
1577zdr_MKNOD3resfail (ZDR *zdrs, MKNOD3resfail *objp)
1578{
1579 register int32_t *buf;
9c29b498 1580 buf = NULL;
763cd6e3
RS
1581
1582 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1583 return FALSE;
1584 return TRUE;
1585}
1586
af8d37c8 1587uint32_t
763cd6e3
RS
1588zdr_MKNOD3res (ZDR *zdrs, MKNOD3res *objp)
1589{
1590 register int32_t *buf;
9c29b498 1591 buf = NULL;
763cd6e3
RS
1592
1593 if (!zdr_nfsstat3 (zdrs, &objp->status))
1594 return FALSE;
1595 switch (objp->status) {
1596 case NFS3_OK:
1597 if (!zdr_MKNOD3resok (zdrs, &objp->MKNOD3res_u.resok))
1598 return FALSE;
1599 break;
1600 default:
1601 if (!zdr_MKNOD3resfail (zdrs, &objp->MKNOD3res_u.resfail))
1602 return FALSE;
1603 break;
1604 }
1605 return TRUE;
1606}
1607
af8d37c8 1608uint32_t
763cd6e3
RS
1609zdr_MKDIR3args (ZDR *zdrs, MKDIR3args *objp)
1610{
1611 register int32_t *buf;
9c29b498 1612 buf = NULL;
763cd6e3
RS
1613
1614 if (!zdr_diropargs3 (zdrs, &objp->where))
1615 return FALSE;
1616 if (!zdr_sattr3 (zdrs, &objp->attributes))
1617 return FALSE;
1618 return TRUE;
1619}
1620
af8d37c8 1621uint32_t
763cd6e3
RS
1622zdr_MKDIR3resok (ZDR *zdrs, MKDIR3resok *objp)
1623{
1624 register int32_t *buf;
9c29b498 1625 buf = NULL;
763cd6e3
RS
1626
1627 if (!zdr_post_op_fh3 (zdrs, &objp->obj))
1628 return FALSE;
1629 if (!zdr_post_op_attr (zdrs, &objp->obj_attributes))
1630 return FALSE;
1631 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1632 return FALSE;
1633 return TRUE;
1634}
1635
af8d37c8 1636uint32_t
763cd6e3
RS
1637zdr_MKDIR3resfail (ZDR *zdrs, MKDIR3resfail *objp)
1638{
1639 register int32_t *buf;
9c29b498 1640 buf = NULL;
763cd6e3
RS
1641
1642 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1643 return FALSE;
1644 return TRUE;
1645}
1646
af8d37c8 1647uint32_t
763cd6e3
RS
1648zdr_MKDIR3res (ZDR *zdrs, MKDIR3res *objp)
1649{
1650 register int32_t *buf;
9c29b498 1651 buf = NULL;
763cd6e3
RS
1652
1653 if (!zdr_nfsstat3 (zdrs, &objp->status))
1654 return FALSE;
1655 switch (objp->status) {
1656 case NFS3_OK:
1657 if (!zdr_MKDIR3resok (zdrs, &objp->MKDIR3res_u.resok))
1658 return FALSE;
1659 break;
1660 default:
1661 if (!zdr_MKDIR3resfail (zdrs, &objp->MKDIR3res_u.resfail))
1662 return FALSE;
1663 break;
1664 }
1665 return TRUE;
1666}
1667
af8d37c8 1668uint32_t
763cd6e3
RS
1669zdr_RMDIR3args (ZDR *zdrs, RMDIR3args *objp)
1670{
1671 register int32_t *buf;
9c29b498 1672 buf = NULL;
763cd6e3
RS
1673
1674 if (!zdr_diropargs3 (zdrs, &objp->object))
1675 return FALSE;
1676 return TRUE;
1677}
1678
af8d37c8 1679uint32_t
763cd6e3
RS
1680zdr_RMDIR3resok (ZDR *zdrs, RMDIR3resok *objp)
1681{
1682 register int32_t *buf;
9c29b498 1683 buf = NULL;
763cd6e3
RS
1684
1685 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1686 return FALSE;
1687 return TRUE;
1688}
1689
af8d37c8 1690uint32_t
763cd6e3
RS
1691zdr_RMDIR3resfail (ZDR *zdrs, RMDIR3resfail *objp)
1692{
1693 register int32_t *buf;
9c29b498 1694 buf = NULL;
763cd6e3
RS
1695
1696 if (!zdr_wcc_data (zdrs, &objp->dir_wcc))
1697 return FALSE;
1698 return TRUE;
1699}
1700
af8d37c8 1701uint32_t
763cd6e3
RS
1702zdr_RMDIR3res (ZDR *zdrs, RMDIR3res *objp)
1703{
1704 register int32_t *buf;
9c29b498 1705 buf = NULL;
763cd6e3
RS
1706
1707 if (!zdr_nfsstat3 (zdrs, &objp->status))
1708 return FALSE;
1709 switch (objp->status) {
1710 case NFS3_OK:
1711 if (!zdr_RMDIR3resok (zdrs, &objp->RMDIR3res_u.resok))
1712 return FALSE;
1713 break;
1714 default:
1715 if (!zdr_RMDIR3resfail (zdrs, &objp->RMDIR3res_u.resfail))
1716 return FALSE;
1717 break;
1718 }
1719 return TRUE;
1720}
1721
af8d37c8 1722uint32_t
763cd6e3
RS
1723zdr_RENAME3args (ZDR *zdrs, RENAME3args *objp)
1724{
1725 register int32_t *buf;
9c29b498 1726 buf = NULL;
763cd6e3
RS
1727
1728 if (!zdr_diropargs3 (zdrs, &objp->from))
1729 return FALSE;
1730 if (!zdr_diropargs3 (zdrs, &objp->to))
1731 return FALSE;
1732 return TRUE;
1733}
1734
af8d37c8 1735uint32_t
763cd6e3
RS
1736zdr_RENAME3resok (ZDR *zdrs, RENAME3resok *objp)
1737{
1738 register int32_t *buf;
9c29b498 1739 buf = NULL;
763cd6e3
RS
1740
1741 if (!zdr_wcc_data (zdrs, &objp->fromdir_wcc))
1742 return FALSE;
1743 if (!zdr_wcc_data (zdrs, &objp->todir_wcc))
1744 return FALSE;
1745 return TRUE;
1746}
1747
af8d37c8 1748uint32_t
763cd6e3
RS
1749zdr_RENAME3resfail (ZDR *zdrs, RENAME3resfail *objp)
1750{
1751 register int32_t *buf;
9c29b498 1752 buf = NULL;
763cd6e3
RS
1753
1754 if (!zdr_wcc_data (zdrs, &objp->fromdir_wcc))
1755 return FALSE;
1756 if (!zdr_wcc_data (zdrs, &objp->todir_wcc))
1757 return FALSE;
1758 return TRUE;
1759}
1760
af8d37c8 1761uint32_t
763cd6e3
RS
1762zdr_RENAME3res (ZDR *zdrs, RENAME3res *objp)
1763{
1764 register int32_t *buf;
9c29b498 1765 buf = NULL;
763cd6e3
RS
1766
1767 if (!zdr_nfsstat3 (zdrs, &objp->status))
1768 return FALSE;
1769 switch (objp->status) {
1770 case NFS3_OK:
1771 if (!zdr_RENAME3resok (zdrs, &objp->RENAME3res_u.resok))
1772 return FALSE;
1773 break;
1774 default:
1775 if (!zdr_RENAME3resfail (zdrs, &objp->RENAME3res_u.resfail))
1776 return FALSE;
1777 break;
1778 }
1779 return TRUE;
1780}
1781
af8d37c8 1782uint32_t
763cd6e3
RS
1783zdr_READDIRPLUS3args (ZDR *zdrs, READDIRPLUS3args *objp)
1784{
1785 register int32_t *buf;
9c29b498 1786 buf = NULL;
763cd6e3
RS
1787
1788 if (!zdr_nfs_fh3 (zdrs, &objp->dir))
1789 return FALSE;
1790 if (!zdr_cookie3 (zdrs, &objp->cookie))
1791 return FALSE;
1792 if (!zdr_cookieverf3 (zdrs, objp->cookieverf))
1793 return FALSE;
1794 if (!zdr_count3 (zdrs, &objp->dircount))
1795 return FALSE;
1796 if (!zdr_count3 (zdrs, &objp->maxcount))
1797 return FALSE;
1798 return TRUE;
1799}
1800
af8d37c8 1801uint32_t
763cd6e3
RS
1802zdr_entryplus3 (ZDR *zdrs, entryplus3 *objp)
1803{
1804 register int32_t *buf;
9c29b498 1805 buf = NULL;
763cd6e3
RS
1806
1807 if (!zdr_fileid3 (zdrs, &objp->fileid))
1808 return FALSE;
1809 if (!zdr_filename3 (zdrs, &objp->name))
1810 return FALSE;
1811 if (!zdr_cookie3 (zdrs, &objp->cookie))
1812 return FALSE;
1813 if (!zdr_post_op_attr (zdrs, &objp->name_attributes))
1814 return FALSE;
1815 if (!zdr_post_op_fh3 (zdrs, &objp->name_handle))
1816 return FALSE;
1817 if (!zdr_pointer (zdrs, (char **)&objp->nextentry, sizeof (entryplus3), (zdrproc_t) zdr_entryplus3))
1818 return FALSE;
1819 return TRUE;
1820}
1821
af8d37c8 1822uint32_t
763cd6e3
RS
1823zdr_dirlistplus3 (ZDR *zdrs, dirlistplus3 *objp)
1824{
1825 register int32_t *buf;
9c29b498 1826 buf = NULL;
763cd6e3
RS
1827
1828 if (!zdr_pointer (zdrs, (char **)&objp->entries, sizeof (entryplus3), (zdrproc_t) zdr_entryplus3))
1829 return FALSE;
1830 if (!zdr_bool (zdrs, &objp->eof))
1831 return FALSE;
1832 return TRUE;
1833}
1834
af8d37c8 1835uint32_t
763cd6e3
RS
1836zdr_READDIRPLUS3resok (ZDR *zdrs, READDIRPLUS3resok *objp)
1837{
1838 register int32_t *buf;
9c29b498 1839 buf = NULL;
763cd6e3
RS
1840
1841 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
1842 return FALSE;
1843 if (!zdr_cookieverf3 (zdrs, objp->cookieverf))
1844 return FALSE;
1845 if (!zdr_dirlistplus3 (zdrs, &objp->reply))
1846 return FALSE;
1847 return TRUE;
1848}
1849
af8d37c8 1850uint32_t
763cd6e3
RS
1851zdr_READDIRPLUS3resfail (ZDR *zdrs, READDIRPLUS3resfail *objp)
1852{
1853 register int32_t *buf;
9c29b498 1854 buf = NULL;
763cd6e3
RS
1855
1856 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
1857 return FALSE;
1858 return TRUE;
1859}
1860
af8d37c8 1861uint32_t
763cd6e3
RS
1862zdr_READDIRPLUS3res (ZDR *zdrs, READDIRPLUS3res *objp)
1863{
1864 register int32_t *buf;
9c29b498 1865 buf = NULL;
763cd6e3
RS
1866
1867 if (!zdr_nfsstat3 (zdrs, &objp->status))
1868 return FALSE;
1869 switch (objp->status) {
1870 case NFS3_OK:
1871 if (!zdr_READDIRPLUS3resok (zdrs, &objp->READDIRPLUS3res_u.resok))
1872 return FALSE;
1873 break;
1874 default:
1875 if (!zdr_READDIRPLUS3resfail (zdrs, &objp->READDIRPLUS3res_u.resfail))
1876 return FALSE;
1877 break;
1878 }
1879 return TRUE;
1880}
1881
af8d37c8 1882uint32_t
763cd6e3
RS
1883zdr_READDIR3args (ZDR *zdrs, READDIR3args *objp)
1884{
1885 register int32_t *buf;
9c29b498 1886 buf = NULL;
763cd6e3
RS
1887
1888 if (!zdr_nfs_fh3 (zdrs, &objp->dir))
1889 return FALSE;
1890 if (!zdr_cookie3 (zdrs, &objp->cookie))
1891 return FALSE;
1892 if (!zdr_cookieverf3 (zdrs, objp->cookieverf))
1893 return FALSE;
1894 if (!zdr_count3 (zdrs, &objp->count))
1895 return FALSE;
1896 return TRUE;
1897}
1898
af8d37c8 1899uint32_t
763cd6e3
RS
1900zdr_entry3 (ZDR *zdrs, entry3 *objp)
1901{
1902 register int32_t *buf;
9c29b498 1903 buf = NULL;
763cd6e3
RS
1904
1905 if (!zdr_fileid3 (zdrs, &objp->fileid))
1906 return FALSE;
1907 if (!zdr_filename3 (zdrs, &objp->name))
1908 return FALSE;
1909 if (!zdr_cookie3 (zdrs, &objp->cookie))
1910 return FALSE;
1911 if (!zdr_pointer (zdrs, (char **)&objp->nextentry, sizeof (entry3), (zdrproc_t) zdr_entry3))
1912 return FALSE;
1913 return TRUE;
1914}
1915
af8d37c8 1916uint32_t
763cd6e3
RS
1917zdr_dirlist3 (ZDR *zdrs, dirlist3 *objp)
1918{
1919 register int32_t *buf;
9c29b498 1920 buf = NULL;
763cd6e3
RS
1921
1922 if (!zdr_pointer (zdrs, (char **)&objp->entries, sizeof (entry3), (zdrproc_t) zdr_entry3))
1923 return FALSE;
1924 if (!zdr_bool (zdrs, &objp->eof))
1925 return FALSE;
1926 return TRUE;
1927}
1928
af8d37c8 1929uint32_t
763cd6e3
RS
1930zdr_READDIR3resok (ZDR *zdrs, READDIR3resok *objp)
1931{
1932 register int32_t *buf;
9c29b498 1933 buf = NULL;
763cd6e3
RS
1934
1935 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
1936 return FALSE;
1937 if (!zdr_cookieverf3 (zdrs, objp->cookieverf))
1938 return FALSE;
1939 if (!zdr_dirlist3 (zdrs, &objp->reply))
1940 return FALSE;
1941 return TRUE;
1942}
1943
af8d37c8 1944uint32_t
763cd6e3
RS
1945zdr_READDIR3resfail (ZDR *zdrs, READDIR3resfail *objp)
1946{
1947 register int32_t *buf;
9c29b498 1948 buf = NULL;
763cd6e3
RS
1949
1950 if (!zdr_post_op_attr (zdrs, &objp->dir_attributes))
1951 return FALSE;
1952 return TRUE;
1953}
1954
af8d37c8 1955uint32_t
763cd6e3
RS
1956zdr_READDIR3res (ZDR *zdrs, READDIR3res *objp)
1957{
1958 register int32_t *buf;
9c29b498 1959 buf = NULL;
763cd6e3
RS
1960
1961 if (!zdr_nfsstat3 (zdrs, &objp->status))
1962 return FALSE;
1963 switch (objp->status) {
1964 case NFS3_OK:
1965 if (!zdr_READDIR3resok (zdrs, &objp->READDIR3res_u.resok))
1966 return FALSE;
1967 break;
1968 default:
1969 if (!zdr_READDIR3resfail (zdrs, &objp->READDIR3res_u.resfail))
1970 return FALSE;
1971 break;
1972 }
1973 return TRUE;
1974}
1975
af8d37c8 1976uint32_t
763cd6e3
RS
1977zdr_LINK3args (ZDR *zdrs, LINK3args *objp)
1978{
1979 register int32_t *buf;
9c29b498 1980 buf = NULL;
763cd6e3
RS
1981
1982 if (!zdr_nfs_fh3 (zdrs, &objp->file))
1983 return FALSE;
1984 if (!zdr_diropargs3 (zdrs, &objp->link))
1985 return FALSE;
1986 return TRUE;
1987}
1988
af8d37c8 1989uint32_t
763cd6e3
RS
1990zdr_LINK3resok (ZDR *zdrs, LINK3resok *objp)
1991{
1992 register int32_t *buf;
9c29b498 1993 buf = NULL;
763cd6e3
RS
1994
1995 if (!zdr_post_op_attr (zdrs, &objp->file_attributes))
1996 return FALSE;
1997 if (!zdr_wcc_data (zdrs, &objp->linkdir_wcc))
1998 return FALSE;
1999 return TRUE;
2000}
2001
af8d37c8 2002uint32_t
763cd6e3
RS
2003zdr_LINK3resfail (ZDR *zdrs, LINK3resfail *objp)
2004{
2005 register int32_t *buf;
9c29b498 2006 buf = NULL;
763cd6e3
RS
2007
2008 if (!zdr_post_op_attr (zdrs, &objp->file_attributes))
2009 return FALSE;
2010 if (!zdr_wcc_data (zdrs, &objp->linkdir_wcc))
2011 return FALSE;
2012 return TRUE;
2013}
2014
af8d37c8 2015uint32_t
763cd6e3
RS
2016zdr_LINK3res (ZDR *zdrs, LINK3res *objp)
2017{
2018 register int32_t *buf;
9c29b498 2019 buf = NULL;
763cd6e3
RS
2020
2021 if (!zdr_nfsstat3 (zdrs, &objp->status))
2022 return FALSE;
2023 switch (objp->status) {
2024 case NFS3_OK:
2025 if (!zdr_LINK3resok (zdrs, &objp->LINK3res_u.resok))
2026 return FALSE;
2027 break;
2028 default:
2029 if (!zdr_LINK3resfail (zdrs, &objp->LINK3res_u.resfail))
2030 return FALSE;
2031 break;
2032 }
2033 return TRUE;
2034}
2035
af8d37c8 2036uint32_t
763cd6e3
RS
2037zdr_sattrguard3 (ZDR *zdrs, sattrguard3 *objp)
2038{
2039 register int32_t *buf;
9c29b498 2040 buf = NULL;
763cd6e3
RS
2041
2042 if (!zdr_bool (zdrs, &objp->check))
2043 return FALSE;
2044 switch (objp->check) {
2045 case TRUE:
2046 if (!zdr_nfstime3 (zdrs, &objp->sattrguard3_u.obj_ctime))
2047 return FALSE;
2048 break;
2049 case FALSE:
2050 break;
2051 default:
2052 return FALSE;
2053 }
2054 return TRUE;
2055}
2056
af8d37c8 2057uint32_t
763cd6e3
RS
2058zdr_SETATTR3args (ZDR *zdrs, SETATTR3args *objp)
2059{
2060 register int32_t *buf;
9c29b498 2061 buf = NULL;
763cd6e3
RS
2062
2063 if (!zdr_nfs_fh3 (zdrs, &objp->object))
2064 return FALSE;
2065 if (!zdr_sattr3 (zdrs, &objp->new_attributes))
2066 return FALSE;
2067 if (!zdr_sattrguard3 (zdrs, &objp->guard))
2068 return FALSE;
2069 return TRUE;
2070}
2071
af8d37c8 2072uint32_t
763cd6e3
RS
2073zdr_SETATTR3resok (ZDR *zdrs, SETATTR3resok *objp)
2074{
2075 register int32_t *buf;
9c29b498 2076 buf = NULL;
763cd6e3
RS
2077
2078 if (!zdr_wcc_data (zdrs, &objp->obj_wcc))
2079 return FALSE;
2080 return TRUE;
2081}
2082
af8d37c8 2083uint32_t
763cd6e3
RS
2084zdr_SETATTR3resfail (ZDR *zdrs, SETATTR3resfail *objp)
2085{
2086 register int32_t *buf;
9c29b498 2087 buf = NULL;
763cd6e3
RS
2088
2089 if (!zdr_wcc_data (zdrs, &objp->obj_wcc))
2090 return FALSE;
2091 return TRUE;
2092}
2093
af8d37c8 2094uint32_t
763cd6e3
RS
2095zdr_SETATTR3res (ZDR *zdrs, SETATTR3res *objp)
2096{
2097 register int32_t *buf;
9c29b498 2098 buf = NULL;
763cd6e3
RS
2099
2100 if (!zdr_nfsstat3 (zdrs, &objp->status))
2101 return FALSE;
2102 switch (objp->status) {
2103 case NFS3_OK:
2104 if (!zdr_SETATTR3resok (zdrs, &objp->SETATTR3res_u.resok))
2105 return FALSE;
2106 break;
2107 default:
2108 if (!zdr_SETATTR3resfail (zdrs, &objp->SETATTR3res_u.resfail))
2109 return FALSE;
2110 break;
2111 }
2112 return TRUE;
2113}
2114
af8d37c8 2115uint32_t
f38aacf8
RS
2116zdr_fhandle2 (ZDR *zdrs, fhandle2 objp)
2117{
2118 register int32_t *buf;
2119 buf = NULL;
2120
2121 if (!zdr_opaque (zdrs, objp, FHSIZE2))
2122 return FALSE;
2123 return TRUE;
2124}
2125
af8d37c8 2126uint32_t
f38aacf8
RS
2127zdr_ftype2 (ZDR *zdrs, ftype2 *objp)
2128{
2129 register int32_t *buf;
2130 buf = NULL;
2131
2132 if (!zdr_enum (zdrs, (enum_t *) objp))
2133 return FALSE;
2134 return TRUE;
2135}
2136
af8d37c8 2137uint32_t
f38aacf8
RS
2138zdr_fattr2 (ZDR *zdrs, fattr2 *objp)
2139{
2140 register int32_t *buf;
2141 buf = NULL;
2142
2143
2144 if (zdrs->x_op == ZDR_ENCODE) {
2145 if (!zdr_ftype2 (zdrs, &objp->type))
2146 return FALSE;
2147 buf = ZDR_INLINE (zdrs, 10 * BYTES_PER_ZDR_UNIT);
2148 if (buf == NULL) {
2149 if (!zdr_u_int (zdrs, &objp->mode))
2150 return FALSE;
2151 if (!zdr_u_int (zdrs, &objp->nlink))
2152 return FALSE;
2153 if (!zdr_u_int (zdrs, &objp->uid))
2154 return FALSE;
2155 if (!zdr_u_int (zdrs, &objp->gid))
2156 return FALSE;
2157 if (!zdr_u_int (zdrs, &objp->size))
2158 return FALSE;
2159 if (!zdr_u_int (zdrs, &objp->blocksize))
2160 return FALSE;
2161 if (!zdr_u_int (zdrs, &objp->rdev))
2162 return FALSE;
2163 if (!zdr_u_int (zdrs, &objp->blocks))
2164 return FALSE;
2165 if (!zdr_u_int (zdrs, &objp->fsid))
2166 return FALSE;
2167 if (!zdr_u_int (zdrs, &objp->fileid))
2168 return FALSE;
2169
2170 } else {
2171 IZDR_PUT_U_LONG(buf, objp->mode);
2172 IZDR_PUT_U_LONG(buf, objp->nlink);
2173 IZDR_PUT_U_LONG(buf, objp->uid);
2174 IZDR_PUT_U_LONG(buf, objp->gid);
2175 IZDR_PUT_U_LONG(buf, objp->size);
2176 IZDR_PUT_U_LONG(buf, objp->blocksize);
2177 IZDR_PUT_U_LONG(buf, objp->rdev);
2178 IZDR_PUT_U_LONG(buf, objp->blocks);
2179 IZDR_PUT_U_LONG(buf, objp->fsid);
2180 IZDR_PUT_U_LONG(buf, objp->fileid);
2181 }
2182 if (!zdr_nfstime3 (zdrs, &objp->atime))
2183 return FALSE;
2184 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2185 return FALSE;
2186 if (!zdr_nfstime3 (zdrs, &objp->ctime))
2187 return FALSE;
2188 return TRUE;
2189 } else if (zdrs->x_op == ZDR_DECODE) {
2190 if (!zdr_ftype2 (zdrs, &objp->type))
2191 return FALSE;
2192 buf = ZDR_INLINE (zdrs, 10 * BYTES_PER_ZDR_UNIT);
2193 if (buf == NULL) {
2194 if (!zdr_u_int (zdrs, &objp->mode))
2195 return FALSE;
2196 if (!zdr_u_int (zdrs, &objp->nlink))
2197 return FALSE;
2198 if (!zdr_u_int (zdrs, &objp->uid))
2199 return FALSE;
2200 if (!zdr_u_int (zdrs, &objp->gid))
2201 return FALSE;
2202 if (!zdr_u_int (zdrs, &objp->size))
2203 return FALSE;
2204 if (!zdr_u_int (zdrs, &objp->blocksize))
2205 return FALSE;
2206 if (!zdr_u_int (zdrs, &objp->rdev))
2207 return FALSE;
2208 if (!zdr_u_int (zdrs, &objp->blocks))
2209 return FALSE;
2210 if (!zdr_u_int (zdrs, &objp->fsid))
2211 return FALSE;
2212 if (!zdr_u_int (zdrs, &objp->fileid))
2213 return FALSE;
2214
2215 } else {
2216 objp->mode = IZDR_GET_U_LONG(buf);
2217 objp->nlink = IZDR_GET_U_LONG(buf);
2218 objp->uid = IZDR_GET_U_LONG(buf);
2219 objp->gid = IZDR_GET_U_LONG(buf);
2220 objp->size = IZDR_GET_U_LONG(buf);
2221 objp->blocksize = IZDR_GET_U_LONG(buf);
2222 objp->rdev = IZDR_GET_U_LONG(buf);
2223 objp->blocks = IZDR_GET_U_LONG(buf);
2224 objp->fsid = IZDR_GET_U_LONG(buf);
2225 objp->fileid = IZDR_GET_U_LONG(buf);
2226 }
2227 if (!zdr_nfstime3 (zdrs, &objp->atime))
2228 return FALSE;
2229 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2230 return FALSE;
2231 if (!zdr_nfstime3 (zdrs, &objp->ctime))
2232 return FALSE;
2233 return TRUE;
2234 }
2235
2236 if (!zdr_ftype2 (zdrs, &objp->type))
2237 return FALSE;
2238 if (!zdr_u_int (zdrs, &objp->mode))
2239 return FALSE;
2240 if (!zdr_u_int (zdrs, &objp->nlink))
2241 return FALSE;
2242 if (!zdr_u_int (zdrs, &objp->uid))
2243 return FALSE;
2244 if (!zdr_u_int (zdrs, &objp->gid))
2245 return FALSE;
2246 if (!zdr_u_int (zdrs, &objp->size))
2247 return FALSE;
2248 if (!zdr_u_int (zdrs, &objp->blocksize))
2249 return FALSE;
2250 if (!zdr_u_int (zdrs, &objp->rdev))
2251 return FALSE;
2252 if (!zdr_u_int (zdrs, &objp->blocks))
2253 return FALSE;
2254 if (!zdr_u_int (zdrs, &objp->fsid))
2255 return FALSE;
2256 if (!zdr_u_int (zdrs, &objp->fileid))
2257 return FALSE;
2258 if (!zdr_nfstime3 (zdrs, &objp->atime))
2259 return FALSE;
2260 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2261 return FALSE;
2262 if (!zdr_nfstime3 (zdrs, &objp->ctime))
2263 return FALSE;
2264 return TRUE;
2265}
2266
af8d37c8 2267uint32_t
f38aacf8
RS
2268zdr_sattr2 (ZDR *zdrs, sattr2 *objp)
2269{
2270 register int32_t *buf;
2271 buf = NULL;
2272
2273
2274 if (zdrs->x_op == ZDR_ENCODE) {
2275 buf = ZDR_INLINE (zdrs, 4 * BYTES_PER_ZDR_UNIT);
2276 if (buf == NULL) {
2277 if (!zdr_u_int (zdrs, &objp->mode))
2278 return FALSE;
2279 if (!zdr_u_int (zdrs, &objp->uid))
2280 return FALSE;
2281 if (!zdr_u_int (zdrs, &objp->gid))
2282 return FALSE;
2283 if (!zdr_u_int (zdrs, &objp->size))
2284 return FALSE;
2285
2286 } else {
2287 IZDR_PUT_U_LONG(buf, objp->mode);
2288 IZDR_PUT_U_LONG(buf, objp->uid);
2289 IZDR_PUT_U_LONG(buf, objp->gid);
2290 IZDR_PUT_U_LONG(buf, objp->size);
2291 }
2292 if (!zdr_nfstime3 (zdrs, &objp->atime))
2293 return FALSE;
2294 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2295 return FALSE;
2296 return TRUE;
2297 } else if (zdrs->x_op == ZDR_DECODE) {
2298 buf = ZDR_INLINE (zdrs, 4 * BYTES_PER_ZDR_UNIT);
2299 if (buf == NULL) {
2300 if (!zdr_u_int (zdrs, &objp->mode))
2301 return FALSE;
2302 if (!zdr_u_int (zdrs, &objp->uid))
2303 return FALSE;
2304 if (!zdr_u_int (zdrs, &objp->gid))
2305 return FALSE;
2306 if (!zdr_u_int (zdrs, &objp->size))
2307 return FALSE;
2308
2309 } else {
2310 objp->mode = IZDR_GET_U_LONG(buf);
2311 objp->uid = IZDR_GET_U_LONG(buf);
2312 objp->gid = IZDR_GET_U_LONG(buf);
2313 objp->size = IZDR_GET_U_LONG(buf);
2314 }
2315 if (!zdr_nfstime3 (zdrs, &objp->atime))
2316 return FALSE;
2317 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2318 return FALSE;
2319 return TRUE;
2320 }
2321
2322 if (!zdr_u_int (zdrs, &objp->mode))
2323 return FALSE;
2324 if (!zdr_u_int (zdrs, &objp->uid))
2325 return FALSE;
2326 if (!zdr_u_int (zdrs, &objp->gid))
2327 return FALSE;
2328 if (!zdr_u_int (zdrs, &objp->size))
2329 return FALSE;
2330 if (!zdr_nfstime3 (zdrs, &objp->atime))
2331 return FALSE;
2332 if (!zdr_nfstime3 (zdrs, &objp->mtime))
2333 return FALSE;
2334 return TRUE;
2335}
2336
af8d37c8 2337uint32_t
f38aacf8
RS
2338zdr_filename2 (ZDR *zdrs, filename2 *objp)
2339{
2340 register int32_t *buf;
2341 buf = NULL;
2342
2343 if (!zdr_string (zdrs, objp, MAXNAMLEN2))
2344 return FALSE;
2345 return TRUE;
2346}
2347
af8d37c8 2348uint32_t
f38aacf8
RS
2349zdr_path2 (ZDR *zdrs, path2 *objp)
2350{
2351 register int32_t *buf;
2352 buf = NULL;
2353
2354 if (!zdr_string (zdrs, objp, MAXPATHLEN2))
2355 return FALSE;
2356 return TRUE;
2357}
2358
af8d37c8 2359uint32_t
f38aacf8
RS
2360zdr_nfsdata2 (ZDR *zdrs, nfsdata2 *objp)
2361{
2362 register int32_t *buf;
2363 buf = NULL;
2364
2365 if (!zdr_bytes (zdrs, (char **)&objp->nfsdata2_val, (u_int *) &objp->nfsdata2_len, NFSMAXDATA2))
2366 return FALSE;
2367 return TRUE;
2368}
2369
af8d37c8 2370uint32_t
f38aacf8
RS
2371zdr_nfscookie2 (ZDR *zdrs, nfscookie2 objp)
2372{
2373 register int32_t *buf;
2374 buf = NULL;
2375
2376 if (!zdr_opaque (zdrs, objp, NFSCOOKIESIZE2))
2377 return FALSE;
2378 return TRUE;
2379}
2380
af8d37c8 2381uint32_t
f38aacf8
RS
2382zdr_entry2 (ZDR *zdrs, entry2 *objp)
2383{
2384 register int32_t *buf;
2385 buf = NULL;
2386
2387 if (!zdr_u_int (zdrs, &objp->fileid))
2388 return FALSE;
2389 if (!zdr_filename2 (zdrs, &objp->name))
2390 return FALSE;
2391 if (!zdr_nfscookie2 (zdrs, objp->cookie))
2392 return FALSE;
2393 if (!zdr_pointer (zdrs, (char **)&objp->nextentry, sizeof (entry2), (zdrproc_t) zdr_entry2))
2394 return FALSE;
2395 return TRUE;
2396}
2397
af8d37c8 2398uint32_t
f38aacf8
RS
2399zdr_diropargs2 (ZDR *zdrs, diropargs2 *objp)
2400{
2401 register int32_t *buf;
2402 buf = NULL;
2403
2404 if (!zdr_fhandle2 (zdrs, objp->dir))
2405 return FALSE;
2406 if (!zdr_filename2 (zdrs, &objp->name))
2407 return FALSE;
2408 return TRUE;
2409}
2410
af8d37c8 2411uint32_t
f38aacf8
RS
2412zdr_GETATTR2args (ZDR *zdrs, GETATTR2args *objp)
2413{
2414 register int32_t *buf;
2415 buf = NULL;
2416
2417 if (!zdr_fhandle2 (zdrs, objp->fhandle))
2418 return FALSE;
2419 return TRUE;
2420}
2421
af8d37c8 2422uint32_t
f38aacf8
RS
2423zdr_GETATTR2resok (ZDR *zdrs, GETATTR2resok *objp)
2424{
2425 register int32_t *buf;
2426 buf = NULL;
2427
2428 if (!zdr_fattr2 (zdrs, &objp->attributes))
2429 return FALSE;
2430 return TRUE;
2431}
2432
af8d37c8 2433uint32_t
f38aacf8
RS
2434zdr_GETATTR2res (ZDR *zdrs, GETATTR2res *objp)
2435{
2436 register int32_t *buf;
2437 buf = NULL;
2438
2439 if (!zdr_nfsstat3 (zdrs, &objp->status))
2440 return FALSE;
2441 switch (objp->status) {
2442 case NFS3_OK:
2443 if (!zdr_GETATTR2resok (zdrs, &objp->GETATTR2res_u.resok))
2444 return FALSE;
2445 break;
2446 default:
2447 break;
2448 }
2449 return TRUE;
2450}
2451
af8d37c8 2452uint32_t
f38aacf8
RS
2453zdr_SETATTR2args (ZDR *zdrs, SETATTR2args *objp)
2454{
2455 register int32_t *buf;
2456 buf = NULL;
2457
2458 if (!zdr_fhandle2 (zdrs, objp->fhandle))
2459 return FALSE;
2460 if (!zdr_sattr2 (zdrs, &objp->attributes))
2461 return FALSE;
2462 return TRUE;
2463}
2464
af8d37c8 2465uint32_t
f38aacf8
RS
2466zdr_SETATTR2resok (ZDR *zdrs, SETATTR2resok *objp)
2467{
2468 register int32_t *buf;
2469 buf = NULL;
2470
2471 if (!zdr_fattr2 (zdrs, &objp->attributes))
2472 return FALSE;
2473 return TRUE;
2474}
2475
af8d37c8 2476uint32_t
f38aacf8
RS
2477zdr_SETATTR2res (ZDR *zdrs, SETATTR2res *objp)
2478{
2479 register int32_t *buf;
2480 buf = NULL;
2481
2482 if (!zdr_nfsstat3 (zdrs, &objp->status))
2483 return FALSE;
2484 switch (objp->status) {
2485 case NFS3_OK:
2486 if (!zdr_SETATTR2resok (zdrs, &objp->SETATTR2res_u.resok))
2487 return FALSE;
2488 break;
2489 default:
2490 break;
2491 }
2492 return TRUE;
2493}
2494
af8d37c8 2495uint32_t
f38aacf8
RS
2496zdr_LOOKUP2args (ZDR *zdrs, LOOKUP2args *objp)
2497{
2498 register int32_t *buf;
2499 buf = NULL;
2500
2501 if (!zdr_diropargs2 (zdrs, &objp->what))
2502 return FALSE;
2503 return TRUE;
2504}
2505
af8d37c8 2506uint32_t
f38aacf8
RS
2507zdr_LOOKUP2resok (ZDR *zdrs, LOOKUP2resok *objp)
2508{
2509 register int32_t *buf;
2510 buf = NULL;
2511
2512 if (!zdr_fhandle2 (zdrs, objp->file))
2513 return FALSE;
2514 if (!zdr_fattr2 (zdrs, &objp->attributes))
2515 return FALSE;
2516 return TRUE;
2517}
2518
af8d37c8 2519uint32_t
f38aacf8
RS
2520zdr_LOOKUP2res (ZDR *zdrs, LOOKUP2res *objp)
2521{
2522 register int32_t *buf;
2523 buf = NULL;
2524
2525 if (!zdr_nfsstat3 (zdrs, &objp->status))
2526 return FALSE;
2527 switch (objp->status) {
2528 case NFS3_OK:
2529 if (!zdr_LOOKUP2resok (zdrs, &objp->LOOKUP2res_u.resok))
2530 return FALSE;
2531 break;
2532 default:
2533 break;
2534 }
2535 return TRUE;
2536}
2537
af8d37c8 2538uint32_t
f38aacf8
RS
2539zdr_READLINK2args (ZDR *zdrs, READLINK2args *objp)
2540{
2541 register int32_t *buf;
2542 buf = NULL;
2543
2544 if (!zdr_fhandle2 (zdrs, objp->file))
2545 return FALSE;
2546 return TRUE;
2547}
2548
af8d37c8 2549uint32_t
f38aacf8
RS
2550zdr_READLINK2resok (ZDR *zdrs, READLINK2resok *objp)
2551{
2552 register int32_t *buf;
2553 buf = NULL;
2554
2555 if (!zdr_path2 (zdrs, &objp->data))
2556 return FALSE;
2557 return TRUE;
2558}
2559
af8d37c8 2560uint32_t
f38aacf8
RS
2561zdr_READLINK2res (ZDR *zdrs, READLINK2res *objp)
2562{
2563 register int32_t *buf;
2564 buf = NULL;
2565
2566 if (!zdr_nfsstat3 (zdrs, &objp->status))
2567 return FALSE;
2568 switch (objp->status) {
2569 case NFS3_OK:
2570 if (!zdr_READLINK2resok (zdrs, &objp->READLINK2res_u.resok))
2571 return FALSE;
2572 break;
2573 default:
2574 break;
2575 }
2576 return TRUE;
2577}
2578
af8d37c8 2579uint32_t
f38aacf8
RS
2580zdr_READ2args (ZDR *zdrs, READ2args *objp)
2581{
2582 register int32_t *buf;
2583 buf = NULL;
2584
2585 if (!zdr_fhandle2 (zdrs, objp->file))
2586 return FALSE;
2587 if (!zdr_u_int (zdrs, &objp->offset))
2588 return FALSE;
2589 if (!zdr_u_int (zdrs, &objp->count))
2590 return FALSE;
2591 if (!zdr_u_int (zdrs, &objp->totalcount))
2592 return FALSE;
2593 return TRUE;
2594}
2595
af8d37c8 2596uint32_t
f38aacf8
RS
2597zdr_READ2resok (ZDR *zdrs, READ2resok *objp)
2598{
2599 register int32_t *buf;
2600 buf = NULL;
2601
2602 if (!zdr_fattr2 (zdrs, &objp->attributes))
2603 return FALSE;
2604 if (!zdr_nfsdata2 (zdrs, &objp->data))
2605 return FALSE;
2606 return TRUE;
2607}
2608
af8d37c8 2609uint32_t
f38aacf8
RS
2610zdr_READ2res (ZDR *zdrs, READ2res *objp)
2611{
2612 register int32_t *buf;
2613 buf = NULL;
2614
2615 if (!zdr_nfsstat3 (zdrs, &objp->status))
2616 return FALSE;
2617 switch (objp->status) {
2618 case NFS3_OK:
2619 if (!zdr_READ2resok (zdrs, &objp->READ2res_u.resok))
2620 return FALSE;
2621 break;
2622 default:
2623 break;
2624 }
2625 return TRUE;
2626}
2627
af8d37c8 2628uint32_t
f38aacf8
RS
2629zdr_WRITE2args (ZDR *zdrs, WRITE2args *objp)
2630{
2631 register int32_t *buf;
2632 buf = NULL;
2633
2634
2635 if (zdrs->x_op == ZDR_ENCODE) {
2636 if (!zdr_fhandle2 (zdrs, objp->file))
2637 return FALSE;
2638 buf = ZDR_INLINE (zdrs, 3 * BYTES_PER_ZDR_UNIT);
2639 if (buf == NULL) {
2640 if (!zdr_u_int (zdrs, &objp->beginoffset))
2641 return FALSE;
2642 if (!zdr_u_int (zdrs, &objp->offset))
2643 return FALSE;
2644 if (!zdr_u_int (zdrs, &objp->totalcount))
2645 return FALSE;
2646
2647 } else {
2648 IZDR_PUT_U_LONG(buf, objp->beginoffset);
2649 IZDR_PUT_U_LONG(buf, objp->offset);
2650 IZDR_PUT_U_LONG(buf, objp->totalcount);
2651 }
2652 if (!zdr_nfsdata2 (zdrs, &objp->data))
2653 return FALSE;
2654 return TRUE;
2655 } else if (zdrs->x_op == ZDR_DECODE) {
2656 if (!zdr_fhandle2 (zdrs, objp->file))
2657 return FALSE;
2658 buf = ZDR_INLINE (zdrs, 3 * BYTES_PER_ZDR_UNIT);
2659 if (buf == NULL) {
2660 if (!zdr_u_int (zdrs, &objp->beginoffset))
2661 return FALSE;
2662 if (!zdr_u_int (zdrs, &objp->offset))
2663 return FALSE;
2664 if (!zdr_u_int (zdrs, &objp->totalcount))
2665 return FALSE;
2666
2667 } else {
2668 objp->beginoffset = IZDR_GET_U_LONG(buf);
2669 objp->offset = IZDR_GET_U_LONG(buf);
2670 objp->totalcount = IZDR_GET_U_LONG(buf);
2671 }
2672 if (!zdr_nfsdata2 (zdrs, &objp->data))
2673 return FALSE;
2674 return TRUE;
2675 }
2676
2677 if (!zdr_fhandle2 (zdrs, objp->file))
2678 return FALSE;
2679 if (!zdr_u_int (zdrs, &objp->beginoffset))
2680 return FALSE;
2681 if (!zdr_u_int (zdrs, &objp->offset))
2682 return FALSE;
2683 if (!zdr_u_int (zdrs, &objp->totalcount))
2684 return FALSE;
2685 if (!zdr_nfsdata2 (zdrs, &objp->data))
2686 return FALSE;
2687 return TRUE;
2688}
2689
af8d37c8 2690uint32_t
f38aacf8
RS
2691zdr_WRITE2resok (ZDR *zdrs, WRITE2resok *objp)
2692{
2693 register int32_t *buf;
2694 buf = NULL;
2695
2696 if (!zdr_fattr2 (zdrs, &objp->attributes))
2697 return FALSE;
2698 return TRUE;
2699}
2700
af8d37c8 2701uint32_t
f38aacf8
RS
2702zdr_WRITE2res (ZDR *zdrs, WRITE2res *objp)
2703{
2704 register int32_t *buf;
2705 buf = NULL;
2706
2707 if (!zdr_nfsstat3 (zdrs, &objp->status))
2708 return FALSE;
2709 switch (objp->status) {
2710 case NFS3_OK:
2711 if (!zdr_WRITE2resok (zdrs, &objp->WRITE2res_u.resok))
2712 return FALSE;
2713 break;
2714 default:
2715 break;
2716 }
2717 return TRUE;
2718}
2719
af8d37c8 2720uint32_t
f38aacf8
RS
2721zdr_CREATE2args (ZDR *zdrs, CREATE2args *objp)
2722{
2723 register int32_t *buf;
2724 buf = NULL;
2725
2726 if (!zdr_diropargs2 (zdrs, &objp->where))
2727 return FALSE;
2728 if (!zdr_sattr2 (zdrs, &objp->attributes))
2729 return FALSE;
2730 return TRUE;
2731}
2732
af8d37c8 2733uint32_t
f38aacf8
RS
2734zdr_CREATE2resok (ZDR *zdrs, CREATE2resok *objp)
2735{
2736 register int32_t *buf;
2737 buf = NULL;
2738
2739 if (!zdr_fhandle2 (zdrs, objp->file))
2740 return FALSE;
2741 if (!zdr_fattr2 (zdrs, &objp->attributes))
2742 return FALSE;
2743 return TRUE;
2744}
2745
af8d37c8 2746uint32_t
f38aacf8
RS
2747zdr_CREATE2res (ZDR *zdrs, CREATE2res *objp)
2748{
2749 register int32_t *buf;
2750 buf = NULL;
2751
2752 if (!zdr_nfsstat3 (zdrs, &objp->status))
2753 return FALSE;
2754 switch (objp->status) {
2755 case NFS3_OK:
2756 if (!zdr_CREATE2resok (zdrs, &objp->CREATE2res_u.resok))
2757 return FALSE;
2758 break;
2759 default:
2760 break;
2761 }
2762 return TRUE;
2763}
2764
af8d37c8 2765uint32_t
f38aacf8
RS
2766zdr_REMOVE2args (ZDR *zdrs, REMOVE2args *objp)
2767{
2768 register int32_t *buf;
2769 buf = NULL;
2770
2771 if (!zdr_diropargs2 (zdrs, &objp->what))
2772 return FALSE;
2773 return TRUE;
2774}
2775
af8d37c8 2776uint32_t
f38aacf8
RS
2777zdr_REMOVE2res (ZDR *zdrs, REMOVE2res *objp)
2778{
2779 register int32_t *buf;
2780 buf = NULL;
2781
2782 if (!zdr_nfsstat3 (zdrs, &objp->status))
2783 return FALSE;
2784 return TRUE;
2785}
2786
af8d37c8 2787uint32_t
f38aacf8
RS
2788zdr_RENAME2args (ZDR *zdrs, RENAME2args *objp)
2789{
2790 register int32_t *buf;
2791 buf = NULL;
2792
2793 if (!zdr_diropargs2 (zdrs, &objp->from))
2794 return FALSE;
2795 if (!zdr_diropargs2 (zdrs, &objp->to))
2796 return FALSE;
2797 return TRUE;
2798}
2799
af8d37c8 2800uint32_t
f38aacf8
RS
2801zdr_RENAME2res (ZDR *zdrs, RENAME2res *objp)
2802{
2803 register int32_t *buf;
2804 buf = NULL;
2805
2806 if (!zdr_nfsstat3 (zdrs, &objp->status))
2807 return FALSE;
2808 return TRUE;
2809}
2810
af8d37c8 2811uint32_t
f38aacf8
RS
2812zdr_LINK2args (ZDR *zdrs, LINK2args *objp)
2813{
2814 register int32_t *buf;
2815 buf = NULL;
2816
2817 if (!zdr_fhandle2 (zdrs, objp->from))
2818 return FALSE;
2819 if (!zdr_diropargs2 (zdrs, &objp->to))
2820 return FALSE;
2821 return TRUE;
2822}
2823
af8d37c8 2824uint32_t
f38aacf8
RS
2825zdr_LINK2res (ZDR *zdrs, LINK2res *objp)
2826{
2827 register int32_t *buf;
2828 buf = NULL;
2829
2830 if (!zdr_nfsstat3 (zdrs, &objp->status))
2831 return FALSE;
2832 return TRUE;
2833}
2834
af8d37c8 2835uint32_t
f38aacf8
RS
2836zdr_SYMLINK2args (ZDR *zdrs, SYMLINK2args *objp)
2837{
2838 register int32_t *buf;
2839 buf = NULL;
2840
2841 if (!zdr_diropargs2 (zdrs, &objp->from))
2842 return FALSE;
2843 if (!zdr_path2 (zdrs, &objp->to))
2844 return FALSE;
2845 if (!zdr_sattr2 (zdrs, &objp->attributes))
2846 return FALSE;
2847 return TRUE;
2848}
2849
af8d37c8 2850uint32_t
f38aacf8
RS
2851zdr_SYMLINK2res (ZDR *zdrs, SYMLINK2res *objp)
2852{
2853 register int32_t *buf;
2854 buf = NULL;
2855
2856 if (!zdr_nfsstat3 (zdrs, &objp->status))
2857 return FALSE;
2858 return TRUE;
2859}
2860
af8d37c8 2861uint32_t
f38aacf8
RS
2862zdr_MKDIR2args (ZDR *zdrs, MKDIR2args *objp)
2863{
2864 register int32_t *buf;
2865 buf = NULL;
2866
2867 if (!zdr_diropargs2 (zdrs, &objp->where))
2868 return FALSE;
2869 if (!zdr_sattr2 (zdrs, &objp->attributes))
2870 return FALSE;
2871 return TRUE;
2872}
2873
af8d37c8 2874uint32_t
f38aacf8
RS
2875zdr_MKDIR2resok (ZDR *zdrs, MKDIR2resok *objp)
2876{
2877 register int32_t *buf;
2878 buf = NULL;
2879
2880 if (!zdr_fhandle2 (zdrs, objp->file))
2881 return FALSE;
2882 if (!zdr_fattr2 (zdrs, &objp->attributes))
2883 return FALSE;
2884 return TRUE;
2885}
2886
af8d37c8 2887uint32_t
f38aacf8
RS
2888zdr_MKDIR2res (ZDR *zdrs, MKDIR2res *objp)
2889{
2890 register int32_t *buf;
2891 buf = NULL;
2892
2893 if (!zdr_nfsstat3 (zdrs, &objp->status))
2894 return FALSE;
2895 switch (objp->status) {
2896 case NFS3_OK:
2897 if (!zdr_MKDIR2resok (zdrs, &objp->MKDIR2res_u.resok))
2898 return FALSE;
2899 break;
2900 default:
2901 break;
2902 }
2903 return TRUE;
2904}
2905
af8d37c8 2906uint32_t
f38aacf8
RS
2907zdr_RMDIR2args (ZDR *zdrs, RMDIR2args *objp)
2908{
2909 register int32_t *buf;
2910 buf = NULL;
2911
2912 if (!zdr_diropargs2 (zdrs, &objp->what))
2913 return FALSE;
2914 return TRUE;
2915}
2916
af8d37c8 2917uint32_t
f38aacf8
RS
2918zdr_RMDIR2res (ZDR *zdrs, RMDIR2res *objp)
2919{
2920 register int32_t *buf;
2921 buf = NULL;
2922
2923 if (!zdr_nfsstat3 (zdrs, &objp->status))
2924 return FALSE;
2925 return TRUE;
2926}
2927
af8d37c8 2928uint32_t
f38aacf8
RS
2929zdr_READDIR2args (ZDR *zdrs, READDIR2args *objp)
2930{
2931 register int32_t *buf;
2932 buf = NULL;
2933
2934 if (!zdr_fhandle2 (zdrs, objp->dir))
2935 return FALSE;
2936 if (!zdr_nfscookie2 (zdrs, objp->cookie))
2937 return FALSE;
2938 if (!zdr_u_int (zdrs, &objp->count))
2939 return FALSE;
2940 return TRUE;
2941}
2942
af8d37c8 2943uint32_t
f38aacf8
RS
2944zdr_READDIR2resok (ZDR *zdrs, READDIR2resok *objp)
2945{
2946 register int32_t *buf;
2947 buf = NULL;
2948
2949 if (!zdr_pointer (zdrs, (char **)&objp->entries, sizeof (entry2), (zdrproc_t) zdr_entry2))
2950 return FALSE;
2951 if (!zdr_bool (zdrs, &objp->eof))
2952 return FALSE;
2953 return TRUE;
2954}
2955
af8d37c8 2956uint32_t
f38aacf8
RS
2957zdr_READDIR2res (ZDR *zdrs, READDIR2res *objp)
2958{
2959 register int32_t *buf;
2960 buf = NULL;
2961
2962 if (!zdr_nfsstat3 (zdrs, &objp->status))
2963 return FALSE;
2964 switch (objp->status) {
2965 case NFS3_OK:
2966 if (!zdr_READDIR2resok (zdrs, &objp->READDIR2res_u.resok))
2967 return FALSE;
2968 break;
2969 default:
2970 break;
2971 }
2972 return TRUE;
2973}
2974
af8d37c8 2975uint32_t
f38aacf8
RS
2976zdr_STATFS2args (ZDR *zdrs, STATFS2args *objp)
2977{
2978 register int32_t *buf;
2979 buf = NULL;
2980
2981 if (!zdr_fhandle2 (zdrs, objp->dir))
2982 return FALSE;
2983 return TRUE;
2984}
2985
af8d37c8 2986uint32_t
f38aacf8
RS
2987zdr_STATFS2resok (ZDR *zdrs, STATFS2resok *objp)
2988{
2989 register int32_t *buf;
2990 buf = NULL;
2991
2992
2993 if (zdrs->x_op == ZDR_ENCODE) {
2994 buf = ZDR_INLINE (zdrs, 5 * BYTES_PER_ZDR_UNIT);
2995 if (buf == NULL) {
2996 if (!zdr_u_int (zdrs, &objp->tsize))
2997 return FALSE;
2998 if (!zdr_u_int (zdrs, &objp->bsize))
2999 return FALSE;
3000 if (!zdr_u_int (zdrs, &objp->blocks))
3001 return FALSE;
3002 if (!zdr_u_int (zdrs, &objp->bfree))
3003 return FALSE;
3004 if (!zdr_u_int (zdrs, &objp->bavail))
3005 return FALSE;
3006 } else {
3007 IZDR_PUT_U_LONG(buf, objp->tsize);
3008 IZDR_PUT_U_LONG(buf, objp->bsize);
3009 IZDR_PUT_U_LONG(buf, objp->blocks);
3010 IZDR_PUT_U_LONG(buf, objp->bfree);
3011 IZDR_PUT_U_LONG(buf, objp->bavail);
3012 }
3013 return TRUE;
3014 } else if (zdrs->x_op == ZDR_DECODE) {
3015 buf = ZDR_INLINE (zdrs, 5 * BYTES_PER_ZDR_UNIT);
3016 if (buf == NULL) {
3017 if (!zdr_u_int (zdrs, &objp->tsize))
3018 return FALSE;
3019 if (!zdr_u_int (zdrs, &objp->bsize))
3020 return FALSE;
3021 if (!zdr_u_int (zdrs, &objp->blocks))
3022 return FALSE;
3023 if (!zdr_u_int (zdrs, &objp->bfree))
3024 return FALSE;
3025 if (!zdr_u_int (zdrs, &objp->bavail))
3026 return FALSE;
3027 } else {
3028 objp->tsize = IZDR_GET_U_LONG(buf);
3029 objp->bsize = IZDR_GET_U_LONG(buf);
3030 objp->blocks = IZDR_GET_U_LONG(buf);
3031 objp->bfree = IZDR_GET_U_LONG(buf);
3032 objp->bavail = IZDR_GET_U_LONG(buf);
3033 }
3034 return TRUE;
3035 }
3036
3037 if (!zdr_u_int (zdrs, &objp->tsize))
3038 return FALSE;
3039 if (!zdr_u_int (zdrs, &objp->bsize))
3040 return FALSE;
3041 if (!zdr_u_int (zdrs, &objp->blocks))
3042 return FALSE;
3043 if (!zdr_u_int (zdrs, &objp->bfree))
3044 return FALSE;
3045 if (!zdr_u_int (zdrs, &objp->bavail))
3046 return FALSE;
3047 return TRUE;
3048}
3049
af8d37c8 3050uint32_t
f38aacf8
RS
3051zdr_STATFS2res (ZDR *zdrs, STATFS2res *objp)
3052{
3053 register int32_t *buf;
3054 buf = NULL;
3055
3056 if (!zdr_nfsstat3 (zdrs, &objp->status))
3057 return FALSE;
3058 switch (objp->status) {
3059 case NFS3_OK:
3060 if (!zdr_STATFS2resok (zdrs, &objp->STATFS2res_u.resok))
3061 return FALSE;
3062 break;
3063 default:
3064 break;
3065 }
3066 return TRUE;
3067}
3068
af8d37c8 3069uint32_t
763cd6e3
RS
3070zdr_nfsacl_type (ZDR *zdrs, nfsacl_type *objp)
3071{
3072 register int32_t *buf;
9c29b498 3073 buf = NULL;
763cd6e3
RS
3074
3075 if (!zdr_enum (zdrs, (enum_t *) objp))
3076 return FALSE;
3077 return TRUE;
3078}
3079
af8d37c8 3080uint32_t
763cd6e3
RS
3081zdr_nfsacl_ace (ZDR *zdrs, nfsacl_ace *objp)
3082{
3083 register int32_t *buf;
9c29b498 3084 buf = NULL;
763cd6e3
RS
3085
3086 if (!zdr_nfsacl_type (zdrs, &objp->type))
3087 return FALSE;
3088 if (!zdr_u_int (zdrs, &objp->id))
3089 return FALSE;
3090 if (!zdr_u_int (zdrs, &objp->perm))
3091 return FALSE;
3092 return TRUE;
3093}
3094
af8d37c8 3095uint32_t
763cd6e3
RS
3096zdr_GETACL3args (ZDR *zdrs, GETACL3args *objp)
3097{
3098 register int32_t *buf;
9c29b498 3099 buf = NULL;
763cd6e3
RS
3100
3101 if (!zdr_nfs_fh3 (zdrs, &objp->dir))
3102 return FALSE;
3103 if (!zdr_u_int (zdrs, &objp->mask))
3104 return FALSE;
3105 return TRUE;
3106}
3107
af8d37c8 3108uint32_t
763cd6e3
RS
3109zdr_GETACL3resok (ZDR *zdrs, GETACL3resok *objp)
3110{
3111 register int32_t *buf;
9c29b498 3112 buf = NULL;
763cd6e3
RS
3113
3114 if (!zdr_post_op_attr (zdrs, &objp->attr))
3115 return FALSE;
3116 if (!zdr_u_int (zdrs, &objp->mask))
3117 return FALSE;
3118 if (!zdr_u_int (zdrs, &objp->ace_count))
3119 return FALSE;
3120 if (!zdr_array (zdrs, (char **)&objp->ace.ace_val, (u_int *) &objp->ace.ace_len, ~0,
3121 sizeof (nfsacl_ace), (zdrproc_t) zdr_nfsacl_ace))
3122 return FALSE;
3123 if (!zdr_u_int (zdrs, &objp->default_ace_count))
3124 return FALSE;
3125 if (!zdr_array (zdrs, (char **)&objp->default_ace.default_ace_val, (u_int *) &objp->default_ace.default_ace_len, ~0,
3126 sizeof (nfsacl_ace), (zdrproc_t) zdr_nfsacl_ace))
3127 return FALSE;
3128 return TRUE;
3129}
3130
af8d37c8 3131uint32_t
763cd6e3
RS
3132zdr_GETACL3res (ZDR *zdrs, GETACL3res *objp)
3133{
3134 register int32_t *buf;
9c29b498 3135 buf = NULL;
763cd6e3
RS
3136
3137 if (!zdr_nfsstat3 (zdrs, &objp->status))
3138 return FALSE;
3139 switch (objp->status) {
3140 case NFS3_OK:
3141 if (!zdr_GETACL3resok (zdrs, &objp->GETACL3res_u.resok))
3142 return FALSE;
3143 break;
3144 default:
3145 break;
3146 }
3147 return TRUE;
3148}
3149
af8d37c8 3150uint32_t
763cd6e3
RS
3151zdr_SETACL3args (ZDR *zdrs, SETACL3args *objp)
3152{
3153 register int32_t *buf;
9c29b498 3154 buf = NULL;
763cd6e3
RS
3155
3156 if (!zdr_nfs_fh3 (zdrs, &objp->dir))
3157 return FALSE;
3158 if (!zdr_u_int (zdrs, &objp->mask))
3159 return FALSE;
3160 if (!zdr_u_int (zdrs, &objp->ace_count))
3161 return FALSE;
3162 if (!zdr_array (zdrs, (char **)&objp->ace.ace_val, (u_int *) &objp->ace.ace_len, ~0,
3163 sizeof (nfsacl_ace), (zdrproc_t) zdr_nfsacl_ace))
3164 return FALSE;
3165 if (!zdr_u_int (zdrs, &objp->default_ace_count))
3166 return FALSE;
3167 if (!zdr_array (zdrs, (char **)&objp->default_ace.default_ace_val, (u_int *) &objp->default_ace.default_ace_len, ~0,
3168 sizeof (nfsacl_ace), (zdrproc_t) zdr_nfsacl_ace))
3169 return FALSE;
3170 return TRUE;
3171}
3172
af8d37c8 3173uint32_t
763cd6e3
RS
3174zdr_SETACL3resok (ZDR *zdrs, SETACL3resok *objp)
3175{
3176 register int32_t *buf;
9c29b498 3177 buf = NULL;
763cd6e3
RS
3178
3179 if (!zdr_post_op_attr (zdrs, &objp->attr))
3180 return FALSE;
3181 return TRUE;
3182}
3183
af8d37c8 3184uint32_t
763cd6e3
RS
3185zdr_SETACL3res (ZDR *zdrs, SETACL3res *objp)
3186{
3187 register int32_t *buf;
9c29b498 3188 buf = NULL;
763cd6e3
RS
3189
3190 if (!zdr_nfsstat3 (zdrs, &objp->status))
3191 return FALSE;
3192 switch (objp->status) {
3193 case NFS3_OK:
3194 if (!zdr_SETACL3resok (zdrs, &objp->SETACL3res_u.resok))
3195 return FALSE;
3196 break;
3197 default:
3198 break;
3199 }
3200 return TRUE;
3201}