make mkdir_async take a full MKDIR3args argument
[deb_libnfs.git] / nfs / nfs.x
index 58fc34e6a8452ee836dd39345d42fe8af6ca4477..76b6d7e508f799c98e0c5a99ca43a8a0d73d4d67 100644 (file)
--- a/nfs/nfs.x
+++ b/nfs/nfs.x
@@ -1,4 +1,4 @@
-/* copied from rfc 1813 */
+/* NFS part from rfc 1813, NFSACL part is from wireshark sources */
 
 const NFS3_FHSIZE    = 64;    /* Maximum bytes in a V3 file handle */
 const NFS3_WRITEVERFSIZE = 8;
@@ -7,7 +7,15 @@ const NFS3_COOKIEVERFSIZE = 8;
 
 typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
 
-typedef unsigned hyper uint64;
+
+/*unsigned hyper can be overridden by giving rpcgen -DU_INT64_PLATTFORM_TYPE="foo" - for plattforms
+  where rpcgen doesn't know anything about hyper
+  default to unsigned hyper as of rfc 1813 */
+#ifndef U_INT64_PLATTFORM_TYPE
+#define U_INT64_PLATTFORM_TYPE unsigned hyper
+#endif/*U_INT64_PLATTFORM_TYPE*/
+
+typedef U_INT64_PLATTFORM_TYPE uint64;
 typedef uint64 cookie3;
 
 struct nfs_fh3 {
@@ -325,8 +333,9 @@ typedef opaque createverf3[NFS3_CREATEVERFSIZE];
 
 union createhow3 switch (createmode3 mode) {
        case UNCHECKED:
-       case GUARDED:
                sattr3       obj_attributes;
+       case GUARDED:
+               sattr3       g_obj_attributes;
        case EXCLUSIVE:
                createverf3  verf;
 };
@@ -548,9 +557,11 @@ struct devicedata3 {
 
 union mknoddata3 switch (ftype3 type) {
        case NF3CHR:
+               devicedata3  chr_device;
        case NF3BLK:
-               devicedata3  device;
+               devicedata3  blk_device;
        case NF3SOCK:
+               sattr3       sock_attributes;
        case NF3FIFO:
                sattr3       pipe_attributes;
        default:
@@ -805,7 +816,8 @@ program NFS_PROGRAM {
                SYMLINK3res
                NFS3_SYMLINK(SYMLINK3args)         = 10;
 
-/*             MKNOD3res NFSPROC3_MKNOD(MKNOD3args)             = 11;*/
+               MKNOD3res
+               NFS3_MKNOD(MKNOD3args)             = 11;
 
                REMOVE3res
                NFS3_REMOVE(REMOVE3args)           = 12;
@@ -838,3 +850,70 @@ program NFS_PROGRAM {
                NFS3_COMMIT(COMMIT3args)           = 21;
        } = 3;
 } = 100003;
+
+
+
+/* NFS ACL definitions based on wireshark souces and network traces */
+/* NFSACL interface. Uses same port/process as NFS */
+
+enum nfsacl_type {
+     NFSACL_TYPE_USER_OBJ         = 0x0001,
+     NFSACL_TYPE_USER             = 0x0002,
+     NFSACL_TYPE_GROUP_OBJ        = 0x0004,
+     NFSACL_TYPE_GROUP            = 0x0008,
+     NFSACL_TYPE_CLASS_OBJ        = 0x0010,
+     NFSACL_TYPE_CLASS            = 0x0020,
+     NFSACL_TYPE_DEFAULT          = 0x1000,
+     NFSACL_TYPE_DEFAULT_USER_OBJ  = 0x1001, 
+     NFSACL_TYPE_DEFAULT_USER      = 0x1002,
+     NFSACL_TYPE_DEFAULT_GROUP_OBJ = 0x1004,
+     NFSACL_TYPE_DEFAULT_GROUP     = 0x1008,
+     NFSACL_TYPE_DEFAULT_CLASS_OBJ = 0x1010,
+     NFSACL_TYPE_DEFAULT_OTHER_OBJ = 0x1020
+};
+
+const NFSACL_PERM_READ  = 0x04;
+const NFSACL_PERM_WRITE = 0x02;
+const NFSACL_PERM_EXEC  = 0x01;
+
+struct nfsacl_ace {
+       enum nfsacl_type type;
+       uint32_t id;
+       uint32_t perm;
+};
+
+const NFSACL_MASK_ACL_ENTRY         = 0x0001;
+const NFSACL_MASK_ACL_COUNT         = 0x0002;
+const NFSACL_MASK_ACL_DEFAULT_ENTRY = 0x0004;
+const NFSACL_MASK_ACL_DEFAULT_COUNT = 0x0008;
+
+struct GETACL3args {
+       nfs_fh3     dir;
+       uint32      mask;
+};
+
+struct GETACL3resok {
+       post_op_attr   attr;
+       uint32_t       mask;
+       uint32_t       ace_count;
+       struct nfsacl_ace ace<>;
+       uint32_t       default_ace_count;
+       struct nfsacl_ace default_ace<>;
+};
+
+union GETACL3res switch (nfsstat3 status) {
+case NFS3_OK:
+     GETACL3resok   resok;
+default:
+     void;
+};
+
+program NFSACL_PROGRAM {
+       version NFSACL_V3 {
+               void
+               NFSACL3_NULL(void)                    = 0;
+
+               GETACL3res
+               NFSACL3_GETACL(GETACL3args)           = 1;
+       } = 3;
+} = 100227;