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.
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.
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]
23 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
27 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
35 * Kernel specific version.
36 * NFS Version 4 protocol definitions. From nfs4_prot.x rev 1.119.
45 #include <rpc/rpc_rdma.h>
47 #include <sys/stream.h>
49 #define NFS4_FHSIZE 128
50 #define NFS4_VERIFIER_SIZE 8
51 #define NFS4_OTHER_SIZE 12
54 * Reasonable upper bounds to catch badly behaving partners
56 #define NFS4_OPAQUE_LIMIT 1024
57 #define NFS4_COMPOUND_LIMIT 2048
58 #define NFS4_FS_LOCATIONS_LIMIT 65536
59 #define NFS4_ACL_LIMIT 65536
60 #define NFS4_SECINFO_LIMIT 65536
61 #define NFS4_FATTR4_LIMIT 1048576
62 #define NFS4_DATA_LIMIT 134217728
75 typedef enum nfs_ftype4 nfs_ftype4
;
93 NFS4ERR_NAMETOOLONG
= 63,
94 NFS4ERR_NOTEMPTY
= 66,
97 NFS4ERR_BADHANDLE
= 10001,
98 NFS4ERR_BAD_COOKIE
= 10003,
99 NFS4ERR_NOTSUPP
= 10004,
100 NFS4ERR_TOOSMALL
= 10005,
101 NFS4ERR_SERVERFAULT
= 10006,
102 NFS4ERR_BADTYPE
= 10007,
103 NFS4ERR_DELAY
= 10008,
104 NFS4ERR_SAME
= 10009,
105 NFS4ERR_DENIED
= 10010,
106 NFS4ERR_EXPIRED
= 10011,
107 NFS4ERR_LOCKED
= 10012,
108 NFS4ERR_GRACE
= 10013,
109 NFS4ERR_FHEXPIRED
= 10014,
110 NFS4ERR_SHARE_DENIED
= 10015,
111 NFS4ERR_WRONGSEC
= 10016,
112 NFS4ERR_CLID_INUSE
= 10017,
113 NFS4ERR_RESOURCE
= 10018,
114 NFS4ERR_MOVED
= 10019,
115 NFS4ERR_NOFILEHANDLE
= 10020,
116 NFS4ERR_MINOR_VERS_MISMATCH
= 10021,
117 NFS4ERR_STALE_CLIENTID
= 10022,
118 NFS4ERR_STALE_STATEID
= 10023,
119 NFS4ERR_OLD_STATEID
= 10024,
120 NFS4ERR_BAD_STATEID
= 10025,
121 NFS4ERR_BAD_SEQID
= 10026,
122 NFS4ERR_NOT_SAME
= 10027,
123 NFS4ERR_LOCK_RANGE
= 10028,
124 NFS4ERR_SYMLINK
= 10029,
125 NFS4ERR_RESTOREFH
= 10030,
126 NFS4ERR_LEASE_MOVED
= 10031,
127 NFS4ERR_ATTRNOTSUPP
= 10032,
128 NFS4ERR_NO_GRACE
= 10033,
129 NFS4ERR_RECLAIM_BAD
= 10034,
130 NFS4ERR_RECLAIM_CONFLICT
= 10035,
131 NFS4ERR_BADXDR
= 10036,
132 NFS4ERR_LOCKS_HELD
= 10037,
133 NFS4ERR_OPENMODE
= 10038,
134 NFS4ERR_BADOWNER
= 10039,
135 NFS4ERR_BADCHAR
= 10040,
136 NFS4ERR_BADNAME
= 10041,
137 NFS4ERR_BAD_RANGE
= 10042,
138 NFS4ERR_LOCK_NOTSUPP
= 10043,
139 NFS4ERR_OP_ILLEGAL
= 10044,
140 NFS4ERR_DEADLOCK
= 10045,
141 NFS4ERR_FILE_OPEN
= 10046,
142 NFS4ERR_ADMIN_REVOKED
= 10047,
143 NFS4ERR_CB_PATH_DOWN
= 10048
145 typedef enum nfsstat4 nfsstat4
;
148 * A bitmap can only be 56 bits, treat it as a uint64_t for now
150 typedef uint64_t bitmap4
;
152 typedef uint64_t offset4
;
154 typedef uint32_t count4
;
156 typedef uint64_t length4
;
158 typedef uint64_t clientid4
;
160 typedef uint32_t nfs_lease4
;
162 typedef uint32_t seqid4
;
165 uint_t utf8string_len
;
166 char *utf8string_val
;
169 typedef utf8string component4
;
172 uint_t pathname4_len
;
173 component4
*pathname4_val
;
176 typedef uint64_t nfs_lockid4
;
178 typedef uint64_t nfs_cookie4
;
181 uint_t linktext4_len
;
185 typedef utf8string ascii_REQUIRED4
;
192 typedef uint32_t qop4
;
194 typedef uint32_t mode4
;
196 typedef uint64_t changeid4
;
198 typedef uint64_t verifier4
;
204 typedef struct nfstime4 nfstime4
;
207 SET_TO_SERVER_TIME4
= 0,
208 SET_TO_CLIENT_TIME4
= 1
210 typedef enum time_how4 time_how4
;
216 typedef struct settime4 settime4
;
227 typedef struct fsid4 fsid4
;
229 struct fs_location4
{
231 utf8string
*server_val
;
234 typedef struct fs_location4 fs_location4
;
236 struct fs_locations4
{
238 uint_t locations_len
;
239 fs_location4
*locations_val
;
241 typedef struct fs_locations4 fs_locations4
;
244 * This structure is declared in nfs4.h
252 #define ACL4_SUPPORT_ALLOW_ACL 0x00000001
253 #define ACL4_SUPPORT_DENY_ACL 0x00000002
254 #define ACL4_SUPPORT_AUDIT_ACL 0x00000004
255 #define ACL4_SUPPORT_ALARM_ACL 0x00000008
257 typedef uint32_t acetype4
;
258 #define ACE4_ACCESS_ALLOWED_ACE_TYPE 0x00000000
259 #define ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
260 #define ACE4_SYSTEM_AUDIT_ACE_TYPE 0x00000002
261 #define ACE4_SYSTEM_ALARM_ACE_TYPE 0x00000003
263 typedef uint32_t aceflag4
;
264 #define ACE4_FILE_INHERIT_ACE 0x00000001
265 #define ACE4_DIRECTORY_INHERIT_ACE 0x00000002
266 #define ACE4_NO_PROPAGATE_INHERIT_ACE 0x00000004
267 #define ACE4_INHERIT_ONLY_ACE 0x00000008
268 #define ACE4_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
269 #define ACE4_FAILED_ACCESS_ACE_FLAG 0x00000020
270 #define ACE4_IDENTIFIER_GROUP 0x00000040
272 * This defines all valid flag bits, as defined by RFC 3530. If
273 * any additional flag bits are deemed part of the NFSv4 spec,
274 * you must also add them to the definition below.
276 #define ACE4_VALID_FLAG_BITS (\
277 ACE4_FILE_INHERIT_ACE | \
278 ACE4_DIRECTORY_INHERIT_ACE | \
279 ACE4_NO_PROPAGATE_INHERIT_ACE | \
280 ACE4_INHERIT_ONLY_ACE | \
281 ACE4_SUCCESSFUL_ACCESS_ACE_FLAG | \
282 ACE4_FAILED_ACCESS_ACE_FLAG | \
283 ACE4_IDENTIFIER_GROUP)
285 typedef uint32_t acemask4
;
286 #define ACE4_READ_DATA 0x00000001
287 #define ACE4_LIST_DIRECTORY 0x00000001
288 #define ACE4_WRITE_DATA 0x00000002
289 #define ACE4_ADD_FILE 0x00000002
290 #define ACE4_APPEND_DATA 0x00000004
291 #define ACE4_ADD_SUBDIRECTORY 0x00000004
292 #define ACE4_READ_NAMED_ATTRS 0x00000008
293 #define ACE4_WRITE_NAMED_ATTRS 0x00000010
294 #define ACE4_EXECUTE 0x00000020
295 #define ACE4_DELETE_CHILD 0x00000040
296 #define ACE4_READ_ATTRIBUTES 0x00000080
297 #define ACE4_WRITE_ATTRIBUTES 0x00000100
298 #define ACE4_DELETE 0x00010000
299 #define ACE4_READ_ACL 0x00020000
300 #define ACE4_WRITE_ACL 0x00040000
301 #define ACE4_WRITE_OWNER 0x00080000
302 #define ACE4_SYNCHRONIZE 0x00100000
303 #define ACE4_GENERIC_READ 0x00120081
304 #define ACE4_GENERIC_WRITE 0x00160106
305 #define ACE4_GENERIC_EXECUTE 0x001200A0
307 * This defines all valid access mask bits, as defined by RFC 3530. If
308 * any additional access mask bits are deemed part of the NFSv4 spec,
309 * you must also add them to the definition below.
311 #define ACE4_VALID_MASK_BITS (\
313 ACE4_LIST_DIRECTORY | \
317 ACE4_ADD_SUBDIRECTORY | \
318 ACE4_READ_NAMED_ATTRS | \
319 ACE4_WRITE_NAMED_ATTRS | \
321 ACE4_DELETE_CHILD | \
322 ACE4_READ_ATTRIBUTES | \
323 ACE4_WRITE_ATTRIBUTES | \
330 /* Used to signify an undefined value for an acemask4 */
331 #define ACE4_MASK_UNDEFINED 0x80000000
333 #define ACE4_WHO_OWNER "OWNER@"
334 #define ACE4_WHO_GROUP "GROUP@"
335 #define ACE4_WHO_EVERYONE "EVERYONE@"
340 acemask4 access_mask
;
343 typedef struct nfsace4 nfsace4
;
344 #define MODE4_SUID 0x800
345 #define MODE4_SGID 0x400
346 #define MODE4_SVTX 0x200
347 #define MODE4_RUSR 0x100
348 #define MODE4_WUSR 0x080
349 #define MODE4_XUSR 0x040
350 #define MODE4_RGRP 0x020
351 #define MODE4_WGRP 0x010
352 #define MODE4_XGRP 0x008
353 #define MODE4_ROTH 0x004
354 #define MODE4_WOTH 0x002
355 #define MODE4_XOTH 0x001
358 * ACL conversion helpers
365 ace4_group
, /* includes GROUP and GROUP_OBJ */
367 } ace4_to_aent_state_t
;
369 typedef struct ace4vals
{
370 utf8string
*key
; /* NB: not allocated here; points to existing utf8 */
378 typedef struct ace4_list
{
382 ace4vals_t group_obj
;
385 ace4vals_t other_obj
;
389 ace4_to_aent_state_t state
;
390 int seen
; /* bitmask of all aclent_t a_type values seen */
397 typedef struct specdata4 specdata4
;
398 #define FH4_PERSISTENT 0x00000000
399 #define FH4_NOEXPIRE_WITH_OPEN 0x00000001
400 #define FH4_VOLATILE_ANY 0x00000002
401 #define FH4_VOL_MIGRATION 0x00000004
402 #define FH4_VOL_RENAME 0x00000008
404 typedef bitmap4 fattr4_supported_attrs
;
406 typedef nfs_ftype4 fattr4_type
;
408 typedef uint32_t fattr4_fh_expire_type
;
410 typedef changeid4 fattr4_change
;
412 typedef uint64_t fattr4_size
;
414 typedef bool_t fattr4_link_support
;
416 typedef bool_t fattr4_symlink_support
;
418 typedef bool_t fattr4_named_attr
;
420 typedef fsid4 fattr4_fsid
;
422 typedef bool_t fattr4_unique_handles
;
424 typedef nfs_lease4 fattr4_lease_time
;
426 typedef nfsstat4 fattr4_rdattr_error
;
429 uint_t fattr4_acl_len
;
430 nfsace4
*fattr4_acl_val
;
433 typedef uint32_t fattr4_aclsupport
;
435 typedef bool_t fattr4_archive
;
437 typedef bool_t fattr4_cansettime
;
439 typedef bool_t fattr4_case_insensitive
;
441 typedef bool_t fattr4_case_preserving
;
443 typedef bool_t fattr4_chown_restricted
;
445 typedef uint64_t fattr4_fileid
;
447 typedef uint64_t fattr4_files_avail
;
449 typedef nfs_fh4 fattr4_filehandle
;
451 typedef uint64_t fattr4_files_free
;
453 typedef uint64_t fattr4_files_total
;
455 typedef fs_locations4 fattr4_fs_locations
;
457 typedef bool_t fattr4_hidden
;
459 typedef bool_t fattr4_homogeneous
;
461 typedef uint64_t fattr4_maxfilesize
;
463 typedef uint32_t fattr4_maxlink
;
465 typedef uint32_t fattr4_maxname
;
467 typedef uint64_t fattr4_maxread
;
469 typedef uint64_t fattr4_maxwrite
;
471 typedef ascii_REQUIRED4 fattr4_mimetype
;
473 typedef mode4 fattr4_mode
;
475 typedef uint64_t fattr4_mounted_on_fileid
;
477 typedef bool_t fattr4_no_trunc
;
479 typedef uint32_t fattr4_numlinks
;
481 typedef utf8string fattr4_owner
;
483 typedef utf8string fattr4_owner_group
;
485 typedef uint64_t fattr4_quota_avail_hard
;
487 typedef uint64_t fattr4_quota_avail_soft
;
489 typedef uint64_t fattr4_quota_used
;
491 typedef specdata4 fattr4_rawdev
;
493 typedef uint64_t fattr4_space_avail
;
495 typedef uint64_t fattr4_space_free
;
497 typedef uint64_t fattr4_space_total
;
499 typedef uint64_t fattr4_space_used
;
501 typedef bool_t fattr4_system
;
503 typedef nfstime4 fattr4_time_access
;
505 typedef settime4 fattr4_time_access_set
;
507 typedef nfstime4 fattr4_time_backup
;
509 typedef nfstime4 fattr4_time_create
;
511 typedef nfstime4 fattr4_time_delta
;
513 typedef nfstime4 fattr4_time_metadata
;
515 typedef nfstime4 fattr4_time_modify
;
517 typedef settime4 fattr4_time_modify_set
;
518 #define FATTR4_SUPPORTED_ATTRS 0
519 #define FATTR4_TYPE 1
520 #define FATTR4_FH_EXPIRE_TYPE 2
521 #define FATTR4_CHANGE 3
522 #define FATTR4_SIZE 4
523 #define FATTR4_LINK_SUPPORT 5
524 #define FATTR4_SYMLINK_SUPPORT 6
525 #define FATTR4_NAMED_ATTR 7
526 #define FATTR4_FSID 8
527 #define FATTR4_UNIQUE_HANDLES 9
528 #define FATTR4_LEASE_TIME 10
529 #define FATTR4_RDATTR_ERROR 11
530 #define FATTR4_FILEHANDLE 19
531 #define FATTR4_ACL 12
532 #define FATTR4_ACLSUPPORT 13
533 #define FATTR4_ARCHIVE 14
534 #define FATTR4_CANSETTIME 15
535 #define FATTR4_CASE_INSENSITIVE 16
536 #define FATTR4_CASE_PRESERVING 17
537 #define FATTR4_CHOWN_RESTRICTED 18
538 #define FATTR4_FILEID 20
539 #define FATTR4_FILES_AVAIL 21
540 #define FATTR4_FILES_FREE 22
541 #define FATTR4_FILES_TOTAL 23
542 #define FATTR4_FS_LOCATIONS 24
543 #define FATTR4_HIDDEN 25
544 #define FATTR4_HOMOGENEOUS 26
545 #define FATTR4_MAXFILESIZE 27
546 #define FATTR4_MAXLINK 28
547 #define FATTR4_MAXNAME 29
548 #define FATTR4_MAXREAD 30
549 #define FATTR4_MAXWRITE 31
550 #define FATTR4_MIMETYPE 32
551 #define FATTR4_MODE 33
552 #define FATTR4_NO_TRUNC 34
553 #define FATTR4_NUMLINKS 35
554 #define FATTR4_OWNER 36
555 #define FATTR4_OWNER_GROUP 37
556 #define FATTR4_QUOTA_AVAIL_HARD 38
557 #define FATTR4_QUOTA_AVAIL_SOFT 39
558 #define FATTR4_QUOTA_USED 40
559 #define FATTR4_RAWDEV 41
560 #define FATTR4_SPACE_AVAIL 42
561 #define FATTR4_SPACE_FREE 43
562 #define FATTR4_SPACE_TOTAL 44
563 #define FATTR4_SPACE_USED 45
564 #define FATTR4_SYSTEM 46
565 #define FATTR4_TIME_ACCESS 47
566 #define FATTR4_TIME_ACCESS_SET 48
567 #define FATTR4_TIME_BACKUP 49
568 #define FATTR4_TIME_CREATE 50
569 #define FATTR4_TIME_DELTA 51
570 #define FATTR4_TIME_METADATA 52
571 #define FATTR4_TIME_MODIFY 53
572 #define FATTR4_TIME_MODIFY_SET 54
573 #define FATTR4_MOUNTED_ON_FILEID 55
578 uint_t attrlist4_len
;
580 typedef struct fattr4 fattr4
;
582 struct change_info4
{
587 typedef struct change_info4 change_info4
;
593 typedef struct clientaddr4 clientaddr4
;
597 clientaddr4 cb_location
;
599 typedef struct cb_client4 cb_client4
;
603 char other
[NFS4_OTHER_SIZE
];
605 typedef struct stateid4 stateid4
;
607 struct nfs_client_id4
{
611 struct sockaddr
*cl_addr
;
613 typedef struct nfs_client_id4 nfs_client_id4
;
620 typedef struct open_owner4 open_owner4
;
627 typedef struct lock_owner4 lock_owner4
;
629 enum nfs_lock_type4
{
635 typedef enum nfs_lock_type4 nfs_lock_type4
;
636 #define ACCESS4_READ 0x00000001
637 #define ACCESS4_LOOKUP 0x00000002
638 #define ACCESS4_MODIFY 0x00000004
639 #define ACCESS4_EXTEND 0x00000008
640 #define ACCESS4_DELETE 0x00000010
641 #define ACCESS4_EXECUTE 0x00000020
646 typedef struct ACCESS4args ACCESS4args
;
653 typedef struct ACCESS4res ACCESS4res
;
657 stateid4 open_stateid
;
659 typedef struct CLOSE4args CLOSE4args
;
663 stateid4 open_stateid
;
665 typedef struct CLOSE4res CLOSE4res
;
671 typedef struct COMMIT4args COMMIT4args
;
677 typedef struct COMMIT4res COMMIT4res
;
688 typedef struct CREATE4args CREATE4args
;
690 struct CREATE4cargs
{
699 typedef struct CREATE4cargs CREATE4cargs
;
706 typedef struct CREATE4res CREATE4res
;
708 struct DELEGPURGE4args
{
711 typedef struct DELEGPURGE4args DELEGPURGE4args
;
713 struct DELEGPURGE4res
{
716 typedef struct DELEGPURGE4res DELEGPURGE4res
;
718 struct DELEGRETURN4args
{
719 stateid4 deleg_stateid
;
721 typedef struct DELEGRETURN4args DELEGRETURN4args
;
723 struct DELEGRETURN4res
{
726 typedef struct DELEGRETURN4res DELEGRETURN4res
;
730 struct GETATTR4args
{
731 bitmap4 attr_request
;
734 typedef struct GETATTR4args GETATTR4args
;
736 struct nfs4_ga_ext_res
;
740 unsigned n4g_change_valid
:1;
741 unsigned n4g_mon_fid_valid
:1;
742 unsigned n4g_fsid_valid
:1;
746 fattr4_change n4g_change
;
747 fattr4_fsid n4g_fsid
;
748 fattr4_mounted_on_fileid n4g_mon_fid
;
749 struct nfs4_ga_ext_res
*n4g_ext_res
;
752 typedef struct nfs4_ga_res nfs4_ga_res_t
;
756 fattr4 obj_attributes
;
758 struct nfs4_ga_res ga_res
;
760 typedef struct GETATTR4res GETATTR4res
;
766 typedef struct GETFH4res GETFH4res
;
771 typedef struct LINK4args LINK4args
;
776 typedef struct LINK4cargs LINK4cargs
;
782 typedef struct LINK4res LINK4res
;
784 struct open_to_lock_owner4
{
786 stateid4 open_stateid
;
788 lock_owner4 lock_owner
;
790 typedef struct open_to_lock_owner4 open_to_lock_owner4
;
792 struct exist_lock_owner4
{
793 stateid4 lock_stateid
;
796 typedef struct exist_lock_owner4 exist_lock_owner4
;
799 bool_t new_lock_owner
;
801 open_to_lock_owner4 open_owner
;
802 exist_lock_owner4 lock_owner
;
805 typedef struct locker4 locker4
;
808 nfs_lock_type4 locktype
;
814 typedef struct LOCK4args LOCK4args
;
819 nfs_lock_type4 locktype
;
822 typedef struct LOCK4denied LOCK4denied
;
827 stateid4 lock_stateid
;
831 typedef struct LOCK4res LOCK4res
;
834 nfs_lock_type4 locktype
;
839 typedef struct LOCKT4args LOCKT4args
;
845 typedef struct LOCKT4res LOCKT4res
;
848 nfs_lock_type4 locktype
;
850 stateid4 lock_stateid
;
854 typedef struct LOCKU4args LOCKU4args
;
858 stateid4 lock_stateid
;
860 typedef struct LOCKU4res LOCKU4res
;
865 typedef struct LOOKUP4args LOOKUP4args
;
867 struct LOOKUP4cargs
{
870 typedef struct LOOKUP4cargs LOOKUP4cargs
;
875 typedef struct LOOKUP4res LOOKUP4res
;
880 typedef struct LOOKUPP4res LOOKUPP4res
;
882 struct NVERIFY4args
{
883 fattr4 obj_attributes
;
885 typedef struct NVERIFY4args NVERIFY4args
;
890 typedef struct NVERIFY4res NVERIFY4res
;
897 typedef enum createmode4 createmode4
;
903 typedef enum opentype4 opentype4
;
909 typedef enum limit_by4 limit_by4
;
911 struct nfs_modified_limit4
{
913 uint32_t bytes_per_block
;
915 typedef struct nfs_modified_limit4 nfs_modified_limit4
;
917 struct nfs_space_limit4
{
921 nfs_modified_limit4 mod_blocks
;
922 } nfs_space_limit4_u
;
924 typedef struct nfs_space_limit4 nfs_space_limit4
;
925 #define OPEN4_SHARE_ACCESS_READ 0x00000001
926 #define OPEN4_SHARE_ACCESS_WRITE 0x00000002
927 #define OPEN4_SHARE_ACCESS_BOTH 0x00000003
928 #define OPEN4_SHARE_DENY_NONE 0x00000000
929 #define OPEN4_SHARE_DENY_READ 0x00000001
930 #define OPEN4_SHARE_DENY_WRITE 0x00000002
931 #define OPEN4_SHARE_DENY_BOTH 0x00000003
933 enum open_delegation_type4
{
934 OPEN_DELEGATE_NONE
= 0,
935 OPEN_DELEGATE_READ
= 1,
936 OPEN_DELEGATE_WRITE
= 2
938 typedef enum open_delegation_type4 open_delegation_type4
;
940 enum open_claim_type4
{
943 CLAIM_DELEGATE_CUR
= 2,
944 CLAIM_DELEGATE_PREV
= 3
946 typedef enum open_claim_type4 open_claim_type4
;
948 struct open_claim_delegate_cur4
{
949 stateid4 delegate_stateid
;
952 typedef struct open_claim_delegate_cur4 open_claim_delegate_cur4
;
954 struct copen_claim_delegate_cur4
{
955 stateid4 delegate_stateid
;
958 typedef struct copen_claim_delegate_cur4 copen_claim_delegate_cur4
;
962 uint32_t share_access
;
969 verifier4 createverf
;
971 open_claim_type4 claim
;
974 open_delegation_type4 delegate_type
;
975 open_claim_delegate_cur4 delegate_cur_info
;
976 component4 file_delegate_prev
;
979 typedef struct OPEN4args OPEN4args
;
983 uint32_t share_access
;
990 verifier4 createverf
;
992 open_claim_type4 claim
;
995 open_delegation_type4 delegate_type
;
996 copen_claim_delegate_cur4 delegate_cur_info
;
997 char *cfile_delegate_prev
;
1000 typedef struct OPEN4cargs OPEN4cargs
;
1002 struct open_read_delegation4
{
1005 nfsace4 permissions
;
1007 typedef struct open_read_delegation4 open_read_delegation4
;
1009 struct open_write_delegation4
{
1012 nfs_space_limit4 space_limit
;
1013 nfsace4 permissions
;
1015 typedef struct open_write_delegation4 open_write_delegation4
;
1017 struct open_delegation4
{
1018 open_delegation_type4 delegation_type
;
1020 open_read_delegation4 read
;
1021 open_write_delegation4 write
;
1022 } open_delegation4_u
;
1024 typedef struct open_delegation4 open_delegation4
;
1025 #define OPEN4_RESULT_CONFIRM 0x00000002
1026 #define OPEN4_RESULT_LOCKTYPE_POSIX 0x00000004
1034 open_delegation4 delegation
;
1036 typedef struct OPEN4res OPEN4res
;
1038 struct OPENATTR4args
{
1041 typedef struct OPENATTR4args OPENATTR4args
;
1043 struct OPENATTR4res
{
1046 typedef struct OPENATTR4res OPENATTR4res
;
1048 struct OPEN_CONFIRM4args
{
1049 stateid4 open_stateid
;
1052 typedef struct OPEN_CONFIRM4args OPEN_CONFIRM4args
;
1054 struct OPEN_CONFIRM4res
{
1056 stateid4 open_stateid
;
1058 typedef struct OPEN_CONFIRM4res OPEN_CONFIRM4res
;
1060 struct OPEN_DOWNGRADE4args
{
1061 stateid4 open_stateid
;
1063 uint32_t share_access
;
1064 uint32_t share_deny
;
1066 typedef struct OPEN_DOWNGRADE4args OPEN_DOWNGRADE4args
;
1068 struct OPEN_DOWNGRADE4res
{
1070 stateid4 open_stateid
;
1072 typedef struct OPEN_DOWNGRADE4res OPEN_DOWNGRADE4res
;
1077 typedef struct PUTFH4args PUTFH4args
;
1080 * Client only side PUTFH arguments
1081 * This is really a nfs4_sharedfh_t * but the forward declaration
1084 struct PUTFH4cargs
{
1087 typedef struct PUTFH4cargs PUTFH4cargs
;
1092 typedef struct PUTFH4res PUTFH4res
;
1094 struct PUTPUBFH4res
{
1097 typedef struct PUTPUBFH4res PUTPUBFH4res
;
1099 struct PUTROOTFH4res
{
1102 typedef struct PUTROOTFH4res PUTROOTFH4res
;
1108 /* The following are used for the XDR decode path */
1109 char *res_data_val_alt
;
1111 struct uio
*res_uiop
;
1114 struct clist
*wlist
;
1118 typedef struct READ4args READ4args
;
1127 struct clist
*wlist
;
1131 typedef struct READ4res READ4res
;
1133 struct rddir4_cache
;
1135 struct READDIR4args
{
1137 verifier4 cookieverf
;
1140 bitmap4 attr_request
;
1142 struct mntinfo4
*mi
;
1144 struct rddir4_cache
*rdc
;
1147 typedef struct READDIR4args READDIR4args
;
1149 struct READDIR4res_clnt
{
1151 verifier4 cookieverf
;
1153 struct dirent64
*dotp
, *dotdotp
;
1154 struct rddir4_cache
*rdc
;
1156 typedef struct READDIR4res_clnt READDIR4res_clnt
;
1158 struct READDIR4res
{
1160 verifier4 cookieverf
;
1164 typedef struct READDIR4res READDIR4res
;
1166 struct READLINK4res
{
1170 typedef struct READLINK4res READLINK4res
;
1172 struct REMOVE4args
{
1175 typedef struct REMOVE4args REMOVE4args
;
1177 struct REMOVE4cargs
{
1180 typedef struct REMOVE4cargs REMOVE4cargs
;
1186 typedef struct REMOVE4res REMOVE4res
;
1188 struct RENAME4args
{
1192 typedef struct RENAME4args RENAME4args
;
1194 struct RENAME4cargs
{
1198 typedef struct RENAME4cargs RENAME4cargs
;
1202 change_info4 source_cinfo
;
1203 change_info4 target_cinfo
;
1205 typedef struct RENAME4res RENAME4res
;
1210 typedef struct RENEW4args RENEW4args
;
1215 typedef struct RENEW4res RENEW4res
;
1217 struct RESTOREFH4res
{
1220 typedef struct RESTOREFH4res RESTOREFH4res
;
1225 typedef struct SAVEFH4res SAVEFH4res
;
1227 struct SECINFO4args
{
1230 typedef struct SECINFO4args SECINFO4args
;
1232 struct SECINFO4cargs
{
1235 typedef struct SECINFO4cargs SECINFO4cargs
;
1237 enum rpc_gss_svc_t
{
1238 RPC_GSS_SVC_NONE
= 1,
1239 RPC_GSS_SVC_INTEGRITY
= 2,
1240 RPC_GSS_SVC_PRIVACY
= 3
1242 typedef enum rpc_gss_svc_t rpc_gss_svc_t
;
1244 struct rpcsec_gss_info
{
1247 rpc_gss_svc_t service
;
1249 typedef struct rpcsec_gss_info rpcsec_gss_info
;
1253 rpcsec_gss_info flavor_info
;
1255 typedef struct secinfo4 secinfo4
;
1257 struct SECINFO4res
{
1259 uint_t SECINFO4resok_len
;
1260 secinfo4
*SECINFO4resok_val
;
1262 typedef struct SECINFO4res SECINFO4res
;
1264 struct SETATTR4args
{
1266 fattr4 obj_attributes
;
1268 typedef struct SETATTR4args SETATTR4args
;
1270 struct SETATTR4res
{
1274 typedef struct SETATTR4res SETATTR4res
;
1276 struct SETCLIENTID4args
{
1277 nfs_client_id4 client
;
1278 cb_client4 callback
;
1279 uint32_t callback_ident
;
1281 typedef struct SETCLIENTID4args SETCLIENTID4args
;
1283 struct SETCLIENTID4resok
{
1285 verifier4 setclientid_confirm
;
1287 typedef struct SETCLIENTID4resok SETCLIENTID4resok
;
1289 struct SETCLIENTID4res
{
1292 SETCLIENTID4resok resok4
;
1293 clientaddr4 client_using
;
1294 } SETCLIENTID4res_u
;
1296 typedef struct SETCLIENTID4res SETCLIENTID4res
;
1298 struct SETCLIENTID_CONFIRM4args
{
1300 verifier4 setclientid_confirm
;
1302 typedef struct SETCLIENTID_CONFIRM4args SETCLIENTID_CONFIRM4args
;
1304 struct SETCLIENTID_CONFIRM4res
{
1307 typedef struct SETCLIENTID_CONFIRM4res SETCLIENTID_CONFIRM4res
;
1309 struct VERIFY4args
{
1310 fattr4 obj_attributes
;
1312 typedef struct VERIFY4args VERIFY4args
;
1317 typedef struct VERIFY4res VERIFY4res
;
1324 typedef enum stable_how4 stable_how4
;
1327 * mblk doesn't go over the wire. If non-NULL, it points to an mblk chain
1328 * for the write data.
1339 struct clist
*rlist
;
1343 typedef struct WRITE4args WRITE4args
;
1348 stable_how4 committed
;
1349 verifier4 writeverf
;
1351 typedef struct WRITE4res WRITE4res
;
1353 struct RELEASE_LOCKOWNER4args
{
1354 lock_owner4 lock_owner
;
1356 typedef struct RELEASE_LOCKOWNER4args RELEASE_LOCKOWNER4args
;
1358 struct RELEASE_LOCKOWNER4res
{
1361 typedef struct RELEASE_LOCKOWNER4res RELEASE_LOCKOWNER4res
;
1363 struct ILLEGAL4res
{
1366 typedef struct ILLEGAL4res ILLEGAL4res
;
1386 OP_OPEN_CONFIRM
= 20,
1387 OP_OPEN_DOWNGRADE
= 21,
1401 OP_SETCLIENTID
= 35,
1402 OP_SETCLIENTID_CONFIRM
= 36,
1405 OP_RELEASE_LOCKOWNER
= 39,
1408 * These are internal client pseudo ops that *MUST* never go over the wire
1410 #define SUNW_PRIVATE_OP 0x10000000
1411 #define REAL_OP4(op) ((op) & ~SUNW_PRIVATE_OP)
1412 OP_CCREATE
= OP_CREATE
| SUNW_PRIVATE_OP
,
1413 OP_CLINK
= OP_LINK
| SUNW_PRIVATE_OP
,
1414 OP_CLOOKUP
= OP_LOOKUP
| SUNW_PRIVATE_OP
,
1415 OP_COPEN
= OP_OPEN
| SUNW_PRIVATE_OP
,
1416 OP_CPUTFH
= OP_PUTFH
| SUNW_PRIVATE_OP
,
1417 OP_CREMOVE
= OP_REMOVE
| SUNW_PRIVATE_OP
,
1418 OP_CRENAME
= OP_RENAME
| SUNW_PRIVATE_OP
,
1419 OP_CSECINFO
= OP_SECINFO
| SUNW_PRIVATE_OP
1421 typedef enum nfs_opnum4 nfs_opnum4
;
1426 ACCESS4args opaccess
;
1428 COMMIT4args opcommit
;
1429 CREATE4args opcreate
;
1430 CREATE4cargs opccreate
;
1431 DELEGPURGE4args opdelegpurge
;
1432 DELEGRETURN4args opdelegreturn
;
1433 GETATTR4args opgetattr
;
1439 LOOKUP4args oplookup
;
1440 LOOKUP4cargs opclookup
;
1441 NVERIFY4args opnverify
;
1444 OPENATTR4args opopenattr
;
1445 OPEN_CONFIRM4args opopen_confirm
;
1446 OPEN_DOWNGRADE4args opopen_downgrade
;
1448 PUTFH4cargs opcputfh
;
1450 READDIR4args opreaddir
;
1451 REMOVE4args opremove
;
1452 REMOVE4cargs opcremove
;
1453 RENAME4args oprename
;
1454 RENAME4cargs opcrename
;
1456 SECINFO4args opsecinfo
;
1457 SECINFO4cargs opcsecinfo
;
1458 SETATTR4args opsetattr
;
1459 SETCLIENTID4args opsetclientid
;
1460 SETCLIENTID_CONFIRM4args opsetclientid_confirm
;
1461 VERIFY4args opverify
;
1463 RELEASE_LOCKOWNER4args oprelease_lockowner
;
1465 size_t opsize
; /* the number of bytes occupied by the */
1466 /* particular operation in the XDR stream */
1467 /* (set during the decode only) */
1469 typedef struct nfs_argop4 nfs_argop4
;
1474 ACCESS4res opaccess
;
1476 COMMIT4res opcommit
;
1477 CREATE4res opcreate
;
1478 DELEGPURGE4res opdelegpurge
;
1479 DELEGRETURN4res opdelegreturn
;
1480 GETATTR4res opgetattr
;
1486 LOOKUP4res oplookup
;
1487 LOOKUPP4res oplookupp
;
1488 NVERIFY4res opnverify
;
1490 OPENATTR4res opopenattr
;
1491 OPEN_CONFIRM4res opopen_confirm
;
1492 OPEN_DOWNGRADE4res opopen_downgrade
;
1494 PUTPUBFH4res opputpubfh
;
1495 PUTROOTFH4res opputrootfh
;
1497 READDIR4res opreaddir
;
1498 READDIR4res_clnt opreaddirclnt
;
1499 READLINK4res opreadlink
;
1500 REMOVE4res opremove
;
1501 RENAME4res oprename
;
1503 RESTOREFH4res oprestorefh
;
1504 SAVEFH4res opsavefh
;
1505 SECINFO4res opsecinfo
;
1506 SETATTR4res opsetattr
;
1507 SETCLIENTID4res opsetclientid
;
1508 SETCLIENTID_CONFIRM4res opsetclientid_confirm
;
1509 VERIFY4res opverify
;
1511 RELEASE_LOCKOWNER4res oprelease_lockowner
;
1512 ILLEGAL4res opillegal
;
1514 size_t opsize
; /* the number of bytes occupied by the */
1515 /* particular operation in the XDR stream */
1516 /* (set during the encode only) */
1517 struct exportinfo
*exi
; /* the exportinfo where the operation should */
1518 /* be counted in (support for per-exportinfo */
1521 typedef struct nfs_resop4 nfs_resop4
;
1524 * Fixed size tag string for easy client encoding
1531 typedef struct _ctag ctag_t
;
1534 * Client-only encode-only version
1536 struct COMPOUND4args_clnt
{
1541 typedef struct COMPOUND4args_clnt COMPOUND4args_clnt
;
1543 struct COMPOUND4args
{
1545 uint32_t minorversion
;
1549 typedef struct COMPOUND4args COMPOUND4args
;
1551 struct COMPOUND4res_clnt
{
1556 COMPOUND4args_clnt
*argsp
;
1558 typedef struct COMPOUND4res_clnt COMPOUND4res_clnt
;
1560 struct COMPOUND4res
{
1566 typedef struct COMPOUND4res COMPOUND4res
;
1568 struct CB_GETATTR4args
{
1570 bitmap4 attr_request
;
1572 typedef struct CB_GETATTR4args CB_GETATTR4args
;
1574 struct CB_GETATTR4res
{
1576 fattr4 obj_attributes
;
1578 typedef struct CB_GETATTR4res CB_GETATTR4res
;
1580 struct CB_RECALL4args
{
1585 typedef struct CB_RECALL4args CB_RECALL4args
;
1587 struct CB_RECALL4res
{
1590 typedef struct CB_RECALL4res CB_RECALL4res
;
1592 struct CB_ILLEGAL4res
{
1595 typedef struct CB_ILLEGAL4res CB_ILLEGAL4res
;
1597 enum nfs_cb_opnum4
{
1600 OP_CB_ILLEGAL
= 10044
1602 typedef enum nfs_cb_opnum4 nfs_cb_opnum4
;
1604 struct nfs_cb_argop4
{
1607 CB_GETATTR4args opcbgetattr
;
1608 CB_RECALL4args opcbrecall
;
1611 typedef struct nfs_cb_argop4 nfs_cb_argop4
;
1613 struct nfs_cb_resop4
{
1616 CB_GETATTR4res opcbgetattr
;
1617 CB_RECALL4res opcbrecall
;
1618 CB_ILLEGAL4res opcbillegal
;
1621 typedef struct nfs_cb_resop4 nfs_cb_resop4
;
1623 struct CB_COMPOUND4args
{
1625 uint32_t minorversion
;
1626 uint32_t callback_ident
;
1628 nfs_cb_argop4
*array
;
1630 typedef struct CB_COMPOUND4args CB_COMPOUND4args
;
1632 struct CB_COMPOUND4res
{
1636 nfs_cb_resop4
*array
;
1638 typedef struct CB_COMPOUND4res CB_COMPOUND4res
;
1640 #define NFS4_PROGRAM 100003
1642 #define NFSPROC4_NULL 0
1643 #define NFSPROC4_COMPOUND 1
1645 #define NFS4_CALLBACK 0x40000000
1648 #define CB_COMPOUND 1
1650 extern bool_t
xdr_bitmap4(XDR
*, bitmap4
*);
1651 extern bool_t
xdr_utf8string(XDR
*, utf8string
*);
1652 extern bool_t
xdr_nfs_fh4(XDR
*, nfs_fh4
*);
1653 extern bool_t
xdr_fattr4_fsid(XDR
*, fattr4_fsid
*);
1654 extern bool_t
xdr_fattr4_acl(XDR
*, fattr4_acl
*);
1655 extern bool_t
xdr_fattr4_fs_locations(XDR
*, fattr4_fs_locations
*);
1656 extern bool_t
xdr_fattr4_rawdev(XDR
*, fattr4_rawdev
*);
1657 extern bool_t
xdr_nfstime4(XDR
*, nfstime4
*);
1658 extern bool_t
xdr_settime4(XDR
*, settime4
*);
1659 extern bool_t
xdr_COMPOUND4args_clnt(XDR
*, COMPOUND4args_clnt
*);
1660 extern bool_t
xdr_COMPOUND4args_srv(XDR
*, COMPOUND4args
*);
1661 extern bool_t
xdr_COMPOUND4res_clnt(XDR
*, COMPOUND4res_clnt
*);
1662 extern bool_t
xdr_COMPOUND4res_srv(XDR
*, COMPOUND4res
*);
1663 extern bool_t
xdr_CB_COMPOUND4args_clnt(XDR
*, CB_COMPOUND4args
*);
1664 extern bool_t
xdr_CB_COMPOUND4args_srv(XDR
*, CB_COMPOUND4args
*);
1665 extern bool_t
xdr_CB_COMPOUND4res(XDR
*, CB_COMPOUND4res
*);
1668 * xdr for referrrals upcall
1670 extern bool_t
xdr_knetconfig(XDR
*, struct knetconfig
*);
1671 extern bool_t
xdr_nfs_fsl_info(XDR
*, struct nfs_fsl_info
*);
1678 #endif /* _NFS4_KPROT_H */