1 /* NFS part from rfc 1813, NFSACL part is from wireshark sources */
6 const NFS3_FHSIZE = 64; /* Maximum bytes in a V3 file handle */
7 const NFS3_WRITEVERFSIZE = 8;
8 const NFS3_CREATEVERFSIZE = 8;
9 const NFS3_COOKIEVERFSIZE = 8;
11 typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
13 /*unsigned hyper can be overridden by giving rpcgen -DU_INT64_PLATTFORM_TYPE="
14 where rpcgen doesn't know anything about hyper
15 default to unsigned hyper as of rfc 1813 */
16 #ifndef U_INT64_PLATTFORM_TYPE
17 #define U_INT64_PLATTFORM_TYPE unsigned hyper
18 #endif/*U_INT64_PLATTFORM_TYPE*/
20 typedef U_INT64_PLATTFORM_TYPE uint64;
22 typedef uint64 cookie3;
25 opaque data<NFS3_FHSIZE>;
28 typedef string filename3<>;
45 typedef unsigned int mode3;
47 typedef unsigned int uid3;
49 typedef unsigned int gid3;
53 typedef uint64 fileid3;
56 unsigned int specdata1;
57 unsigned int specdata2;
62 unsigned int nseconds;
81 union post_op_attr switch (bool attributes_follow) {
106 NFS3ERR_NAMETOOLONG = 63,
107 NFS3ERR_NOTEMPTY = 66,
111 NFS3ERR_BADHANDLE = 10001,
112 NFS3ERR_NOT_SYNC = 10002,
113 NFS3ERR_BAD_COOKIE = 10003,
114 NFS3ERR_NOTSUPP = 10004,
115 NFS3ERR_TOOSMALL = 10005,
116 NFS3ERR_SERVERFAULT = 10006,
117 NFS3ERR_BADTYPE = 10007,
118 NFS3ERR_JUKEBOX = 10008
127 typedef uint64 offset3;
129 typedef unsigned int count3;
137 union pre_op_attr switch (bool attributes_follow) {
157 typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
162 stable_how committed;
166 struct WRITE3resfail {
170 union WRITE3res switch (nfsstat3 status) {
174 WRITE3resfail resfail;
181 struct LOOKUP3resok {
183 post_op_attr obj_attributes;
184 post_op_attr dir_attributes;
187 struct LOOKUP3resfail {
188 post_op_attr dir_attributes;
193 union LOOKUP3res switch (nfsstat3 status) {
197 LOOKUP3resfail resfail;
206 struct COMMIT3resok {
211 struct COMMIT3resfail {
215 union COMMIT3res switch (nfsstat3 status) {
219 COMMIT3resfail resfail;
222 const ACCESS3_READ = 0x0001;
223 const ACCESS3_LOOKUP = 0x0002;
224 const ACCESS3_MODIFY = 0x0004;
225 const ACCESS3_EXTEND = 0x0008;
226 const ACCESS3_DELETE = 0x0010;
227 const ACCESS3_EXECUTE = 0x0020;
234 struct ACCESS3resok {
235 post_op_attr obj_attributes;
239 struct ACCESS3resfail {
240 post_op_attr obj_attributes;
243 union ACCESS3res switch (nfsstat3 status) {
247 ACCESS3resfail resfail;
250 struct GETATTR3args {
254 struct GETATTR3resok {
255 fattr3 obj_attributes;
258 union GETATTR3res switch (nfsstat3 status) {
269 SET_TO_SERVER_TIME = 1,
270 SET_TO_CLIENT_TIME = 2
273 union set_mode3 switch (bool set_it) {
280 union set_uid3 switch (bool set_it) {
287 union set_gid3 switch (bool set_it) {
294 union set_size3 switch (bool set_it) {
301 union set_atime switch (time_how set_it) {
302 case SET_TO_CLIENT_TIME:
308 union set_mtime switch (time_how set_it) {
309 case SET_TO_CLIENT_TIME:
331 typedef opaque createverf3[NFS3_CREATEVERFSIZE];
333 union createhow3 switch (createmode3 mode) {
335 sattr3 obj_attributes;
337 sattr3 g_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;
435 unsigned int properties;
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;
462 unsigned int invarsec;
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;
482 unsigned int linkmax;
483 unsigned int name_max;
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) {
559 devicedata3 chr_device;
561 devicedata3 blk_device;
563 sattr3 sock_attributes;
565 sattr3 pipe_attributes;
577 post_op_attr obj_attributes;
581 struct MKNOD3resfail {
585 union MKNOD3res switch (nfsstat3 status) {
589 MKNOD3resfail resfail;
600 post_op_attr obj_attributes;
604 struct MKDIR3resfail {
608 union MKDIR3res switch (nfsstat3 status) {
612 MKDIR3resfail resfail;
623 struct RMDIR3resfail {
627 union RMDIR3res switch (nfsstat3 status) {
631 RMDIR3resfail resfail;
639 struct RENAME3resok {
640 wcc_data fromdir_wcc;
644 struct RENAME3resfail {
645 wcc_data fromdir_wcc;
649 union RENAME3res switch (nfsstat3 status) {
653 RENAME3resfail resfail;
656 struct READDIRPLUS3args {
659 cookieverf3 cookieverf;
668 post_op_attr name_attributes;
669 post_op_fh3 name_handle;
670 entryplus3 *nextentry;
673 struct dirlistplus3 {
678 struct READDIRPLUS3resok {
679 post_op_attr dir_attributes;
680 cookieverf3 cookieverf;
685 struct READDIRPLUS3resfail {
686 post_op_attr dir_attributes;
689 union READDIRPLUS3res switch (nfsstat3 status) {
691 READDIRPLUS3resok resok;
693 READDIRPLUS3resfail resfail;
696 struct READDIR3args {
699 cookieverf3 cookieverf;
716 struct READDIR3resok {
717 post_op_attr dir_attributes;
718 cookieverf3 cookieverf;
722 struct READDIR3resfail {
723 post_op_attr dir_attributes;
726 union READDIR3res switch (nfsstat3 status) {
730 READDIR3resfail resfail;
739 post_op_attr file_attributes;
740 wcc_data linkdir_wcc;
743 struct LINK3resfail {
744 post_op_attr file_attributes;
745 wcc_data linkdir_wcc;
748 union LINK3res switch (nfsstat3 status) {
752 LINK3resfail resfail;
755 union sattrguard3 switch (bool check) {
762 struct SETATTR3args {
764 sattr3 new_attributes;
768 struct SETATTR3resok {
772 struct SETATTR3resfail {
776 union SETATTR3res switch (nfsstat3 status) {
780 SETATTR3resfail resfail;
785 * We share many definitions from v3
788 typedef opaque fhandle2[FHSIZE2];
806 unsigned int blocksize;
825 const MAXNAMLEN2 = 255;
826 typedef string filename2<MAXNAMLEN2>;
828 const MAXPATHLEN2 = 1024;
829 typedef string path2<MAXPATHLEN2>;
831 const NFSMAXDATA2 = 8192;
832 typedef opaque nfsdata2<NFSMAXDATA2>;
834 const NFSCOOKIESIZE2 = 4;
835 typedef opaque nfscookie2[NFSCOOKIESIZE2];
849 struct GETATTR2args {
853 struct GETATTR2resok {
857 union GETATTR2res switch (nfsstat3 status) {
864 struct SETATTR2args {
869 struct SETATTR2resok {
873 union SETATTR2res switch (nfsstat3 status) {
884 struct LOOKUP2resok {
889 union LOOKUP2res switch (nfsstat3 status) {
896 struct READLINK2args {
900 struct READLINK2resok {
904 union READLINK2res switch (nfsstat3 status) {
906 READLINK2resok resok;
915 unsigned int totalcount;
923 union READ2res switch (nfsstat3 status) {
932 unsigned int beginoffset;
934 unsigned int totalcount;
942 union WRITE2res switch (nfsstat3 status) {
954 struct CREATE2resok {
959 union CREATE2res switch (nfsstat3 status) {
992 struct SYMLINK2args {
1007 struct MKDIR2resok {
1012 union MKDIR2res switch (nfsstat3 status) {
1027 struct READDIR2args {
1033 struct READDIR2resok {
1038 union READDIR2res switch (nfsstat3 status) {
1040 READDIR2resok resok;
1045 struct STATFS2args {
1049 struct STATFS2resok {
1052 unsigned int blocks;
1054 unsigned int bavail;
1057 union STATFS2res switch (nfsstat3 status) {
1064 program NFS_PROGRAM {
1067 NFS2_NULL(void) = 0;
1070 NFS2_GETATTR(GETATTR2args) = 1;
1073 NFS2_SETATTR(SETATTR2args) = 2;
1076 NFS2_LOOKUP(LOOKUP2args) = 4;
1079 NFS2_READLINK(READLINK2args) = 5;
1082 NFS2_READ(READ2args) = 6;
1085 NFS2_WRITE(WRITE2args) = 8;
1088 NFS2_CREATE(CREATE2args) = 9;
1091 NFS2_REMOVE(REMOVE2args) = 10;
1094 NFS2_RENAME(RENAME2args) = 11;
1097 NFS2_LINK(LINK2args) = 12;
1100 NFS2_SYMLINK(SYMLINK2args) = 13;
1103 NFS2_MKDIR(MKDIR2args) = 14;
1106 NFS2_RMDIR(RMDIR2args) = 15;
1109 NFS2_READDIR(READDIR2args) = 16;
1112 NFS2_STATFS(STATFS2args) = 17;
1117 NFS3_NULL(void) = 0;
1120 NFS3_GETATTR(GETATTR3args) = 1;
1123 NFS3_SETATTR(SETATTR3args) = 2;
1126 NFS3_LOOKUP(LOOKUP3args) = 3;
1129 NFS3_ACCESS(ACCESS3args) = 4;
1132 NFS3_READLINK(READLINK3args) = 5;
1135 NFS3_READ(READ3args) = 6;
1138 NFS3_WRITE(WRITE3args) = 7;
1141 NFS3_CREATE(CREATE3args) = 8;
1144 NFS3_MKDIR(MKDIR3args) = 9;
1147 NFS3_SYMLINK(SYMLINK3args) = 10;
1150 NFS3_MKNOD(MKNOD3args) = 11;
1153 NFS3_REMOVE(REMOVE3args) = 12;
1156 NFS3_RMDIR(RMDIR3args) = 13;
1159 NFS3_RENAME(RENAME3args) = 14;
1162 NFS3_LINK(LINK3args) = 15;
1165 NFS3_READDIR(READDIR3args) = 16;
1168 NFS3_READDIRPLUS(READDIRPLUS3args) = 17;
1171 NFS3_FSSTAT(FSSTAT3args) = 18;
1174 NFS3_FSINFO(FSINFO3args) = 19;
1177 NFS3_PATHCONF(PATHCONF3args) = 20;
1180 NFS3_COMMIT(COMMIT3args) = 21;
1186 /* NFS ACL definitions based on wireshark souces and network traces */
1187 /* NFSACL interface. Uses same port/process as NFS */
1190 NFSACL_TYPE_USER_OBJ = 0x0001,
1191 NFSACL_TYPE_USER = 0x0002,
1192 NFSACL_TYPE_GROUP_OBJ = 0x0004,
1193 NFSACL_TYPE_GROUP = 0x0008,
1194 NFSACL_TYPE_CLASS_OBJ = 0x0010,
1195 NFSACL_TYPE_CLASS = 0x0020,
1196 NFSACL_TYPE_DEFAULT = 0x1000,
1197 NFSACL_TYPE_DEFAULT_USER_OBJ = 0x1001,
1198 NFSACL_TYPE_DEFAULT_USER = 0x1002,
1199 NFSACL_TYPE_DEFAULT_GROUP_OBJ = 0x1004,
1200 NFSACL_TYPE_DEFAULT_GROUP = 0x1008,
1201 NFSACL_TYPE_DEFAULT_CLASS_OBJ = 0x1010,
1202 NFSACL_TYPE_DEFAULT_OTHER_OBJ = 0x1020
1205 const NFSACL_PERM_READ = 0x04;
1206 const NFSACL_PERM_WRITE = 0x02;
1207 const NFSACL_PERM_EXEC = 0x01;
1210 enum nfsacl_type type;
1215 const NFSACL_MASK_ACL_ENTRY = 0x0001;
1216 const NFSACL_MASK_ACL_COUNT = 0x0002;
1217 const NFSACL_MASK_ACL_DEFAULT_ENTRY = 0x0004;
1218 const NFSACL_MASK_ACL_DEFAULT_COUNT = 0x0008;
1220 struct GETACL3args {
1225 struct GETACL3resok {
1228 unsigned int ace_count;
1229 struct nfsacl_ace ace<>;
1230 unsigned int default_ace_count;
1231 struct nfsacl_ace default_ace<>;
1234 union GETACL3res switch (nfsstat3 status) {
1241 struct SETACL3args {
1244 unsigned int ace_count;
1245 struct nfsacl_ace ace<>;
1246 unsigned int default_ace_count;
1247 struct nfsacl_ace default_ace<>;
1250 struct SETACL3resok {
1254 union SETACL3res switch (nfsstat3 status) {
1261 program NFSACL_PROGRAM {
1264 NFSACL3_NULL(void) = 0;
1267 NFSACL3_GETACL(GETACL3args) = 1;
1270 NFSACL3_SETACL(SETACL3args) = 2;