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
6 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
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
17 diff --git a/Makefile.am b/Makefile.am
18 index 4e4dc32..b7ae979 100644
21 @@ -3,6 +3,9 @@ ACLOCAL_AMFLAGS = -I m4
24 tirpc/rpcsvc/crypt.h \
25 + tirpc/rpcsvc/mount.h \
26 + tirpc/rpcsvc/nfs_prot.h \
27 + tirpc/rpcsvc/rquota.h \
30 noinst_HEADERS = tirpc/reentrant.h \
31 @@ -12,6 +15,9 @@ noinst_HEADERS = tirpc/reentrant.h \
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 \
41 diff --git a/tirpc/rpcsvc/mount.x b/tirpc/rpcsvc/mount.x
43 index 0000000..f68a06f
45 +++ b/tirpc/rpcsvc/mount.x
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.
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.
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.
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.
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.
71 + * Sun Microsystems, Inc.
72 + * 2550 Garcia Avenue
73 + * Mountain View, California 94043
77 + * Protocol description for the mount program
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 */
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 */
93 +const FHSIZE3 = 64; /* size in bytes of a file handle (v3) */
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.
102 +typedef opaque fhandle[FHSIZE];
104 +typedef opaque fhandle3<FHSIZE3>;
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.
112 +union fhstatus switch (unsigned fhs_status) {
114 + fhandle fhs_fhandle;
121 + * Status codes returned by the version 3 mount call.
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 */
136 +struct mountres3_ok {
138 + int auth_flavors<>;
141 +union mountres3 switch (mountstat3 fhs_status) {
143 + mountres3_ok mountinfo;
150 + * The type dirpath is the pathname of a directory
152 +typedef string dirpath<MNTPATHLEN>;
155 + * The type name is used for arbitrary names (hostnames, groupnames)
157 +typedef string name<MNTNAMLEN>;
160 + * A list of who has what mounted
162 +typedef struct mountbody *mountlist;
165 + dirpath ml_directory;
170 + * A list of netgroups
172 +typedef struct groupnode *groups;
179 + * A list of what is exported and to whom
181 +typedef struct exportnode *exports;
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
196 + version MOUNTVERS {
198 + * Does no work. It is made available in all RPC services
199 + * to allow server reponse testing and timing
202 + MOUNTPROC_NULL(void) = 0;
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
210 + * Unix authentication required.
213 + MOUNTPROC_MNT(dirpath) = 1;
216 + * Returns the list of remotely mounted filesystems. The
217 + * mountlist contains one entry for each hostname and
221 + MOUNTPROC_DUMP(void) = 2;
224 + * Removes the mount list entry for the directory
225 + * Unix authentication required.
228 + MOUNTPROC_UMNT(dirpath) = 3;
231 + * Removes all of the mount list entries for this client
232 + * Unix authentication required.
235 + MOUNTPROC_UMNTALL(void) = 4;
238 + * Returns a list of all the exported filesystems, and which
239 + * machines are allowed to import it.
242 + MOUNTPROC_EXPORT(void) = 5;
245 + * Identical to MOUNTPROC_EXPORT above
248 + MOUNTPROC_EXPORTALL(void) = 6;
251 + version MOUNTVERS3 {
253 + * Does no work. It is made available in all RPC services
254 + * to allow server reponse testing and timing
257 + MOUNTPROC_NULL(void) = 0;
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.
271 + MOUNTPROC_MNT(dirpath) = 1;
274 + * Returns the list of remotely mounted filesystems. The
275 + * mountlist contains one entry for each hostname and
279 + MOUNTPROC_DUMP(void) = 2;
282 + * Removes the mount list entry for the directory
283 + * Unix authentication required.
286 + MOUNTPROC_UMNT(dirpath) = 3;
289 + * Removes all of the mount list entries for this client
290 + * Unix authentication required.
293 + MOUNTPROC_UMNTALL(void) = 4;
296 + * Returns a list of all the exported filesystems, and which
297 + * machines are allowed to import it.
300 + MOUNTPROC_EXPORT(void) = 5;
304 diff --git a/tirpc/rpcsvc/nfs_prot.x b/tirpc/rpcsvc/nfs_prot.x
306 index 0000000..01564f8
308 +++ b/tirpc/rpcsvc/nfs_prot.x
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.
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.
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.
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.
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.
334 + * Sun Microsystems, Inc.
335 + * 2550 Garcia Avenue
336 + * Mountain View, California 94043
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 */
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 */
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 */
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 */
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 */
408 + * File access handle
411 + opaque data[NFS_FHSIZE];
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 */
444 + * File attributes which can be set
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 */
456 +typedef string filename<NFS_MAXNAMLEN>;
457 +typedef string nfspath<NFS_MAXPATHLEN>;
460 + * Reply status with file attributes
462 +union attrstat switch (nfsstat status) {
475 + * Arguments for directory operations
478 + nfs_fh dir; /* directory file handle */
479 + filename name; /* name (up to NFS_MAXNAMLEN bytes) */
488 + * Results from directory operation
490 +union diropres switch (nfsstat status) {
492 + diropokres diropres;
497 +union readlinkres switch (nfsstat status) {
505 + * Arguments to remote read
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)*/
515 + * Status OK portion of remote read reply
518 + fattr attributes; /* attributes, need for pagin*/
519 + opaque data<NFS_MAXDATA>;
522 +union readres switch (nfsstat status) {
530 + * Arguments to remote write
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>;
555 +struct symlinkargs {
562 +typedef opaque nfscookie[NFS_COOKIESIZE];
565 + * Arguments to readdir
567 +struct readdirargs {
568 + nfs_fh dir; /* directory handle */
570 + unsigned count; /* number of directory bytes to read */
585 +union readdirres switch (nfsstat status) {
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 */
600 +union statfsres switch (nfsstat status) {
610 + * NFSv3 constants and types
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 */
617 +typedef unsigned hyper uint64;
618 +typedef hyper int64;
619 +typedef unsigned long uint32;
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;
636 + * Error status (v3)
644 + NFS3ERR_ACCES = 13,
645 + NFS3ERR_EXIST = 17,
647 + NFS3ERR_NODEV = 19,
648 + NFS3ERR_NOTDIR = 20,
649 + NFS3ERR_ISDIR = 21,
650 + NFS3ERR_INVAL = 22,
652 + NFS3ERR_NOSPC = 28,
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
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 */
689 + * File access handle (v3)
692 + opaque data<NFS3_FHSIZE>;
705 + * File attributes (v3)
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 */
723 +union post_op_attr switch (bool attributes_follow) {
736 +union pre_op_attr switch (bool attributes_follow) {
738 + wcc_attr attributes;
744 + pre_op_attr before;
745 + post_op_attr after;
748 +union post_op_fh3 switch (bool handle_follows) {
756 + * File attributes which can be set (v3)
760 + SET_TO_SERVER_TIME = 1,
761 + SET_TO_CLIENT_TIME = 2
764 +union set_mode3 switch (bool set_it) {
771 +union set_uid3 switch (bool set_it) {
778 +union set_gid3 switch (bool set_it) {
785 +union set_size3 switch (bool set_it) {
792 +union set_atime switch (time_how set_it) {
793 +case SET_TO_CLIENT_TIME:
799 +union set_mtime switch (time_how set_it) {
800 +case SET_TO_CLIENT_TIME:
816 + * Arguments for directory operations (v3)
819 + nfs_fh3 dir; /* directory file handle */
820 + filename3 name; /* name (up to NFS_MAXNAMLEN bytes) */
824 + * Arguments to getattr (v3).
826 +struct GETATTR3args {
830 +struct GETATTR3resok {
831 + fattr3 obj_attributes;
834 +union GETATTR3res switch (nfsstat3 status) {
836 + GETATTR3resok resok;
842 + * Arguments to setattr (v3).
844 +union sattrguard3 switch (bool check) {
846 + nfstime3 obj_ctime;
851 +struct SETATTR3args {
853 + sattr3 new_attributes;
857 +struct SETATTR3resok {
861 +struct SETATTR3resfail {
865 +union SETATTR3res switch (nfsstat3 status) {
867 + SETATTR3resok resok;
869 + SETATTR3resfail resfail;
873 + * Arguments to lookup (v3).
875 +struct LOOKUP3args {
879 +struct LOOKUP3resok {
881 + post_op_attr obj_attributes;
882 + post_op_attr dir_attributes;
885 +struct LOOKUP3resfail {
886 + post_op_attr dir_attributes;
889 +union LOOKUP3res switch (nfsstat3 status) {
891 + LOOKUP3resok resok;
893 + LOOKUP3resfail resfail;
897 + * Arguments to access (v3).
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;
906 +struct ACCESS3args {
911 +struct ACCESS3resok {
912 + post_op_attr obj_attributes;
916 +struct ACCESS3resfail {
917 + post_op_attr obj_attributes;
920 +union ACCESS3res switch (nfsstat3 status) {
922 + ACCESS3resok resok;
924 + ACCESS3resfail resfail;
928 + * Arguments to readlink (v3).
930 +struct READLINK3args {
934 +struct READLINK3resok {
935 + post_op_attr symlink_attributes;
939 +struct READLINK3resfail {
940 + post_op_attr symlink_attributes;
943 +union READLINK3res switch (nfsstat3 status) {
945 + READLINK3resok resok;
947 + READLINK3resfail resfail;
951 + * Arguments to read (v3).
960 + post_op_attr file_attributes;
966 +struct READ3resfail {
967 + post_op_attr file_attributes;
970 +/* XXX: solaris 2.6 uses ``nfsstat'' here */
971 +union READ3res switch (nfsstat3 status) {
975 + READ3resfail resfail;
979 + * Arguments to write (v3).
995 +struct WRITE3resok {
998 + stable_how committed;
1002 +struct WRITE3resfail {
1003 + wcc_data file_wcc;
1006 +union WRITE3res switch (nfsstat3 status) {
1008 + WRITE3resok resok;
1010 + WRITE3resfail resfail;
1014 + * Arguments to create (v3).
1022 +union createhow3 switch (createmode3 mode) {
1025 + sattr3 obj_attributes;
1030 +struct CREATE3args {
1035 +struct CREATE3resok {
1037 + post_op_attr obj_attributes;
1041 +struct CREATE3resfail {
1045 +union CREATE3res switch (nfsstat3 status) {
1047 + CREATE3resok resok;
1049 + CREATE3resfail resfail;
1053 + * Arguments to mkdir (v3).
1055 +struct MKDIR3args {
1057 + sattr3 attributes;
1060 +struct MKDIR3resok {
1062 + post_op_attr obj_attributes;
1066 +struct MKDIR3resfail {
1070 +union MKDIR3res switch (nfsstat3 status) {
1072 + MKDIR3resok resok;
1074 + MKDIR3resfail resfail;
1078 + * Arguments to symlink (v3).
1080 +struct symlinkdata3 {
1081 + sattr3 symlink_attributes;
1082 + nfspath3 symlink_data;
1085 +struct SYMLINK3args {
1087 + symlinkdata3 symlink;
1090 +struct SYMLINK3resok {
1092 + post_op_attr obj_attributes;
1096 +struct SYMLINK3resfail {
1100 +union SYMLINK3res switch (nfsstat3 status) {
1102 + SYMLINK3resok resok;
1104 + SYMLINK3resfail resfail;
1108 + * Arguments to mknod (v3).
1110 +struct devicedata3 {
1111 + sattr3 dev_attributes;
1115 +union mknoddata3 switch (ftype3 type) {
1118 + devicedata3 device;
1121 + sattr3 pipe_attributes;
1126 +struct MKNOD3args {
1131 +struct MKNOD3resok {
1133 + post_op_attr obj_attributes;
1137 +struct MKNOD3resfail {
1141 +union MKNOD3res switch (nfsstat3 status) {
1143 + MKNOD3resok resok;
1145 + MKNOD3resfail resfail;
1149 + * Arguments to remove (v3).
1151 +struct REMOVE3args {
1152 + diropargs3 object;
1155 +struct REMOVE3resok {
1159 +struct REMOVE3resfail {
1163 +union REMOVE3res switch (nfsstat3 status) {
1165 + REMOVE3resok resok;
1167 + REMOVE3resfail resfail;
1171 + * Arguments to rmdir (v3).
1173 +struct RMDIR3args {
1174 + diropargs3 object;
1177 +struct RMDIR3resok {
1181 +struct RMDIR3resfail {
1185 +union RMDIR3res switch (nfsstat3 status) {
1187 + RMDIR3resok resok;
1189 + RMDIR3resfail resfail;
1193 + * Arguments to rename (v3).
1195 +struct RENAME3args {
1200 +struct RENAME3resok {
1201 + wcc_data fromdir_wcc;
1202 + wcc_data todir_wcc;
1205 +struct RENAME3resfail {
1206 + wcc_data fromdir_wcc;
1207 + wcc_data todir_wcc;
1210 +union RENAME3res switch (nfsstat3 status) {
1212 + RENAME3resok resok;
1214 + RENAME3resfail resfail;
1218 + * Arguments to link (v3).
1225 +struct LINK3resok {
1226 + post_op_attr file_attributes;
1227 + wcc_data linkdir_wcc;
1230 +struct LINK3resfail {
1231 + post_op_attr file_attributes;
1232 + wcc_data linkdir_wcc;
1235 +union LINK3res switch (nfsstat3 status) {
1239 + LINK3resfail resfail;
1243 + * Arguments to readdir (v3).
1245 +struct READDIR3args {
1248 + cookieverf3 cookieverf;
1256 + entry3 *nextentry;
1264 +struct READDIR3resok {
1265 + post_op_attr dir_attributes;
1266 + cookieverf3 cookieverf;
1270 +struct READDIR3resfail {
1271 + post_op_attr dir_attributes;
1274 +union READDIR3res switch (nfsstat3 status) {
1276 + READDIR3resok resok;
1278 + READDIR3resfail resfail;
1282 + * Arguments to readdirplus (v3).
1284 +struct READDIRPLUS3args {
1287 + cookieverf3 cookieverf;
1292 +struct entryplus3 {
1296 + post_op_attr name_attributes;
1297 + post_op_fh3 name_handle;
1298 + entryplus3 *nextentry;
1301 +struct dirlistplus3 {
1302 + entryplus3 *entries;
1306 +struct READDIRPLUS3resok {
1307 + post_op_attr dir_attributes;
1308 + cookieverf3 cookieverf;
1309 + dirlistplus3 reply;
1312 +struct READDIRPLUS3resfail {
1313 + post_op_attr dir_attributes;
1316 +union READDIRPLUS3res switch (nfsstat3 status) {
1318 + READDIRPLUS3resok resok;
1320 + READDIRPLUS3resfail resfail;
1324 + * Arguments to fsstat (v3).
1326 +struct FSSTAT3args {
1330 +struct FSSTAT3resok {
1331 + post_op_attr obj_attributes;
1341 +struct FSSTAT3resfail {
1342 + post_op_attr obj_attributes;
1345 +union FSSTAT3res switch (nfsstat3 status) {
1347 + FSSTAT3resok resok;
1349 + FSSTAT3resfail resfail;
1353 + * Arguments to fsinfo (v3).
1355 +const FSF3_LINK = 0x0001;
1356 +const FSF3_SYMLINK = 0x0002;
1357 +const FSF3_HOMOGENEOUS = 0x0008;
1358 +const FSF3_CANSETTIME = 0x0010;
1360 +struct FSINFO3args {
1364 +struct FSINFO3resok {
1365 + post_op_attr obj_attributes;
1373 + size3 maxfilesize;
1374 + nfstime3 time_delta;
1375 + uint32 properties;
1378 +struct FSINFO3resfail {
1379 + post_op_attr obj_attributes;
1382 +union FSINFO3res switch (nfsstat3 status) {
1384 + FSINFO3resok resok;
1386 + FSINFO3resfail resfail;
1390 + * Arguments to pathconf (v3).
1392 +struct PATHCONF3args {
1396 +struct PATHCONF3resok {
1397 + post_op_attr obj_attributes;
1401 + bool chown_restricted;
1402 + bool case_insensitive;
1403 + bool case_preserving;
1406 +struct PATHCONF3resfail {
1407 + post_op_attr obj_attributes;
1410 +union PATHCONF3res switch (nfsstat3 status) {
1412 + PATHCONF3resok resok;
1414 + PATHCONF3resfail resfail;
1418 + * Arguments to commit (v3).
1420 +struct COMMIT3args {
1426 +struct COMMIT3resok {
1427 + wcc_data file_wcc;
1431 +struct COMMIT3resfail {
1432 + wcc_data file_wcc;
1435 +union COMMIT3res switch (nfsstat3 status) {
1437 + COMMIT3resok resok;
1439 + COMMIT3resfail resfail;
1442 +#endif /* WANT_NFS3 */
1445 + * Remote file service routines
1447 +program NFS_PROGRAM {
1448 + version NFS_VERSION {
1450 + NFSPROC_NULL(void) = 0;
1453 + NFSPROC_GETATTR(nfs_fh) = 1;
1456 + NFSPROC_SETATTR(sattrargs) = 2;
1459 + NFSPROC_ROOT(void) = 3;
1462 + NFSPROC_LOOKUP(diropargs) = 4;
1465 + NFSPROC_READLINK(nfs_fh) = 5;
1468 + NFSPROC_READ(readargs) = 6;
1471 + NFSPROC_WRITECACHE(void) = 7;
1474 + NFSPROC_WRITE(writeargs) = 8;
1477 + NFSPROC_CREATE(createargs) = 9;
1480 + NFSPROC_REMOVE(diropargs) = 10;
1483 + NFSPROC_RENAME(renameargs) = 11;
1486 + NFSPROC_LINK(linkargs) = 12;
1489 + NFSPROC_SYMLINK(symlinkargs) = 13;
1492 + NFSPROC_MKDIR(createargs) = 14;
1495 + NFSPROC_RMDIR(diropargs) = 15;
1498 + NFSPROC_READDIR(readdirargs) = 16;
1501 + NFSPROC_STATFS(nfs_fh) = 17;
1505 +program NFS3_PROGRAM {
1508 + NFSPROC3_NULL(void) = 0;
1511 + NFSPROC3_GETATTR(GETATTR3args) = 1;
1514 + NFSPROC3_SETATTR(SETATTR3args) = 2;
1517 + NFSPROC3_LOOKUP(LOOKUP3args) = 3;
1520 + NFSPROC3_ACCESS(ACCESS3args) = 4;
1523 + NFSPROC3_READLINK(READLINK3args) = 5;
1526 + NFSPROC3_READ(READ3args) = 6;
1529 + NFSPROC3_WRITE(WRITE3args) = 7;
1532 + NFSPROC3_CREATE(CREATE3args) = 8;
1535 + NFSPROC3_MKDIR(MKDIR3args) = 9;
1538 + NFSPROC3_SYMLINK(SYMLINK3args) = 10;
1541 + NFSPROC3_MKNOD(MKNOD3args) = 11;
1544 + NFSPROC3_REMOVE(REMOVE3args) = 12;
1547 + NFSPROC3_RMDIR(RMDIR3args) = 13;
1550 + NFSPROC3_RENAME(RENAME3args) = 14;
1553 + NFSPROC3_LINK(LINK3args) = 15;
1556 + NFSPROC3_READDIR(READDIR3args) = 16;
1559 + NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17;
1562 + NFSPROC3_FSSTAT(FSSTAT3args) = 18;
1565 + NFSPROC3_FSINFO(FSINFO3args) = 19;
1568 + NFSPROC3_PATHCONF(PATHCONF3args) = 20;
1571 + NFSPROC3_COMMIT(COMMIT3args) = 21;
1576 diff --git a/tirpc/rpcsvc/rquota.x b/tirpc/rpcsvc/rquota.x
1577 new file mode 100644
1578 index 0000000..72864d1
1580 +++ b/tirpc/rpcsvc/rquota.x
1583 + * Remote quota protocol
1584 + * Requires unix authentication
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 */
1596 +const RQ_PATHLEN = 1024;
1598 +struct getquota_args {
1599 + string gqa_pathp<RQ_PATHLEN>; /* path to filesystem of interest */
1600 + int gqa_uid; /* inquire about quota for uid */
1604 + * remote quota structure
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 */
1620 + Q_OK = 1, /* quota returned */
1621 + Q_NOQUOTA = 2, /* noquota for uid */
1622 + Q_EPERM = 3 /* no permission to access quota */
1625 +union getquota_rslt switch (gqr_status status) {
1627 + rquota gqr_rquota; /* valid if status == Q_OK */
1634 +program RQUOTAPROG {
1635 + version RQUOTAVERS {
1640 + RQUOTAPROC_GETQUOTA(getquota_args) = 1;
1643 + * Get active quotas only
1646 + RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;