The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / libtirpc / 0006-Add-more-XDR-files-needed-to-build-rpcbind-on-top-of.patch
1 From 008a9c8ac3a84ffcc46a0eedb5b13862b279190c Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Sat, 10 Nov 2012 17:45:03 +0100
4 Subject: [PATCH] Add more XDR files needed to build rpcbind on top of libtirpc
5
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 ---
8  Makefile.am             |    6 +
9  tirpc/rpcsvc/mount.x    |  257 ++++++++++
10  tirpc/rpcsvc/nfs_prot.x | 1266 +++++++++++++++++++++++++++++++++++++++++++++++
11  tirpc/rpcsvc/rquota.x   |   67 +++
12  4 files changed, 1596 insertions(+)
13  create mode 100644 tirpc/rpcsvc/mount.x
14  create mode 100644 tirpc/rpcsvc/nfs_prot.x
15  create mode 100644 tirpc/rpcsvc/rquota.x
16
17 diff --git a/Makefile.am b/Makefile.am
18 index 4e4dc32..b7ae979 100644
19 --- a/Makefile.am
20 +++ b/Makefile.am
21 @@ -3,6 +3,9 @@ ACLOCAL_AMFLAGS = -I m4
22  
23  GENFILES = \
24                         tirpc/rpcsvc/crypt.h \
25 +                       tirpc/rpcsvc/mount.h \
26 +                       tirpc/rpcsvc/nfs_prot.h \
27 +                       tirpc/rpcsvc/rquota.h \
28                         tirpc/rpc/rpcb_prot.h
29  
30  noinst_HEADERS        = tirpc/reentrant.h \
31 @@ -12,6 +15,9 @@ noinst_HEADERS               = tirpc/reentrant.h \
32  
33  nobase_include_HEADERS = tirpc/netconfig.h \
34                          tirpc/rpcsvc/crypt.x \
35 +                        tirpc/rpcsvc/mount.x \
36 +                        tirpc/rpcsvc/nfs_prot.x \
37 +                        tirpc/rpcsvc/rquota.x \
38                          tirpc/rpc/xdr.h \
39                          tirpc/rpc/types.h \
40                          tirpc/rpc/svc_soc.h \
41 diff --git a/tirpc/rpcsvc/mount.x b/tirpc/rpcsvc/mount.x
42 new file mode 100644
43 index 0000000..f68a06f
44 --- /dev/null
45 +++ b/tirpc/rpcsvc/mount.x
46 @@ -0,0 +1,257 @@
47 +/*
48 + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
49 + * unrestricted use provided that this legend is included on all tape
50 + * media and as a part of the software program in whole or part.  Users
51 + * may copy or modify Sun RPC without charge, but are not authorized
52 + * to license or distribute it to anyone else except as part of a product or
53 + * program developed by the user.
54 + * 
55 + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
56 + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
57 + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
58 + * 
59 + * Sun RPC is provided with no support and without any obligation on the
60 + * part of Sun Microsystems, Inc. to assist in its use, correction,
61 + * modification or enhancement.
62 + * 
63 + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
64 + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
65 + * OR ANY PART THEREOF.
66 + * 
67 + * In no event will Sun Microsystems, Inc. be liable for any lost revenue
68 + * or profits or other special, indirect and consequential damages, even if
69 + * Sun has been advised of the possibility of such damages.
70 + * 
71 + * Sun Microsystems, Inc.
72 + * 2550 Garcia Avenue
73 + * Mountain View, California  94043
74 + */
75 +
76 +/*
77 + * Protocol description for the mount program
78 + */
79 +
80 +#ifndef RPC_HDR
81 +%#ifndef lint
82 +%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
83 +%/*static char sccsid[] = "from: @(#)mount.x   2.1 88/08/01 4.0 RPCSRC";*/
84 +%static const char rcsid[] =
85 +%  "$FreeBSD: src/include/rpcsvc/mount.x,v 1.6 1999/08/27 23:45:08 peter Exp $";
86 +%#endif /* not lint */
87 +#endif
88 +
89 +const MNTPATHLEN = 1024;       /* maximum bytes in a pathname argument */
90 +const MNTNAMLEN = 255;         /* maximum bytes in a name argument */
91 +const FHSIZE = 32;             /* size in bytes of a file handle */
92 +#ifdef WANT_NFS3
93 +const FHSIZE3 = 64;            /* size in bytes of a file handle (v3) */
94 +#endif
95 +
96 +/*
97 + * The fhandle is the file handle that the server passes to the client.
98 + * All file operations are done using the file handles to refer to a file
99 + * or a directory. The file handle can contain whatever information the
100 + * server needs to distinguish an individual file.
101 + */
102 +typedef opaque fhandle[FHSIZE];        
103 +#ifdef WANT_NFS3
104 +typedef opaque fhandle3<FHSIZE3>;
105 +#endif
106 +
107 +/*
108 + * If a status of zero is returned, the call completed successfully, and 
109 + * a file handle for the directory follows. A non-zero status indicates
110 + * some sort of error. The status corresponds with UNIX error numbers.
111 + */
112 +union fhstatus switch (unsigned fhs_status) {
113 +case 0:
114 +       fhandle fhs_fhandle;
115 +default:
116 +       void;
117 +};
118 +
119 +#ifdef WANT_NFS3
120 +/*
121 + * Status codes returned by the version 3 mount call.
122 + */
123 +enum mountstat3 {
124 +       MNT3_OK = 0,                 /* no error */
125 +       MNT3ERR_PERM = 1,            /* Not owner */
126 +       MNT3ERR_NOENT = 2,           /* No such file or directory */
127 +       MNT3ERR_IO = 5,              /* I/O error */
128 +       MNT3ERR_ACCES = 13,          /* Permission denied */
129 +       MNT3ERR_NOTDIR = 20,         /* Not a directory */
130 +       MNT3ERR_INVAL = 22,          /* Invalid argument */
131 +       MNT3ERR_NAMETOOLONG = 63,    /* Filename too long */
132 +       MNT3ERR_NOTSUPP = 10004,     /* Operation not supported */
133 +       MNT3ERR_SERVERFAULT = 10006  /* A failure on the server */
134 +};
135 +
136 +struct mountres3_ok {
137 +       fhandle3        fhandle;
138 +       int             auth_flavors<>;
139 +};
140 +
141 +union mountres3 switch (mountstat3 fhs_status) {
142 +case 0:
143 +       mountres3_ok    mountinfo;
144 +default:
145 +       void;
146 +};
147 +#endif
148 +
149 +/*
150 + * The type dirpath is the pathname of a directory
151 + */
152 +typedef string dirpath<MNTPATHLEN>;
153 +
154 +/*
155 + * The type name is used for arbitrary names (hostnames, groupnames)
156 + */
157 +typedef string name<MNTNAMLEN>;
158 +
159 +/*
160 + * A list of who has what mounted
161 + */
162 +typedef struct mountbody *mountlist;
163 +struct mountbody {
164 +       name ml_hostname;
165 +       dirpath ml_directory;
166 +       mountlist ml_next;
167 +};
168 +
169 +/*
170 + * A list of netgroups
171 + */
172 +typedef struct groupnode *groups;
173 +struct groupnode {
174 +       name gr_name;
175 +       groups gr_next;
176 +};
177 +
178 +/*
179 + * A list of what is exported and to whom
180 + */
181 +typedef struct exportnode *exports;
182 +struct exportnode {
183 +       dirpath ex_dir;
184 +       groups ex_groups;
185 +       exports ex_next;
186 +};
187 +
188 +program MOUNTPROG {
189 +       /*
190 +        * Version one of the mount protocol communicates with version two
191 +        * of the NFS protocol. Version three communicates with
192 +        * version three of the NFS protocol. The only connecting
193 +        * point is the fhandle structure, which is the same for both
194 +        * protocols.
195 +        */
196 +       version MOUNTVERS {
197 +               /*
198 +                * Does no work. It is made available in all RPC services
199 +                * to allow server reponse testing and timing
200 +                */
201 +               void
202 +               MOUNTPROC_NULL(void) = 0;
203 +
204 +               /*      
205 +                * If fhs_status is 0, then fhs_fhandle contains the
206 +                * file handle for the directory. This file handle may
207 +                * be used in the NFS protocol. This procedure also adds
208 +                * a new entry to the mount list for this client mounting
209 +                * the directory.
210 +                * Unix authentication required.
211 +                */
212 +               fhstatus 
213 +               MOUNTPROC_MNT(dirpath) = 1;
214 +
215 +               /*
216 +                * Returns the list of remotely mounted filesystems. The 
217 +                * mountlist contains one entry for each hostname and 
218 +                * directory pair.
219 +                */
220 +               mountlist
221 +               MOUNTPROC_DUMP(void) = 2;
222 +
223 +               /*
224 +                * Removes the mount list entry for the directory
225 +                * Unix authentication required.
226 +                */
227 +               void
228 +               MOUNTPROC_UMNT(dirpath) = 3;
229 +
230 +               /*
231 +                * Removes all of the mount list entries for this client
232 +                * Unix authentication required.
233 +                */
234 +               void
235 +               MOUNTPROC_UMNTALL(void) = 4;
236 +
237 +               /*
238 +                * Returns a list of all the exported filesystems, and which
239 +                * machines are allowed to import it.
240 +                */
241 +               exports
242 +               MOUNTPROC_EXPORT(void)  = 5;
243 +
244 +               /*
245 +                * Identical to MOUNTPROC_EXPORT above
246 +                */
247 +               exports
248 +               MOUNTPROC_EXPORTALL(void) = 6;
249 +       } = 1;
250 +#ifdef WANT_NFS3
251 +       version MOUNTVERS3 {
252 +               /*
253 +                * Does no work. It is made available in all RPC services
254 +                * to allow server reponse testing and timing
255 +                */
256 +               void
257 +               MOUNTPROC_NULL(void) = 0;
258 +
259 +               /*
260 +                * If mountres3.fhs_status is MNT3_OK, then
261 +                * mountres3.mountinfo contains the file handle for
262 +                * the directory and a list of acceptable
263 +                * authentication flavors.  This file handle may only
264 +                * be used in the NFS version 3 protocol.  This
265 +                * procedure also results in the server adding a new
266 +                * entry to its mount list recording that this client
267 +                * has mounted the directory. AUTH_UNIX authentication
268 +                * or better is required.
269 +                */
270 +               mountres3
271 +               MOUNTPROC_MNT(dirpath) = 1;
272 +
273 +               /*
274 +                * Returns the list of remotely mounted filesystems. The 
275 +                * mountlist contains one entry for each hostname and 
276 +                * directory pair.
277 +                */
278 +               mountlist
279 +               MOUNTPROC_DUMP(void) = 2;
280 +
281 +               /*
282 +                * Removes the mount list entry for the directory
283 +                * Unix authentication required.
284 +                */
285 +               void
286 +               MOUNTPROC_UMNT(dirpath) = 3;
287 +
288 +               /*
289 +                * Removes all of the mount list entries for this client
290 +                * Unix authentication required.
291 +                */
292 +               void
293 +               MOUNTPROC_UMNTALL(void) = 4;
294 +
295 +               /*
296 +                * Returns a list of all the exported filesystems, and which
297 +                * machines are allowed to import it.
298 +                */
299 +               exports
300 +               MOUNTPROC_EXPORT(void)  = 5;
301 +       } = 3;
302 +#endif
303 +} = 100005;
304 diff --git a/tirpc/rpcsvc/nfs_prot.x b/tirpc/rpcsvc/nfs_prot.x
305 new file mode 100644
306 index 0000000..01564f8
307 --- /dev/null
308 +++ b/tirpc/rpcsvc/nfs_prot.x
309 @@ -0,0 +1,1266 @@
310 +/*
311 + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
312 + * unrestricted use provided that this legend is included on all tape
313 + * media and as a part of the software program in whole or part.  Users
314 + * may copy or modify Sun RPC without charge, but are not authorized
315 + * to license or distribute it to anyone else except as part of a product or
316 + * program developed by the user.
317 + * 
318 + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
319 + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
320 + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
321 + * 
322 + * Sun RPC is provided with no support and without any obligation on the
323 + * part of Sun Microsystems, Inc. to assist in its use, correction,
324 + * modification or enhancement.
325 + * 
326 + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
327 + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
328 + * OR ANY PART THEREOF.
329 + * 
330 + * In no event will Sun Microsystems, Inc. be liable for any lost revenue
331 + * or profits or other special, indirect and consequential damages, even if
332 + * Sun has been advised of the possibility of such damages.
333 + * 
334 + * Sun Microsystems, Inc.
335 + * 2550 Garcia Avenue
336 + * Mountain View, California  94043
337 + */
338 +
339 +#ifndef RPC_HDR
340 +%#ifndef lint
341 +%/*static char sccsid[] = "from: @(#)nfs_prot.x 1.2 87/10/12 Copyr 1987 Sun Micro";*/
342 +%/*static char sccsid[] = "from: @(#)nfs_prot.x        2.1 88/08/01 4.0 RPCSRC";*/
343 +%static const char rcsid[] =
344 +%  "$FreeBSD: src/include/rpcsvc/nfs_prot.x,v 1.7 1999/08/27 23:45:08 peter Exp $";
345 +%#endif /* not lint */
346 +#endif
347 +
348 +const NFS_PORT          = 2049;
349 +const NFS_MAXDATA       = 8192;
350 +const NFS_MAXPATHLEN    = 1024;
351 +const NFS_MAXNAMLEN    = 255;
352 +const NFS_FHSIZE       = 32;
353 +const NFS_COOKIESIZE   = 4;
354 +const NFS_FIFO_DEV     = -1;   /* size kludge for named pipes */
355 +
356 +/*
357 + * File types
358 + */
359 +const NFSMODE_FMT  = 0170000;  /* type of file */
360 +const NFSMODE_DIR  = 0040000;  /* directory */
361 +const NFSMODE_CHR  = 0020000;  /* character special */
362 +const NFSMODE_BLK  = 0060000;  /* block special */
363 +const NFSMODE_REG  = 0100000;  /* regular */
364 +const NFSMODE_LNK  = 0120000;  /* symbolic link */
365 +const NFSMODE_SOCK = 0140000;  /* socket */
366 +const NFSMODE_FIFO = 0010000;  /* fifo */
367 +
368 +/*
369 + * Error status
370 + */
371 +enum nfsstat {
372 +       NFS_OK= 0,              /* no error */
373 +       NFSERR_PERM=1,          /* Not owner */
374 +       NFSERR_NOENT=2,         /* No such file or directory */
375 +       NFSERR_IO=5,            /* I/O error */
376 +       NFSERR_NXIO=6,          /* No such device or address */
377 +       NFSERR_ACCES=13,        /* Permission denied */
378 +       NFSERR_EXIST=17,        /* File exists */
379 +       NFSERR_NODEV=19,        /* No such device */
380 +       NFSERR_NOTDIR=20,       /* Not a directory*/
381 +       NFSERR_ISDIR=21,        /* Is a directory */
382 +       NFSERR_FBIG=27,         /* File too large */
383 +       NFSERR_NOSPC=28,        /* No space left on device */
384 +       NFSERR_ROFS=30,         /* Read-only file system */
385 +       NFSERR_NAMETOOLONG=63,  /* File name too long */
386 +       NFSERR_NOTEMPTY=66,     /* Directory not empty */
387 +       NFSERR_DQUOT=69,        /* Disc quota exceeded */
388 +       NFSERR_STALE=70,        /* Stale NFS file handle */
389 +       NFSERR_WFLUSH=99        /* write cache flushed */
390 +};
391 +
392 +/*
393 + * File types
394 + */
395 +enum ftype {
396 +       NFNON = 0,      /* non-file */
397 +       NFREG = 1,      /* regular file */
398 +       NFDIR = 2,      /* directory */
399 +       NFBLK = 3,      /* block special */
400 +       NFCHR = 4,      /* character special */
401 +       NFLNK = 5,      /* symbolic link */
402 +       NFSOCK = 6,     /* unix domain sockets */
403 +       NFBAD = 7,      /* unused */
404 +       NFFIFO = 8      /* named pipe */
405 +};
406 +
407 +/*
408 + * File access handle
409 + */
410 +struct nfs_fh {
411 +       opaque data[NFS_FHSIZE];
412 +};
413 +
414 +/* 
415 + * Timeval
416 + */
417 +struct nfstime {
418 +       unsigned seconds;
419 +       unsigned useconds;
420 +};
421 +
422 +
423 +/*
424 + * File attributes
425 + */
426 +struct fattr {
427 +       ftype type;             /* file type */
428 +       unsigned mode;          /* protection mode bits */
429 +       unsigned nlink;         /* # hard links */
430 +       unsigned uid;           /* owner user id */
431 +       unsigned gid;           /* owner group id */
432 +       unsigned size;          /* file size in bytes */
433 +       unsigned blocksize;     /* prefered block size */
434 +       unsigned rdev;          /* special device # */
435 +       unsigned blocks;        /* Kb of disk used by file */
436 +       unsigned fsid;          /* device # */
437 +       unsigned fileid;        /* inode # */
438 +       nfstime atime;          /* time of last access */
439 +       nfstime mtime;          /* time of last modification */
440 +       nfstime ctime;          /* time of last change */
441 +};
442 +
443 +/*
444 + * File attributes which can be set
445 + */
446 +struct sattr {
447 +       unsigned mode;  /* protection mode bits */
448 +       unsigned uid;   /* owner user id */
449 +       unsigned gid;   /* owner group id */
450 +       unsigned size;  /* file size in bytes */
451 +       nfstime atime;  /* time of last access */
452 +       nfstime mtime;  /* time of last modification */
453 +};
454 +
455 +
456 +typedef string filename<NFS_MAXNAMLEN>; 
457 +typedef string nfspath<NFS_MAXPATHLEN>;
458 +
459 +/*
460 + * Reply status with file attributes
461 + */
462 +union attrstat switch (nfsstat status) {
463 +case NFS_OK:
464 +       fattr attributes;
465 +default:
466 +       void;
467 +};
468 +
469 +struct sattrargs {
470 +       nfs_fh file;
471 +       sattr attributes;
472 +};
473 +
474 +/*
475 + * Arguments for directory operations
476 + */
477 +struct diropargs {
478 +       nfs_fh  dir;    /* directory file handle */
479 +       filename name;          /* name (up to NFS_MAXNAMLEN bytes) */
480 +};
481 +
482 +struct diropokres {
483 +       nfs_fh file;
484 +       fattr attributes;
485 +};
486 +
487 +/*
488 + * Results from directory operation
489 + */
490 +union diropres switch (nfsstat status) {
491 +case NFS_OK:
492 +       diropokres diropres;
493 +default:
494 +       void;
495 +};
496 +
497 +union readlinkres switch (nfsstat status) {
498 +case NFS_OK:
499 +       nfspath data;
500 +default:
501 +       void;
502 +};
503 +
504 +/*
505 + * Arguments to remote read
506 + */
507 +struct readargs {
508 +       nfs_fh file;            /* handle for file */
509 +       unsigned offset;        /* byte offset in file */
510 +       unsigned count;         /* immediate read count */
511 +       unsigned totalcount;    /* total read count (from this offset)*/
512 +};
513 +
514 +/*
515 + * Status OK portion of remote read reply
516 + */
517 +struct readokres {
518 +       fattr   attributes;     /* attributes, need for pagin*/
519 +       opaque data<NFS_MAXDATA>;
520 +};
521 +
522 +union readres switch (nfsstat status) {
523 +case NFS_OK:
524 +       readokres reply;
525 +default:
526 +       void;
527 +};
528 +
529 +/*
530 + * Arguments to remote write 
531 + */
532 +struct writeargs {
533 +       nfs_fh  file;           /* handle for file */
534 +       unsigned beginoffset;   /* beginning byte offset in file */
535 +       unsigned offset;        /* current byte offset in file */
536 +       unsigned totalcount;    /* total write count (to this offset)*/
537 +       opaque data<NFS_MAXDATA>;
538 +};
539 +
540 +struct createargs {
541 +       diropargs where;
542 +       sattr attributes;
543 +};
544 +
545 +struct renameargs {
546 +       diropargs from;
547 +       diropargs to;
548 +};
549 +
550 +struct linkargs {
551 +       nfs_fh from;
552 +       diropargs to;
553 +};
554 +
555 +struct symlinkargs {
556 +       diropargs from;
557 +       nfspath to;
558 +       sattr attributes;
559 +};
560 +
561 +
562 +typedef opaque nfscookie[NFS_COOKIESIZE];
563 +
564 +/*
565 + * Arguments to readdir
566 + */
567 +struct readdirargs {
568 +       nfs_fh dir;             /* directory handle */
569 +       nfscookie cookie;
570 +       unsigned count;         /* number of directory bytes to read */
571 +};
572 +
573 +struct entry {
574 +       unsigned fileid;
575 +       filename name;
576 +       nfscookie cookie;
577 +       entry *nextentry;
578 +};
579 +
580 +struct dirlist {
581 +       entry *entries;
582 +       bool eof;
583 +};
584 +
585 +union readdirres switch (nfsstat status) {
586 +case NFS_OK:
587 +       dirlist reply;
588 +default:
589 +       void;
590 +};
591 +
592 +struct statfsokres {
593 +       unsigned tsize; /* preferred transfer size in bytes */
594 +       unsigned bsize; /* fundamental file system block size */
595 +       unsigned blocks;        /* total blocks in file system */
596 +       unsigned bfree; /* free blocks in fs */
597 +       unsigned bavail;        /* free blocks avail to non-superuser */
598 +};
599 +
600 +union statfsres switch (nfsstat status) {
601 +case NFS_OK:
602 +       statfsokres reply;
603 +default:
604 +       void;
605 +};
606 +
607 +#ifdef WANT_NFS3
608 +
609 +/*
610 + * NFSv3 constants and types
611 + */
612 +const NFS3_FHSIZE      = 64;   /* maximum size in bytes of a file handle */
613 +const NFS3_COOKIEVERFSIZE = 8; /* size of a cookie verifier for READDIR */
614 +const NFS3_CREATEVERFSIZE = 8; /* size of the verifier used for CREATE */
615 +const NFS3_WRITEVERFSIZE = 8;  /* size of the verifier used for WRITE */
616 +
617 +typedef unsigned hyper uint64;
618 +typedef hyper int64;
619 +typedef unsigned long uint32;
620 +typedef long int32;
621 +typedef string filename3<>;
622 +typedef string nfspath3<>;
623 +typedef uint64 fileid3;
624 +typedef uint64 cookie3;
625 +typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
626 +typedef opaque createverf3[NFS3_CREATEVERFSIZE];
627 +typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
628 +typedef uint32 uid3;
629 +typedef uint32 gid3;
630 +typedef uint64 size3;
631 +typedef uint64 offset3;
632 +typedef uint32 mode3;
633 +typedef uint32 count3;
634 +
635 +/*
636 + * Error status (v3)
637 + */
638 +enum nfsstat3 {
639 +       NFS3_OK = 0,
640 +       NFS3ERR_PERM            = 1,
641 +       NFS3ERR_NOENT           = 2,
642 +       NFS3ERR_IO              = 5,
643 +       NFS3ERR_NXIO            = 6,
644 +       NFS3ERR_ACCES           = 13,
645 +       NFS3ERR_EXIST           = 17,
646 +       NFS3ERR_XDEV            = 18,
647 +       NFS3ERR_NODEV           = 19,
648 +       NFS3ERR_NOTDIR          = 20,
649 +       NFS3ERR_ISDIR           = 21,
650 +       NFS3ERR_INVAL           = 22,
651 +       NFS3ERR_FBIG            = 27,
652 +       NFS3ERR_NOSPC           = 28,
653 +       NFS3ERR_ROFS            = 30,
654 +       NFS3ERR_MLINK           = 31,
655 +       NFS3ERR_NAMETOOLONG     = 63,
656 +       NFS3ERR_NOTEMPTY        = 66,
657 +       NFS3ERR_DQUOT           = 69,
658 +       NFS3ERR_STALE           = 70,
659 +       NFS3ERR_REMOTE          = 71,
660 +       NFS3ERR_BADHANDLE       = 10001,
661 +       NFS3ERR_NOT_SYNC        = 10002,
662 +       NFS3ERR_BAD_COOKIE      = 10003,
663 +       NFS3ERR_NOTSUPP         = 10004,
664 +       NFS3ERR_TOOSMALL        = 10005,
665 +       NFS3ERR_SERVERFAULT     = 10006,
666 +       NFS3ERR_BADTYPE         = 10007,
667 +       NFS3ERR_JUKEBOX         = 10008
668 +};
669 +
670 +/*
671 + * File types (v3)
672 + */
673 +enum ftype3 {
674 +       NF3REG  = 1,            /* regular file */
675 +       NF3DIR  = 2,            /* directory */
676 +       NF3BLK  = 3,            /* block special */
677 +       NF3CHR  = 4,            /* character special */
678 +       NF3LNK  = 5,            /* symbolic link */
679 +       NF3SOCK = 6,            /* unix domain sockets */
680 +       NF3FIFO = 7             /* named pipe */
681 +};
682 +
683 +struct specdata3 {
684 +       uint32  specdata1;
685 +       uint32  specdata2;
686 +};
687 +
688 +/*
689 + * File access handle (v3)
690 + */
691 +struct nfs_fh3 {
692 +       opaque data<NFS3_FHSIZE>;
693 +};
694 +
695 +/* 
696 + * Timeval (v3)
697 + */
698 +struct nfstime3 {
699 +       uint32  seconds;
700 +       uint32  nseconds;
701 +};
702 +
703 +
704 +/*
705 + * File attributes (v3)
706 + */
707 +struct fattr3 {
708 +       ftype3  type;           /* file type */
709 +       mode3   mode;           /* protection mode bits */
710 +       uint32  nlink;          /* # hard links */
711 +       uid3    uid;            /* owner user id */
712 +       gid3    gid;            /* owner group id */
713 +       size3   size;           /* file size in bytes */
714 +       size3   used;           /* prefered block size */
715 +       specdata3 rdev;         /* special device # */
716 +       uint64 fsid;            /* device # */
717 +       fileid3 fileid;         /* inode # */
718 +       nfstime3 atime;         /* time of last access */
719 +       nfstime3 mtime;         /* time of last modification */
720 +       nfstime3 ctime;         /* time of last change */
721 +};
722 +
723 +union post_op_attr switch (bool attributes_follow) {
724 +case TRUE:
725 +       fattr3  attributes;
726 +case FALSE:
727 +       void;
728 +};
729 +
730 +struct wcc_attr {
731 +       size3   size;
732 +       nfstime3 mtime;
733 +       nfstime3 ctime;
734 +};
735 +
736 +union pre_op_attr switch (bool attributes_follow) {
737 +case TRUE:
738 +       wcc_attr attributes;
739 +case FALSE:
740 +       void;
741 +};
742 +
743 +struct wcc_data {
744 +       pre_op_attr before;
745 +       post_op_attr after;
746 +};
747 +
748 +union post_op_fh3 switch (bool handle_follows) {
749 +case TRUE:
750 +       nfs_fh3 handle;
751 +case FALSE:
752 +       void;
753 +};
754 +
755 +/*
756 + * File attributes which can be set (v3)
757 + */
758 +enum time_how {
759 +       DONT_CHANGE             = 0,
760 +       SET_TO_SERVER_TIME      = 1,
761 +       SET_TO_CLIENT_TIME      = 2
762 +};
763 +
764 +union set_mode3 switch (bool set_it) {
765 +case TRUE:
766 +       mode3   mode;
767 +default:
768 +       void;
769 +};
770 +
771 +union set_uid3 switch (bool set_it) {
772 +case TRUE:
773 +       uid3    uid;
774 +default:
775 +       void;
776 +};
777 +
778 +union set_gid3 switch (bool set_it) {
779 +case TRUE:
780 +       gid3    gid;
781 +default:
782 +       void;
783 +};
784 +
785 +union set_size3 switch (bool set_it) {
786 +case TRUE:
787 +       size3   size;
788 +default:
789 +       void;
790 +};
791 +
792 +union set_atime switch (time_how set_it) {
793 +case SET_TO_CLIENT_TIME:
794 +       nfstime3        atime;
795 +default:
796 +       void;
797 +};
798 +
799 +union set_mtime switch (time_how set_it) {
800 +case SET_TO_CLIENT_TIME:
801 +       nfstime3        mtime;
802 +default:
803 +       void;
804 +};
805 +
806 +struct sattr3 {
807 +       set_mode3       mode;
808 +       set_uid3        uid;
809 +       set_gid3        gid;
810 +       set_size3       size;
811 +       set_atime       atime;
812 +       set_mtime       mtime;
813 +};
814 +
815 +/*
816 + * Arguments for directory operations (v3)
817 + */
818 +struct diropargs3 {
819 +       nfs_fh3 dir;            /* directory file handle */
820 +       filename3 name;         /* name (up to NFS_MAXNAMLEN bytes) */
821 +};
822 +
823 +/*
824 + * Arguments to getattr (v3).
825 + */
826 +struct GETATTR3args {
827 +       nfs_fh3         object;
828 +};
829 +
830 +struct GETATTR3resok {
831 +       fattr3          obj_attributes;
832 +};
833 +
834 +union GETATTR3res switch (nfsstat3 status) {
835 +case NFS3_OK:
836 +       GETATTR3resok   resok;
837 +default:
838 +       void;
839 +};
840 +
841 +/*
842 + * Arguments to setattr (v3).
843 + */
844 +union sattrguard3 switch (bool check) {
845 +case TRUE:
846 +       nfstime3        obj_ctime;
847 +case FALSE:
848 +       void;
849 +};
850 +
851 +struct SETATTR3args {
852 +       nfs_fh3         object;
853 +       sattr3          new_attributes;
854 +       sattrguard3     guard;
855 +};
856 +
857 +struct SETATTR3resok {
858 +       wcc_data        obj_wcc;
859 +};
860 +
861 +struct SETATTR3resfail {
862 +       wcc_data        obj_wcc;
863 +};
864 +
865 +union SETATTR3res switch (nfsstat3 status) {
866 +case NFS3_OK:
867 +       SETATTR3resok   resok;
868 +default:
869 +       SETATTR3resfail resfail;
870 +};
871 +
872 +/*
873 + * Arguments to lookup (v3).
874 + */
875 +struct LOOKUP3args {
876 +       diropargs3      what;
877 +};
878 +
879 +struct LOOKUP3resok {
880 +       nfs_fh3         object;
881 +       post_op_attr    obj_attributes;
882 +       post_op_attr    dir_attributes;
883 +};
884 +
885 +struct LOOKUP3resfail {
886 +       post_op_attr    dir_attributes;
887 +};
888 +
889 +union LOOKUP3res switch (nfsstat3 status) {
890 +case NFS3_OK:
891 +       LOOKUP3resok    resok;
892 +default:
893 +       LOOKUP3resfail  resfail;
894 +};
895 +
896 +/*
897 + * Arguments to access (v3).
898 + */
899 +const ACCESS3_READ     = 0x0001;
900 +const ACCESS3_LOOKUP   = 0x0002;
901 +const ACCESS3_MODIFY   = 0x0004;
902 +const ACCESS3_EXTEND   = 0x0008;
903 +const ACCESS3_DELETE   = 0x0010;
904 +const ACCESS3_EXECUTE  = 0x0020;
905 +
906 +struct ACCESS3args {
907 +       nfs_fh3         object;
908 +       uint32          access;
909 +};
910 +
911 +struct ACCESS3resok {
912 +       post_op_attr    obj_attributes;
913 +       uint32          access;
914 +};
915 +
916 +struct ACCESS3resfail {
917 +       post_op_attr    obj_attributes;
918 +};
919 +
920 +union ACCESS3res switch (nfsstat3 status) {
921 +case NFS3_OK:
922 +       ACCESS3resok    resok;
923 +default:
924 +       ACCESS3resfail  resfail;
925 +};
926 +
927 +/*
928 + * Arguments to readlink (v3).
929 + */
930 +struct READLINK3args {
931 +       nfs_fh3         symlink;
932 +};
933 +
934 +struct READLINK3resok {
935 +       post_op_attr    symlink_attributes;
936 +       nfspath3        data;
937 +};
938 +
939 +struct READLINK3resfail {
940 +       post_op_attr    symlink_attributes;
941 +};
942 +
943 +union READLINK3res switch (nfsstat3 status) {
944 +case NFS3_OK:
945 +       READLINK3resok  resok;
946 +default:
947 +       READLINK3resfail resfail;
948 +};
949 +
950 +/*
951 + * Arguments to read (v3).
952 + */
953 +struct READ3args {
954 +       nfs_fh3         file;
955 +       offset3         offset;
956 +       count3          count;
957 +};
958 +
959 +struct READ3resok {
960 +       post_op_attr    file_attributes;
961 +       count3          count;
962 +       bool            eof;
963 +       opaque          data<>;
964 +};
965 +
966 +struct READ3resfail {
967 +       post_op_attr    file_attributes;
968 +};
969 +
970 +/* XXX: solaris 2.6 uses ``nfsstat'' here */
971 +union READ3res switch (nfsstat3 status) {
972 +case NFS3_OK:
973 +       READ3resok      resok;
974 +default:
975 +       READ3resfail    resfail;
976 +};
977 +
978 +/*
979 + * Arguments to write (v3).
980 + */
981 +enum stable_how {
982 +       UNSTABLE        = 0,
983 +       DATA_SYNC       = 1,
984 +       FILE_SYNC       = 2
985 +};
986 +
987 +struct WRITE3args {
988 +       nfs_fh3         file;
989 +       offset3         offset;
990 +       count3          count;
991 +       stable_how      stable;
992 +       opaque          data<>;
993 +};
994 +
995 +struct WRITE3resok {
996 +       wcc_data        file_wcc;
997 +       count3          count;
998 +       stable_how      committed;
999 +       writeverf3      verf;
1000 +};
1001 +
1002 +struct WRITE3resfail {
1003 +       wcc_data        file_wcc;
1004 +};
1005 +
1006 +union WRITE3res switch (nfsstat3 status) {
1007 +case NFS3_OK:
1008 +       WRITE3resok     resok;
1009 +default:
1010 +       WRITE3resfail   resfail;
1011 +};
1012 +
1013 +/*
1014 + * Arguments to create (v3).
1015 + */
1016 +enum createmode3 {
1017 +       UNCHECKED       = 0,
1018 +       GUARDED         = 1,
1019 +       EXCLUSIVE       = 2
1020 +};
1021 +
1022 +union createhow3 switch (createmode3 mode) {
1023 +case UNCHECKED:
1024 +case GUARDED:
1025 +       sattr3          obj_attributes;
1026 +case EXCLUSIVE:
1027 +       createverf3     verf;
1028 +};
1029 +
1030 +struct CREATE3args {
1031 +       diropargs3      where;
1032 +       createhow3      how;
1033 +};
1034 +
1035 +struct CREATE3resok {
1036 +       post_op_fh3     obj;
1037 +       post_op_attr    obj_attributes;
1038 +       wcc_data        dir_wcc;
1039 +};
1040 +
1041 +struct CREATE3resfail {
1042 +       wcc_data        dir_wcc;
1043 +};
1044 +
1045 +union CREATE3res switch (nfsstat3 status) {
1046 +case NFS3_OK:
1047 +       CREATE3resok    resok;
1048 +default:
1049 +       CREATE3resfail  resfail;
1050 +};
1051 +
1052 +/*
1053 + * Arguments to mkdir (v3).
1054 + */
1055 +struct MKDIR3args {
1056 +       diropargs3      where;
1057 +       sattr3          attributes;
1058 +};
1059 +
1060 +struct MKDIR3resok {
1061 +       post_op_fh3     obj;
1062 +       post_op_attr    obj_attributes;
1063 +       wcc_data        dir_wcc;
1064 +};
1065 +
1066 +struct MKDIR3resfail {
1067 +       wcc_data        dir_wcc;
1068 +};
1069 +
1070 +union MKDIR3res switch (nfsstat3 status) {
1071 +case NFS3_OK:
1072 +       MKDIR3resok     resok;
1073 +default:
1074 +       MKDIR3resfail   resfail;
1075 +};
1076 +
1077 +/*
1078 + * Arguments to symlink (v3).
1079 + */
1080 +struct symlinkdata3 {
1081 +       sattr3          symlink_attributes;
1082 +       nfspath3        symlink_data;
1083 +};
1084 +
1085 +struct SYMLINK3args {
1086 +       diropargs3      where;
1087 +       symlinkdata3    symlink;
1088 +};
1089 +
1090 +struct SYMLINK3resok {
1091 +       post_op_fh3     obj;
1092 +       post_op_attr    obj_attributes;
1093 +       wcc_data        dir_wcc;
1094 +};
1095 +
1096 +struct SYMLINK3resfail {
1097 +       wcc_data        dir_wcc;
1098 +};
1099 +
1100 +union SYMLINK3res switch (nfsstat3 status) {
1101 +case NFS3_OK:
1102 +       SYMLINK3resok   resok;
1103 +default:
1104 +       SYMLINK3resfail resfail;
1105 +};
1106 +
1107 +/*
1108 + * Arguments to mknod (v3).
1109 + */
1110 +struct devicedata3 {
1111 +       sattr3          dev_attributes;
1112 +       specdata3       spec;
1113 +};
1114 +
1115 +union mknoddata3 switch (ftype3 type) {
1116 +case NF3CHR:
1117 +case NF3BLK:
1118 +       devicedata3     device;
1119 +case NF3SOCK:
1120 +case NF3FIFO:
1121 +       sattr3          pipe_attributes;
1122 +default:
1123 +       void;
1124 +};
1125 +
1126 +struct MKNOD3args {
1127 +       diropargs3      where;
1128 +       mknoddata3      what;
1129 +};
1130 +
1131 +struct MKNOD3resok {
1132 +       post_op_fh3     obj;
1133 +       post_op_attr    obj_attributes;
1134 +       wcc_data        dir_wcc;
1135 +};
1136 +
1137 +struct MKNOD3resfail {
1138 +       wcc_data        dir_wcc;
1139 +};
1140 +
1141 +union MKNOD3res switch (nfsstat3 status) {
1142 +case NFS3_OK:
1143 +       MKNOD3resok     resok;
1144 +default:
1145 +       MKNOD3resfail   resfail;
1146 +};
1147 +
1148 +/*
1149 + * Arguments to remove (v3).
1150 + */
1151 +struct REMOVE3args {
1152 +       diropargs3      object;
1153 +};
1154 +
1155 +struct REMOVE3resok {
1156 +       wcc_data        dir_wcc;
1157 +};
1158 +
1159 +struct REMOVE3resfail {
1160 +       wcc_data        dir_wcc;
1161 +};
1162 +
1163 +union REMOVE3res switch (nfsstat3 status) {
1164 +case NFS3_OK:
1165 +       REMOVE3resok    resok;
1166 +default:
1167 +       REMOVE3resfail  resfail;
1168 +};
1169 +
1170 +/*
1171 + * Arguments to rmdir (v3).
1172 + */
1173 +struct RMDIR3args {
1174 +       diropargs3      object;
1175 +};
1176 +
1177 +struct RMDIR3resok {
1178 +       wcc_data        dir_wcc;
1179 +};
1180 +
1181 +struct RMDIR3resfail {
1182 +       wcc_data        dir_wcc;
1183 +};
1184 +
1185 +union RMDIR3res switch (nfsstat3 status) {
1186 +case NFS3_OK:
1187 +       RMDIR3resok     resok;
1188 +default:
1189 +       RMDIR3resfail   resfail;
1190 +};
1191 +
1192 +/*
1193 + * Arguments to rename (v3).
1194 + */
1195 +struct RENAME3args {
1196 +       diropargs3      from;
1197 +       diropargs3      to;
1198 +};
1199 +
1200 +struct RENAME3resok {
1201 +       wcc_data        fromdir_wcc;
1202 +       wcc_data        todir_wcc;
1203 +};
1204 +
1205 +struct RENAME3resfail {
1206 +       wcc_data        fromdir_wcc;
1207 +       wcc_data        todir_wcc;
1208 +};
1209 +
1210 +union RENAME3res switch (nfsstat3 status) {
1211 +case NFS3_OK:
1212 +       RENAME3resok    resok;
1213 +default:
1214 +       RENAME3resfail  resfail;
1215 +};
1216 +
1217 +/*
1218 + * Arguments to link (v3).
1219 + */
1220 +struct LINK3args {
1221 +       nfs_fh3         file;
1222 +       diropargs3      link;
1223 +};
1224 +
1225 +struct LINK3resok {
1226 +       post_op_attr    file_attributes;
1227 +       wcc_data        linkdir_wcc;
1228 +};
1229 +
1230 +struct LINK3resfail {
1231 +       post_op_attr    file_attributes;
1232 +       wcc_data        linkdir_wcc;
1233 +};
1234 +
1235 +union LINK3res switch (nfsstat3 status) {
1236 +case NFS3_OK:
1237 +       LINK3resok      resok;
1238 +default:
1239 +       LINK3resfail    resfail;
1240 +};
1241 +
1242 +/*
1243 + * Arguments to readdir (v3).
1244 + */
1245 +struct READDIR3args {
1246 +       nfs_fh3         dir;
1247 +       cookie3         cookie;
1248 +       cookieverf3     cookieverf;
1249 +       count3          count;
1250 +};
1251 +
1252 +struct entry3 {
1253 +       fileid3         fileid;
1254 +       filename3       name;
1255 +       cookie3         cookie;
1256 +       entry3          *nextentry;
1257 +};
1258 +
1259 +struct dirlist3 {
1260 +       entry3          *entries;
1261 +       bool            eof;
1262 +};
1263 +
1264 +struct READDIR3resok {
1265 +       post_op_attr    dir_attributes;
1266 +       cookieverf3     cookieverf;
1267 +       dirlist3        reply;
1268 +};
1269 +
1270 +struct READDIR3resfail {
1271 +       post_op_attr    dir_attributes;
1272 +};
1273 +
1274 +union READDIR3res switch (nfsstat3 status) {
1275 +case NFS3_OK:
1276 +       READDIR3resok   resok;
1277 +default:
1278 +       READDIR3resfail resfail;
1279 +};
1280 +
1281 +/*
1282 + * Arguments to readdirplus (v3).
1283 + */
1284 +struct READDIRPLUS3args {
1285 +       nfs_fh3         dir;
1286 +       cookie3         cookie;
1287 +       cookieverf3     cookieverf;
1288 +       count3          dircount;
1289 +       count3          maxcount;
1290 +};
1291 +
1292 +struct entryplus3 {
1293 +       fileid3         fileid;
1294 +       filename3       name;
1295 +       cookie3         cookie;
1296 +       post_op_attr    name_attributes;
1297 +       post_op_fh3     name_handle;
1298 +       entryplus3      *nextentry;
1299 +};
1300 +
1301 +struct dirlistplus3 {
1302 +       entryplus3      *entries;
1303 +       bool            eof;
1304 +};
1305 +
1306 +struct READDIRPLUS3resok {
1307 +       post_op_attr    dir_attributes;
1308 +       cookieverf3     cookieverf;
1309 +       dirlistplus3    reply;
1310 +};
1311 +
1312 +struct READDIRPLUS3resfail {
1313 +       post_op_attr    dir_attributes;
1314 +};
1315 +
1316 +union READDIRPLUS3res switch (nfsstat3 status) {
1317 +case NFS3_OK:
1318 +       READDIRPLUS3resok       resok;
1319 +default:
1320 +       READDIRPLUS3resfail     resfail;
1321 +};
1322 +
1323 +/*
1324 + * Arguments to fsstat (v3).
1325 + */
1326 +struct FSSTAT3args {
1327 +       nfs_fh3         fsroot;
1328 +};
1329 +
1330 +struct FSSTAT3resok {
1331 +       post_op_attr    obj_attributes;
1332 +       size3           tbytes;
1333 +       size3           fbytes;
1334 +       size3           abytes;
1335 +       size3           tfiles;
1336 +       size3           ffiles;
1337 +       size3           afiles;
1338 +       uint32          invarsec;
1339 +};
1340 +
1341 +struct FSSTAT3resfail {
1342 +       post_op_attr    obj_attributes;
1343 +};
1344 +
1345 +union FSSTAT3res switch (nfsstat3 status) {
1346 +case NFS3_OK:
1347 +       FSSTAT3resok    resok;
1348 +default:
1349 +       FSSTAT3resfail  resfail;
1350 +};
1351 +
1352 +/*
1353 + * Arguments to fsinfo (v3).
1354 + */
1355 +const FSF3_LINK                = 0x0001;
1356 +const FSF3_SYMLINK     = 0x0002;
1357 +const FSF3_HOMOGENEOUS = 0x0008;
1358 +const FSF3_CANSETTIME  = 0x0010;
1359 +
1360 +struct FSINFO3args {
1361 +       nfs_fh3         fsroot;
1362 +};
1363 +
1364 +struct FSINFO3resok {
1365 +       post_op_attr    obj_attributes;
1366 +       uint32          rtmax;
1367 +       uint32          rtpref;
1368 +       uint32          rtmult;
1369 +       uint32          wtmax;
1370 +       uint32          wtpref;
1371 +       uint32          wtmult;
1372 +       uint32          dtpref;
1373 +       size3           maxfilesize;
1374 +       nfstime3        time_delta;
1375 +       uint32          properties;
1376 +};
1377 +
1378 +struct FSINFO3resfail {
1379 +       post_op_attr    obj_attributes;
1380 +};
1381 +
1382 +union FSINFO3res switch (nfsstat3 status) {
1383 +case NFS3_OK:
1384 +       FSINFO3resok    resok;
1385 +default:
1386 +       FSINFO3resfail  resfail;
1387 +};
1388 +
1389 +/*
1390 + * Arguments to pathconf (v3).
1391 + */
1392 +struct PATHCONF3args {
1393 +       nfs_fh3         object;
1394 +};
1395 +
1396 +struct PATHCONF3resok {
1397 +       post_op_attr    obj_attributes;
1398 +       uint32          linkmax;
1399 +       uint32          name_max;
1400 +       bool            no_trunc;
1401 +       bool            chown_restricted;
1402 +       bool            case_insensitive;
1403 +       bool            case_preserving;
1404 +};
1405 +
1406 +struct PATHCONF3resfail {
1407 +       post_op_attr    obj_attributes;
1408 +};
1409 +
1410 +union PATHCONF3res switch (nfsstat3 status) {
1411 +case NFS3_OK:
1412 +       PATHCONF3resok  resok;
1413 +default:
1414 +       PATHCONF3resfail        resfail;
1415 +};
1416 +
1417 +/*
1418 + * Arguments to commit (v3).
1419 + */
1420 +struct COMMIT3args {
1421 +       nfs_fh3         file;
1422 +       offset3         offset;
1423 +       count3          count;
1424 +};
1425 +
1426 +struct COMMIT3resok {
1427 +       wcc_data        file_wcc;
1428 +       writeverf3      verf;
1429 +};
1430 +
1431 +struct COMMIT3resfail {
1432 +       wcc_data        file_wcc;
1433 +};
1434 +
1435 +union COMMIT3res switch (nfsstat3 status) {
1436 +case NFS3_OK:
1437 +       COMMIT3resok    resok;
1438 +default:
1439 +       COMMIT3resfail  resfail;
1440 +};
1441 +
1442 +#endif /* WANT_NFS3 */
1443 +
1444 +/*
1445 + * Remote file service routines
1446 + */
1447 +program NFS_PROGRAM {
1448 +       version NFS_VERSION {
1449 +               void 
1450 +               NFSPROC_NULL(void) = 0;
1451 +
1452 +               attrstat 
1453 +               NFSPROC_GETATTR(nfs_fh) =       1;
1454 +
1455 +               attrstat 
1456 +               NFSPROC_SETATTR(sattrargs) = 2;
1457 +
1458 +               void 
1459 +               NFSPROC_ROOT(void) = 3;
1460 +
1461 +               diropres 
1462 +               NFSPROC_LOOKUP(diropargs) = 4;
1463 +
1464 +               readlinkres 
1465 +               NFSPROC_READLINK(nfs_fh) = 5;
1466 +
1467 +               readres 
1468 +               NFSPROC_READ(readargs) = 6;
1469 +
1470 +               void 
1471 +               NFSPROC_WRITECACHE(void) = 7;
1472 +
1473 +               attrstat
1474 +               NFSPROC_WRITE(writeargs) = 8;
1475 +
1476 +               diropres
1477 +               NFSPROC_CREATE(createargs) = 9;
1478 +
1479 +               nfsstat
1480 +               NFSPROC_REMOVE(diropargs) = 10;
1481 +
1482 +               nfsstat
1483 +               NFSPROC_RENAME(renameargs) = 11;
1484 +
1485 +               nfsstat
1486 +               NFSPROC_LINK(linkargs) = 12;
1487 +
1488 +               nfsstat
1489 +               NFSPROC_SYMLINK(symlinkargs) = 13;
1490 +
1491 +               diropres
1492 +               NFSPROC_MKDIR(createargs) = 14;
1493 +
1494 +               nfsstat
1495 +               NFSPROC_RMDIR(diropargs) = 15;
1496 +
1497 +               readdirres
1498 +               NFSPROC_READDIR(readdirargs) = 16;
1499 +
1500 +               statfsres
1501 +               NFSPROC_STATFS(nfs_fh) = 17;
1502 +       } = 2;
1503 +} = 100003;
1504 +#ifdef WANT_NFS3
1505 +program NFS3_PROGRAM {
1506 +       version NFS_V3 {
1507 +               void
1508 +               NFSPROC3_NULL(void)                     = 0;
1509 +
1510 +               GETATTR3res
1511 +               NFSPROC3_GETATTR(GETATTR3args)          = 1;
1512 +
1513 +               SETATTR3res
1514 +               NFSPROC3_SETATTR(SETATTR3args)          = 2;
1515 +
1516 +               LOOKUP3res
1517 +               NFSPROC3_LOOKUP(LOOKUP3args)            = 3;
1518 +
1519 +               ACCESS3res
1520 +               NFSPROC3_ACCESS(ACCESS3args)            = 4;
1521 +
1522 +               READLINK3res
1523 +               NFSPROC3_READLINK(READLINK3args)        = 5;
1524 +
1525 +               READ3res
1526 +               NFSPROC3_READ(READ3args)                = 6;
1527 +
1528 +               WRITE3res
1529 +               NFSPROC3_WRITE(WRITE3args)              = 7;
1530 +
1531 +               CREATE3res
1532 +               NFSPROC3_CREATE(CREATE3args)            = 8;
1533 +
1534 +               MKDIR3res
1535 +               NFSPROC3_MKDIR(MKDIR3args)              = 9;
1536 +
1537 +               SYMLINK3res
1538 +               NFSPROC3_SYMLINK(SYMLINK3args)          = 10;
1539 +
1540 +               MKNOD3res
1541 +               NFSPROC3_MKNOD(MKNOD3args)              = 11;
1542 +
1543 +               REMOVE3res
1544 +               NFSPROC3_REMOVE(REMOVE3args)            = 12;
1545 +
1546 +               RMDIR3res
1547 +               NFSPROC3_RMDIR(RMDIR3args)              = 13;
1548 +
1549 +               RENAME3res
1550 +               NFSPROC3_RENAME(RENAME3args)            = 14;
1551 +
1552 +               LINK3res
1553 +               NFSPROC3_LINK(LINK3args)                = 15;
1554 +
1555 +               READDIR3res
1556 +               NFSPROC3_READDIR(READDIR3args)          = 16;
1557 +
1558 +               READDIRPLUS3res
1559 +               NFSPROC3_READDIRPLUS(READDIRPLUS3args)  = 17;
1560 +
1561 +               FSSTAT3res
1562 +               NFSPROC3_FSSTAT(FSSTAT3args)            = 18;
1563 +
1564 +               FSINFO3res
1565 +               NFSPROC3_FSINFO(FSINFO3args)            = 19;
1566 +
1567 +               PATHCONF3res
1568 +               NFSPROC3_PATHCONF(PATHCONF3args)        = 20;
1569 +
1570 +               COMMIT3res
1571 +               NFSPROC3_COMMIT(COMMIT3args)            = 21;
1572 +       } = 3;
1573 +} = 100003;
1574 +#endif
1575 +
1576 diff --git a/tirpc/rpcsvc/rquota.x b/tirpc/rpcsvc/rquota.x
1577 new file mode 100644
1578 index 0000000..72864d1
1579 --- /dev/null
1580 +++ b/tirpc/rpcsvc/rquota.x
1581 @@ -0,0 +1,67 @@
1582 +/*
1583 + * Remote quota protocol
1584 + * Requires unix authentication
1585 + */
1586 +
1587 +#ifndef RPC_HDR
1588 +%#ifndef lint
1589 +%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
1590 +%/*static char sccsid[] = "from: @(#)rquota.x  2.1 88/08/01 4.0 RPCSRC";*/
1591 +%static const char rcsid[] =
1592 +%  "$FreeBSD: src/include/rpcsvc/rquota.x,v 1.6 1999/08/27 23:45:10 peter Exp $";
1593 +%#endif /* not lint */
1594 +#endif
1595 +
1596 +const RQ_PATHLEN = 1024;
1597 +
1598 +struct getquota_args {
1599 +       string gqa_pathp<RQ_PATHLEN>;   /* path to filesystem of interest */
1600 +       int gqa_uid;                    /* inquire about quota for uid */
1601 +};
1602 +
1603 +/*
1604 + * remote quota structure
1605 + */
1606 +struct rquota {
1607 +       int rq_bsize;                   /* block size for block counts */
1608 +       bool rq_active;                 /* indicates whether quota is active */
1609 +       unsigned int rq_bhardlimit;     /* absolute limit on disk blks alloc */
1610 +       unsigned int rq_bsoftlimit;     /* preferred limit on disk blks */
1611 +       unsigned int rq_curblocks;      /* current block count */
1612 +       unsigned int rq_fhardlimit;     /* absolute limit on allocated files */
1613 +       unsigned int rq_fsoftlimit;     /* preferred file limit */
1614 +       unsigned int rq_curfiles;       /* current # allocated files */
1615 +       unsigned int rq_btimeleft;      /* time left for excessive disk use */
1616 +       unsigned int rq_ftimeleft;      /* time left for excessive files */
1617 +};     
1618 +
1619 +enum gqr_status {
1620 +       Q_OK = 1,               /* quota returned */
1621 +       Q_NOQUOTA = 2,          /* noquota for uid */
1622 +       Q_EPERM = 3             /* no permission to access quota */
1623 +};
1624 +
1625 +union getquota_rslt switch (gqr_status status) {
1626 +case Q_OK:
1627 +       rquota gqr_rquota;      /* valid if status == Q_OK */
1628 +case Q_NOQUOTA:
1629 +       void;
1630 +case Q_EPERM:
1631 +       void;
1632 +};
1633 +
1634 +program RQUOTAPROG {
1635 +       version RQUOTAVERS {
1636 +               /*
1637 +                * Get all quotas
1638 +                */
1639 +               getquota_rslt
1640 +               RQUOTAPROC_GETQUOTA(getquota_args) = 1;
1641 +
1642 +               /*
1643 +                * Get active quotas only
1644 +                */
1645 +               getquota_rslt
1646 +               RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
1647 +       } = 1;
1648 +} = 100011;
1649 -- 
1650 2.0.0
1651