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