1 From baeca7ea594fe9faa1d40d35e76066c6002ca638 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
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7 [yann.morin.1998@free.fr: update for 0.3.1]
8 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
11 tirpc/rpcsvc/mount.x | 257 ++++++++++
12 tirpc/rpcsvc/nfs_prot.x | 1266 +++++++++++++++++++++++++++++++++++++++++++++++
13 tirpc/rpcsvc/rquota.x | 67 +++
14 4 files changed, 1596 insertions(+)
15 create mode 100644 tirpc/rpcsvc/mount.x
16 create mode 100644 tirpc/rpcsvc/nfs_prot.x
17 create mode 100644 tirpc/rpcsvc/rquota.x
19 diff --git a/Makefile.am b/Makefile.am
20 index aa5908e..4999066 100644
23 @@ -2,6 +2,9 @@ SUBDIRS = src man doc rpcgen
24 ACLOCAL_AMFLAGS = -I m4
26 GENFILES = tirpc/rpcsvc/crypt.h \
27 + tirpc/rpcsvc/mount.h \
28 + tirpc/rpcsvc/nfs_prot.h \
29 + tirpc/rpcsvc/rquota.h \
32 noinst_HEADERS = tirpc/reentrant.h \
33 @@ -11,6 +14,9 @@ noinst_HEADERS = tirpc/reentrant.h \
35 nobase_include_HEADERS = tirpc/netconfig.h \
36 tirpc/rpcsvc/crypt.x \
37 + tirpc/rpcsvc/mount.x \
38 + tirpc/rpcsvc/nfs_prot.x \
39 + tirpc/rpcsvc/rquota.x \
43 diff --git a/tirpc/rpcsvc/mount.x b/tirpc/rpcsvc/mount.x
45 index 0000000..f68a06f
47 +++ b/tirpc/rpcsvc/mount.x
50 + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
51 + * unrestricted use provided that this legend is included on all tape
52 + * media and as a part of the software program in whole or part. Users
53 + * may copy or modify Sun RPC without charge, but are not authorized
54 + * to license or distribute it to anyone else except as part of a product or
55 + * program developed by the user.
57 + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
58 + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
59 + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
61 + * Sun RPC is provided with no support and without any obligation on the
62 + * part of Sun Microsystems, Inc. to assist in its use, correction,
63 + * modification or enhancement.
65 + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
66 + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
67 + * OR ANY PART THEREOF.
69 + * In no event will Sun Microsystems, Inc. be liable for any lost revenue
70 + * or profits or other special, indirect and consequential damages, even if
71 + * Sun has been advised of the possibility of such damages.
73 + * Sun Microsystems, Inc.
74 + * 2550 Garcia Avenue
75 + * Mountain View, California 94043
79 + * Protocol description for the mount program
84 +%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
85 +%/*static char sccsid[] = "from: @(#)mount.x 2.1 88/08/01 4.0 RPCSRC";*/
86 +%static const char rcsid[] =
87 +% "$FreeBSD: src/include/rpcsvc/mount.x,v 1.6 1999/08/27 23:45:08 peter Exp $";
88 +%#endif /* not lint */
91 +const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
92 +const MNTNAMLEN = 255; /* maximum bytes in a name argument */
93 +const FHSIZE = 32; /* size in bytes of a file handle */
95 +const FHSIZE3 = 64; /* size in bytes of a file handle (v3) */
99 + * The fhandle is the file handle that the server passes to the client.
100 + * All file operations are done using the file handles to refer to a file
101 + * or a directory. The file handle can contain whatever information the
102 + * server needs to distinguish an individual file.
104 +typedef opaque fhandle[FHSIZE];
106 +typedef opaque fhandle3<FHSIZE3>;
110 + * If a status of zero is returned, the call completed successfully, and
111 + * a file handle for the directory follows. A non-zero status indicates
112 + * some sort of error. The status corresponds with UNIX error numbers.
114 +union fhstatus switch (unsigned fhs_status) {
116 + fhandle fhs_fhandle;
123 + * Status codes returned by the version 3 mount call.
126 + MNT3_OK = 0, /* no error */
127 + MNT3ERR_PERM = 1, /* Not owner */
128 + MNT3ERR_NOENT = 2, /* No such file or directory */
129 + MNT3ERR_IO = 5, /* I/O error */
130 + MNT3ERR_ACCES = 13, /* Permission denied */
131 + MNT3ERR_NOTDIR = 20, /* Not a directory */
132 + MNT3ERR_INVAL = 22, /* Invalid argument */
133 + MNT3ERR_NAMETOOLONG = 63, /* Filename too long */
134 + MNT3ERR_NOTSUPP = 10004, /* Operation not supported */
135 + MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
138 +struct mountres3_ok {
140 + int auth_flavors<>;
143 +union mountres3 switch (mountstat3 fhs_status) {
145 + mountres3_ok mountinfo;
152 + * The type dirpath is the pathname of a directory
154 +typedef string dirpath<MNTPATHLEN>;
157 + * The type name is used for arbitrary names (hostnames, groupnames)
159 +typedef string name<MNTNAMLEN>;
162 + * A list of who has what mounted
164 +typedef struct mountbody *mountlist;
167 + dirpath ml_directory;
172 + * A list of netgroups
174 +typedef struct groupnode *groups;
181 + * A list of what is exported and to whom
183 +typedef struct exportnode *exports;
192 + * Version one of the mount protocol communicates with version two
193 + * of the NFS protocol. Version three communicates with
194 + * version three of the NFS protocol. The only connecting
195 + * point is the fhandle structure, which is the same for both
198 + version MOUNTVERS {
200 + * Does no work. It is made available in all RPC services
201 + * to allow server reponse testing and timing
204 + MOUNTPROC_NULL(void) = 0;
207 + * If fhs_status is 0, then fhs_fhandle contains the
208 + * file handle for the directory. This file handle may
209 + * be used in the NFS protocol. This procedure also adds
210 + * a new entry to the mount list for this client mounting
212 + * Unix authentication required.
215 + MOUNTPROC_MNT(dirpath) = 1;
218 + * Returns the list of remotely mounted filesystems. The
219 + * mountlist contains one entry for each hostname and
223 + MOUNTPROC_DUMP(void) = 2;
226 + * Removes the mount list entry for the directory
227 + * Unix authentication required.
230 + MOUNTPROC_UMNT(dirpath) = 3;
233 + * Removes all of the mount list entries for this client
234 + * Unix authentication required.
237 + MOUNTPROC_UMNTALL(void) = 4;
240 + * Returns a list of all the exported filesystems, and which
241 + * machines are allowed to import it.
244 + MOUNTPROC_EXPORT(void) = 5;
247 + * Identical to MOUNTPROC_EXPORT above
250 + MOUNTPROC_EXPORTALL(void) = 6;
253 + version MOUNTVERS3 {
255 + * Does no work. It is made available in all RPC services
256 + * to allow server reponse testing and timing
259 + MOUNTPROC_NULL(void) = 0;
262 + * If mountres3.fhs_status is MNT3_OK, then
263 + * mountres3.mountinfo contains the file handle for
264 + * the directory and a list of acceptable
265 + * authentication flavors. This file handle may only
266 + * be used in the NFS version 3 protocol. This
267 + * procedure also results in the server adding a new
268 + * entry to its mount list recording that this client
269 + * has mounted the directory. AUTH_UNIX authentication
270 + * or better is required.
273 + MOUNTPROC_MNT(dirpath) = 1;
276 + * Returns the list of remotely mounted filesystems. The
277 + * mountlist contains one entry for each hostname and
281 + MOUNTPROC_DUMP(void) = 2;
284 + * Removes the mount list entry for the directory
285 + * Unix authentication required.
288 + MOUNTPROC_UMNT(dirpath) = 3;
291 + * Removes all of the mount list entries for this client
292 + * Unix authentication required.
295 + MOUNTPROC_UMNTALL(void) = 4;
298 + * Returns a list of all the exported filesystems, and which
299 + * machines are allowed to import it.
302 + MOUNTPROC_EXPORT(void) = 5;
306 diff --git a/tirpc/rpcsvc/nfs_prot.x b/tirpc/rpcsvc/nfs_prot.x
308 index 0000000..01564f8
310 +++ b/tirpc/rpcsvc/nfs_prot.x
313 + * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
314 + * unrestricted use provided that this legend is included on all tape
315 + * media and as a part of the software program in whole or part. Users
316 + * may copy or modify Sun RPC without charge, but are not authorized
317 + * to license or distribute it to anyone else except as part of a product or
318 + * program developed by the user.
320 + * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
321 + * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
322 + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
324 + * Sun RPC is provided with no support and without any obligation on the
325 + * part of Sun Microsystems, Inc. to assist in its use, correction,
326 + * modification or enhancement.
328 + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
329 + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
330 + * OR ANY PART THEREOF.
332 + * In no event will Sun Microsystems, Inc. be liable for any lost revenue
333 + * or profits or other special, indirect and consequential damages, even if
334 + * Sun has been advised of the possibility of such damages.
336 + * Sun Microsystems, Inc.
337 + * 2550 Garcia Avenue
338 + * Mountain View, California 94043
343 +%/*static char sccsid[] = "from: @(#)nfs_prot.x 1.2 87/10/12 Copyr 1987 Sun Micro";*/
344 +%/*static char sccsid[] = "from: @(#)nfs_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
345 +%static const char rcsid[] =
346 +% "$FreeBSD: src/include/rpcsvc/nfs_prot.x,v 1.7 1999/08/27 23:45:08 peter Exp $";
347 +%#endif /* not lint */
350 +const NFS_PORT = 2049;
351 +const NFS_MAXDATA = 8192;
352 +const NFS_MAXPATHLEN = 1024;
353 +const NFS_MAXNAMLEN = 255;
354 +const NFS_FHSIZE = 32;
355 +const NFS_COOKIESIZE = 4;
356 +const NFS_FIFO_DEV = -1; /* size kludge for named pipes */
361 +const NFSMODE_FMT = 0170000; /* type of file */
362 +const NFSMODE_DIR = 0040000; /* directory */
363 +const NFSMODE_CHR = 0020000; /* character special */
364 +const NFSMODE_BLK = 0060000; /* block special */
365 +const NFSMODE_REG = 0100000; /* regular */
366 +const NFSMODE_LNK = 0120000; /* symbolic link */
367 +const NFSMODE_SOCK = 0140000; /* socket */
368 +const NFSMODE_FIFO = 0010000; /* fifo */
374 + NFS_OK= 0, /* no error */
375 + NFSERR_PERM=1, /* Not owner */
376 + NFSERR_NOENT=2, /* No such file or directory */
377 + NFSERR_IO=5, /* I/O error */
378 + NFSERR_NXIO=6, /* No such device or address */
379 + NFSERR_ACCES=13, /* Permission denied */
380 + NFSERR_EXIST=17, /* File exists */
381 + NFSERR_NODEV=19, /* No such device */
382 + NFSERR_NOTDIR=20, /* Not a directory*/
383 + NFSERR_ISDIR=21, /* Is a directory */
384 + NFSERR_FBIG=27, /* File too large */
385 + NFSERR_NOSPC=28, /* No space left on device */
386 + NFSERR_ROFS=30, /* Read-only file system */
387 + NFSERR_NAMETOOLONG=63, /* File name too long */
388 + NFSERR_NOTEMPTY=66, /* Directory not empty */
389 + NFSERR_DQUOT=69, /* Disc quota exceeded */
390 + NFSERR_STALE=70, /* Stale NFS file handle */
391 + NFSERR_WFLUSH=99 /* write cache flushed */
398 + NFNON = 0, /* non-file */
399 + NFREG = 1, /* regular file */
400 + NFDIR = 2, /* directory */
401 + NFBLK = 3, /* block special */
402 + NFCHR = 4, /* character special */
403 + NFLNK = 5, /* symbolic link */
404 + NFSOCK = 6, /* unix domain sockets */
405 + NFBAD = 7, /* unused */
406 + NFFIFO = 8 /* named pipe */
410 + * File access handle
413 + opaque data[NFS_FHSIZE];
429 + ftype type; /* file type */
430 + unsigned mode; /* protection mode bits */
431 + unsigned nlink; /* # hard links */
432 + unsigned uid; /* owner user id */
433 + unsigned gid; /* owner group id */
434 + unsigned size; /* file size in bytes */
435 + unsigned blocksize; /* prefered block size */
436 + unsigned rdev; /* special device # */
437 + unsigned blocks; /* Kb of disk used by file */
438 + unsigned fsid; /* device # */
439 + unsigned fileid; /* inode # */
440 + nfstime atime; /* time of last access */
441 + nfstime mtime; /* time of last modification */
442 + nfstime ctime; /* time of last change */
446 + * File attributes which can be set
449 + unsigned mode; /* protection mode bits */
450 + unsigned uid; /* owner user id */
451 + unsigned gid; /* owner group id */
452 + unsigned size; /* file size in bytes */
453 + nfstime atime; /* time of last access */
454 + nfstime mtime; /* time of last modification */
458 +typedef string filename<NFS_MAXNAMLEN>;
459 +typedef string nfspath<NFS_MAXPATHLEN>;
462 + * Reply status with file attributes
464 +union attrstat switch (nfsstat status) {
477 + * Arguments for directory operations
480 + nfs_fh dir; /* directory file handle */
481 + filename name; /* name (up to NFS_MAXNAMLEN bytes) */
490 + * Results from directory operation
492 +union diropres switch (nfsstat status) {
494 + diropokres diropres;
499 +union readlinkres switch (nfsstat status) {
507 + * Arguments to remote read
510 + nfs_fh file; /* handle for file */
511 + unsigned offset; /* byte offset in file */
512 + unsigned count; /* immediate read count */
513 + unsigned totalcount; /* total read count (from this offset)*/
517 + * Status OK portion of remote read reply
520 + fattr attributes; /* attributes, need for pagin*/
521 + opaque data<NFS_MAXDATA>;
524 +union readres switch (nfsstat status) {
532 + * Arguments to remote write
535 + nfs_fh file; /* handle for file */
536 + unsigned beginoffset; /* beginning byte offset in file */
537 + unsigned offset; /* current byte offset in file */
538 + unsigned totalcount; /* total write count (to this offset)*/
539 + opaque data<NFS_MAXDATA>;
557 +struct symlinkargs {
564 +typedef opaque nfscookie[NFS_COOKIESIZE];
567 + * Arguments to readdir
569 +struct readdirargs {
570 + nfs_fh dir; /* directory handle */
572 + unsigned count; /* number of directory bytes to read */
587 +union readdirres switch (nfsstat status) {
594 +struct statfsokres {
595 + unsigned tsize; /* preferred transfer size in bytes */
596 + unsigned bsize; /* fundamental file system block size */
597 + unsigned blocks; /* total blocks in file system */
598 + unsigned bfree; /* free blocks in fs */
599 + unsigned bavail; /* free blocks avail to non-superuser */
602 +union statfsres switch (nfsstat status) {
612 + * NFSv3 constants and types
614 +const NFS3_FHSIZE = 64; /* maximum size in bytes of a file handle */
615 +const NFS3_COOKIEVERFSIZE = 8; /* size of a cookie verifier for READDIR */
616 +const NFS3_CREATEVERFSIZE = 8; /* size of the verifier used for CREATE */
617 +const NFS3_WRITEVERFSIZE = 8; /* size of the verifier used for WRITE */
619 +typedef unsigned hyper uint64;
620 +typedef hyper int64;
621 +typedef unsigned long uint32;
623 +typedef string filename3<>;
624 +typedef string nfspath3<>;
625 +typedef uint64 fileid3;
626 +typedef uint64 cookie3;
627 +typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
628 +typedef opaque createverf3[NFS3_CREATEVERFSIZE];
629 +typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
630 +typedef uint32 uid3;
631 +typedef uint32 gid3;
632 +typedef uint64 size3;
633 +typedef uint64 offset3;
634 +typedef uint32 mode3;
635 +typedef uint32 count3;
638 + * Error status (v3)
646 + NFS3ERR_ACCES = 13,
647 + NFS3ERR_EXIST = 17,
649 + NFS3ERR_NODEV = 19,
650 + NFS3ERR_NOTDIR = 20,
651 + NFS3ERR_ISDIR = 21,
652 + NFS3ERR_INVAL = 22,
654 + NFS3ERR_NOSPC = 28,
656 + NFS3ERR_MLINK = 31,
657 + NFS3ERR_NAMETOOLONG = 63,
658 + NFS3ERR_NOTEMPTY = 66,
659 + NFS3ERR_DQUOT = 69,
660 + NFS3ERR_STALE = 70,
661 + NFS3ERR_REMOTE = 71,
662 + NFS3ERR_BADHANDLE = 10001,
663 + NFS3ERR_NOT_SYNC = 10002,
664 + NFS3ERR_BAD_COOKIE = 10003,
665 + NFS3ERR_NOTSUPP = 10004,
666 + NFS3ERR_TOOSMALL = 10005,
667 + NFS3ERR_SERVERFAULT = 10006,
668 + NFS3ERR_BADTYPE = 10007,
669 + NFS3ERR_JUKEBOX = 10008
676 + NF3REG = 1, /* regular file */
677 + NF3DIR = 2, /* directory */
678 + NF3BLK = 3, /* block special */
679 + NF3CHR = 4, /* character special */
680 + NF3LNK = 5, /* symbolic link */
681 + NF3SOCK = 6, /* unix domain sockets */
682 + NF3FIFO = 7 /* named pipe */
691 + * File access handle (v3)
694 + opaque data<NFS3_FHSIZE>;
707 + * File attributes (v3)
710 + ftype3 type; /* file type */
711 + mode3 mode; /* protection mode bits */
712 + uint32 nlink; /* # hard links */
713 + uid3 uid; /* owner user id */
714 + gid3 gid; /* owner group id */
715 + size3 size; /* file size in bytes */
716 + size3 used; /* prefered block size */
717 + specdata3 rdev; /* special device # */
718 + uint64 fsid; /* device # */
719 + fileid3 fileid; /* inode # */
720 + nfstime3 atime; /* time of last access */
721 + nfstime3 mtime; /* time of last modification */
722 + nfstime3 ctime; /* time of last change */
725 +union post_op_attr switch (bool attributes_follow) {
738 +union pre_op_attr switch (bool attributes_follow) {
740 + wcc_attr attributes;
746 + pre_op_attr before;
747 + post_op_attr after;
750 +union post_op_fh3 switch (bool handle_follows) {
758 + * File attributes which can be set (v3)
762 + SET_TO_SERVER_TIME = 1,
763 + SET_TO_CLIENT_TIME = 2
766 +union set_mode3 switch (bool set_it) {
773 +union set_uid3 switch (bool set_it) {
780 +union set_gid3 switch (bool set_it) {
787 +union set_size3 switch (bool set_it) {
794 +union set_atime switch (time_how set_it) {
795 +case SET_TO_CLIENT_TIME:
801 +union set_mtime switch (time_how set_it) {
802 +case SET_TO_CLIENT_TIME:
818 + * Arguments for directory operations (v3)
821 + nfs_fh3 dir; /* directory file handle */
822 + filename3 name; /* name (up to NFS_MAXNAMLEN bytes) */
826 + * Arguments to getattr (v3).
828 +struct GETATTR3args {
832 +struct GETATTR3resok {
833 + fattr3 obj_attributes;
836 +union GETATTR3res switch (nfsstat3 status) {
838 + GETATTR3resok resok;
844 + * Arguments to setattr (v3).
846 +union sattrguard3 switch (bool check) {
848 + nfstime3 obj_ctime;
853 +struct SETATTR3args {
855 + sattr3 new_attributes;
859 +struct SETATTR3resok {
863 +struct SETATTR3resfail {
867 +union SETATTR3res switch (nfsstat3 status) {
869 + SETATTR3resok resok;
871 + SETATTR3resfail resfail;
875 + * Arguments to lookup (v3).
877 +struct LOOKUP3args {
881 +struct LOOKUP3resok {
883 + post_op_attr obj_attributes;
884 + post_op_attr dir_attributes;
887 +struct LOOKUP3resfail {
888 + post_op_attr dir_attributes;
891 +union LOOKUP3res switch (nfsstat3 status) {
893 + LOOKUP3resok resok;
895 + LOOKUP3resfail resfail;
899 + * Arguments to access (v3).
901 +const ACCESS3_READ = 0x0001;
902 +const ACCESS3_LOOKUP = 0x0002;
903 +const ACCESS3_MODIFY = 0x0004;
904 +const ACCESS3_EXTEND = 0x0008;
905 +const ACCESS3_DELETE = 0x0010;
906 +const ACCESS3_EXECUTE = 0x0020;
908 +struct ACCESS3args {
913 +struct ACCESS3resok {
914 + post_op_attr obj_attributes;
918 +struct ACCESS3resfail {
919 + post_op_attr obj_attributes;
922 +union ACCESS3res switch (nfsstat3 status) {
924 + ACCESS3resok resok;
926 + ACCESS3resfail resfail;
930 + * Arguments to readlink (v3).
932 +struct READLINK3args {
936 +struct READLINK3resok {
937 + post_op_attr symlink_attributes;
941 +struct READLINK3resfail {
942 + post_op_attr symlink_attributes;
945 +union READLINK3res switch (nfsstat3 status) {
947 + READLINK3resok resok;
949 + READLINK3resfail resfail;
953 + * Arguments to read (v3).
962 + post_op_attr file_attributes;
968 +struct READ3resfail {
969 + post_op_attr file_attributes;
972 +/* XXX: solaris 2.6 uses ``nfsstat'' here */
973 +union READ3res switch (nfsstat3 status) {
977 + READ3resfail resfail;
981 + * Arguments to write (v3).
997 +struct WRITE3resok {
1000 + stable_how committed;
1004 +struct WRITE3resfail {
1005 + wcc_data file_wcc;
1008 +union WRITE3res switch (nfsstat3 status) {
1010 + WRITE3resok resok;
1012 + WRITE3resfail resfail;
1016 + * Arguments to create (v3).
1024 +union createhow3 switch (createmode3 mode) {
1027 + sattr3 obj_attributes;
1032 +struct CREATE3args {
1037 +struct CREATE3resok {
1039 + post_op_attr obj_attributes;
1043 +struct CREATE3resfail {
1047 +union CREATE3res switch (nfsstat3 status) {
1049 + CREATE3resok resok;
1051 + CREATE3resfail resfail;
1055 + * Arguments to mkdir (v3).
1057 +struct MKDIR3args {
1059 + sattr3 attributes;
1062 +struct MKDIR3resok {
1064 + post_op_attr obj_attributes;
1068 +struct MKDIR3resfail {
1072 +union MKDIR3res switch (nfsstat3 status) {
1074 + MKDIR3resok resok;
1076 + MKDIR3resfail resfail;
1080 + * Arguments to symlink (v3).
1082 +struct symlinkdata3 {
1083 + sattr3 symlink_attributes;
1084 + nfspath3 symlink_data;
1087 +struct SYMLINK3args {
1089 + symlinkdata3 symlink;
1092 +struct SYMLINK3resok {
1094 + post_op_attr obj_attributes;
1098 +struct SYMLINK3resfail {
1102 +union SYMLINK3res switch (nfsstat3 status) {
1104 + SYMLINK3resok resok;
1106 + SYMLINK3resfail resfail;
1110 + * Arguments to mknod (v3).
1112 +struct devicedata3 {
1113 + sattr3 dev_attributes;
1117 +union mknoddata3 switch (ftype3 type) {
1120 + devicedata3 device;
1123 + sattr3 pipe_attributes;
1128 +struct MKNOD3args {
1133 +struct MKNOD3resok {
1135 + post_op_attr obj_attributes;
1139 +struct MKNOD3resfail {
1143 +union MKNOD3res switch (nfsstat3 status) {
1145 + MKNOD3resok resok;
1147 + MKNOD3resfail resfail;
1151 + * Arguments to remove (v3).
1153 +struct REMOVE3args {
1154 + diropargs3 object;
1157 +struct REMOVE3resok {
1161 +struct REMOVE3resfail {
1165 +union REMOVE3res switch (nfsstat3 status) {
1167 + REMOVE3resok resok;
1169 + REMOVE3resfail resfail;
1173 + * Arguments to rmdir (v3).
1175 +struct RMDIR3args {
1176 + diropargs3 object;
1179 +struct RMDIR3resok {
1183 +struct RMDIR3resfail {
1187 +union RMDIR3res switch (nfsstat3 status) {
1189 + RMDIR3resok resok;
1191 + RMDIR3resfail resfail;
1195 + * Arguments to rename (v3).
1197 +struct RENAME3args {
1202 +struct RENAME3resok {
1203 + wcc_data fromdir_wcc;
1204 + wcc_data todir_wcc;
1207 +struct RENAME3resfail {
1208 + wcc_data fromdir_wcc;
1209 + wcc_data todir_wcc;
1212 +union RENAME3res switch (nfsstat3 status) {
1214 + RENAME3resok resok;
1216 + RENAME3resfail resfail;
1220 + * Arguments to link (v3).
1227 +struct LINK3resok {
1228 + post_op_attr file_attributes;
1229 + wcc_data linkdir_wcc;
1232 +struct LINK3resfail {
1233 + post_op_attr file_attributes;
1234 + wcc_data linkdir_wcc;
1237 +union LINK3res switch (nfsstat3 status) {
1241 + LINK3resfail resfail;
1245 + * Arguments to readdir (v3).
1247 +struct READDIR3args {
1250 + cookieverf3 cookieverf;
1258 + entry3 *nextentry;
1266 +struct READDIR3resok {
1267 + post_op_attr dir_attributes;
1268 + cookieverf3 cookieverf;
1272 +struct READDIR3resfail {
1273 + post_op_attr dir_attributes;
1276 +union READDIR3res switch (nfsstat3 status) {
1278 + READDIR3resok resok;
1280 + READDIR3resfail resfail;
1284 + * Arguments to readdirplus (v3).
1286 +struct READDIRPLUS3args {
1289 + cookieverf3 cookieverf;
1294 +struct entryplus3 {
1298 + post_op_attr name_attributes;
1299 + post_op_fh3 name_handle;
1300 + entryplus3 *nextentry;
1303 +struct dirlistplus3 {
1304 + entryplus3 *entries;
1308 +struct READDIRPLUS3resok {
1309 + post_op_attr dir_attributes;
1310 + cookieverf3 cookieverf;
1311 + dirlistplus3 reply;
1314 +struct READDIRPLUS3resfail {
1315 + post_op_attr dir_attributes;
1318 +union READDIRPLUS3res switch (nfsstat3 status) {
1320 + READDIRPLUS3resok resok;
1322 + READDIRPLUS3resfail resfail;
1326 + * Arguments to fsstat (v3).
1328 +struct FSSTAT3args {
1332 +struct FSSTAT3resok {
1333 + post_op_attr obj_attributes;
1343 +struct FSSTAT3resfail {
1344 + post_op_attr obj_attributes;
1347 +union FSSTAT3res switch (nfsstat3 status) {
1349 + FSSTAT3resok resok;
1351 + FSSTAT3resfail resfail;
1355 + * Arguments to fsinfo (v3).
1357 +const FSF3_LINK = 0x0001;
1358 +const FSF3_SYMLINK = 0x0002;
1359 +const FSF3_HOMOGENEOUS = 0x0008;
1360 +const FSF3_CANSETTIME = 0x0010;
1362 +struct FSINFO3args {
1366 +struct FSINFO3resok {
1367 + post_op_attr obj_attributes;
1375 + size3 maxfilesize;
1376 + nfstime3 time_delta;
1377 + uint32 properties;
1380 +struct FSINFO3resfail {
1381 + post_op_attr obj_attributes;
1384 +union FSINFO3res switch (nfsstat3 status) {
1386 + FSINFO3resok resok;
1388 + FSINFO3resfail resfail;
1392 + * Arguments to pathconf (v3).
1394 +struct PATHCONF3args {
1398 +struct PATHCONF3resok {
1399 + post_op_attr obj_attributes;
1403 + bool chown_restricted;
1404 + bool case_insensitive;
1405 + bool case_preserving;
1408 +struct PATHCONF3resfail {
1409 + post_op_attr obj_attributes;
1412 +union PATHCONF3res switch (nfsstat3 status) {
1414 + PATHCONF3resok resok;
1416 + PATHCONF3resfail resfail;
1420 + * Arguments to commit (v3).
1422 +struct COMMIT3args {
1428 +struct COMMIT3resok {
1429 + wcc_data file_wcc;
1433 +struct COMMIT3resfail {
1434 + wcc_data file_wcc;
1437 +union COMMIT3res switch (nfsstat3 status) {
1439 + COMMIT3resok resok;
1441 + COMMIT3resfail resfail;
1444 +#endif /* WANT_NFS3 */
1447 + * Remote file service routines
1449 +program NFS_PROGRAM {
1450 + version NFS_VERSION {
1452 + NFSPROC_NULL(void) = 0;
1455 + NFSPROC_GETATTR(nfs_fh) = 1;
1458 + NFSPROC_SETATTR(sattrargs) = 2;
1461 + NFSPROC_ROOT(void) = 3;
1464 + NFSPROC_LOOKUP(diropargs) = 4;
1467 + NFSPROC_READLINK(nfs_fh) = 5;
1470 + NFSPROC_READ(readargs) = 6;
1473 + NFSPROC_WRITECACHE(void) = 7;
1476 + NFSPROC_WRITE(writeargs) = 8;
1479 + NFSPROC_CREATE(createargs) = 9;
1482 + NFSPROC_REMOVE(diropargs) = 10;
1485 + NFSPROC_RENAME(renameargs) = 11;
1488 + NFSPROC_LINK(linkargs) = 12;
1491 + NFSPROC_SYMLINK(symlinkargs) = 13;
1494 + NFSPROC_MKDIR(createargs) = 14;
1497 + NFSPROC_RMDIR(diropargs) = 15;
1500 + NFSPROC_READDIR(readdirargs) = 16;
1503 + NFSPROC_STATFS(nfs_fh) = 17;
1507 +program NFS3_PROGRAM {
1510 + NFSPROC3_NULL(void) = 0;
1513 + NFSPROC3_GETATTR(GETATTR3args) = 1;
1516 + NFSPROC3_SETATTR(SETATTR3args) = 2;
1519 + NFSPROC3_LOOKUP(LOOKUP3args) = 3;
1522 + NFSPROC3_ACCESS(ACCESS3args) = 4;
1525 + NFSPROC3_READLINK(READLINK3args) = 5;
1528 + NFSPROC3_READ(READ3args) = 6;
1531 + NFSPROC3_WRITE(WRITE3args) = 7;
1534 + NFSPROC3_CREATE(CREATE3args) = 8;
1537 + NFSPROC3_MKDIR(MKDIR3args) = 9;
1540 + NFSPROC3_SYMLINK(SYMLINK3args) = 10;
1543 + NFSPROC3_MKNOD(MKNOD3args) = 11;
1546 + NFSPROC3_REMOVE(REMOVE3args) = 12;
1549 + NFSPROC3_RMDIR(RMDIR3args) = 13;
1552 + NFSPROC3_RENAME(RENAME3args) = 14;
1555 + NFSPROC3_LINK(LINK3args) = 15;
1558 + NFSPROC3_READDIR(READDIR3args) = 16;
1561 + NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17;
1564 + NFSPROC3_FSSTAT(FSSTAT3args) = 18;
1567 + NFSPROC3_FSINFO(FSINFO3args) = 19;
1570 + NFSPROC3_PATHCONF(PATHCONF3args) = 20;
1573 + NFSPROC3_COMMIT(COMMIT3args) = 21;
1578 diff --git a/tirpc/rpcsvc/rquota.x b/tirpc/rpcsvc/rquota.x
1579 new file mode 100644
1580 index 0000000..72864d1
1582 +++ b/tirpc/rpcsvc/rquota.x
1585 + * Remote quota protocol
1586 + * Requires unix authentication
1591 +%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
1592 +%/*static char sccsid[] = "from: @(#)rquota.x 2.1 88/08/01 4.0 RPCSRC";*/
1593 +%static const char rcsid[] =
1594 +% "$FreeBSD: src/include/rpcsvc/rquota.x,v 1.6 1999/08/27 23:45:10 peter Exp $";
1595 +%#endif /* not lint */
1598 +const RQ_PATHLEN = 1024;
1600 +struct getquota_args {
1601 + string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
1602 + int gqa_uid; /* inquire about quota for uid */
1606 + * remote quota structure
1609 + int rq_bsize; /* block size for block counts */
1610 + bool rq_active; /* indicates whether quota is active */
1611 + unsigned int rq_bhardlimit; /* absolute limit on disk blks alloc */
1612 + unsigned int rq_bsoftlimit; /* preferred limit on disk blks */
1613 + unsigned int rq_curblocks; /* current block count */
1614 + unsigned int rq_fhardlimit; /* absolute limit on allocated files */
1615 + unsigned int rq_fsoftlimit; /* preferred file limit */
1616 + unsigned int rq_curfiles; /* current # allocated files */
1617 + unsigned int rq_btimeleft; /* time left for excessive disk use */
1618 + unsigned int rq_ftimeleft; /* time left for excessive files */
1622 + Q_OK = 1, /* quota returned */
1623 + Q_NOQUOTA = 2, /* noquota for uid */
1624 + Q_EPERM = 3 /* no permission to access quota */
1627 +union getquota_rslt switch (gqr_status status) {
1629 + rquota gqr_rquota; /* valid if status == Q_OK */
1636 +program RQUOTAPROG {
1637 + version RQUOTAVERS {
1642 + RQUOTAPROC_GETQUOTA(getquota_args) = 1;
1645 + * Get active quotas only
1648 + RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;