Add proper per-file copyright notices/licenses and top-level license.
[bluesky.git] / TBBT / trace_play / sfs_2_xdr.c
1 #ifndef lint
2 static char sfs_c_xdrSid[] = "@(#)sfs_2_xdr.c   2.1     97/10/23";
3 #endif
4
5 /*
6  *   Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
7  *      All rights reserved.
8  *              Standard Performance Evaluation Corporation (SPEC)
9  *              6585 Merchant Place, Suite 100
10  *              Warrenton, VA 20187
11  *
12  *      This product contains benchmarks acquired from several sources who
13  *      understand and agree with SPEC's goal of creating fair and objective
14  *      benchmarks to measure computer performance.
15  *
16  *      This copyright notice is placed here only to protect SPEC in the
17  *      event the source is misused in any manner that is contrary to the
18  *      spirit, the goals and the intent of SPEC.
19  *
20  *      The source code is provided to the user or company under the license
21  *      agreement for the SPEC Benchmark Suite for this product.
22  */
23
24 /*
25  * -------------------------- sfs_c_xdr.c --------------------------
26  *
27  *      XDR routines for the nfs protocol.
28  *
29  *.Exported_routines
30  *      bool_t xdr_fhstatus(XDR *, struct fhstatus *)
31  *      bool_t xdr_path(XDR *, char **)
32  *      bool_t xdr_fattr(XDR *, fattr *)
33  *      bool_t xdr_sattr(XDR *, sattr *)
34  *      bool_t xdr_null(void)
35  *      bool_t xdr_getattr(XDR *, char *)
36  *      bool_t xdr_setattr(XDR *, char *)
37  *      bool_t xdr_root(void)
38  *      bool_t xdr_lookup(XDR *, char *)
39  *      bool_t xdr_readlink(XDR *, char *)
40  *      bool_t xdr_read(XDR *, char *)
41  *      bool_t xdr_write(XDR *, char *)
42  *      bool_t xdr_create(XDR *, char *)
43  *      bool_t xdr_remove(XDR *, char *)
44  *      bool_t xdr_rename(XDR *, char *)
45  *      bool_t xdr_link(XDR *, char *)
46  *      bool_t xdr_symlink(XDR *, char *)
47  *      bool_t xdr_mkdir(XDR *, char *)
48  *      bool_t xdr_rmdir(XDR *, char *)
49  *      bool_t xdr_readdir(XDR *, char *)
50  *      bool_t xdr_statfs(XDR *, char *)
51  *
52  *.Local_routines
53  *      bool_t xdr_timeval(XDR *, nfstime *)
54  *      bool_t xdr_nfsstat(XDR *, nfsstat *)
55  *      bool_t xdr_ftype(XDR *, ftype *)
56  *      bool_t xdr_diropargs(XDR *, diropargs *)
57  *      bool_t xdr_diropres(XDR *, diropres *)
58  *      bool_t xdr_attrstat(XDR *, attrstat *)
59  *
60  *.Revision_History
61  *      28-NOv-91       Teelucksingh    ANSI C
62  *      25-Jun-91       Santa Wiryaman  Changed return values to TRUE when
63  *                                      status != NFS_OK.  This way we can
64  *                                      decode NFS error messages.
65  *      17-May-90       Richard Bean    Created.
66  */
67
68
69 /*
70  * -------------------------  Include Files  -------------------------
71  */
72
73 /*
74  * ANSI C headers
75  */
76 #include <stdio.h>
77 #include <stdlib.h>
78 #include <string.h>
79 #include <errno.h>
80  
81 #include <sys/types.h>
82 #include <sys/stat.h> 
83
84 #include "sfs_c_def.h"
85
86 /*
87  * -----------------------  Forward Definitions  -----------------------
88  */
89
90 static bool_t xdr_f_handle(XDR *, fhandle_t *);
91 static bool_t xdr_fattr(XDR *, fattr *);
92 static bool_t xdr_sattr(XDR *, sattr *);
93 static bool_t xdr_timeval(XDR *, nfstime *);
94 static bool_t xdr_nfsstat(XDR *, nfsstat *);
95 static bool_t xdr_ftype(XDR *, ftype *);
96 static bool_t xdr_diropargs(XDR *, diropargs *);
97 static bool_t xdr_diropres(XDR *, diropres *);
98 static bool_t xdr_attrstat(XDR *, attrstat *);
99
100 /*
101  * -----------------------  SFS XDR Routines  -------------------------
102  */
103
104
105 static bool_t
106 xdr_f_handle(
107     XDR *               xdrs,
108     fhandle_t *         fhandle_ptr)
109 {
110     return(xdr_opaque(xdrs, (char *)fhandle_ptr, NFS_FHSIZE));
111 }
112
113
114 static bool_t
115 xdr_timeval(
116     XDR *               xdrs,
117     nfstime *           timeval_ptr)
118 {
119     return(xdr_int32_t(xdrs, (int32_t *) &timeval_ptr->seconds) &&
120            xdr_int32_t(xdrs, (int32_t *) &timeval_ptr->useconds));
121 }
122
123
124 static bool_t
125 xdr_nfsstat(
126     XDR *               xdrs,
127     nfsstat *           nfsstat_ptr)
128 {
129     return(xdr_enum(xdrs, (enum_t *) nfsstat_ptr));
130 }
131
132
133 static bool_t
134 xdr_ftype(
135     XDR *               xdrs,
136     ftype *             ftype_ptr)
137 {
138     return(xdr_enum(xdrs, (enum_t *) ftype_ptr));
139 }
140
141
142 bool_t
143 xdr_fhstatus(
144     XDR *               xdrs,
145     struct fhstatus *   fhsp)
146 {
147     if (!xdr_nfsstat(xdrs, (nfsstat *) &fhsp->fhs_status)) {
148         return(FALSE);
149     }
150     if (fhsp->fhs_status != (int)NFS_OK) {
151         return(TRUE);
152     }
153     return(xdr_f_handle(xdrs, &fhsp->fhs_fh));
154 }
155
156
157 bool_t
158 xdr_path(
159     XDR *               xdrs,
160     char **             pathp)
161 {
162     return(xdr_string(xdrs, pathp, NFS_MAXPATHLEN));
163 }
164
165
166 static bool_t
167 xdr_fattr(
168     XDR *               xdrs,
169     fattr *             fattr_ptr)
170 {
171     return(xdr_ftype(xdrs, &fattr_ptr->type) &&
172            xdr_u_int(xdrs, &fattr_ptr->mode) &&
173            xdr_u_int(xdrs, &fattr_ptr->nlink) &&
174            xdr_u_int(xdrs, &fattr_ptr->uid) &&
175            xdr_u_int(xdrs, &fattr_ptr->gid) &&
176            xdr_u_int(xdrs, &fattr_ptr->size) &&
177            xdr_u_int(xdrs, &fattr_ptr->blocksize) &&
178            xdr_u_int(xdrs, &fattr_ptr->rdev) &&
179            xdr_u_int(xdrs, &fattr_ptr->blocks) &&
180            xdr_u_int(xdrs, &fattr_ptr->fsid) &&
181            xdr_u_int(xdrs, &fattr_ptr->fileid) &&
182            xdr_timeval(xdrs, &fattr_ptr->atime) &&
183            xdr_timeval(xdrs, &fattr_ptr->mtime) &&
184            xdr_timeval(xdrs, &fattr_ptr->ctime));
185 }
186
187
188 static bool_t
189 xdr_sattr(
190     XDR *               xdrs,
191     sattr *             sattr_ptr)
192 {
193     return(xdr_u_int(xdrs, &sattr_ptr->mode) &&
194            xdr_u_int(xdrs, &sattr_ptr->uid) &&
195            xdr_u_int(xdrs, &sattr_ptr->gid) &&
196            xdr_u_int(xdrs, &sattr_ptr->size) &&
197            xdr_timeval(xdrs, &sattr_ptr->atime) &&
198            xdr_timeval(xdrs, &sattr_ptr->mtime));
199 }
200
201
202 static bool_t
203 xdr_diropargs(
204     XDR *               xdrs,
205     diropargs *         dir_args_ptr)
206 {
207     return(xdr_f_handle(xdrs, &dir_args_ptr->dir) &&
208            xdr_path(xdrs, &dir_args_ptr->name));
209 }
210
211
212 static bool_t
213 xdr_diropres(
214     XDR *               xdrs,
215     diropres *          dir_res_ptr)
216 {
217     if (!xdr_nfsstat(xdrs, &dir_res_ptr->status)) {
218         return(FALSE);
219     }
220
221     if (dir_res_ptr->status == NFS_OK) {
222         return(xdr_f_handle(xdrs, &dir_res_ptr->diropres_u.diropres.file) &&
223                xdr_fattr(xdrs, &dir_res_ptr->diropres_u.diropres.attributes));
224     }
225     return(TRUE);
226 }
227
228
229 static bool_t
230 xdr_attrstat(
231     XDR *               xdrs,
232     attrstat *          attrstat_ptr)
233 {
234     if (!xdr_nfsstat(xdrs, &attrstat_ptr->status)) {
235         return(FALSE);
236     }
237
238     if (attrstat_ptr->status == NFS_OK) {
239         return(xdr_fattr(xdrs, &attrstat_ptr->attrstat_u.attributes));
240     }
241     return(TRUE);
242 }
243
244
245 bool_t
246 xdr_getattr(
247     XDR *               xdrs,
248     char *              params_ptr)
249 {
250     fhandle_t *         fhandle_ptr;
251     attrstat *          attrstat_ptr;
252
253     switch (xdrs->x_op) {
254         case XDR_ENCODE:
255             fhandle_ptr = (fhandle_t *) params_ptr;
256             return(xdr_f_handle(xdrs, fhandle_ptr));
257
258         case XDR_DECODE:
259             /* LINTED pointer cast */
260             attrstat_ptr = (attrstat *) params_ptr;
261             return(xdr_attrstat(xdrs, attrstat_ptr));
262
263         default:
264             return(FALSE);
265     } /* switch on operation */
266 }
267
268
269 bool_t
270 xdr_setattr(
271     XDR *               xdrs,
272     char *              params_ptr)
273 {
274     sattrargs *         sattrargs_ptr;
275     attrstat *          attrstat_ptr;
276
277     switch (xdrs->x_op) {
278         case XDR_ENCODE:
279             /* LINTED pointer cast */
280             sattrargs_ptr = (sattrargs *) params_ptr;
281             return(xdr_f_handle(xdrs, &sattrargs_ptr->file) &&
282                    xdr_sattr(xdrs, &sattrargs_ptr->attributes));
283
284         case XDR_DECODE:
285             /* LINTED pointer cast */
286             attrstat_ptr = (attrstat *) params_ptr;
287             return(xdr_attrstat(xdrs, attrstat_ptr));
288
289         default:
290             return(FALSE);
291     } /* switch on operation */
292 }
293
294
295 bool_t
296 xdr_lookup(
297     XDR *               xdrs,
298     char *              params_ptr)
299 {
300     diropargs *         diropargs_ptr;
301     diropres *          diropres_ptr;
302
303
304     switch(xdrs->x_op) {
305         case XDR_ENCODE:
306             /* LINTED pointer cast */
307             diropargs_ptr = (diropargs *) params_ptr;
308             return(xdr_f_handle(xdrs, &diropargs_ptr->dir) &&
309                    xdr_path(xdrs, &diropargs_ptr->name));
310
311         case XDR_DECODE:
312             /* LINTED pointer cast */
313             diropres_ptr = (diropres *) params_ptr;
314             return(xdr_diropres(xdrs, diropres_ptr));
315
316         default:
317             return(FALSE);
318     } /* switch on operation */
319 }
320
321 bool_t
322 xdr_readlink(
323     XDR *               xdrs,
324     char *              params_ptr)
325 {
326     fhandle_t *         fhandle_ptr;
327     readlinkres *       readlinkres_ptr;
328
329     switch(xdrs->x_op) {
330         case XDR_ENCODE:
331             fhandle_ptr = (fhandle_t *) params_ptr;
332             return(xdr_f_handle(xdrs, fhandle_ptr));
333
334         case XDR_DECODE:
335             /* LINTED pointer cast */
336             readlinkres_ptr = (readlinkres *) params_ptr;
337             if (!xdr_nfsstat(xdrs, &readlinkres_ptr->status)) {
338                 return(FALSE);
339             }
340             if (readlinkres_ptr->status != NFS_OK) {
341                 return(TRUE);
342             }
343             return(xdr_bytes(xdrs, &readlinkres_ptr->readlinkres_u.data,
344                              (unsigned int *)
345                              &readlinkres_ptr->readlinkres_u.len,
346                              (unsigned int) NFS_MAXPATHLEN));
347
348         default:
349             return(FALSE);
350     } /* switch on operation */
351 }
352
353
354 bool_t
355 xdr_read(
356     XDR *               xdrs,
357     char *              params_ptr)
358 {
359     readargs *          readargs_ptr;
360     readres *           readres_ptr;
361
362
363     switch (xdrs->x_op) {
364         case XDR_ENCODE:
365             /* LINTED pointer cast */
366             readargs_ptr = (readargs *) params_ptr;
367             return(xdr_f_handle(xdrs, &readargs_ptr->file) &&
368                    xdr_u_int(xdrs, &readargs_ptr->offset) &&
369                    xdr_u_int(xdrs, &readargs_ptr->count) &&
370                    xdr_u_int(xdrs, &readargs_ptr->totalcount));
371
372         case XDR_DECODE:
373             /* LINTED pointer cast */
374             readres_ptr = (readres *) params_ptr;
375             if (!xdr_nfsstat(xdrs, &readres_ptr->status)) {
376                 return(FALSE);
377             }
378             if (readres_ptr->status != NFS_OK) {
379                 return(TRUE);
380             }
381             return(xdr_fattr(xdrs, &readres_ptr->readres_u.reply.attributes) &&
382                    xdr_bytes(xdrs, &readres_ptr->readres_u.reply.data.data_val,
383                              &readres_ptr->readres_u.reply.data.data_len,
384                              (unsigned int) NFS_MAXDATA));
385
386         default:
387             return(FALSE);
388     } /* switch on operation */
389 }
390
391 bool_t
392 xdr_write(
393     XDR *               xdrs,
394     char *              params_ptr)
395 {
396     writeargs *         writeargs_ptr;
397     attrstat *          attrstat_ptr;
398
399
400     switch (xdrs->x_op) {
401         case XDR_ENCODE:
402             /* LINTED pointer cast */
403             writeargs_ptr = (writeargs *) params_ptr;
404             return(xdr_f_handle(xdrs, &writeargs_ptr->file) &&
405                    xdr_u_int(xdrs, &writeargs_ptr->beginoffset) &&
406                    xdr_u_int(xdrs, &writeargs_ptr->offset) &&
407                    xdr_u_int(xdrs, &writeargs_ptr->totalcount) &&
408                    xdr_bytes(xdrs, &writeargs_ptr->data.data_val,
409                                    &writeargs_ptr->data.data_len,
410                                    (unsigned int) NFS_MAXDATA));
411
412         case XDR_DECODE:
413             /* LINTED pointer cast */
414             attrstat_ptr = (attrstat *) params_ptr;
415             return(xdr_attrstat(xdrs, attrstat_ptr));
416
417         default:
418             return(FALSE);
419     } /* switch on operation */
420 }
421
422
423 bool_t
424 xdr_create(
425     XDR *               xdrs,
426     char *              params_ptr)
427 {
428     createargs *        createargs_ptr;
429     diropres *          diropres_ptr;
430
431
432     switch (xdrs->x_op) {
433         case XDR_ENCODE:
434             /* LINTED pointer cast */
435             createargs_ptr = (createargs *) params_ptr;
436             return(xdr_diropargs(xdrs, &createargs_ptr->where) &&
437                    xdr_sattr(xdrs, &createargs_ptr->attributes));
438
439         case XDR_DECODE:
440             /* LINTED pointer cast */
441             diropres_ptr = (diropres *) params_ptr;
442             return(xdr_diropres(xdrs, diropres_ptr));
443
444         default:
445             return(FALSE);
446     } /* switch on operation */
447 }
448
449
450 bool_t
451 xdr_remove(
452     XDR *               xdrs,
453     char *              params_ptr)
454 {
455     diropargs *         diropargs_ptr;
456     nfsstat *           nfsstat_ptr;
457
458
459     switch (xdrs->x_op) {
460         case XDR_ENCODE:
461             /* LINTED pointer cast */
462             diropargs_ptr = (diropargs *) params_ptr;
463             return(xdr_diropargs (xdrs, diropargs_ptr));
464
465         case XDR_DECODE:
466             /* LINTED pointer cast */
467             nfsstat_ptr = (nfsstat *) params_ptr;
468             return(xdr_nfsstat(xdrs, nfsstat_ptr));
469
470         default:
471             return(FALSE);
472     } /* switch on operation */
473 }
474
475
476 bool_t
477 xdr_rename(
478     XDR *               xdrs,
479     char *              params_ptr)
480 {
481     renameargs *        renameargs_ptr;
482     nfsstat *           nfsstat_ptr;
483
484
485     switch (xdrs->x_op) {
486         case XDR_ENCODE:
487             /* LINTED pointer cast */
488             renameargs_ptr = (renameargs *) params_ptr;
489             return(xdr_diropargs(xdrs, &renameargs_ptr->from) &&
490                    xdr_diropargs(xdrs, &renameargs_ptr->to));
491
492         case XDR_DECODE:
493             /* LINTED pointer cast */
494             nfsstat_ptr = (nfsstat *) params_ptr;
495             return(xdr_nfsstat(xdrs, nfsstat_ptr));
496
497         default:
498             return(FALSE);
499     } /* switch on operation */
500 }
501
502
503 bool_t
504 xdr_link(
505     XDR *               xdrs,
506     char *              params_ptr)
507 {
508     linkargs *          linkargs_ptr;
509     nfsstat *           nfsstat_ptr;
510
511
512     switch (xdrs->x_op) {
513         case XDR_ENCODE:
514             /* LINTED pointer cast */
515             linkargs_ptr = (linkargs *) params_ptr;
516             return(xdr_f_handle(xdrs, &linkargs_ptr->from) &&
517                    xdr_diropargs(xdrs, &linkargs_ptr->to));
518
519         case XDR_DECODE:
520             /* LINTED pointer cast */
521             nfsstat_ptr = (nfsstat *) params_ptr;
522             return(xdr_nfsstat(xdrs, nfsstat_ptr));
523
524         default:
525             return(FALSE);
526     } /* switch on operation */
527 }
528
529
530 bool_t
531 xdr_symlink(
532     XDR *               xdrs,
533     char *              params_ptr)
534 {
535     symlinkargs *       symlinkargs_ptr;
536     nfsstat *           nfsstat_ptr;
537
538
539     switch (xdrs->x_op) {
540         case XDR_ENCODE:
541             /* LINTED pointer cast */
542             symlinkargs_ptr = (symlinkargs *) params_ptr;
543             return(xdr_diropargs(xdrs, &symlinkargs_ptr->from) &&
544                    xdr_path(xdrs, &symlinkargs_ptr->to) &&
545                    xdr_sattr(xdrs, &symlinkargs_ptr->attributes));
546
547         case XDR_DECODE:
548             /* LINTED pointer cast */
549             nfsstat_ptr = (nfsstat *) params_ptr;
550             return(xdr_nfsstat(xdrs, nfsstat_ptr));
551
552         default:
553             return(FALSE);
554     } /* switch on operation */
555 }
556
557
558 bool_t
559 xdr_mkdir(
560     XDR *               xdrs,
561     char *              params_ptr)
562 {
563     mkdirargs *         mkdirargs_ptr;
564     diropres *          diropres_ptr;
565
566
567     switch (xdrs->x_op) {
568         case XDR_ENCODE:
569             /* LINTED pointer cast */
570             mkdirargs_ptr = (mkdirargs *) params_ptr;
571             return(xdr_diropargs(xdrs, &mkdirargs_ptr->where) &&
572                    xdr_sattr(xdrs, &mkdirargs_ptr->attributes));
573
574         case XDR_DECODE:
575             /* LINTED pointer cast */
576             diropres_ptr = (diropres *) params_ptr;
577             return(xdr_diropres(xdrs, diropres_ptr));
578
579         default:
580             return(FALSE);
581     } /* switch on operation */
582 }
583
584
585 bool_t
586 xdr_rmdir(
587     XDR *               xdrs,
588     char *              params_ptr)
589 {
590     diropargs *         diropargs_ptr;
591     nfsstat *           nfsstat_ptr;
592
593
594     switch (xdrs->x_op) {
595         case XDR_ENCODE:
596             /* LINTED pointer cast */
597             diropargs_ptr = (diropargs *) params_ptr;
598             return(xdr_diropargs(xdrs, diropargs_ptr));
599
600         case XDR_DECODE:
601             /* LINTED pointer cast */
602             nfsstat_ptr = (nfsstat *) params_ptr;
603             return(xdr_nfsstat(xdrs, nfsstat_ptr));
604
605         default:
606             return(FALSE);
607     } /* switch on operation */
608 }
609
610
611 bool_t
612 xdr_readdir(
613     XDR *               xdrs,
614     char *              params_ptr)
615 {
616     readdirargs *       readdirargs_ptr;
617     readdirres *        readdirres_ptr;
618     entry *             entry_ptr;
619     int                 n;              /* entry ctr */
620
621
622     switch (xdrs->x_op) {
623         case XDR_ENCODE:
624             /* LINTED pointer cast */
625             readdirargs_ptr = (readdirargs *) params_ptr;
626             return(xdr_f_handle(xdrs, &readdirargs_ptr->dir) &&
627                    xdr_opaque(xdrs, (char *) readdirargs_ptr->cookie,
628                                     NFS_COOKIESIZE) &&
629                    xdr_u_int(xdrs, &readdirargs_ptr->count));
630
631         case XDR_DECODE:
632             /* LINTED pointer cast */
633             readdirres_ptr = (readdirres *) params_ptr;
634             if (!xdr_nfsstat(xdrs, &readdirres_ptr->status)) {
635                 return(FALSE);
636             }
637             if (readdirres_ptr->status != NFS_OK) {
638                 return(TRUE);
639             }
640
641             /*
642              * go thru the stream of entries until hit an invalid one
643              * or have gotten all the user asked for.
644              *
645              * max_entries is read to obtain a maximum.  it is written
646              * to return how many entries were decoded.
647              */
648             entry_ptr = readdirres_ptr->readdirres_u.reply.entries;
649
650             n = 0;
651             while (n < readdirres_ptr->readdirres_u.reply.max_entries) {
652                 if (!xdr_bool(xdrs, &entry_ptr->valid)) {
653                     return(FALSE);
654                 }
655
656                 if (!entry_ptr->valid) {
657                     break;
658                 }
659
660                 if (!xdr_u_int(xdrs, &entry_ptr->fileid)) {
661                     return(FALSE);
662                 }
663
664                 if (!xdr_uint16_t(xdrs, &entry_ptr->name_len)) {
665                     return(FALSE);
666                 }
667
668                 if (!xdr_opaque(xdrs, entry_ptr->name, entry_ptr->name_len)) {
669                     return(FALSE);
670                 }
671
672                 if (!xdr_opaque(xdrs, entry_ptr->cookie, NFS_COOKIESIZE)) {
673                     return(FALSE);
674                 }
675
676                 n++;
677                 entry_ptr++;
678             } /* while extracting entries */
679
680             /* If we are at the user's data buffer limit, stop right now.  */
681             if (n == readdirres_ptr->readdirres_u.reply.max_entries) {
682                 return(TRUE);
683             }
684
685             /* Return how many entries were gotten for the dirlist */
686             readdirres_ptr->readdirres_u.reply.max_entries = n;
687
688             /* check the EOF flag for the dirlist */
689             if(!xdr_bool(xdrs, &readdirres_ptr->readdirres_u.reply.eof)) {
690                 return(FALSE);
691             }
692
693             return(TRUE);
694
695         default:
696             return(FALSE);
697     } /* switch on operation */
698 }
699
700 bool_t
701 xdr_statfs(
702     XDR *               xdrs,
703     char *              params_ptr)
704 {
705     fhandle_t *         fhandle_ptr;
706     statfsres *         statfsres_ptr;
707
708
709     switch (xdrs->x_op) {
710         case XDR_ENCODE:
711             fhandle_ptr = (fhandle_t *) params_ptr;
712             return(xdr_f_handle(xdrs, fhandle_ptr));
713
714         case XDR_DECODE:
715             /* LINTED pointer cast */
716             statfsres_ptr = (statfsres *) params_ptr;
717             if (!xdr_nfsstat(xdrs, &statfsres_ptr->status)) {
718                 return(FALSE);
719             }
720             if (statfsres_ptr->status != NFS_OK) {
721                 return(TRUE);
722             }
723             return(xdr_u_int(xdrs, &statfsres_ptr->statfsres_u.reply.tsize) &&
724                    xdr_u_int(xdrs, &statfsres_ptr->statfsres_u.reply.bsize) &&
725                    xdr_u_int(xdrs, &statfsres_ptr->statfsres_u.reply.blocks) &&
726                    xdr_u_int(xdrs, &statfsres_ptr->statfsres_u.reply.bfree) &&
727                    xdr_u_int(xdrs, &statfsres_ptr->statfsres_u.reply.bavail));
728
729         default:
730             return(FALSE);
731     } /* switch on operation */
732 }
733
734
735 /* sfs_c_xdr.c */