1 /* NFS part from rfc 1813, NFSACL part is from wireshark sources */
3 const NFS3_FHSIZE = 64; /* Maximum bytes in a V3 file handle */
4 const NFS3_WRITEVERFSIZE = 8;
5 const NFS3_CREATEVERFSIZE = 8;
6 const NFS3_COOKIEVERFSIZE = 8;
8 typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
10 /*unsigned hyper can be overridden by giving rpcgen -DU_INT64_PLATTFORM_TYPE="
11 where rpcgen doesn't know anything about hyper
12 default to unsigned hyper as of rfc 1813 */
13 #ifndef U_INT64_PLATTFORM_TYPE
14 #define U_INT64_PLATTFORM_TYPE unsigned hyper
15 #endif/*U_INT64_PLATTFORM_TYPE*/
17 typedef U_INT64_PLATTFORM_TYPE uint64;
19 typedef uint64 cookie3;
22 opaque data<NFS3_FHSIZE>;
25 typedef string filename3<>;
42 typedef unsigned int mode3;
44 typedef unsigned int uid3;
46 typedef unsigned int gid3;
50 typedef uint64 fileid3;
53 unsigned int specdata1;
54 unsigned int specdata2;
59 unsigned int nseconds;
78 union post_op_attr switch (bool attributes_follow) {
103 NFS3ERR_NAMETOOLONG = 63,
104 NFS3ERR_NOTEMPTY = 66,
108 NFS3ERR_BADHANDLE = 10001,
109 NFS3ERR_NOT_SYNC = 10002,
110 NFS3ERR_BAD_COOKIE = 10003,
111 NFS3ERR_NOTSUPP = 10004,
112 NFS3ERR_TOOSMALL = 10005,
113 NFS3ERR_SERVERFAULT = 10006,
114 NFS3ERR_BADTYPE = 10007,
115 NFS3ERR_JUKEBOX = 10008
124 typedef uint64 offset3;
126 typedef unsigned int count3;
134 union pre_op_attr switch (bool attributes_follow) {
154 typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
159 stable_how committed;
163 struct WRITE3resfail {
167 union WRITE3res switch (nfsstat3 status) {
171 WRITE3resfail resfail;
178 struct LOOKUP3resok {
180 post_op_attr obj_attributes;
181 post_op_attr dir_attributes;
184 struct LOOKUP3resfail {
185 post_op_attr dir_attributes;
190 union LOOKUP3res switch (nfsstat3 status) {
194 LOOKUP3resfail resfail;
203 struct COMMIT3resok {
208 struct COMMIT3resfail {
212 union COMMIT3res switch (nfsstat3 status) {
216 COMMIT3resfail resfail;
219 const ACCESS3_READ = 0x0001;
220 const ACCESS3_LOOKUP = 0x0002;
221 const ACCESS3_MODIFY = 0x0004;
222 const ACCESS3_EXTEND = 0x0008;
223 const ACCESS3_DELETE = 0x0010;
224 const ACCESS3_EXECUTE = 0x0020;
231 struct ACCESS3resok {
232 post_op_attr obj_attributes;
236 struct ACCESS3resfail {
237 post_op_attr obj_attributes;
240 union ACCESS3res switch (nfsstat3 status) {
244 ACCESS3resfail resfail;
247 struct GETATTR3args {
251 struct GETATTR3resok {
252 fattr3 obj_attributes;
255 union GETATTR3res switch (nfsstat3 status) {
266 SET_TO_SERVER_TIME = 1,
267 SET_TO_CLIENT_TIME = 2
270 union set_mode3 switch (bool set_it) {
277 union set_uid3 switch (bool set_it) {
284 union set_gid3 switch (bool set_it) {
291 union set_size3 switch (bool set_it) {
298 union set_atime switch (time_how set_it) {
299 case SET_TO_CLIENT_TIME:
305 union set_mtime switch (time_how set_it) {
306 case SET_TO_CLIENT_TIME:
328 typedef opaque createverf3[NFS3_CREATEVERFSIZE];
330 union createhow3 switch (createmode3 mode) {
332 sattr3 obj_attributes;
334 sattr3 g_obj_attributes;
344 union post_op_fh3 switch (bool handle_follows) {
351 struct CREATE3resok {
353 post_op_attr obj_attributes;
357 struct CREATE3resfail {
361 union CREATE3res switch (nfsstat3 status) {
365 CREATE3resfail resfail;
372 struct REMOVE3resok {
376 struct REMOVE3resfail {
380 union REMOVE3res switch (nfsstat3 status) {
384 REMOVE3resfail resfail;
394 post_op_attr file_attributes;
400 struct READ3resfail {
401 post_op_attr file_attributes;
404 union READ3res switch (nfsstat3 status) {
408 READ3resfail resfail;
412 const FSF3_LINK = 0x0001;
413 const FSF3_SYMLINK = 0x0002;
414 const FSF3_HOMOGENEOUS = 0x0008;
415 const FSF3_CANSETTIME = 0x0010;
421 struct FSINFO3resok {
422 post_op_attr obj_attributes;
432 unsigned int properties;
435 struct FSINFO3resfail {
436 post_op_attr obj_attributes;
439 union FSINFO3res switch (nfsstat3 status) {
443 FSINFO3resfail resfail;
451 struct FSSTAT3resok {
452 post_op_attr obj_attributes;
459 unsigned int invarsec;
462 struct FSSTAT3resfail {
463 post_op_attr obj_attributes;
466 union FSSTAT3res switch (nfsstat3 status) {
470 FSSTAT3resfail resfail;
473 struct PATHCONF3args {
477 struct PATHCONF3resok {
478 post_op_attr obj_attributes;
479 unsigned int linkmax;
480 unsigned int name_max;
482 bool chown_restricted;
483 bool case_insensitive;
484 bool case_preserving;
487 struct PATHCONF3resfail {
488 post_op_attr obj_attributes;
491 union PATHCONF3res switch (nfsstat3 status) {
493 PATHCONF3resok resok;
495 PATHCONF3resfail resfail;
498 typedef string nfspath3<>;
500 struct symlinkdata3 {
501 sattr3 symlink_attributes;
502 nfspath3 symlink_data;
505 struct SYMLINK3args {
507 symlinkdata3 symlink;
510 struct SYMLINK3resok {
512 post_op_attr obj_attributes;
516 struct SYMLINK3resfail {
520 union SYMLINK3res switch (nfsstat3 status) {
524 SYMLINK3resfail resfail;
528 struct READLINK3args {
532 struct READLINK3resok {
533 post_op_attr symlink_attributes;
537 struct READLINK3resfail {
538 post_op_attr symlink_attributes;
541 union READLINK3res switch (nfsstat3 status) {
543 READLINK3resok resok;
545 READLINK3resfail resfail;
550 sattr3 dev_attributes;
554 union mknoddata3 switch (ftype3 type) {
556 devicedata3 chr_device;
558 devicedata3 blk_device;
560 sattr3 sock_attributes;
562 sattr3 pipe_attributes;
574 post_op_attr obj_attributes;
578 struct MKNOD3resfail {
582 union MKNOD3res switch (nfsstat3 status) {
586 MKNOD3resfail resfail;
597 post_op_attr obj_attributes;
601 struct MKDIR3resfail {
605 union MKDIR3res switch (nfsstat3 status) {
609 MKDIR3resfail resfail;
620 struct RMDIR3resfail {
624 union RMDIR3res switch (nfsstat3 status) {
628 RMDIR3resfail resfail;
636 struct RENAME3resok {
637 wcc_data fromdir_wcc;
641 struct RENAME3resfail {
642 wcc_data fromdir_wcc;
646 union RENAME3res switch (nfsstat3 status) {
650 RENAME3resfail resfail;
653 struct READDIRPLUS3args {
656 cookieverf3 cookieverf;
665 post_op_attr name_attributes;
666 post_op_fh3 name_handle;
667 entryplus3 *nextentry;
670 struct dirlistplus3 {
675 struct READDIRPLUS3resok {
676 post_op_attr dir_attributes;
677 cookieverf3 cookieverf;
682 struct READDIRPLUS3resfail {
683 post_op_attr dir_attributes;
686 union READDIRPLUS3res switch (nfsstat3 status) {
688 READDIRPLUS3resok resok;
690 READDIRPLUS3resfail resfail;
693 struct READDIR3args {
696 cookieverf3 cookieverf;
713 struct READDIR3resok {
714 post_op_attr dir_attributes;
715 cookieverf3 cookieverf;
719 struct READDIR3resfail {
720 post_op_attr dir_attributes;
723 union READDIR3res switch (nfsstat3 status) {
727 READDIR3resfail resfail;
736 post_op_attr file_attributes;
737 wcc_data linkdir_wcc;
740 struct LINK3resfail {
741 post_op_attr file_attributes;
742 wcc_data linkdir_wcc;
745 union LINK3res switch (nfsstat3 status) {
749 LINK3resfail resfail;
752 union sattrguard3 switch (bool check) {
759 struct SETATTR3args {
761 sattr3 new_attributes;
765 struct SETATTR3resok {
769 struct SETATTR3resfail {
773 union SETATTR3res switch (nfsstat3 status) {
777 SETATTR3resfail resfail;
780 program NFS_PROGRAM {
786 NFS3_GETATTR(GETATTR3args) = 1;
789 NFS3_SETATTR(SETATTR3args) = 2;
792 NFS3_LOOKUP(LOOKUP3args) = 3;
795 NFS3_ACCESS(ACCESS3args) = 4;
798 NFS3_READLINK(READLINK3args) = 5;
801 NFS3_READ(READ3args) = 6;
804 NFS3_WRITE(WRITE3args) = 7;
807 NFS3_CREATE(CREATE3args) = 8;
810 NFS3_MKDIR(MKDIR3args) = 9;
813 NFS3_SYMLINK(SYMLINK3args) = 10;
816 NFS3_MKNOD(MKNOD3args) = 11;
819 NFS3_REMOVE(REMOVE3args) = 12;
822 NFS3_RMDIR(RMDIR3args) = 13;
825 NFS3_RENAME(RENAME3args) = 14;
828 NFS3_LINK(LINK3args) = 15;
831 NFS3_READDIR(READDIR3args) = 16;
834 NFS3_READDIRPLUS(READDIRPLUS3args) = 17;
837 NFS3_FSSTAT(FSSTAT3args) = 18;
840 NFS3_FSINFO(FSINFO3args) = 19;
843 NFS3_PATHCONF(PATHCONF3args) = 20;
846 NFS3_COMMIT(COMMIT3args) = 21;
852 /* NFS ACL definitions based on wireshark souces and network traces */
853 /* NFSACL interface. Uses same port/process as NFS */
856 NFSACL_TYPE_USER_OBJ = 0x0001,
857 NFSACL_TYPE_USER = 0x0002,
858 NFSACL_TYPE_GROUP_OBJ = 0x0004,
859 NFSACL_TYPE_GROUP = 0x0008,
860 NFSACL_TYPE_CLASS_OBJ = 0x0010,
861 NFSACL_TYPE_CLASS = 0x0020,
862 NFSACL_TYPE_DEFAULT = 0x1000,
863 NFSACL_TYPE_DEFAULT_USER_OBJ = 0x1001,
864 NFSACL_TYPE_DEFAULT_USER = 0x1002,
865 NFSACL_TYPE_DEFAULT_GROUP_OBJ = 0x1004,
866 NFSACL_TYPE_DEFAULT_GROUP = 0x1008,
867 NFSACL_TYPE_DEFAULT_CLASS_OBJ = 0x1010,
868 NFSACL_TYPE_DEFAULT_OTHER_OBJ = 0x1020
871 const NFSACL_PERM_READ = 0x04;
872 const NFSACL_PERM_WRITE = 0x02;
873 const NFSACL_PERM_EXEC = 0x01;
876 enum nfsacl_type type;
881 const NFSACL_MASK_ACL_ENTRY = 0x0001;
882 const NFSACL_MASK_ACL_COUNT = 0x0002;
883 const NFSACL_MASK_ACL_DEFAULT_ENTRY = 0x0004;
884 const NFSACL_MASK_ACL_DEFAULT_COUNT = 0x0008;
891 struct GETACL3resok {
894 unsigned int ace_count;
895 struct nfsacl_ace ace<>;
896 unsigned int default_ace_count;
897 struct nfsacl_ace default_ace<>;
900 union GETACL3res switch (nfsstat3 status) {
910 unsigned int ace_count;
911 struct nfsacl_ace ace<>;
912 unsigned int default_ace_count;
913 struct nfsacl_ace default_ace<>;
916 struct SETACL3resok {
920 union SETACL3res switch (nfsstat3 status) {
927 program NFSACL_PROGRAM {
930 NFSACL3_NULL(void) = 0;
933 NFSACL3_GETACL(GETACL3args) = 1;
936 NFSACL3_SETACL(SETACL3args) = 2;