nfs_prot.x revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
%#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef RPC_HDR
%
%/*
% * Definitions for uint64, int64, uint32, and int32
% */
%#include <rpc/rpc_sztypes.h>
%
#endif
const NFS_PORT = 2049;
const NFS_MAXDATA = 8192;
const NFS_MAXPATHLEN = 1024;
const NFS_MAXNAMLEN = 255;
const NFS_FHSIZE = 32;
const NFS_COOKIESIZE = 4;
/*
* File types
*/
/*
* Error status
*/
enum nfsstat {
NFS_OK= 0, /* no error */
};
/*
* File types
*/
enum ftype {
NFNON = 0, /* non-file */
};
/*
* File access handle
*/
struct nfs_fh {
};
/*
* Timeval
*/
struct nfstime {
unsigned seconds;
unsigned useconds;
};
/*
* File attributes
*/
struct fattr {
unsigned mode; /* protection mode bits */
unsigned nlink; /* # hard links */
unsigned uid; /* owner user id */
unsigned gid; /* owner group id */
unsigned size; /* file size in bytes */
unsigned blocksize; /* prefered block size */
unsigned rdev; /* special device # */
unsigned blocks; /* Kb of disk used by file */
unsigned fsid; /* device # */
unsigned fileid; /* inode # */
};
/*
* File attributes which can be set
*/
struct sattr {
unsigned mode; /* protection mode bits */
unsigned uid; /* owner user id */
unsigned gid; /* owner group id */
unsigned size; /* file size in bytes */
};
/*
* Reply status with file attributes
*/
case NFS_OK:
default:
void;
};
struct sattrargs {
};
/*
* Arguments for directory operations
*/
struct diropargs {
};
struct diropokres {
};
/*
* Results from directory operation
*/
case NFS_OK:
default:
void;
};
case NFS_OK:
default:
void;
};
/*
* Arguments to remote read
*/
struct readargs {
unsigned offset; /* byte offset in file */
unsigned count; /* immediate read count */
unsigned totalcount; /* total read count (from this offset)*/
};
/*
* Status OK portion of remote read reply
*/
struct readokres {
};
case NFS_OK:
default:
void;
};
/*
* Arguments to remote write
*/
struct writeargs {
unsigned beginoffset; /* beginning byte offset in file */
unsigned offset; /* current byte offset in file */
unsigned totalcount; /* total write count (to this offset)*/
};
struct createargs {
};
struct renameargs {
};
struct linkargs {
};
struct symlinkargs {
};
/*
* Arguments to readdir
*/
struct readdirargs {
unsigned count; /* number of directory bytes to read */
};
struct entry {
unsigned fileid;
};
struct dirlist {
bool eof;
};
case NFS_OK:
default:
void;
};
struct statfsokres {
unsigned tsize; /* preferred transfer size in bytes */
unsigned bsize; /* fundamental file system block size */
unsigned blocks; /* total blocks in file system */
unsigned bfree; /* free blocks in fs */
unsigned bavail; /* free blocks avail to non-superuser */
};
case NFS_OK:
default:
void;
};
/*
* Remote file service routines
*/
void
NFSPROC_NULL(void) = 0;
void
NFSPROC_ROOT(void) = 3;
void
NFSPROC_WRITECACHE(void) = 7;
} = 2;
} = 100003;
/*
* Version 3 declarations and definitions.
*/
/*
* Sizes
*/
const NFS3_FHSIZE = 64;
const NFS3_COOKIEVERFSIZE = 8;
const NFS3_CREATEVERFSIZE = 8;
const NFS3_WRITEVERFSIZE = 8;
/*
* Basic data types
*/
/*
* Error status
*/
enum nfsstat3 {
NFS3_OK = 0,
NFS3ERR_PERM = 1,
NFS3ERR_NOENT = 2,
NFS3ERR_IO = 5,
NFS3ERR_NXIO = 6,
NFS3ERR_ACCES = 13,
NFS3ERR_EXIST = 17,
NFS3ERR_XDEV = 18,
NFS3ERR_NODEV = 19,
NFS3ERR_NOTDIR = 20,
NFS3ERR_ISDIR = 21,
NFS3ERR_INVAL = 22,
NFS3ERR_FBIG = 27,
NFS3ERR_NOSPC = 28,
NFS3ERR_ROFS = 30,
NFS3ERR_MLINK = 31,
NFS3ERR_NAMETOOLONG = 63,
NFS3ERR_NOTEMPTY = 66,
NFS3ERR_DQUOT = 69,
NFS3ERR_STALE = 70,
NFS3ERR_REMOTE = 71,
NFS3ERR_BADHANDLE = 10001,
NFS3ERR_NOT_SYNC = 10002,
NFS3ERR_BAD_COOKIE = 10003,
NFS3ERR_NOTSUPP = 10004,
NFS3ERR_TOOSMALL = 10005,
NFS3ERR_SERVERFAULT = 10006,
NFS3ERR_BADTYPE = 10007,
NFS3ERR_JUKEBOX = 10008
};
/*
* File types
*/
enum ftype3 {
NF3REG = 1,
NF3DIR = 2,
NF3BLK = 3,
NF3CHR = 4,
NF3LNK = 5,
NF3SOCK = 6,
NF3FIFO = 7
};
struct specdata3 {
};
/*
* File access handle
*/
struct nfs_fh3 {
};
/*
* Timeval
*/
struct nfstime3 {
};
/*
* File attributes
*/
struct fattr3 {
};
/*
* File attributes
*/
union post_op_attr switch (bool attributes_follow) {
case TRUE:
case FALSE:
void;
};
struct wcc_attr {
};
union pre_op_attr switch (bool attributes_follow) {
case TRUE:
case FALSE:
void;
};
struct wcc_data {
};
union post_op_fh3 switch (bool handle_follows) {
case TRUE:
case FALSE:
void;
};
enum time_how {
DONT_CHANGE = 0,
SET_TO_SERVER_TIME = 1,
};
case TRUE:
default:
void;
};
case TRUE:
default:
void;
};
case TRUE:
default:
void;
};
case TRUE:
default:
void;
};
case SET_TO_CLIENT_TIME:
default:
void;
};
case SET_TO_CLIENT_TIME:
default:
void;
};
struct sattr3 {
};
struct diropargs3 {
};
/*
* GETATTR: Get file attributes
*/
struct GETATTR3args {
};
struct GETATTR3resok {
};
case NFS3_OK:
default:
void;
};
/*
* SETATTR: Set file attributes
*/
union sattrguard3 switch (bool check) {
case TRUE:
case FALSE:
void;
};
struct SETATTR3args {
};
struct SETATTR3resok {
};
struct SETATTR3resfail {
};
case NFS3_OK:
default:
};
/*
* LOOKUP: Lookup filename
*/
struct LOOKUP3args {
};
struct LOOKUP3resok {
};
struct LOOKUP3resfail {
};
case NFS3_OK:
default:
};
/*
* ACCESS: Check access permission
*/
const ACCESS3_READ = 0x0001;
const ACCESS3_LOOKUP = 0x0002;
const ACCESS3_MODIFY = 0x0004;
const ACCESS3_EXTEND = 0x0008;
const ACCESS3_DELETE = 0x0010;
const ACCESS3_EXECUTE = 0x0020;
struct ACCESS3args {
};
struct ACCESS3resok {
};
struct ACCESS3resfail {
};
case NFS3_OK:
default:
};
/*
* READLINK: Read from symbolic link
*/
struct READLINK3args {
};
struct READLINK3resok {
};
struct READLINK3resfail {
};
case NFS3_OK:
default:
};
/*
* READ: Read from file
*/
struct READ3args {
};
struct READ3resok {
bool eof;
};
struct READ3resfail {
};
case NFS3_OK:
default:
};
/*
* WRITE: Write to file
*/
enum stable_how {
UNSTABLE = 0,
DATA_SYNC = 1,
FILE_SYNC = 2
};
struct WRITE3args {
};
struct WRITE3resok {
};
struct WRITE3resfail {
};
case NFS3_OK:
default:
};
/*
* CREATE: Create a file
*/
enum createmode3 {
UNCHECKED = 0,
GUARDED = 1,
EXCLUSIVE = 2
};
case UNCHECKED:
case GUARDED:
case EXCLUSIVE:
};
struct CREATE3args {
};
struct CREATE3resok {
};
struct CREATE3resfail {
};
case NFS3_OK:
default:
};
/*
* MKDIR: Create a directory
*/
struct MKDIR3args {
};
struct MKDIR3resok {
};
struct MKDIR3resfail {
};
case NFS3_OK:
default:
};
/*
* SYMLINK: Create a symbolic link
*/
struct symlinkdata3 {
};
struct SYMLINK3args {
};
struct SYMLINK3resok {
};
struct SYMLINK3resfail {
};
case NFS3_OK:
default:
};
/*
* MKNOD: Create a special file
*/
struct devicedata3 {
};
case NF3CHR:
case NF3BLK:
case NF3SOCK:
case NF3FIFO:
default:
void;
};
struct MKNOD3args {
};
struct MKNOD3resok {
};
struct MKNOD3resfail {
};
case NFS3_OK:
default:
};
/*
* REMOVE: Remove a file
*/
struct REMOVE3args {
};
struct REMOVE3resok {
};
struct REMOVE3resfail {
};
case NFS3_OK:
default:
};
/*
* RMDIR: Remove a directory
*/
struct RMDIR3args {
};
struct RMDIR3resok {
};
struct RMDIR3resfail {
};
case NFS3_OK:
default:
};
/*
* RENAME: Rename a file or directory
*/
struct RENAME3args {
};
struct RENAME3resok {
};
struct RENAME3resfail {
};
case NFS3_OK:
default:
};
/*
* LINK: Create link to an object
*/
struct LINK3args {
};
struct LINK3resok {
};
struct LINK3resfail {
};
case NFS3_OK:
default:
};
/*
* READDIR: Read from directory
*/
struct READDIR3args {
};
struct entry3 {
};
struct dirlist3 {
bool eof;
};
struct READDIR3resok {
};
struct READDIR3resfail {
};
case NFS3_OK:
default:
};
/*
* READDIRPLUS: Extended read from a directory
*/
struct READDIRPLUS3args {
};
struct entryplus3 {
};
struct dirlistplus3 {
bool eof;
};
struct READDIRPLUS3resok {
};
struct READDIRPLUS3resfail {
};
case NFS3_OK:
default:
};
/*
* FSSTAT: Get dynamic file system information
*/
struct FSSTAT3args {
};
struct FSSTAT3resok {
};
struct FSSTAT3resfail {
};
case NFS3_OK:
default:
};
/*
* FSINFO: Get static file system information
*/
const FSF3_LINK = 0x0001;
const FSF3_SYMLINK = 0x0002;
const FSF3_HOMOGENEOUS = 0x0008;
const FSF3_CANSETTIME = 0x0010;
struct FSINFO3args {
};
struct FSINFO3resok {
};
struct FSINFO3resfail {
};
case NFS3_OK:
default:
};
/*
* PATHCONF: Retrieve POSIX information
*/
struct PATHCONF3args {
};
struct PATHCONF3resok {
bool no_trunc;
bool chown_restricted;
bool case_insensitive;
bool case_preserving;
};
struct PATHCONF3resfail {
};
case NFS3_OK:
default:
};
/*
* COMMIT: Commit cached data on a server to stable storage
*/
struct COMMIT3args {
};
struct COMMIT3resok {
};
struct COMMIT3resfail {
};
case NFS3_OK:
default:
};
/*
* Remote file service routines
*/
void
NFSPROC3_NULL(void) = 0;
} = 3;
} = 100003;