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