X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=nfs%2Fnfs.x;fp=nfs%2Fnfs.x;h=cc19757ea607ede75d79d47517a068050eb01123;hb=f38aacf8c9cf23e2f4e9cc76a8bc61e3f6e8f47f;hp=6e2d7a47d6bd9f044cfd762565bea6a1eec4615d;hpb=463d59bf8e5ff1a3ac27ab4fedf77b237394d1a6;p=deb_libnfs.git diff --git a/nfs/nfs.x b/nfs/nfs.x index 6e2d7a4..cc19757 100644 --- a/nfs/nfs.x +++ b/nfs/nfs.x @@ -1,5 +1,8 @@ /* NFS part from rfc 1813, NFSACL part is from wireshark sources */ +/* + * NFS v3 Definitions + */ const NFS3_FHSIZE = 64; /* Maximum bytes in a V3 file handle */ const NFS3_WRITEVERFSIZE = 8; const NFS3_CREATEVERFSIZE = 8; @@ -777,7 +780,338 @@ union SETATTR3res switch (nfsstat3 status) { SETATTR3resfail resfail; }; +/* + * NFS v2 Definitions + * We share many definitions from v3 + */ +const FHSIZE2 = 32; +typedef opaque fhandle2[FHSIZE2]; + +enum ftype2 { + NF2NON = 0, + NF2REG = 1, + NF2DIR = 2, + NF2BLK = 3, + NF2CHR = 4, + NF2LNK = 5 +}; + +struct fattr2 { + ftype2 type; + unsigned int mode; + unsigned int nlink; + unsigned int uid; + unsigned int gid; + unsigned int size; + unsigned int blocksize; + unsigned int rdev; + unsigned int blocks; + unsigned int fsid; + unsigned int fileid; + nfstime3 atime; + nfstime3 mtime; + nfstime3 ctime; +}; + +struct sattr2 { + unsigned int mode; + unsigned int uid; + unsigned int gid; + unsigned int size; + nfstime3 atime; + nfstime3 mtime; +}; + +const MAXNAMLEN2 = 255; +typedef string filename2; + +const MAXPATHLEN2 = 1024; +typedef string path2; + +const NFSMAXDATA2 = 8192; +typedef opaque nfsdata2; + +const NFSCOOKIESIZE2 = 4; +typedef opaque nfscookie2[NFSCOOKIESIZE2]; + +struct entry2 { + unsigned int fileid; + filename2 name; + nfscookie2 cookie; + entry2 *nextentry; +}; + +struct diropargs2 { + fhandle2 dir; + filename2 name; +}; + +struct GETATTR2args { + fhandle2 fhandle; +}; + +struct GETATTR2resok { + fattr2 attributes; +}; + +union GETATTR2res switch (nfsstat3 status) { + case NFS3_OK: + GETATTR2resok resok; + default: + void; +}; + +struct SETATTR2args { + fhandle2 fhandle; + sattr2 attributes; +}; + +struct SETATTR2resok { + fattr2 attributes; +}; + +union SETATTR2res switch (nfsstat3 status) { + case NFS3_OK: + SETATTR2resok resok; + default: + void; +}; + +struct LOOKUP2args { + diropargs2 what; +}; + +struct LOOKUP2resok { + fhandle2 file; + fattr2 attributes; +}; + +union LOOKUP2res switch (nfsstat3 status) { + case NFS3_OK: + LOOKUP2resok resok; + default: + void; +}; + +struct READLINK2args { + fhandle2 file; +}; + +struct READLINK2resok { + path2 data; +}; + +union READLINK2res switch (nfsstat3 status) { + case NFS3_OK: + READLINK2resok resok; + default: + void; +}; + +struct READ2args { + fhandle2 file; + unsigned int offset; + unsigned int count; + unsigned int totalcount; +}; + +struct READ2resok { + fattr2 attributes; + nfsdata2 data; +}; + +union READ2res switch (nfsstat3 status) { + case NFS3_OK: + READ2resok resok; + default: + void; +}; + +struct WRITE2args { + fhandle2 file; + unsigned int beginoffset; + unsigned int offset; + unsigned int totalcount; + nfsdata2 data; +}; + +struct WRITE2resok { + fattr2 attributes; +}; + +union WRITE2res switch (nfsstat3 status) { + case NFS3_OK: + WRITE2resok resok; + default: + void; +}; + +struct CREATE2args { + diropargs2 where; + sattr2 attributes; +}; + +struct CREATE2resok { + fhandle2 file; + fattr2 attributes; +}; + +union CREATE2res switch (nfsstat3 status) { + case NFS3_OK: + CREATE2resok resok; + default: + void; +}; + +struct REMOVE2args { + diropargs2 what; +}; + +struct REMOVE2res { + nfsstat3 status; +}; + +struct RENAME2args { + diropargs2 from; + diropargs2 to; +}; + +struct RENAME2res { + nfsstat3 status; +}; + +struct LINK2args { + fhandle2 from; + diropargs2 to; +}; + +struct LINK2res { + nfsstat3 status; +}; + +struct SYMLINK2args { + diropargs2 from; + path2 to; + sattr2 attributes; +}; + +struct SYMLINK2res { + nfsstat3 status; +}; + +struct MKDIR2args { + diropargs2 where; + sattr2 attributes; +}; + +struct MKDIR2resok { + fhandle2 file; + fattr2 attributes; +}; + +union MKDIR2res switch (nfsstat3 status) { + case NFS3_OK: + MKDIR2resok resok; + default: + void; +}; + +struct RMDIR2args { + diropargs2 what; +}; + +struct RMDIR2res { + nfsstat3 status; +}; + +struct READDIR2args { + fhandle2 dir; + nfscookie2 cookie; + unsigned int count; +}; + +struct READDIR2resok { + entry2 *entries; + bool eof; +}; + +union READDIR2res switch (nfsstat3 status) { + case NFS3_OK: + READDIR2resok resok; + default: + void; +}; + +struct STATFS2args { + fhandle2 dir; +}; + +struct STATFS2resok { + unsigned int tsize; + unsigned int bsize; + unsigned int blocks; + unsigned int bfree; + unsigned int bavail; +}; + +union STATFS2res switch (nfsstat3 status) { + case NFS3_OK: + STATFS2resok resok; + default: + void; +}; + program NFS_PROGRAM { + version NFS_V2 { + void + NFS2_NULL(void) = 0; + + GETATTR2res + NFS2_GETATTR(GETATTR2args) = 1; + + SETATTR2res + NFS2_SETATTR(SETATTR2args) = 2; + + LOOKUP2res + NFS2_LOOKUP(LOOKUP2args) = 4; + + READLINK2res + NFS2_READLINK(READLINK2args) = 5; + + READ2res + NFS2_READ(READ2args) = 6; + + WRITE2res + NFS2_WRITE(WRITE2args) = 8; + + CREATE2res + NFS2_CREATE(CREATE2args) = 9; + + REMOVE2res + NFS2_REMOVE(REMOVE2args) = 10; + + RENAME2res + NFS2_RENAME(RENAME2args) = 11; + + LINK2res + NFS2_LINK(LINK2args) = 12; + + SYMLINK2res + NFS2_SYMLINK(SYMLINK2args) = 13; + + MKDIR2res + NFS2_MKDIR(MKDIR2args) = 14; + + RMDIR2res + NFS2_RMDIR(RMDIR2args) = 15; + + READDIR2res + NFS2_READDIR(READDIR2args) = 16; + + STATFS2res + NFS2_STATFS(STATFS2args) = 17; + } = 2; + version NFS_V3 { void NFS3_NULL(void) = 0;