xref: /netbsd-src/sys/fs/nfs/common/oldnfsproto.h (revision 6ca35587140cd9a0531fe714770d4b88eeec3317)
1*6ca35587Sdholland /*	$NetBSD: oldnfsproto.h,v 1.1.1.1 2013/09/30 07:19:34 dholland Exp $	*/
2*6ca35587Sdholland /*-
3*6ca35587Sdholland  * Copyright (c) 1989, 1993
4*6ca35587Sdholland  *	The Regents of the University of California.  All rights reserved.
5*6ca35587Sdholland  *
6*6ca35587Sdholland  * This code is derived from software contributed to Berkeley by
7*6ca35587Sdholland  * Rick Macklem at The University of Guelph.
8*6ca35587Sdholland  *
9*6ca35587Sdholland  * Redistribution and use in source and binary forms, with or without
10*6ca35587Sdholland  * modification, are permitted provided that the following conditions
11*6ca35587Sdholland  * are met:
12*6ca35587Sdholland  * 1. Redistributions of source code must retain the above copyright
13*6ca35587Sdholland  *    notice, this list of conditions and the following disclaimer.
14*6ca35587Sdholland  * 2. Redistributions in binary form must reproduce the above copyright
15*6ca35587Sdholland  *    notice, this list of conditions and the following disclaimer in the
16*6ca35587Sdholland  *    documentation and/or other materials provided with the distribution.
17*6ca35587Sdholland  * 4. Neither the name of the University nor the names of its contributors
18*6ca35587Sdholland  *    may be used to endorse or promote products derived from this software
19*6ca35587Sdholland  *    without specific prior written permission.
20*6ca35587Sdholland  *
21*6ca35587Sdholland  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22*6ca35587Sdholland  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23*6ca35587Sdholland  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24*6ca35587Sdholland  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25*6ca35587Sdholland  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26*6ca35587Sdholland  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27*6ca35587Sdholland  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28*6ca35587Sdholland  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29*6ca35587Sdholland  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30*6ca35587Sdholland  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31*6ca35587Sdholland  * SUCH DAMAGE.
32*6ca35587Sdholland  *
33*6ca35587Sdholland  *	@(#)nfsproto.h  8.2 (Berkeley) 3/30/95
34*6ca35587Sdholland  * FreeBSD: head/sys/nfs/nfsproto.h 164725 2006-11-28 19:33:28Z rees
35*6ca35587Sdholland  * $NetBSD: oldnfsproto.h,v 1.1.1.1 2013/09/30 07:19:34 dholland Exp $
36*6ca35587Sdholland  */
37*6ca35587Sdholland 
38*6ca35587Sdholland #ifndef _NFS_NFSPROTO_H_
39*6ca35587Sdholland #define _NFS_NFSPROTO_H_
40*6ca35587Sdholland 
41*6ca35587Sdholland /*
42*6ca35587Sdholland  * nfs definitions as per the Version 2 and 3 specs
43*6ca35587Sdholland  */
44*6ca35587Sdholland 
45*6ca35587Sdholland /*
46*6ca35587Sdholland  * Constants as defined in the Sun NFS Version 2 and 3 specs.
47*6ca35587Sdholland  * "NFS: Network File System Protocol Specification" RFC1094
48*6ca35587Sdholland  * and in the "NFS: Network File System Version 3 Protocol
49*6ca35587Sdholland  * Specification"
50*6ca35587Sdholland  */
51*6ca35587Sdholland 
52*6ca35587Sdholland #define NFS_PORT	2049
53*6ca35587Sdholland #define	NFS_PROG	100003
54*6ca35587Sdholland #define NFS_VER2	2
55*6ca35587Sdholland #define	NFS_VER3	3
56*6ca35587Sdholland #define NFS_VER4	4
57*6ca35587Sdholland 
58*6ca35587Sdholland #define NFS_V2MAXDATA	8192
59*6ca35587Sdholland #define	NFS_MAXDGRAMDATA 16384
60*6ca35587Sdholland #define	NFS_MAXDATA	32768
61*6ca35587Sdholland #define	NFS_MAXPATHLEN	1024
62*6ca35587Sdholland #define	NFS_MAXNAMLEN	255
63*6ca35587Sdholland #define	NFS_MAXPKTHDR	404	/* XXXv4 this needs to be adjust for v4 */
64*6ca35587Sdholland #define NFS_MAXPACKET	(NFS_MAXPKTHDR + NFS_MAXDATA)
65*6ca35587Sdholland #define	NFS_MINPACKET	20
66*6ca35587Sdholland #define	NFS_FABLKSIZE	512	/* Size in bytes of a block wrt fa_blocks */
67*6ca35587Sdholland 
68*6ca35587Sdholland /* Stat numbers for rpc returns (version 2, 3 and 4) */
69*6ca35587Sdholland #define	NFS_OK			0
70*6ca35587Sdholland #define	NFSERR_PERM		1
71*6ca35587Sdholland #define	NFSERR_NOENT		2
72*6ca35587Sdholland #define	NFSERR_IO		5
73*6ca35587Sdholland #define	NFSERR_NXIO		6
74*6ca35587Sdholland #define	NFSERR_ACCES		13
75*6ca35587Sdholland #define	NFSERR_EXIST		17
76*6ca35587Sdholland #define	NFSERR_XDEV		18	/* Version 3 only */
77*6ca35587Sdholland #define	NFSERR_NODEV		19
78*6ca35587Sdholland #define	NFSERR_NOTDIR		20
79*6ca35587Sdholland #define	NFSERR_ISDIR		21
80*6ca35587Sdholland #define	NFSERR_INVAL		22	/* Version 3 only */
81*6ca35587Sdholland #define	NFSERR_FBIG		27
82*6ca35587Sdholland #define	NFSERR_NOSPC		28
83*6ca35587Sdholland #define	NFSERR_ROFS		30
84*6ca35587Sdholland #define	NFSERR_MLINK		31	/* Version 3 only */
85*6ca35587Sdholland #define	NFSERR_NAMETOL		63
86*6ca35587Sdholland #define	NFSERR_NOTEMPTY		66
87*6ca35587Sdholland #define	NFSERR_DQUOT		69
88*6ca35587Sdholland #define	NFSERR_STALE		70
89*6ca35587Sdholland #define	NFSERR_REMOTE		71	/* Version 3 only */
90*6ca35587Sdholland #define	NFSERR_WFLUSH		99	/* Version 2 only */
91*6ca35587Sdholland #define	NFSERR_BADHANDLE	10001	/* The rest Version 3, 4 only */
92*6ca35587Sdholland #define	NFSERR_NOT_SYNC		10002
93*6ca35587Sdholland #define	NFSERR_BAD_COOKIE	10003
94*6ca35587Sdholland #define	NFSERR_NOTSUPP		10004
95*6ca35587Sdholland #define	NFSERR_TOOSMALL		10005
96*6ca35587Sdholland #define	NFSERR_SERVERFAULT	10006
97*6ca35587Sdholland #define	NFSERR_BADTYPE		10007
98*6ca35587Sdholland #define	NFSERR_JUKEBOX		10008
99*6ca35587Sdholland #define NFSERR_TRYLATER		NFSERR_JUKEBOX
100*6ca35587Sdholland #define	NFSERR_SAME		10009   /* The rest Version 4 only */
101*6ca35587Sdholland #define	NFSERR_DENIED		10010
102*6ca35587Sdholland #define	NFSERR_EXPIRED		10011
103*6ca35587Sdholland #define	NFSERR_LOCKED		10012
104*6ca35587Sdholland #define	NFSERR_GRACE		10013
105*6ca35587Sdholland #define	NFSERR_FHEXPIRED	10014
106*6ca35587Sdholland #define	NFSERR_SHARDE_DENIED	10015
107*6ca35587Sdholland #define	NFSERR_WRONGSEC		10016
108*6ca35587Sdholland #define	NFSERR_CLID_INUSE	10017
109*6ca35587Sdholland #define	NFSERR_RESOURCE		10018
110*6ca35587Sdholland #define	NFSERR_MOVED		10019
111*6ca35587Sdholland #define	NFSERR_NOFILEHANDLE	10020
112*6ca35587Sdholland #define	NFSERR_MINOR_VERS_MISMATCH 10021
113*6ca35587Sdholland #define	NFSERR_STALE_CLIENTID	10022
114*6ca35587Sdholland #define	NFSERR_STALE_STATEID	10023
115*6ca35587Sdholland #define	NFSERR_OLD_STATEID	10024
116*6ca35587Sdholland #define	NFSERR_BAD_STATEID	10025
117*6ca35587Sdholland #define	NFSERR_BAD_SEQID	10026
118*6ca35587Sdholland #define	NFSERR_NOT_SAME		10027
119*6ca35587Sdholland #define	NFSERR_LOCK_RANGE	10028
120*6ca35587Sdholland #define	NFSERR_SYMLINK		10029
121*6ca35587Sdholland #define	NFSERR_READDIR_NOSPC	10030
122*6ca35587Sdholland #define	NFSERR_LEASE_MOVED	10031
123*6ca35587Sdholland #define	NFSERR_ATTRNOTSUPP	10032
124*6ca35587Sdholland #define	NFSERR_NO_GRACE		10033
125*6ca35587Sdholland #define	NFSERR_RECLAIM_BAD	10034
126*6ca35587Sdholland #define	NFSERR_RECLAIM_CONFLICT	10035
127*6ca35587Sdholland #define	NFSERR_BADXDR		10036
128*6ca35587Sdholland #define	NFSERR_LOCKS_HELD	10037
129*6ca35587Sdholland #define	NFSERR_OPENMODE		10038
130*6ca35587Sdholland #define	NFSERR_BADOWNER		10039
131*6ca35587Sdholland #define	NFSERR_BADCHAR		10040
132*6ca35587Sdholland #define	NFSERR_BADNAME		10041
133*6ca35587Sdholland #define	NFSERR_BAD_RANGE	10042
134*6ca35587Sdholland #define	NFSERR_LOCK_NOTSUPP	10043
135*6ca35587Sdholland #define	NFSERR_OP_ILLEGAL	10044
136*6ca35587Sdholland #define	NFSERR_DEADLOCK		10045
137*6ca35587Sdholland #define	NFSERR_FILE_OPEN	10046
138*6ca35587Sdholland #define	NFSERR_STALEWRITEVERF	30001	/* Fake return for nfs_commit() */
139*6ca35587Sdholland 
140*6ca35587Sdholland 
141*6ca35587Sdholland 
142*6ca35587Sdholland #define NFSERR_RETVOID		0x20000000 /* Return void, not error */
143*6ca35587Sdholland #define NFSERR_AUTHERR		0x40000000 /* Mark an authentication error */
144*6ca35587Sdholland #define NFSERR_RETERR		0x80000000 /* Mark an error return for V3 */
145*6ca35587Sdholland 
146*6ca35587Sdholland /* Sizes in bytes of various nfs rpc components */
147*6ca35587Sdholland #define	NFSX_UNSIGNED	4
148*6ca35587Sdholland 
149*6ca35587Sdholland /* specific to NFS Version 2 */
150*6ca35587Sdholland #define	NFSX_V2FH	32
151*6ca35587Sdholland #define	NFSX_V2FATTR	68
152*6ca35587Sdholland #define	NFSX_V2SATTR	32
153*6ca35587Sdholland #define	NFSX_V2COOKIE	4
154*6ca35587Sdholland #define NFSX_V2STATFS	20
155*6ca35587Sdholland 
156*6ca35587Sdholland /* specific to NFS Version 3 */
157*6ca35587Sdholland #define NFSX_V3FH		(sizeof (fhandle_t)) /* size this server uses */
158*6ca35587Sdholland #define	NFSX_V3FHMAX		64	/* max. allowed by protocol */
159*6ca35587Sdholland #define NFSX_V3FATTR		84
160*6ca35587Sdholland #define NFSX_V3SATTR		60	/* max. all fields filled in */
161*6ca35587Sdholland #define NFSX_V3SRVSATTR		(sizeof (struct nfsv3_sattr))
162*6ca35587Sdholland #define NFSX_V3POSTOPATTR	(NFSX_V3FATTR + NFSX_UNSIGNED)
163*6ca35587Sdholland #define NFSX_V3WCCDATA		(NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
164*6ca35587Sdholland #define NFSX_V3COOKIEVERF 	8
165*6ca35587Sdholland #define NFSX_V3WRITEVERF 	8
166*6ca35587Sdholland #define NFSX_V3CREATEVERF	8
167*6ca35587Sdholland #define NFSX_V3STATFS		52
168*6ca35587Sdholland #define NFSX_V3FSINFO		48
169*6ca35587Sdholland #define NFSX_V3PATHCONF		24
170*6ca35587Sdholland 
171*6ca35587Sdholland /* specific to NFS Version 4 */
172*6ca35587Sdholland #define NFSX_V4VERF		8
173*6ca35587Sdholland #define NFSX_V4FH		128
174*6ca35587Sdholland #define NFSX_V4STATEID		16
175*6ca35587Sdholland 
176*6ca35587Sdholland /* variants for both versions */
177*6ca35587Sdholland #define NFSX_FH(v3)		((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
178*6ca35587Sdholland 					NFSX_V2FH)
179*6ca35587Sdholland #define NFSX_SRVFH(v3)		((v3) ? NFSX_V3FH : NFSX_V2FH)
180*6ca35587Sdholland #define	NFSX_FATTR(v3)		((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
181*6ca35587Sdholland #define NFSX_PREOPATTR(v3)	((v3) ? (7 * NFSX_UNSIGNED) : 0)
182*6ca35587Sdholland #define NFSX_POSTOPATTR(v3)	((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
183*6ca35587Sdholland #define NFSX_POSTOPORFATTR(v3)	((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
184*6ca35587Sdholland 					NFSX_V2FATTR)
185*6ca35587Sdholland #define NFSX_WCCDATA(v3)	((v3) ? NFSX_V3WCCDATA : 0)
186*6ca35587Sdholland #define NFSX_WCCORFATTR(v3)	((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
187*6ca35587Sdholland #define	NFSX_SATTR(v3)		((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
188*6ca35587Sdholland #define	NFSX_COOKIEVERF(v3)	((v3) ? NFSX_V3COOKIEVERF : 0)
189*6ca35587Sdholland #define	NFSX_WRITEVERF(v3)	((v3) ? NFSX_V3WRITEVERF : 0)
190*6ca35587Sdholland #define NFSX_READDIR(v3)	((v3) ? (5 * NFSX_UNSIGNED) : \
191*6ca35587Sdholland 					(2 * NFSX_UNSIGNED))
192*6ca35587Sdholland #define	NFSX_STATFS(v3)		((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
193*6ca35587Sdholland 
194*6ca35587Sdholland /* nfs rpc procedure numbers (before version mapping) */
195*6ca35587Sdholland #define	NFSPROC_NULL		0
196*6ca35587Sdholland #define	NFSPROC_GETATTR		1
197*6ca35587Sdholland #define	NFSPROC_SETATTR		2
198*6ca35587Sdholland #define	NFSPROC_LOOKUP		3
199*6ca35587Sdholland #define	NFSPROC_ACCESS		4
200*6ca35587Sdholland #define	NFSPROC_READLINK	5
201*6ca35587Sdholland #define	NFSPROC_READ		6
202*6ca35587Sdholland #define	NFSPROC_WRITE		7
203*6ca35587Sdholland #define	NFSPROC_CREATE		8
204*6ca35587Sdholland #define	NFSPROC_MKDIR		9
205*6ca35587Sdholland #define	NFSPROC_SYMLINK		10
206*6ca35587Sdholland #define	NFSPROC_MKNOD		11
207*6ca35587Sdholland #define	NFSPROC_REMOVE		12
208*6ca35587Sdholland #define	NFSPROC_RMDIR		13
209*6ca35587Sdholland #define	NFSPROC_RENAME		14
210*6ca35587Sdholland #define	NFSPROC_LINK		15
211*6ca35587Sdholland #define	NFSPROC_READDIR		16
212*6ca35587Sdholland #define	NFSPROC_READDIRPLUS	17
213*6ca35587Sdholland #define	NFSPROC_FSSTAT		18
214*6ca35587Sdholland #define	NFSPROC_FSINFO		19
215*6ca35587Sdholland #define	NFSPROC_PATHCONF	20
216*6ca35587Sdholland #define	NFSPROC_COMMIT		21
217*6ca35587Sdholland #define NFSPROC_NOOP		22
218*6ca35587Sdholland #define	NFS_NPROCS		23
219*6ca35587Sdholland 
220*6ca35587Sdholland /* Actual Version 2 procedure numbers */
221*6ca35587Sdholland #define	NFSV2PROC_NULL		0
222*6ca35587Sdholland #define	NFSV2PROC_GETATTR	1
223*6ca35587Sdholland #define	NFSV2PROC_SETATTR	2
224*6ca35587Sdholland #define	NFSV2PROC_NOOP		3
225*6ca35587Sdholland #define	NFSV2PROC_ROOT		NFSV2PROC_NOOP	/* Obsolete */
226*6ca35587Sdholland #define	NFSV2PROC_LOOKUP	4
227*6ca35587Sdholland #define	NFSV2PROC_READLINK	5
228*6ca35587Sdholland #define	NFSV2PROC_READ		6
229*6ca35587Sdholland #define	NFSV2PROC_WRITECACHE	NFSV2PROC_NOOP	/* Obsolete */
230*6ca35587Sdholland #define	NFSV2PROC_WRITE		8
231*6ca35587Sdholland #define	NFSV2PROC_CREATE	9
232*6ca35587Sdholland #define	NFSV2PROC_REMOVE	10
233*6ca35587Sdholland #define	NFSV2PROC_RENAME	11
234*6ca35587Sdholland #define	NFSV2PROC_LINK		12
235*6ca35587Sdholland #define	NFSV2PROC_SYMLINK	13
236*6ca35587Sdholland #define	NFSV2PROC_MKDIR		14
237*6ca35587Sdholland #define	NFSV2PROC_RMDIR		15
238*6ca35587Sdholland #define	NFSV2PROC_READDIR	16
239*6ca35587Sdholland #define	NFSV2PROC_STATFS	17
240*6ca35587Sdholland 
241*6ca35587Sdholland /* Version 4 procedure numbers */
242*6ca35587Sdholland #define NFSV4PROC_NULL         0
243*6ca35587Sdholland #define NFSV4PROC_COMPOUND     1
244*6ca35587Sdholland 
245*6ca35587Sdholland /* Version 4 operation numbers */
246*6ca35587Sdholland #define NFSV4OP_ACCESS		3
247*6ca35587Sdholland #define NFSV4OP_CLOSE		4
248*6ca35587Sdholland #define NFSV4OP_COMMIT		5
249*6ca35587Sdholland #define NFSV4OP_CREATE		6
250*6ca35587Sdholland #define NFSV4OP_DELEGPURGE	7
251*6ca35587Sdholland #define NFSV4OP_DELEGRETURN	8
252*6ca35587Sdholland #define NFSV4OP_GETATTR		9
253*6ca35587Sdholland #define NFSV4OP_GETFH		10
254*6ca35587Sdholland #define NFSV4OP_LINK		11
255*6ca35587Sdholland #define NFSV4OP_LOCK		12
256*6ca35587Sdholland #define NFSV4OP_LOCKT		13
257*6ca35587Sdholland #define NFSV4OP_LOCKU		14
258*6ca35587Sdholland #define NFSV4OP_LOOKUP		15
259*6ca35587Sdholland #define NFSV4OP_LOOKUPP		16
260*6ca35587Sdholland #define NFSV4OP_NVERIFY		17
261*6ca35587Sdholland #define NFSV4OP_OPEN		18
262*6ca35587Sdholland #define NFSV4OP_OPENATTR	19
263*6ca35587Sdholland #define NFSV4OP_OPEN_CONFIRM	20
264*6ca35587Sdholland #define NFSV4OP_OPEN_DOWNGRADE	21
265*6ca35587Sdholland #define NFSV4OP_PUTFH		22
266*6ca35587Sdholland #define NFSV4OP_PUTPUBFH	23
267*6ca35587Sdholland #define NFSV4OP_PUTROOTFH	24
268*6ca35587Sdholland #define NFSV4OP_READ		25
269*6ca35587Sdholland #define NFSV4OP_READDIR		26
270*6ca35587Sdholland #define NFSV4OP_READLINK	27
271*6ca35587Sdholland #define NFSV4OP_REMOVE		28
272*6ca35587Sdholland #define NFSV4OP_RENAME		29
273*6ca35587Sdholland #define NFSV4OP_RENEW		30
274*6ca35587Sdholland #define NFSV4OP_RESTOREFH	31
275*6ca35587Sdholland #define NFSV4OP_SAVEFH		32
276*6ca35587Sdholland #define NFSV4OP_SECINFO		33
277*6ca35587Sdholland #define NFSV4OP_SETATTR		34
278*6ca35587Sdholland #define NFSV4OP_SETCLIENTID	35
279*6ca35587Sdholland #define NFSV4OP_SETCLIENTID_CONFIRM 36
280*6ca35587Sdholland #define NFSV4OP_VERIFY		37
281*6ca35587Sdholland #define NFSV4OP_WRITE		38
282*6ca35587Sdholland 
283*6ca35587Sdholland /*
284*6ca35587Sdholland  * Constants used by the Version 3 protocol for various RPCs
285*6ca35587Sdholland  */
286*6ca35587Sdholland #define NFSV3SATTRTIME_DONTCHANGE	0
287*6ca35587Sdholland #define NFSV3SATTRTIME_TOSERVER		1
288*6ca35587Sdholland #define NFSV3SATTRTIME_TOCLIENT		2
289*6ca35587Sdholland 
290*6ca35587Sdholland #define NFSV3ACCESS_READ		0x01
291*6ca35587Sdholland #define NFSV3ACCESS_LOOKUP		0x02
292*6ca35587Sdholland #define NFSV3ACCESS_MODIFY		0x04
293*6ca35587Sdholland #define NFSV3ACCESS_EXTEND		0x08
294*6ca35587Sdholland #define NFSV3ACCESS_DELETE		0x10
295*6ca35587Sdholland #define NFSV3ACCESS_EXECUTE		0x20
296*6ca35587Sdholland 
297*6ca35587Sdholland #define NFSV3WRITE_UNSTABLE		0
298*6ca35587Sdholland #define NFSV3WRITE_DATASYNC		1
299*6ca35587Sdholland #define NFSV3WRITE_FILESYNC		2
300*6ca35587Sdholland 
301*6ca35587Sdholland #define NFSV3CREATE_UNCHECKED		0
302*6ca35587Sdholland #define NFSV3CREATE_GUARDED		1
303*6ca35587Sdholland #define NFSV3CREATE_EXCLUSIVE		2
304*6ca35587Sdholland 
305*6ca35587Sdholland #define NFSV3FSINFO_LINK		0x01
306*6ca35587Sdholland #define NFSV3FSINFO_SYMLINK		0x02
307*6ca35587Sdholland #define NFSV3FSINFO_HOMOGENEOUS		0x08
308*6ca35587Sdholland #define NFSV3FSINFO_CANSETTIME		0x10
309*6ca35587Sdholland 
310*6ca35587Sdholland /*
311*6ca35587Sdholland  * Constants used by the Version 4 protocol for various RPCs
312*6ca35587Sdholland  */
313*6ca35587Sdholland 
314*6ca35587Sdholland #define NFSV4ACCESS_READ		0x01
315*6ca35587Sdholland #define NFSV4ACCESS_LOOKUP		0x02
316*6ca35587Sdholland #define NFSV4ACCESS_MODIFY		0x04
317*6ca35587Sdholland #define NFSV4ACCESS_EXTEND		0x08
318*6ca35587Sdholland #define NFSV4ACCESS_DELETE		0x10
319*6ca35587Sdholland #define NFSV4ACCESS_EXECUTE		0x20
320*6ca35587Sdholland 
321*6ca35587Sdholland #define NFSV4OPENRES_MLOCK		0x01
322*6ca35587Sdholland #define NFSV4OPENRES_CONFIRM		0x02
323*6ca35587Sdholland 
324*6ca35587Sdholland #define NFSV4OPENSHARE_ACCESS_READ	0x01
325*6ca35587Sdholland #define NFSV4OPENSHARE_ACCESS_WRITE	0x02
326*6ca35587Sdholland #define NFSV4OPENSHARE_ACCESS_BOTH	0x03
327*6ca35587Sdholland #define NFSV4OPENSHARE_DENY_NONE	0x00
328*6ca35587Sdholland #define NFSV4OPENSHARE_DENY_READ	0x01
329*6ca35587Sdholland #define NFSV4OPENSHARE_DENY_WRITE	0x02
330*6ca35587Sdholland #define NFSV4OPENSHARE_DENY_BOTH	0x03
331*6ca35587Sdholland 
332*6ca35587Sdholland /* File types */
333*6ca35587Sdholland typedef enum {
334*6ca35587Sdholland 	NFNON=0,
335*6ca35587Sdholland 	NFREG=1,
336*6ca35587Sdholland 	NFDIR=2,
337*6ca35587Sdholland 	NFBLK=3,
338*6ca35587Sdholland 	NFCHR=4,
339*6ca35587Sdholland 	NFLNK=5,
340*6ca35587Sdholland 	NFSOCK=6,
341*6ca35587Sdholland 	NFFIFO=7,
342*6ca35587Sdholland 	NFATTRDIR = 8,
343*6ca35587Sdholland 	NFNAMEDATTR = 9,
344*6ca35587Sdholland 	NFBAD = 10,
345*6ca35587Sdholland } nfstype;
346*6ca35587Sdholland 
347*6ca35587Sdholland /* NFSv4 claim type */
348*6ca35587Sdholland typedef enum {
349*6ca35587Sdholland 	NCLNULL = 0,
350*6ca35587Sdholland 	NCLPREV = 1,
351*6ca35587Sdholland 	NCLDELEGCUR = 2,
352*6ca35587Sdholland 	NCLDELEGPREV = 3,
353*6ca35587Sdholland } nfsv4cltype;
354*6ca35587Sdholland 
355*6ca35587Sdholland /* Other NFSv4 types */
356*6ca35587Sdholland typedef enum {
357*6ca35587Sdholland 	NSHUNSTABLE = 0,
358*6ca35587Sdholland 	NSHDATASYNC = 1,
359*6ca35587Sdholland 	NSHFILESYNC = 2,
360*6ca35587Sdholland } nfsv4stablehow;
361*6ca35587Sdholland 
362*6ca35587Sdholland typedef enum { OTNOCREATE = 0, OTCREATE = 1 } nfsv4opentype;
363*6ca35587Sdholland typedef enum { CMUNCHECKED = 0, CMGUARDED = 1, CMEXCLUSIVE = 2 } nfsv4createmode;
364*6ca35587Sdholland typedef enum { THSERVERTIME = 0, THCLIENTTIME = 1 } nfsv4timehow;
365*6ca35587Sdholland typedef enum { ODNONE = 0, ODREAD = 1, ODWRITE = 2 } nfsv4opendelegtype;
366*6ca35587Sdholland 
367*6ca35587Sdholland /* Structs for common parts of the rpc's */
368*6ca35587Sdholland 
369*6ca35587Sdholland /*
370*6ca35587Sdholland  * File Handle (32 bytes for version 2), variable up to 64 for version 3.
371*6ca35587Sdholland  * File Handles of up to NFS_SMALLFH in size are stored directly in the
372*6ca35587Sdholland  * nfs node, whereas larger ones are malloc'd. (This never happens when
373*6ca35587Sdholland  * NFS_SMALLFH is set to 64.)
374*6ca35587Sdholland  * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
375*6ca35587Sdholland  */
376*6ca35587Sdholland #ifndef NFS_SMALLFH
377*6ca35587Sdholland #define NFS_SMALLFH	128
378*6ca35587Sdholland #endif
379*6ca35587Sdholland union nfsfh {
380*6ca35587Sdholland 	fhandle_t	fh_generic;
381*6ca35587Sdholland 	u_char		fh_bytes[NFS_SMALLFH];
382*6ca35587Sdholland };
383*6ca35587Sdholland typedef union nfsfh nfsfh_t;
384*6ca35587Sdholland 
385*6ca35587Sdholland struct nfsv2_time {
386*6ca35587Sdholland 	u_int32_t	nfsv2_sec;
387*6ca35587Sdholland 	u_int32_t	nfsv2_usec;
388*6ca35587Sdholland };
389*6ca35587Sdholland typedef struct nfsv2_time	nfstime2;
390*6ca35587Sdholland 
391*6ca35587Sdholland struct nfsv3_time {
392*6ca35587Sdholland 	u_int32_t	nfsv3_sec;
393*6ca35587Sdholland 	u_int32_t	nfsv3_nsec;
394*6ca35587Sdholland };
395*6ca35587Sdholland typedef struct nfsv3_time	nfstime3;
396*6ca35587Sdholland 
397*6ca35587Sdholland /*
398*6ca35587Sdholland  * Quads are defined as arrays of 2 longs to ensure dense packing for the
399*6ca35587Sdholland  * protocol and to facilitate xdr conversion.
400*6ca35587Sdholland  */
401*6ca35587Sdholland struct nfs_uquad {
402*6ca35587Sdholland 	u_int32_t	nfsuquad[2];
403*6ca35587Sdholland };
404*6ca35587Sdholland typedef	struct nfs_uquad	nfsuint64;
405*6ca35587Sdholland 
406*6ca35587Sdholland /*
407*6ca35587Sdholland  * Used to convert between two u_longs and a u_quad_t.
408*6ca35587Sdholland  */
409*6ca35587Sdholland union nfs_quadconvert {
410*6ca35587Sdholland 	u_int32_t	lval[2];
411*6ca35587Sdholland 	u_quad_t	qval;
412*6ca35587Sdholland };
413*6ca35587Sdholland typedef union nfs_quadconvert	nfsquad_t;
414*6ca35587Sdholland 
415*6ca35587Sdholland /*
416*6ca35587Sdholland  * NFS Version 3 special file number.
417*6ca35587Sdholland  */
418*6ca35587Sdholland struct nfsv3_spec {
419*6ca35587Sdholland 	u_int32_t	specdata1;
420*6ca35587Sdholland 	u_int32_t	specdata2;
421*6ca35587Sdholland };
422*6ca35587Sdholland typedef	struct nfsv3_spec	nfsv3spec;
423*6ca35587Sdholland 
424*6ca35587Sdholland /*
425*6ca35587Sdholland  * NFS Version 4 bitmap.
426*6ca35587Sdholland  */
427*6ca35587Sdholland struct nfsv4_bitmap {
428*6ca35587Sdholland 	uint32_t	bmlen;
429*6ca35587Sdholland 	uint32_t	*bmval;
430*6ca35587Sdholland };
431*6ca35587Sdholland typedef struct nfsv4_bitmap nfsv4bitmap;
432*6ca35587Sdholland 
433*6ca35587Sdholland struct nfsv4_changeinfo {
434*6ca35587Sdholland 	u_int		ciatomic;
435*6ca35587Sdholland 	uint64_t	cibefore;
436*6ca35587Sdholland 	uint64_t	ciafter;
437*6ca35587Sdholland };
438*6ca35587Sdholland typedef struct nfsv4_changeinfo nfsv4changeinfo;
439*6ca35587Sdholland 
440*6ca35587Sdholland /*
441*6ca35587Sdholland  * File attributes and setable attributes. These structures cover both
442*6ca35587Sdholland  * NFS version 2 and the version 3 protocol. Note that the union is only
443*6ca35587Sdholland  * used so that one pointer can refer to both variants. These structures
444*6ca35587Sdholland  * go out on the wire and must be densely packed, so no quad data types
445*6ca35587Sdholland  * are used. (all fields are longs or u_longs or structures of same)
446*6ca35587Sdholland  * NB: You can't do sizeof(struct nfs_fattr), you must use the
447*6ca35587Sdholland  *     NFSX_FATTR(v3) macro.
448*6ca35587Sdholland  */
449*6ca35587Sdholland struct nfs_fattr {
450*6ca35587Sdholland 	u_int32_t	fa_type;
451*6ca35587Sdholland 	u_int32_t	fa_mode;
452*6ca35587Sdholland 	u_int32_t	fa_nlink;
453*6ca35587Sdholland 	u_int32_t	fa_uid;
454*6ca35587Sdholland 	u_int32_t	fa_gid;
455*6ca35587Sdholland 	union {
456*6ca35587Sdholland 		struct {
457*6ca35587Sdholland 			u_int32_t	nfsv2fa_size;
458*6ca35587Sdholland 			u_int32_t	nfsv2fa_blocksize;
459*6ca35587Sdholland 			u_int32_t	nfsv2fa_rdev;
460*6ca35587Sdholland 			u_int32_t	nfsv2fa_blocks;
461*6ca35587Sdholland 			u_int32_t	nfsv2fa_fsid;
462*6ca35587Sdholland 			u_int32_t	nfsv2fa_fileid;
463*6ca35587Sdholland 			nfstime2	nfsv2fa_atime;
464*6ca35587Sdholland 			nfstime2	nfsv2fa_mtime;
465*6ca35587Sdholland 			nfstime2	nfsv2fa_ctime;
466*6ca35587Sdholland 		} fa_nfsv2;
467*6ca35587Sdholland 		struct {
468*6ca35587Sdholland 			nfsuint64	nfsv3fa_size;
469*6ca35587Sdholland 			nfsuint64	nfsv3fa_used;
470*6ca35587Sdholland 			nfsv3spec	nfsv3fa_rdev;
471*6ca35587Sdholland 			nfsuint64	nfsv3fa_fsid;
472*6ca35587Sdholland 			nfsuint64	nfsv3fa_fileid;
473*6ca35587Sdholland 			nfstime3	nfsv3fa_atime;
474*6ca35587Sdholland 			nfstime3	nfsv3fa_mtime;
475*6ca35587Sdholland 			nfstime3	nfsv3fa_ctime;
476*6ca35587Sdholland 		} fa_nfsv3;
477*6ca35587Sdholland 	} fa_un;
478*6ca35587Sdholland };
479*6ca35587Sdholland 
480*6ca35587Sdholland /* and some ugly defines for accessing union components */
481*6ca35587Sdholland #define	fa2_size		fa_un.fa_nfsv2.nfsv2fa_size
482*6ca35587Sdholland #define	fa2_blocksize		fa_un.fa_nfsv2.nfsv2fa_blocksize
483*6ca35587Sdholland #define	fa2_rdev		fa_un.fa_nfsv2.nfsv2fa_rdev
484*6ca35587Sdholland #define	fa2_blocks		fa_un.fa_nfsv2.nfsv2fa_blocks
485*6ca35587Sdholland #define	fa2_fsid		fa_un.fa_nfsv2.nfsv2fa_fsid
486*6ca35587Sdholland #define	fa2_fileid		fa_un.fa_nfsv2.nfsv2fa_fileid
487*6ca35587Sdholland #define	fa2_atime		fa_un.fa_nfsv2.nfsv2fa_atime
488*6ca35587Sdholland #define	fa2_mtime		fa_un.fa_nfsv2.nfsv2fa_mtime
489*6ca35587Sdholland #define	fa2_ctime		fa_un.fa_nfsv2.nfsv2fa_ctime
490*6ca35587Sdholland #define	fa3_size		fa_un.fa_nfsv3.nfsv3fa_size
491*6ca35587Sdholland #define	fa3_used		fa_un.fa_nfsv3.nfsv3fa_used
492*6ca35587Sdholland #define	fa3_rdev		fa_un.fa_nfsv3.nfsv3fa_rdev
493*6ca35587Sdholland #define	fa3_fsid		fa_un.fa_nfsv3.nfsv3fa_fsid
494*6ca35587Sdholland #define	fa3_fileid		fa_un.fa_nfsv3.nfsv3fa_fileid
495*6ca35587Sdholland #define	fa3_atime		fa_un.fa_nfsv3.nfsv3fa_atime
496*6ca35587Sdholland #define	fa3_mtime		fa_un.fa_nfsv3.nfsv3fa_mtime
497*6ca35587Sdholland #define	fa3_ctime		fa_un.fa_nfsv3.nfsv3fa_ctime
498*6ca35587Sdholland 
499*6ca35587Sdholland struct nfsv4_fattr {
500*6ca35587Sdholland 	u_int		fa4_valid;
501*6ca35587Sdholland 	nfstype		fa4_type;
502*6ca35587Sdholland 	off_t		fa4_size;
503*6ca35587Sdholland 	uint64_t	fa4_fsid_major;
504*6ca35587Sdholland 	uint64_t	fa4_fsid_minor;
505*6ca35587Sdholland 	uint64_t	fa4_fileid;
506*6ca35587Sdholland 	mode_t		fa4_mode;
507*6ca35587Sdholland 	nlink_t		fa4_nlink;
508*6ca35587Sdholland 	uid_t		fa4_uid;
509*6ca35587Sdholland 	gid_t		fa4_gid;
510*6ca35587Sdholland 	uint32_t	fa4_rdev_major;
511*6ca35587Sdholland 	uint32_t	fa4_rdev_minor;
512*6ca35587Sdholland 	struct timespec	fa4_atime;
513*6ca35587Sdholland 	struct timespec	fa4_btime;
514*6ca35587Sdholland 	struct timespec	fa4_ctime;
515*6ca35587Sdholland 	struct timespec	fa4_mtime;
516*6ca35587Sdholland 	uint64_t	fa4_maxread;
517*6ca35587Sdholland 	uint64_t	fa4_maxwrite;
518*6ca35587Sdholland 	uint64_t	fa4_ffree;
519*6ca35587Sdholland 	uint64_t	fa4_ftotal;
520*6ca35587Sdholland 	uint32_t	fa4_maxname;
521*6ca35587Sdholland 	uint64_t	fa4_savail;
522*6ca35587Sdholland 	uint64_t	fa4_sfree;
523*6ca35587Sdholland 	uint64_t	fa4_stotal;
524*6ca35587Sdholland 	uint64_t	fa4_changeid;
525*6ca35587Sdholland 	uint32_t	fa4_lease_time;
526*6ca35587Sdholland 	uint64_t	fa4_maxfilesize;
527*6ca35587Sdholland };
528*6ca35587Sdholland 
529*6ca35587Sdholland /* Flags for fa4_valid */
530*6ca35587Sdholland #define FA4V_SIZE	0x00000001
531*6ca35587Sdholland #define FA4V_FSID	0x00000002
532*6ca35587Sdholland #define FA4V_FILEID	0x00000004
533*6ca35587Sdholland #define FA4V_MODE	0x00000008
534*6ca35587Sdholland #define FA4V_NLINK	0x00000010
535*6ca35587Sdholland #define FA4V_UID	0x00000020
536*6ca35587Sdholland #define FA4V_GID	0x00000040
537*6ca35587Sdholland #define FA4V_RDEV	0x00000080
538*6ca35587Sdholland #define FA4V_ATIME	0x00000100
539*6ca35587Sdholland #define FA4V_BTIME	0x00000200
540*6ca35587Sdholland #define FA4V_CTIME	0x00000400
541*6ca35587Sdholland #define FA4V_MTIME	0x00000800
542*6ca35587Sdholland #define FA4V_MAXREAD	0x00001000
543*6ca35587Sdholland #define FA4V_MAXWRITE	0x00002000
544*6ca35587Sdholland #define FA4V_TYPE	0x00004000
545*6ca35587Sdholland #define FA4V_FFREE	0x00008000
546*6ca35587Sdholland #define FA4V_FTOTAL	0x00010000
547*6ca35587Sdholland #define FA4V_MAXNAME	0x00020000
548*6ca35587Sdholland #define FA4V_SAVAIL	0x00040000
549*6ca35587Sdholland #define FA4V_SFREE	0x00080000
550*6ca35587Sdholland #define FA4V_STOTAL	0x00100000
551*6ca35587Sdholland #define FA4V_CHANGEID	0x00200000
552*6ca35587Sdholland #define FA4V_LEASE_TIME	0x00400000
553*6ca35587Sdholland #define FA4V_MAXFILESIZE 0x00800000
554*6ca35587Sdholland #define FA4V_ACL	0x01000000
555*6ca35587Sdholland 
556*6ca35587Sdholland /* Offsets into bitmask */
557*6ca35587Sdholland #define FA4_SUPPORTED_ATTRS	0
558*6ca35587Sdholland #define FA4_TYPE		1
559*6ca35587Sdholland #define FA4_FH_EXPIRE_TYPE	2
560*6ca35587Sdholland #define FA4_CHANGE		3
561*6ca35587Sdholland #define FA4_SIZE		4
562*6ca35587Sdholland #define FA4_LINK_SUPPORT	5
563*6ca35587Sdholland #define FA4_SYMLINK_SUPPORT	6
564*6ca35587Sdholland #define FA4_NAMED_ATTR		7
565*6ca35587Sdholland #define FA4_FSID		8
566*6ca35587Sdholland #define FA4_UNIQUE_HANDLES	9
567*6ca35587Sdholland #define FA4_LEASE_TIME		10
568*6ca35587Sdholland #define FA4_RDATTR_ERROR	11
569*6ca35587Sdholland #define FA4_ACL			12
570*6ca35587Sdholland #define FA4_ACLSUPPORT		13
571*6ca35587Sdholland #define FA4_ARCHIVE		14
572*6ca35587Sdholland #define FA4_CANSETTIME		15
573*6ca35587Sdholland #define FA4_CASE_INSENSITIVE	16
574*6ca35587Sdholland #define FA4_CASE_PRESERVING	17
575*6ca35587Sdholland #define FA4_CHOWN_RESTRICTED	18
576*6ca35587Sdholland #define FA4_FILEHANDLE		19
577*6ca35587Sdholland #define FA4_FILEID		20
578*6ca35587Sdholland #define FA4_FILES_AVAIL		21
579*6ca35587Sdholland #define FA4_FILES_FREE		22
580*6ca35587Sdholland #define FA4_FILES_TOTAL		23
581*6ca35587Sdholland #define FA4_FS_LOCATIONS	24
582*6ca35587Sdholland #define FA4_HIDDEN		25
583*6ca35587Sdholland #define FA4_HOMOGENEOUS		26
584*6ca35587Sdholland #define FA4_MAXFILESIZE		27
585*6ca35587Sdholland #define FA4_MAXLINK		28
586*6ca35587Sdholland #define FA4_MAXNAME		29
587*6ca35587Sdholland #define FA4_MAXREAD		30
588*6ca35587Sdholland #define FA4_MAXWRITE		31
589*6ca35587Sdholland #define FA4_MIMETYPE		32
590*6ca35587Sdholland #define FA4_MODE		33
591*6ca35587Sdholland #define FA4_NO_TRUNC		34
592*6ca35587Sdholland #define FA4_NUMLINKS		35
593*6ca35587Sdholland #define FA4_OWNER		36
594*6ca35587Sdholland #define FA4_OWNER_GROUP		37
595*6ca35587Sdholland #define FA4_QUOTA_HARD		38
596*6ca35587Sdholland #define FA4_QUOTA_SOFT		39
597*6ca35587Sdholland #define FA4_QUOTA_USED		40
598*6ca35587Sdholland #define FA4_RAWDEV		41
599*6ca35587Sdholland #define FA4_SPACE_AVAIL		42
600*6ca35587Sdholland #define FA4_SPACE_FREE		43
601*6ca35587Sdholland #define FA4_SPACE_TOTAL		44
602*6ca35587Sdholland #define FA4_SPACE_USED		45
603*6ca35587Sdholland #define FA4_SYSTEM		46
604*6ca35587Sdholland #define FA4_TIME_ACCESS		47
605*6ca35587Sdholland #define FA4_TIME_ACCESS_SET	48
606*6ca35587Sdholland #define FA4_TIME_BACKUP		49
607*6ca35587Sdholland #define FA4_TIME_CREATE		50
608*6ca35587Sdholland #define FA4_TIME_DELTA		51
609*6ca35587Sdholland #define FA4_TIME_METADATA	52
610*6ca35587Sdholland #define FA4_TIME_MODIFY		53
611*6ca35587Sdholland #define FA4_TIME_MODIFY_SET	54
612*6ca35587Sdholland #define FA4_ATTR_MAX		55
613*6ca35587Sdholland 
614*6ca35587Sdholland /* Macros for v4 fattr manipulation */
615*6ca35587Sdholland #define FA4_SET(n, p)	((p)[(n)/32] |= (1 << ((n) % 32)))
616*6ca35587Sdholland #define FA4_CLR(n, p)	((p)[(n)/32] &= ~(1 << ((n) % 32)))
617*6ca35587Sdholland #define FA4_ISSET(n, p)	((p)[(n)/32] & (1 << ((n) % 32)))
618*6ca35587Sdholland #define FA4_ZERO(p)	bzero((p), 8)
619*6ca35587Sdholland #define FA4_SKIP(p)	((p) += 2)
620*6ca35587Sdholland 
621*6ca35587Sdholland struct nfsv2_sattr {
622*6ca35587Sdholland 	u_int32_t	sa_mode;
623*6ca35587Sdholland 	u_int32_t	sa_uid;
624*6ca35587Sdholland 	u_int32_t	sa_gid;
625*6ca35587Sdholland 	u_int32_t	sa_size;
626*6ca35587Sdholland 	nfstime2	sa_atime;
627*6ca35587Sdholland 	nfstime2	sa_mtime;
628*6ca35587Sdholland };
629*6ca35587Sdholland 
630*6ca35587Sdholland /*
631*6ca35587Sdholland  * NFS Version 3 sattr structure for the new node creation case.
632*6ca35587Sdholland  */
633*6ca35587Sdholland struct nfsv3_sattr {
634*6ca35587Sdholland 	u_int32_t	sa_modetrue;
635*6ca35587Sdholland 	u_int32_t	sa_mode;
636*6ca35587Sdholland 	u_int32_t	sa_uidfalse;
637*6ca35587Sdholland 	u_int32_t	sa_gidfalse;
638*6ca35587Sdholland 	u_int32_t	sa_sizefalse;
639*6ca35587Sdholland 	u_int32_t	sa_atimetype;
640*6ca35587Sdholland 	nfstime3	sa_atime;
641*6ca35587Sdholland 	u_int32_t	sa_mtimetype;
642*6ca35587Sdholland 	nfstime3	sa_mtime;
643*6ca35587Sdholland };
644*6ca35587Sdholland 
645*6ca35587Sdholland struct nfs_statfs {
646*6ca35587Sdholland 	union {
647*6ca35587Sdholland 		struct {
648*6ca35587Sdholland 			u_int32_t	nfsv2sf_tsize;
649*6ca35587Sdholland 			u_int32_t	nfsv2sf_bsize;
650*6ca35587Sdholland 			u_int32_t	nfsv2sf_blocks;
651*6ca35587Sdholland 			u_int32_t	nfsv2sf_bfree;
652*6ca35587Sdholland 			u_int32_t	nfsv2sf_bavail;
653*6ca35587Sdholland 		} sf_nfsv2;
654*6ca35587Sdholland 		struct {
655*6ca35587Sdholland 			nfsuint64	nfsv3sf_tbytes;
656*6ca35587Sdholland 			nfsuint64	nfsv3sf_fbytes;
657*6ca35587Sdholland 			nfsuint64	nfsv3sf_abytes;
658*6ca35587Sdholland 			nfsuint64	nfsv3sf_tfiles;
659*6ca35587Sdholland 			nfsuint64	nfsv3sf_ffiles;
660*6ca35587Sdholland 			nfsuint64	nfsv3sf_afiles;
661*6ca35587Sdholland 			u_int32_t	nfsv3sf_invarsec;
662*6ca35587Sdholland 		} sf_nfsv3;
663*6ca35587Sdholland 	} sf_un;
664*6ca35587Sdholland };
665*6ca35587Sdholland 
666*6ca35587Sdholland #define sf_tsize	sf_un.sf_nfsv2.nfsv2sf_tsize
667*6ca35587Sdholland #define sf_bsize	sf_un.sf_nfsv2.nfsv2sf_bsize
668*6ca35587Sdholland #define sf_blocks	sf_un.sf_nfsv2.nfsv2sf_blocks
669*6ca35587Sdholland #define sf_bfree	sf_un.sf_nfsv2.nfsv2sf_bfree
670*6ca35587Sdholland #define sf_bavail	sf_un.sf_nfsv2.nfsv2sf_bavail
671*6ca35587Sdholland #define sf_tbytes	sf_un.sf_nfsv3.nfsv3sf_tbytes
672*6ca35587Sdholland #define sf_fbytes	sf_un.sf_nfsv3.nfsv3sf_fbytes
673*6ca35587Sdholland #define sf_abytes	sf_un.sf_nfsv3.nfsv3sf_abytes
674*6ca35587Sdholland #define sf_tfiles	sf_un.sf_nfsv3.nfsv3sf_tfiles
675*6ca35587Sdholland #define sf_ffiles	sf_un.sf_nfsv3.nfsv3sf_ffiles
676*6ca35587Sdholland #define sf_afiles	sf_un.sf_nfsv3.nfsv3sf_afiles
677*6ca35587Sdholland #define sf_invarsec	sf_un.sf_nfsv3.nfsv3sf_invarsec
678*6ca35587Sdholland 
679*6ca35587Sdholland struct nfsv3_fsinfo {
680*6ca35587Sdholland 	u_int32_t	fs_rtmax;
681*6ca35587Sdholland 	u_int32_t	fs_rtpref;
682*6ca35587Sdholland 	u_int32_t	fs_rtmult;
683*6ca35587Sdholland 	u_int32_t	fs_wtmax;
684*6ca35587Sdholland 	u_int32_t	fs_wtpref;
685*6ca35587Sdholland 	u_int32_t	fs_wtmult;
686*6ca35587Sdholland 	u_int32_t	fs_dtpref;
687*6ca35587Sdholland 	nfsuint64	fs_maxfilesize;
688*6ca35587Sdholland 	nfstime3	fs_timedelta;
689*6ca35587Sdholland 	u_int32_t	fs_properties;
690*6ca35587Sdholland };
691*6ca35587Sdholland 
692*6ca35587Sdholland struct nfsv3_pathconf {
693*6ca35587Sdholland 	u_int32_t	pc_linkmax;
694*6ca35587Sdholland 	u_int32_t	pc_namemax;
695*6ca35587Sdholland 	u_int32_t	pc_notrunc;
696*6ca35587Sdholland 	u_int32_t	pc_chownrestricted;
697*6ca35587Sdholland 	u_int32_t	pc_caseinsensitive;
698*6ca35587Sdholland 	u_int32_t	pc_casepreserving;
699*6ca35587Sdholland };
700*6ca35587Sdholland 
701*6ca35587Sdholland #endif
702