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];
11 /*unsigned hyper can be overridden by giving rpcgen -DU_INT64_PLATTFORM_TYPE="foo" - for plattforms
12 where rpcgen doesn't know anything about hyper
13 default to unsigned hyper as of rfc 1813 */
14 #ifndef U_INT64_PLATTFORM_TYPE
15 #define U_INT64_PLATTFORM_TYPE unsigned hyper
16 #endif/*U_INT64_PLATTFORM_TYPE*/
18 typedef U_INT64_PLATTFORM_TYPE uint64;
19 typedef uint64 cookie3;
22 opaque data<NFS3_FHSIZE>;
25 typedef string filename3<>;
42 typedef unsigned long uint32;
54 typedef uint64 fileid3;
82 union post_op_attr switch (bool attributes_follow) {
107 NFS3ERR_NAMETOOLONG = 63,
108 NFS3ERR_NOTEMPTY = 66,
112 NFS3ERR_BADHANDLE = 10001,
113 NFS3ERR_NOT_SYNC = 10002,
114 NFS3ERR_BAD_COOKIE = 10003,
115 NFS3ERR_NOTSUPP = 10004,
116 NFS3ERR_TOOSMALL = 10005,
117 NFS3ERR_SERVERFAULT = 10006,
118 NFS3ERR_BADTYPE = 10007,
119 NFS3ERR_JUKEBOX = 10008
128 typedef uint64 offset3;
130 typedef uint32 count3;
138 union pre_op_attr switch (bool attributes_follow) {
158 typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
163 stable_how committed;
167 struct WRITE3resfail {
171 union WRITE3res switch (nfsstat3 status) {
175 WRITE3resfail resfail;
182 struct LOOKUP3resok {
184 post_op_attr obj_attributes;
185 post_op_attr dir_attributes;
188 struct LOOKUP3resfail {
189 post_op_attr dir_attributes;
194 union LOOKUP3res switch (nfsstat3 status) {
198 LOOKUP3resfail resfail;
207 struct COMMIT3resok {
212 struct COMMIT3resfail {
216 union COMMIT3res switch (nfsstat3 status) {
220 COMMIT3resfail resfail;
223 const ACCESS3_READ = 0x0001;
224 const ACCESS3_LOOKUP = 0x0002;
225 const ACCESS3_MODIFY = 0x0004;
226 const ACCESS3_EXTEND = 0x0008;
227 const ACCESS3_DELETE = 0x0010;
228 const ACCESS3_EXECUTE = 0x0020;
235 struct ACCESS3resok {
236 post_op_attr obj_attributes;
240 struct ACCESS3resfail {
241 post_op_attr obj_attributes;
244 union ACCESS3res switch (nfsstat3 status) {
248 ACCESS3resfail resfail;
251 struct GETATTR3args {
255 struct GETATTR3resok {
256 fattr3 obj_attributes;
259 union GETATTR3res switch (nfsstat3 status) {
270 SET_TO_SERVER_TIME = 1,
271 SET_TO_CLIENT_TIME = 2
274 union set_mode3 switch (bool set_it) {
281 union set_uid3 switch (bool set_it) {
288 union set_gid3 switch (bool set_it) {
295 union set_size3 switch (bool set_it) {
302 union set_atime switch (time_how set_it) {
303 case SET_TO_CLIENT_TIME:
309 union set_mtime switch (time_how set_it) {
310 case SET_TO_CLIENT_TIME:
332 typedef opaque createverf3[NFS3_CREATEVERFSIZE];
334 union createhow3 switch (createmode3 mode) {
337 sattr3 obj_attributes;
347 union post_op_fh3 switch (bool handle_follows) {
354 struct CREATE3resok {
356 post_op_attr obj_attributes;
360 struct CREATE3resfail {
364 union CREATE3res switch (nfsstat3 status) {
368 CREATE3resfail resfail;
375 struct REMOVE3resok {
379 struct REMOVE3resfail {
383 union REMOVE3res switch (nfsstat3 status) {
387 REMOVE3resfail resfail;
397 post_op_attr file_attributes;
403 struct READ3resfail {
404 post_op_attr file_attributes;
407 union READ3res switch (nfsstat3 status) {
411 READ3resfail resfail;
415 const FSF3_LINK = 0x0001;
416 const FSF3_SYMLINK = 0x0002;
417 const FSF3_HOMOGENEOUS = 0x0008;
418 const FSF3_CANSETTIME = 0x0010;
424 struct FSINFO3resok {
425 post_op_attr obj_attributes;
438 struct FSINFO3resfail {
439 post_op_attr obj_attributes;
442 union FSINFO3res switch (nfsstat3 status) {
446 FSINFO3resfail resfail;
454 struct FSSTAT3resok {
455 post_op_attr obj_attributes;
465 struct FSSTAT3resfail {
466 post_op_attr obj_attributes;
469 union FSSTAT3res switch (nfsstat3 status) {
473 FSSTAT3resfail resfail;
476 struct PATHCONF3args {
480 struct PATHCONF3resok {
481 post_op_attr obj_attributes;
485 bool chown_restricted;
486 bool case_insensitive;
487 bool case_preserving;
490 struct PATHCONF3resfail {
491 post_op_attr obj_attributes;
494 union PATHCONF3res switch (nfsstat3 status) {
496 PATHCONF3resok resok;
498 PATHCONF3resfail resfail;
501 typedef string nfspath3<>;
503 struct symlinkdata3 {
504 sattr3 symlink_attributes;
505 nfspath3 symlink_data;
508 struct SYMLINK3args {
510 symlinkdata3 symlink;
513 struct SYMLINK3resok {
515 post_op_attr obj_attributes;
519 struct SYMLINK3resfail {
523 union SYMLINK3res switch (nfsstat3 status) {
527 SYMLINK3resfail resfail;
531 struct READLINK3args {
535 struct READLINK3resok {
536 post_op_attr symlink_attributes;
540 struct READLINK3resfail {
541 post_op_attr symlink_attributes;
544 union READLINK3res switch (nfsstat3 status) {
546 READLINK3resok resok;
548 READLINK3resfail resfail;
553 sattr3 dev_attributes;
557 union mknoddata3 switch (ftype3 type) {
563 sattr3 pipe_attributes;
575 post_op_attr obj_attributes;
579 struct MKNOD3resfail {
583 union MKNOD3res switch (nfsstat3 status) {
587 MKNOD3resfail resfail;
598 post_op_attr obj_attributes;
602 struct MKDIR3resfail {
606 union MKDIR3res switch (nfsstat3 status) {
610 MKDIR3resfail resfail;
621 struct RMDIR3resfail {
625 union RMDIR3res switch (nfsstat3 status) {
629 RMDIR3resfail resfail;
637 struct RENAME3resok {
638 wcc_data fromdir_wcc;
642 struct RENAME3resfail {
643 wcc_data fromdir_wcc;
647 union RENAME3res switch (nfsstat3 status) {
651 RENAME3resfail resfail;
654 struct READDIRPLUS3args {
657 cookieverf3 cookieverf;
666 post_op_attr name_attributes;
667 post_op_fh3 name_handle;
668 entryplus3 *nextentry;
671 struct dirlistplus3 {
676 struct READDIRPLUS3resok {
677 post_op_attr dir_attributes;
678 cookieverf3 cookieverf;
683 struct READDIRPLUS3resfail {
684 post_op_attr dir_attributes;
687 union READDIRPLUS3res switch (nfsstat3 status) {
689 READDIRPLUS3resok resok;
691 READDIRPLUS3resfail resfail;
694 struct READDIR3args {
697 cookieverf3 cookieverf;
714 struct READDIR3resok {
715 post_op_attr dir_attributes;
716 cookieverf3 cookieverf;
720 struct READDIR3resfail {
721 post_op_attr dir_attributes;
724 union READDIR3res switch (nfsstat3 status) {
728 READDIR3resfail resfail;
737 post_op_attr file_attributes;
738 wcc_data linkdir_wcc;
741 struct LINK3resfail {
742 post_op_attr file_attributes;
743 wcc_data linkdir_wcc;
746 union LINK3res switch (nfsstat3 status) {
750 LINK3resfail resfail;
753 union sattrguard3 switch (bool check) {
760 struct SETATTR3args {
762 sattr3 new_attributes;
766 struct SETATTR3resok {
770 struct SETATTR3resfail {
774 union SETATTR3res switch (nfsstat3 status) {
778 SETATTR3resfail resfail;
781 program NFS_PROGRAM {
787 NFS3_GETATTR(GETATTR3args) = 1;
790 NFS3_SETATTR(SETATTR3args) = 2;
793 NFS3_LOOKUP(LOOKUP3args) = 3;
796 NFS3_ACCESS(ACCESS3args) = 4;
799 NFS3_READLINK(READLINK3args) = 5;
802 NFS3_READ(READ3args) = 6;
805 NFS3_WRITE(WRITE3args) = 7;
808 NFS3_CREATE(CREATE3args) = 8;
811 NFS3_MKDIR(MKDIR3args) = 9;
814 NFS3_SYMLINK(SYMLINK3args) = 10;
816 /* MKNOD3res NFSPROC3_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 {
895 struct nfsacl_ace ace<>;
896 uint32_t default_ace_count;
897 struct nfsacl_ace default_ace<>;
900 union GETACL3res switch (nfsstat3 status) {
907 program NFSACL_PROGRAM {
910 NFSACL3_NULL(void) = 0;
913 NFSACL3_GETACL(GETACL3args) = 1;