xref: /illumos-gate/usr/src/uts/common/nfs/nfs4_kprot.h (revision a86602b15b9c56eb076e48653db3cf239babfec8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
24  * Copyright 2020-2025 RackTop Systems, Inc.
25  */
26 
27 /*
28  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
29  * Use is subject to license terms.
30  */
31 
32 #ifndef _NFS4_KPROT_H
33 #define	_NFS4_KPROT_H
34 
35 /*
36  * Kernel specific version.
37  * NFS Version 4 protocol definitions.  From nfs4_prot.x RFC 5662
38  */
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
44 #include <rpc/rpc.h>
45 #ifdef _KERNEL
46 #include <rpc/rpc_rdma.h>
47 #endif
48 #include <sys/stream.h>
49 
50 #include <rpc/auth_sys.h>
51 typedef struct authsys_parms authsys_parms;
52 
53 #define	NFS4_FHSIZE 128
54 #define	NFS4_VERIFIER_SIZE 8
55 #define	NFS4_OTHER_SIZE 12
56 
57 /*
58  * Reasonable upper bounds to catch badly behaving partners
59  */
60 #define	NFS4_OPAQUE_LIMIT	1024
61 #define	NFS4_COMPOUND_LIMIT	2048
62 #define	NFS4_FS_LOCATIONS_LIMIT	65536
63 #define	NFS4_ACL_LIMIT		65536
64 #define	NFS4_SECINFO_LIMIT	65536
65 #define	NFS4_FATTR4_LIMIT	1048576
66 #define	NFS4_DATA_LIMIT		134217728
67 
68 #define	NFS4_SESSIONID_SIZE	16
69 
70 enum nfs_ftype4 {
71 	NF4REG = 1,
72 	NF4DIR = 2,
73 	NF4BLK = 3,
74 	NF4CHR = 4,
75 	NF4LNK = 5,
76 	NF4SOCK = 6,
77 	NF4FIFO = 7,
78 	NF4ATTRDIR = 8,
79 	NF4NAMEDATTR = 9
80 };
81 typedef enum nfs_ftype4 nfs_ftype4;
82 
83 enum nfsstat4 {
84 	NFS4_OK = 0,
85 	NFS4ERR_PERM = 1,
86 	NFS4ERR_NOENT = 2,
87 	NFS4ERR_IO = 5,
88 	NFS4ERR_NXIO = 6,
89 	NFS4ERR_ACCESS = 13,
90 	NFS4ERR_EXIST = 17,
91 	NFS4ERR_XDEV = 18,
92 	NFS4ERR_NOTDIR = 20,
93 	NFS4ERR_ISDIR = 21,
94 	NFS4ERR_INVAL = 22,
95 	NFS4ERR_FBIG = 27,
96 	NFS4ERR_NOSPC = 28,
97 	NFS4ERR_ROFS = 30,
98 	NFS4ERR_MLINK = 31,
99 	NFS4ERR_NAMETOOLONG = 63,
100 	NFS4ERR_NOTEMPTY = 66,
101 	NFS4ERR_DQUOT = 69,
102 	NFS4ERR_STALE = 70,
103 	NFS4ERR_BADHANDLE = 10001,
104 	NFS4ERR_BAD_COOKIE = 10003,
105 	NFS4ERR_NOTSUPP = 10004,
106 	NFS4ERR_TOOSMALL = 10005,
107 	NFS4ERR_SERVERFAULT = 10006,
108 	NFS4ERR_BADTYPE = 10007,
109 	NFS4ERR_DELAY = 10008,
110 	NFS4ERR_SAME = 10009,
111 	NFS4ERR_DENIED = 10010,
112 	NFS4ERR_EXPIRED = 10011,
113 	NFS4ERR_LOCKED = 10012,
114 	NFS4ERR_GRACE = 10013,
115 	NFS4ERR_FHEXPIRED = 10014,
116 	NFS4ERR_SHARE_DENIED = 10015,
117 	NFS4ERR_WRONGSEC = 10016,
118 	NFS4ERR_CLID_INUSE = 10017,
119 	NFS4ERR_RESOURCE = 10018,
120 	NFS4ERR_MOVED = 10019,
121 	NFS4ERR_NOFILEHANDLE = 10020,
122 	NFS4ERR_MINOR_VERS_MISMATCH = 10021,
123 	NFS4ERR_STALE_CLIENTID = 10022,
124 	NFS4ERR_STALE_STATEID = 10023,
125 	NFS4ERR_OLD_STATEID = 10024,
126 	NFS4ERR_BAD_STATEID = 10025,
127 	NFS4ERR_BAD_SEQID = 10026,
128 	NFS4ERR_NOT_SAME = 10027,
129 	NFS4ERR_LOCK_RANGE = 10028,
130 	NFS4ERR_SYMLINK = 10029,
131 	NFS4ERR_RESTOREFH = 10030,
132 	NFS4ERR_LEASE_MOVED = 10031,
133 	NFS4ERR_ATTRNOTSUPP = 10032,
134 	NFS4ERR_NO_GRACE = 10033,
135 	NFS4ERR_RECLAIM_BAD = 10034,
136 	NFS4ERR_RECLAIM_CONFLICT = 10035,
137 	NFS4ERR_BADXDR = 10036,
138 	NFS4ERR_LOCKS_HELD = 10037,
139 	NFS4ERR_OPENMODE = 10038,
140 	NFS4ERR_BADOWNER = 10039,
141 	NFS4ERR_BADCHAR = 10040,
142 	NFS4ERR_BADNAME = 10041,
143 	NFS4ERR_BAD_RANGE = 10042,
144 	NFS4ERR_LOCK_NOTSUPP = 10043,
145 	NFS4ERR_OP_ILLEGAL = 10044,
146 	NFS4ERR_DEADLOCK = 10045,
147 	NFS4ERR_FILE_OPEN = 10046,
148 	NFS4ERR_ADMIN_REVOKED = 10047,
149 	NFS4ERR_CB_PATH_DOWN = 10048,
150 	NFS4ERR_BADIOMODE = 10049,	/*  nfsv4.1 */
151 	NFS4ERR_BADLAYOUT = 10050,
152 	NFS4ERR_BAD_SESSION_DIGEST = 10051,
153 	NFS4ERR_BADSESSION = 10052,
154 	NFS4ERR_BADSLOT = 10053,
155 	NFS4ERR_COMPLETE_ALREADY = 10054,
156 	NFS4ERR_CONN_NOT_BOUND_TO_SESSION = 10055,
157 	NFS4ERR_DELEG_ALREADY_WANTED = 10056,
158 	NFS4ERR_BACK_CHAN_BUSY = 10057,
159 	NFS4ERR_LAYOUTTRYLATER = 10058,
160 	NFS4ERR_LAYOUTUNAVAILABLE = 10059,
161 	NFS4ERR_NOMATCHING_LAYOUT = 10060,
162 	NFS4ERR_RECALLCONFLICT = 10061,
163 	NFS4ERR_UNKNOWN_LAYOUTTYPE = 10062,
164 	NFS4ERR_SEQ_MISORDERED = 10063,
165 	NFS4ERR_SEQUENCE_POS = 10064,
166 	NFS4ERR_REQ_TOO_BIG = 10065,
167 	NFS4ERR_REP_TOO_BIG = 10066,
168 	NFS4ERR_REP_TOO_BIG_TO_CACHE = 10067,
169 	NFS4ERR_RETRY_UNCACHED_REP = 10068,
170 	NFS4ERR_UNSAFE_COMPOUND = 10069,
171 	NFS4ERR_TOO_MANY_OPS = 10070,
172 	NFS4ERR_OP_NOT_IN_SESSION = 10071,
173 	NFS4ERR_HASH_ALG_UNSUPP = 10072,
174 	NFS4ERR_CLIENTID_BUSY = 10074,
175 	NFS4ERR_PNFS_IO_HOLE = 10075,
176 	NFS4ERR_SEQ_FALSE_RETRY = 10076,
177 	NFS4ERR_BAD_HIGH_SLOT = 10077,
178 	NFS4ERR_DEADSESSION = 10078,
179 	NFS4ERR_ENCR_ALG_UNSUPP = 10079,
180 	NFS4ERR_PNFS_NO_LAYOUT = 10080,
181 	NFS4ERR_NOT_ONLY_OP = 10081,
182 	NFS4ERR_WRONG_CRED = 10082,
183 	NFS4ERR_WRONG_TYPE = 10083,
184 	NFS4ERR_DIRDELEG_UNAVAIL = 10084,
185 	NFS4ERR_REJECT_DELEG = 10085,
186 	NFS4ERR_RETURNCONFLICT = 10086,
187 	NFS4ERR_DELEG_REVOKED = 10087,
188 	NFS4ERR_PARTNER_NOTSUPP = 10088,
189 	NFS4ERR_PARTNER_NO_AUTH = 10089,
190 	NFS4ERR_UNION_NOTSUPP = 10090,
191 	NFS4ERR_OFFLOAD_DENIED = 10091,
192 	NFS4ERR_WRONG_LFS = 10092,
193 	NFS4ERR_BADLABEL = 10093,
194 	NFS4ERR_OFFLOAD_NO_REQS = 10094,
195 
196 	/* for internal use */
197 	NFS4ERR_REPLAY_CACHE = 30000
198 };
199 typedef enum nfsstat4 nfsstat4;
200 
201 /*
202  * A bitmap can only be 56 bits, treat it as a uint64_t for now
203  */
204 typedef uint64_t bitmap4;
205 
206 typedef struct {
207 	uint_t attrlist4_len;
208 	char *attrlist4_val;
209 } attrlist4;
210 
211 typedef uint64_t offset4;
212 
213 typedef uint32_t count4;
214 
215 typedef uint64_t length4;
216 
217 typedef uint64_t clientid4;
218 
219 typedef uint32_t nfs_lease4;
220 
221 typedef uint32_t seqid4;
222 
223 typedef uint32_t sequenceid4;
224 
225 typedef char sessionid4[NFS4_SESSIONID_SIZE];
226 
227 typedef uint32_t slotid4;
228 
229 typedef struct {
230 	uint_t utf8string_len;
231 	char *utf8string_val;
232 } utf8string;
233 
234 typedef utf8string component4;
235 
236 typedef utf8string utf8str_cis;
237 
238 typedef utf8string utf8str_cs;
239 
240 typedef utf8string utf8str_mixed;
241 
242 typedef struct {
243 	uint_t pathname4_len;
244 	component4 *pathname4_val;
245 } pathname4;
246 
247 typedef uint64_t nfs_cookie4;
248 
249 typedef struct {
250 	uint_t linktext4_len;
251 	char *linktext4_val;
252 } linktext4;
253 
254 typedef utf8string ascii_REQUIRED4;
255 
256 typedef struct {
257 	uint_t sec_oid4_len;
258 	char *sec_oid4_val;
259 } sec_oid4;
260 
261 typedef uint32_t qop4;
262 
263 typedef uint32_t mode4;
264 
265 typedef uint64_t changeid4;
266 
267 typedef uint64_t verifier4;
268 
269 struct nfstime4 {
270 	int64_t seconds;
271 	uint32_t nseconds;
272 };
273 typedef struct nfstime4 nfstime4;
274 
275 enum time_how4 {
276 	SET_TO_SERVER_TIME4 = 0,
277 	SET_TO_CLIENT_TIME4 = 1
278 };
279 typedef enum time_how4 time_how4;
280 
281 struct settime4 {
282 	time_how4 set_it;
283 	nfstime4 time;
284 };
285 typedef struct settime4 settime4;
286 
287 typedef struct {
288 	uint_t nfs_fh4_len;
289 	char *nfs_fh4_val;
290 } nfs_fh4;
291 
292 struct fsid4 {
293 	uint64_t major;
294 	uint64_t minor;
295 };
296 typedef struct fsid4 fsid4;
297 
298 struct change_policy4 {
299 	uint64_t cp_major;
300 	uint64_t cp_minor;
301 };
302 typedef struct change_policy4 change_policy4;
303 
304 struct fs_location4 {
305 	uint_t server_len;
306 	utf8string *server_val;
307 	pathname4 rootpath;
308 };
309 typedef struct fs_location4 fs_location4;
310 
311 struct fs_locations4 {
312 	pathname4 fs_root;
313 	uint_t locations_len;
314 	fs_location4 *locations_val;
315 };
316 typedef struct fs_locations4 fs_locations4;
317 
318 /*
319  * This structure is declared in nfs4.h
320  */
321 struct nfs_fsl_info;
322 
323 /*
324  * ACL support
325  */
326 
327 #define	ACL4_SUPPORT_ALLOW_ACL 0x00000001
328 #define	ACL4_SUPPORT_DENY_ACL 0x00000002
329 #define	ACL4_SUPPORT_AUDIT_ACL 0x00000004
330 #define	ACL4_SUPPORT_ALARM_ACL 0x00000008
331 
332 typedef uint32_t acetype4;
333 #define	ACE4_ACCESS_ALLOWED_ACE_TYPE 0x00000000
334 #define	ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
335 #define	ACE4_SYSTEM_AUDIT_ACE_TYPE 0x00000002
336 #define	ACE4_SYSTEM_ALARM_ACE_TYPE 0x00000003
337 
338 typedef uint32_t aceflag4;
339 #define	ACE4_FILE_INHERIT_ACE 0x00000001
340 #define	ACE4_DIRECTORY_INHERIT_ACE 0x00000002
341 #define	ACE4_NO_PROPAGATE_INHERIT_ACE 0x00000004
342 #define	ACE4_INHERIT_ONLY_ACE 0x00000008
343 #define	ACE4_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
344 #define	ACE4_FAILED_ACCESS_ACE_FLAG 0x00000020
345 #define	ACE4_IDENTIFIER_GROUP 0x00000040
346 #define	ACE4_INHERITED_ACE 0x00000080
347 
348 /*
349  * This defines all valid flag bits, as defined by RFC 7530.  If
350  * any additional flag bits are deemed part of the NFSv4 spec,
351  * you must also add them to the definition below.
352  */
353 #define	ACE4_VALID_FLAG_BITS (\
354     ACE4_FILE_INHERIT_ACE | \
355     ACE4_DIRECTORY_INHERIT_ACE | \
356     ACE4_NO_PROPAGATE_INHERIT_ACE | \
357     ACE4_INHERIT_ONLY_ACE | \
358     ACE4_SUCCESSFUL_ACCESS_ACE_FLAG | \
359     ACE4_FAILED_ACCESS_ACE_FLAG | \
360     ACE4_IDENTIFIER_GROUP)
361 
362 typedef uint32_t acemask4;
363 #define	ACE4_READ_DATA 0x00000001
364 #define	ACE4_LIST_DIRECTORY 0x00000001
365 #define	ACE4_WRITE_DATA 0x00000002
366 #define	ACE4_ADD_FILE 0x00000002
367 #define	ACE4_APPEND_DATA 0x00000004
368 #define	ACE4_ADD_SUBDIRECTORY 0x00000004
369 #define	ACE4_READ_NAMED_ATTRS 0x00000008
370 #define	ACE4_WRITE_NAMED_ATTRS 0x00000010
371 #define	ACE4_EXECUTE 0x00000020
372 #define	ACE4_DELETE_CHILD 0x00000040
373 #define	ACE4_READ_ATTRIBUTES 0x00000080
374 #define	ACE4_WRITE_ATTRIBUTES 0x00000100
375 #define	ACE4_WRITE_RETENTION 0x00000200
376 #define	ACE4_WRITE_RETENTION_HOLD 0x00000400
377 #define	ACE4_DELETE 0x00010000
378 #define	ACE4_READ_ACL 0x00020000
379 #define	ACE4_WRITE_ACL 0x00040000
380 #define	ACE4_WRITE_OWNER 0x00080000
381 #define	ACE4_SYNCHRONIZE 0x00100000
382 #define	ACE4_GENERIC_READ 0x00120081
383 #define	ACE4_GENERIC_WRITE 0x00160106
384 #define	ACE4_GENERIC_EXECUTE 0x001200A0
385 /*
386  * This defines all valid access mask bits, as defined by RFC 7530.  If
387  * any additional access mask bits are deemed part of the NFSv4 spec,
388  * you must also add them to the definition below.
389  */
390 #define	ACE4_VALID_MASK_BITS (\
391     ACE4_READ_DATA | \
392     ACE4_LIST_DIRECTORY | \
393     ACE4_WRITE_DATA | \
394     ACE4_ADD_FILE | \
395     ACE4_APPEND_DATA | \
396     ACE4_ADD_SUBDIRECTORY | \
397     ACE4_READ_NAMED_ATTRS | \
398     ACE4_WRITE_NAMED_ATTRS | \
399     ACE4_EXECUTE | \
400     ACE4_DELETE_CHILD | \
401     ACE4_READ_ATTRIBUTES | \
402     ACE4_WRITE_ATTRIBUTES | \
403     ACE4_DELETE | \
404     ACE4_READ_ACL | \
405     ACE4_WRITE_ACL | \
406     ACE4_WRITE_OWNER | \
407     ACE4_SYNCHRONIZE)
408 
409 /* Used to signify an undefined value for an acemask4 */
410 #define	ACE4_MASK_UNDEFINED 0x80000000
411 
412 #define	ACE4_WHO_OWNER		"OWNER@"
413 #define	ACE4_WHO_GROUP		"GROUP@"
414 #define	ACE4_WHO_EVERYONE	"EVERYONE@"
415 
416 struct nfsace4 {
417 	acetype4 type;
418 	aceflag4 flag;
419 	acemask4 access_mask;
420 	utf8string who;
421 };
422 typedef struct nfsace4 nfsace4;
423 
424 typedef uint32_t aclflag4;		/* 4.1 */
425 #define	ACL4_AUTO_INHERIT 0x00000001
426 #define	ACL4_PROTECTED 0x00000002
427 #define	ACL4_DEFAULTED 0x00000004
428 
429 struct nfsacl41 {			/* 4.1 */
430 	aclflag4 na41_flag;
431 	struct {
432 		uint_t na41_aces_len;
433 		nfsace4 *na41_aces_val;
434 	} na41_aces;
435 };
436 typedef struct nfsacl41 nfsacl41;
437 
438 #define	MODE4_SUID 0x800
439 #define	MODE4_SGID 0x400
440 #define	MODE4_SVTX 0x200
441 #define	MODE4_RUSR 0x100
442 #define	MODE4_WUSR 0x080
443 #define	MODE4_XUSR 0x040
444 #define	MODE4_RGRP 0x020
445 #define	MODE4_WGRP 0x010
446 #define	MODE4_XGRP 0x008
447 #define	MODE4_ROTH 0x004
448 #define	MODE4_WOTH 0x002
449 #define	MODE4_XOTH 0x001
450 
451 struct mode_masked4 {			/* 4.1 */
452 	mode4 mm_value_to_set;
453 	mode4 mm_mask_bits;
454 };
455 typedef struct mode_masked4 mode_masked4;
456 
457 /*
458  * ACL conversion helpers
459  */
460 
461 typedef enum {
462 	ace4_unused,
463 	ace4_user_obj,
464 	ace4_user,
465 	ace4_group, /* includes GROUP and GROUP_OBJ */
466 	ace4_other_obj
467 } ace4_to_aent_state_t;
468 
469 typedef struct ace4vals {
470 	utf8string *key; /* NB: not allocated here; points to existing utf8 */
471 	avl_node_t avl;
472 	acemask4 mask;
473 	acemask4 allowed;
474 	acemask4 denied;
475 	int aent_type;
476 } ace4vals_t;
477 
478 typedef struct ace4_list {
479 	ace4vals_t user_obj;
480 	avl_tree_t user;
481 	int numusers;
482 	ace4vals_t group_obj;
483 	avl_tree_t group;
484 	int numgroups;
485 	ace4vals_t other_obj;
486 	acemask4 acl_mask;
487 	int hasmask;
488 	int dfacl_flag;
489 	ace4_to_aent_state_t state;
490 	int seen; /* bitmask of all aclent_t a_type values seen */
491 } ace4_list_t;
492 
493 struct specdata4 {
494 	uint32_t specdata1;
495 	uint32_t specdata2;
496 };
497 typedef struct specdata4 specdata4;
498 #define	FH4_PERSISTENT 0x00000000
499 #define	FH4_NOEXPIRE_WITH_OPEN 0x00000001
500 #define	FH4_VOLATILE_ANY 0x00000002
501 #define	FH4_VOL_MIGRATION 0x00000004
502 #define	FH4_VOL_RENAME 0x00000008
503 
504 /*
505  * nfsv4.1
506  */
507 struct netaddr4 {
508 	char *na_r_netid;
509 	char *na_r_addr;
510 };
511 typedef struct netaddr4 netaddr4;
512 
513 struct nfs_impl_id4 {
514 	utf8str_cis nii_domain;
515 	utf8str_cs nii_name;
516 	nfstime4 nii_date;
517 };
518 typedef struct nfs_impl_id4 nfs_impl_id4;
519 
520 struct stateid4 {
521 	uint32_t seqid;
522 	char other[NFS4_OTHER_SIZE];
523 };
524 typedef struct stateid4 stateid4;
525 
526 enum layouttype4 {
527 	LAYOUT4_NFSV4_1_FILES = 0x1,
528 	LAYOUT4_OSD2_OBJECTS = 0x2,
529 	LAYOUT4_BLOCK_VOLUME = 0x3
530 };
531 typedef enum layouttype4 layouttype4;
532 
533 struct layout_content4 {
534 	layouttype4 loc_type;
535 	struct {
536 		uint_t loc_body_len;
537 		char *loc_body_val;
538 	} loc_body;
539 };
540 typedef struct layout_content4 layout_content4;
541 
542 /*
543  * LAYOUT4_OSD2_OBJECTS loc_body description
544  * is in a separate .x file
545  */
546 
547 /*
548  * LAYOUT4_BLOCK_VOLUME loc_body description
549  * is in a separate .x file
550  */
551 
552 struct layouthint4 {
553 	layouttype4 loh_type;
554 	struct {
555 		uint_t loh_body_len;
556 		char *loh_body_val;
557 	} loh_body;
558 };
559 typedef struct layouthint4 layouthint4;
560 
561 enum layoutiomode4 {
562 	LAYOUTIOMODE4_READ = 1,
563 	LAYOUTIOMODE4_RW = 2,
564 	LAYOUTIOMODE4_ANY = 3
565 };
566 typedef enum layoutiomode4 layoutiomode4;
567 
568 struct layout4 {
569 	offset4 lo_offset;
570 	length4 lo_length;
571 	layoutiomode4 lo_iomode;
572 	layout_content4 lo_content;
573 };
574 typedef struct layout4 layout4;
575 #define	NFS4_DEVICEID4_SIZE 16
576 
577 typedef char deviceid4[NFS4_DEVICEID4_SIZE];
578 
579 struct device_addr4 {
580 	layouttype4 da_layout_type;
581 	struct {
582 		uint_t da_addr_body_len;
583 		char *da_addr_body_val;
584 	} da_addr_body;
585 };
586 typedef struct device_addr4 device_addr4;
587 
588 struct layoutupdate4 {
589 	layouttype4 lou_type;
590 	struct {
591 		uint_t lou_body_len;
592 		char *lou_body_val;
593 	} lou_body;
594 };
595 typedef struct layoutupdate4 layoutupdate4;
596 
597 #define	LAYOUT4_RET_REC_FILE 1
598 #define	LAYOUT4_RET_REC_FSID 2
599 #define	LAYOUT4_RET_REC_ALL 3
600 
601 enum layoutreturn_type4 {
602 	LAYOUTRETURN4_FILE = LAYOUT4_RET_REC_FILE,
603 	LAYOUTRETURN4_FSID = LAYOUT4_RET_REC_FSID,
604 	LAYOUTRETURN4_ALL = LAYOUT4_RET_REC_ALL
605 };
606 typedef enum layoutreturn_type4 layoutreturn_type4;
607 
608 /* layouttype4 specific data */
609 
610 struct layoutreturn_file4 {
611 	offset4 lrf_offset;
612 	length4 lrf_length;
613 	stateid4 lrf_stateid;
614 	struct {
615 		uint_t lrf_body_len;
616 		char *lrf_body_val;
617 	} lrf_body;
618 };
619 typedef struct layoutreturn_file4 layoutreturn_file4;
620 
621 struct layoutreturn4 {
622 	layoutreturn_type4 lr_returntype;
623 	union {
624 		layoutreturn_file4 lr_layout;
625 	} layoutreturn4_u;
626 };
627 typedef struct layoutreturn4 layoutreturn4;
628 
629 enum fs4_status_type {
630 	STATUS4_FIXED = 1,
631 	STATUS4_UPDATED = 2,
632 	STATUS4_VERSIONED = 3,
633 	STATUS4_WRITABLE = 4,
634 	STATUS4_REFERRAL = 5
635 };
636 typedef enum fs4_status_type fs4_status_type;
637 
638 struct fs4_status {
639 	bool_t fss_absent;
640 	fs4_status_type fss_type;
641 	utf8str_cs fss_source;
642 	utf8str_cs fss_current;
643 	int32_t fss_age;
644 	nfstime4 fss_version;
645 };
646 typedef struct fs4_status fs4_status;
647 
648 #define	TH4_READ_SIZE 0
649 #define	TH4_WRITE_SIZE 1
650 #define	TH4_READ_IOSIZE 2
651 #define	TH4_WRITE_IOSIZE 3
652 
653 typedef length4 threshold4_read_size;
654 
655 typedef length4 threshold4_write_size;
656 
657 typedef length4 threshold4_read_iosize;
658 
659 typedef length4 threshold4_write_iosize;
660 
661 struct threshold_item4 {
662 	layouttype4 thi_layout_type;
663 	bitmap4 thi_hintset;
664 	struct {
665 		uint_t thi_hintlist_len;
666 		char *thi_hintlist_val;
667 	} thi_hintlist;
668 };
669 typedef struct threshold_item4 threshold_item4;
670 
671 struct mdsthreshold4 {
672 	struct {
673 		uint_t mth_hints_len;
674 		threshold_item4 *mth_hints_val;
675 	} mth_hints;
676 };
677 typedef struct mdsthreshold4 mdsthreshold4;
678 #define	RET4_DURATION_INFINITE 0xffffffffffffffff
679 
680 struct retention_get4 {
681 	uint64_t rg_duration;
682 	struct {
683 		uint_t rg_begin_time_len;
684 		nfstime4 *rg_begin_time_val;
685 	} rg_begin_time;
686 };
687 typedef struct retention_get4 retention_get4;
688 
689 struct retention_set4 {
690 	bool_t rs_enable;
691 	struct {
692 		uint_t rs_duration_len;
693 		uint64_t *rs_duration_val;
694 	} rs_duration;
695 };
696 typedef struct retention_set4 retention_set4;
697 #define	FSCHARSET_CAP4_CONTAINS_NON_UTF8 0x1
698 #define	FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 0x2
699 
700 typedef uint32_t fs_charset_cap4;
701 
702 /* nfsv4.1 end, nfsv4.2 additions */
703 
704 enum netloc_type4 {
705 	NL4_NAME = 1,
706 	NL4_URL = 2,
707 	NL4_NETADDR = 3
708 };
709 typedef enum netloc_type4 netloc_type4;
710 
711 struct netloc4 {
712 	netloc_type4 nl_type;
713 	union {
714 		utf8str_cis nl_name;
715 		utf8str_cis nl_url;
716 		netaddr4 nl_addr;
717 	} netloc4_u;
718 };
719 typedef struct netloc4 netloc4;
720 
721 enum change_attr_type4 {
722 	NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR = 0,
723 	NFS4_CHANGE_TYPE_IS_VERSION_COUNTER = 1,
724 	NFS4_CHANGE_TYPE_IS_VERSION_COUNTER_NOPNFS = 2,
725 	NFS4_CHANGE_TYPE_IS_TIME_METADATA = 3,
726 	NFS4_CHANGE_TYPE_IS_UNDEFINED = 4
727 };
728 typedef enum change_attr_type4 change_attr_type4;
729 
730 /*
731  * Note that rpcgen would have put here:
732  *	typedef struct labelformat_spec4 {...}
733  *	typedef struct sec_label4 {...}
734  * but this implementation is using a hand-coded replacment.
735  */
736 
737 /* nfsv4.2 by-hand version */
738 struct sec_label4 {
739 	uint_t slai_len;
740 	char  *slai_val;
741 };
742 
743 typedef struct sec_label4 sec_label4;
744 
745 /*
746  * Note that rpcgen would have put here:
747  *	typedef struct copy_from_auth_priv {...}
748  *	typedef struct copy_to_auth_priv {...}
749  *	typedef struct copy_confirm_auth_priv {...}
750  * not currently used.
751  */
752 
753 struct app_data_block4 {
754 	offset4 adb_offset;
755 	length4 adb_block_size;
756 	length4 adb_block_count;
757 	length4 adb_reloff_blocknum;
758 	count4 adb_block_num;
759 	length4 adb_reloff_pattern;
760 	struct {
761 		uint_t adb_pattern_len;
762 		char *adb_pattern_val;
763 	} adb_pattern;
764 };
765 typedef struct app_data_block4 app_data_block4;
766 
767 struct data4 {
768 	offset4 d_offset;
769 	struct {
770 		uint_t d_data_len;
771 		char *d_data_val;
772 	} d_data;
773 };
774 typedef struct data4 data4;
775 
776 struct data_info4 {
777 	offset4 di_offset;
778 	length4 di_length;
779 };
780 typedef struct data_info4 data_info4;
781 
782 enum data_content4 {
783 	NFS4_CONTENT_DATA = 0,
784 	NFS4_CONTENT_HOLE = 1
785 };
786 typedef enum data_content4 data_content4;
787 
788 enum stable_how4 {
789 	UNSTABLE4 = 0,
790 	DATA_SYNC4 = 1,
791 	FILE_SYNC4 = 2
792 };
793 typedef enum stable_how4 stable_how4;
794 
795 struct write_response4 {
796 	struct {
797 		uint_t wr_callback_id_len;
798 		stateid4 *wr_callback_id_val;
799 	} wr_callback_id;
800 	length4 wr_count;
801 	stable_how4 wr_committed;
802 	verifier4 wr_writeverf;
803 };
804 typedef struct write_response4 write_response4;
805 
806 /* nfsv4.2 end */
807 
808 typedef bitmap4 fattr4_supported_attrs;
809 
810 typedef nfs_ftype4 fattr4_type;
811 
812 typedef uint32_t fattr4_fh_expire_type;
813 
814 typedef changeid4 fattr4_change;
815 
816 typedef uint64_t fattr4_size;
817 
818 typedef bool_t fattr4_link_support;
819 
820 typedef bool_t fattr4_symlink_support;
821 
822 typedef bool_t fattr4_named_attr;
823 
824 typedef fsid4 fattr4_fsid;
825 
826 typedef bool_t fattr4_unique_handles;
827 
828 typedef nfs_lease4 fattr4_lease_time;
829 
830 typedef nfsstat4 fattr4_rdattr_error;
831 
832 typedef struct {
833 	uint_t fattr4_acl_len;
834 	nfsace4 *fattr4_acl_val;
835 } fattr4_acl;
836 
837 typedef uint32_t fattr4_aclsupport;
838 
839 typedef bool_t fattr4_archive;
840 
841 typedef bool_t fattr4_cansettime;
842 
843 typedef bool_t fattr4_case_insensitive;
844 
845 typedef bool_t fattr4_case_preserving;
846 
847 typedef bool_t fattr4_chown_restricted;
848 
849 typedef uint64_t fattr4_fileid;
850 
851 typedef uint64_t fattr4_files_avail;
852 
853 typedef nfs_fh4 fattr4_filehandle;
854 
855 typedef uint64_t fattr4_files_free;
856 
857 typedef uint64_t fattr4_files_total;
858 
859 typedef fs_locations4 fattr4_fs_locations;
860 
861 typedef bool_t fattr4_hidden;
862 
863 typedef bool_t fattr4_homogeneous;
864 
865 typedef uint64_t fattr4_maxfilesize;
866 
867 typedef uint32_t fattr4_maxlink;
868 
869 typedef uint32_t fattr4_maxname;
870 
871 typedef uint64_t fattr4_maxread;
872 
873 typedef uint64_t fattr4_maxwrite;
874 
875 typedef ascii_REQUIRED4 fattr4_mimetype;
876 
877 typedef mode4 fattr4_mode;
878 
879 typedef mode_masked4 fattr4_mode_set_masked;
880 
881 typedef uint64_t fattr4_mounted_on_fileid;
882 
883 typedef bool_t fattr4_no_trunc;
884 
885 typedef uint32_t fattr4_numlinks;
886 
887 typedef utf8string fattr4_owner;
888 
889 typedef utf8string fattr4_owner_group;
890 
891 typedef uint64_t fattr4_quota_avail_hard;
892 
893 typedef uint64_t fattr4_quota_avail_soft;
894 
895 typedef uint64_t fattr4_quota_used;
896 
897 typedef specdata4 fattr4_rawdev;
898 
899 typedef uint64_t fattr4_space_avail;
900 
901 typedef uint64_t fattr4_space_free;
902 
903 typedef uint64_t fattr4_space_total;
904 
905 typedef uint64_t fattr4_space_used;
906 
907 typedef bool_t fattr4_system;
908 
909 typedef nfstime4 fattr4_time_access;
910 
911 typedef settime4 fattr4_time_access_set;
912 
913 typedef nfstime4 fattr4_time_backup;
914 
915 typedef nfstime4 fattr4_time_create;
916 
917 typedef nfstime4 fattr4_time_delta;
918 
919 typedef nfstime4 fattr4_time_metadata;
920 
921 typedef nfstime4 fattr4_time_modify;
922 
923 typedef settime4 fattr4_time_modify_set;
924 
925 /* nfsv4.1 */
926 typedef bitmap4 fattr4_suppattr_exclcreat;
927 
928 typedef nfstime4 fattr4_dir_notif_delay;
929 
930 typedef nfstime4 fattr4_dirent_notif_delay;
931 
932 typedef struct {
933 	uint_t fattr4_fs_layout_types_len;
934 	layouttype4 *fattr4_fs_layout_types_val;
935 } fattr4_fs_layout_types;
936 
937 typedef fs4_status fattr4_fs_status;
938 
939 typedef fs_charset_cap4 fattr4_fs_charset_cap;
940 
941 typedef uint32_t fattr4_layout_alignment;
942 
943 typedef uint32_t fattr4_layout_blksize;
944 
945 typedef layouthint4 fattr4_layout_hint;
946 
947 typedef struct {
948 	uint_t fattr4_layout_types_len;
949 	layouttype4 *fattr4_layout_types_val;
950 } fattr4_layout_types;
951 
952 typedef mdsthreshold4 fattr4_mdsthreshold;
953 
954 typedef retention_get4 fattr4_retention_get;
955 
956 typedef retention_set4 fattr4_retention_set;
957 
958 typedef retention_get4 fattr4_retentevt_get;
959 
960 typedef retention_set4 fattr4_retentevt_set;
961 
962 typedef uint64_t fattr4_retention_hold;
963 
964 typedef nfsacl41 fattr4_dacl;
965 
966 typedef nfsacl41 fattr4_sacl;
967 
968 typedef change_policy4 fattr4_change_policy;
969 
970 /* nfsv4.1 end, nfsv4.2 begin */
971 
972 typedef uint64_t fattr4_space_freed;
973 
974 typedef change_attr_type4 fattr4_change_attr_type;
975 
976 typedef sec_label4 fattr4_sec_label;
977 
978 typedef uint32_t fattr4_clone_blksize;
979 
980 /* nfsv4.2 end */
981 
982 /*
983  * REQUIRED Attributes
984  */
985 #define	FATTR4_SUPPORTED_ATTRS 0
986 #define	FATTR4_TYPE 1
987 #define	FATTR4_FH_EXPIRE_TYPE 2
988 #define	FATTR4_CHANGE 3
989 #define	FATTR4_SIZE 4
990 #define	FATTR4_LINK_SUPPORT 5
991 #define	FATTR4_SYMLINK_SUPPORT 6
992 #define	FATTR4_NAMED_ATTR 7
993 #define	FATTR4_FSID 8
994 #define	FATTR4_UNIQUE_HANDLES 9
995 #define	FATTR4_LEASE_TIME 10
996 #define	FATTR4_RDATTR_ERROR 11
997 #define	FATTR4_FILEHANDLE 19
998 /* new to NFSV4.1 */
999 #define	FATTR4_SUPPATTR_EXCLCREAT 75
1000 
1001 /*
1002  * RECOMMENDED Attributes
1003  */
1004 #define	FATTR4_ACL 12
1005 #define	FATTR4_ACLSUPPORT 13
1006 #define	FATTR4_ARCHIVE 14
1007 #define	FATTR4_CANSETTIME 15
1008 #define	FATTR4_CASE_INSENSITIVE 16
1009 #define	FATTR4_CASE_PRESERVING 17
1010 #define	FATTR4_CHOWN_RESTRICTED 18
1011 #define	FATTR4_FILEID 20
1012 #define	FATTR4_FILES_AVAIL 21
1013 #define	FATTR4_FILES_FREE 22
1014 #define	FATTR4_FILES_TOTAL 23
1015 #define	FATTR4_FS_LOCATIONS 24
1016 #define	FATTR4_HIDDEN 25
1017 #define	FATTR4_HOMOGENEOUS 26
1018 #define	FATTR4_MAXFILESIZE 27
1019 #define	FATTR4_MAXLINK 28
1020 #define	FATTR4_MAXNAME 29
1021 #define	FATTR4_MAXREAD 30
1022 #define	FATTR4_MAXWRITE 31
1023 #define	FATTR4_MIMETYPE 32
1024 #define	FATTR4_MODE 33
1025 #define	FATTR4_NO_TRUNC 34
1026 #define	FATTR4_NUMLINKS 35
1027 #define	FATTR4_OWNER 36
1028 #define	FATTR4_OWNER_GROUP 37
1029 #define	FATTR4_QUOTA_AVAIL_HARD 38
1030 #define	FATTR4_QUOTA_AVAIL_SOFT 39
1031 #define	FATTR4_QUOTA_USED 40
1032 #define	FATTR4_RAWDEV 41
1033 #define	FATTR4_SPACE_AVAIL 42
1034 #define	FATTR4_SPACE_FREE 43
1035 #define	FATTR4_SPACE_TOTAL 44
1036 #define	FATTR4_SPACE_USED 45
1037 #define	FATTR4_SYSTEM 46
1038 #define	FATTR4_TIME_ACCESS 47
1039 #define	FATTR4_TIME_ACCESS_SET 48
1040 #define	FATTR4_TIME_BACKUP 49
1041 #define	FATTR4_TIME_CREATE 50
1042 #define	FATTR4_TIME_DELTA 51
1043 #define	FATTR4_TIME_METADATA 52
1044 #define	FATTR4_TIME_MODIFY 53
1045 #define	FATTR4_TIME_MODIFY_SET 54
1046 #define	FATTR4_MOUNTED_ON_FILEID 55
1047 
1048 /* new to NFSV4.1 */
1049 #define	FATTR4_DIR_NOTIF_DELAY 56
1050 #define	FATTR4_DIRENT_NOTIF_DELAY 57
1051 #define	FATTR4_DACL 58
1052 #define	FATTR4_SACL 59
1053 #define	FATTR4_CHANGE_POLICY 60
1054 #define	FATTR4_FS_STATUS 61
1055 #define	FATTR4_FS_LAYOUT_TYPES 62
1056 #define	FATTR4_LAYOUT_HINT 63
1057 #define	FATTR4_LAYOUT_TYPES 64
1058 #define	FATTR4_LAYOUT_BLKSIZE 65
1059 #define	FATTR4_LAYOUT_ALIGNMENT 66
1060 #define	FATTR4_FS_LOCATIONS_INFO 67
1061 #define	FATTR4_MDSTHRESHOLD 68
1062 #define	FATTR4_RETENTION_GET 69
1063 #define	FATTR4_RETENTION_SET 70
1064 #define	FATTR4_RETENTEVT_GET 71
1065 #define	FATTR4_RETENTEVT_SET 72
1066 #define	FATTR4_RETENTION_HOLD 73
1067 #define	FATTR4_MODE_SET_MASKED 74
1068 /*	FATTR4_SUPPATTR_EXCLCREAT (75) is required. See above. */
1069 #define	FATTR4_FS_CHARSET_CAP 76
1070 
1071 /* new to NFSv4.2 */
1072 #define	FATTR4_CLONE_BLKSIZE 77
1073 #define	FATTR4_SPACE_FREED 78
1074 #define	FATTR4_CHANGE_ATTR_TYPE 79
1075 #define	FATTR4_SEC_LABEL 80
1076 
1077 struct fattr4 {
1078 	bitmap4 attrmask;
1079 	char *attrlist4;
1080 	uint_t attrlist4_len;
1081 };
1082 typedef struct fattr4 fattr4;
1083 
1084 struct change_info4 {
1085 	bool_t atomic;
1086 	changeid4 before;
1087 	changeid4 after;
1088 };
1089 typedef struct change_info4 change_info4;
1090 
1091 struct clientaddr4 {
1092 	char *r_netid;
1093 	char *r_addr;
1094 };
1095 typedef struct clientaddr4 clientaddr4;
1096 
1097 struct cb_client4 {
1098 	uint_t cb_program;
1099 	clientaddr4 cb_location;
1100 };
1101 typedef struct cb_client4 cb_client4;
1102 
1103 struct nfs_client_id4 {
1104 	verifier4 verifier;
1105 	uint_t id_len;
1106 	char *id_val;
1107 	struct sockaddr *cl_addr;
1108 };
1109 typedef struct nfs_client_id4 nfs_client_id4;
1110 
1111 struct client_owner4 {
1112 	verifier4 co_verifier;
1113 	struct {
1114 		uint_t co_ownerid_len;
1115 		char *co_ownerid_val;
1116 	} co_ownerid;
1117 };
1118 typedef struct client_owner4 client_owner4;
1119 
1120 struct server_owner4 {
1121 	uint64_t so_minor_id;
1122 	struct {
1123 		uint_t so_major_id_len;
1124 		char *so_major_id_val;
1125 	} so_major_id;
1126 };
1127 typedef struct server_owner4 server_owner4;
1128 
1129 struct state_owner4 {
1130 	clientid4 clientid;
1131 	struct {
1132 		uint_t owner_len;
1133 		char *owner_val;
1134 	} owner;
1135 };
1136 typedef struct state_owner4 state_owner4;
1137 
1138 struct open_owner4 {
1139 	clientid4 clientid;
1140 	uint_t owner_len;
1141 	char *owner_val;
1142 };
1143 typedef struct open_owner4 open_owner4;
1144 
1145 struct lock_owner4 {
1146 	clientid4 clientid;
1147 	uint_t owner_len;
1148 	char *owner_val;
1149 };
1150 typedef struct lock_owner4 lock_owner4;
1151 
1152 enum nfs_lock_type4 {
1153 	READ_LT = 1,
1154 	WRITE_LT = 2,
1155 	READW_LT = 3,
1156 	WRITEW_LT = 4
1157 };
1158 typedef enum nfs_lock_type4 nfs_lock_type4;
1159 
1160 /*
1161  * nfsv4.1
1162  */
1163 
1164 /* Input for computing subkeys */
1165 
1166 enum ssv_subkey4 {
1167 	SSV4_SUBKEY_MIC_I2T = 1,
1168 	SSV4_SUBKEY_MIC_T2I = 2,
1169 	SSV4_SUBKEY_SEAL_I2T = 3,
1170 	SSV4_SUBKEY_SEAL_T2I = 4
1171 };
1172 typedef enum ssv_subkey4 ssv_subkey4;
1173 
1174 /* Input for computing smt_hmac */
1175 
1176 struct ssv_mic_plain_tkn4 {
1177 	uint32_t smpt_ssv_seq;
1178 	struct {
1179 		uint_t smpt_orig_plain_len;
1180 		char *smpt_orig_plain_val;
1181 	} smpt_orig_plain;
1182 };
1183 typedef struct ssv_mic_plain_tkn4 ssv_mic_plain_tkn4;
1184 
1185 /* SSV GSS PerMsgToken token */
1186 
1187 struct ssv_mic_tkn4 {
1188 	uint32_t smt_ssv_seq;
1189 	struct {
1190 		uint_t smt_hmac_len;
1191 		char *smt_hmac_val;
1192 	} smt_hmac;
1193 };
1194 typedef struct ssv_mic_tkn4 ssv_mic_tkn4;
1195 
1196 /* Input for computing ssct_encr_data and ssct_hmac */
1197 
1198 struct ssv_seal_plain_tkn4 {
1199 	struct {
1200 		uint_t sspt_confounder_len;
1201 		char *sspt_confounder_val;
1202 	} sspt_confounder;
1203 	uint32_t sspt_ssv_seq;
1204 	struct {
1205 		uint_t sspt_orig_plain_len;
1206 		char *sspt_orig_plain_val;
1207 	} sspt_orig_plain;
1208 	struct {
1209 		uint_t sspt_pad_len;
1210 		char *sspt_pad_val;
1211 	} sspt_pad;
1212 };
1213 typedef struct ssv_seal_plain_tkn4 ssv_seal_plain_tkn4;
1214 
1215 /* SSV GSS SealedMessage token */
1216 
1217 struct ssv_seal_cipher_tkn4 {
1218 	uint32_t ssct_ssv_seq;
1219 	struct {
1220 		uint_t ssct_iv_len;
1221 		char *ssct_iv_val;
1222 	} ssct_iv;
1223 	struct {
1224 		uint_t ssct_encr_data_len;
1225 		char *ssct_encr_data_val;
1226 	} ssct_encr_data;
1227 	struct {
1228 		uint_t ssct_hmac_len;
1229 		char *ssct_hmac_val;
1230 	} ssct_hmac;
1231 };
1232 typedef struct ssv_seal_cipher_tkn4 ssv_seal_cipher_tkn4;
1233 
1234 struct fs_locations_server4 {
1235 	int32_t fls_currency;
1236 	struct {
1237 		uint_t fls_info_len;
1238 		char *fls_info_val;
1239 	} fls_info;
1240 	utf8str_cis fls_server;
1241 };
1242 typedef struct fs_locations_server4 fs_locations_server4;
1243 #define	FSLI4BX_GFLAGS 0
1244 #define	FSLI4BX_TFLAGS 1
1245 #define	FSLI4BX_CLSIMUL 2
1246 #define	FSLI4BX_CLHANDLE 3
1247 #define	FSLI4BX_CLFILEID 4
1248 #define	FSLI4BX_CLWRITEVER 5
1249 #define	FSLI4BX_CLCHANGE 6
1250 #define	FSLI4BX_CLREADDIR 7
1251 #define	FSLI4BX_READRANK 8
1252 #define	FSLI4BX_WRITERANK 9
1253 #define	FSLI4BX_READORDER 10
1254 #define	FSLI4BX_WRITEORDER 11
1255 #define	FSLI4GF_WRITABLE 0x01
1256 #define	FSLI4GF_CUR_REQ 0x02
1257 #define	FSLI4GF_ABSENT 0x04
1258 #define	FSLI4GF_GOING 0x08
1259 #define	FSLI4GF_SPLIT 0x10
1260 #define	FSLI4TF_RDMA 0x01
1261 
1262 struct fs_locations_item4 {
1263 	struct {
1264 		uint_t fli_entries_len;
1265 		fs_locations_server4 *fli_entries_val;
1266 	} fli_entries;
1267 	pathname4 fli_rootpath;
1268 };
1269 typedef struct fs_locations_item4 fs_locations_item4;
1270 
1271 struct fs_locations_info4 {
1272 	uint32_t fli_flags;
1273 	int32_t fli_valid_for;
1274 	pathname4 fli_fs_root;
1275 	struct {
1276 		uint_t fli_items_len;
1277 		fs_locations_item4 *fli_items_val;
1278 	} fli_items;
1279 };
1280 typedef struct fs_locations_info4 fs_locations_info4;
1281 #define	FSLI4IF_VAR_SUB 0x00000001
1282 
1283 typedef fs_locations_info4 fattr4_fs_locations_info;
1284 #define	NFL4_UFLG_MASK			0x0000003F
1285 #define	NFL4_UFLG_DENSE			0x00000001
1286 #define	NFL4_UFLG_COMMIT_THRU_MDS	0x00000002
1287 #define	NFL4_UFLG_STRIPE_UNIT_SIZE_MASK	0xFFFFFFC0
1288 
1289 typedef uint32_t nfl_util4;
1290 
1291 enum filelayout_hint_care4 {
1292 	NFLH4_CARE_DENSE = NFL4_UFLG_DENSE,
1293 	NFLH4_CARE_COMMIT_THRU_MDS = NFL4_UFLG_COMMIT_THRU_MDS,
1294 	NFLH4_CARE_STRIPE_UNIT_SIZE = 0x00000040,
1295 	NFLH4_CARE_STRIPE_COUNT = 0x00000080
1296 };
1297 typedef enum filelayout_hint_care4 filelayout_hint_care4;
1298 
1299 /* Encoded in the loh_body field of data type layouthint4: */
1300 
1301 struct nfsv4_1_file_layouthint4 {
1302 	uint32_t nflh_care;
1303 	nfl_util4 nflh_util;
1304 	count4 nflh_stripe_count;
1305 };
1306 typedef struct nfsv4_1_file_layouthint4 nfsv4_1_file_layouthint4;
1307 
1308 typedef struct {
1309 	uint_t multipath_list4_len;
1310 	netaddr4 *multipath_list4_val;
1311 } multipath_list4;
1312 
1313 /*
1314  * Encoded in the da_addr_body field of
1315  * data type device_addr4:
1316  */
1317 
1318 struct nfsv4_1_file_layout_ds_addr4 {
1319 	struct {
1320 		uint_t nflda_stripe_indices_len;
1321 		uint32_t *nflda_stripe_indices_val;
1322 	} nflda_stripe_indices;
1323 	struct {
1324 		uint_t nflda_multipath_ds_list_len;
1325 		multipath_list4 *nflda_multipath_ds_list_val;
1326 	} nflda_multipath_ds_list;
1327 };
1328 typedef struct nfsv4_1_file_layout_ds_addr4 nfsv4_1_file_layout_ds_addr4;
1329 
1330 /*
1331  * Encoded in the loc_body field of
1332  * data type layout_content4:
1333  */
1334 
1335 struct nfsv4_1_file_layout4 {
1336 	deviceid4 nfl_deviceid;
1337 	nfl_util4 nfl_util;
1338 	uint32_t nfl_first_stripe_index;
1339 	offset4 nfl_pattern_offset;
1340 	struct {
1341 		uint_t nfl_fh_list_len;
1342 		nfs_fh4 *nfl_fh_list_val;
1343 	} nfl_fh_list;
1344 };
1345 typedef struct nfsv4_1_file_layout4 nfsv4_1_file_layout4;
1346 
1347 /*
1348  * Encoded in the lou_body field of data type layoutupdate4:
1349  *      Nothing. lou_body is a zero length array of bytes.
1350  */
1351 
1352 /*
1353  * Encoded in the lrf_body field of
1354  * data type layoutreturn_file4:
1355  *      Nothing. lrf_body is a zero length array of bytes.
1356  */
1357 
1358 /* nfsv4.1 end */
1359 
1360 enum nfs_opnum4 {
1361 	OP_ACCESS = 3,
1362 	OP_CLOSE = 4,
1363 	OP_COMMIT = 5,
1364 	OP_CREATE = 6,
1365 	OP_DELEGPURGE = 7,
1366 	OP_DELEGRETURN = 8,
1367 	OP_GETATTR = 9,
1368 	OP_GETFH = 10,
1369 	OP_LINK = 11,
1370 	OP_LOCK = 12,
1371 	OP_LOCKT = 13,
1372 	OP_LOCKU = 14,
1373 	OP_LOOKUP = 15,
1374 	OP_LOOKUPP = 16,
1375 	OP_NVERIFY = 17,
1376 	OP_OPEN = 18,
1377 	OP_OPENATTR = 19,
1378 	OP_OPEN_CONFIRM = 20,
1379 	OP_OPEN_DOWNGRADE = 21,
1380 	OP_PUTFH = 22,
1381 	OP_PUTPUBFH = 23,
1382 	OP_PUTROOTFH = 24,
1383 	OP_READ = 25,
1384 	OP_READDIR = 26,
1385 	OP_READLINK = 27,
1386 	OP_REMOVE = 28,
1387 	OP_RENAME = 29,
1388 	OP_RENEW = 30,
1389 	OP_RESTOREFH = 31,
1390 	OP_SAVEFH = 32,
1391 	OP_SECINFO = 33,
1392 	OP_SETATTR = 34,
1393 	OP_SETCLIENTID = 35,
1394 	OP_SETCLIENTID_CONFIRM = 36,
1395 	OP_VERIFY = 37,
1396 	OP_WRITE = 38,
1397 	OP_RELEASE_LOCKOWNER = 39,
1398 
1399 	/* nfsv4.1 */
1400 	OP_BACKCHANNEL_CTL = 40,
1401 	OP_BIND_CONN_TO_SESSION = 41,
1402 	OP_EXCHANGE_ID = 42,
1403 	OP_CREATE_SESSION = 43,
1404 	OP_DESTROY_SESSION = 44,
1405 	OP_FREE_STATEID = 45,
1406 	OP_GET_DIR_DELEGATION = 46,
1407 	OP_GETDEVICEINFO = 47,
1408 	OP_GETDEVICELIST = 48,
1409 	OP_LAYOUTCOMMIT = 49,
1410 	OP_LAYOUTGET = 50,
1411 	OP_LAYOUTRETURN = 51,
1412 	OP_SECINFO_NO_NAME = 52,
1413 	OP_SEQUENCE = 53,
1414 	OP_SET_SSV = 54,
1415 	OP_TEST_STATEID = 55,
1416 	OP_WANT_DELEGATION = 56,
1417 	OP_DESTROY_CLIENTID = 57,
1418 	OP_RECLAIM_COMPLETE = 58,
1419 
1420 	/* NFSv4.2 */
1421 	OP_ALLOCATE = 59,
1422 	OP_COPY = 60,
1423 	OP_COPY_NOTIFY = 61,
1424 	OP_DEALLOCATE = 62,
1425 	OP_IO_ADVISE = 63,
1426 	OP_LAYOUTERROR = 64,
1427 	OP_LAYOUTSTATS = 65,
1428 	OP_OFFLOAD_CANCEL = 66,
1429 	OP_OFFLOAD_STATUS = 67,
1430 	OP_READ_PLUS = 68,
1431 	OP_SEEK = 69,
1432 	OP_WRITE_SAME = 70,
1433 	OP_CLONE = 71,
1434 
1435 	OP_ILLEGAL = 10044,
1436 /*
1437  * These are internal client pseudo ops that *MUST* never go over the wire
1438  */
1439 #define	SUNW_PRIVATE_OP	0x10000000
1440 #define	REAL_OP4(op)	((op) & ~SUNW_PRIVATE_OP)
1441 	OP_CCREATE = OP_CREATE | SUNW_PRIVATE_OP,
1442 	OP_CLINK = OP_LINK | SUNW_PRIVATE_OP,
1443 	OP_CLOOKUP = OP_LOOKUP | SUNW_PRIVATE_OP,
1444 	OP_COPEN = OP_OPEN | SUNW_PRIVATE_OP,
1445 	OP_CPUTFH = OP_PUTFH | SUNW_PRIVATE_OP,
1446 	OP_CREMOVE = OP_REMOVE | SUNW_PRIVATE_OP,
1447 	OP_CRENAME = OP_RENAME | SUNW_PRIVATE_OP,
1448 	OP_CSECINFO = OP_SECINFO | SUNW_PRIVATE_OP
1449 };
1450 typedef enum nfs_opnum4 nfs_opnum4;
1451 
1452 /* Args & res. structs */
1453 
1454 #define	ACCESS4_READ 0x00000001
1455 #define	ACCESS4_LOOKUP 0x00000002
1456 #define	ACCESS4_MODIFY 0x00000004
1457 #define	ACCESS4_EXTEND 0x00000008
1458 #define	ACCESS4_DELETE 0x00000010
1459 #define	ACCESS4_EXECUTE 0x00000020
1460 
1461 struct ACCESS4args {
1462 	uint32_t access;
1463 };
1464 typedef struct ACCESS4args ACCESS4args;
1465 
1466 struct ACCESS4res {
1467 	nfsstat4 status;
1468 	uint32_t supported;
1469 	uint32_t access;
1470 };
1471 typedef struct ACCESS4res ACCESS4res;
1472 
1473 struct CLOSE4args {
1474 	seqid4 seqid;
1475 	stateid4 open_stateid;
1476 };
1477 typedef struct CLOSE4args CLOSE4args;
1478 
1479 struct CLOSE4res {
1480 	nfsstat4 status;
1481 	stateid4 open_stateid;
1482 };
1483 typedef struct CLOSE4res CLOSE4res;
1484 
1485 struct COMMIT4args {
1486 	offset4 offset;
1487 	count4 count;
1488 };
1489 typedef struct COMMIT4args COMMIT4args;
1490 
1491 struct COMMIT4res {
1492 	nfsstat4 status;
1493 	verifier4 writeverf;
1494 };
1495 typedef struct COMMIT4res COMMIT4res;
1496 
1497 struct CREATE4args {
1498 	nfs_ftype4 type;
1499 	union {
1500 		linktext4 linkdata;
1501 		specdata4 devdata;
1502 	} ftype4_u;
1503 	component4 objname;
1504 	fattr4 createattrs;
1505 };
1506 typedef struct CREATE4args CREATE4args;
1507 
1508 struct CREATE4cargs {
1509 	nfs_ftype4 type;
1510 	union {
1511 		char *clinkdata;
1512 		specdata4 devdata;
1513 	} ftype4_u;
1514 	char *cname;
1515 	fattr4 createattrs;
1516 };
1517 typedef struct CREATE4cargs CREATE4cargs;
1518 
1519 struct CREATE4res {
1520 	nfsstat4 status;
1521 	change_info4 cinfo;
1522 	bitmap4 attrset;
1523 };
1524 typedef struct CREATE4res CREATE4res;
1525 
1526 struct DELEGPURGE4args {
1527 	clientid4 clientid;
1528 };
1529 typedef struct DELEGPURGE4args DELEGPURGE4args;
1530 
1531 struct DELEGPURGE4res {
1532 	nfsstat4 status;
1533 };
1534 typedef struct DELEGPURGE4res DELEGPURGE4res;
1535 
1536 struct DELEGRETURN4args {
1537 	stateid4 deleg_stateid;
1538 };
1539 typedef struct DELEGRETURN4args DELEGRETURN4args;
1540 
1541 struct DELEGRETURN4res {
1542 	nfsstat4 status;
1543 };
1544 typedef struct DELEGRETURN4res DELEGRETURN4res;
1545 
1546 struct mntinfo4;
1547 
1548 struct GETATTR4args {
1549 	bitmap4 attr_request;
1550 	struct mntinfo4 *mi;
1551 };
1552 typedef struct GETATTR4args GETATTR4args;
1553 
1554 struct nfs4_ga_ext_res;
1555 
1556 struct nfs4_ga_res {
1557 	vattr_t				n4g_va;
1558 	unsigned			n4g_change_valid:1;
1559 	unsigned			n4g_mon_fid_valid:1;
1560 	unsigned			n4g_fsid_valid:1;
1561 	uint_t				n4g_attrerr;
1562 	uint_t				n4g_attrwhy;
1563 	bitmap4				n4g_resbmap;
1564 	fattr4_change			n4g_change;
1565 	fattr4_fsid			n4g_fsid;
1566 	fattr4_mounted_on_fileid	n4g_mon_fid;
1567 	struct nfs4_ga_ext_res		*n4g_ext_res;
1568 	vsecattr_t			n4g_vsa;
1569 };
1570 typedef struct nfs4_ga_res nfs4_ga_res_t;
1571 
1572 struct GETATTR4res {
1573 	nfsstat4 status;
1574 	fattr4 obj_attributes;
1575 	nfsstat4	ga_status;
1576 	struct nfs4_ga_res ga_res;
1577 };
1578 typedef struct GETATTR4res GETATTR4res;
1579 
1580 struct GETFH4res {
1581 	nfsstat4 status;
1582 	nfs_fh4 object;
1583 };
1584 typedef struct GETFH4res GETFH4res;
1585 
1586 struct LINK4args {
1587 	component4 newname;
1588 };
1589 typedef struct LINK4args LINK4args;
1590 
1591 struct LINK4cargs {
1592 	char *cnewname;
1593 };
1594 typedef struct LINK4cargs LINK4cargs;
1595 
1596 struct LINK4res {
1597 	nfsstat4 status;
1598 	change_info4 cinfo;
1599 };
1600 typedef struct LINK4res LINK4res;
1601 
1602 struct open_to_lock_owner4 {
1603 	seqid4 open_seqid;
1604 	stateid4 open_stateid;
1605 	seqid4 lock_seqid;
1606 	lock_owner4 lock_owner;
1607 };
1608 typedef struct open_to_lock_owner4 open_to_lock_owner4;
1609 
1610 struct exist_lock_owner4 {
1611 	stateid4 lock_stateid;
1612 	seqid4 lock_seqid;
1613 };
1614 typedef struct exist_lock_owner4 exist_lock_owner4;
1615 
1616 struct locker4 {
1617 	bool_t new_lock_owner;
1618 	union {
1619 		open_to_lock_owner4 open_owner;
1620 		exist_lock_owner4 lock_owner;
1621 	} locker4_u;
1622 };
1623 typedef struct locker4 locker4;
1624 
1625 struct LOCK4args {
1626 	nfs_lock_type4 locktype;
1627 	bool_t reclaim;
1628 	offset4 offset;
1629 	length4 length;
1630 	locker4 locker;
1631 };
1632 typedef struct LOCK4args LOCK4args;
1633 
1634 struct LOCK4denied {
1635 	offset4 offset;
1636 	length4 length;
1637 	nfs_lock_type4 locktype;
1638 	lock_owner4 owner;
1639 };
1640 typedef struct LOCK4denied LOCK4denied;
1641 
1642 struct LOCK4res {
1643 	nfsstat4 status;
1644 	union {
1645 		stateid4 lock_stateid;
1646 		LOCK4denied denied;
1647 	} LOCK4res_u;
1648 };
1649 typedef struct LOCK4res LOCK4res;
1650 
1651 struct LOCKT4args {
1652 	nfs_lock_type4 locktype;
1653 	offset4 offset;
1654 	length4 length;
1655 	lock_owner4 owner;
1656 };
1657 typedef struct LOCKT4args LOCKT4args;
1658 
1659 struct LOCKT4res {
1660 	nfsstat4 status;
1661 	LOCK4denied denied;
1662 };
1663 typedef struct LOCKT4res LOCKT4res;
1664 
1665 struct LOCKU4args {
1666 	nfs_lock_type4 locktype;
1667 	seqid4 seqid;
1668 	stateid4 lock_stateid;
1669 	offset4 offset;
1670 	length4 length;
1671 };
1672 typedef struct LOCKU4args LOCKU4args;
1673 
1674 struct LOCKU4res {
1675 	nfsstat4 status;
1676 	stateid4 lock_stateid;
1677 };
1678 typedef struct LOCKU4res LOCKU4res;
1679 
1680 struct LOOKUP4args {
1681 	component4 objname;
1682 };
1683 typedef struct LOOKUP4args LOOKUP4args;
1684 
1685 struct LOOKUP4cargs {
1686 	char *cname;
1687 };
1688 typedef struct LOOKUP4cargs LOOKUP4cargs;
1689 
1690 struct LOOKUP4res {
1691 	nfsstat4 status;
1692 };
1693 typedef struct LOOKUP4res LOOKUP4res;
1694 
1695 struct LOOKUPP4res {
1696 	nfsstat4 status;
1697 };
1698 typedef struct LOOKUPP4res LOOKUPP4res;
1699 
1700 struct NVERIFY4args {
1701 	fattr4 obj_attributes;
1702 };
1703 typedef struct NVERIFY4args NVERIFY4args;
1704 
1705 struct NVERIFY4res {
1706 	nfsstat4 status;
1707 };
1708 typedef struct NVERIFY4res NVERIFY4res;
1709 
1710 enum createmode4 {
1711 	UNCHECKED4 = 0,
1712 	GUARDED4 = 1,
1713 	EXCLUSIVE4 = 2,
1714 	EXCLUSIVE4_1 = 3
1715 };
1716 typedef enum createmode4 createmode4;
1717 
1718 struct creatverfattr {
1719 	verifier4 cva_verf;
1720 	fattr4 cva_attrs;
1721 };
1722 typedef struct creatverfattr creatverfattr;
1723 
1724 struct createhow4 {
1725 	createmode4 mode;
1726 	union {
1727 		fattr4 createattrs;
1728 		verifier4 createverf;
1729 		creatverfattr ch_createboth;
1730 	} createhow4_u;
1731 };
1732 typedef struct createhow4 createhow4;
1733 
1734 enum opentype4 {
1735 	OPEN4_NOCREATE = 0,
1736 	OPEN4_CREATE = 1
1737 };
1738 typedef enum opentype4 opentype4;
1739 
1740 struct openflag4 {
1741 	opentype4 opentype;
1742 	union {
1743 		createhow4 how;
1744 	} openflag4_u;
1745 };
1746 typedef struct openflag4 openflag4;
1747 
1748 enum limit_by4 {
1749 	NFS_LIMIT_SIZE = 1,
1750 	NFS_LIMIT_BLOCKS = 2
1751 };
1752 typedef enum limit_by4 limit_by4;
1753 
1754 struct nfs_modified_limit4 {
1755 	uint32_t num_blocks;
1756 	uint32_t bytes_per_block;
1757 };
1758 typedef struct nfs_modified_limit4 nfs_modified_limit4;
1759 
1760 struct nfs_space_limit4 {
1761 	limit_by4 limitby;
1762 	union {
1763 		uint64_t filesize;
1764 		nfs_modified_limit4 mod_blocks;
1765 	} nfs_space_limit4_u;
1766 };
1767 typedef struct nfs_space_limit4 nfs_space_limit4;
1768 
1769 #define	OPEN4_SHARE_ACCESS_MASK 0x00FF
1770 #define	OPEN4_SHARE_ACCESS_READ 0x00000001
1771 #define	OPEN4_SHARE_ACCESS_WRITE 0x00000002
1772 #define	OPEN4_SHARE_ACCESS_BOTH 0x00000003
1773 #define	OPEN4_SHARE_DENY_NONE 0x00000000
1774 #define	OPEN4_SHARE_DENY_READ 0x00000001
1775 #define	OPEN4_SHARE_DENY_WRITE 0x00000002
1776 #define	OPEN4_SHARE_DENY_BOTH 0x00000003
1777 /* nfsv4.1 */
1778 #define	OPEN4_SHARE_WANT_MASK		0xFF00
1779 #define	OPEN4_SHARE_WANT_NO_PREFERENCE	0x0000
1780 #define	OPEN4_SHARE_WANT_READ_DELEG	0x0100
1781 #define	OPEN4_SHARE_WANT_WRITE_DELEG	0x0200
1782 #define	OPEN4_SHARE_WANT_ANY_DELEG	0x0300
1783 #define	OPEN4_SHARE_WANT_NO_DELEG	0x0400
1784 #define	OPEN4_SHARE_WANT_CANCEL		0x0500
1785 
1786 #define	OPEN4_SHARE_WHEN_MASK			  0xF0000
1787 #define	OPEN4_SHARE_SIGNAL_DELEG_WHEN_RESRC_AVAIL 0x10000
1788 #define	OPEN4_SHARE_PUSH_DELEG_WHEN_UNCONTENDED   0x20000
1789 
1790 enum open_delegation_type4 {
1791 	OPEN_DELEGATE_NONE = 0,
1792 	OPEN_DELEGATE_READ = 1,
1793 	OPEN_DELEGATE_WRITE = 2,
1794 	OPEN_DELEGATE_NONE_EXT = 3
1795 };
1796 typedef enum open_delegation_type4 open_delegation_type4;
1797 
1798 enum open_claim_type4 {
1799 	CLAIM_NULL = 0,
1800 	CLAIM_PREVIOUS = 1,
1801 	CLAIM_DELEGATE_CUR = 2,
1802 	CLAIM_DELEGATE_PREV = 3,
1803 	CLAIM_FH = 4,
1804 	CLAIM_DELEG_CUR_FH = 5,
1805 	CLAIM_DELEG_PREV_FH = 6
1806 };
1807 typedef enum open_claim_type4 open_claim_type4;
1808 
1809 struct open_claim_delegate_cur4 {
1810 	stateid4 delegate_stateid;
1811 	component4 file;
1812 };
1813 typedef struct open_claim_delegate_cur4 open_claim_delegate_cur4;
1814 
1815 struct copen_claim_delegate_cur4 {
1816 	stateid4 delegate_stateid;
1817 	char *cfile;
1818 };
1819 typedef struct copen_claim_delegate_cur4 copen_claim_delegate_cur4;
1820 
1821 struct open_claim4 {
1822 	open_claim_type4 claim;
1823 	union {
1824 		component4 file;
1825 		open_delegation_type4 delegate_type;
1826 		open_claim_delegate_cur4 delegate_cur_info;
1827 		component4 file_delegate_prev;
1828 		stateid4 oc_delegate_stateid;
1829 	} open_claim4_u;
1830 };
1831 typedef struct open_claim4 open_claim4;
1832 
1833 struct OPEN4args {
1834 	seqid4 seqid;
1835 	uint32_t share_access;
1836 	uint32_t deleg_want;	/* nfsv4.1 */
1837 	uint32_t share_deny;
1838 	open_owner4 owner;
1839 	opentype4 opentype;
1840 	createmode4 mode;
1841 	union {
1842 		fattr4 createattrs;
1843 		verifier4 createverf;
1844 		creatverfattr ch_createboth; /* for nfsv4.1 */
1845 	} createhow4_u;
1846 	open_claim4 claim;
1847 };
1848 typedef struct OPEN4args OPEN4args;
1849 
1850 struct OPEN4cargs {
1851 	seqid4 seqid;
1852 	uint32_t share_access;
1853 	uint32_t share_deny;
1854 	open_owner4 owner;
1855 	opentype4 opentype;
1856 	createmode4 mode;
1857 	union {
1858 		fattr4 createattrs;
1859 		verifier4 createverf;
1860 	} createhow4_u;
1861 	open_claim_type4 claim;
1862 	union {
1863 		char *cfile;
1864 		open_delegation_type4 delegate_type;
1865 		copen_claim_delegate_cur4 delegate_cur_info;
1866 		char *cfile_delegate_prev;
1867 	} open_claim4_u;
1868 };
1869 typedef struct OPEN4cargs OPEN4cargs;
1870 
1871 struct open_read_delegation4 {
1872 	stateid4 stateid;
1873 	bool_t recall;
1874 	nfsace4 permissions;
1875 };
1876 typedef struct open_read_delegation4 open_read_delegation4;
1877 
1878 struct open_write_delegation4 {
1879 	stateid4 stateid;
1880 	bool_t recall;
1881 	nfs_space_limit4 space_limit;
1882 	nfsace4 permissions;
1883 };
1884 typedef struct open_write_delegation4 open_write_delegation4;
1885 
1886 /* nfsv4.1 */
1887 enum why_no_delegation4 {
1888 	WND4_NOT_WANTED = 0,
1889 	WND4_CONTENTION = 1,
1890 	WND4_RESOURCE = 2,
1891 	WND4_NOT_SUPP_FTYPE = 3,
1892 	WND4_WRITE_DELEG_NOT_SUPP_FTYPE = 4,
1893 	WND4_NOT_SUPP_UPGRADE = 5,
1894 	WND4_NOT_SUPP_DOWNGRADE = 6,
1895 	WND4_CANCELLED = 7,
1896 	WND4_IS_DIR = 8
1897 };
1898 typedef enum why_no_delegation4 why_no_delegation4;
1899 
1900 struct open_none_delegation4 {
1901 	why_no_delegation4 ond_why;
1902 	union {
1903 		bool_t ond_server_will_push_deleg;
1904 		bool_t ond_server_will_signal_avail;
1905 	} open_none_delegation4_u;
1906 };
1907 typedef struct open_none_delegation4 open_none_delegation4;
1908 
1909 /* nfsv4.1 end */
1910 
1911 struct open_delegation4 {
1912 	open_delegation_type4 delegation_type;
1913 	union {
1914 		open_read_delegation4 read;
1915 		open_write_delegation4 write;
1916 		open_none_delegation4 od_whynone; /* nfsv4.1 */
1917 	} open_delegation4_u;
1918 };
1919 typedef struct open_delegation4 open_delegation4;
1920 #define	OPEN4_RESULT_CONFIRM 0x00000002
1921 #define	OPEN4_RESULT_LOCKTYPE_POSIX 0x00000004
1922 #define	OPEN4_RESULT_PRESERVE_UNLINKED 0x00000008 /* nfsv4.1 */
1923 #define	OPEN4_RESULT_MAY_NOTIFY_LOCK 0x00000020	  /* nfsv4.1 */
1924 
1925 struct OPEN4res {
1926 	nfsstat4 status;
1927 	stateid4 stateid;
1928 	change_info4 cinfo;
1929 	uint32_t rflags;
1930 	bitmap4 attrset;
1931 	open_delegation4 delegation;
1932 };
1933 typedef struct OPEN4res OPEN4res;
1934 
1935 struct OPENATTR4args {
1936 	bool_t createdir;
1937 };
1938 typedef struct OPENATTR4args OPENATTR4args;
1939 
1940 struct OPENATTR4res {
1941 	nfsstat4 status;
1942 };
1943 typedef struct OPENATTR4res OPENATTR4res;
1944 
1945 struct OPEN_CONFIRM4args {
1946 	stateid4 open_stateid;
1947 	seqid4 seqid;
1948 };
1949 typedef struct OPEN_CONFIRM4args OPEN_CONFIRM4args;
1950 
1951 struct OPEN_CONFIRM4res {
1952 	nfsstat4 status;
1953 	stateid4 open_stateid;
1954 };
1955 typedef struct OPEN_CONFIRM4res OPEN_CONFIRM4res;
1956 
1957 struct OPEN_DOWNGRADE4args {
1958 	stateid4 open_stateid;
1959 	seqid4 seqid;
1960 	uint32_t share_access;
1961 	uint32_t deleg_want;	/* nfsv4.1 */
1962 	uint32_t share_deny;
1963 };
1964 typedef struct OPEN_DOWNGRADE4args OPEN_DOWNGRADE4args;
1965 
1966 struct OPEN_DOWNGRADE4res {
1967 	nfsstat4 status;
1968 	stateid4 open_stateid;
1969 };
1970 typedef struct OPEN_DOWNGRADE4res OPEN_DOWNGRADE4res;
1971 
1972 struct PUTFH4args {
1973 	nfs_fh4 object;
1974 };
1975 typedef struct PUTFH4args PUTFH4args;
1976 
1977 /*
1978  * Client only side PUTFH arguments
1979  * This is really a nfs4_sharedfh_t * but the forward declaration
1980  * is problematic;
1981  */
1982 struct PUTFH4cargs {
1983 	void *sfh;
1984 };
1985 typedef struct PUTFH4cargs PUTFH4cargs;
1986 
1987 struct PUTFH4res {
1988 	nfsstat4 status;
1989 };
1990 typedef struct PUTFH4res PUTFH4res;
1991 
1992 struct PUTPUBFH4res {
1993 	nfsstat4 status;
1994 };
1995 typedef struct PUTPUBFH4res PUTPUBFH4res;
1996 
1997 struct PUTROOTFH4res {
1998 	nfsstat4 status;
1999 };
2000 typedef struct PUTROOTFH4res PUTROOTFH4res;
2001 
2002 struct READ4args {
2003 	stateid4 stateid;
2004 	offset4 offset;
2005 	count4 count;
2006 	/* The following are used for the XDR decode path */
2007 	char *res_data_val_alt;
2008 	mblk_t *res_mblk;
2009 	struct uio *res_uiop;
2010 	uint_t res_maxsize;
2011 #ifdef _KERNEL
2012 	struct clist *wlist;
2013 	CONN *conn;
2014 #endif
2015 };
2016 typedef struct READ4args READ4args;
2017 
2018 struct READ4res {
2019 	nfsstat4 status;
2020 	bool_t eof;
2021 	uint_t data_len;
2022 	char *data_val;
2023 	mblk_t *mblk;
2024 #ifdef _KERNEL
2025 	struct clist *wlist;
2026 	uint_t wlist_len;
2027 #endif
2028 };
2029 typedef struct READ4res READ4res;
2030 
2031 struct rddir4_cache;
2032 
2033 struct READDIR4args {
2034 	nfs_cookie4 cookie;
2035 	verifier4 cookieverf;
2036 	count4 dircount;
2037 	count4 maxcount;
2038 	bitmap4 attr_request;
2039 	vnode_t *dvp;
2040 	struct mntinfo4 *mi;
2041 	cred_t *cr;
2042 	struct rddir4_cache *rdc;
2043 	hrtime_t t;
2044 };
2045 typedef struct READDIR4args READDIR4args;
2046 
2047 struct READDIR4res_clnt {
2048 	nfsstat4 status;
2049 	verifier4 cookieverf;
2050 	bool_t eof;
2051 	struct dirent64 *dotp, *dotdotp;
2052 	struct rddir4_cache *rdc;
2053 };
2054 typedef struct READDIR4res_clnt READDIR4res_clnt;
2055 
2056 struct READDIR4res {
2057 	nfsstat4 status;
2058 	verifier4 cookieverf;
2059 	mblk_t *mblk;
2060 	uint_t data_len;
2061 };
2062 typedef struct READDIR4res READDIR4res;
2063 
2064 struct READLINK4res {
2065 	nfsstat4 status;
2066 	linktext4 link;
2067 };
2068 typedef struct READLINK4res READLINK4res;
2069 
2070 struct REMOVE4args {
2071 	component4 target;
2072 };
2073 typedef struct REMOVE4args REMOVE4args;
2074 
2075 struct REMOVE4cargs {
2076 	char *ctarget;
2077 };
2078 typedef struct REMOVE4cargs REMOVE4cargs;
2079 
2080 struct REMOVE4res {
2081 	nfsstat4 status;
2082 	change_info4 cinfo;
2083 };
2084 typedef struct REMOVE4res REMOVE4res;
2085 
2086 struct RENAME4args {
2087 	component4 oldname;
2088 	component4 newname;
2089 };
2090 typedef struct RENAME4args RENAME4args;
2091 
2092 struct RENAME4cargs {
2093 	char *coldname;
2094 	char *cnewname;
2095 };
2096 typedef struct RENAME4cargs RENAME4cargs;
2097 
2098 struct RENAME4res {
2099 	nfsstat4 status;
2100 	change_info4 source_cinfo;
2101 	change_info4 target_cinfo;
2102 };
2103 typedef struct RENAME4res RENAME4res;
2104 
2105 struct RENEW4args {
2106 	clientid4 clientid;
2107 };
2108 typedef struct RENEW4args RENEW4args;
2109 
2110 struct RENEW4res {
2111 	nfsstat4 status;
2112 };
2113 typedef struct RENEW4res RENEW4res;
2114 
2115 struct RESTOREFH4res {
2116 	nfsstat4 status;
2117 };
2118 typedef struct RESTOREFH4res RESTOREFH4res;
2119 
2120 struct SAVEFH4res {
2121 	nfsstat4 status;
2122 };
2123 typedef struct SAVEFH4res SAVEFH4res;
2124 
2125 struct SECINFO4args {
2126 	component4 name;
2127 };
2128 typedef struct SECINFO4args SECINFO4args;
2129 
2130 struct SECINFO4cargs {
2131 	char *cname;
2132 };
2133 typedef struct SECINFO4cargs SECINFO4cargs;
2134 
2135 enum rpc_gss_svc_t {
2136 	RPC_GSS_SVC_NONE = 1,
2137 	RPC_GSS_SVC_INTEGRITY = 2,
2138 	RPC_GSS_SVC_PRIVACY = 3
2139 };
2140 typedef enum rpc_gss_svc_t rpc_gss_svc_t;
2141 
2142 struct rpcsec_gss_info {
2143 	sec_oid4 oid;
2144 	qop4 qop;
2145 	rpc_gss_svc_t service;
2146 };
2147 typedef struct rpcsec_gss_info rpcsec_gss_info;
2148 
2149 struct secinfo4 {
2150 	uint32_t flavor;
2151 	rpcsec_gss_info flavor_info;
2152 };
2153 typedef struct secinfo4 secinfo4;
2154 
2155 struct SECINFO4res {
2156 	nfsstat4 status;
2157 	uint_t SECINFO4resok_len;
2158 	secinfo4 *SECINFO4resok_val;
2159 };
2160 typedef struct SECINFO4res SECINFO4res;
2161 
2162 struct SETATTR4args {
2163 	stateid4 stateid;
2164 	fattr4 obj_attributes;
2165 };
2166 typedef struct SETATTR4args SETATTR4args;
2167 
2168 struct SETATTR4res {
2169 	nfsstat4 status;
2170 	bitmap4 attrsset;
2171 };
2172 typedef struct SETATTR4res SETATTR4res;
2173 
2174 struct SETCLIENTID4args {
2175 	nfs_client_id4 client;
2176 	cb_client4 callback;
2177 	uint32_t callback_ident;
2178 };
2179 typedef struct SETCLIENTID4args SETCLIENTID4args;
2180 
2181 struct SETCLIENTID4resok {
2182 	clientid4 clientid;
2183 	verifier4 setclientid_confirm;
2184 };
2185 typedef struct SETCLIENTID4resok SETCLIENTID4resok;
2186 
2187 struct SETCLIENTID4res {
2188 	nfsstat4 status;
2189 	union {
2190 		SETCLIENTID4resok resok4;
2191 		clientaddr4 client_using;
2192 	} SETCLIENTID4res_u;
2193 };
2194 typedef struct SETCLIENTID4res SETCLIENTID4res;
2195 
2196 struct SETCLIENTID_CONFIRM4args {
2197 	clientid4 clientid;
2198 	verifier4 setclientid_confirm;
2199 };
2200 typedef struct SETCLIENTID_CONFIRM4args SETCLIENTID_CONFIRM4args;
2201 
2202 struct SETCLIENTID_CONFIRM4res {
2203 	nfsstat4 status;
2204 };
2205 typedef struct SETCLIENTID_CONFIRM4res SETCLIENTID_CONFIRM4res;
2206 
2207 struct VERIFY4args {
2208 	fattr4 obj_attributes;
2209 };
2210 typedef struct VERIFY4args VERIFY4args;
2211 
2212 struct VERIFY4res {
2213 	nfsstat4 status;
2214 };
2215 typedef struct VERIFY4res VERIFY4res;
2216 
2217 /*
2218  * mblk doesn't go over the wire.  If non-NULL, it points to an mblk chain
2219  * for the write data.
2220  */
2221 
2222 struct WRITE4args {
2223 	stateid4 stateid;
2224 	offset4 offset;
2225 	stable_how4 stable;
2226 	uint_t data_len;
2227 	char *data_val;
2228 	mblk_t *mblk;
2229 #ifdef _KERNEL
2230 	struct clist *rlist;
2231 	CONN *conn;
2232 #endif
2233 };
2234 typedef struct WRITE4args WRITE4args;
2235 
2236 struct WRITE4res {
2237 	nfsstat4 status;
2238 	count4 count;
2239 	stable_how4 committed;
2240 	verifier4 writeverf;
2241 };
2242 typedef struct WRITE4res WRITE4res;
2243 
2244 struct RELEASE_LOCKOWNER4args {
2245 	lock_owner4 lock_owner;
2246 };
2247 typedef struct RELEASE_LOCKOWNER4args RELEASE_LOCKOWNER4args;
2248 
2249 struct RELEASE_LOCKOWNER4res {
2250 	nfsstat4 status;
2251 };
2252 typedef struct RELEASE_LOCKOWNER4res RELEASE_LOCKOWNER4res;
2253 
2254 struct ILLEGAL4res {
2255 	nfsstat4 status;
2256 };
2257 typedef struct ILLEGAL4res ILLEGAL4res;
2258 
2259 /*
2260  * New operations for nfsv4.1
2261  */
2262 typedef struct {
2263 	uint_t gsshandle4_t_len;
2264 	char *gsshandle4_t_val;
2265 } gsshandle4_t;
2266 
2267 struct gss_cb_handles4 {
2268 	rpc_gss_svc_t gcbp_service;
2269 	gsshandle4_t gcbp_handle_from_server;
2270 	gsshandle4_t gcbp_handle_from_client;
2271 };
2272 typedef struct gss_cb_handles4 gss_cb_handles4;
2273 
2274 struct callback_sec_parms4 {
2275 	uint32_t cb_secflavor;
2276 	union {
2277 		authsys_parms cbsp_sys_cred;
2278 		gss_cb_handles4 cbsp_gss_handles;
2279 	} callback_sec_parms4_u;
2280 };
2281 typedef struct callback_sec_parms4 callback_sec_parms4;
2282 
2283 struct BACKCHANNEL_CTL4args {
2284 	uint32_t bca_cb_program;
2285 	struct {
2286 		uint_t bca_sec_parms_len;
2287 		callback_sec_parms4 *bca_sec_parms_val;
2288 	} bca_sec_parms;
2289 };
2290 typedef struct BACKCHANNEL_CTL4args BACKCHANNEL_CTL4args;
2291 
2292 struct BACKCHANNEL_CTL4res {
2293 	nfsstat4 bcr_status;
2294 };
2295 typedef struct BACKCHANNEL_CTL4res BACKCHANNEL_CTL4res;
2296 
2297 enum channel_dir_from_client4 {
2298 	CDFC4_FORE = 0x1,
2299 	CDFC4_BACK = 0x2,
2300 	CDFC4_FORE_OR_BOTH = 0x3,
2301 	CDFC4_BACK_OR_BOTH = 0x7
2302 };
2303 typedef enum channel_dir_from_client4 channel_dir_from_client4;
2304 
2305 struct BIND_CONN_TO_SESSION4args {
2306 	sessionid4 bctsa_sessid;
2307 	channel_dir_from_client4 bctsa_dir;
2308 	bool_t bctsa_use_conn_in_rdma_mode;
2309 };
2310 typedef struct BIND_CONN_TO_SESSION4args BIND_CONN_TO_SESSION4args;
2311 
2312 enum channel_dir_from_server4 {
2313 	CDFS4_FORE = 0x1,
2314 	CDFS4_BACK = 0x2,
2315 	CDFS4_BOTH = 0x3
2316 };
2317 typedef enum channel_dir_from_server4 channel_dir_from_server4;
2318 
2319 struct BIND_CONN_TO_SESSION4resok {
2320 	sessionid4 bctsr_sessid;
2321 	channel_dir_from_server4 bctsr_dir;
2322 	bool_t bctsr_use_conn_in_rdma_mode;
2323 };
2324 typedef struct BIND_CONN_TO_SESSION4resok BIND_CONN_TO_SESSION4resok;
2325 
2326 struct BIND_CONN_TO_SESSION4res {
2327 	nfsstat4 bctsr_status;
2328 	union {
2329 		BIND_CONN_TO_SESSION4resok bctsr_resok4;
2330 	} BIND_CONN_TO_SESSION4res_u;
2331 };
2332 typedef struct BIND_CONN_TO_SESSION4res BIND_CONN_TO_SESSION4res;
2333 
2334 #define	EXCHGID4_FLAG_SUPP_MOVED_REFER	  0x00000001
2335 #define	EXCHGID4_FLAG_SUPP_MOVED_MIGR	  0x00000002
2336 #define	EXCHGID4_FLAG_BIND_PRINC_STATEID  0x00000100
2337 
2338 #define	EXCHGID4_FLAG_USE_NON_PNFS	  0x00010000
2339 #define	EXCHGID4_FLAG_USE_PNFS_MDS	  0x00020000
2340 #define	EXCHGID4_FLAG_USE_PNFS_DS	  0x00040000
2341 #define	EXCHGID4_FLAG_MASK_PNFS		  0x00070000
2342 
2343 #define	EXCHGID4_FLAG_UPD_CONFIRMED_REC_A 0x40000000
2344 #define	EXCHGID4_FLAG_CONFIRMED_R	  0x80000000
2345 
2346 #define	EXID4_FLAG_MASK		0x40070103
2347 
2348 struct state_protect_ops4 {
2349 	bitmap4 spo_must_enforce;
2350 	bitmap4 spo_must_allow;
2351 };
2352 typedef struct state_protect_ops4 state_protect_ops4;
2353 
2354 struct ssv_sp_parms4 {
2355 	state_protect_ops4 ssp_ops;
2356 	struct {
2357 		uint_t ssp_hash_algs_len;
2358 		sec_oid4 *ssp_hash_algs_val;
2359 	} ssp_hash_algs;
2360 	struct {
2361 		uint_t ssp_encr_algs_len;
2362 		sec_oid4 *ssp_encr_algs_val;
2363 	} ssp_encr_algs;
2364 	uint32_t ssp_window;
2365 	uint32_t ssp_num_gss_handles;
2366 };
2367 typedef struct ssv_sp_parms4 ssv_sp_parms4;
2368 
2369 enum state_protect_how4 {
2370 	SP4_NONE = 0,
2371 	SP4_MACH_CRED = 1,
2372 	SP4_SSV = 2
2373 };
2374 typedef enum state_protect_how4 state_protect_how4;
2375 
2376 struct state_protect4_a {
2377 	state_protect_how4 spa_how;
2378 	union {
2379 		state_protect_ops4 spa_mach_ops;
2380 		ssv_sp_parms4 spa_ssv_parms;
2381 	} state_protect4_a_u;
2382 };
2383 typedef struct state_protect4_a state_protect4_a;
2384 
2385 struct EXCHANGE_ID4args {
2386 	client_owner4 eia_clientowner;
2387 	uint32_t eia_flags;
2388 	state_protect4_a eia_state_protect;
2389 	struct {
2390 		uint_t eia_client_impl_id_len;
2391 		nfs_impl_id4 *eia_client_impl_id_val;
2392 	} eia_client_impl_id;
2393 };
2394 typedef struct EXCHANGE_ID4args EXCHANGE_ID4args;
2395 
2396 struct ssv_prot_info4 {
2397 	state_protect_ops4 spi_ops;
2398 	uint32_t spi_hash_alg;
2399 	uint32_t spi_encr_alg;
2400 	uint32_t spi_ssv_len;
2401 	uint32_t spi_window;
2402 	struct {
2403 		uint_t spi_handles_len;
2404 		gsshandle4_t *spi_handles_val;
2405 	} spi_handles;
2406 };
2407 typedef struct ssv_prot_info4 ssv_prot_info4;
2408 
2409 struct state_protect4_r {
2410 	state_protect_how4 spr_how;
2411 	union {
2412 		state_protect_ops4 spr_mach_ops;
2413 		ssv_prot_info4 spr_ssv_info;
2414 	} state_protect4_r_u;
2415 };
2416 typedef struct state_protect4_r state_protect4_r;
2417 
2418 struct EXCHANGE_ID4resok {
2419 	clientid4 eir_clientid;
2420 	sequenceid4 eir_sequenceid;
2421 	uint32_t eir_flags;
2422 	state_protect4_r eir_state_protect;
2423 	server_owner4 eir_server_owner;
2424 	struct eir_server_scope {
2425 		uint_t eir_server_scope_len;
2426 		char *eir_server_scope_val;
2427 	} eir_server_scope;
2428 	struct {
2429 		uint_t eir_server_impl_id_len;
2430 		nfs_impl_id4 *eir_server_impl_id_val;
2431 	} eir_server_impl_id;
2432 };
2433 typedef struct EXCHANGE_ID4resok EXCHANGE_ID4resok;
2434 
2435 struct EXCHANGE_ID4res {
2436 	nfsstat4 eir_status;
2437 	union {
2438 		EXCHANGE_ID4resok eir_resok4;
2439 	} EXCHANGE_ID4res_u;
2440 };
2441 typedef struct EXCHANGE_ID4res EXCHANGE_ID4res;
2442 
2443 struct channel_attrs4 {
2444 	count4 ca_headerpadsize;
2445 	count4 ca_maxrequestsize;
2446 	count4 ca_maxresponsesize;
2447 	count4 ca_maxresponsesize_cached;
2448 	count4 ca_maxoperations;
2449 	count4 ca_maxrequests;
2450 	struct {
2451 		uint_t ca_rdma_ird_len;
2452 		uint32_t *ca_rdma_ird_val;
2453 	} ca_rdma_ird;
2454 };
2455 typedef struct channel_attrs4 channel_attrs4;
2456 
2457 #define	CREATE_SESSION4_FLAG_PERSIST 0x00000001
2458 #define	CREATE_SESSION4_FLAG_CONN_BACK_CHAN 0x00000002
2459 #define	CREATE_SESSION4_FLAG_CONN_RDMA 0x00000004
2460 
2461 #define	CREATE_SESSION4_FLAG_MASK 0x07
2462 
2463 struct CREATE_SESSION4args {
2464 	clientid4 csa_clientid;
2465 	sequenceid4 csa_sequence;
2466 	uint32_t csa_flags;
2467 	channel_attrs4 csa_fore_chan_attrs;
2468 	channel_attrs4 csa_back_chan_attrs;
2469 	uint32_t csa_cb_program;
2470 	struct {
2471 		uint_t csa_sec_parms_len;
2472 		callback_sec_parms4 *csa_sec_parms_val;
2473 	} csa_sec_parms;
2474 };
2475 typedef struct CREATE_SESSION4args CREATE_SESSION4args;
2476 
2477 struct CREATE_SESSION4resok {
2478 	sessionid4 csr_sessionid;
2479 	sequenceid4 csr_sequence;
2480 	uint32_t csr_flags;
2481 	channel_attrs4 csr_fore_chan_attrs;
2482 	channel_attrs4 csr_back_chan_attrs;
2483 };
2484 typedef struct CREATE_SESSION4resok CREATE_SESSION4resok;
2485 
2486 struct CREATE_SESSION4res {
2487 	nfsstat4 csr_status;
2488 	union {
2489 		CREATE_SESSION4resok csr_resok4;
2490 	} CREATE_SESSION4res_u;
2491 };
2492 typedef struct CREATE_SESSION4res CREATE_SESSION4res;
2493 
2494 struct DESTROY_SESSION4args {
2495 	sessionid4 dsa_sessionid;
2496 };
2497 typedef struct DESTROY_SESSION4args DESTROY_SESSION4args;
2498 
2499 struct DESTROY_SESSION4res {
2500 	nfsstat4 dsr_status;
2501 };
2502 typedef struct DESTROY_SESSION4res DESTROY_SESSION4res;
2503 
2504 struct FREE_STATEID4args {
2505 	stateid4 fsa_stateid;
2506 };
2507 typedef struct FREE_STATEID4args FREE_STATEID4args;
2508 
2509 struct FREE_STATEID4res {
2510 	nfsstat4 fsr_status;
2511 };
2512 typedef struct FREE_STATEID4res FREE_STATEID4res;
2513 
2514 typedef nfstime4 attr_notice4;
2515 
2516 struct GET_DIR_DELEGATION4args {
2517 	bool_t gdda_signal_deleg_avail;
2518 	bitmap4 gdda_notification_types;
2519 	attr_notice4 gdda_child_attr_delay;
2520 	attr_notice4 gdda_dir_attr_delay;
2521 	bitmap4 gdda_child_attributes;
2522 	bitmap4 gdda_dir_attributes;
2523 };
2524 typedef struct GET_DIR_DELEGATION4args GET_DIR_DELEGATION4args;
2525 
2526 struct GET_DIR_DELEGATION4resok {
2527 	verifier4 gddr_cookieverf;
2528 	stateid4 gddr_stateid;
2529 	bitmap4 gddr_notification;
2530 	bitmap4 gddr_child_attributes;
2531 	bitmap4 gddr_dir_attributes;
2532 };
2533 typedef struct GET_DIR_DELEGATION4resok GET_DIR_DELEGATION4resok;
2534 
2535 enum gddrnf4_status {
2536 	GDD4_OK = 0,
2537 	GDD4_UNAVAIL = 1
2538 };
2539 typedef enum gddrnf4_status gddrnf4_status;
2540 
2541 struct GET_DIR_DELEGATION4res_non_fatal {
2542 	gddrnf4_status gddrnf_status;
2543 	union {
2544 		GET_DIR_DELEGATION4resok gddrnf_resok4;
2545 		bool_t gddrnf_will_signal_deleg_avail;
2546 	} GET_DIR_DELEGATION4res_non_fatal_u;
2547 };
2548 typedef struct GET_DIR_DELEGATION4res_non_fatal
2549     GET_DIR_DELEGATION4res_non_fatal;
2550 
2551 struct GET_DIR_DELEGATION4res {
2552 	nfsstat4 gddr_status;
2553 	union {
2554 		GET_DIR_DELEGATION4res_non_fatal gddr_res_non_fatal4;
2555 	} GET_DIR_DELEGATION4res_u;
2556 };
2557 typedef struct GET_DIR_DELEGATION4res GET_DIR_DELEGATION4res;
2558 
2559 struct GETDEVICEINFO4args {
2560 	deviceid4 gdia_device_id;
2561 	layouttype4 gdia_layout_type;
2562 	count4 gdia_maxcount;
2563 	bitmap4 gdia_notify_types;
2564 };
2565 typedef struct GETDEVICEINFO4args GETDEVICEINFO4args;
2566 
2567 struct GETDEVICEINFO4resok {
2568 	device_addr4 gdir_device_addr;
2569 	bitmap4 gdir_notification;
2570 };
2571 typedef struct GETDEVICEINFO4resok GETDEVICEINFO4resok;
2572 
2573 struct GETDEVICEINFO4res {
2574 	nfsstat4 gdir_status;
2575 	union {
2576 		GETDEVICEINFO4resok gdir_resok4;
2577 		count4 gdir_mincount;
2578 	} GETDEVICEINFO4res_u;
2579 };
2580 typedef struct GETDEVICEINFO4res GETDEVICEINFO4res;
2581 
2582 struct GETDEVICELIST4args {
2583 	layouttype4 gdla_layout_type;
2584 	count4 gdla_maxdevices;
2585 	nfs_cookie4 gdla_cookie;
2586 	verifier4 gdla_cookieverf;
2587 };
2588 typedef struct GETDEVICELIST4args GETDEVICELIST4args;
2589 
2590 struct GETDEVICELIST4resok {
2591 	nfs_cookie4 gdlr_cookie;
2592 	verifier4 gdlr_cookieverf;
2593 	struct {
2594 		uint_t gdlr_deviceid_list_len;
2595 		deviceid4 *gdlr_deviceid_list_val;
2596 	} gdlr_deviceid_list;
2597 	bool_t gdlr_eof;
2598 };
2599 typedef struct GETDEVICELIST4resok GETDEVICELIST4resok;
2600 
2601 struct GETDEVICELIST4res {
2602 	nfsstat4 gdlr_status;
2603 	union {
2604 		GETDEVICELIST4resok gdlr_resok4;
2605 	} GETDEVICELIST4res_u;
2606 };
2607 typedef struct GETDEVICELIST4res GETDEVICELIST4res;
2608 
2609 struct newtime4 {
2610 	bool_t nt_timechanged;
2611 	union {
2612 		nfstime4 nt_time;
2613 	} newtime4_u;
2614 };
2615 typedef struct newtime4 newtime4;
2616 
2617 struct newoffset4 {
2618 	bool_t no_newoffset;
2619 	union {
2620 		offset4 no_offset;
2621 	} newoffset4_u;
2622 };
2623 typedef struct newoffset4 newoffset4;
2624 
2625 struct LAYOUTCOMMIT4args {
2626 	offset4 loca_offset;
2627 	length4 loca_length;
2628 	bool_t loca_reclaim;
2629 	stateid4 loca_stateid;
2630 	newoffset4 loca_last_write_offset;
2631 	newtime4 loca_time_modify;
2632 	layoutupdate4 loca_layoutupdate;
2633 };
2634 typedef struct LAYOUTCOMMIT4args LAYOUTCOMMIT4args;
2635 
2636 struct newsize4 {
2637 	bool_t ns_sizechanged;
2638 	union {
2639 		length4 ns_size;
2640 	} newsize4_u;
2641 };
2642 typedef struct newsize4 newsize4;
2643 
2644 struct LAYOUTCOMMIT4resok {
2645 	newsize4 locr_newsize;
2646 };
2647 typedef struct LAYOUTCOMMIT4resok LAYOUTCOMMIT4resok;
2648 
2649 struct LAYOUTCOMMIT4res {
2650 	nfsstat4 locr_status;
2651 	union {
2652 		LAYOUTCOMMIT4resok locr_resok4;
2653 	} LAYOUTCOMMIT4res_u;
2654 };
2655 typedef struct LAYOUTCOMMIT4res LAYOUTCOMMIT4res;
2656 
2657 struct LAYOUTGET4args {
2658 	bool_t loga_signal_layout_avail;
2659 	layouttype4 loga_layout_type;
2660 	layoutiomode4 loga_iomode;
2661 	offset4 loga_offset;
2662 	length4 loga_length;
2663 	length4 loga_minlength;
2664 	stateid4 loga_stateid;
2665 	count4 loga_maxcount;
2666 };
2667 typedef struct LAYOUTGET4args LAYOUTGET4args;
2668 
2669 struct LAYOUTGET4resok {
2670 	bool_t logr_return_on_close;
2671 	stateid4 logr_stateid;
2672 	struct {
2673 		uint_t logr_layout_len;
2674 		layout4 *logr_layout_val;
2675 	} logr_layout;
2676 };
2677 typedef struct LAYOUTGET4resok LAYOUTGET4resok;
2678 
2679 struct LAYOUTGET4res {
2680 	nfsstat4 logr_status;
2681 	union {
2682 		LAYOUTGET4resok logr_resok4;
2683 		bool_t logr_will_signal_layout_avail;
2684 	} LAYOUTGET4res_u;
2685 };
2686 typedef struct LAYOUTGET4res LAYOUTGET4res;
2687 
2688 struct LAYOUTRETURN4args {
2689 	bool_t lora_reclaim;
2690 	layouttype4 lora_layout_type;
2691 	layoutiomode4 lora_iomode;
2692 	layoutreturn4 lora_layoutreturn;
2693 };
2694 typedef struct LAYOUTRETURN4args LAYOUTRETURN4args;
2695 
2696 struct layoutreturn_stateid {
2697 	bool_t lrs_present;
2698 	union {
2699 		stateid4 lrs_stateid;
2700 	} layoutreturn_stateid_u;
2701 };
2702 typedef struct layoutreturn_stateid layoutreturn_stateid;
2703 
2704 struct LAYOUTRETURN4res {
2705 	nfsstat4 lorr_status;
2706 	union {
2707 		layoutreturn_stateid lorr_stateid;
2708 	} LAYOUTRETURN4res_u;
2709 };
2710 typedef struct LAYOUTRETURN4res LAYOUTRETURN4res;
2711 
2712 enum secinfo_style4 {
2713 	SECINFO_STYLE4_CURRENT_FH = 0,
2714 	SECINFO_STYLE4_PARENT = 1
2715 };
2716 typedef enum secinfo_style4 secinfo_style4;
2717 
2718 typedef secinfo_style4 SECINFO_NO_NAME4args;
2719 
2720 typedef SECINFO4res SECINFO_NO_NAME4res;
2721 
2722 struct SEQUENCE4args {
2723 	sessionid4 sa_sessionid;
2724 	sequenceid4 sa_sequenceid;
2725 	slotid4 sa_slotid;
2726 	slotid4 sa_highest_slotid;
2727 	bool_t sa_cachethis;
2728 };
2729 typedef struct SEQUENCE4args SEQUENCE4args;
2730 #define	SEQ4_STATUS_CB_PATH_DOWN 0x00000001
2731 #define	SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRING 0x00000002
2732 #define	SEQ4_STATUS_CB_GSS_CONTEXTS_EXPIRED 0x00000004
2733 #define	SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED 0x00000008
2734 #define	SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED 0x00000010
2735 #define	SEQ4_STATUS_ADMIN_STATE_REVOKED 0x00000020
2736 #define	SEQ4_STATUS_RECALLABLE_STATE_REVOKED 0x00000040
2737 #define	SEQ4_STATUS_LEASE_MOVED 0x00000080
2738 #define	SEQ4_STATUS_RESTART_RECLAIM_NEEDED 0x00000100
2739 #define	SEQ4_STATUS_CB_PATH_DOWN_SESSION 0x00000200
2740 #define	SEQ4_STATUS_BACKCHANNEL_FAULT 0x00000400
2741 #define	SEQ4_STATUS_DEVID_CHANGED 0x00000800
2742 #define	SEQ4_STATUS_DEVID_DELETED 0x00001000
2743 #define	SEQ4_HIGH_BIT SEQ4_STATUS_DEVID_DELETED /* highest defined flag */
2744 
2745 struct SEQUENCE4resok {
2746 	sessionid4 sr_sessionid;
2747 	sequenceid4 sr_sequenceid;
2748 	slotid4 sr_slotid;
2749 	slotid4 sr_highest_slotid;
2750 	slotid4 sr_target_highest_slotid;
2751 	uint32_t sr_status_flags;
2752 };
2753 typedef struct SEQUENCE4resok SEQUENCE4resok;
2754 
2755 struct SEQUENCE4res {
2756 	nfsstat4 sr_status;
2757 	union {
2758 		SEQUENCE4resok sr_resok4;
2759 	} SEQUENCE4res_u;
2760 };
2761 typedef struct SEQUENCE4res SEQUENCE4res;
2762 
2763 struct ssa_digest_input4 {
2764 	SEQUENCE4args sdi_seqargs;
2765 };
2766 typedef struct ssa_digest_input4 ssa_digest_input4;
2767 
2768 struct SET_SSV4args {
2769 	struct {
2770 		uint_t ssa_ssv_len;
2771 		char *ssa_ssv_val;
2772 	} ssa_ssv;
2773 	struct {
2774 		uint_t ssa_digest_len;
2775 		char *ssa_digest_val;
2776 	} ssa_digest;
2777 };
2778 typedef struct SET_SSV4args SET_SSV4args;
2779 
2780 struct ssr_digest_input4 {
2781 	SEQUENCE4res sdi_seqres;
2782 };
2783 typedef struct ssr_digest_input4 ssr_digest_input4;
2784 
2785 struct SET_SSV4resok {
2786 	struct {
2787 		uint_t ssr_digest_len;
2788 		char *ssr_digest_val;
2789 	} ssr_digest;
2790 };
2791 typedef struct SET_SSV4resok SET_SSV4resok;
2792 
2793 struct SET_SSV4res {
2794 	nfsstat4 ssr_status;
2795 	union {
2796 		SET_SSV4resok ssr_resok4;
2797 	} SET_SSV4res_u;
2798 };
2799 typedef struct SET_SSV4res SET_SSV4res;
2800 
2801 struct TEST_STATEID4args {
2802 	struct {
2803 		uint_t ts_stateids_len;
2804 		stateid4 *ts_stateids_val;
2805 	} ts_stateids;
2806 };
2807 typedef struct TEST_STATEID4args TEST_STATEID4args;
2808 
2809 struct TEST_STATEID4resok {
2810 	struct {
2811 		uint_t tsr_status_codes_len;
2812 		nfsstat4 *tsr_status_codes_val;
2813 	} tsr_status_codes;
2814 };
2815 typedef struct TEST_STATEID4resok TEST_STATEID4resok;
2816 
2817 struct TEST_STATEID4res {
2818 	nfsstat4 tsr_status;
2819 	union {
2820 		TEST_STATEID4resok tsr_resok4;
2821 	} TEST_STATEID4res_u;
2822 };
2823 typedef struct TEST_STATEID4res TEST_STATEID4res;
2824 
2825 struct deleg_claim4 {
2826 	open_claim_type4 dc_claim;
2827 	union {
2828 		open_delegation_type4 dc_delegate_type;
2829 	} deleg_claim4_u;
2830 };
2831 typedef struct deleg_claim4 deleg_claim4;
2832 
2833 struct WANT_DELEGATION4args {
2834 	uint32_t wda_want;
2835 	deleg_claim4 wda_claim;
2836 };
2837 typedef struct WANT_DELEGATION4args WANT_DELEGATION4args;
2838 
2839 struct WANT_DELEGATION4res {
2840 	nfsstat4 wdr_status;
2841 	union {
2842 		open_delegation4 wdr_resok4;
2843 	} WANT_DELEGATION4res_u;
2844 };
2845 typedef struct WANT_DELEGATION4res WANT_DELEGATION4res;
2846 
2847 struct DESTROY_CLIENTID4args {
2848 	clientid4 dca_clientid;
2849 };
2850 typedef struct DESTROY_CLIENTID4args DESTROY_CLIENTID4args;
2851 
2852 struct DESTROY_CLIENTID4res {
2853 	nfsstat4 dcr_status;
2854 };
2855 typedef struct DESTROY_CLIENTID4res DESTROY_CLIENTID4res;
2856 
2857 struct RECLAIM_COMPLETE4args {
2858 	bool_t rca_one_fs;
2859 };
2860 typedef struct RECLAIM_COMPLETE4args RECLAIM_COMPLETE4args;
2861 
2862 struct RECLAIM_COMPLETE4res {
2863 	nfsstat4 rcr_status;
2864 };
2865 typedef struct RECLAIM_COMPLETE4res RECLAIM_COMPLETE4res;
2866 
2867 /*
2868  * New operations for nfsv4.2
2869  */
2870 
2871 struct CLONE4args {
2872 	stateid4 cl_src_stateid;
2873 	stateid4 cl_dst_stateid;
2874 	offset4 cl_src_offset;
2875 	offset4 cl_dst_offset;
2876 	length4 cl_count;
2877 };
2878 typedef struct CLONE4args CLONE4args;
2879 
2880 struct CLONE4res {
2881 	nfsstat4 cl_status;
2882 };
2883 typedef struct CLONE4res CLONE4res;
2884 
2885 struct COPY4args {
2886 	stateid4 ca_src_stateid;
2887 	stateid4 ca_dst_stateid;
2888 	offset4 ca_src_offset;
2889 	offset4 ca_dst_offset;
2890 	length4 ca_count;
2891 	bool_t ca_consecutive;
2892 	bool_t ca_synchronous;
2893 	struct {
2894 		uint_t ca_source_server_len;
2895 		netloc4 *ca_source_server_val;
2896 	} ca_source_server;
2897 };
2898 typedef struct COPY4args COPY4args;
2899 
2900 struct copy_requirements4 {
2901 	bool_t cr_consecutive;
2902 	bool_t cr_synchronous;
2903 };
2904 typedef struct copy_requirements4 copy_requirements4;
2905 
2906 struct COPY4resok {
2907 	write_response4 cr_response;
2908 	copy_requirements4 cr_requirements;
2909 };
2910 typedef struct COPY4resok COPY4resok;
2911 
2912 struct COPY4res {
2913 	nfsstat4 cr_status;
2914 	union {
2915 		COPY4resok cr_resok4;
2916 		copy_requirements4 cr_requirements;
2917 	} COPY4res_u;
2918 };
2919 typedef struct COPY4res COPY4res;
2920 
2921 struct COPY_NOTIFY4args {
2922 	stateid4 cna_src_stateid;
2923 	netloc4 cna_destination_server;
2924 };
2925 typedef struct COPY_NOTIFY4args COPY_NOTIFY4args;
2926 
2927 struct COPY_NOTIFY4resok {
2928 	nfstime4 cnr_lease_time;
2929 	stateid4 cnr_stateid;
2930 	struct {
2931 		uint_t cnr_source_server_len;
2932 		netloc4 *cnr_source_server_val;
2933 	} cnr_source_server;
2934 };
2935 typedef struct COPY_NOTIFY4resok COPY_NOTIFY4resok;
2936 
2937 struct COPY_NOTIFY4res {
2938 	nfsstat4 cnr_status;
2939 	union {
2940 		COPY_NOTIFY4resok resok4;
2941 	} COPY_NOTIFY4res_u;
2942 };
2943 typedef struct COPY_NOTIFY4res COPY_NOTIFY4res;
2944 
2945 struct OFFLOAD_CANCEL4args {
2946 	stateid4 oca_stateid;
2947 };
2948 typedef struct OFFLOAD_CANCEL4args OFFLOAD_CANCEL4args;
2949 
2950 struct OFFLOAD_CANCEL4res {
2951 	nfsstat4 ocr_status;
2952 };
2953 typedef struct OFFLOAD_CANCEL4res OFFLOAD_CANCEL4res;
2954 
2955 struct OFFLOAD_STATUS4args {
2956 	stateid4 osa_stateid;
2957 };
2958 typedef struct OFFLOAD_STATUS4args OFFLOAD_STATUS4args;
2959 
2960 struct OFFLOAD_STATUS4resok {
2961 	length4 osr_count;
2962 	struct {
2963 		uint_t osr_complete_len;
2964 		nfsstat4 *osr_complete_val;
2965 	} osr_complete;
2966 };
2967 typedef struct OFFLOAD_STATUS4resok OFFLOAD_STATUS4resok;
2968 
2969 struct OFFLOAD_STATUS4res {
2970 	nfsstat4 osr_status;
2971 	union {
2972 		OFFLOAD_STATUS4resok osr_resok4;
2973 	} OFFLOAD_STATUS4res_u;
2974 };
2975 typedef struct OFFLOAD_STATUS4res OFFLOAD_STATUS4res;
2976 
2977 struct ALLOCATE4args {
2978 	stateid4 aa_stateid;
2979 	offset4 aa_offset;
2980 	length4 aa_length;
2981 };
2982 typedef struct ALLOCATE4args ALLOCATE4args;
2983 
2984 struct ALLOCATE4res {
2985 	nfsstat4 ar_status;
2986 };
2987 typedef struct ALLOCATE4res ALLOCATE4res;
2988 
2989 struct DEALLOCATE4args {
2990 	stateid4 da_stateid;
2991 	offset4 da_offset;
2992 	length4 da_length;
2993 };
2994 typedef struct DEALLOCATE4args DEALLOCATE4args;
2995 
2996 struct DEALLOCATE4res {
2997 	nfsstat4 dr_status;
2998 };
2999 typedef struct DEALLOCATE4res DEALLOCATE4res;
3000 
3001 enum IO_ADVISE_type4 {
3002 	IO_ADVISE4_NORMAL = 0,
3003 	IO_ADVISE4_SEQUENTIAL = 1,
3004 	IO_ADVISE4_SEQUENTIAL_BACKWARDS = 2,
3005 	IO_ADVISE4_RANDOM = 3,
3006 	IO_ADVISE4_WILLNEED = 4,
3007 	IO_ADVISE4_WILLNEED_OPPORTUNISTIC = 5,
3008 	IO_ADVISE4_DONTNEED = 6,
3009 	IO_ADVISE4_NOREUSE = 7,
3010 	IO_ADVISE4_READ = 8,
3011 	IO_ADVISE4_WRITE = 9,
3012 	IO_ADVISE4_INIT_PROXIMITY = 10
3013 };
3014 typedef enum IO_ADVISE_type4 IO_ADVISE_type4;
3015 
3016 struct IO_ADVISE4args {
3017 	stateid4 iaa_stateid;
3018 	offset4 iaa_offset;
3019 	length4 iaa_count;
3020 	bitmap4 iaa_hints;
3021 };
3022 typedef struct IO_ADVISE4args IO_ADVISE4args;
3023 
3024 struct IO_ADVISE4resok {
3025 	bitmap4 ior_hints;
3026 };
3027 typedef struct IO_ADVISE4resok IO_ADVISE4resok;
3028 
3029 struct IO_ADVISE4res {
3030 	nfsstat4 ior_status;
3031 	union {
3032 		IO_ADVISE4resok resok4;
3033 	} IO_ADVISE4res_u;
3034 };
3035 typedef struct IO_ADVISE4res IO_ADVISE4res;
3036 
3037 struct device_error4 {
3038 	deviceid4 de_deviceid;
3039 	nfsstat4 de_status;
3040 	nfs_opnum4 de_opnum;
3041 };
3042 typedef struct device_error4 device_error4;
3043 
3044 struct LAYOUTERROR4args {
3045 	offset4 lea_offset;
3046 	length4 lea_length;
3047 	stateid4 lea_stateid;
3048 	struct {
3049 		uint_t lea_errors_len;
3050 		device_error4 *lea_errors_val;
3051 	} lea_errors;
3052 };
3053 typedef struct LAYOUTERROR4args LAYOUTERROR4args;
3054 
3055 struct LAYOUTERROR4res {
3056 	nfsstat4 ler_status;
3057 };
3058 typedef struct LAYOUTERROR4res LAYOUTERROR4res;
3059 
3060 struct io_info4 {
3061 	uint64_t ii_count;
3062 	uint64_t ii_bytes;
3063 };
3064 typedef struct io_info4 io_info4;
3065 
3066 struct LAYOUTSTATS4args {
3067 	offset4 lsa_offset;
3068 	length4 lsa_length;
3069 	stateid4 lsa_stateid;
3070 	io_info4 lsa_read;
3071 	io_info4 lsa_write;
3072 	deviceid4 lsa_deviceid;
3073 	layoutupdate4 lsa_layoutupdate;
3074 };
3075 typedef struct LAYOUTSTATS4args LAYOUTSTATS4args;
3076 
3077 struct LAYOUTSTATS4res {
3078 	nfsstat4 lsr_status;
3079 };
3080 typedef struct LAYOUTSTATS4res LAYOUTSTATS4res;
3081 
3082 struct READ_PLUS4args {
3083 	stateid4 rpa_stateid;
3084 	offset4 rpa_offset;
3085 	count4 rpa_count;
3086 };
3087 typedef struct READ_PLUS4args READ_PLUS4args;
3088 
3089 struct read_plus_content {
3090 	data_content4 rpc_content;
3091 	union {
3092 		data4 rpc_data;
3093 		data_info4 rpc_hole;
3094 	} read_plus_content_u;
3095 };
3096 typedef struct read_plus_content read_plus_content;
3097 
3098 struct read_plus_res4 {
3099 	bool_t rpr_eof;
3100 	struct {
3101 		uint_t rpr_contents_len;
3102 		read_plus_content *rpr_contents_val;
3103 	} rpr_contents;
3104 };
3105 typedef struct read_plus_res4 read_plus_res4;
3106 
3107 struct READ_PLUS4res {
3108 	nfsstat4 rp_status;
3109 	union {
3110 		read_plus_res4 rp_resok4;
3111 	} READ_PLUS4res_u;
3112 };
3113 typedef struct READ_PLUS4res READ_PLUS4res;
3114 
3115 struct SEEK4args {
3116 	stateid4 sa_stateid;
3117 	offset4 sa_offset;
3118 	data_content4 sa_what;
3119 };
3120 typedef struct SEEK4args SEEK4args;
3121 
3122 struct seek_res4 {
3123 	bool_t sr_eof;
3124 	offset4 sr_offset;
3125 };
3126 typedef struct seek_res4 seek_res4;
3127 
3128 struct SEEK4res {
3129 	nfsstat4 sa_status;
3130 	union {
3131 		seek_res4 resok4;
3132 	} SEEK4res_u;
3133 };
3134 typedef struct SEEK4res SEEK4res;
3135 
3136 struct WRITE_SAME4args {
3137 	stateid4 wsa_stateid;
3138 	stable_how4 wsa_stable;
3139 	app_data_block4 wsa_adb;
3140 };
3141 typedef struct WRITE_SAME4args WRITE_SAME4args;
3142 
3143 struct WRITE_SAME4res {
3144 	nfsstat4 wsr_status;
3145 	union {
3146 		write_response4 resok4;
3147 	} WRITE_SAME4res_u;
3148 };
3149 typedef struct WRITE_SAME4res WRITE_SAME4res;
3150 
3151 /* new operations for NFSv4.2 end */
3152 
3153 struct nfs_argop4 {
3154 	nfs_opnum4 argop;
3155 	union {
3156 		ACCESS4args opaccess;
3157 		CLOSE4args opclose;
3158 		COMMIT4args opcommit;
3159 		CREATE4args opcreate;
3160 		CREATE4cargs opccreate;
3161 		DELEGPURGE4args opdelegpurge;
3162 		DELEGRETURN4args opdelegreturn;
3163 		GETATTR4args opgetattr;
3164 		LINK4args oplink;
3165 		LINK4cargs opclink;
3166 		LOCK4args oplock;
3167 		LOCKT4args oplockt;
3168 		LOCKU4args oplocku;
3169 		LOOKUP4args oplookup;
3170 		LOOKUP4cargs opclookup;
3171 		NVERIFY4args opnverify;
3172 		OPEN4args opopen;
3173 		OPEN4cargs opcopen;
3174 		OPENATTR4args opopenattr;
3175 		OPEN_CONFIRM4args opopen_confirm;
3176 		OPEN_DOWNGRADE4args opopen_downgrade;
3177 		PUTFH4args opputfh;
3178 		PUTFH4cargs opcputfh;
3179 		READ4args opread;
3180 		READDIR4args opreaddir;
3181 		REMOVE4args opremove;
3182 		REMOVE4cargs opcremove;
3183 		RENAME4args oprename;
3184 		RENAME4cargs opcrename;
3185 		RENEW4args oprenew;
3186 		SECINFO4args opsecinfo;
3187 		SECINFO4cargs opcsecinfo;
3188 		SETATTR4args opsetattr;
3189 		SETCLIENTID4args opsetclientid;
3190 		SETCLIENTID_CONFIRM4args opsetclientid_confirm;
3191 		VERIFY4args opverify;
3192 		WRITE4args opwrite;
3193 		RELEASE_LOCKOWNER4args oprelease_lockowner;
3194 		BACKCHANNEL_CTL4args opbackchannel_ctl;		/* nfsv4.1 */
3195 		BIND_CONN_TO_SESSION4args opbind_conn_to_session;
3196 		EXCHANGE_ID4args opexchange_id;
3197 		CREATE_SESSION4args opcreate_session;
3198 		DESTROY_SESSION4args opdestroy_session;
3199 		FREE_STATEID4args opfree_stateid;
3200 		GET_DIR_DELEGATION4args opget_dir_delegation;
3201 		GETDEVICEINFO4args opgetdeviceinfo;
3202 		GETDEVICELIST4args opgetdevicelist;
3203 		LAYOUTCOMMIT4args oplayoutcommit;
3204 		LAYOUTGET4args oplayoutget;
3205 		LAYOUTRETURN4args oplayoutreturn;
3206 		SECINFO_NO_NAME4args opsecinfo_no_name;
3207 		SEQUENCE4args opsequence;
3208 		SET_SSV4args opset_ssv;
3209 		TEST_STATEID4args optest_stateid;
3210 		WANT_DELEGATION4args opwant_delegation;
3211 		DESTROY_CLIENTID4args opdestroy_clientid;
3212 		RECLAIM_COMPLETE4args opreclaim_complete;
3213 		/* nfsv4.2 */
3214 		ALLOCATE4args opallocate;
3215 		COPY4args opcopy;
3216 		COPY_NOTIFY4args opoffload_notify;
3217 		DEALLOCATE4args opdeallocate;
3218 		IO_ADVISE4args opio_advise;
3219 		LAYOUTERROR4args oplayouterror;
3220 		LAYOUTSTATS4args oplayoutstats;
3221 		OFFLOAD_CANCEL4args opoffload_cancel;
3222 		OFFLOAD_STATUS4args opoffload_status;
3223 		READ_PLUS4args opread_plus;
3224 		SEEK4args opseek;
3225 		WRITE_SAME4args opwrite_same;
3226 		CLONE4args opclone;
3227 	} nfs_argop4_u;
3228 };
3229 typedef struct nfs_argop4 nfs_argop4;
3230 
3231 struct nfs_resop4 {
3232 	nfs_opnum4 resop;
3233 	union {
3234 		ACCESS4res opaccess;
3235 		CLOSE4res opclose;
3236 		COMMIT4res opcommit;
3237 		CREATE4res opcreate;
3238 		DELEGPURGE4res opdelegpurge;
3239 		DELEGRETURN4res opdelegreturn;
3240 		GETATTR4res opgetattr;
3241 		GETFH4res opgetfh;
3242 		LINK4res oplink;
3243 		LOCK4res oplock;
3244 		LOCKT4res oplockt;
3245 		LOCKU4res oplocku;
3246 		LOOKUP4res oplookup;
3247 		LOOKUPP4res oplookupp;
3248 		NVERIFY4res opnverify;
3249 		OPEN4res opopen;
3250 		OPENATTR4res opopenattr;
3251 		OPEN_CONFIRM4res opopen_confirm;
3252 		OPEN_DOWNGRADE4res opopen_downgrade;
3253 		PUTFH4res opputfh;
3254 		PUTPUBFH4res opputpubfh;
3255 		PUTROOTFH4res opputrootfh;
3256 		READ4res opread;
3257 		READDIR4res opreaddir;
3258 		READDIR4res_clnt opreaddirclnt;
3259 		READLINK4res opreadlink;
3260 		REMOVE4res opremove;
3261 		RENAME4res oprename;
3262 		RENEW4res oprenew;
3263 		RESTOREFH4res oprestorefh;
3264 		SAVEFH4res opsavefh;
3265 		SECINFO4res opsecinfo;
3266 		SETATTR4res opsetattr;
3267 		SETCLIENTID4res opsetclientid;
3268 		SETCLIENTID_CONFIRM4res opsetclientid_confirm;
3269 		VERIFY4res opverify;
3270 		WRITE4res opwrite;
3271 		RELEASE_LOCKOWNER4res oprelease_lockowner;
3272 		BACKCHANNEL_CTL4res opbackchannel_ctl;		/* nfsv4.1 */
3273 		BIND_CONN_TO_SESSION4res opbind_conn_to_session;
3274 		EXCHANGE_ID4res opexchange_id;
3275 		CREATE_SESSION4res opcreate_session;
3276 		DESTROY_SESSION4res opdestroy_session;
3277 		FREE_STATEID4res opfree_stateid;
3278 		GET_DIR_DELEGATION4res opget_dir_delegation;
3279 		GETDEVICEINFO4res opgetdeviceinfo;
3280 		GETDEVICELIST4res opgetdevicelist;
3281 		LAYOUTCOMMIT4res oplayoutcommit;
3282 		LAYOUTGET4res oplayoutget;
3283 		LAYOUTRETURN4res oplayoutreturn;
3284 		SECINFO_NO_NAME4res opsecinfo_no_name;
3285 		SEQUENCE4res opsequence;
3286 		SET_SSV4res opset_ssv;
3287 		TEST_STATEID4res optest_stateid;
3288 		WANT_DELEGATION4res opwant_delegation;
3289 		DESTROY_CLIENTID4res opdestroy_clientid;
3290 		RECLAIM_COMPLETE4res opreclaim_complete;
3291 		/* nfsv4.2 */
3292 		ALLOCATE4res opallocate;
3293 		COPY4res opcopy;
3294 		COPY_NOTIFY4res opcopy_notify;
3295 		DEALLOCATE4res opdeallocate;
3296 		IO_ADVISE4res opio_advise;
3297 		LAYOUTERROR4res oplayouterror;
3298 		LAYOUTSTATS4res oplayoutstats;
3299 		OFFLOAD_CANCEL4res opoffload_cancel;
3300 		OFFLOAD_STATUS4res opoffload_status;
3301 		READ_PLUS4res opread_plus;
3302 		SEEK4res opseek;
3303 		WRITE_SAME4res opwrite_same;
3304 		CLONE4res opclone;
3305 
3306 		ILLEGAL4res opillegal;
3307 	} nfs_resop4_u;
3308 };
3309 typedef struct nfs_resop4 nfs_resop4;
3310 
3311 /*
3312  * Fixed size tag string for easy client encoding
3313  */
3314 struct _ctag {
3315 	int ct_type;
3316 	char *ct_str;
3317 	uint32_t ct_tag[3];
3318 };
3319 typedef struct _ctag ctag_t;
3320 
3321 /*
3322  * Client-only encode-only version
3323  */
3324 struct COMPOUND4args_clnt {
3325 	int ctag;
3326 	uint_t array_len;
3327 	nfs_argop4 *array;
3328 };
3329 typedef struct COMPOUND4args_clnt COMPOUND4args_clnt;
3330 
3331 struct COMPOUND4args {
3332 	utf8string tag;
3333 	uint32_t minorversion;
3334 	uint_t array_len;
3335 	nfs_argop4 *array;
3336 };
3337 typedef struct COMPOUND4args COMPOUND4args;
3338 
3339 struct COMPOUND4res_clnt {
3340 	nfsstat4 status;
3341 	uint_t array_len;
3342 	uint_t decode_len;
3343 	nfs_resop4 *array;
3344 	COMPOUND4args_clnt *argsp;
3345 };
3346 typedef struct COMPOUND4res_clnt COMPOUND4res_clnt;
3347 
3348 struct COMPOUND4res {
3349 	nfsstat4 status;
3350 	utf8string tag;
3351 	uint_t array_len;
3352 	nfs_resop4 *array;
3353 };
3354 typedef struct COMPOUND4res COMPOUND4res;
3355 
3356 struct CB_GETATTR4args {
3357 	nfs_fh4 fh;
3358 	bitmap4 attr_request;
3359 };
3360 typedef struct CB_GETATTR4args CB_GETATTR4args;
3361 
3362 struct CB_GETATTR4res {
3363 	nfsstat4 status;
3364 	fattr4 obj_attributes;
3365 };
3366 typedef struct CB_GETATTR4res CB_GETATTR4res;
3367 
3368 struct CB_RECALL4args {
3369 	stateid4 stateid;
3370 	bool_t truncate;
3371 	nfs_fh4 fh;
3372 };
3373 typedef struct CB_RECALL4args CB_RECALL4args;
3374 
3375 struct CB_RECALL4res {
3376 	nfsstat4 status;
3377 };
3378 typedef struct CB_RECALL4res CB_RECALL4res;
3379 
3380 struct CB_ILLEGAL4res {
3381 	nfsstat4 status;
3382 };
3383 typedef struct CB_ILLEGAL4res CB_ILLEGAL4res;
3384 
3385 /*
3386  * New to nfsv4.1
3387  */
3388 enum layoutrecall_type4 {
3389 	LAYOUTRECALL4_FILE = LAYOUT4_RET_REC_FILE,
3390 	LAYOUTRECALL4_FSID = LAYOUT4_RET_REC_FSID,
3391 	LAYOUTRECALL4_ALL = LAYOUT4_RET_REC_ALL
3392 };
3393 typedef enum layoutrecall_type4 layoutrecall_type4;
3394 
3395 struct layoutrecall_file4 {
3396 	nfs_fh4 lor_fh;
3397 	offset4 lor_offset;
3398 	length4 lor_length;
3399 	stateid4 lor_stateid;
3400 };
3401 typedef struct layoutrecall_file4 layoutrecall_file4;
3402 
3403 struct layoutrecall4 {
3404 	layoutrecall_type4 lor_recalltype;
3405 	union {
3406 		layoutrecall_file4 lor_layout;
3407 		fsid4 lor_fsid;
3408 	} layoutrecall4_u;
3409 };
3410 typedef struct layoutrecall4 layoutrecall4;
3411 
3412 struct CB_LAYOUTRECALL4args {
3413 	layouttype4 clora_type;
3414 	layoutiomode4 clora_iomode;
3415 	bool_t clora_changed;
3416 	layoutrecall4 clora_recall;
3417 };
3418 typedef struct CB_LAYOUTRECALL4args CB_LAYOUTRECALL4args;
3419 
3420 struct CB_LAYOUTRECALL4res {
3421 	nfsstat4 clorr_status;
3422 };
3423 typedef struct CB_LAYOUTRECALL4res CB_LAYOUTRECALL4res;
3424 
3425 enum notify_type4 {
3426 	NOTIFY4_CHANGE_CHILD_ATTRS = 0,
3427 	NOTIFY4_CHANGE_DIR_ATTRS = 1,
3428 	NOTIFY4_REMOVE_ENTRY = 2,
3429 	NOTIFY4_ADD_ENTRY = 3,
3430 	NOTIFY4_RENAME_ENTRY = 4,
3431 	NOTIFY4_CHANGE_COOKIE_VERIFIER = 5
3432 };
3433 typedef enum notify_type4 notify_type4;
3434 
3435 struct notify_entry4 {
3436 	component4 ne_file;
3437 	fattr4 ne_attrs;
3438 };
3439 typedef struct notify_entry4 notify_entry4;
3440 
3441 struct prev_entry4 {
3442 	notify_entry4 pe_prev_entry;
3443 	nfs_cookie4 pe_prev_entry_cookie;
3444 };
3445 typedef struct prev_entry4 prev_entry4;
3446 
3447 struct notify_remove4 {
3448 	notify_entry4 nrm_old_entry;
3449 	nfs_cookie4 nrm_old_entry_cookie;
3450 };
3451 typedef struct notify_remove4 notify_remove4;
3452 
3453 struct notify_add4 {
3454 	struct {
3455 		uint_t nad_old_entry_len;
3456 		notify_remove4 *nad_old_entry_val;
3457 	} nad_old_entry;
3458 	notify_entry4 nad_new_entry;
3459 	struct {
3460 		uint_t nad_new_entry_cookie_len;
3461 		nfs_cookie4 *nad_new_entry_cookie_val;
3462 } nad_new_entry_cookie;
3463 	struct {
3464 		uint_t nad_prev_entry_len;
3465 		prev_entry4 *nad_prev_entry_val;
3466 	} nad_prev_entry;
3467 	bool_t nad_last_entry;
3468 };
3469 typedef struct notify_add4 notify_add4;
3470 
3471 struct notify_attr4 {
3472 	notify_entry4 na_changed_entry;
3473 };
3474 typedef struct notify_attr4 notify_attr4;
3475 
3476 struct notify_rename4 {
3477 	notify_remove4 nrn_old_entry;
3478 	notify_add4 nrn_new_entry;
3479 };
3480 typedef struct notify_rename4 notify_rename4;
3481 
3482 struct notify_verifier4 {
3483 	verifier4 nv_old_cookieverf;
3484 	verifier4 nv_new_cookieverf;
3485 };
3486 typedef struct notify_verifier4 notify_verifier4;
3487 
3488 typedef struct {
3489 	uint_t notifylist4_len;
3490 	char *notifylist4_val;
3491 } notifylist4;
3492 
3493 struct notify4 {
3494 	bitmap4 notify_mask;
3495 	notifylist4 notify_vals;
3496 };
3497 typedef struct notify4 notify4;
3498 
3499 struct CB_NOTIFY4args {
3500 	stateid4 cna_stateid;
3501 	nfs_fh4 cna_fh;
3502 	struct {
3503 		uint_t cna_changes_len;
3504 		notify4 *cna_changes_val;
3505 	} cna_changes;
3506 };
3507 typedef struct CB_NOTIFY4args CB_NOTIFY4args;
3508 
3509 struct CB_NOTIFY4res {
3510 	nfsstat4 cnr_status;
3511 };
3512 typedef struct CB_NOTIFY4res CB_NOTIFY4res;
3513 
3514 struct CB_PUSH_DELEG4args {
3515 	nfs_fh4 cpda_fh;
3516 	open_delegation4 cpda_delegation;
3517 };
3518 typedef struct CB_PUSH_DELEG4args CB_PUSH_DELEG4args;
3519 
3520 struct CB_PUSH_DELEG4res {
3521 	nfsstat4 cpdr_status;
3522 };
3523 typedef struct CB_PUSH_DELEG4res CB_PUSH_DELEG4res;
3524 #define	RCA4_TYPE_MASK_RDATA_DLG 0
3525 #define	RCA4_TYPE_MASK_WDATA_DLG 1
3526 #define	RCA4_TYPE_MASK_DIR_DLG 2
3527 #define	RCA4_TYPE_MASK_FILE_LAYOUT 3
3528 #define	RCA4_TYPE_MASK_BLK_LAYOUT 4
3529 #define	RCA4_TYPE_MASK_OBJ_LAYOUT_MIN 8
3530 #define	RCA4_TYPE_MASK_OBJ_LAYOUT_MAX 9
3531 #define	RCA4_TYPE_MASK_OTHER_LAYOUT_MIN 12
3532 #define	RCA4_TYPE_MASK_OTHER_LAYOUT_MAX 15
3533 
3534 struct CB_RECALL_ANY4args {
3535 	uint32_t craa_objects_to_keep;
3536 	bitmap4 craa_type_mask;
3537 };
3538 typedef struct CB_RECALL_ANY4args CB_RECALL_ANY4args;
3539 
3540 struct CB_RECALL_ANY4res {
3541 	nfsstat4 crar_status;
3542 };
3543 typedef struct CB_RECALL_ANY4res CB_RECALL_ANY4res;
3544 
3545 typedef CB_RECALL_ANY4args CB_RECALLABLE_OBJ_AVAIL4args;
3546 
3547 struct CB_RECALLABLE_OBJ_AVAIL4res {
3548 	nfsstat4 croa_status;
3549 };
3550 typedef struct CB_RECALLABLE_OBJ_AVAIL4res CB_RECALLABLE_OBJ_AVAIL4res;
3551 
3552 struct CB_RECALL_SLOT4args {
3553 	slotid4 rsa_target_highest_slotid;
3554 };
3555 typedef struct CB_RECALL_SLOT4args CB_RECALL_SLOT4args;
3556 
3557 struct CB_RECALL_SLOT4res {
3558 	nfsstat4 rsr_status;
3559 };
3560 typedef struct CB_RECALL_SLOT4res CB_RECALL_SLOT4res;
3561 
3562 struct referring_call4 {
3563 	sequenceid4 rc_sequenceid;
3564 	slotid4 rc_slotid;
3565 };
3566 typedef struct referring_call4 referring_call4;
3567 
3568 struct referring_call_list4 {
3569 	sessionid4 rcl_sessionid;
3570 	struct {
3571 		uint_t rcl_referring_calls_len;
3572 		referring_call4 *rcl_referring_calls_val;
3573 	} rcl_referring_calls;
3574 };
3575 typedef struct referring_call_list4 referring_call_list4;
3576 
3577 struct CB_SEQUENCE4args {
3578 	sessionid4 csa_sessionid;
3579 	sequenceid4 csa_sequenceid;
3580 	slotid4 csa_slotid;
3581 	slotid4 csa_highest_slotid;
3582 	bool_t csa_cachethis;
3583 	struct {
3584 		uint_t csa_referring_call_lists_len;
3585 		referring_call_list4 *csa_referring_call_lists_val;
3586 	} csa_referring_call_lists;
3587 };
3588 typedef struct CB_SEQUENCE4args CB_SEQUENCE4args;
3589 
3590 struct CB_SEQUENCE4resok {
3591 	sessionid4 csr_sessionid;
3592 	sequenceid4 csr_sequenceid;
3593 	slotid4 csr_slotid;
3594 	slotid4 csr_highest_slotid;
3595 	slotid4 csr_target_highest_slotid;
3596 };
3597 typedef struct CB_SEQUENCE4resok CB_SEQUENCE4resok;
3598 
3599 struct CB_SEQUENCE4res {
3600 	nfsstat4 csr_status;
3601 	union {
3602 		CB_SEQUENCE4resok csr_resok4;
3603 	} CB_SEQUENCE4res_u;
3604 };
3605 typedef struct CB_SEQUENCE4res CB_SEQUENCE4res;
3606 
3607 struct CB_WANTS_CANCELLED4args {
3608 	bool_t cwca_contended_wants_cancelled;
3609 	bool_t cwca_resourced_wants_cancelled;
3610 };
3611 typedef struct CB_WANTS_CANCELLED4args CB_WANTS_CANCELLED4args;
3612 
3613 struct CB_WANTS_CANCELLED4res {
3614 	nfsstat4 cwcr_status;
3615 };
3616 typedef struct CB_WANTS_CANCELLED4res CB_WANTS_CANCELLED4res;
3617 
3618 struct CB_NOTIFY_LOCK4args {
3619 	nfs_fh4 cnla_fh;
3620 	lock_owner4 cnla_lock_owner;
3621 };
3622 typedef struct CB_NOTIFY_LOCK4args CB_NOTIFY_LOCK4args;
3623 
3624 struct CB_NOTIFY_LOCK4res {
3625 	nfsstat4 cnlr_status;
3626 };
3627 typedef struct CB_NOTIFY_LOCK4res CB_NOTIFY_LOCK4res;
3628 
3629 enum notify_deviceid_type4 {
3630 	NOTIFY_DEVICEID4_CHANGE = 1,
3631 	NOTIFY_DEVICEID4_DELETE = 2
3632 };
3633 typedef enum notify_deviceid_type4 notify_deviceid_type4;
3634 
3635 struct notify_deviceid_delete4 {
3636 	layouttype4 ndd_layouttype;
3637 	deviceid4 ndd_deviceid;
3638 };
3639 typedef struct notify_deviceid_delete4 notify_deviceid_delete4;
3640 
3641 struct notify_deviceid_change4 {
3642 	layouttype4 ndc_layouttype;
3643 	deviceid4 ndc_deviceid;
3644 	bool_t ndc_immediate;
3645 };
3646 typedef struct notify_deviceid_change4 notify_deviceid_change4;
3647 
3648 struct CB_NOTIFY_DEVICEID4args {
3649 	struct {
3650 		uint_t cnda_changes_len;
3651 		notify4 *cnda_changes_val;
3652 	} cnda_changes;
3653 };
3654 typedef struct CB_NOTIFY_DEVICEID4args CB_NOTIFY_DEVICEID4args;
3655 
3656 struct CB_NOTIFY_DEVICEID4res {
3657 	nfsstat4 cndr_status;
3658 };
3659 typedef struct CB_NOTIFY_DEVICEID4res CB_NOTIFY_DEVICEID4res;
3660 
3661 /* Callback operations new to NFSv4.1 */
3662 
3663 enum nfs_cb_opnum4 {
3664 	OP_CB_GETATTR = 3,
3665 	OP_CB_RECALL = 4,
3666 	OP_CB_LAYOUTRECALL = 5,
3667 	OP_CB_NOTIFY = 6,
3668 	OP_CB_PUSH_DELEG = 7,
3669 	OP_CB_RECALL_ANY = 8,
3670 	OP_CB_RECALLABLE_OBJ_AVAIL = 9,
3671 	OP_CB_RECALL_SLOT = 10,
3672 	OP_CB_SEQUENCE = 11,
3673 	OP_CB_WANTS_CANCELLED = 12,
3674 	OP_CB_NOTIFY_LOCK = 13,
3675 	OP_CB_NOTIFY_DEVICEID = 14,
3676 	OP_CB_OFFLOAD = 15,	/* nfsv4.2 */
3677 	OP_CB_ILLEGAL = 10044
3678 };
3679 typedef enum nfs_cb_opnum4 nfs_cb_opnum4;
3680 
3681 struct nfs_cb_argop4 {
3682 	uint_t argop;
3683 	union {
3684 		CB_GETATTR4args opcbgetattr;
3685 		CB_RECALL4args opcbrecall;
3686 		CB_LAYOUTRECALL4args opcblayoutrecall;
3687 		CB_NOTIFY4args opcbnotify;
3688 		CB_PUSH_DELEG4args opcbpush_deleg;
3689 		CB_RECALL_ANY4args opcbrecall_any;
3690 		CB_RECALLABLE_OBJ_AVAIL4args opcbrecallable_obj_avail;
3691 		CB_RECALL_SLOT4args opcbrecall_slot;
3692 		CB_SEQUENCE4args opcbsequence;
3693 		CB_WANTS_CANCELLED4args opcbwants_cancelled;
3694 		CB_NOTIFY_LOCK4args opcbnotify_lock;
3695 		CB_NOTIFY_DEVICEID4args opcbnotify_deviceid;
3696 	} nfs_cb_argop4_u;
3697 };
3698 typedef struct nfs_cb_argop4 nfs_cb_argop4;
3699 
3700 struct nfs_cb_resop4 {
3701 	uint_t resop;
3702 	union {
3703 		CB_GETATTR4res opcbgetattr;
3704 		CB_RECALL4res opcbrecall;
3705 		CB_LAYOUTRECALL4res opcblayoutrecall;
3706 		CB_NOTIFY4res opcbnotify;
3707 		CB_PUSH_DELEG4res opcbpush_deleg;
3708 		CB_RECALL_ANY4res opcbrecall_any;
3709 		CB_RECALLABLE_OBJ_AVAIL4res opcbrecallable_obj_avail;
3710 		CB_RECALL_SLOT4res opcbrecall_slot;
3711 		CB_SEQUENCE4res opcbsequence;
3712 		CB_WANTS_CANCELLED4res opcbwants_cancelled;
3713 		CB_NOTIFY_LOCK4res opcbnotify_lock;
3714 		CB_NOTIFY_DEVICEID4res opcbnotify_deviceid;
3715 		CB_ILLEGAL4res opcbillegal;
3716 	} nfs_cb_resop4_u;
3717 };
3718 typedef struct nfs_cb_resop4 nfs_cb_resop4;
3719 
3720 struct CB_COMPOUND4args {
3721 	utf8string tag;
3722 	uint32_t minorversion;
3723 	uint32_t callback_ident;
3724 	uint_t array_len;
3725 	nfs_cb_argop4 *array;
3726 };
3727 typedef struct CB_COMPOUND4args CB_COMPOUND4args;
3728 
3729 struct CB_COMPOUND4res {
3730 	nfsstat4 status;
3731 	utf8string tag;
3732 	uint_t array_len;
3733 	nfs_cb_resop4 *array;
3734 };
3735 typedef struct CB_COMPOUND4res CB_COMPOUND4res;
3736 
3737 #define	NFS4_PROGRAM		100003
3738 #define	NFS_V4			4
3739 #define	NFSPROC4_NULL		0
3740 #define	NFSPROC4_COMPOUND	1
3741 
3742 #define	NFS4_CALLBACK		0x40000000
3743 #define	NFS_CB			1
3744 #define	CB_NULL			0
3745 #define	CB_COMPOUND		1
3746 
3747 extern  bool_t xdr_bitmap4(XDR *, bitmap4 *);
3748 extern  bool_t xdr_utf8string(XDR *, utf8string *);
3749 extern  bool_t xdr_nfs_fh4(XDR *, nfs_fh4 *);
3750 extern  bool_t xdr_fattr4_fsid(XDR *, fattr4_fsid *);
3751 extern  bool_t xdr_fattr4_acl(XDR *, fattr4_acl *);
3752 extern  bool_t xdr_fattr4_fs_locations(XDR *, fattr4_fs_locations *);
3753 extern  bool_t xdr_fattr4_rawdev(XDR *, fattr4_rawdev *);
3754 extern  bool_t xdr_nfstime4(XDR *, nfstime4 *);
3755 extern  bool_t xdr_settime4(XDR *, settime4 *);
3756 extern  bool_t xdr_COMPOUND4args_clnt(XDR *, COMPOUND4args_clnt *);
3757 extern  bool_t xdr_COMPOUND4args_srv(XDR *, COMPOUND4args *);
3758 extern  bool_t xdr_COMPOUND4res_clnt(XDR *, COMPOUND4res_clnt *);
3759 extern  bool_t xdr_COMPOUND4res_srv(XDR *, COMPOUND4res *);
3760 extern  bool_t xdr_CB_COMPOUND4args_clnt(XDR *, CB_COMPOUND4args *);
3761 extern  bool_t xdr_CB_COMPOUND4args_srv(XDR *, CB_COMPOUND4args *);
3762 extern  bool_t xdr_CB_COMPOUND4res(XDR *, CB_COMPOUND4res *);
3763 
3764 /* New XDR to nfsv4.1 */
3765 extern  bool_t xdr_nfs_ftype4(XDR *, nfs_ftype4*);
3766 extern  bool_t xdr_nfsstat4(XDR *, nfsstat4*);
3767 extern  bool_t xdr_attrlist4(XDR *, attrlist4*);
3768 extern  bool_t xdr_bitmap4(XDR *, bitmap4*);
3769 extern  bool_t xdr_changeid4(XDR *, changeid4*);
3770 extern  bool_t xdr_clientid4(XDR *, clientid4*);
3771 extern  bool_t xdr_count4(XDR *, count4*);
3772 extern  bool_t xdr_length4(XDR *, length4*);
3773 extern  bool_t xdr_mode4(XDR *, mode4*);
3774 extern  bool_t xdr_nfs_cookie4(XDR *, nfs_cookie4*);
3775 extern  bool_t xdr_nfs_fh4(XDR *, nfs_fh4*);
3776 extern  bool_t xdr_offset4(XDR *, offset4*);
3777 extern  bool_t xdr_qop4(XDR *, qop4*);
3778 extern  bool_t xdr_sec_oid4(XDR *, sec_oid4*);
3779 extern  bool_t xdr_sequenceid4(XDR *, sequenceid4*);
3780 extern  bool_t xdr_seqid4(XDR *, seqid4*);
3781 extern  bool_t xdr_sessionid4(XDR *, sessionid4);
3782 extern  bool_t xdr_slotid4(XDR *, slotid4*);
3783 extern  bool_t xdr_utf8string(XDR *, utf8string*);
3784 extern  bool_t xdr_utf8str_cis(XDR *, utf8str_cis*);
3785 extern  bool_t xdr_utf8str_cs(XDR *, utf8str_cs*);
3786 extern  bool_t xdr_utf8str_mixed(XDR *, utf8str_mixed*);
3787 extern  bool_t xdr_component4(XDR *, component4*);
3788 extern  bool_t xdr_linktext4(XDR *, linktext4*);
3789 extern  bool_t xdr_pathname4(XDR *, pathname4*);
3790 extern  bool_t xdr_verifier4(XDR *, verifier4*);
3791 extern  bool_t xdr_nfstime4(XDR *, nfstime4*);
3792 extern  bool_t xdr_time_how4(XDR *, time_how4*);
3793 extern  bool_t xdr_settime4(XDR *, settime4*);
3794 extern  bool_t xdr_nfs_lease4(XDR *, nfs_lease4*);
3795 extern  bool_t xdr_fsid4(XDR *, fsid4*);
3796 extern  bool_t xdr_change_policy4(XDR *, change_policy4*);
3797 extern  bool_t xdr_fs_locations4(XDR *, fs_locations4*);
3798 extern  bool_t xdr_acetype4(XDR *, acetype4*);
3799 extern  bool_t xdr_aceflag4(XDR *, aceflag4*);
3800 extern  bool_t xdr_acemask4(XDR *, acemask4*);
3801 extern  bool_t xdr_nfsace4(XDR *, nfsace4*);
3802 extern  bool_t xdr_aclflag4(XDR *, aclflag4*);
3803 extern  bool_t xdr_nfsacl41(XDR *, nfsacl41*);
3804 extern  bool_t xdr_mode_masked4(XDR *, mode_masked4*);
3805 extern  bool_t xdr_specdata4(XDR *, specdata4*);
3806 extern  bool_t xdr_netaddr4(XDR *, netaddr4*);
3807 extern  bool_t xdr_nfs_impl_id4(XDR *, nfs_impl_id4*);
3808 extern  bool_t xdr_stateid4(XDR *, stateid4*);
3809 extern  bool_t xdr_layouttype4(XDR *, layouttype4*);
3810 extern  bool_t xdr_layout_content4(XDR *, layout_content4*);
3811 extern  bool_t xdr_layouthint4(XDR *, layouthint4*);
3812 extern  bool_t xdr_layoutiomode4(XDR *, layoutiomode4*);
3813 extern  bool_t xdr_layout4(XDR *, layout4*);
3814 extern  bool_t xdr_deviceid4(XDR *, deviceid4);
3815 extern  bool_t xdr_device_addr4(XDR *, device_addr4*);
3816 extern  bool_t xdr_layoutupdate4(XDR *, layoutupdate4*);
3817 extern  bool_t xdr_layoutreturn_type4(XDR *, layoutreturn_type4*);
3818 extern  bool_t xdr_layoutreturn_file4(XDR *, layoutreturn_file4*);
3819 extern  bool_t xdr_layoutreturn4(XDR *, layoutreturn4*);
3820 extern  bool_t xdr_fs4_status_type(XDR *, fs4_status_type*);
3821 extern  bool_t xdr_fs4_status(XDR *, fs4_status*);
3822 extern  bool_t xdr_threshold4_read_size(XDR *, threshold4_read_size*);
3823 extern  bool_t xdr_threshold4_write_size(XDR *, threshold4_write_size*);
3824 extern  bool_t xdr_threshold4_read_iosize(XDR *, threshold4_read_iosize*);
3825 extern  bool_t xdr_threshold4_write_iosize(XDR *, threshold4_write_iosize*);
3826 extern  bool_t xdr_threshold_item4(XDR *, threshold_item4*);
3827 extern  bool_t xdr_mdsthreshold4(XDR *, mdsthreshold4*);
3828 extern  bool_t xdr_retention_get4(XDR *, retention_get4*);
3829 extern  bool_t xdr_retention_set4(XDR *, retention_set4*);
3830 extern  bool_t xdr_fs_charset_cap4(XDR *, fs_charset_cap4*);
3831 extern  bool_t xdr_netloc_type4(XDR *, netloc_type4*);
3832 extern  bool_t xdr_netloc4(XDR *, netloc4*);
3833 extern  bool_t xdr_change_attr_type4(XDR *, change_attr_type4*);
3834 /* extern  bool_t xdr_labelformat_spec4(XDR *, labelformat_spec4*); */
3835 extern  bool_t xdr_sec_label4(XDR *, sec_label4*);
3836 extern  bool_t xdr_app_data_block4(XDR *, app_data_block4*);
3837 extern  bool_t xdr_data4(XDR *, data4*);
3838 extern  bool_t xdr_data_info4(XDR *, data_info4*);
3839 extern  bool_t xdr_data_content4(XDR *, data_content4*);
3840 extern  bool_t xdr_stable_how4(XDR *, stable_how4*);
3841 extern  bool_t xdr_write_response4(XDR *, write_response4*);
3842 extern  bool_t xdr_fattr4_supported_attrs(XDR *, fattr4_supported_attrs*);
3843 extern  bool_t xdr_fattr4_type(XDR *, fattr4_type*);
3844 extern  bool_t xdr_fattr4_fh_expire_type(XDR *, fattr4_fh_expire_type*);
3845 extern  bool_t xdr_fattr4_change(XDR *, fattr4_change*);
3846 extern  bool_t xdr_fattr4_size(XDR *, fattr4_size*);
3847 extern  bool_t xdr_fattr4_link_support(XDR *, fattr4_link_support*);
3848 extern  bool_t xdr_fattr4_symlink_support(XDR *, fattr4_symlink_support*);
3849 extern  bool_t xdr_fattr4_named_attr(XDR *, fattr4_named_attr*);
3850 extern  bool_t xdr_fattr4_fsid(XDR *, fattr4_fsid*);
3851 extern  bool_t xdr_fattr4_unique_handles(XDR *, fattr4_unique_handles*);
3852 extern  bool_t xdr_fattr4_lease_time(XDR *, fattr4_lease_time*);
3853 extern  bool_t xdr_fattr4_rdattr_error(XDR *, fattr4_rdattr_error*);
3854 extern  bool_t xdr_fattr4_acl(XDR *, fattr4_acl*);
3855 extern  bool_t xdr_fattr4_aclsupport(XDR *, fattr4_aclsupport*);
3856 extern  bool_t xdr_fattr4_archive(XDR *, fattr4_archive*);
3857 extern  bool_t xdr_fattr4_cansettime(XDR *, fattr4_cansettime*);
3858 extern  bool_t xdr_fattr4_case_insensitive(XDR *, fattr4_case_insensitive*);
3859 extern  bool_t xdr_fattr4_case_preserving(XDR *, fattr4_case_preserving*);
3860 extern  bool_t xdr_fattr4_chown_restricted(XDR *, fattr4_chown_restricted*);
3861 extern  bool_t xdr_fattr4_fileid(XDR *, fattr4_fileid*);
3862 extern  bool_t xdr_fattr4_files_avail(XDR *, fattr4_files_avail*);
3863 extern  bool_t xdr_fattr4_filehandle(XDR *, fattr4_filehandle*);
3864 extern  bool_t xdr_fattr4_files_free(XDR *, fattr4_files_free*);
3865 extern  bool_t xdr_fattr4_files_total(XDR *, fattr4_files_total*);
3866 extern  bool_t xdr_fattr4_fs_locations(XDR *, fattr4_fs_locations*);
3867 extern  bool_t xdr_fattr4_hidden(XDR *, fattr4_hidden*);
3868 extern  bool_t xdr_fattr4_homogeneous(XDR *, fattr4_homogeneous*);
3869 extern  bool_t xdr_fattr4_maxfilesize(XDR *, fattr4_maxfilesize*);
3870 extern  bool_t xdr_fattr4_maxlink(XDR *, fattr4_maxlink*);
3871 extern  bool_t xdr_fattr4_maxname(XDR *, fattr4_maxname*);
3872 extern  bool_t xdr_fattr4_maxread(XDR *, fattr4_maxread*);
3873 extern  bool_t xdr_fattr4_maxwrite(XDR *, fattr4_maxwrite*);
3874 extern  bool_t xdr_fattr4_mimetype(XDR *, fattr4_mimetype*);
3875 extern  bool_t xdr_fattr4_mode(XDR *, fattr4_mode*);
3876 extern  bool_t xdr_fattr4_mode_set_masked(XDR *, fattr4_mode_set_masked*);
3877 extern  bool_t xdr_fattr4_mounted_on_fileid(XDR *, fattr4_mounted_on_fileid*);
3878 extern  bool_t xdr_fattr4_no_trunc(XDR *, fattr4_no_trunc*);
3879 extern  bool_t xdr_fattr4_numlinks(XDR *, fattr4_numlinks*);
3880 extern  bool_t xdr_fattr4_owner(XDR *, fattr4_owner*);
3881 extern  bool_t xdr_fattr4_owner_group(XDR *, fattr4_owner_group*);
3882 extern  bool_t xdr_fattr4_quota_avail_hard(XDR *, fattr4_quota_avail_hard*);
3883 extern  bool_t xdr_fattr4_quota_avail_soft(XDR *, fattr4_quota_avail_soft*);
3884 extern  bool_t xdr_fattr4_quota_used(XDR *, fattr4_quota_used*);
3885 extern  bool_t xdr_fattr4_rawdev(XDR *, fattr4_rawdev*);
3886 extern  bool_t xdr_fattr4_space_avail(XDR *, fattr4_space_avail*);
3887 extern  bool_t xdr_fattr4_space_free(XDR *, fattr4_space_free*);
3888 extern  bool_t xdr_fattr4_space_total(XDR *, fattr4_space_total*);
3889 extern  bool_t xdr_fattr4_space_used(XDR *, fattr4_space_used*);
3890 extern  bool_t xdr_fattr4_system(XDR *, fattr4_system*);
3891 extern  bool_t xdr_fattr4_time_access(XDR *, fattr4_time_access*);
3892 extern  bool_t xdr_fattr4_time_access_set(XDR *, fattr4_time_access_set*);
3893 extern  bool_t xdr_fattr4_time_backup(XDR *, fattr4_time_backup*);
3894 extern  bool_t xdr_fattr4_time_create(XDR *, fattr4_time_create*);
3895 extern  bool_t xdr_fattr4_time_delta(XDR *, fattr4_time_delta*);
3896 extern  bool_t xdr_fattr4_time_metadata(XDR *, fattr4_time_metadata*);
3897 extern  bool_t xdr_fattr4_time_modify(XDR *, fattr4_time_modify*);
3898 extern  bool_t xdr_fattr4_time_modify_set(XDR *, fattr4_time_modify_set*);
3899 extern  bool_t xdr_fattr4_suppattr_exclcreat(XDR *, fattr4_suppattr_exclcreat*);
3900 extern  bool_t xdr_fattr4_dir_notif_delay(XDR *, fattr4_dir_notif_delay*);
3901 extern  bool_t xdr_fattr4_dirent_notif_delay(XDR *, fattr4_dirent_notif_delay*);
3902 extern  bool_t xdr_fattr4_fs_layout_types(XDR *, fattr4_fs_layout_types*);
3903 extern  bool_t xdr_fattr4_fs_status(XDR *, fattr4_fs_status*);
3904 extern  bool_t xdr_fattr4_fs_charset_cap(XDR *, fattr4_fs_charset_cap*);
3905 extern  bool_t xdr_fattr4_layout_alignment(XDR *, fattr4_layout_alignment*);
3906 extern  bool_t xdr_fattr4_layout_blksize(XDR *, fattr4_layout_blksize*);
3907 extern  bool_t xdr_fattr4_layout_hint(XDR *, fattr4_layout_hint*);
3908 extern  bool_t xdr_fattr4_layout_types(XDR *, fattr4_layout_types*);
3909 extern  bool_t xdr_fattr4_mdsthreshold(XDR *, fattr4_mdsthreshold*);
3910 extern  bool_t xdr_fattr4_retention_get(XDR *, fattr4_retention_get*);
3911 extern  bool_t xdr_fattr4_retention_set(XDR *, fattr4_retention_set*);
3912 extern  bool_t xdr_fattr4_retentevt_get(XDR *, fattr4_retentevt_get*);
3913 extern  bool_t xdr_fattr4_retentevt_set(XDR *, fattr4_retentevt_set*);
3914 extern  bool_t xdr_fattr4_retention_hold(XDR *, fattr4_retention_hold*);
3915 extern  bool_t xdr_fattr4_dacl(XDR *, fattr4_dacl*);
3916 extern  bool_t xdr_fattr4_sacl(XDR *, fattr4_sacl*);
3917 extern  bool_t xdr_fattr4_change_policy(XDR *, fattr4_change_policy*);
3918 extern  bool_t xdr_fattr4_space_freed(XDR *, fattr4_space_freed*);
3919 extern  bool_t xdr_fattr4_change_attr_type(XDR *, fattr4_change_attr_type*);
3920 extern  bool_t xdr_fattr4_sec_label(XDR *, fattr4_sec_label*);
3921 extern  bool_t xdr_fattr4_clone_blksize(XDR *, fattr4_clone_blksize*);
3922 extern  bool_t xdr_fattr4(XDR *, fattr4*);
3923 extern  bool_t xdr_change_info4(XDR *, change_info4*);
3924 extern  bool_t xdr_clientaddr4(XDR *, clientaddr4*);
3925 extern  bool_t xdr_cb_client4(XDR *, cb_client4*);
3926 extern  bool_t xdr_nfs_client_id4(XDR *, nfs_client_id4*);
3927 extern  bool_t xdr_client_owner4(XDR *, client_owner4*);
3928 extern  bool_t xdr_server_owner4(XDR *, server_owner4*);
3929 extern  bool_t xdr_state_owner4(XDR *, state_owner4*);
3930 extern  bool_t xdr_open_owner4(XDR *, open_owner4*);
3931 extern  bool_t xdr_lock_owner4(XDR *, lock_owner4*);
3932 extern  bool_t xdr_nfs_lock_type4(XDR *, nfs_lock_type4*);
3933 extern  bool_t xdr_ssv_subkey4(XDR *, ssv_subkey4*);
3934 extern  bool_t xdr_ssv_mic_plain_tkn4(XDR *, ssv_mic_plain_tkn4*);
3935 extern  bool_t xdr_ssv_mic_tkn4(XDR *, ssv_mic_tkn4*);
3936 extern  bool_t xdr_ssv_seal_plain_tkn4(XDR *, ssv_seal_plain_tkn4*);
3937 extern  bool_t xdr_ssv_seal_cipher_tkn4(XDR *, ssv_seal_cipher_tkn4*);
3938 extern  bool_t xdr_fs_locations_server4(XDR *, fs_locations_server4*);
3939 extern  bool_t xdr_fs_locations_item4(XDR *, fs_locations_item4*);
3940 extern  bool_t xdr_fs_locations_info4(XDR *, fs_locations_info4*);
3941 extern  bool_t xdr_fattr4_fs_locations_info(XDR *, fattr4_fs_locations_info*);
3942 extern  bool_t xdr_nfl_util4(XDR *, nfl_util4*);
3943 extern  bool_t xdr_filelayout_hint_care4(XDR *, filelayout_hint_care4*);
3944 extern  bool_t xdr_nfsv4_1_file_layouthint4(XDR *, nfsv4_1_file_layouthint4*);
3945 extern  bool_t xdr_multipath_list4(XDR *, multipath_list4*);
3946 extern  bool_t xdr_nfsv4_1_file_layout_ds_addr4(XDR *,
3947 	nfsv4_1_file_layout_ds_addr4*);
3948 extern  bool_t xdr_nfsv4_1_file_layout4(XDR *, nfsv4_1_file_layout4*);
3949 extern  bool_t xdr_ACCESS4args(XDR *, ACCESS4args*);
3950 extern  bool_t xdr_CLONE4args(XDR *, CLONE4args*);
3951 extern  bool_t xdr_CLONE4res(XDR *, CLONE4res*);
3952 extern  bool_t xdr_COMMIT4args(XDR *, COMMIT4args*);
3953 extern  bool_t xdr_COMMIT4res(XDR *, COMMIT4res*);
3954 extern  bool_t xdr_DELEGPURGE4args(XDR *, DELEGPURGE4args*);
3955 extern  bool_t xdr_DELEGPURGE4res(XDR *, DELEGPURGE4res*);
3956 extern  bool_t xdr_DELEGRETURN4args(XDR *, DELEGRETURN4args*);
3957 extern  bool_t xdr_DELEGRETURN4res(XDR *, DELEGRETURN4res*);
3958 extern  bool_t xdr_GETATTR4args(XDR *, GETATTR4args*);
3959 extern  bool_t xdr_GETATTR4res(XDR *, GETATTR4res*);
3960 extern  bool_t xdr_GETFH4res(XDR *, GETFH4res*);
3961 extern  bool_t xdr_open_to_lock_owner4(XDR *, open_to_lock_owner4*);
3962 extern  bool_t xdr_exist_lock_owner4(XDR *, exist_lock_owner4*);
3963 extern  bool_t xdr_locker4(XDR *, locker4*);
3964 extern  bool_t xdr_LOCK4denied(XDR *, LOCK4denied*);
3965 extern  bool_t xdr_LOOKUP4args(XDR *, LOOKUP4args*);
3966 extern  bool_t xdr_LOOKUP4res(XDR *, LOOKUP4res*);
3967 extern  bool_t xdr_LOOKUPP4res(XDR *, LOOKUPP4res*);
3968 extern  bool_t xdr_NVERIFY4args(XDR *, NVERIFY4args*);
3969 extern  bool_t xdr_NVERIFY4res(XDR *, NVERIFY4res*);
3970 extern  bool_t xdr_createmode4(XDR *, createmode4*);
3971 extern  bool_t xdr_creatverfattr(XDR *, creatverfattr*);
3972 extern  bool_t xdr_createhow4(XDR *, createhow4*);
3973 extern  bool_t xdr_opentype4(XDR *, opentype4*);
3974 extern  bool_t xdr_openflag4(XDR *, openflag4*);
3975 extern  bool_t xdr_limit_by4(XDR *, limit_by4*);
3976 extern  bool_t xdr_nfs_modified_limit4(XDR *, nfs_modified_limit4*);
3977 extern  bool_t xdr_nfs_space_limit4(XDR *, nfs_space_limit4*);
3978 extern  bool_t xdr_open_delegation_type4(XDR *, open_delegation_type4*);
3979 extern  bool_t xdr_open_claim_type4(XDR *, open_claim_type4*);
3980 extern  bool_t xdr_open_claim_delegate_cur4(XDR *, open_claim_delegate_cur4*);
3981 extern  bool_t xdr_open_claim4(XDR *, open_claim4*);
3982 extern  bool_t xdr_open_read_delegation4(XDR *, open_read_delegation4*);
3983 extern  bool_t xdr_open_write_delegation4(XDR *, open_write_delegation4*);
3984 extern  bool_t xdr_why_no_delegation4(XDR *, why_no_delegation4*);
3985 extern  bool_t xdr_open_none_delegation4(XDR *, open_none_delegation4*);
3986 extern  bool_t xdr_open_delegation4(XDR *, open_delegation4*);
3987 extern  bool_t xdr_PUTFH4args(XDR *, PUTFH4args*);
3988 extern  bool_t xdr_PUTFH4res(XDR *, PUTFH4res*);
3989 extern  bool_t xdr_PUTPUBFH4res(XDR *, PUTPUBFH4res*);
3990 extern  bool_t xdr_PUTROOTFH4res(XDR *, PUTROOTFH4res*);
3991 extern  bool_t xdr_RENEW4args(XDR *, RENEW4args*);
3992 extern  bool_t xdr_RENEW4res(XDR *, RENEW4res*);
3993 extern  bool_t xdr_RESTOREFH4res(XDR *, RESTOREFH4res*);
3994 extern  bool_t xdr_SAVEFH4res(XDR *, SAVEFH4res*);
3995 extern  bool_t xdr_SECINFO4args(XDR *, SECINFO4args*);
3996 extern  bool_t xdr_rpc_gss_svc_t(XDR *, rpc_gss_svc_t *);
3997 extern  bool_t xdr_rpcsec_gss_info(XDR *, rpcsec_gss_info*);
3998 extern  bool_t xdr_SECINFO4res(XDR *, SECINFO4res*);
3999 extern  bool_t xdr_SETATTR4args(XDR *, SETATTR4args*);
4000 extern  bool_t xdr_SETATTR4res(XDR *, SETATTR4res*);
4001 extern  bool_t xdr_SETCLIENTID_CONFIRM4args(XDR *, SETCLIENTID_CONFIRM4args*);
4002 extern  bool_t xdr_SETCLIENTID_CONFIRM4res(XDR *, SETCLIENTID_CONFIRM4res*);
4003 extern  bool_t xdr_VERIFY4args(XDR *, VERIFY4args*);
4004 extern  bool_t xdr_VERIFY4res(XDR *, VERIFY4res*);
4005 extern  bool_t xdr_RELEASE_LOCKOWNER4args(XDR *, RELEASE_LOCKOWNER4args*);
4006 extern  bool_t xdr_RELEASE_LOCKOWNER4res(XDR *, RELEASE_LOCKOWNER4res*);
4007 extern  bool_t xdr_ILLEGAL4res(XDR *, ILLEGAL4res*);
4008 extern  bool_t xdr_gsshandle4_t(XDR *, gsshandle4_t *);
4009 extern  bool_t xdr_gss_cb_handles4(XDR *, gss_cb_handles4*);
4010 extern  bool_t xdr_callback_sec_parms4(XDR *, callback_sec_parms4*);
4011 extern  bool_t xdr_BACKCHANNEL_CTL4args(XDR *, BACKCHANNEL_CTL4args*);
4012 extern  bool_t xdr_BACKCHANNEL_CTL4res(XDR *, BACKCHANNEL_CTL4res*);
4013 extern  bool_t xdr_channel_dir_from_client4(XDR *, channel_dir_from_client4*);
4014 extern  bool_t xdr_BIND_CONN_TO_SESSION4args(XDR *, BIND_CONN_TO_SESSION4args*);
4015 extern  bool_t xdr_channel_dir_from_server4(XDR *, channel_dir_from_server4*);
4016 extern  bool_t xdr_BIND_CONN_TO_SESSION4resok(XDR *,
4017 	BIND_CONN_TO_SESSION4resok*);
4018 extern  bool_t xdr_BIND_CONN_TO_SESSION4res(XDR *, BIND_CONN_TO_SESSION4res*);
4019 extern  bool_t xdr_state_protect_ops4(XDR *, state_protect_ops4*);
4020 extern  bool_t xdr_ssv_sp_parms4(XDR *, ssv_sp_parms4*);
4021 extern  bool_t xdr_state_protect_how4(XDR *, state_protect_how4*);
4022 extern  bool_t xdr_state_protect4_a(XDR *, state_protect4_a*);
4023 extern  bool_t xdr_EXCHANGE_ID4args(XDR *, EXCHANGE_ID4args*);
4024 extern  bool_t xdr_ssv_prot_info4(XDR *, ssv_prot_info4*);
4025 extern  bool_t xdr_state_protect4_r(XDR *, state_protect4_r*);
4026 extern  bool_t xdr_EXCHANGE_ID4resok(XDR *, EXCHANGE_ID4resok*);
4027 extern  bool_t xdr_EXCHANGE_ID4res(XDR *, EXCHANGE_ID4res*);
4028 extern  bool_t xdr_channel_attrs4(XDR *, channel_attrs4*);
4029 extern  bool_t xdr_CREATE_SESSION4args(XDR *, CREATE_SESSION4args*);
4030 extern  bool_t xdr_CREATE_SESSION4resok(XDR *, CREATE_SESSION4resok*);
4031 extern  bool_t xdr_CREATE_SESSION4res(XDR *, CREATE_SESSION4res*);
4032 extern  bool_t xdr_DESTROY_SESSION4args(XDR *, DESTROY_SESSION4args*);
4033 extern  bool_t xdr_DESTROY_SESSION4res(XDR *, DESTROY_SESSION4res*);
4034 extern  bool_t xdr_FREE_STATEID4args(XDR *, FREE_STATEID4args*);
4035 extern  bool_t xdr_FREE_STATEID4res(XDR *, FREE_STATEID4res*);
4036 extern  bool_t xdr_attr_notice4(XDR *, attr_notice4*);
4037 extern  bool_t xdr_GET_DIR_DELEGATION4args(XDR *, GET_DIR_DELEGATION4args*);
4038 extern  bool_t xdr_GET_DIR_DELEGATION4resok(XDR *, GET_DIR_DELEGATION4resok*);
4039 extern  bool_t xdr_gddrnf4_status(XDR *, gddrnf4_status*);
4040 extern  bool_t xdr_GET_DIR_DELEGATION4res_non_fatal(XDR *,
4041 	GET_DIR_DELEGATION4res_non_fatal*);
4042 extern  bool_t xdr_GET_DIR_DELEGATION4res(XDR *, GET_DIR_DELEGATION4res*);
4043 extern  bool_t xdr_GETDEVICEINFO4args(XDR *, GETDEVICEINFO4args*);
4044 extern  bool_t xdr_GETDEVICEINFO4resok(XDR *, GETDEVICEINFO4resok*);
4045 extern  bool_t xdr_GETDEVICEINFO4res(XDR *, GETDEVICEINFO4res*);
4046 extern  bool_t xdr_GETDEVICELIST4args(XDR *, GETDEVICELIST4args*);
4047 extern  bool_t xdr_GETDEVICELIST4resok(XDR *, GETDEVICELIST4resok*);
4048 extern  bool_t xdr_GETDEVICELIST4res(XDR *, GETDEVICELIST4res*);
4049 extern  bool_t xdr_newtime4(XDR *, newtime4*);
4050 extern  bool_t xdr_newoffset4(XDR *, newoffset4*);
4051 extern  bool_t xdr_LAYOUTCOMMIT4args(XDR *, LAYOUTCOMMIT4args*);
4052 extern  bool_t xdr_newsize4(XDR *, newsize4*);
4053 extern  bool_t xdr_LAYOUTCOMMIT4resok(XDR *, LAYOUTCOMMIT4resok*);
4054 extern  bool_t xdr_LAYOUTCOMMIT4res(XDR *, LAYOUTCOMMIT4res*);
4055 extern  bool_t xdr_LAYOUTGET4args(XDR *, LAYOUTGET4args*);
4056 extern  bool_t xdr_LAYOUTGET4resok(XDR *, LAYOUTGET4resok*);
4057 extern  bool_t xdr_LAYOUTGET4res(XDR *, LAYOUTGET4res*);
4058 extern  bool_t xdr_LAYOUTRETURN4args(XDR *, LAYOUTRETURN4args*);
4059 extern  bool_t xdr_layoutreturn_stateid(XDR *, layoutreturn_stateid*);
4060 extern  bool_t xdr_LAYOUTRETURN4res(XDR *, LAYOUTRETURN4res*);
4061 extern  bool_t xdr_secinfo_style4(XDR *, secinfo_style4*);
4062 extern  bool_t xdr_SECINFO_NO_NAME4args(XDR *, SECINFO_NO_NAME4args*);
4063 extern  bool_t xdr_SECINFO_NO_NAME4res(XDR *, SECINFO_NO_NAME4res*);
4064 extern  bool_t xdr_SEQUENCE4args(XDR *, SEQUENCE4args*);
4065 extern  bool_t xdr_SEQUENCE4resok(XDR *, SEQUENCE4resok*);
4066 extern  bool_t xdr_SEQUENCE4res(XDR *, SEQUENCE4res*);
4067 extern  bool_t xdr_ssa_digest_input4(XDR *, ssa_digest_input4*);
4068 extern  bool_t xdr_SET_SSV4args(XDR *, SET_SSV4args*);
4069 extern  bool_t xdr_ssr_digest_input4(XDR *, ssr_digest_input4*);
4070 extern  bool_t xdr_SET_SSV4resok(XDR *, SET_SSV4resok*);
4071 extern  bool_t xdr_SET_SSV4res(XDR *, SET_SSV4res*);
4072 extern  bool_t xdr_TEST_STATEID4args(XDR *, TEST_STATEID4args*);
4073 extern  bool_t xdr_TEST_STATEID4resok(XDR *, TEST_STATEID4resok*);
4074 extern  bool_t xdr_TEST_STATEID4res(XDR *, TEST_STATEID4res*);
4075 extern  bool_t xdr_deleg_claim4(XDR *, deleg_claim4*);
4076 extern  bool_t xdr_WANT_DELEGATION4args(XDR *, WANT_DELEGATION4args*);
4077 extern  bool_t xdr_WANT_DELEGATION4res(XDR *, WANT_DELEGATION4res*);
4078 extern  bool_t xdr_DESTROY_CLIENTID4args(XDR *, DESTROY_CLIENTID4args*);
4079 extern  bool_t xdr_DESTROY_CLIENTID4res(XDR *, DESTROY_CLIENTID4res*);
4080 extern  bool_t xdr_RECLAIM_COMPLETE4args(XDR *, RECLAIM_COMPLETE4args*);
4081 extern  bool_t xdr_RECLAIM_COMPLETE4res(XDR *, RECLAIM_COMPLETE4res*);
4082 extern  bool_t xdr_nfs_opnum4(XDR *, nfs_opnum4*);
4083 
4084 extern  bool_t xdr_COPY4args(XDR *, COPY4args*);
4085 extern  bool_t xdr_copy_requirements4(XDR *, copy_requirements4*);
4086 extern  bool_t xdr_COPY4resok(XDR *, COPY4resok*);
4087 extern  bool_t xdr_COPY4res(XDR *, COPY4res*);
4088 extern  bool_t xdr_COPY_NOTIFY4args(XDR *, COPY_NOTIFY4args*);
4089 extern  bool_t xdr_COPY_NOTIFY4resok(XDR *, COPY_NOTIFY4resok*);
4090 extern  bool_t xdr_COPY_NOTIFY4res(XDR *, COPY_NOTIFY4res*);
4091 extern  bool_t xdr_OFFLOAD_CANCEL4args(XDR *, OFFLOAD_CANCEL4args*);
4092 extern  bool_t xdr_OFFLOAD_CANCEL4res(XDR *, OFFLOAD_CANCEL4res*);
4093 extern  bool_t xdr_OFFLOAD_STATUS4args(XDR *, OFFLOAD_STATUS4args*);
4094 extern  bool_t xdr_OFFLOAD_STATUS4resok(XDR *, OFFLOAD_STATUS4resok*);
4095 extern  bool_t xdr_OFFLOAD_STATUS4res(XDR *, OFFLOAD_STATUS4res*);
4096 extern  bool_t xdr_ALLOCATE4args(XDR *, ALLOCATE4args*);
4097 extern  bool_t xdr_ALLOCATE4res(XDR *, ALLOCATE4res*);
4098 extern  bool_t xdr_DEALLOCATE4args(XDR *, DEALLOCATE4args*);
4099 extern  bool_t xdr_DEALLOCATE4res(XDR *, DEALLOCATE4res*);
4100 extern  bool_t xdr_IO_ADVISE_type4(XDR *, IO_ADVISE_type4*);
4101 extern  bool_t xdr_IO_ADVISE4args(XDR *, IO_ADVISE4args*);
4102 extern  bool_t xdr_IO_ADVISE4resok(XDR *, IO_ADVISE4resok*);
4103 extern  bool_t xdr_IO_ADVISE4res(XDR *, IO_ADVISE4res*);
4104 extern  bool_t xdr_device_error4(XDR *, device_error4*);
4105 extern  bool_t xdr_LAYOUTERROR4args(XDR *, LAYOUTERROR4args*);
4106 extern  bool_t xdr_LAYOUTERROR4res(XDR *, LAYOUTERROR4res*);
4107 extern  bool_t xdr_io_info4(XDR *, io_info4*);
4108 extern  bool_t xdr_LAYOUTSTATS4args(XDR *, LAYOUTSTATS4args*);
4109 extern  bool_t xdr_LAYOUTSTATS4res(XDR *, LAYOUTSTATS4res*);
4110 extern  bool_t xdr_READ_PLUS4args(XDR *, READ_PLUS4args*);
4111 extern  bool_t xdr_read_plus_content(XDR *, read_plus_content*);
4112 extern  bool_t xdr_read_plus_res4(XDR *, read_plus_res4*);
4113 extern  bool_t xdr_READ_PLUS4res(XDR *, READ_PLUS4res*);
4114 extern  bool_t xdr_SEEK4args(XDR *, SEEK4args*);
4115 extern  bool_t xdr_seek_res4(XDR *, seek_res4*);
4116 extern  bool_t xdr_SEEK4res(XDR *, SEEK4res*);
4117 extern  bool_t xdr_WRITE_SAME4args(XDR *, WRITE_SAME4args*);
4118 extern  bool_t xdr_WRITE_SAME4res(XDR *, WRITE_SAME4res*);
4119 
4120 extern  bool_t xdr_COMPOUND4args(XDR *, COMPOUND4args*);
4121 extern  bool_t xdr_COMPOUND4res(XDR *, COMPOUND4res*);
4122 extern  bool_t xdr_CB_GETATTR4args(XDR *, CB_GETATTR4args*);
4123 extern  bool_t xdr_CB_GETATTR4res(XDR *, CB_GETATTR4res*);
4124 extern  bool_t xdr_CB_RECALL4args(XDR *, CB_RECALL4args*);
4125 extern  bool_t xdr_CB_RECALL4res(XDR *, CB_RECALL4res*);
4126 extern  bool_t xdr_CB_ILLEGAL4res(XDR *, CB_ILLEGAL4res*);
4127 extern  bool_t xdr_layoutrecall_type4(XDR *, layoutrecall_type4*);
4128 extern  bool_t xdr_layoutrecall_file4(XDR *, layoutrecall_file4*);
4129 extern  bool_t xdr_layoutrecall4(XDR *, layoutrecall4*);
4130 extern  bool_t xdr_CB_LAYOUTRECALL4args(XDR *, CB_LAYOUTRECALL4args*);
4131 extern  bool_t xdr_CB_LAYOUTRECALL4res(XDR *, CB_LAYOUTRECALL4res*);
4132 extern  bool_t xdr_notify_type4(XDR *, notify_type4*);
4133 extern  bool_t xdr_notify_entry4(XDR *, notify_entry4*);
4134 extern  bool_t xdr_prev_entry4(XDR *, prev_entry4*);
4135 extern  bool_t xdr_notify_remove4(XDR *, notify_remove4*);
4136 extern  bool_t xdr_notify_add4(XDR *, notify_add4*);
4137 extern  bool_t xdr_notify_attr4(XDR *, notify_attr4*);
4138 extern  bool_t xdr_notify_rename4(XDR *, notify_rename4*);
4139 extern  bool_t xdr_notify_verifier4(XDR *, notify_verifier4*);
4140 extern  bool_t xdr_notifylist4(XDR *, notifylist4*);
4141 extern  bool_t xdr_notify4(XDR *, notify4*);
4142 extern  bool_t xdr_CB_NOTIFY4args(XDR *, CB_NOTIFY4args*);
4143 extern  bool_t xdr_CB_NOTIFY4res(XDR *, CB_NOTIFY4res*);
4144 extern  bool_t xdr_CB_PUSH_DELEG4args(XDR *, CB_PUSH_DELEG4args*);
4145 extern  bool_t xdr_CB_PUSH_DELEG4res(XDR *, CB_PUSH_DELEG4res*);
4146 extern  bool_t xdr_CB_RECALL_ANY4args(XDR *, CB_RECALL_ANY4args*);
4147 extern  bool_t xdr_CB_RECALL_ANY4res(XDR *, CB_RECALL_ANY4res*);
4148 extern  bool_t xdr_CB_RECALLABLE_OBJ_AVAIL4args(XDR *,
4149 	CB_RECALLABLE_OBJ_AVAIL4args*);
4150 extern  bool_t xdr_CB_RECALLABLE_OBJ_AVAIL4res(XDR *,
4151 	CB_RECALLABLE_OBJ_AVAIL4res*);
4152 extern  bool_t xdr_CB_RECALL_SLOT4args(XDR *, CB_RECALL_SLOT4args*);
4153 extern  bool_t xdr_CB_RECALL_SLOT4res(XDR *, CB_RECALL_SLOT4res*);
4154 extern  bool_t xdr_referring_call4(XDR *, referring_call4*);
4155 extern  bool_t xdr_referring_call_list4(XDR *, referring_call_list4*);
4156 extern  bool_t xdr_CB_SEQUENCE4args(XDR *, CB_SEQUENCE4args*);
4157 extern  bool_t xdr_CB_SEQUENCE4resok(XDR *, CB_SEQUENCE4resok*);
4158 extern  bool_t xdr_CB_SEQUENCE4res(XDR *, CB_SEQUENCE4res*);
4159 extern  bool_t xdr_CB_WANTS_CANCELLED4args(XDR *, CB_WANTS_CANCELLED4args*);
4160 extern  bool_t xdr_CB_WANTS_CANCELLED4res(XDR *, CB_WANTS_CANCELLED4res*);
4161 extern  bool_t xdr_CB_NOTIFY_LOCK4args(XDR *, CB_NOTIFY_LOCK4args*);
4162 extern  bool_t xdr_CB_NOTIFY_LOCK4res(XDR *, CB_NOTIFY_LOCK4res*);
4163 extern  bool_t xdr_notify_deviceid_type4(XDR *, notify_deviceid_type4*);
4164 extern  bool_t xdr_notify_deviceid_delete4(XDR *, notify_deviceid_delete4*);
4165 extern  bool_t xdr_notify_deviceid_change4(XDR *, notify_deviceid_change4*);
4166 extern  bool_t xdr_CB_NOTIFY_DEVICEID4args(XDR *, CB_NOTIFY_DEVICEID4args*);
4167 extern  bool_t xdr_CB_NOTIFY_DEVICEID4res(XDR *, CB_NOTIFY_DEVICEID4res*);
4168 extern  bool_t xdr_nfs_cb_opnum4(XDR *, nfs_cb_opnum4*);
4169 extern  bool_t xdr_nfs_cb_argop4(XDR *, nfs_cb_argop4*);
4170 extern  bool_t xdr_nfs_cb_resop4(XDR *, nfs_cb_resop4*);
4171 extern  bool_t xdr_CB_COMPOUND4args(XDR *, CB_COMPOUND4args*);
4172 extern  bool_t xdr_CB_COMPOUND4res(XDR *, CB_COMPOUND4res*);
4173 
4174 /* NFSv4.x xdr */
4175 extern bool_t xdr_nfs4x_argop4(XDR *xdrs, nfs_argop4 *objp);
4176 extern bool_t xdr_nfs4x_resop4(XDR *xdrs, nfs_resop4 *objp);
4177 
4178 /*
4179  * xdr for referrrals upcall
4180  */
4181 extern	bool_t xdr_knetconfig(XDR *, struct knetconfig *);
4182 extern	bool_t xdr_nfs_fsl_info(XDR *, struct nfs_fsl_info *);
4183 
4184 
4185 #ifdef __cplusplus
4186 }
4187 #endif
4188 
4189 #endif /* _NFS4_KPROT_H */
4190