1 /* $FreeBSD: src/lib/libstand/nfsv2.h,v 1.1.1.1.6.1 2000/05/04 13:47:51 ps Exp $ */
2 /* $DragonFly: src/lib/libstand/nfsv2.h,v 1.2 2003/06/17 04:26:51 dillon Exp $ */
3 /* $NetBSD: nfsv2.h,v 1.2 1996/02/26 23:05:23 gwr Exp $ */
6 * Copyright (c) 1989, 1993
7 * The Regents of the University of California. All rights reserved.
9 * This code is derived from software contributed to Berkeley by
10 * Rick Macklem at The University of Guelph.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by the University of
23 * California, Berkeley and its contributors.
24 * 4. Neither the name of the University nor the names of its contributors
25 * may be used to endorse or promote products derived from this software
26 * without specific prior written permission.
28 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
29 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
32 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * @(#)nfsv2.h 8.1 (Berkeley) 6/10/93
44 * nfs definitions as per the version 2 specs
48 * Constants as defined in the Sun NFS Version 2 spec.
49 * "NFS: Network File System Protocol Specification" RFC1094
53 #define NFS_PROG 100003
55 #define NFS_MAXDGRAMDATA 8192
56 #define NFS_MAXDATA 32768
57 #define NFS_MAXPATHLEN 1024
58 #define NFS_MAXNAMLEN 255
60 #define NFS_MAXPKTHDR 404
61 #define NFS_MAXPACKET (NFS_MAXPKTHDR+NFS_MAXDATA)
62 #define NFS_MINPACKET 20
63 #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
64 #define NFS_READDIRSIZE 1024
66 /* Stat numbers for rpc returns */
69 #define NFSERR_NOENT 2
72 #define NFSERR_ACCES 13
73 #define NFSERR_EXIST 17
74 #define NFSERR_NODEV 19
75 #define NFSERR_NOTDIR 20
76 #define NFSERR_ISDIR 21
77 #define NFSERR_FBIG 27
78 #define NFSERR_NOSPC 28
79 #define NFSERR_ROFS 30
80 #define NFSERR_NAMETOL 63
81 #define NFSERR_NOTEMPTY 66
82 #define NFSERR_DQUOT 69
83 #define NFSERR_STALE 70
84 #define NFSERR_WFLUSH 99
86 /* Sizes in bytes of various nfs rpc components */
88 #define NFSX_UNSIGNED 4
91 #define NFSX_STATFS 20
94 /* nfs rpc procedure numbers */
95 #define NFSPROC_NULL 0
96 #define NFSPROC_GETATTR 1
97 #define NFSPROC_SETATTR 2
98 #define NFSPROC_NOOP 3
99 #define NFSPROC_ROOT NFSPROC_NOOP /* Obsolete */
100 #define NFSPROC_LOOKUP 4
101 #define NFSPROC_READLINK 5
102 #define NFSPROC_READ 6
103 #define NFSPROC_WRITECACHE NFSPROC_NOOP /* Obsolete */
104 #define NFSPROC_WRITE 8
105 #define NFSPROC_CREATE 9
106 #define NFSPROC_REMOVE 10
107 #define NFSPROC_RENAME 11
108 #define NFSPROC_LINK 12
109 #define NFSPROC_SYMLINK 13
110 #define NFSPROC_MKDIR 14
111 #define NFSPROC_RMDIR 15
112 #define NFSPROC_READDIR 16
113 #define NFSPROC_STATFS 17
115 #define NFS_NPROCS 18
128 /* Structs for common parts of the rpc's */
135 * File attributes and setable attributes.
149 struct nfsv2_time fa_atime
;
150 struct nfsv2_time fa_mtime
;
151 struct nfsv2_time fa_ctime
;
159 struct nfsv2_time sa_atime
;
160 struct nfsv2_time sa_mtime
;
163 struct nfsv2_statfs
{