]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Copyright (c) 2000-2010 Apple Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * This file contains Original Code and/or Modifications of Original Code | |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
14 | * | |
15 | * Please obtain a copy of the License at | |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
17 | * | |
18 | * The Original Code and all software distributed under the License are | |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
25 | * | |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ | |
27 | */ | |
28 | /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */ | |
29 | /* | |
30 | * Copyright (c) 1989, 1993 | |
31 | * The Regents of the University of California. All rights reserved. | |
32 | * | |
33 | * This code is derived from software contributed to Berkeley by | |
34 | * Rick Macklem at The University of Guelph. | |
35 | * | |
36 | * Redistribution and use in source and binary forms, with or without | |
37 | * modification, are permitted provided that the following conditions | |
38 | * are met: | |
39 | * 1. Redistributions of source code must retain the above copyright | |
40 | * notice, this list of conditions and the following disclaimer. | |
41 | * 2. Redistributions in binary form must reproduce the above copyright | |
42 | * notice, this list of conditions and the following disclaimer in the | |
43 | * documentation and/or other materials provided with the distribution. | |
44 | * 3. All advertising materials mentioning features or use of this software | |
45 | * must display the following acknowledgement: | |
46 | * This product includes software developed by the University of | |
47 | * California, Berkeley and its contributors. | |
48 | * 4. Neither the name of the University nor the names of its contributors | |
49 | * may be used to endorse or promote products derived from this software | |
50 | * without specific prior written permission. | |
51 | * | |
52 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
53 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
55 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
58 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
59 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
60 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
61 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
62 | * SUCH DAMAGE. | |
63 | * | |
64 | * @(#)nfsproto.h 8.2 (Berkeley) 3/30/95 | |
65 | * FreeBSD-Id: nfsproto.h,v 1.3 1997/02/22 09:42:50 peter Exp $ | |
66 | */ | |
67 | ||
68 | #ifndef _NFS_NFSPROTO_H_ | |
69 | #define _NFS_NFSPROTO_H_ | |
70 | ||
71 | #include <sys/appleapiopts.h> | |
72 | ||
73 | #ifdef __APPLE_API_PRIVATE | |
74 | ||
75 | /* | |
76 | * NFS definitions per the various NFS protocol specs: | |
77 | * Version 2 (RFC 1094), Version 3 (RFC 1813), and Version 4 (RFC 3530) | |
78 | * and various protocol-related implementation definitions. | |
79 | */ | |
80 | ||
81 | /* Only define these if nfs_prot.h hasn't been included */ | |
82 | #ifndef NFS_PROGRAM | |
83 | ||
84 | #define NFS_PORT 2049 | |
85 | #define NFS_PROG 100003 | |
86 | #define NFS_VER2 2 | |
87 | #define NFS_VER3 3 | |
88 | #define NFS_VER4 4 | |
89 | #define NFS_V2MAXDATA 8192 | |
90 | #define NFS_MAXDGRAMDATA 16384 | |
91 | #define NFS_PREFDGRAMDATA 8192 | |
92 | #define NFS_MAXDATA (64*1024) // XXX not ready for >64K | |
93 | #define NFSRV_MAXDATA (64*1024) // XXX not ready for >64K | |
94 | #define NFS_MAXPATHLEN 1024 | |
95 | #define NFS_MAXNAMLEN 255 | |
96 | #define NFS_MAXPACKET (16*1024*1024) | |
97 | #define NFS_UDPSOCKBUF (224*1024) | |
98 | #define NFS_FABLKSIZE 512 /* Size in bytes of a block wrt fa_blocks */ | |
99 | ||
100 | #define NFS4_CALLBACK_PROG 0x4E465343 /* "NFSC" */ | |
101 | #define NFS4_CALLBACK_PROG_VERSION 1 | |
102 | ||
103 | /* Stat numbers for NFS RPC returns */ | |
104 | #define NFS_OK 0 | |
105 | #define NFSERR_PERM 1 | |
106 | #define NFSERR_NOENT 2 | |
107 | #define NFSERR_IO 5 | |
108 | #define NFSERR_NXIO 6 | |
109 | #define NFSERR_ACCES 13 | |
110 | #define NFSERR_EXIST 17 | |
111 | #define NFSERR_XDEV 18 /* Version 3 only */ | |
112 | #define NFSERR_NODEV 19 | |
113 | #define NFSERR_NOTDIR 20 | |
114 | #define NFSERR_ISDIR 21 | |
115 | #define NFSERR_INVAL 22 /* Version 3 only */ | |
116 | #define NFSERR_FBIG 27 | |
117 | #define NFSERR_NOSPC 28 | |
118 | #define NFSERR_ROFS 30 | |
119 | #define NFSERR_MLINK 31 /* Version 3 only */ | |
120 | #define NFSERR_NAMETOL 63 | |
121 | #define NFSERR_NOTEMPTY 66 | |
122 | #define NFSERR_DQUOT 69 | |
123 | #define NFSERR_STALE 70 | |
124 | #define NFSERR_REMOTE 71 /* Version 3 only */ | |
125 | #define NFSERR_WFLUSH 99 /* Version 2 only */ | |
126 | #define NFSERR_BADHANDLE 10001 /* The rest Version 3 only */ | |
127 | #define NFSERR_NOT_SYNC 10002 | |
128 | #define NFSERR_BAD_COOKIE 10003 | |
129 | #define NFSERR_NOTSUPP 10004 | |
130 | #define NFSERR_TOOSMALL 10005 | |
131 | #define NFSERR_SERVERFAULT 10006 | |
132 | #define NFSERR_BADTYPE 10007 | |
133 | #define NFSERR_JUKEBOX 10008 | |
134 | #define NFSERR_TRYLATER NFSERR_JUKEBOX | |
135 | #define NFSERR_DELAY NFSERR_JUKEBOX | |
136 | #define NFSERR_SAME 10009 /* The rest Version 4 only */ | |
137 | #define NFSERR_DENIED 10010 | |
138 | #define NFSERR_EXPIRED 10011 | |
139 | #define NFSERR_LOCKED 10012 | |
140 | #define NFSERR_GRACE 10013 | |
141 | #define NFSERR_FHEXPIRED 10014 | |
142 | #define NFSERR_SHARE_DENIED 10015 | |
143 | #define NFSERR_WRONGSEC 10016 | |
144 | #define NFSERR_CLID_INUSE 10017 | |
145 | #define NFSERR_RESOURCE 10018 | |
146 | #define NFSERR_MOVED 10019 | |
147 | #define NFSERR_NOFILEHANDLE 10020 | |
148 | #define NFSERR_MINOR_VERS_MISMATCH 10021 | |
149 | #define NFSERR_STALE_CLIENTID 10022 | |
150 | #define NFSERR_STALE_STATEID 10023 | |
151 | #define NFSERR_OLD_STATEID 10024 | |
152 | #define NFSERR_BAD_STATEID 10025 | |
153 | #define NFSERR_BAD_SEQID 10026 | |
154 | #define NFSERR_NOT_SAME 10027 | |
155 | #define NFSERR_LOCK_RANGE 10028 | |
156 | #define NFSERR_SYMLINK 10029 | |
157 | #define NFSERR_RESTOREFH 10030 | |
158 | #define NFSERR_LEASE_MOVED 10031 | |
159 | #define NFSERR_ATTRNOTSUPP 10032 | |
160 | #define NFSERR_NO_GRACE 10033 | |
161 | #define NFSERR_RECLAIM_BAD 10034 | |
162 | #define NFSERR_RECLAIM_CONFLICT 10035 | |
163 | #define NFSERR_BADXDR 10036 | |
164 | #define NFSERR_LOCKS_HELD 10037 | |
165 | #define NFSERR_OPENMODE 10038 | |
166 | #define NFSERR_BADOWNER 10039 | |
167 | #define NFSERR_BADCHAR 10040 | |
168 | #define NFSERR_BADNAME 10041 | |
169 | #define NFSERR_BAD_RANGE 10042 | |
170 | #define NFSERR_LOCK_NOTSUPP 10043 | |
171 | #define NFSERR_OP_ILLEGAL 10044 | |
172 | #define NFSERR_DEADLOCK 10045 | |
173 | #define NFSERR_FILE_OPEN 10046 | |
174 | #define NFSERR_ADMIN_REVOKED 10047 | |
175 | #define NFSERR_CB_PATH_DOWN 10048 | |
176 | ||
177 | #define NFSERR_STALEWRITEVERF 30001 /* Fake return for nfs_commit() */ | |
178 | #define NFSERR_DIRBUFDROPPED 30002 /* Fake return for nfs*_readdir_rpc() */ | |
179 | ||
180 | /* | |
181 | * For gss we would like to return EAUTH when we don't have or can't get credentials, | |
182 | * but some callers don't know what to do with it, so we define our own version | |
183 | * of EAUTH to be EACCES | |
184 | */ | |
185 | #define NFSERR_EAUTH EACCES | |
186 | ||
187 | #define NFSERR_RETVOID 0x20000000 /* Return void, not error */ | |
188 | #define NFSERR_AUTHERR 0x40000000 /* Mark an authentication error */ | |
189 | #define NFSERR_RETERR 0x80000000 /* Mark an error return for V3 */ | |
190 | ||
191 | #endif /* !NFS_PROGRAM */ | |
192 | ||
193 | /* Sizes in bytes of various nfs rpc components */ | |
194 | #define NFSX_UNSIGNED 4 | |
195 | ||
196 | /* specific to NFS Version 2 */ | |
197 | #define NFSX_V2FH 32 | |
198 | #define NFSX_V2FATTR 68 | |
199 | #define NFSX_V2SATTR 32 | |
200 | #define NFSX_V2COOKIE 4 | |
201 | #define NFSX_V2STATFS 20 | |
202 | ||
203 | /* specific to NFS Version 3 */ | |
204 | #define NFSX_V3FHMAX 64 /* max. allowed by protocol */ | |
205 | #define NFSX_V3FATTR 84 | |
206 | #define NFSX_V3SATTR 60 /* max. all fields filled in */ | |
207 | #define NFSX_V3POSTOPATTR (NFSX_V3FATTR + NFSX_UNSIGNED) | |
208 | #define NFSX_V3WCCDATA (NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED) | |
209 | #define NFSX_V3COOKIEVERF 8 | |
210 | #define NFSX_V3WRITEVERF 8 | |
211 | #define NFSX_V3CREATEVERF 8 | |
212 | #define NFSX_V3STATFS 52 | |
213 | #define NFSX_V3FSINFO 48 | |
214 | #define NFSX_V3PATHCONF 24 | |
215 | ||
216 | /* specific to NFS Version 4 */ | |
217 | #define NFS4_FHSIZE 128 | |
218 | #define NFS4_VERIFIER_SIZE 8 | |
219 | #define NFS4_OPAQUE_LIMIT 1024 | |
220 | ||
221 | /* variants for multiple versions */ | |
222 | #define NFSX_FH(V) (((V) == NFS_VER2) ? NFSX_V2FH : (NFSX_UNSIGNED + \ | |
223 | (((V) == NFS_VER3) ? NFSX_V3FHMAX : NFS4_FHSIZE))) | |
224 | #define NFSX_SRVFH(V,FH) (((V) == NFS_VER2) ? NFSX_V2FH : (FH)->nfh_len) | |
225 | #define NFSX_FATTR(V) (((V) == NFS_VER3) ? NFSX_V3FATTR : NFSX_V2FATTR) | |
226 | #define NFSX_PREOPATTR(V) (((V) == NFS_VER3) ? (7 * NFSX_UNSIGNED) : 0) | |
227 | #define NFSX_POSTOPATTR(V) (((V) == NFS_VER3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0) | |
228 | #define NFSX_POSTOPORFATTR(V) (((V) == NFS_VER3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : NFSX_V2FATTR) | |
229 | #define NFSX_WCCDATA(V) (((V) == NFS_VER3) ? NFSX_V3WCCDATA : 0) | |
230 | #define NFSX_WCCORFATTR(V) (((V) == NFS_VER3) ? NFSX_V3WCCDATA : NFSX_V2FATTR) | |
231 | #define NFSX_SATTR(V) (((V) == NFS_VER3) ? NFSX_V3SATTR : NFSX_V2SATTR) | |
232 | #define NFSX_COOKIEVERF(V) (((V) == NFS_VER3) ? NFSX_V3COOKIEVERF : 0) | |
233 | #define NFSX_WRITEVERF(V) (((V) == NFS_VER3) ? NFSX_V3WRITEVERF : 0) | |
234 | #define NFSX_READDIR(V) (((V) == NFS_VER3) ? (5 * NFSX_UNSIGNED) : \ | |
235 | (2 * NFSX_UNSIGNED)) | |
236 | #define NFSX_STATFS(V) (((V) == NFS_VER3) ? NFSX_V3STATFS : NFSX_V2STATFS) | |
237 | ||
238 | /* Only define these if nfs_prot.h hasn't been included */ | |
239 | #ifndef NFS_PROGRAM | |
240 | ||
241 | /* nfs rpc procedure numbers (before version mapping) */ | |
242 | #define NFSPROC_NULL 0 | |
243 | #define NFSPROC_GETATTR 1 | |
244 | #define NFSPROC_SETATTR 2 | |
245 | #define NFSPROC_LOOKUP 3 | |
246 | #define NFSPROC_ACCESS 4 | |
247 | #define NFSPROC_READLINK 5 | |
248 | #define NFSPROC_READ 6 | |
249 | #define NFSPROC_WRITE 7 | |
250 | #define NFSPROC_CREATE 8 | |
251 | #define NFSPROC_MKDIR 9 | |
252 | #define NFSPROC_SYMLINK 10 | |
253 | #define NFSPROC_MKNOD 11 | |
254 | #define NFSPROC_REMOVE 12 | |
255 | #define NFSPROC_RMDIR 13 | |
256 | #define NFSPROC_RENAME 14 | |
257 | #define NFSPROC_LINK 15 | |
258 | #define NFSPROC_READDIR 16 | |
259 | #define NFSPROC_READDIRPLUS 17 | |
260 | #define NFSPROC_FSSTAT 18 | |
261 | #define NFSPROC_FSINFO 19 | |
262 | #define NFSPROC_PATHCONF 20 | |
263 | #define NFSPROC_COMMIT 21 | |
264 | ||
265 | #endif /* !NFS_PROGRAM */ | |
266 | ||
267 | #define NFSPROC_NOOP 22 | |
268 | #define NFS_NPROCS 23 | |
269 | ||
270 | /* Actual Version 2 procedure numbers */ | |
271 | #define NFSV2PROC_NULL 0 | |
272 | #define NFSV2PROC_GETATTR 1 | |
273 | #define NFSV2PROC_SETATTR 2 | |
274 | #define NFSV2PROC_NOOP 3 | |
275 | #define NFSV2PROC_ROOT NFSV2PROC_NOOP /* Obsolete */ | |
276 | #define NFSV2PROC_LOOKUP 4 | |
277 | #define NFSV2PROC_READLINK 5 | |
278 | #define NFSV2PROC_READ 6 | |
279 | #define NFSV2PROC_WRITECACHE NFSV2PROC_NOOP /* Obsolete */ | |
280 | #define NFSV2PROC_WRITE 8 | |
281 | #define NFSV2PROC_CREATE 9 | |
282 | #define NFSV2PROC_REMOVE 10 | |
283 | #define NFSV2PROC_RENAME 11 | |
284 | #define NFSV2PROC_LINK 12 | |
285 | #define NFSV2PROC_SYMLINK 13 | |
286 | #define NFSV2PROC_MKDIR 14 | |
287 | #define NFSV2PROC_RMDIR 15 | |
288 | #define NFSV2PROC_READDIR 16 | |
289 | #define NFSV2PROC_STATFS 17 | |
290 | ||
291 | /* | |
292 | * Constants used by the Version 3 protocol for various RPCs | |
293 | */ | |
294 | ||
295 | #define NFSV3FSINFO_LINK 0x01 | |
296 | #define NFSV3FSINFO_SYMLINK 0x02 | |
297 | #define NFSV3FSINFO_HOMOGENEOUS 0x08 | |
298 | #define NFSV3FSINFO_CANSETTIME 0x10 | |
299 | ||
300 | /* time setting constants */ | |
301 | #define NFS_TIME_DONT_CHANGE 0 | |
302 | #define NFS_TIME_SET_TO_SERVER 1 | |
303 | #define NFS_TIME_SET_TO_CLIENT 2 | |
304 | #define NFS4_TIME_SET_TO_SERVER 0 | |
305 | #define NFS4_TIME_SET_TO_CLIENT 1 | |
306 | ||
307 | /* access() constants */ | |
308 | #define NFS_ACCESS_READ 0x01 | |
309 | #define NFS_ACCESS_LOOKUP 0x02 | |
310 | #define NFS_ACCESS_MODIFY 0x04 | |
311 | #define NFS_ACCESS_EXTEND 0x08 | |
312 | #define NFS_ACCESS_DELETE 0x10 | |
313 | #define NFS_ACCESS_EXECUTE 0x20 | |
314 | #define NFS_ACCESS_ALL (NFS_ACCESS_READ | NFS_ACCESS_MODIFY \ | |
315 | | NFS_ACCESS_EXTEND | NFS_ACCESS_EXECUTE \ | |
316 | | NFS_ACCESS_DELETE | NFS_ACCESS_LOOKUP) | |
317 | ||
318 | /* NFS WRITE how constants */ | |
319 | #define NFS_WRITE_UNSTABLE 0 | |
320 | #define NFS_WRITE_DATASYNC 1 | |
321 | #define NFS_WRITE_FILESYNC 2 | |
322 | ||
323 | /* NFS CREATE types */ | |
324 | #define NFS_CREATE_UNCHECKED 0 | |
325 | #define NFS_CREATE_GUARDED 1 | |
326 | #define NFS_CREATE_EXCLUSIVE 2 | |
327 | ||
328 | /* Only define these if nfs_prot.h hasn't been included */ | |
329 | #ifndef NFS_PROGRAM | |
330 | /* NFS object types */ | |
331 | typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5, | |
332 | NFSOCK=6, NFFIFO=7, NFATTRDIR=8, NFNAMEDATTR=9 } nfstype; | |
333 | #endif /* !NFS_PROGRAM */ | |
334 | ||
335 | /* | |
336 | * File Handle (32 bytes for version 2), variable up to 64 for version 3 | |
337 | * and variable up to 128 bytes for version 4. | |
338 | * File Handles of up to NFS_SMALLFH in size are stored directly in the | |
339 | * nfs node, whereas larger ones are malloc'd. (This never happens when | |
340 | * NFS_SMALLFH is set to the largest size.) | |
341 | * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4. | |
342 | */ | |
343 | #ifndef NFS_SMALLFH | |
344 | #define NFS_SMALLFH 64 | |
345 | #endif | |
346 | ||
347 | /* | |
348 | * NFS attribute management stuff | |
349 | */ | |
350 | #define NFS_ATTR_BITMAP_LEN 2 | |
351 | #define NFS_BITMAP_SET(B, I) (((uint32_t *)(B))[(I)/32] |= 1<<((I)%32)) | |
352 | #define NFS_BITMAP_CLR(B, I) (((uint32_t *)(B))[(I)/32] &= ~(1<<((I)%32))) | |
353 | #define NFS_BITMAP_ISSET(B, I) (((uint32_t *)(B))[(I)/32] & (1<<((I)%32))) | |
354 | #define NFS_BITMAP_ZERO(B, L) \ | |
355 | do { \ | |
356 | int __i; \ | |
357 | for (__i=0; __i < (L); __i++) \ | |
358 | ((uint32_t*)(B))[__i] = 0; \ | |
359 | } while (0) | |
360 | ||
361 | __private_extern__ uint32_t nfs_fs_attr_bitmap[NFS_ATTR_BITMAP_LEN]; | |
362 | __private_extern__ uint32_t nfs_object_attr_bitmap[NFS_ATTR_BITMAP_LEN]; | |
363 | __private_extern__ uint32_t nfs_getattr_bitmap[NFS_ATTR_BITMAP_LEN]; | |
364 | ||
365 | #define NFS_CLEAR_ATTRIBUTES(A) NFS_BITMAP_ZERO((A), NFS_ATTR_BITMAP_LEN) | |
366 | #define NFS_COPY_ATTRIBUTES(SRC, DST) \ | |
367 | do { \ | |
368 | int __i; \ | |
369 | for (__i=0; __i < NFS_ATTR_BITMAP_LEN; __i++) \ | |
370 | ((uint32_t*)(DST))[__i] = ((uint32_t*)(SRC))[__i]; \ | |
371 | } while (0) | |
372 | ||
373 | /* NFS attributes */ | |
374 | #define NFS_FATTR_SUPPORTED_ATTRS 0 | |
375 | #define NFS_FATTR_TYPE 1 | |
376 | #define NFS_FATTR_FH_EXPIRE_TYPE 2 | |
377 | #define NFS_FATTR_CHANGE 3 | |
378 | #define NFS_FATTR_SIZE 4 | |
379 | #define NFS_FATTR_LINK_SUPPORT 5 | |
380 | #define NFS_FATTR_SYMLINK_SUPPORT 6 | |
381 | #define NFS_FATTR_NAMED_ATTR 7 | |
382 | #define NFS_FATTR_FSID 8 | |
383 | #define NFS_FATTR_UNIQUE_HANDLES 9 | |
384 | #define NFS_FATTR_LEASE_TIME 10 | |
385 | #define NFS_FATTR_RDATTR_ERROR 11 | |
386 | #define NFS_FATTR_FILEHANDLE 19 | |
387 | #define NFS_FATTR_ACL 12 | |
388 | #define NFS_FATTR_ACLSUPPORT 13 | |
389 | #define NFS_FATTR_ARCHIVE 14 | |
390 | #define NFS_FATTR_CANSETTIME 15 | |
391 | #define NFS_FATTR_CASE_INSENSITIVE 16 | |
392 | #define NFS_FATTR_CASE_PRESERVING 17 | |
393 | #define NFS_FATTR_CHOWN_RESTRICTED 18 | |
394 | #define NFS_FATTR_FILEID 20 | |
395 | #define NFS_FATTR_FILES_AVAIL 21 | |
396 | #define NFS_FATTR_FILES_FREE 22 | |
397 | #define NFS_FATTR_FILES_TOTAL 23 | |
398 | #define NFS_FATTR_FS_LOCATIONS 24 | |
399 | #define NFS_FATTR_HIDDEN 25 | |
400 | #define NFS_FATTR_HOMOGENEOUS 26 | |
401 | #define NFS_FATTR_MAXFILESIZE 27 | |
402 | #define NFS_FATTR_MAXLINK 28 | |
403 | #define NFS_FATTR_MAXNAME 29 | |
404 | #define NFS_FATTR_MAXREAD 30 | |
405 | #define NFS_FATTR_MAXWRITE 31 | |
406 | #define NFS_FATTR_MIMETYPE 32 | |
407 | #define NFS_FATTR_MODE 33 | |
408 | #define NFS_FATTR_NO_TRUNC 34 | |
409 | #define NFS_FATTR_NUMLINKS 35 | |
410 | #define NFS_FATTR_OWNER 36 | |
411 | #define NFS_FATTR_OWNER_GROUP 37 | |
412 | #define NFS_FATTR_QUOTA_AVAIL_HARD 38 | |
413 | #define NFS_FATTR_QUOTA_AVAIL_SOFT 39 | |
414 | #define NFS_FATTR_QUOTA_USED 40 | |
415 | #define NFS_FATTR_RAWDEV 41 | |
416 | #define NFS_FATTR_SPACE_AVAIL 42 | |
417 | #define NFS_FATTR_SPACE_FREE 43 | |
418 | #define NFS_FATTR_SPACE_TOTAL 44 | |
419 | #define NFS_FATTR_SPACE_USED 45 | |
420 | #define NFS_FATTR_SYSTEM 46 | |
421 | #define NFS_FATTR_TIME_ACCESS 47 | |
422 | #define NFS_FATTR_TIME_ACCESS_SET 48 | |
423 | #define NFS_FATTR_TIME_BACKUP 49 | |
424 | #define NFS_FATTR_TIME_CREATE 50 | |
425 | #define NFS_FATTR_TIME_DELTA 51 | |
426 | #define NFS_FATTR_TIME_METADATA 52 | |
427 | #define NFS_FATTR_TIME_MODIFY 53 | |
428 | #define NFS_FATTR_TIME_MODIFY_SET 54 | |
429 | #define NFS_FATTR_MOUNTED_ON_FILEID 55 | |
430 | ||
431 | #define NFS4_ALL_ATTRIBUTES(A) \ | |
432 | do { \ | |
433 | /* required: */ \ | |
434 | NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \ | |
435 | NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \ | |
436 | NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \ | |
437 | NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \ | |
438 | NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \ | |
439 | NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \ | |
440 | NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \ | |
441 | NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \ | |
442 | NFS_BITMAP_SET((A), NFS_FATTR_FSID); \ | |
443 | NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \ | |
444 | NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \ | |
445 | NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); \ | |
446 | NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); \ | |
447 | /* optional: */ \ | |
448 | NFS_BITMAP_SET((A), NFS_FATTR_ACL); \ | |
449 | NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \ | |
450 | NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \ | |
451 | NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); \ | |
452 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \ | |
453 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \ | |
454 | NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \ | |
455 | NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \ | |
456 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \ | |
457 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \ | |
458 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \ | |
459 | NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); \ | |
460 | NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \ | |
461 | NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \ | |
462 | NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \ | |
463 | NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \ | |
464 | NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \ | |
465 | NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \ | |
466 | NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \ | |
467 | NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); \ | |
468 | NFS_BITMAP_SET((A), NFS_FATTR_MODE); \ | |
469 | NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \ | |
470 | NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \ | |
471 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \ | |
472 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \ | |
473 | NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_HARD); \ | |
474 | NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_SOFT); \ | |
475 | NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_USED); \ | |
476 | NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \ | |
477 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \ | |
478 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \ | |
479 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \ | |
480 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \ | |
481 | NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); \ | |
482 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \ | |
483 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS_SET); \ | |
484 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \ | |
485 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \ | |
486 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); \ | |
487 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \ | |
488 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \ | |
489 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY_SET); \ | |
490 | NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \ | |
491 | } while (0) | |
492 | ||
493 | #define NFS4_PER_OBJECT_ATTRIBUTES(A) \ | |
494 | do { \ | |
495 | /* required: */ \ | |
496 | NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \ | |
497 | NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \ | |
498 | NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \ | |
499 | NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \ | |
500 | NFS_BITMAP_SET((A), NFS_FATTR_FSID); \ | |
501 | NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); \ | |
502 | NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); \ | |
503 | /* optional: */ \ | |
504 | NFS_BITMAP_SET((A), NFS_FATTR_ACL); \ | |
505 | NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \ | |
506 | NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \ | |
507 | NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \ | |
508 | NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \ | |
509 | NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); \ | |
510 | NFS_BITMAP_SET((A), NFS_FATTR_MODE); \ | |
511 | NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \ | |
512 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \ | |
513 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \ | |
514 | NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \ | |
515 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \ | |
516 | NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); \ | |
517 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \ | |
518 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \ | |
519 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \ | |
520 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \ | |
521 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \ | |
522 | NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \ | |
523 | } while (0) | |
524 | ||
525 | #define NFS4_PER_FS_ATTRIBUTES(A) \ | |
526 | do { \ | |
527 | /* required: */ \ | |
528 | NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \ | |
529 | NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \ | |
530 | NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \ | |
531 | NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \ | |
532 | NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \ | |
533 | NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \ | |
534 | /* optional: */ \ | |
535 | NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \ | |
536 | NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); \ | |
537 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \ | |
538 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \ | |
539 | NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \ | |
540 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \ | |
541 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \ | |
542 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \ | |
543 | NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); \ | |
544 | NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \ | |
545 | NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \ | |
546 | NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \ | |
547 | NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \ | |
548 | NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \ | |
549 | NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \ | |
550 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \ | |
551 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \ | |
552 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \ | |
553 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); \ | |
554 | } while (0) | |
555 | ||
556 | #define NFS4_DEFAULT_ATTRIBUTES(A) \ | |
557 | do { \ | |
558 | /* required: */ \ | |
559 | NFS_BITMAP_SET((A), NFS_FATTR_SUPPORTED_ATTRS); \ | |
560 | NFS_BITMAP_SET((A), NFS_FATTR_TYPE); \ | |
561 | NFS_BITMAP_SET((A), NFS_FATTR_FH_EXPIRE_TYPE); \ | |
562 | NFS_BITMAP_SET((A), NFS_FATTR_CHANGE); \ | |
563 | NFS_BITMAP_SET((A), NFS_FATTR_SIZE); \ | |
564 | NFS_BITMAP_SET((A), NFS_FATTR_LINK_SUPPORT); \ | |
565 | NFS_BITMAP_SET((A), NFS_FATTR_SYMLINK_SUPPORT); \ | |
566 | NFS_BITMAP_SET((A), NFS_FATTR_NAMED_ATTR); \ | |
567 | NFS_BITMAP_SET((A), NFS_FATTR_FSID); \ | |
568 | NFS_BITMAP_SET((A), NFS_FATTR_UNIQUE_HANDLES); \ | |
569 | NFS_BITMAP_SET((A), NFS_FATTR_LEASE_TIME); \ | |
570 | /* NFS_BITMAP_SET((A), NFS_FATTR_RDATTR_ERROR); */ \ | |
571 | /* NFS_BITMAP_SET((A), NFS_FATTR_FILEHANDLE); */ \ | |
572 | /* optional: */ \ | |
573 | /* NFS_BITMAP_SET((A), NFS_FATTR_ACL); */ \ | |
574 | NFS_BITMAP_SET((A), NFS_FATTR_ACLSUPPORT); \ | |
575 | NFS_BITMAP_SET((A), NFS_FATTR_ARCHIVE); \ | |
576 | /* NFS_BITMAP_SET((A), NFS_FATTR_CANSETTIME); */ \ | |
577 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_INSENSITIVE); \ | |
578 | NFS_BITMAP_SET((A), NFS_FATTR_CASE_PRESERVING); \ | |
579 | NFS_BITMAP_SET((A), NFS_FATTR_CHOWN_RESTRICTED); \ | |
580 | NFS_BITMAP_SET((A), NFS_FATTR_FILEID); \ | |
581 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \ | |
582 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \ | |
583 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \ | |
584 | /* NFS_BITMAP_SET((A), NFS_FATTR_FS_LOCATIONS); */ \ | |
585 | NFS_BITMAP_SET((A), NFS_FATTR_HIDDEN); \ | |
586 | NFS_BITMAP_SET((A), NFS_FATTR_HOMOGENEOUS); \ | |
587 | NFS_BITMAP_SET((A), NFS_FATTR_MAXFILESIZE); \ | |
588 | NFS_BITMAP_SET((A), NFS_FATTR_MAXLINK); \ | |
589 | NFS_BITMAP_SET((A), NFS_FATTR_MAXNAME); \ | |
590 | NFS_BITMAP_SET((A), NFS_FATTR_MAXREAD); \ | |
591 | NFS_BITMAP_SET((A), NFS_FATTR_MAXWRITE); \ | |
592 | /* NFS_BITMAP_SET((A), NFS_FATTR_MIMETYPE); */ \ | |
593 | NFS_BITMAP_SET((A), NFS_FATTR_MODE); \ | |
594 | NFS_BITMAP_SET((A), NFS_FATTR_NO_TRUNC); \ | |
595 | NFS_BITMAP_SET((A), NFS_FATTR_NUMLINKS); \ | |
596 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER); \ | |
597 | NFS_BITMAP_SET((A), NFS_FATTR_OWNER_GROUP); \ | |
598 | /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_HARD); */ \ | |
599 | /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_AVAIL_SOFT); */ \ | |
600 | /* NFS_BITMAP_SET((A), NFS_FATTR_QUOTA_USED); */ \ | |
601 | NFS_BITMAP_SET((A), NFS_FATTR_RAWDEV); \ | |
602 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \ | |
603 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \ | |
604 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \ | |
605 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_USED); \ | |
606 | /* NFS_BITMAP_SET((A), NFS_FATTR_SYSTEM); */ \ | |
607 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS); \ | |
608 | /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_ACCESS_SET); */ \ | |
609 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_BACKUP); \ | |
610 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_CREATE); \ | |
611 | /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_DELTA); */ \ | |
612 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_METADATA); \ | |
613 | NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY); \ | |
614 | /* NFS_BITMAP_SET((A), NFS_FATTR_TIME_MODIFY_SET); */ \ | |
615 | NFS_BITMAP_SET((A), NFS_FATTR_MOUNTED_ON_FILEID); \ | |
616 | } while (0) | |
617 | ||
618 | /* attributes requested when we want to do a "statfs" */ | |
619 | #define NFS4_STATFS_ATTRIBUTES(A) \ | |
620 | do { \ | |
621 | /* optional: */ \ | |
622 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_AVAIL); \ | |
623 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_FREE); \ | |
624 | NFS_BITMAP_SET((A), NFS_FATTR_FILES_TOTAL); \ | |
625 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_AVAIL); \ | |
626 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_FREE); \ | |
627 | NFS_BITMAP_SET((A), NFS_FATTR_SPACE_TOTAL); \ | |
628 | } while (0) | |
629 | ||
630 | /* | |
631 | * NFS OPEN constants | |
632 | */ | |
633 | /* open type */ | |
634 | #define NFS_OPEN_NOCREATE 0 | |
635 | #define NFS_OPEN_CREATE 1 | |
636 | /* delegation space limit */ | |
637 | #define NFS_LIMIT_SIZE 1 | |
638 | #define NFS_LIMIT_BLOCKS 2 | |
639 | /* access/deny modes */ | |
640 | #define NFS_OPEN_SHARE_ACCESS_NONE 0x00000000 | |
641 | #define NFS_OPEN_SHARE_ACCESS_READ 0x00000001 | |
642 | #define NFS_OPEN_SHARE_ACCESS_WRITE 0x00000002 | |
643 | #define NFS_OPEN_SHARE_ACCESS_BOTH 0x00000003 | |
644 | #define NFS_OPEN_SHARE_DENY_NONE 0x00000000 | |
645 | #define NFS_OPEN_SHARE_DENY_READ 0x00000001 | |
646 | #define NFS_OPEN_SHARE_DENY_WRITE 0x00000002 | |
647 | #define NFS_OPEN_SHARE_DENY_BOTH 0x00000003 | |
648 | /* delegation types */ | |
649 | #define NFS_OPEN_DELEGATE_NONE 0 | |
650 | #define NFS_OPEN_DELEGATE_READ 1 | |
651 | #define NFS_OPEN_DELEGATE_WRITE 2 | |
652 | /* delegation claim types */ | |
653 | #define NFS_CLAIM_NULL 0 | |
654 | #define NFS_CLAIM_PREVIOUS 1 | |
655 | #define NFS_CLAIM_DELEGATE_CUR 2 | |
656 | #define NFS_CLAIM_DELEGATE_PREV 3 | |
657 | /* open result flags */ | |
658 | #define NFS_OPEN_RESULT_CONFIRM 0x00000002 | |
659 | #define NFS_OPEN_RESULT_LOCKTYPE_POSIX 0x00000004 | |
660 | /* NFS lock types */ | |
661 | #define NFS_LOCK_TYPE_READ 1 | |
662 | #define NFS_LOCK_TYPE_WRITE 2 | |
663 | #define NFS_LOCK_TYPE_READW 3 /* "blocking" */ | |
664 | #define NFS_LOCK_TYPE_WRITEW 4 /* "blocking" */ | |
665 | ||
666 | /* NFSv4 RPC procedures */ | |
667 | #define NFSPROC4_NULL 0 | |
668 | #define NFSPROC4_COMPOUND 1 | |
669 | #define NFSPROC4_CB_NULL 0 | |
670 | #define NFSPROC4_CB_COMPOUND 1 | |
671 | ||
672 | /* NFSv4 opcodes */ | |
673 | #define NFS_OP_ACCESS 3 | |
674 | #define NFS_OP_CLOSE 4 | |
675 | #define NFS_OP_COMMIT 5 | |
676 | #define NFS_OP_CREATE 6 | |
677 | #define NFS_OP_DELEGPURGE 7 | |
678 | #define NFS_OP_DELEGRETURN 8 | |
679 | #define NFS_OP_GETATTR 9 | |
680 | #define NFS_OP_GETFH 10 | |
681 | #define NFS_OP_LINK 11 | |
682 | #define NFS_OP_LOCK 12 | |
683 | #define NFS_OP_LOCKT 13 | |
684 | #define NFS_OP_LOCKU 14 | |
685 | #define NFS_OP_LOOKUP 15 | |
686 | #define NFS_OP_LOOKUPP 16 | |
687 | #define NFS_OP_NVERIFY 17 | |
688 | #define NFS_OP_OPEN 18 | |
689 | #define NFS_OP_OPENATTR 19 | |
690 | #define NFS_OP_OPEN_CONFIRM 20 | |
691 | #define NFS_OP_OPEN_DOWNGRADE 21 | |
692 | #define NFS_OP_PUTFH 22 | |
693 | #define NFS_OP_PUTPUBFH 23 | |
694 | #define NFS_OP_PUTROOTFH 24 | |
695 | #define NFS_OP_READ 25 | |
696 | #define NFS_OP_READDIR 26 | |
697 | #define NFS_OP_READLINK 27 | |
698 | #define NFS_OP_REMOVE 28 | |
699 | #define NFS_OP_RENAME 29 | |
700 | #define NFS_OP_RENEW 30 | |
701 | #define NFS_OP_RESTOREFH 31 | |
702 | #define NFS_OP_SAVEFH 32 | |
703 | #define NFS_OP_SECINFO 33 | |
704 | #define NFS_OP_SETATTR 34 | |
705 | #define NFS_OP_SETCLIENTID 35 | |
706 | #define NFS_OP_SETCLIENTID_CONFIRM 36 | |
707 | #define NFS_OP_VERIFY 37 | |
708 | #define NFS_OP_WRITE 38 | |
709 | #define NFS_OP_RELEASE_LOCKOWNER 39 | |
710 | #define NFS_OP_ILLEGAL 10044 | |
711 | /* NFSv4 callback opcodes */ | |
712 | #define NFS_OP_CB_GETATTR 3 | |
713 | #define NFS_OP_CB_RECALL 4 | |
714 | #define NFS_OP_CB_ILLEGAL 10044 | |
715 | ||
716 | /* NFSv4 file handle type flags */ | |
717 | #define NFS_FH_PERSISTENT 0x00000000 | |
718 | #define NFS_FH_NOEXPIRE_WITH_OPEN 0x00000001 | |
719 | #define NFS_FH_VOLATILE_ANY 0x00000002 | |
720 | #define NFS_FH_VOL_MIGRATION 0x00000004 | |
721 | #define NFS_FH_VOL_RENAME 0x00000008 | |
722 | ||
723 | /* | |
724 | * NFSv4 ACL constants | |
725 | */ | |
726 | /* ACE support mask bits */ | |
727 | #define NFS_ACL_SUPPORT_ALLOW_ACL 0x00000001 | |
728 | #define NFS_ACL_SUPPORT_DENY_ACL 0x00000002 | |
729 | #define NFS_ACL_SUPPORT_AUDIT_ACL 0x00000004 | |
730 | #define NFS_ACL_SUPPORT_ALARM_ACL 0x00000008 | |
731 | /* ACE types */ | |
732 | #define NFS_ACE_ACCESS_ALLOWED_ACE_TYPE 0x00000000 | |
733 | #define NFS_ACE_ACCESS_DENIED_ACE_TYPE 0x00000001 | |
734 | #define NFS_ACE_SYSTEM_AUDIT_ACE_TYPE 0x00000002 | |
735 | #define NFS_ACE_SYSTEM_ALARM_ACE_TYPE 0x00000003 | |
736 | /* ACE flags */ | |
737 | #define NFS_ACE_FILE_INHERIT_ACE 0x00000001 | |
738 | #define NFS_ACE_DIRECTORY_INHERIT_ACE 0x00000002 | |
739 | #define NFS_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004 | |
740 | #define NFS_ACE_INHERIT_ONLY_ACE 0x00000008 | |
741 | #define NFS_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010 | |
742 | #define NFS_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020 | |
743 | #define NFS_ACE_IDENTIFIER_GROUP 0x00000040 | |
744 | #define NFS_ACE_INHERITED_ACE 0x00000080 | |
745 | /* ACE mask flags */ | |
746 | #define NFS_ACE_READ_DATA 0x00000001 | |
747 | #define NFS_ACE_LIST_DIRECTORY 0x00000001 | |
748 | #define NFS_ACE_WRITE_DATA 0x00000002 | |
749 | #define NFS_ACE_ADD_FILE 0x00000002 | |
750 | #define NFS_ACE_APPEND_DATA 0x00000004 | |
751 | #define NFS_ACE_ADD_SUBDIRECTORY 0x00000004 | |
752 | #define NFS_ACE_READ_NAMED_ATTRS 0x00000008 | |
753 | #define NFS_ACE_WRITE_NAMED_ATTRS 0x00000010 | |
754 | #define NFS_ACE_EXECUTE 0x00000020 | |
755 | #define NFS_ACE_DELETE_CHILD 0x00000040 | |
756 | #define NFS_ACE_READ_ATTRIBUTES 0x00000080 | |
757 | #define NFS_ACE_WRITE_ATTRIBUTES 0x00000100 | |
758 | #define NFS_ACE_DELETE 0x00010000 | |
759 | #define NFS_ACE_READ_ACL 0x00020000 | |
760 | #define NFS_ACE_WRITE_ACL 0x00040000 | |
761 | #define NFS_ACE_WRITE_OWNER 0x00080000 | |
762 | #define NFS_ACE_SYNCHRONIZE 0x00100000 | |
763 | #define NFS_ACE_GENERIC_READ 0x00120081 | |
764 | #define NFS_ACE_GENERIC_WRITE 0x00160106 | |
765 | #define NFS_ACE_GENERIC_EXECUTE 0x001200A0 | |
766 | ||
767 | ||
768 | /* | |
769 | * Quads are defined as arrays of 2 32-bit values to ensure dense packing | |
770 | * for the protocol and to facilitate xdr conversion. | |
771 | */ | |
772 | struct nfs_uquad { | |
773 | u_int32_t nfsuquad[2]; | |
774 | }; | |
775 | typedef struct nfs_uquad nfsuint64; | |
776 | ||
777 | /* | |
778 | * Used to convert between two u_int32_ts and a u_quad_t. | |
779 | */ | |
780 | union nfs_quadconvert { | |
781 | u_int32_t lval[2]; | |
782 | u_quad_t qval; | |
783 | }; | |
784 | typedef union nfs_quadconvert nfsquad_t; | |
785 | ||
786 | /* | |
787 | * special data/attribute associated with NFBLK/NFCHR | |
788 | */ | |
789 | struct nfs_specdata { | |
790 | uint32_t specdata1; /* major device number */ | |
791 | uint32_t specdata2; /* minor device number */ | |
792 | }; | |
793 | typedef struct nfs_specdata nfs_specdata; | |
794 | ||
795 | /* | |
796 | * an "fsid" large enough to hold an NFSv4 fsid. | |
797 | */ | |
798 | struct nfs_fsid { | |
799 | uint64_t major; | |
800 | uint64_t minor; | |
801 | }; | |
802 | typedef struct nfs_fsid nfs_fsid; | |
803 | ||
804 | /* | |
805 | * NFSv4 stateid structure | |
806 | */ | |
807 | struct nfs_stateid { | |
808 | uint32_t seqid; | |
809 | uint32_t other[3]; | |
810 | }; | |
811 | typedef struct nfs_stateid nfs_stateid; | |
812 | ||
813 | #endif /* __APPLE_API_PRIVATE */ | |
814 | #endif /* _NFS_NFSPROTO_H_ */ |