2. RPC Information
2.1 Authentication
The NFS service uses AUTH_NONE in the NULL procedure. AUTH_UNIX, AUTH_DES, or AUTH_KERB are used for all other procedures. Other authentication types may be supported in the future.
2.2 Constants
These are the RPC constants needed to call the NFS Version 3 service. They are given in decimal.
PROGRAM 100003
VERSION 3
2.3 Transport address
The NFS protocol is normally supported over the TCP and UDP protocols. It uses port 2049, the same as the NFS version 2 protocol.
2.4 Sizes
These are the sizes, given in decimal bytes, of various XDR structures used in the NFS version 3 protocol:
NFS3_FHSIZE 64
- The maximum size in bytes of the opaque file handle.
NFS3_COOKIEVERFSIZE 8
- The size in bytes of the opaque cookie verifier passed by READDIR and READDIRPLUS.
NFS3_CREATEVERFSIZE 8
- The size in bytes of the opaque verifier used for exclusive CREATE.
NFS3_WRITEVERFSIZE 8
- The size in bytes of the opaque verifier used for asynchronous WRITE.
2.5 Basic Data Types
The following XDR definitions are basic definitions that are used in other structures.
uint64
typedef unsigned hyper uint64;
int64
typedef hyper int64;
uint32
typedef unsigned long uint32;
int32
typedef long int32;
filename3
typedef string filename3<>;
nfspath3
typedef string nfspath3<>;
fileid3
typedef uint64 fileid3;
cookie3
typedef uint64 cookie3;
cookieverf3
typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
createverf3
typedef opaque createverf3[NFS3_CREATEVERFSIZE];
writeverf3
typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
uid3
typedef uint32 uid3;
gid3
typedef uint32 gid3;
size3
typedef uint64 size3;
offset3
typedef uint64 offset3;
mode3
typedef uint32 mode3;
count3
typedef uint32 count3;
nfsstat3
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
};
The nfsstat3 type is returned with every procedure's results except for the NULL procedure. A value of NFS3_OK indicates that the call completed successfully. Any other value indicates that some error occurred on the call, as identified by the error code. Note that the precise numeric encoding must be followed. No other values may be returned by a server.
2.6 Defined Error Numbers
A description of each defined error follows:
NFS3_OK = 0
- Indicates the call completed successfully.
NFS3ERR_PERM = 1
- Not owner. The operation was not allowed because the caller is either not a privileged user (root) or not the owner of the target of the operation.
NFS3ERR_NOENT = 2
- No such file or directory. The file or directory name specified does not exist.
NFS3ERR_IO = 5
- I/O error. A hard error (for example, a disk error) occurred while processing the requested operation.
NFS3ERR_NXIO = 6
- I/O error. No such device or address.
NFS3ERR_ACCES = 13
- Permission denied. The caller does not have the correct permission to perform the requested operation. Contrast this with NFS3ERR_PERM, which restricts itself to owner or privileged user permission failures.
NFS3ERR_EXIST = 17
- File exists. The file specified already exists.
NFS3ERR_XDEV = 18
- Attempt to do a cross-device hard link.
NFS3ERR_NODEV = 19
- No such device.
NFS3ERR_NOTDIR = 20
- Not a directory. The caller specified a non-directory in a directory operation.
NFS3ERR_ISDIR = 21
- Is a directory. The caller specified a directory in a non-directory operation.
NFS3ERR_INVAL = 22
- Invalid argument or unsupported argument for an operation. Two examples are attempting a READLINK on an object other than a symbolic link or attempting to SETATTR a time field on a server that does not support this operation.
NFS3ERR_FBIG = 27
- File too large. The operation would have caused a file to grow beyond the server's limit.
NFS3ERR_NOSPC = 28
- No space left on device. The operation would have caused the server's file system to exceed its limit.
NFS3ERR_ROFS = 30
- Read-only file system. A modifying operation was attempted on a read-only file system.
NFS3ERR_MLINK = 31
- Too many hard links.
NFS3ERR_NAMETOOLONG = 63
- The filename in an operation was too long.
NFS3ERR_NOTEMPTY = 66
- An attempt was made to remove a directory that was not empty.
NFS3ERR_DQUOT = 69
- Resource (quota) hard limit exceeded. The user's resource limit on the server has been exceeded.
NFS3ERR_STALE = 70
- Invalid file handle. The file handle given in the arguments was invalid. The file referred to by that file handle no longer exists or access to it has been revoked.
NFS3ERR_REMOTE = 71
- Too many levels of remote in path. The file handle given in the arguments referred to a file on a non-local file system on the server.
NFS3ERR_BADHANDLE = 10001
- Illegal NFS file handle. The file handle failed internal consistency checks.
NFS3ERR_NOT_SYNC = 10002
- Update synchronization mismatch was detected during a SETATTR operation.
NFS3ERR_BAD_COOKIE = 10003
- READDIR or READDIRPLUS cookie is stale.
NFS3ERR_NOTSUPP = 10004
- Operation is not supported.
NFS3ERR_TOOSMALL = 10005
- Buffer or request is too small.
NFS3ERR_SERVERFAULT = 10006
- An error occurred on the server which does not map to any of the legal NFS version 3 protocol error values. The client should translate this into an appropriate error. UNIX clients may choose to translate this to EIO.
NFS3ERR_BADTYPE = 10007
- An attempt was made to create an object of a type not supported by the server.
NFS3ERR_JUKEBOX = 10008
- The server initiated the request, but was not able to complete it in a timely fashion. The client should wait and then try the request with a new RPC transaction ID. For example, this error should be returned from a server that supports hierarchical storage and receives a request to process a file that has been migrated. In this case, the server should start the immigration process and respond to client with this error.