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) {
336 sattr3 obj_attributes;
338 sattr3 g_obj_attributes;
348 union post_op_fh3 switch (bool handle_follows) {
355 struct CREATE3resok {
357 post_op_attr obj_attributes;
361 struct CREATE3resfail {
365 union CREATE3res switch (nfsstat3 status) {
369 CREATE3resfail resfail;
376 struct REMOVE3resok {
380 struct REMOVE3resfail {
384 union REMOVE3res switch (nfsstat3 status) {
388 REMOVE3resfail resfail;
398 post_op_attr file_attributes;
404 struct READ3resfail {
405 post_op_attr file_attributes;
408 union READ3res switch (nfsstat3 status) {
412 READ3resfail resfail;
416 const FSF3_LINK = 0x0001;
417 const FSF3_SYMLINK = 0x0002;
418 const FSF3_HOMOGENEOUS = 0x0008;
419 const FSF3_CANSETTIME = 0x0010;
425 struct FSINFO3resok {
426 post_op_attr obj_attributes;
439 struct FSINFO3resfail {
440 post_op_attr obj_attributes;
443 union FSINFO3res switch (nfsstat3 status) {
447 FSINFO3resfail resfail;
455 struct FSSTAT3resok {
456 post_op_attr obj_attributes;
466 struct FSSTAT3resfail {
467 post_op_attr obj_attributes;
470 union FSSTAT3res switch (nfsstat3 status) {
474 FSSTAT3resfail resfail;
477 struct PATHCONF3args {
481 struct PATHCONF3resok {
482 post_op_attr obj_attributes;
486 bool chown_restricted;
487 bool case_insensitive;
488 bool case_preserving;
491 struct PATHCONF3resfail {
492 post_op_attr obj_attributes;
495 union PATHCONF3res switch (nfsstat3 status) {
497 PATHCONF3resok resok;
499 PATHCONF3resfail resfail;
502 typedef string nfspath3<>;
504 struct symlinkdata3 {
505 sattr3 symlink_attributes;
506 nfspath3 symlink_data;
509 struct SYMLINK3args {
511 symlinkdata3 symlink;
514 struct SYMLINK3resok {
516 post_op_attr obj_attributes;
520 struct SYMLINK3resfail {
524 union SYMLINK3res switch (nfsstat3 status) {
528 SYMLINK3resfail resfail;
532 struct READLINK3args {
536 struct READLINK3resok {
537 post_op_attr symlink_attributes;
541 struct READLINK3resfail {
542 post_op_attr symlink_attributes;
545 union READLINK3res switch (nfsstat3 status) {
547 READLINK3resok resok;
549 READLINK3resfail resfail;
554 sattr3 dev_attributes;
558 union mknoddata3 switch (ftype3 type) {
560 devicedata3 chr_device;
562 devicedata3 blk_device;
564 sattr3 sock_attributes;
566 sattr3 pipe_attributes;
578 post_op_attr obj_attributes;
582 struct MKNOD3resfail {
586 union MKNOD3res switch (nfsstat3 status) {
590 MKNOD3resfail resfail;
601 post_op_attr obj_attributes;
605 struct MKDIR3resfail {
609 union MKDIR3res switch (nfsstat3 status) {
613 MKDIR3resfail resfail;
624 struct RMDIR3resfail {
628 union RMDIR3res switch (nfsstat3 status) {
632 RMDIR3resfail resfail;
640 struct RENAME3resok {
641 wcc_data fromdir_wcc;
645 struct RENAME3resfail {
646 wcc_data fromdir_wcc;
650 union RENAME3res switch (nfsstat3 status) {
654 RENAME3resfail resfail;
657 struct READDIRPLUS3args {
660 cookieverf3 cookieverf;
669 post_op_attr name_attributes;
670 post_op_fh3 name_handle;
671 entryplus3 *nextentry;
674 struct dirlistplus3 {
679 struct READDIRPLUS3resok {
680 post_op_attr dir_attributes;
681 cookieverf3 cookieverf;
686 struct READDIRPLUS3resfail {
687 post_op_attr dir_attributes;
690 union READDIRPLUS3res switch (nfsstat3 status) {
692 READDIRPLUS3resok resok;
694 READDIRPLUS3resfail resfail;
697 struct READDIR3args {
700 cookieverf3 cookieverf;
717 struct READDIR3resok {
718 post_op_attr dir_attributes;
719 cookieverf3 cookieverf;
723 struct READDIR3resfail {
724 post_op_attr dir_attributes;
727 union READDIR3res switch (nfsstat3 status) {
731 READDIR3resfail resfail;
740 post_op_attr file_attributes;
741 wcc_data linkdir_wcc;
744 struct LINK3resfail {
745 post_op_attr file_attributes;
746 wcc_data linkdir_wcc;
749 union LINK3res switch (nfsstat3 status) {
753 LINK3resfail resfail;
756 union sattrguard3 switch (bool check) {
763 struct SETATTR3args {
765 sattr3 new_attributes;
769 struct SETATTR3resok {
773 struct SETATTR3resfail {
777 union SETATTR3res switch (nfsstat3 status) {
781 SETATTR3resfail resfail;
784 program NFS_PROGRAM {
790 NFS3_GETATTR(GETATTR3args) = 1;
793 NFS3_SETATTR(SETATTR3args) = 2;
796 NFS3_LOOKUP(LOOKUP3args) = 3;
799 NFS3_ACCESS(ACCESS3args) = 4;
802 NFS3_READLINK(READLINK3args) = 5;
805 NFS3_READ(READ3args) = 6;
808 NFS3_WRITE(WRITE3args) = 7;
811 NFS3_CREATE(CREATE3args) = 8;
814 NFS3_MKDIR(MKDIR3args) = 9;
817 NFS3_SYMLINK(SYMLINK3args) = 10;
819 /* MKNOD3res NFSPROC3_MKNOD(MKNOD3args) = 11;*/
822 NFS3_REMOVE(REMOVE3args) = 12;
825 NFS3_RMDIR(RMDIR3args) = 13;
828 NFS3_RENAME(RENAME3args) = 14;
831 NFS3_LINK(LINK3args) = 15;
834 NFS3_READDIR(READDIR3args) = 16;
837 NFS3_READDIRPLUS(READDIRPLUS3args) = 17;
840 NFS3_FSSTAT(FSSTAT3args) = 18;
843 NFS3_FSINFO(FSINFO3args) = 19;
846 NFS3_PATHCONF(PATHCONF3args) = 20;
849 NFS3_COMMIT(COMMIT3args) = 21;
855 /* NFS ACL definitions based on wireshark souces and network traces */
856 /* NFSACL interface. Uses same port/process as NFS */
859 NFSACL_TYPE_USER_OBJ = 0x0001,
860 NFSACL_TYPE_USER = 0x0002,
861 NFSACL_TYPE_GROUP_OBJ = 0x0004,
862 NFSACL_TYPE_GROUP = 0x0008,
863 NFSACL_TYPE_CLASS_OBJ = 0x0010,
864 NFSACL_TYPE_CLASS = 0x0020,
865 NFSACL_TYPE_DEFAULT = 0x1000,
866 NFSACL_TYPE_DEFAULT_USER_OBJ = 0x1001,
867 NFSACL_TYPE_DEFAULT_USER = 0x1002,
868 NFSACL_TYPE_DEFAULT_GROUP_OBJ = 0x1004,
869 NFSACL_TYPE_DEFAULT_GROUP = 0x1008,
870 NFSACL_TYPE_DEFAULT_CLASS_OBJ = 0x1010,
871 NFSACL_TYPE_DEFAULT_OTHER_OBJ = 0x1020
874 const NFSACL_PERM_READ = 0x04;
875 const NFSACL_PERM_WRITE = 0x02;
876 const NFSACL_PERM_EXEC = 0x01;
879 enum nfsacl_type type;
884 const NFSACL_MASK_ACL_ENTRY = 0x0001;
885 const NFSACL_MASK_ACL_COUNT = 0x0002;
886 const NFSACL_MASK_ACL_DEFAULT_ENTRY = 0x0004;
887 const NFSACL_MASK_ACL_DEFAULT_COUNT = 0x0008;
894 struct GETACL3resok {
898 struct nfsacl_ace ace<>;
899 uint32_t default_ace_count;
900 struct nfsacl_ace default_ace<>;
903 union GETACL3res switch (nfsstat3 status) {
910 program NFSACL_PROGRAM {
913 NFSACL3_NULL(void) = 0;
916 NFSACL3_GETACL(GETACL3args) = 1;