nfsproto.h revision 1.10 1 1.10 agc /* $NetBSD: nfsproto.h,v 1.10 2003/08/07 16:33:57 agc Exp $ */
2 1.1 fvdl
3 1.1 fvdl /*
4 1.1 fvdl * Copyright (c) 1989, 1993
5 1.1 fvdl * The Regents of the University of California. All rights reserved.
6 1.1 fvdl *
7 1.1 fvdl * This code is derived from software contributed to Berkeley by
8 1.1 fvdl * Rick Macklem at The University of Guelph.
9 1.1 fvdl *
10 1.1 fvdl * Redistribution and use in source and binary forms, with or without
11 1.1 fvdl * modification, are permitted provided that the following conditions
12 1.1 fvdl * are met:
13 1.1 fvdl * 1. Redistributions of source code must retain the above copyright
14 1.1 fvdl * notice, this list of conditions and the following disclaimer.
15 1.1 fvdl * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 fvdl * notice, this list of conditions and the following disclaimer in the
17 1.1 fvdl * documentation and/or other materials provided with the distribution.
18 1.10 agc * 3. Neither the name of the University nor the names of its contributors
19 1.1 fvdl * may be used to endorse or promote products derived from this software
20 1.1 fvdl * without specific prior written permission.
21 1.1 fvdl *
22 1.1 fvdl * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.1 fvdl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.1 fvdl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.1 fvdl * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.1 fvdl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.1 fvdl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.1 fvdl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.1 fvdl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.1 fvdl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.1 fvdl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 fvdl * SUCH DAMAGE.
33 1.1 fvdl *
34 1.1 fvdl * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95
35 1.1 fvdl */
36 1.1 fvdl
37 1.1 fvdl #ifndef _NFS_NFSPROTO_H_
38 1.1 fvdl #define _NFS_NFSPROTO_H_
39 1.1 fvdl
40 1.1 fvdl
41 1.1 fvdl /*
42 1.1 fvdl * nfs definitions as per the Version 2 and 3 specs
43 1.1 fvdl */
44 1.1 fvdl
45 1.1 fvdl /*
46 1.1 fvdl * Constants as defined in the Sun NFS Version 2 and 3 specs.
47 1.1 fvdl * "NFS: Network File System Protocol Specification" RFC1094
48 1.1 fvdl * and in the "NFS: Network File System Version 3 Protocol
49 1.8 kleink * Specification" RFC1813.
50 1.1 fvdl */
51 1.1 fvdl
52 1.1 fvdl #define NFS_PORT 2049
53 1.1 fvdl #define NFS_PROG 100003
54 1.1 fvdl #define NFS_VER2 2
55 1.1 fvdl #define NFS_VER3 3
56 1.1 fvdl #define NFS_V2MAXDATA 8192
57 1.9 fvdl #define NFS_MAXDGRAMDATA 32768
58 1.9 fvdl #define NFS_MAXDATA MAXBSIZE
59 1.1 fvdl #define NFS_MAXPATHLEN 1024
60 1.1 fvdl #define NFS_MAXNAMLEN 255
61 1.1 fvdl #define NFS_MAXPKTHDR 404
62 1.1 fvdl #define NFS_MAXPACKET (NFS_MAXPKTHDR + NFS_MAXDATA)
63 1.1 fvdl #define NFS_MINPACKET 20
64 1.1 fvdl #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */
65 1.1 fvdl
66 1.1 fvdl /* Stat numbers for rpc returns (version 2 and 3) */
67 1.1 fvdl #define NFS_OK 0
68 1.1 fvdl #define NFSERR_PERM 1
69 1.1 fvdl #define NFSERR_NOENT 2
70 1.1 fvdl #define NFSERR_IO 5
71 1.1 fvdl #define NFSERR_NXIO 6
72 1.1 fvdl #define NFSERR_ACCES 13
73 1.1 fvdl #define NFSERR_EXIST 17
74 1.1 fvdl #define NFSERR_XDEV 18 /* Version 3 only */
75 1.1 fvdl #define NFSERR_NODEV 19
76 1.1 fvdl #define NFSERR_NOTDIR 20
77 1.1 fvdl #define NFSERR_ISDIR 21
78 1.1 fvdl #define NFSERR_INVAL 22 /* Version 3 only */
79 1.1 fvdl #define NFSERR_FBIG 27
80 1.1 fvdl #define NFSERR_NOSPC 28
81 1.1 fvdl #define NFSERR_ROFS 30
82 1.1 fvdl #define NFSERR_MLINK 31 /* Version 3 only */
83 1.1 fvdl #define NFSERR_NAMETOL 63
84 1.1 fvdl #define NFSERR_NOTEMPTY 66
85 1.1 fvdl #define NFSERR_DQUOT 69
86 1.1 fvdl #define NFSERR_STALE 70
87 1.1 fvdl #define NFSERR_REMOTE 71 /* Version 3 only */
88 1.1 fvdl #define NFSERR_WFLUSH 99 /* Version 2 only */
89 1.1 fvdl #define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */
90 1.1 fvdl #define NFSERR_NOT_SYNC 10002
91 1.1 fvdl #define NFSERR_BAD_COOKIE 10003
92 1.1 fvdl #define NFSERR_NOTSUPP 10004
93 1.1 fvdl #define NFSERR_TOOSMALL 10005
94 1.1 fvdl #define NFSERR_SERVERFAULT 10006
95 1.1 fvdl #define NFSERR_BADTYPE 10007
96 1.1 fvdl #define NFSERR_JUKEBOX 10008
97 1.1 fvdl #define NFSERR_TRYLATER NFSERR_JUKEBOX
98 1.1 fvdl #define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */
99 1.1 fvdl
100 1.1 fvdl #define NFSERR_RETVOID 0x20000000 /* Return void, not error */
101 1.1 fvdl #define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */
102 1.1 fvdl #define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */
103 1.1 fvdl
104 1.1 fvdl /* Sizes in bytes of various nfs rpc components */
105 1.1 fvdl #define NFSX_UNSIGNED 4
106 1.1 fvdl
107 1.1 fvdl /* specific to NFS Version 2 */
108 1.1 fvdl #define NFSX_V2FH 32
109 1.1 fvdl #define NFSX_V2FATTR 68
110 1.1 fvdl #define NFSX_V2SATTR 32
111 1.1 fvdl #define NFSX_V2COOKIE 4
112 1.1 fvdl #define NFSX_V2STATFS 20
113 1.1 fvdl
114 1.1 fvdl /* specific to NFS Version 3 */
115 1.1 fvdl #define NFSX_V3FH (sizeof (fhandle_t)) /* size this server uses */
116 1.1 fvdl #define NFSX_V3FHMAX 64 /* max. allowed by protocol */
117 1.1 fvdl #define NFSX_V3FATTR 84
118 1.1 fvdl #define NFSX_V3SATTR 60 /* max. all fields filled in */
119 1.1 fvdl #define NFSX_V3SRVSATTR (sizeof (struct nfsv3_sattr))
120 1.1 fvdl #define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED)
121 1.1 fvdl #define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
122 1.1 fvdl #define NFSX_V3COOKIEVERF 8
123 1.1 fvdl #define NFSX_V3WRITEVERF 8
124 1.1 fvdl #define NFSX_V3CREATEVERF 8
125 1.1 fvdl #define NFSX_V3STATFS 52
126 1.1 fvdl #define NFSX_V3FSINFO 48
127 1.1 fvdl #define NFSX_V3PATHCONF 24
128 1.1 fvdl
129 1.1 fvdl /* variants for both versions */
130 1.1 fvdl #define NFSX_FH(v3) ((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
131 1.1 fvdl NFSX_V2FH)
132 1.1 fvdl #define NFSX_SRVFH(v3) ((v3) ? NFSX_V3FH : NFSX_V2FH)
133 1.1 fvdl #define NFSX_FATTR(v3) ((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
134 1.1 fvdl #define NFSX_PREOPATTR(v3) ((v3) ? (7 * NFSX_UNSIGNED) : 0)
135 1.1 fvdl #define NFSX_POSTOPATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
136 1.1 fvdl #define NFSX_POSTOPORFATTR(v3) ((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
137 1.1 fvdl NFSX_V2FATTR)
138 1.1 fvdl #define NFSX_WCCDATA(v3) ((v3) ? NFSX_V3WCCDATA : 0)
139 1.1 fvdl #define NFSX_WCCORFATTR(v3) ((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
140 1.1 fvdl #define NFSX_SATTR(v3) ((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
141 1.1 fvdl #define NFSX_COOKIEVERF(v3) ((v3) ? NFSX_V3COOKIEVERF : 0)
142 1.1 fvdl #define NFSX_WRITEVERF(v3) ((v3) ? NFSX_V3WRITEVERF : 0)
143 1.1 fvdl #define NFSX_READDIR(v3) ((v3) ? (5 * NFSX_UNSIGNED) : \
144 1.1 fvdl (2 * NFSX_UNSIGNED))
145 1.1 fvdl #define NFSX_STATFS(v3) ((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
146 1.1 fvdl
147 1.1 fvdl /* nfs rpc procedure numbers (before version mapping) */
148 1.1 fvdl #define NFSPROC_NULL 0
149 1.1 fvdl #define NFSPROC_GETATTR 1
150 1.1 fvdl #define NFSPROC_SETATTR 2
151 1.1 fvdl #define NFSPROC_LOOKUP 3
152 1.1 fvdl #define NFSPROC_ACCESS 4
153 1.1 fvdl #define NFSPROC_READLINK 5
154 1.1 fvdl #define NFSPROC_READ 6
155 1.1 fvdl #define NFSPROC_WRITE 7
156 1.1 fvdl #define NFSPROC_CREATE 8
157 1.1 fvdl #define NFSPROC_MKDIR 9
158 1.1 fvdl #define NFSPROC_SYMLINK 10
159 1.1 fvdl #define NFSPROC_MKNOD 11
160 1.1 fvdl #define NFSPROC_REMOVE 12
161 1.1 fvdl #define NFSPROC_RMDIR 13
162 1.1 fvdl #define NFSPROC_RENAME 14
163 1.1 fvdl #define NFSPROC_LINK 15
164 1.1 fvdl #define NFSPROC_READDIR 16
165 1.1 fvdl #define NFSPROC_READDIRPLUS 17
166 1.1 fvdl #define NFSPROC_FSSTAT 18
167 1.1 fvdl #define NFSPROC_FSINFO 19
168 1.1 fvdl #define NFSPROC_PATHCONF 20
169 1.1 fvdl #define NFSPROC_COMMIT 21
170 1.1 fvdl
171 1.1 fvdl /* And leasing (nqnfs) procedure numbers (must be last) */
172 1.1 fvdl #define NQNFSPROC_GETLEASE 22
173 1.1 fvdl #define NQNFSPROC_VACATED 23
174 1.1 fvdl #define NQNFSPROC_EVICTED 24
175 1.1 fvdl
176 1.1 fvdl #define NFSPROC_NOOP 25
177 1.1 fvdl #define NFS_NPROCS 26
178 1.1 fvdl
179 1.1 fvdl /* Actual Version 2 procedure numbers */
180 1.1 fvdl #define NFSV2PROC_NULL 0
181 1.1 fvdl #define NFSV2PROC_GETATTR 1
182 1.1 fvdl #define NFSV2PROC_SETATTR 2
183 1.1 fvdl #define NFSV2PROC_NOOP 3
184 1.1 fvdl #define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */
185 1.1 fvdl #define NFSV2PROC_LOOKUP 4
186 1.1 fvdl #define NFSV2PROC_READLINK 5
187 1.1 fvdl #define NFSV2PROC_READ 6
188 1.1 fvdl #define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */
189 1.1 fvdl #define NFSV2PROC_WRITE 8
190 1.1 fvdl #define NFSV2PROC_CREATE 9
191 1.1 fvdl #define NFSV2PROC_REMOVE 10
192 1.1 fvdl #define NFSV2PROC_RENAME 11
193 1.1 fvdl #define NFSV2PROC_LINK 12
194 1.1 fvdl #define NFSV2PROC_SYMLINK 13
195 1.1 fvdl #define NFSV2PROC_MKDIR 14
196 1.1 fvdl #define NFSV2PROC_RMDIR 15
197 1.1 fvdl #define NFSV2PROC_READDIR 16
198 1.1 fvdl #define NFSV2PROC_STATFS 17
199 1.1 fvdl
200 1.1 fvdl /*
201 1.1 fvdl * Constants used by the Version 3 protocol for various RPCs
202 1.1 fvdl */
203 1.1 fvdl #define NFSV3SATTRTIME_DONTCHANGE 0
204 1.1 fvdl #define NFSV3SATTRTIME_TOSERVER 1
205 1.1 fvdl #define NFSV3SATTRTIME_TOCLIENT 2
206 1.1 fvdl
207 1.1 fvdl #define NFSV3ACCESS_READ 0x01
208 1.1 fvdl #define NFSV3ACCESS_LOOKUP 0x02
209 1.1 fvdl #define NFSV3ACCESS_MODIFY 0x04
210 1.1 fvdl #define NFSV3ACCESS_EXTEND 0x08
211 1.1 fvdl #define NFSV3ACCESS_DELETE 0x10
212 1.1 fvdl #define NFSV3ACCESS_EXECUTE 0x20
213 1.1 fvdl
214 1.1 fvdl #define NFSV3WRITE_UNSTABLE 0
215 1.1 fvdl #define NFSV3WRITE_DATASYNC 1
216 1.1 fvdl #define NFSV3WRITE_FILESYNC 2
217 1.1 fvdl
218 1.1 fvdl #define NFSV3CREATE_UNCHECKED 0
219 1.1 fvdl #define NFSV3CREATE_GUARDED 1
220 1.1 fvdl #define NFSV3CREATE_EXCLUSIVE 2
221 1.1 fvdl
222 1.1 fvdl #define NFSV3FSINFO_LINK 0x01
223 1.1 fvdl #define NFSV3FSINFO_SYMLINK 0x02
224 1.1 fvdl #define NFSV3FSINFO_HOMOGENEOUS 0x08
225 1.1 fvdl #define NFSV3FSINFO_CANSETTIME 0x10
226 1.1 fvdl
227 1.1 fvdl /* Conversion macros */
228 1.1 fvdl #define vtonfsv2_mode(t,m) \
229 1.1 fvdl txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
230 1.1 fvdl MAKEIMODE((t), (m)))
231 1.2 mycroft #define vtonfsv3_mode(m) txdr_unsigned((m) & ALLPERMS)
232 1.5 christos #define nfstov_mode(a) (fxdr_unsigned(u_int32_t, (a)) & ALLPERMS)
233 1.1 fvdl #define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))])
234 1.1 fvdl #define vtonfsv3_type(a) txdr_unsigned(nfsv3_type[((int32_t)(a))])
235 1.1 fvdl #define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
236 1.1 fvdl #define nfsv3tov_type(a) nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
237 1.1 fvdl
238 1.1 fvdl /* File types */
239 1.1 fvdl typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
240 1.1 fvdl NFSOCK=6, NFFIFO=7 } nfstype;
241 1.1 fvdl
242 1.1 fvdl /* Structs for common parts of the rpc's */
243 1.1 fvdl /*
244 1.1 fvdl * File Handle (32 bytes for version 2), variable up to 64 for version 3.
245 1.1 fvdl * File Handles of up to NFS_SMALLFH in size are stored directly in the
246 1.1 fvdl * nfs node, whereas larger ones are malloc'd. (This never happens when
247 1.1 fvdl * NFS_SMALLFH is set to 64.)
248 1.1 fvdl * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
249 1.1 fvdl */
250 1.1 fvdl #ifndef NFS_SMALLFH
251 1.7 fvdl #define NFS_SMALLFH 64
252 1.1 fvdl #endif
253 1.1 fvdl union nfsfh {
254 1.1 fvdl fhandle_t fh_generic;
255 1.1 fvdl u_char fh_bytes[NFS_SMALLFH];
256 1.1 fvdl };
257 1.1 fvdl typedef union nfsfh nfsfh_t;
258 1.1 fvdl
259 1.1 fvdl struct nfsv2_time {
260 1.1 fvdl u_int32_t nfsv2_sec;
261 1.1 fvdl u_int32_t nfsv2_usec;
262 1.1 fvdl };
263 1.1 fvdl typedef struct nfsv2_time nfstime2;
264 1.1 fvdl
265 1.1 fvdl struct nfsv3_time {
266 1.1 fvdl u_int32_t nfsv3_sec;
267 1.1 fvdl u_int32_t nfsv3_nsec;
268 1.1 fvdl };
269 1.1 fvdl typedef struct nfsv3_time nfstime3;
270 1.1 fvdl
271 1.1 fvdl /*
272 1.1 fvdl * Quads are defined as arrays of 2 longs to ensure dense packing for the
273 1.1 fvdl * protocol and to facilitate xdr conversion.
274 1.1 fvdl */
275 1.1 fvdl struct nfs_uquad {
276 1.1 fvdl u_int32_t nfsuquad[2];
277 1.1 fvdl };
278 1.1 fvdl typedef struct nfs_uquad nfsuint64;
279 1.1 fvdl
280 1.1 fvdl /*
281 1.1 fvdl * Used to convert between two u_longs and a u_quad_t.
282 1.1 fvdl */
283 1.1 fvdl union nfs_quadconvert {
284 1.1 fvdl u_int32_t lval[2];
285 1.1 fvdl u_quad_t qval;
286 1.1 fvdl };
287 1.1 fvdl typedef union nfs_quadconvert nfsquad_t;
288 1.1 fvdl
289 1.1 fvdl /*
290 1.1 fvdl * NFS Version 3 special file number.
291 1.1 fvdl */
292 1.1 fvdl struct nfsv3_spec {
293 1.1 fvdl u_int32_t specdata1;
294 1.1 fvdl u_int32_t specdata2;
295 1.1 fvdl };
296 1.1 fvdl typedef struct nfsv3_spec nfsv3spec;
297 1.1 fvdl
298 1.1 fvdl /*
299 1.1 fvdl * File attributes and setable attributes. These structures cover both
300 1.1 fvdl * NFS version 2 and the version 3 protocol. Note that the union is only
301 1.1 fvdl * used so that one pointer can refer to both variants. These structures
302 1.1 fvdl * go out on the wire and must be densely packed, so no quad data types
303 1.1 fvdl * are used. (all fields are longs or u_longs or structures of same)
304 1.1 fvdl * NB: You can't do sizeof(struct nfs_fattr), you must use the
305 1.1 fvdl * NFSX_FATTR(v3) macro.
306 1.1 fvdl */
307 1.1 fvdl struct nfs_fattr {
308 1.1 fvdl u_int32_t fa_type;
309 1.1 fvdl u_int32_t fa_mode;
310 1.1 fvdl u_int32_t fa_nlink;
311 1.1 fvdl u_int32_t fa_uid;
312 1.1 fvdl u_int32_t fa_gid;
313 1.1 fvdl union {
314 1.1 fvdl struct {
315 1.1 fvdl u_int32_t nfsv2fa_size;
316 1.1 fvdl u_int32_t nfsv2fa_blocksize;
317 1.1 fvdl u_int32_t nfsv2fa_rdev;
318 1.1 fvdl u_int32_t nfsv2fa_blocks;
319 1.1 fvdl u_int32_t nfsv2fa_fsid;
320 1.1 fvdl u_int32_t nfsv2fa_fileid;
321 1.1 fvdl nfstime2 nfsv2fa_atime;
322 1.1 fvdl nfstime2 nfsv2fa_mtime;
323 1.1 fvdl nfstime2 nfsv2fa_ctime;
324 1.1 fvdl } fa_nfsv2;
325 1.1 fvdl struct {
326 1.1 fvdl nfsuint64 nfsv3fa_size;
327 1.1 fvdl nfsuint64 nfsv3fa_used;
328 1.1 fvdl nfsv3spec nfsv3fa_rdev;
329 1.1 fvdl nfsuint64 nfsv3fa_fsid;
330 1.1 fvdl nfsuint64 nfsv3fa_fileid;
331 1.1 fvdl nfstime3 nfsv3fa_atime;
332 1.1 fvdl nfstime3 nfsv3fa_mtime;
333 1.1 fvdl nfstime3 nfsv3fa_ctime;
334 1.1 fvdl } fa_nfsv3;
335 1.1 fvdl } fa_un;
336 1.1 fvdl };
337 1.1 fvdl
338 1.1 fvdl /* and some ugly defines for accessing union components */
339 1.1 fvdl #define fa2_size fa_un.fa_nfsv2.nfsv2fa_size
340 1.1 fvdl #define fa2_blocksize fa_un.fa_nfsv2.nfsv2fa_blocksize
341 1.1 fvdl #define fa2_rdev fa_un.fa_nfsv2.nfsv2fa_rdev
342 1.1 fvdl #define fa2_blocks fa_un.fa_nfsv2.nfsv2fa_blocks
343 1.1 fvdl #define fa2_fsid fa_un.fa_nfsv2.nfsv2fa_fsid
344 1.1 fvdl #define fa2_fileid fa_un.fa_nfsv2.nfsv2fa_fileid
345 1.1 fvdl #define fa2_atime fa_un.fa_nfsv2.nfsv2fa_atime
346 1.1 fvdl #define fa2_mtime fa_un.fa_nfsv2.nfsv2fa_mtime
347 1.1 fvdl #define fa2_ctime fa_un.fa_nfsv2.nfsv2fa_ctime
348 1.1 fvdl #define fa3_size fa_un.fa_nfsv3.nfsv3fa_size
349 1.1 fvdl #define fa3_used fa_un.fa_nfsv3.nfsv3fa_used
350 1.1 fvdl #define fa3_rdev fa_un.fa_nfsv3.nfsv3fa_rdev
351 1.1 fvdl #define fa3_fsid fa_un.fa_nfsv3.nfsv3fa_fsid
352 1.1 fvdl #define fa3_fileid fa_un.fa_nfsv3.nfsv3fa_fileid
353 1.1 fvdl #define fa3_atime fa_un.fa_nfsv3.nfsv3fa_atime
354 1.1 fvdl #define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime
355 1.1 fvdl #define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime
356 1.1 fvdl
357 1.1 fvdl struct nfsv2_sattr {
358 1.1 fvdl u_int32_t sa_mode;
359 1.1 fvdl u_int32_t sa_uid;
360 1.1 fvdl u_int32_t sa_gid;
361 1.1 fvdl u_int32_t sa_size;
362 1.1 fvdl nfstime2 sa_atime;
363 1.1 fvdl nfstime2 sa_mtime;
364 1.1 fvdl };
365 1.1 fvdl
366 1.1 fvdl /*
367 1.1 fvdl * NFS Version 3 sattr structure for the new node creation case.
368 1.1 fvdl */
369 1.1 fvdl struct nfsv3_sattr {
370 1.1 fvdl u_int32_t sa_modetrue;
371 1.1 fvdl u_int32_t sa_mode;
372 1.1 fvdl u_int32_t sa_uidfalse;
373 1.1 fvdl u_int32_t sa_gidfalse;
374 1.1 fvdl u_int32_t sa_sizefalse;
375 1.1 fvdl u_int32_t sa_atimetype;
376 1.1 fvdl nfstime3 sa_atime;
377 1.1 fvdl u_int32_t sa_mtimetype;
378 1.1 fvdl nfstime3 sa_mtime;
379 1.1 fvdl };
380 1.1 fvdl
381 1.1 fvdl struct nfs_statfs {
382 1.1 fvdl union {
383 1.1 fvdl struct {
384 1.1 fvdl u_int32_t nfsv2sf_tsize;
385 1.1 fvdl u_int32_t nfsv2sf_bsize;
386 1.1 fvdl u_int32_t nfsv2sf_blocks;
387 1.1 fvdl u_int32_t nfsv2sf_bfree;
388 1.1 fvdl u_int32_t nfsv2sf_bavail;
389 1.1 fvdl } sf_nfsv2;
390 1.1 fvdl struct {
391 1.1 fvdl nfsuint64 nfsv3sf_tbytes;
392 1.1 fvdl nfsuint64 nfsv3sf_fbytes;
393 1.1 fvdl nfsuint64 nfsv3sf_abytes;
394 1.1 fvdl nfsuint64 nfsv3sf_tfiles;
395 1.1 fvdl nfsuint64 nfsv3sf_ffiles;
396 1.1 fvdl nfsuint64 nfsv3sf_afiles;
397 1.1 fvdl u_int32_t nfsv3sf_invarsec;
398 1.1 fvdl } sf_nfsv3;
399 1.1 fvdl } sf_un;
400 1.1 fvdl };
401 1.1 fvdl
402 1.1 fvdl #define sf_tsize sf_un.sf_nfsv2.nfsv2sf_tsize
403 1.1 fvdl #define sf_bsize sf_un.sf_nfsv2.nfsv2sf_bsize
404 1.1 fvdl #define sf_blocks sf_un.sf_nfsv2.nfsv2sf_blocks
405 1.1 fvdl #define sf_bfree sf_un.sf_nfsv2.nfsv2sf_bfree
406 1.1 fvdl #define sf_bavail sf_un.sf_nfsv2.nfsv2sf_bavail
407 1.1 fvdl #define sf_tbytes sf_un.sf_nfsv3.nfsv3sf_tbytes
408 1.1 fvdl #define sf_fbytes sf_un.sf_nfsv3.nfsv3sf_fbytes
409 1.1 fvdl #define sf_abytes sf_un.sf_nfsv3.nfsv3sf_abytes
410 1.1 fvdl #define sf_tfiles sf_un.sf_nfsv3.nfsv3sf_tfiles
411 1.1 fvdl #define sf_ffiles sf_un.sf_nfsv3.nfsv3sf_ffiles
412 1.1 fvdl #define sf_afiles sf_un.sf_nfsv3.nfsv3sf_afiles
413 1.1 fvdl #define sf_invarsec sf_un.sf_nfsv3.nfsv3sf_invarsec
414 1.1 fvdl
415 1.1 fvdl struct nfsv3_fsinfo {
416 1.1 fvdl u_int32_t fs_rtmax;
417 1.1 fvdl u_int32_t fs_rtpref;
418 1.1 fvdl u_int32_t fs_rtmult;
419 1.1 fvdl u_int32_t fs_wtmax;
420 1.1 fvdl u_int32_t fs_wtpref;
421 1.1 fvdl u_int32_t fs_wtmult;
422 1.1 fvdl u_int32_t fs_dtpref;
423 1.1 fvdl nfsuint64 fs_maxfilesize;
424 1.1 fvdl nfstime3 fs_timedelta;
425 1.1 fvdl u_int32_t fs_properties;
426 1.1 fvdl };
427 1.1 fvdl
428 1.1 fvdl struct nfsv3_pathconf {
429 1.1 fvdl u_int32_t pc_linkmax;
430 1.1 fvdl u_int32_t pc_namemax;
431 1.1 fvdl u_int32_t pc_notrunc;
432 1.1 fvdl u_int32_t pc_chownrestricted;
433 1.1 fvdl u_int32_t pc_caseinsensitive;
434 1.1 fvdl u_int32_t pc_casepreserving;
435 1.1 fvdl };
436 1.1 fvdl
437 1.1 fvdl #endif
438