ZDR: New builtin replacement for RPC/XDR called ZDR
[deb_libnfs.git] / nfs / nfs.x
index abb4e461779f9edf89c2e93b259866287d90a079..c259aa6e3cf3ff6dc7b96f3d34dc60b095f1951c 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;
@@ -39,44 +39,40 @@ enum ftype3 {
        NF3FIFO   = 7
 };
 
-typedef unsigned long uint32;
+typedef unsigned int mode3;
 
-typedef long int32;
+typedef unsigned int uid3;
 
-typedef uint32 mode3;
-
-typedef uint32 uid3;
-
-typedef uint32 gid3;
+typedef unsigned int gid3;
 
 typedef uint64 size3;
 
 typedef uint64 fileid3;
 
 struct specdata3 {
-       uint32     specdata1;
-       uint32     specdata2;
+       unsigned int specdata1;
+       unsigned int specdata2;
 };
 
 struct nfstime3 {
-       uint32   seconds;
-       uint32   nseconds;
+       unsigned int seconds;
+       unsigned int nseconds;
 };
 
 struct fattr3 {
-       ftype3     type;
-       mode3      mode;
-       uint32     nlink;
-       uid3       uid;
-       gid3       gid;
-       size3      size;
-       size3      used;
-       specdata3  rdev;
-       uint64     fsid;
-       fileid3    fileid;
-       nfstime3   atime;
-       nfstime3   mtime;
-       nfstime3   ctime;
+       ftype3       type;
+       mode3        mode;
+       unsigned int nlink;
+       uid3         uid;
+       gid3         gid;
+       size3        size;
+       size3        used;
+       specdata3    rdev;
+       uint64       fsid;
+       fileid3      fileid;
+       nfstime3     atime;
+       nfstime3     mtime;
+       nfstime3     ctime;
 };
 
 union post_op_attr switch (bool attributes_follow) {
@@ -127,7 +123,7 @@ enum stable_how {
 
 typedef uint64 offset3;
 
-typedef uint32 count3;
+typedef unsigned int count3;
 
 struct wcc_attr {
        size3       size;
@@ -228,13 +224,13 @@ const ACCESS3_DELETE  = 0x0010;
 const ACCESS3_EXECUTE = 0x0020;
 
 struct ACCESS3args {
-     nfs_fh3  object;
-     uint32   access;
+     nfs_fh3      object;
+     unsigned int access;
 };
 
 struct ACCESS3resok {
-     post_op_attr   obj_attributes;
-     uint32         access;
+     post_op_attr obj_attributes;
+     unsigned int access;
 };
 
 struct ACCESS3resfail {
@@ -333,8 +329,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;
 };
@@ -423,16 +420,16 @@ struct FSINFO3args {
 
 struct FSINFO3resok {
        post_op_attr obj_attributes;
-       uint32       rtmax;
-       uint32       rtpref;
-       uint32       rtmult;
-       uint32       wtmax;
-       uint32       wtpref;
-       uint32       wtmult;
-       uint32       dtpref;
+       unsigned int rtmax;
+       unsigned int rtpref;
+       unsigned int rtmult;
+       unsigned int wtmax;
+       unsigned int wtpref;
+       unsigned int wtmult;
+       unsigned int dtpref;
        size3        maxfilesize;
        nfstime3     time_delta;
-       uint32       properties;
+       unsigned int properties;
 };
 
 struct FSINFO3resfail {
@@ -459,7 +456,7 @@ struct FSSTAT3resok {
        size3        tfiles;
        size3        ffiles;
        size3        afiles;
-       uint32       invarsec;
+       unsigned int invarsec;
 };
 
 struct FSSTAT3resfail {
@@ -479,8 +476,8 @@ struct PATHCONF3args {
 
 struct PATHCONF3resok {
        post_op_attr obj_attributes;
-       uint32       linkmax;
-       uint32       name_max;
+       unsigned int linkmax;
+       unsigned int name_max;
        bool         no_trunc;
        bool         chown_restricted;
        bool         case_insensitive;
@@ -556,9 +553,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:
@@ -813,7 +812,8 @@ program NFS_PROGRAM {
                SYMLINK3res
                NFS3_SYMLINK(SYMLINK3args)         = 10;
 
-/*             MKNOD3res NFSPROC3_MKNOD(MKNOD3args)             = 11;*/
+               MKNOD3res
+               NFS3_MKNOD(MKNOD3args)             = 11;
 
                REMOVE3res
                NFS3_REMOVE(REMOVE3args)           = 12;
@@ -846,3 +846,93 @@ 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;
+       unsigned int id;
+       unsigned int 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;
+       unsigned int mask;
+};
+
+struct GETACL3resok {
+       post_op_attr       attr;
+       unsigned int       mask;
+       unsigned int       ace_count;
+       struct nfsacl_ace  ace<>;
+       unsigned int       default_ace_count;
+       struct nfsacl_ace  default_ace<>;
+};
+
+union GETACL3res switch (nfsstat3 status) {
+case NFS3_OK:
+     GETACL3resok   resok;
+default:
+     void;
+};
+
+struct SETACL3args {
+       nfs_fh3            dir;
+       unsigned int       mask;
+       unsigned int       ace_count;
+       struct nfsacl_ace  ace<>;
+       unsigned int       default_ace_count;
+       struct nfsacl_ace  default_ace<>;
+};
+
+struct SETACL3resok {
+       post_op_attr   attr;
+};
+
+union SETACL3res switch (nfsstat3 status) {
+case NFS3_OK:
+     SETACL3resok   resok;
+default:
+     void;
+};
+
+program NFSACL_PROGRAM {
+       version NFSACL_V3 {
+               void
+               NFSACL3_NULL(void)                    = 0;
+
+               GETACL3res
+               NFSACL3_GETACL(GETACL3args)           = 1;
+
+               SETACL3res
+               NFSACL3_SETACL(SETACL3args)           = 2;
+       } = 3;
+} = 100227;