2 * UNFS3 NFS protocol definitions
6 #ifndef _NFS_PROT_H_RPCGEN
7 #define _NFS_PROT_H_RPCGEN
9 /* for lack of a better place */
11 #define U(x) x __attribute__ ((unused))
16 #if HAVE_STDINT_H == 1
22 #define UNIX_PATH_MAX 108
25 #define NFS_MAXDATA_TCP 524288
26 #define NFS_MAXDATA_UDP 32768
27 #define NFS_MAX_UDP_PACKET (NFS_MAXDATA_UDP + 4096) /* The extra 4096 bytes are for the RPC header */
28 #define NFS_MAXPATHLEN 1024
29 #define NFS_MAXNAMLEN 255
30 #define NFS_FIFO_DEV -1
31 #define NFSMODE_FMT 0170000
32 #define NFSMODE_DIR 0040000
33 #define NFSMODE_CHR 0020000
34 #define NFSMODE_BLK 0060000
35 #define NFSMODE_REG 0100000
36 #define NFSMODE_LNK 0120000
37 #define NFSMODE_SOCK 0140000
38 #define NFSMODE_FIFO 0010000
40 typedef char *filename;
42 typedef char *nfspath;
43 #define NFS3_FHSIZE 64
44 #define NFS3_COOKIEVERFSIZE 8
45 #define NFS3_CREATEVERFSIZE 8
46 #define NFS3_WRITEVERFSIZE 8
49 typedef uint64_t uint64;
53 typedef int64_t int64;
57 #if HAVE_XDR_U_LONG == 1
58 typedef u_long uint32;
60 typedef uint32_t uint32;
65 #if HAVE_XDR_LONG == 1
68 typedef int32_t int32;
72 typedef char *filename3;
74 typedef char *nfspath3;
76 typedef uint64 fileid3;
78 typedef uint64 cookie3;
80 typedef char cookieverf3[NFS3_COOKIEVERFSIZE];
82 typedef char createverf3[NFS3_CREATEVERFSIZE];
84 typedef char writeverf3[NFS3_WRITEVERFSIZE];
92 typedef uint64 offset3;
96 typedef uint32 count3;
115 NFS3ERR_NAMETOOLONG = 63,
116 NFS3ERR_NOTEMPTY = 66,
120 NFS3ERR_BADHANDLE = 10001,
121 NFS3ERR_NOT_SYNC = 10002,
122 NFS3ERR_BAD_COOKIE = 10003,
123 NFS3ERR_NOTSUPP = 10004,
124 NFS3ERR_TOOSMALL = 10005,
125 NFS3ERR_SERVERFAULT = 10006,
126 NFS3ERR_BADTYPE = 10007,
127 NFS3ERR_JUKEBOX = 10008,
129 typedef enum nfsstat3 nfsstat3;
140 typedef enum ftype3 ftype3;
146 typedef struct specdata3 specdata3;
154 typedef struct nfs_fh3 nfs_fh3;
160 typedef struct nfstime3 nfstime3;
177 typedef struct fattr3 fattr3;
179 struct post_op_attr {
180 bool_t attributes_follow;
185 typedef struct post_op_attr post_op_attr;
192 typedef struct wcc_attr wcc_attr;
195 bool_t attributes_follow;
200 typedef struct pre_op_attr pre_op_attr;
206 typedef struct wcc_data wcc_data;
209 bool_t handle_follows;
214 typedef struct post_op_fh3 post_op_fh3;
218 SET_TO_SERVER_TIME = 1,
219 SET_TO_CLIENT_TIME = 2,
221 typedef enum time_how time_how;
229 typedef struct set_mode3 set_mode3;
237 typedef struct set_uid3 set_uid3;
245 typedef struct set_gid3 set_gid3;
253 typedef struct set_size3 set_size3;
261 typedef struct set_atime set_atime;
269 typedef struct set_mtime set_mtime;
279 typedef struct sattr3 sattr3;
285 typedef struct diropargs3 diropargs3;
287 struct GETATTR3args {
290 typedef struct GETATTR3args GETATTR3args;
292 struct GETATTR3resok {
293 fattr3 obj_attributes;
295 typedef struct GETATTR3resok GETATTR3resok;
303 typedef struct GETATTR3res GETATTR3res;
311 typedef struct sattrguard3 sattrguard3;
313 struct SETATTR3args {
315 sattr3 new_attributes;
318 typedef struct SETATTR3args SETATTR3args;
320 struct SETATTR3resok {
323 typedef struct SETATTR3resok SETATTR3resok;
325 struct SETATTR3resfail {
328 typedef struct SETATTR3resfail SETATTR3resfail;
334 SETATTR3resfail resfail;
337 typedef struct SETATTR3res SETATTR3res;
342 typedef struct LOOKUP3args LOOKUP3args;
344 struct LOOKUP3resok {
345 post_op_attr dir_attributes;
347 post_op_attr obj_attributes;
349 typedef struct LOOKUP3resok LOOKUP3resok;
351 struct LOOKUP3resfail {
352 post_op_attr dir_attributes;
354 typedef struct LOOKUP3resfail LOOKUP3resfail;
360 LOOKUP3resfail resfail;
363 typedef struct LOOKUP3res LOOKUP3res;
365 #define ACCESS3_READ 0x0001
366 #define ACCESS3_LOOKUP 0x0002
367 #define ACCESS3_MODIFY 0x0004
368 #define ACCESS3_EXTEND 0x0008
369 #define ACCESS3_DELETE 0x0010
370 #define ACCESS3_EXECUTE 0x0020
376 typedef struct ACCESS3args ACCESS3args;
378 struct ACCESS3resok {
379 post_op_attr obj_attributes;
382 typedef struct ACCESS3resok ACCESS3resok;
384 struct ACCESS3resfail {
385 post_op_attr obj_attributes;
387 typedef struct ACCESS3resfail ACCESS3resfail;
393 ACCESS3resfail resfail;
396 typedef struct ACCESS3res ACCESS3res;
398 struct READLINK3args {
401 typedef struct READLINK3args READLINK3args;
403 struct READLINK3resok {
404 post_op_attr symlink_attributes;
407 typedef struct READLINK3resok READLINK3resok;
409 struct READLINK3resfail {
410 post_op_attr symlink_attributes;
412 typedef struct READLINK3resfail READLINK3resfail;
414 struct READLINK3res {
417 READLINK3resok resok;
418 READLINK3resfail resfail;
421 typedef struct READLINK3res READLINK3res;
428 typedef struct READ3args READ3args;
431 post_op_attr file_attributes;
439 typedef struct READ3resok READ3resok;
441 struct READ3resfail {
442 post_op_attr file_attributes;
444 typedef struct READ3resfail READ3resfail;
450 READ3resfail resfail;
453 typedef struct READ3res READ3res;
460 typedef enum stable_how stable_how;
472 typedef struct WRITE3args WRITE3args;
477 stable_how committed;
480 typedef struct WRITE3resok WRITE3resok;
482 struct WRITE3resfail {
485 typedef struct WRITE3resfail WRITE3resfail;
491 WRITE3resfail resfail;
494 typedef struct WRITE3res WRITE3res;
501 typedef enum createmode3 createmode3;
506 sattr3 obj_attributes;
510 typedef struct createhow3 createhow3;
516 typedef struct CREATE3args CREATE3args;
518 struct CREATE3resok {
521 post_op_attr obj_attributes;
523 typedef struct CREATE3resok CREATE3resok;
525 struct CREATE3resfail {
528 typedef struct CREATE3resfail CREATE3resfail;
534 CREATE3resfail resfail;
537 typedef struct CREATE3res CREATE3res;
543 typedef struct MKDIR3args MKDIR3args;
548 post_op_attr obj_attributes;
550 typedef struct MKDIR3resok MKDIR3resok;
552 struct MKDIR3resfail {
555 typedef struct MKDIR3resfail MKDIR3resfail;
561 MKDIR3resfail resfail;
564 typedef struct MKDIR3res MKDIR3res;
566 struct symlinkdata3 {
567 sattr3 symlink_attributes;
568 nfspath3 symlink_data;
570 typedef struct symlinkdata3 symlinkdata3;
572 struct SYMLINK3args {
574 symlinkdata3 symlink;
576 typedef struct SYMLINK3args SYMLINK3args;
578 struct SYMLINK3resok {
581 post_op_attr obj_attributes;
583 typedef struct SYMLINK3resok SYMLINK3resok;
585 struct SYMLINK3resfail {
588 typedef struct SYMLINK3resfail SYMLINK3resfail;
594 SYMLINK3resfail resfail;
597 typedef struct SYMLINK3res SYMLINK3res;
600 sattr3 dev_attributes;
603 typedef struct devicedata3 devicedata3;
609 sattr3 pipe_attributes;
612 typedef struct mknoddata3 mknoddata3;
618 typedef struct MKNOD3args MKNOD3args;
623 post_op_attr obj_attributes;
625 typedef struct MKNOD3resok MKNOD3resok;
627 struct MKNOD3resfail {
630 typedef struct MKNOD3resfail MKNOD3resfail;
636 MKNOD3resfail resfail;
639 typedef struct MKNOD3res MKNOD3res;
644 typedef struct REMOVE3args REMOVE3args;
646 struct REMOVE3resok {
649 typedef struct REMOVE3resok REMOVE3resok;
651 struct REMOVE3resfail {
654 typedef struct REMOVE3resfail REMOVE3resfail;
660 REMOVE3resfail resfail;
663 typedef struct REMOVE3res REMOVE3res;
668 typedef struct RMDIR3args RMDIR3args;
673 typedef struct RMDIR3resok RMDIR3resok;
675 struct RMDIR3resfail {
678 typedef struct RMDIR3resfail RMDIR3resfail;
684 RMDIR3resfail resfail;
687 typedef struct RMDIR3res RMDIR3res;
693 typedef struct RENAME3args RENAME3args;
695 struct RENAME3resok {
696 wcc_data fromdir_wcc;
699 typedef struct RENAME3resok RENAME3resok;
701 struct RENAME3resfail {
702 wcc_data fromdir_wcc;
705 typedef struct RENAME3resfail RENAME3resfail;
711 RENAME3resfail resfail;
714 typedef struct RENAME3res RENAME3res;
720 typedef struct LINK3args LINK3args;
723 post_op_attr file_attributes;
724 wcc_data linkdir_wcc;
726 typedef struct LINK3resok LINK3resok;
728 struct LINK3resfail {
729 post_op_attr file_attributes;
730 wcc_data linkdir_wcc;
732 typedef struct LINK3resfail LINK3resfail;
738 LINK3resfail resfail;
741 typedef struct LINK3res LINK3res;
743 struct READDIR3args {
746 cookieverf3 cookieverf;
749 typedef struct READDIR3args READDIR3args;
755 struct entry3 *nextentry;
757 typedef struct entry3 entry3;
763 typedef struct dirlist3 dirlist3;
765 struct READDIR3resok {
766 post_op_attr dir_attributes;
767 cookieverf3 cookieverf;
770 typedef struct READDIR3resok READDIR3resok;
772 struct READDIR3resfail {
773 post_op_attr dir_attributes;
775 typedef struct READDIR3resfail READDIR3resfail;
781 READDIR3resfail resfail;
784 typedef struct READDIR3res READDIR3res;
786 struct READDIRPLUS3args {
789 cookieverf3 cookieverf;
793 typedef struct READDIRPLUS3args READDIRPLUS3args;
799 post_op_attr name_attributes;
800 post_op_fh3 name_handle;
801 struct entryplus3 *nextentry;
803 typedef struct entryplus3 entryplus3;
805 struct dirlistplus3 {
809 typedef struct dirlistplus3 dirlistplus3;
811 struct READDIRPLUS3resok {
812 post_op_attr dir_attributes;
813 cookieverf3 cookieverf;
816 typedef struct READDIRPLUS3resok READDIRPLUS3resok;
818 struct READDIRPLUS3resfail {
819 post_op_attr dir_attributes;
821 typedef struct READDIRPLUS3resfail READDIRPLUS3resfail;
823 struct READDIRPLUS3res {
826 READDIRPLUS3resok resok;
827 READDIRPLUS3resfail resfail;
830 typedef struct READDIRPLUS3res READDIRPLUS3res;
835 typedef struct FSSTAT3args FSSTAT3args;
837 struct FSSTAT3resok {
838 post_op_attr obj_attributes;
847 typedef struct FSSTAT3resok FSSTAT3resok;
849 struct FSSTAT3resfail {
850 post_op_attr obj_attributes;
852 typedef struct FSSTAT3resfail FSSTAT3resfail;
858 FSSTAT3resfail resfail;
861 typedef struct FSSTAT3res FSSTAT3res;
862 #define FSF3_LINK 0x0001
863 #define FSF3_SYMLINK 0x0002
864 #define FSF3_HOMOGENEOUS 0x0008
865 #define FSF3_CANSETTIME 0x0010
870 typedef struct FSINFO3args FSINFO3args;
872 struct FSINFO3resok {
873 post_op_attr obj_attributes;
885 typedef struct FSINFO3resok FSINFO3resok;
887 struct FSINFO3resfail {
888 post_op_attr obj_attributes;
890 typedef struct FSINFO3resfail FSINFO3resfail;
896 FSINFO3resfail resfail;
899 typedef struct FSINFO3res FSINFO3res;
901 struct PATHCONF3args {
904 typedef struct PATHCONF3args PATHCONF3args;
906 struct PATHCONF3resok {
907 post_op_attr obj_attributes;
911 bool_t chown_restricted;
912 bool_t case_insensitive;
913 bool_t case_preserving;
915 typedef struct PATHCONF3resok PATHCONF3resok;
917 struct PATHCONF3resfail {
918 post_op_attr obj_attributes;
920 typedef struct PATHCONF3resfail PATHCONF3resfail;
922 struct PATHCONF3res {
925 PATHCONF3resok resok;
926 PATHCONF3resfail resfail;
929 typedef struct PATHCONF3res PATHCONF3res;
936 typedef struct COMMIT3args COMMIT3args;
938 struct COMMIT3resok {
942 typedef struct COMMIT3resok COMMIT3resok;
944 struct COMMIT3resfail {
947 typedef struct COMMIT3resfail COMMIT3resfail;
953 COMMIT3resfail resfail;
956 typedef struct COMMIT3res COMMIT3res;
958 #define NFS3_PROGRAM 100003
961 #define NFSPROC3_NULL 0
962 extern void * nfsproc3_null_3_svc(void *, struct svc_req *);
963 #define NFSPROC3_GETATTR 1
964 extern GETATTR3res * nfsproc3_getattr_3_svc(GETATTR3args *, struct svc_req *);
965 #define NFSPROC3_SETATTR 2
966 extern SETATTR3res * nfsproc3_setattr_3_svc(SETATTR3args *, struct svc_req *);
967 #define NFSPROC3_LOOKUP 3
968 extern LOOKUP3res * nfsproc3_lookup_3_svc(LOOKUP3args *, struct svc_req *);
969 #define NFSPROC3_ACCESS 4
970 extern ACCESS3res * nfsproc3_access_3_svc(ACCESS3args *, struct svc_req *);
971 #define NFSPROC3_READLINK 5
972 extern READLINK3res * nfsproc3_readlink_3_svc(READLINK3args *, struct svc_req *);
973 #define NFSPROC3_READ 6
974 extern READ3res * nfsproc3_read_3_svc(READ3args *, struct svc_req *);
975 #define NFSPROC3_WRITE 7
976 extern WRITE3res * nfsproc3_write_3_svc(WRITE3args *, struct svc_req *);
977 #define NFSPROC3_CREATE 8
978 extern CREATE3res * nfsproc3_create_3_svc(CREATE3args *, struct svc_req *);
979 #define NFSPROC3_MKDIR 9
980 extern MKDIR3res * nfsproc3_mkdir_3_svc(MKDIR3args *, struct svc_req *);
981 #define NFSPROC3_SYMLINK 10
982 extern SYMLINK3res * nfsproc3_symlink_3_svc(SYMLINK3args *, struct svc_req *);
983 #define NFSPROC3_MKNOD 11
984 extern MKNOD3res * nfsproc3_mknod_3_svc(MKNOD3args *, struct svc_req *);
985 #define NFSPROC3_REMOVE 12
986 extern REMOVE3res * nfsproc3_remove_3_svc(REMOVE3args *, struct svc_req *);
987 #define NFSPROC3_RMDIR 13
988 extern RMDIR3res * nfsproc3_rmdir_3_svc(RMDIR3args *, struct svc_req *);
989 #define NFSPROC3_RENAME 14
990 extern RENAME3res * nfsproc3_rename_3_svc(RENAME3args *, struct svc_req *);
991 #define NFSPROC3_LINK 15
992 extern LINK3res * nfsproc3_link_3_svc(LINK3args *, struct svc_req *);
993 #define NFSPROC3_READDIR 16
994 extern READDIR3res * nfsproc3_readdir_3_svc(READDIR3args *, struct svc_req *);
995 #define NFSPROC3_READDIRPLUS 17
996 extern READDIRPLUS3res * nfsproc3_readdirplus_3_svc(READDIRPLUS3args *, struct svc_req *);
997 #define NFSPROC3_FSSTAT 18
998 extern FSSTAT3res * nfsproc3_fsstat_3_svc(FSSTAT3args *, struct svc_req *);
999 #define NFSPROC3_FSINFO 19
1000 extern FSINFO3res * nfsproc3_fsinfo_3_svc(FSINFO3args *, struct svc_req *);
1001 #define NFSPROC3_PATHCONF 20
1002 extern PATHCONF3res * nfsproc3_pathconf_3_svc(PATHCONF3args *, struct svc_req *);
1003 #define NFSPROC3_COMMIT 21
1004 extern COMMIT3res * nfsproc3_commit_3_svc(COMMIT3args *, struct svc_req *);
1005 extern int nfs3_program_3_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
1007 #endif /* !_NFS_PROT_H_RPCGEN */