📄 rfc1813.txt
字号:
union for each field to tell whether or how to set that
field. The atime and mtime fields can be set to either
the server's current time or a time supplied by the
client.
LOOKUP
The LOOKUP return structure now includes the attributes
for the directory searched.
Callaghan, el al Informational [Page 12]
RFC 1813 NFS Version 3 Protocol June 1995
ACCESS
An ACCESS procedure has been added to allow an explicit
over-the-wire permissions check. This addresses known
problems with the superuser ID mapping feature in many
server implementations (where, due to mapping of root
user, unexpected permission denied errors could occur
while reading from or writing to a file). This also
removes the assumption which was made in the NFS
version 2 protocol that access to files was based
solely on UNIX style mode bits.
READ
The reply structure includes a Boolean that is TRUE if
the end-of-file was encountered during the READ. This
allows the client to correctly detect end-of-file.
WRITE
The beginoffset and totalcount fields were removed from
the WRITE arguments. The reply now includes a count so
that the server can write less than the requested
amount of data, if required. An indicator was added to
the arguments to instruct the server as to the level of
cache synchronization that is required by the client.
CREATE
An exclusive flag and a create verifier was added for
the exclusive creation of regular files.
MKNOD
This procedure was added to support the creation of
special files. This avoids overloading fields of CREATE
as was done in some NFS version 2 protocol
implementations.
READDIR
The READDIR arguments now include a verifier to allow
the server to validate the cookie. The cookie is now a
64 bit unsigned integer instead of the 4 byte array
which was used in the NFS version 2 protocol. This
will help to reduce interoperability problems.
READDIRPLUS
This procedure was added to return file handles and
attributes in an extended directory list.
FSINFO
FSINFO was added to provide nonvolatile information
about a file system. The reply includes preferred and
Callaghan, el al Informational [Page 13]
RFC 1813 NFS Version 3 Protocol June 1995
maximum read transfer size, preferred and maximum write
transfer size, and flags stating whether links or
symbolic links are supported. Also returned are
preferred transfer size for READDIR procedure replies,
server time granularity, and whether times can be set
in a SETATTR request.
FSSTAT
FSSTAT was added to provide volatile information about
a file system, for use by utilities such as the Unix
system df command. The reply includes the total size
and free space in the file system specified in bytes,
the total number of files and number of free file slots
in the file system, and an estimate of time between
file system modifications (for use in cache consistency
checking algorithms).
COMMIT
The COMMIT procedure provides the synchronization
mechanism to be used with asynchronous WRITE
operations.
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:
Callaghan, el al Informational [Page 14]
RFC 1813 NFS Version 3 Protocol June 1995
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];
Callaghan, el al Informational [Page 15]
RFC 1813 NFS Version 3 Protocol June 1995
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,
Callaghan, el al Informational [Page 16]
RFC 1813 NFS Version 3 Protocol June 1995
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. Servers are
expected to make a best effort mapping of error conditions to
the set of error codes defined. In addition, no error
precedences are specified by this specification. Error
precedences determine the error value that should be returned
when more than one error applies in a given situation. The error
precedence will be determined by the individual server
implementation. If the client requires specific error
precedences, it should check for the specific errors for
itself.
2.6 Defined Error Numbers
A description of each defined error follows:
NFS3_OK
Indicates the call completed successfully.
NFS3ERR_PERM
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
No such file or directory. The file or directory name
specified does not exist.
NFS3ERR_IO
I/O error. A hard error (for example, a disk error)
occurred while processing the requested operation.
NFS3ERR_NXIO
I/O error. No such device or address.
Callaghan, el al Informational [Page 17]
RFC 1813 NFS Version 3 Protocol June 1995
NFS3ERR_ACCES
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
File exists. The file specified already exists.
NFS3ERR_XDEV
Attempt to do a cross-device hard link.
NFS3ERR_NODEV
No such device.
NFS3ERR_NOTDIR
Not a directory. The caller specified a non-directory in
a directory operation.
NFS3ERR_ISDIR
Is a directory. The caller specified a directory in a
non-directory operation.
NFS3ERR_INVAL
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
File too large. The operation would have caused a file to
grow beyond the server's limit.
NFS3ERR_NOSPC
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -