17c478bd9Sstevel@tonic-gate /* 2*bbe876c0SMarcel Telka * This file was machine generated for [RFC7530]. 37c478bd9Sstevel@tonic-gate * 4*bbe876c0SMarcel Telka * Last updated Tue Mar 10 11:51:21 PDT 2015. 57c478bd9Sstevel@tonic-gate */ 6*bbe876c0SMarcel Telka 77c478bd9Sstevel@tonic-gate /* 8*bbe876c0SMarcel Telka * Copyright (c) 2015 IETF Trust and the persons identified 9*bbe876c0SMarcel Telka * as authors of the code. All rights reserved. 10*bbe876c0SMarcel Telka * 11*bbe876c0SMarcel Telka * Redistribution and use in source and binary forms, with 12*bbe876c0SMarcel Telka * or without modification, are permitted provided that the 13*bbe876c0SMarcel Telka * following conditions are met: 14*bbe876c0SMarcel Telka * 15*bbe876c0SMarcel Telka * - Redistributions of source code must retain the above 16*bbe876c0SMarcel Telka * copyright notice, this list of conditions and the 17*bbe876c0SMarcel Telka * following disclaimer. 18*bbe876c0SMarcel Telka * 19*bbe876c0SMarcel Telka * - Redistributions in binary form must reproduce the above 20*bbe876c0SMarcel Telka * copyright notice, this list of conditions and the 21*bbe876c0SMarcel Telka * following disclaimer in the documentation and/or other 22*bbe876c0SMarcel Telka * materials provided with the distribution. 23*bbe876c0SMarcel Telka * 24*bbe876c0SMarcel Telka * - Neither the name of Internet Society, IETF or IETF 25*bbe876c0SMarcel Telka * Trust, nor the names of specific contributors, may be 26*bbe876c0SMarcel Telka * used to endorse or promote products derived from this 27*bbe876c0SMarcel Telka * software without specific prior written permission. 28*bbe876c0SMarcel Telka * 29*bbe876c0SMarcel Telka * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 30*bbe876c0SMarcel Telka * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 31*bbe876c0SMarcel Telka * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 32*bbe876c0SMarcel Telka * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 33*bbe876c0SMarcel Telka * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 34*bbe876c0SMarcel Telka * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 35*bbe876c0SMarcel Telka * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 36*bbe876c0SMarcel Telka * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 37*bbe876c0SMarcel Telka * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 38*bbe876c0SMarcel Telka * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 39*bbe876c0SMarcel Telka * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 40*bbe876c0SMarcel Telka * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 41*bbe876c0SMarcel Telka * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 42*bbe876c0SMarcel Telka * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 43*bbe876c0SMarcel Telka * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 44*bbe876c0SMarcel Telka */ 45*bbe876c0SMarcel Telka 46*bbe876c0SMarcel Telka /* 47*bbe876c0SMarcel Telka * This code was derived from RFC 7531. 487c478bd9Sstevel@tonic-gate */ 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate /* 517c478bd9Sstevel@tonic-gate * nfs4_prot.x 52*bbe876c0SMarcel Telka * 537c478bd9Sstevel@tonic-gate */ 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate /* 567c478bd9Sstevel@tonic-gate * Basic typedefs for RFC 1832 data type definitions 577c478bd9Sstevel@tonic-gate */ 587c478bd9Sstevel@tonic-gate /* 597c478bd9Sstevel@tonic-gate * typedef int int32_t; 607c478bd9Sstevel@tonic-gate * typedef unsigned int uint32_t; 617c478bd9Sstevel@tonic-gate * typedef hyper int64_t; 627c478bd9Sstevel@tonic-gate * typedef unsigned hyper uint64_t; 637c478bd9Sstevel@tonic-gate */ 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate /* 667c478bd9Sstevel@tonic-gate * Sizes 677c478bd9Sstevel@tonic-gate */ 687c478bd9Sstevel@tonic-gate const NFS4_FHSIZE = 128; 697c478bd9Sstevel@tonic-gate const NFS4_VERIFIER_SIZE = 8; 70*bbe876c0SMarcel Telka const NFS4_OTHER_SIZE = 12; 717c478bd9Sstevel@tonic-gate const NFS4_OPAQUE_LIMIT = 1024; 727c478bd9Sstevel@tonic-gate 73*bbe876c0SMarcel Telka const NFS4_INT64_MAX = 0x7fffffffffffffff; 74*bbe876c0SMarcel Telka const NFS4_UINT64_MAX = 0xffffffffffffffff; 75*bbe876c0SMarcel Telka const NFS4_INT32_MAX = 0x7fffffff; 76*bbe876c0SMarcel Telka const NFS4_UINT32_MAX = 0xffffffff; 77*bbe876c0SMarcel Telka 78*bbe876c0SMarcel Telka 797c478bd9Sstevel@tonic-gate /* 807c478bd9Sstevel@tonic-gate * File types 817c478bd9Sstevel@tonic-gate */ 827c478bd9Sstevel@tonic-gate enum nfs_ftype4 { 837c478bd9Sstevel@tonic-gate NF4REG = 1, /* Regular File */ 847c478bd9Sstevel@tonic-gate NF4DIR = 2, /* Directory */ 857c478bd9Sstevel@tonic-gate NF4BLK = 3, /* Special File - block device */ 867c478bd9Sstevel@tonic-gate NF4CHR = 4, /* Special File - character device */ 877c478bd9Sstevel@tonic-gate NF4LNK = 5, /* Symbolic Link */ 887c478bd9Sstevel@tonic-gate NF4SOCK = 6, /* Special File - socket */ 897c478bd9Sstevel@tonic-gate NF4FIFO = 7, /* Special File - fifo */ 90*bbe876c0SMarcel Telka NF4ATTRDIR 91*bbe876c0SMarcel Telka = 8, /* Attribute Directory */ 92*bbe876c0SMarcel Telka NF4NAMEDATTR 93*bbe876c0SMarcel Telka = 9 /* Named Attribute */ 947c478bd9Sstevel@tonic-gate }; 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate /* 977c478bd9Sstevel@tonic-gate * Error status 987c478bd9Sstevel@tonic-gate */ 997c478bd9Sstevel@tonic-gate enum nfsstat4 { 1007c478bd9Sstevel@tonic-gate NFS4_OK = 0, /* everything is okay */ 1017c478bd9Sstevel@tonic-gate NFS4ERR_PERM = 1, /* caller not privileged */ 1027c478bd9Sstevel@tonic-gate NFS4ERR_NOENT = 2, /* no such file/directory */ 1037c478bd9Sstevel@tonic-gate NFS4ERR_IO = 5, /* hard I/O error */ 1047c478bd9Sstevel@tonic-gate NFS4ERR_NXIO = 6, /* no such device */ 1057c478bd9Sstevel@tonic-gate NFS4ERR_ACCESS = 13, /* access denied */ 1067c478bd9Sstevel@tonic-gate NFS4ERR_EXIST = 17, /* file already exists */ 1077c478bd9Sstevel@tonic-gate NFS4ERR_XDEV = 18, /* different file systems */ 1087c478bd9Sstevel@tonic-gate /* Unused/reserved 19 */ 1097c478bd9Sstevel@tonic-gate NFS4ERR_NOTDIR = 20, /* should be a directory */ 1107c478bd9Sstevel@tonic-gate NFS4ERR_ISDIR = 21, /* should not be directory */ 1117c478bd9Sstevel@tonic-gate NFS4ERR_INVAL = 22, /* invalid argument */ 1127c478bd9Sstevel@tonic-gate NFS4ERR_FBIG = 27, /* file exceeds server max */ 1137c478bd9Sstevel@tonic-gate NFS4ERR_NOSPC = 28, /* no space on file system */ 1147c478bd9Sstevel@tonic-gate NFS4ERR_ROFS = 30, /* read-only file system */ 1157c478bd9Sstevel@tonic-gate NFS4ERR_MLINK = 31, /* too many hard links */ 1167c478bd9Sstevel@tonic-gate NFS4ERR_NAMETOOLONG = 63, /* name exceeds server max */ 1177c478bd9Sstevel@tonic-gate NFS4ERR_NOTEMPTY = 66, /* directory not empty */ 1187c478bd9Sstevel@tonic-gate NFS4ERR_DQUOT = 69, /* hard quota limit reached */ 1197c478bd9Sstevel@tonic-gate NFS4ERR_STALE = 70, /* file no longer exists */ 1207c478bd9Sstevel@tonic-gate NFS4ERR_BADHANDLE = 10001,/* Illegal filehandle */ 1217c478bd9Sstevel@tonic-gate NFS4ERR_BAD_COOKIE = 10003,/* READDIR cookie is stale */ 1227c478bd9Sstevel@tonic-gate NFS4ERR_NOTSUPP = 10004,/* operation not supported */ 1237c478bd9Sstevel@tonic-gate NFS4ERR_TOOSMALL = 10005,/* response limit exceeded */ 1247c478bd9Sstevel@tonic-gate NFS4ERR_SERVERFAULT = 10006,/* undefined server error */ 1257c478bd9Sstevel@tonic-gate NFS4ERR_BADTYPE = 10007,/* type invalid for CREATE */ 1267c478bd9Sstevel@tonic-gate NFS4ERR_DELAY = 10008,/* file "busy" - retry */ 1277c478bd9Sstevel@tonic-gate NFS4ERR_SAME = 10009,/* nverify says attrs same */ 1287c478bd9Sstevel@tonic-gate NFS4ERR_DENIED = 10010,/* lock unavailable */ 1297c478bd9Sstevel@tonic-gate NFS4ERR_EXPIRED = 10011,/* lock lease expired */ 1307c478bd9Sstevel@tonic-gate NFS4ERR_LOCKED = 10012,/* I/O failed due to lock */ 1317c478bd9Sstevel@tonic-gate NFS4ERR_GRACE = 10013,/* in grace period */ 1327c478bd9Sstevel@tonic-gate NFS4ERR_FHEXPIRED = 10014,/* filehandle expired */ 1337c478bd9Sstevel@tonic-gate NFS4ERR_SHARE_DENIED = 10015,/* share reserve denied */ 1347c478bd9Sstevel@tonic-gate NFS4ERR_WRONGSEC = 10016,/* wrong security flavor */ 1357c478bd9Sstevel@tonic-gate NFS4ERR_CLID_INUSE = 10017,/* clientid in use */ 1367c478bd9Sstevel@tonic-gate NFS4ERR_RESOURCE = 10018,/* resource exhaustion */ 1377c478bd9Sstevel@tonic-gate NFS4ERR_MOVED = 10019,/* file system relocated */ 1387c478bd9Sstevel@tonic-gate NFS4ERR_NOFILEHANDLE = 10020,/* current FH is not set */ 1397c478bd9Sstevel@tonic-gate NFS4ERR_MINOR_VERS_MISMATCH = 10021,/* minor vers not supp */ 1407c478bd9Sstevel@tonic-gate NFS4ERR_STALE_CLIENTID = 10022,/* server has rebooted */ 1417c478bd9Sstevel@tonic-gate NFS4ERR_STALE_STATEID = 10023,/* server has rebooted */ 1427c478bd9Sstevel@tonic-gate NFS4ERR_OLD_STATEID = 10024,/* state is out of sync */ 1437c478bd9Sstevel@tonic-gate NFS4ERR_BAD_STATEID = 10025,/* incorrect stateid */ 1447c478bd9Sstevel@tonic-gate NFS4ERR_BAD_SEQID = 10026,/* request is out of seq. */ 1457c478bd9Sstevel@tonic-gate NFS4ERR_NOT_SAME = 10027,/* verify - attrs not same */ 1467c478bd9Sstevel@tonic-gate NFS4ERR_LOCK_RANGE = 10028,/* lock range not supported */ 1477c478bd9Sstevel@tonic-gate NFS4ERR_SYMLINK = 10029,/* should be file/directory */ 1487c478bd9Sstevel@tonic-gate NFS4ERR_RESTOREFH = 10030,/* no saved filehandle */ 1497c478bd9Sstevel@tonic-gate NFS4ERR_LEASE_MOVED = 10031,/* some file system moved */ 1507c478bd9Sstevel@tonic-gate NFS4ERR_ATTRNOTSUPP = 10032,/* recommended attr not sup */ 1517c478bd9Sstevel@tonic-gate NFS4ERR_NO_GRACE = 10033,/* reclaim outside of grace */ 1527c478bd9Sstevel@tonic-gate NFS4ERR_RECLAIM_BAD = 10034,/* reclaim error at server */ 1537c478bd9Sstevel@tonic-gate NFS4ERR_RECLAIM_CONFLICT = 10035,/* conflict on reclaim */ 1547c478bd9Sstevel@tonic-gate NFS4ERR_BADXDR = 10036,/* XDR decode failed */ 1557c478bd9Sstevel@tonic-gate NFS4ERR_LOCKS_HELD = 10037,/* file locks held at CLOSE */ 1567c478bd9Sstevel@tonic-gate NFS4ERR_OPENMODE = 10038,/* conflict in OPEN and I/O */ 1577c478bd9Sstevel@tonic-gate NFS4ERR_BADOWNER = 10039,/* owner translation bad */ 158*bbe876c0SMarcel Telka NFS4ERR_BADCHAR = 10040,/* UTF-8 char not supported */ 1597c478bd9Sstevel@tonic-gate NFS4ERR_BADNAME = 10041,/* name not supported */ 1607c478bd9Sstevel@tonic-gate NFS4ERR_BAD_RANGE = 10042,/* lock range not supported */ 1617c478bd9Sstevel@tonic-gate NFS4ERR_LOCK_NOTSUPP = 10043,/* no atomic up/downgrade */ 1627c478bd9Sstevel@tonic-gate NFS4ERR_OP_ILLEGAL = 10044,/* undefined operation */ 1637c478bd9Sstevel@tonic-gate NFS4ERR_DEADLOCK = 10045,/* file locking deadlock */ 1647c478bd9Sstevel@tonic-gate NFS4ERR_FILE_OPEN = 10046,/* open file blocks op. */ 165*bbe876c0SMarcel Telka NFS4ERR_ADMIN_REVOKED = 10047,/* lock-owner state revoked */ 1667c478bd9Sstevel@tonic-gate NFS4ERR_CB_PATH_DOWN = 10048 /* callback path down */ 1677c478bd9Sstevel@tonic-gate }; 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate /* 1707c478bd9Sstevel@tonic-gate * Basic data types 1717c478bd9Sstevel@tonic-gate */ 172*bbe876c0SMarcel Telka typedef opaque attrlist4<>; 1737c478bd9Sstevel@tonic-gate typedef uint32_t bitmap4<>; 174*bbe876c0SMarcel Telka typedef uint64_t changeid4; 175*bbe876c0SMarcel Telka typedef uint64_t clientid4; 1767c478bd9Sstevel@tonic-gate typedef uint32_t count4; 1777c478bd9Sstevel@tonic-gate typedef uint64_t length4; 178*bbe876c0SMarcel Telka typedef uint32_t mode4; 179*bbe876c0SMarcel Telka typedef uint64_t nfs_cookie4; 180*bbe876c0SMarcel Telka typedef opaque nfs_fh4<NFS4_FHSIZE>; 181*bbe876c0SMarcel Telka typedef uint32_t nfs_lease4; 182*bbe876c0SMarcel Telka typedef uint64_t offset4; 183*bbe876c0SMarcel Telka typedef uint32_t qop4; 184*bbe876c0SMarcel Telka typedef opaque sec_oid4<>; 1857c478bd9Sstevel@tonic-gate typedef uint32_t seqid4; 1867c478bd9Sstevel@tonic-gate typedef opaque utf8string<>; 1877c478bd9Sstevel@tonic-gate typedef utf8string utf8str_cis; 1887c478bd9Sstevel@tonic-gate typedef utf8string utf8str_cs; 1897c478bd9Sstevel@tonic-gate typedef utf8string utf8str_mixed; 1907c478bd9Sstevel@tonic-gate typedef utf8str_cs component4; 191*bbe876c0SMarcel Telka typedef opaque linktext4<>; 192*bbe876c0SMarcel Telka typedef utf8string ascii_REQUIRED4; 1937c478bd9Sstevel@tonic-gate typedef component4 pathname4<>; 1947c478bd9Sstevel@tonic-gate typedef uint64_t nfs_lockid4; 1957c478bd9Sstevel@tonic-gate typedef opaque verifier4[NFS4_VERIFIER_SIZE]; 1967c478bd9Sstevel@tonic-gate 197*bbe876c0SMarcel Telka 1987c478bd9Sstevel@tonic-gate /* 1997c478bd9Sstevel@tonic-gate * Timeval 2007c478bd9Sstevel@tonic-gate */ 2017c478bd9Sstevel@tonic-gate struct nfstime4 { 2027c478bd9Sstevel@tonic-gate int64_t seconds; 2037c478bd9Sstevel@tonic-gate uint32_t nseconds; 2047c478bd9Sstevel@tonic-gate }; 2057c478bd9Sstevel@tonic-gate 2067c478bd9Sstevel@tonic-gate enum time_how4 { 2077c478bd9Sstevel@tonic-gate SET_TO_SERVER_TIME4 = 0, 2087c478bd9Sstevel@tonic-gate SET_TO_CLIENT_TIME4 = 1 2097c478bd9Sstevel@tonic-gate }; 2107c478bd9Sstevel@tonic-gate 2117c478bd9Sstevel@tonic-gate union settime4 switch (time_how4 set_it) { 2127c478bd9Sstevel@tonic-gate case SET_TO_CLIENT_TIME4: 2137c478bd9Sstevel@tonic-gate nfstime4 time; 2147c478bd9Sstevel@tonic-gate default: 2157c478bd9Sstevel@tonic-gate void; 2167c478bd9Sstevel@tonic-gate }; 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate /* 2207c478bd9Sstevel@tonic-gate * File attribute definitions 2217c478bd9Sstevel@tonic-gate */ 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate /* 2247c478bd9Sstevel@tonic-gate * FSID structure for major/minor 2257c478bd9Sstevel@tonic-gate */ 2267c478bd9Sstevel@tonic-gate struct fsid4 { 2277c478bd9Sstevel@tonic-gate uint64_t major; 2287c478bd9Sstevel@tonic-gate uint64_t minor; 2297c478bd9Sstevel@tonic-gate }; 2307c478bd9Sstevel@tonic-gate 231*bbe876c0SMarcel Telka 2327c478bd9Sstevel@tonic-gate /* 2337c478bd9Sstevel@tonic-gate * File system locations attribute for relocation/migration 2347c478bd9Sstevel@tonic-gate */ 2357c478bd9Sstevel@tonic-gate struct fs_location4 { 2367c478bd9Sstevel@tonic-gate utf8str_cis server<>; 2377c478bd9Sstevel@tonic-gate pathname4 rootpath; 2387c478bd9Sstevel@tonic-gate }; 2397c478bd9Sstevel@tonic-gate 2407c478bd9Sstevel@tonic-gate struct fs_locations4 { 2417c478bd9Sstevel@tonic-gate pathname4 fs_root; 2427c478bd9Sstevel@tonic-gate fs_location4 locations<>; 2437c478bd9Sstevel@tonic-gate }; 2447c478bd9Sstevel@tonic-gate 2452f172c55SRobert Thurlow 2467c478bd9Sstevel@tonic-gate /* 2477c478bd9Sstevel@tonic-gate * Various Access Control Entry definitions 2487c478bd9Sstevel@tonic-gate */ 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate /* 251*bbe876c0SMarcel Telka * Mask that indicates which Access Control Entries 252*bbe876c0SMarcel Telka * are supported. Values for the fattr4_aclsupport attribute. 2537c478bd9Sstevel@tonic-gate */ 2547c478bd9Sstevel@tonic-gate const ACL4_SUPPORT_ALLOW_ACL = 0x00000001; 2557c478bd9Sstevel@tonic-gate const ACL4_SUPPORT_DENY_ACL = 0x00000002; 2567c478bd9Sstevel@tonic-gate const ACL4_SUPPORT_AUDIT_ACL = 0x00000004; 2577c478bd9Sstevel@tonic-gate const ACL4_SUPPORT_ALARM_ACL = 0x00000008; 2587c478bd9Sstevel@tonic-gate 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate typedef uint32_t acetype4; 2617c478bd9Sstevel@tonic-gate 262*bbe876c0SMarcel Telka 2637c478bd9Sstevel@tonic-gate /* 264*bbe876c0SMarcel Telka * acetype4 values; others can be added as needed. 2657c478bd9Sstevel@tonic-gate */ 2667c478bd9Sstevel@tonic-gate const ACE4_ACCESS_ALLOWED_ACE_TYPE = 0x00000000; 2677c478bd9Sstevel@tonic-gate const ACE4_ACCESS_DENIED_ACE_TYPE = 0x00000001; 2687c478bd9Sstevel@tonic-gate const ACE4_SYSTEM_AUDIT_ACE_TYPE = 0x00000002; 2697c478bd9Sstevel@tonic-gate const ACE4_SYSTEM_ALARM_ACE_TYPE = 0x00000003; 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate 272*bbe876c0SMarcel Telka 2737c478bd9Sstevel@tonic-gate /* 2747c478bd9Sstevel@tonic-gate * ACE flag 2757c478bd9Sstevel@tonic-gate */ 2767c478bd9Sstevel@tonic-gate typedef uint32_t aceflag4; 2777c478bd9Sstevel@tonic-gate 278*bbe876c0SMarcel Telka 2797c478bd9Sstevel@tonic-gate /* 2807c478bd9Sstevel@tonic-gate * ACE flag values 2817c478bd9Sstevel@tonic-gate */ 2827c478bd9Sstevel@tonic-gate const ACE4_FILE_INHERIT_ACE = 0x00000001; 2837c478bd9Sstevel@tonic-gate const ACE4_DIRECTORY_INHERIT_ACE = 0x00000002; 2847c478bd9Sstevel@tonic-gate const ACE4_NO_PROPAGATE_INHERIT_ACE = 0x00000004; 2857c478bd9Sstevel@tonic-gate const ACE4_INHERIT_ONLY_ACE = 0x00000008; 2867c478bd9Sstevel@tonic-gate const ACE4_SUCCESSFUL_ACCESS_ACE_FLAG = 0x00000010; 2877c478bd9Sstevel@tonic-gate const ACE4_FAILED_ACCESS_ACE_FLAG = 0x00000020; 2887c478bd9Sstevel@tonic-gate const ACE4_IDENTIFIER_GROUP = 0x00000040; 2897c478bd9Sstevel@tonic-gate 2907c478bd9Sstevel@tonic-gate 291*bbe876c0SMarcel Telka 2927c478bd9Sstevel@tonic-gate /* 2937c478bd9Sstevel@tonic-gate * ACE mask 2947c478bd9Sstevel@tonic-gate */ 2957c478bd9Sstevel@tonic-gate typedef uint32_t acemask4; 2967c478bd9Sstevel@tonic-gate 297*bbe876c0SMarcel Telka 2987c478bd9Sstevel@tonic-gate /* 2997c478bd9Sstevel@tonic-gate * ACE mask values 3007c478bd9Sstevel@tonic-gate */ 3017c478bd9Sstevel@tonic-gate const ACE4_READ_DATA = 0x00000001; 3027c478bd9Sstevel@tonic-gate const ACE4_LIST_DIRECTORY = 0x00000001; 3037c478bd9Sstevel@tonic-gate const ACE4_WRITE_DATA = 0x00000002; 3047c478bd9Sstevel@tonic-gate const ACE4_ADD_FILE = 0x00000002; 3057c478bd9Sstevel@tonic-gate const ACE4_APPEND_DATA = 0x00000004; 3067c478bd9Sstevel@tonic-gate const ACE4_ADD_SUBDIRECTORY = 0x00000004; 3077c478bd9Sstevel@tonic-gate const ACE4_READ_NAMED_ATTRS = 0x00000008; 3087c478bd9Sstevel@tonic-gate const ACE4_WRITE_NAMED_ATTRS = 0x00000010; 3097c478bd9Sstevel@tonic-gate const ACE4_EXECUTE = 0x00000020; 3107c478bd9Sstevel@tonic-gate const ACE4_DELETE_CHILD = 0x00000040; 3117c478bd9Sstevel@tonic-gate const ACE4_READ_ATTRIBUTES = 0x00000080; 3127c478bd9Sstevel@tonic-gate const ACE4_WRITE_ATTRIBUTES = 0x00000100; 3137c478bd9Sstevel@tonic-gate 3147c478bd9Sstevel@tonic-gate const ACE4_DELETE = 0x00010000; 3157c478bd9Sstevel@tonic-gate const ACE4_READ_ACL = 0x00020000; 3167c478bd9Sstevel@tonic-gate const ACE4_WRITE_ACL = 0x00040000; 3177c478bd9Sstevel@tonic-gate const ACE4_WRITE_OWNER = 0x00080000; 3187c478bd9Sstevel@tonic-gate const ACE4_SYNCHRONIZE = 0x00100000; 3197c478bd9Sstevel@tonic-gate 320*bbe876c0SMarcel Telka 3217c478bd9Sstevel@tonic-gate /* 322*bbe876c0SMarcel Telka * ACE4_GENERIC_READ - defined as a combination of 3237c478bd9Sstevel@tonic-gate * ACE4_READ_ACL | 3247c478bd9Sstevel@tonic-gate * ACE4_READ_DATA | 3257c478bd9Sstevel@tonic-gate * ACE4_READ_ATTRIBUTES | 3267c478bd9Sstevel@tonic-gate * ACE4_SYNCHRONIZE 3277c478bd9Sstevel@tonic-gate */ 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gate const ACE4_GENERIC_READ = 0x00120081; 3307c478bd9Sstevel@tonic-gate 3317c478bd9Sstevel@tonic-gate /* 332*bbe876c0SMarcel Telka * ACE4_GENERIC_WRITE - defined as a combination of 3337c478bd9Sstevel@tonic-gate * ACE4_READ_ACL | 3347c478bd9Sstevel@tonic-gate * ACE4_WRITE_DATA | 3357c478bd9Sstevel@tonic-gate * ACE4_WRITE_ATTRIBUTES | 3367c478bd9Sstevel@tonic-gate * ACE4_WRITE_ACL | 3377c478bd9Sstevel@tonic-gate * ACE4_APPEND_DATA | 3387c478bd9Sstevel@tonic-gate * ACE4_SYNCHRONIZE 3397c478bd9Sstevel@tonic-gate */ 3407c478bd9Sstevel@tonic-gate const ACE4_GENERIC_WRITE = 0x00160106; 3417c478bd9Sstevel@tonic-gate 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate /* 344*bbe876c0SMarcel Telka * ACE4_GENERIC_EXECUTE - defined as a combination of 3457c478bd9Sstevel@tonic-gate * ACE4_READ_ACL 3467c478bd9Sstevel@tonic-gate * ACE4_READ_ATTRIBUTES 3477c478bd9Sstevel@tonic-gate * ACE4_EXECUTE 3487c478bd9Sstevel@tonic-gate * ACE4_SYNCHRONIZE 3497c478bd9Sstevel@tonic-gate */ 3507c478bd9Sstevel@tonic-gate const ACE4_GENERIC_EXECUTE = 0x001200A0; 3517c478bd9Sstevel@tonic-gate 3527c478bd9Sstevel@tonic-gate 3537c478bd9Sstevel@tonic-gate /* 3547c478bd9Sstevel@tonic-gate * Access Control Entry definition 3557c478bd9Sstevel@tonic-gate */ 3567c478bd9Sstevel@tonic-gate struct nfsace4 { 3577c478bd9Sstevel@tonic-gate acetype4 type; 3587c478bd9Sstevel@tonic-gate aceflag4 flag; 3597c478bd9Sstevel@tonic-gate acemask4 access_mask; 3607c478bd9Sstevel@tonic-gate utf8str_mixed who; 3617c478bd9Sstevel@tonic-gate }; 3627c478bd9Sstevel@tonic-gate 363*bbe876c0SMarcel Telka 3647c478bd9Sstevel@tonic-gate /* 3657c478bd9Sstevel@tonic-gate * Field definitions for the fattr4_mode attribute 3667c478bd9Sstevel@tonic-gate */ 3677c478bd9Sstevel@tonic-gate const MODE4_SUID = 0x800; /* set user id on execution */ 3687c478bd9Sstevel@tonic-gate const MODE4_SGID = 0x400; /* set group id on execution */ 3697c478bd9Sstevel@tonic-gate const MODE4_SVTX = 0x200; /* save text even after use */ 3707c478bd9Sstevel@tonic-gate const MODE4_RUSR = 0x100; /* read permission: owner */ 3717c478bd9Sstevel@tonic-gate const MODE4_WUSR = 0x080; /* write permission: owner */ 3727c478bd9Sstevel@tonic-gate const MODE4_XUSR = 0x040; /* execute permission: owner */ 3737c478bd9Sstevel@tonic-gate const MODE4_RGRP = 0x020; /* read permission: group */ 3747c478bd9Sstevel@tonic-gate const MODE4_WGRP = 0x010; /* write permission: group */ 3757c478bd9Sstevel@tonic-gate const MODE4_XGRP = 0x008; /* execute permission: group */ 3767c478bd9Sstevel@tonic-gate const MODE4_ROTH = 0x004; /* read permission: other */ 3777c478bd9Sstevel@tonic-gate const MODE4_WOTH = 0x002; /* write permission: other */ 3787c478bd9Sstevel@tonic-gate const MODE4_XOTH = 0x001; /* execute permission: other */ 3797c478bd9Sstevel@tonic-gate 380*bbe876c0SMarcel Telka 3817c478bd9Sstevel@tonic-gate /* 3827c478bd9Sstevel@tonic-gate * Special data/attribute associated with 3837c478bd9Sstevel@tonic-gate * file types NF4BLK and NF4CHR. 3847c478bd9Sstevel@tonic-gate */ 3857c478bd9Sstevel@tonic-gate struct specdata4 { 3867c478bd9Sstevel@tonic-gate uint32_t specdata1; /* major device number */ 3877c478bd9Sstevel@tonic-gate uint32_t specdata2; /* minor device number */ 3887c478bd9Sstevel@tonic-gate }; 3897c478bd9Sstevel@tonic-gate 390*bbe876c0SMarcel Telka 3917c478bd9Sstevel@tonic-gate /* 3927c478bd9Sstevel@tonic-gate * Values for fattr4_fh_expire_type 3937c478bd9Sstevel@tonic-gate */ 3947c478bd9Sstevel@tonic-gate const FH4_PERSISTENT = 0x00000000; 3957c478bd9Sstevel@tonic-gate const FH4_NOEXPIRE_WITH_OPEN = 0x00000001; 3967c478bd9Sstevel@tonic-gate const FH4_VOLATILE_ANY = 0x00000002; 3977c478bd9Sstevel@tonic-gate const FH4_VOL_MIGRATION = 0x00000004; 3987c478bd9Sstevel@tonic-gate const FH4_VOL_RENAME = 0x00000008; 3997c478bd9Sstevel@tonic-gate 4007c478bd9Sstevel@tonic-gate 4017c478bd9Sstevel@tonic-gate typedef bitmap4 fattr4_supported_attrs; 4027c478bd9Sstevel@tonic-gate typedef nfs_ftype4 fattr4_type; 4037c478bd9Sstevel@tonic-gate typedef uint32_t fattr4_fh_expire_type; 4047c478bd9Sstevel@tonic-gate typedef changeid4 fattr4_change; 4057c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_size; 4067c478bd9Sstevel@tonic-gate typedef bool fattr4_link_support; 4077c478bd9Sstevel@tonic-gate typedef bool fattr4_symlink_support; 4087c478bd9Sstevel@tonic-gate typedef bool fattr4_named_attr; 4097c478bd9Sstevel@tonic-gate typedef fsid4 fattr4_fsid; 4107c478bd9Sstevel@tonic-gate typedef bool fattr4_unique_handles; 411*bbe876c0SMarcel Telka typedef nfs_lease4 fattr4_lease_time; 4127c478bd9Sstevel@tonic-gate typedef nfsstat4 fattr4_rdattr_error; 4137c478bd9Sstevel@tonic-gate 4147c478bd9Sstevel@tonic-gate typedef nfsace4 fattr4_acl<>; 4157c478bd9Sstevel@tonic-gate typedef uint32_t fattr4_aclsupport; 4167c478bd9Sstevel@tonic-gate typedef bool fattr4_archive; 4177c478bd9Sstevel@tonic-gate typedef bool fattr4_cansettime; 4187c478bd9Sstevel@tonic-gate typedef bool fattr4_case_insensitive; 4197c478bd9Sstevel@tonic-gate typedef bool fattr4_case_preserving; 4207c478bd9Sstevel@tonic-gate typedef bool fattr4_chown_restricted; 4217c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_fileid; 4227c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_files_avail; 4237c478bd9Sstevel@tonic-gate typedef nfs_fh4 fattr4_filehandle; 4247c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_files_free; 4257c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_files_total; 4267c478bd9Sstevel@tonic-gate typedef fs_locations4 fattr4_fs_locations; 4277c478bd9Sstevel@tonic-gate typedef bool fattr4_hidden; 4287c478bd9Sstevel@tonic-gate typedef bool fattr4_homogeneous; 4297c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_maxfilesize; 4307c478bd9Sstevel@tonic-gate typedef uint32_t fattr4_maxlink; 4317c478bd9Sstevel@tonic-gate typedef uint32_t fattr4_maxname; 4327c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_maxread; 4337c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_maxwrite; 434*bbe876c0SMarcel Telka typedef ascii_REQUIRED4 fattr4_mimetype; 4357c478bd9Sstevel@tonic-gate typedef mode4 fattr4_mode; 4367c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_mounted_on_fileid; 4377c478bd9Sstevel@tonic-gate typedef bool fattr4_no_trunc; 4387c478bd9Sstevel@tonic-gate typedef uint32_t fattr4_numlinks; 4397c478bd9Sstevel@tonic-gate typedef utf8str_mixed fattr4_owner; 4407c478bd9Sstevel@tonic-gate typedef utf8str_mixed fattr4_owner_group; 4417c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_quota_avail_hard; 4427c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_quota_avail_soft; 4437c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_quota_used; 4447c478bd9Sstevel@tonic-gate typedef specdata4 fattr4_rawdev; 4457c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_space_avail; 4467c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_space_free; 4477c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_space_total; 4487c478bd9Sstevel@tonic-gate typedef uint64_t fattr4_space_used; 4497c478bd9Sstevel@tonic-gate typedef bool fattr4_system; 4507c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_access; 4517c478bd9Sstevel@tonic-gate typedef settime4 fattr4_time_access_set; 4527c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_backup; 4537c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_create; 4547c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_delta; 4557c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_metadata; 4567c478bd9Sstevel@tonic-gate typedef nfstime4 fattr4_time_modify; 4577c478bd9Sstevel@tonic-gate typedef settime4 fattr4_time_modify_set; 4587c478bd9Sstevel@tonic-gate 4597c478bd9Sstevel@tonic-gate 4607c478bd9Sstevel@tonic-gate /* 461*bbe876c0SMarcel Telka * Mandatory attributes 4627c478bd9Sstevel@tonic-gate */ 4637c478bd9Sstevel@tonic-gate const FATTR4_SUPPORTED_ATTRS = 0; 4647c478bd9Sstevel@tonic-gate const FATTR4_TYPE = 1; 4657c478bd9Sstevel@tonic-gate const FATTR4_FH_EXPIRE_TYPE = 2; 4667c478bd9Sstevel@tonic-gate const FATTR4_CHANGE = 3; 4677c478bd9Sstevel@tonic-gate const FATTR4_SIZE = 4; 4687c478bd9Sstevel@tonic-gate const FATTR4_LINK_SUPPORT = 5; 4697c478bd9Sstevel@tonic-gate const FATTR4_SYMLINK_SUPPORT = 6; 4707c478bd9Sstevel@tonic-gate const FATTR4_NAMED_ATTR = 7; 4717c478bd9Sstevel@tonic-gate const FATTR4_FSID = 8; 4727c478bd9Sstevel@tonic-gate const FATTR4_UNIQUE_HANDLES = 9; 4737c478bd9Sstevel@tonic-gate const FATTR4_LEASE_TIME = 10; 4747c478bd9Sstevel@tonic-gate const FATTR4_RDATTR_ERROR = 11; 4757c478bd9Sstevel@tonic-gate const FATTR4_FILEHANDLE = 19; 4767c478bd9Sstevel@tonic-gate 4777c478bd9Sstevel@tonic-gate /* 478*bbe876c0SMarcel Telka * Recommended attributes 4797c478bd9Sstevel@tonic-gate */ 4807c478bd9Sstevel@tonic-gate const FATTR4_ACL = 12; 4817c478bd9Sstevel@tonic-gate const FATTR4_ACLSUPPORT = 13; 4827c478bd9Sstevel@tonic-gate const FATTR4_ARCHIVE = 14; 4837c478bd9Sstevel@tonic-gate const FATTR4_CANSETTIME = 15; 4847c478bd9Sstevel@tonic-gate const FATTR4_CASE_INSENSITIVE = 16; 4857c478bd9Sstevel@tonic-gate const FATTR4_CASE_PRESERVING = 17; 4867c478bd9Sstevel@tonic-gate const FATTR4_CHOWN_RESTRICTED = 18; 4877c478bd9Sstevel@tonic-gate const FATTR4_FILEID = 20; 4887c478bd9Sstevel@tonic-gate const FATTR4_FILES_AVAIL = 21; 4897c478bd9Sstevel@tonic-gate const FATTR4_FILES_FREE = 22; 4907c478bd9Sstevel@tonic-gate const FATTR4_FILES_TOTAL = 23; 4917c478bd9Sstevel@tonic-gate const FATTR4_FS_LOCATIONS = 24; 4927c478bd9Sstevel@tonic-gate const FATTR4_HIDDEN = 25; 4937c478bd9Sstevel@tonic-gate const FATTR4_HOMOGENEOUS = 26; 4947c478bd9Sstevel@tonic-gate const FATTR4_MAXFILESIZE = 27; 4957c478bd9Sstevel@tonic-gate const FATTR4_MAXLINK = 28; 4967c478bd9Sstevel@tonic-gate const FATTR4_MAXNAME = 29; 4977c478bd9Sstevel@tonic-gate const FATTR4_MAXREAD = 30; 4987c478bd9Sstevel@tonic-gate const FATTR4_MAXWRITE = 31; 4997c478bd9Sstevel@tonic-gate const FATTR4_MIMETYPE = 32; 5007c478bd9Sstevel@tonic-gate const FATTR4_MODE = 33; 5017c478bd9Sstevel@tonic-gate const FATTR4_NO_TRUNC = 34; 5027c478bd9Sstevel@tonic-gate const FATTR4_NUMLINKS = 35; 5037c478bd9Sstevel@tonic-gate const FATTR4_OWNER = 36; 5047c478bd9Sstevel@tonic-gate const FATTR4_OWNER_GROUP = 37; 5057c478bd9Sstevel@tonic-gate const FATTR4_QUOTA_AVAIL_HARD = 38; 5067c478bd9Sstevel@tonic-gate const FATTR4_QUOTA_AVAIL_SOFT = 39; 5077c478bd9Sstevel@tonic-gate const FATTR4_QUOTA_USED = 40; 5087c478bd9Sstevel@tonic-gate const FATTR4_RAWDEV = 41; 5097c478bd9Sstevel@tonic-gate const FATTR4_SPACE_AVAIL = 42; 5107c478bd9Sstevel@tonic-gate const FATTR4_SPACE_FREE = 43; 5117c478bd9Sstevel@tonic-gate const FATTR4_SPACE_TOTAL = 44; 5127c478bd9Sstevel@tonic-gate const FATTR4_SPACE_USED = 45; 5137c478bd9Sstevel@tonic-gate const FATTR4_SYSTEM = 46; 5147c478bd9Sstevel@tonic-gate const FATTR4_TIME_ACCESS = 47; 5157c478bd9Sstevel@tonic-gate const FATTR4_TIME_ACCESS_SET = 48; 5167c478bd9Sstevel@tonic-gate const FATTR4_TIME_BACKUP = 49; 5177c478bd9Sstevel@tonic-gate const FATTR4_TIME_CREATE = 50; 5187c478bd9Sstevel@tonic-gate const FATTR4_TIME_DELTA = 51; 5197c478bd9Sstevel@tonic-gate const FATTR4_TIME_METADATA = 52; 5207c478bd9Sstevel@tonic-gate const FATTR4_TIME_MODIFY = 53; 5217c478bd9Sstevel@tonic-gate const FATTR4_TIME_MODIFY_SET = 54; 5227c478bd9Sstevel@tonic-gate const FATTR4_MOUNTED_ON_FILEID = 55; 5237c478bd9Sstevel@tonic-gate 5247c478bd9Sstevel@tonic-gate /* 5257c478bd9Sstevel@tonic-gate * File attribute container 5267c478bd9Sstevel@tonic-gate */ 5277c478bd9Sstevel@tonic-gate struct fattr4 { 5287c478bd9Sstevel@tonic-gate bitmap4 attrmask; 5297c478bd9Sstevel@tonic-gate attrlist4 attr_vals; 5307c478bd9Sstevel@tonic-gate }; 5317c478bd9Sstevel@tonic-gate 532*bbe876c0SMarcel Telka 5337c478bd9Sstevel@tonic-gate /* 5347c478bd9Sstevel@tonic-gate * Change info for the client 5357c478bd9Sstevel@tonic-gate */ 5367c478bd9Sstevel@tonic-gate struct change_info4 { 5377c478bd9Sstevel@tonic-gate bool atomic; 5387c478bd9Sstevel@tonic-gate changeid4 before; 5397c478bd9Sstevel@tonic-gate changeid4 after; 5407c478bd9Sstevel@tonic-gate }; 5417c478bd9Sstevel@tonic-gate 542*bbe876c0SMarcel Telka 5437c478bd9Sstevel@tonic-gate struct clientaddr4 { 5447c478bd9Sstevel@tonic-gate /* see struct rpcb in RFC 1833 */ 5457c478bd9Sstevel@tonic-gate string r_netid<>; /* network id */ 5467c478bd9Sstevel@tonic-gate string r_addr<>; /* universal address */ 5477c478bd9Sstevel@tonic-gate }; 5487c478bd9Sstevel@tonic-gate 549*bbe876c0SMarcel Telka 5507c478bd9Sstevel@tonic-gate /* 5517c478bd9Sstevel@tonic-gate * Callback program info as provided by the client 5527c478bd9Sstevel@tonic-gate */ 5537c478bd9Sstevel@tonic-gate struct cb_client4 { 554*bbe876c0SMarcel Telka unsigned int cb_program; 5557c478bd9Sstevel@tonic-gate clientaddr4 cb_location; 5567c478bd9Sstevel@tonic-gate }; 5577c478bd9Sstevel@tonic-gate 558*bbe876c0SMarcel Telka 5597c478bd9Sstevel@tonic-gate /* 5607c478bd9Sstevel@tonic-gate * Stateid 5617c478bd9Sstevel@tonic-gate */ 5627c478bd9Sstevel@tonic-gate struct stateid4 { 5637c478bd9Sstevel@tonic-gate uint32_t seqid; 564*bbe876c0SMarcel Telka opaque other[NFS4_OTHER_SIZE]; 5657c478bd9Sstevel@tonic-gate }; 5667c478bd9Sstevel@tonic-gate 5677c478bd9Sstevel@tonic-gate /* 5687c478bd9Sstevel@tonic-gate * Client ID 5697c478bd9Sstevel@tonic-gate */ 5707c478bd9Sstevel@tonic-gate struct nfs_client_id4 { 5717c478bd9Sstevel@tonic-gate verifier4 verifier; 5727c478bd9Sstevel@tonic-gate opaque id<NFS4_OPAQUE_LIMIT>; 5737c478bd9Sstevel@tonic-gate }; 5747c478bd9Sstevel@tonic-gate 575*bbe876c0SMarcel Telka 5767c478bd9Sstevel@tonic-gate struct open_owner4 { 5777c478bd9Sstevel@tonic-gate clientid4 clientid; 5787c478bd9Sstevel@tonic-gate opaque owner<NFS4_OPAQUE_LIMIT>; 5797c478bd9Sstevel@tonic-gate }; 5807c478bd9Sstevel@tonic-gate 581*bbe876c0SMarcel Telka 5827c478bd9Sstevel@tonic-gate struct lock_owner4 { 5837c478bd9Sstevel@tonic-gate clientid4 clientid; 5847c478bd9Sstevel@tonic-gate opaque owner<NFS4_OPAQUE_LIMIT>; 5857c478bd9Sstevel@tonic-gate }; 5867c478bd9Sstevel@tonic-gate 587*bbe876c0SMarcel Telka 5887c478bd9Sstevel@tonic-gate enum nfs_lock_type4 { 5897c478bd9Sstevel@tonic-gate READ_LT = 1, 5907c478bd9Sstevel@tonic-gate WRITE_LT = 2, 5917c478bd9Sstevel@tonic-gate READW_LT = 3, /* blocking read */ 5927c478bd9Sstevel@tonic-gate WRITEW_LT = 4 /* blocking write */ 5937c478bd9Sstevel@tonic-gate }; 5947c478bd9Sstevel@tonic-gate 595*bbe876c0SMarcel Telka 5967c478bd9Sstevel@tonic-gate const ACCESS4_READ = 0x00000001; 5977c478bd9Sstevel@tonic-gate const ACCESS4_LOOKUP = 0x00000002; 5987c478bd9Sstevel@tonic-gate const ACCESS4_MODIFY = 0x00000004; 5997c478bd9Sstevel@tonic-gate const ACCESS4_EXTEND = 0x00000008; 6007c478bd9Sstevel@tonic-gate const ACCESS4_DELETE = 0x00000010; 6017c478bd9Sstevel@tonic-gate const ACCESS4_EXECUTE = 0x00000020; 6027c478bd9Sstevel@tonic-gate 6037c478bd9Sstevel@tonic-gate struct ACCESS4args { 6047c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 6057c478bd9Sstevel@tonic-gate uint32_t access; 6067c478bd9Sstevel@tonic-gate }; 6077c478bd9Sstevel@tonic-gate 6087c478bd9Sstevel@tonic-gate struct ACCESS4resok { 6097c478bd9Sstevel@tonic-gate uint32_t supported; 6107c478bd9Sstevel@tonic-gate uint32_t access; 6117c478bd9Sstevel@tonic-gate }; 6127c478bd9Sstevel@tonic-gate 6137c478bd9Sstevel@tonic-gate union ACCESS4res switch (nfsstat4 status) { 6147c478bd9Sstevel@tonic-gate case NFS4_OK: 6157c478bd9Sstevel@tonic-gate ACCESS4resok resok4; 6167c478bd9Sstevel@tonic-gate default: 6177c478bd9Sstevel@tonic-gate void; 6187c478bd9Sstevel@tonic-gate }; 6197c478bd9Sstevel@tonic-gate 6207c478bd9Sstevel@tonic-gate struct CLOSE4args { 6217c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 6227c478bd9Sstevel@tonic-gate seqid4 seqid; 6237c478bd9Sstevel@tonic-gate stateid4 open_stateid; 6247c478bd9Sstevel@tonic-gate }; 6257c478bd9Sstevel@tonic-gate 6267c478bd9Sstevel@tonic-gate union CLOSE4res switch (nfsstat4 status) { 6277c478bd9Sstevel@tonic-gate case NFS4_OK: 6287c478bd9Sstevel@tonic-gate stateid4 open_stateid; 6297c478bd9Sstevel@tonic-gate default: 6307c478bd9Sstevel@tonic-gate void; 6317c478bd9Sstevel@tonic-gate }; 6327c478bd9Sstevel@tonic-gate 6337c478bd9Sstevel@tonic-gate struct COMMIT4args { 6347c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 6357c478bd9Sstevel@tonic-gate offset4 offset; 6367c478bd9Sstevel@tonic-gate count4 count; 6377c478bd9Sstevel@tonic-gate }; 6387c478bd9Sstevel@tonic-gate 6397c478bd9Sstevel@tonic-gate struct COMMIT4resok { 6407c478bd9Sstevel@tonic-gate verifier4 writeverf; 6417c478bd9Sstevel@tonic-gate }; 6427c478bd9Sstevel@tonic-gate 6437c478bd9Sstevel@tonic-gate union COMMIT4res switch (nfsstat4 status) { 6447c478bd9Sstevel@tonic-gate case NFS4_OK: 6457c478bd9Sstevel@tonic-gate COMMIT4resok resok4; 6467c478bd9Sstevel@tonic-gate default: 6477c478bd9Sstevel@tonic-gate void; 6487c478bd9Sstevel@tonic-gate }; 6497c478bd9Sstevel@tonic-gate 6507c478bd9Sstevel@tonic-gate union createtype4 switch (nfs_ftype4 type) { 6517c478bd9Sstevel@tonic-gate case NF4LNK: 6527c478bd9Sstevel@tonic-gate linktext4 linkdata; 6537c478bd9Sstevel@tonic-gate case NF4BLK: 6547c478bd9Sstevel@tonic-gate case NF4CHR: 6557c478bd9Sstevel@tonic-gate specdata4 devdata; 6567c478bd9Sstevel@tonic-gate case NF4SOCK: 6577c478bd9Sstevel@tonic-gate case NF4FIFO: 6587c478bd9Sstevel@tonic-gate case NF4DIR: 6597c478bd9Sstevel@tonic-gate void; 6607c478bd9Sstevel@tonic-gate default: 6617c478bd9Sstevel@tonic-gate void; /* server should return NFS4ERR_BADTYPE */ 6627c478bd9Sstevel@tonic-gate }; 6637c478bd9Sstevel@tonic-gate 6647c478bd9Sstevel@tonic-gate struct CREATE4args { 6657c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory for creation */ 6667c478bd9Sstevel@tonic-gate createtype4 objtype; 6677c478bd9Sstevel@tonic-gate component4 objname; 6687c478bd9Sstevel@tonic-gate fattr4 createattrs; 6697c478bd9Sstevel@tonic-gate }; 6707c478bd9Sstevel@tonic-gate 6717c478bd9Sstevel@tonic-gate struct CREATE4resok { 6727c478bd9Sstevel@tonic-gate change_info4 cinfo; 6737c478bd9Sstevel@tonic-gate bitmap4 attrset; /* attributes set */ 6747c478bd9Sstevel@tonic-gate }; 6757c478bd9Sstevel@tonic-gate 6767c478bd9Sstevel@tonic-gate union CREATE4res switch (nfsstat4 status) { 6777c478bd9Sstevel@tonic-gate case NFS4_OK: 6787c478bd9Sstevel@tonic-gate CREATE4resok resok4; 6797c478bd9Sstevel@tonic-gate default: 6807c478bd9Sstevel@tonic-gate void; 6817c478bd9Sstevel@tonic-gate }; 6827c478bd9Sstevel@tonic-gate 6837c478bd9Sstevel@tonic-gate struct DELEGPURGE4args { 6847c478bd9Sstevel@tonic-gate clientid4 clientid; 6857c478bd9Sstevel@tonic-gate }; 6867c478bd9Sstevel@tonic-gate 6877c478bd9Sstevel@tonic-gate struct DELEGPURGE4res { 6887c478bd9Sstevel@tonic-gate nfsstat4 status; 6897c478bd9Sstevel@tonic-gate }; 6907c478bd9Sstevel@tonic-gate 6917c478bd9Sstevel@tonic-gate struct DELEGRETURN4args { 6927c478bd9Sstevel@tonic-gate /* CURRENT_FH: delegated file */ 6937c478bd9Sstevel@tonic-gate stateid4 deleg_stateid; 6947c478bd9Sstevel@tonic-gate }; 6957c478bd9Sstevel@tonic-gate 6967c478bd9Sstevel@tonic-gate struct DELEGRETURN4res { 6977c478bd9Sstevel@tonic-gate nfsstat4 status; 6987c478bd9Sstevel@tonic-gate }; 6997c478bd9Sstevel@tonic-gate 7007c478bd9Sstevel@tonic-gate struct GETATTR4args { 7017c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory or file */ 7027c478bd9Sstevel@tonic-gate bitmap4 attr_request; 7037c478bd9Sstevel@tonic-gate }; 7047c478bd9Sstevel@tonic-gate 7057c478bd9Sstevel@tonic-gate struct GETATTR4resok { 7067c478bd9Sstevel@tonic-gate fattr4 obj_attributes; 7077c478bd9Sstevel@tonic-gate }; 7087c478bd9Sstevel@tonic-gate 7097c478bd9Sstevel@tonic-gate union GETATTR4res switch (nfsstat4 status) { 7107c478bd9Sstevel@tonic-gate case NFS4_OK: 7117c478bd9Sstevel@tonic-gate GETATTR4resok resok4; 7127c478bd9Sstevel@tonic-gate default: 7137c478bd9Sstevel@tonic-gate void; 7147c478bd9Sstevel@tonic-gate }; 7157c478bd9Sstevel@tonic-gate 7167c478bd9Sstevel@tonic-gate struct GETFH4resok { 7177c478bd9Sstevel@tonic-gate nfs_fh4 object; 7187c478bd9Sstevel@tonic-gate }; 7197c478bd9Sstevel@tonic-gate 7207c478bd9Sstevel@tonic-gate union GETFH4res switch (nfsstat4 status) { 7217c478bd9Sstevel@tonic-gate case NFS4_OK: 7227c478bd9Sstevel@tonic-gate GETFH4resok resok4; 7237c478bd9Sstevel@tonic-gate default: 7247c478bd9Sstevel@tonic-gate void; 7257c478bd9Sstevel@tonic-gate }; 7267c478bd9Sstevel@tonic-gate 7277c478bd9Sstevel@tonic-gate struct LINK4args { 7287c478bd9Sstevel@tonic-gate /* SAVED_FH: source object */ 7297c478bd9Sstevel@tonic-gate /* CURRENT_FH: target directory */ 7307c478bd9Sstevel@tonic-gate component4 newname; 7317c478bd9Sstevel@tonic-gate }; 7327c478bd9Sstevel@tonic-gate 7337c478bd9Sstevel@tonic-gate struct LINK4resok { 7347c478bd9Sstevel@tonic-gate change_info4 cinfo; 7357c478bd9Sstevel@tonic-gate }; 7367c478bd9Sstevel@tonic-gate 7377c478bd9Sstevel@tonic-gate union LINK4res switch (nfsstat4 status) { 7387c478bd9Sstevel@tonic-gate case NFS4_OK: 7397c478bd9Sstevel@tonic-gate LINK4resok resok4; 7407c478bd9Sstevel@tonic-gate default: 7417c478bd9Sstevel@tonic-gate void; 7427c478bd9Sstevel@tonic-gate }; 7437c478bd9Sstevel@tonic-gate 7447c478bd9Sstevel@tonic-gate /* 7457c478bd9Sstevel@tonic-gate * For LOCK, transition from open_owner to new lock_owner 7467c478bd9Sstevel@tonic-gate */ 7477c478bd9Sstevel@tonic-gate struct open_to_lock_owner4 { 7487c478bd9Sstevel@tonic-gate seqid4 open_seqid; 7497c478bd9Sstevel@tonic-gate stateid4 open_stateid; 7507c478bd9Sstevel@tonic-gate seqid4 lock_seqid; 7517c478bd9Sstevel@tonic-gate lock_owner4 lock_owner; 7527c478bd9Sstevel@tonic-gate }; 7537c478bd9Sstevel@tonic-gate 7547c478bd9Sstevel@tonic-gate /* 7557c478bd9Sstevel@tonic-gate * For LOCK, existing lock_owner continues to request file locks 7567c478bd9Sstevel@tonic-gate */ 7577c478bd9Sstevel@tonic-gate struct exist_lock_owner4 { 7587c478bd9Sstevel@tonic-gate stateid4 lock_stateid; 7597c478bd9Sstevel@tonic-gate seqid4 lock_seqid; 7607c478bd9Sstevel@tonic-gate }; 7617c478bd9Sstevel@tonic-gate 7627c478bd9Sstevel@tonic-gate union locker4 switch (bool new_lock_owner) { 7637c478bd9Sstevel@tonic-gate case TRUE: 7647c478bd9Sstevel@tonic-gate open_to_lock_owner4 open_owner; 7657c478bd9Sstevel@tonic-gate case FALSE: 7667c478bd9Sstevel@tonic-gate exist_lock_owner4 lock_owner; 7677c478bd9Sstevel@tonic-gate }; 7687c478bd9Sstevel@tonic-gate 7697c478bd9Sstevel@tonic-gate /* 7707c478bd9Sstevel@tonic-gate * LOCK/LOCKT/LOCKU: Record lock management 7717c478bd9Sstevel@tonic-gate */ 7727c478bd9Sstevel@tonic-gate struct LOCK4args { 7737c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 7747c478bd9Sstevel@tonic-gate nfs_lock_type4 locktype; 7757c478bd9Sstevel@tonic-gate bool reclaim; 7767c478bd9Sstevel@tonic-gate offset4 offset; 7777c478bd9Sstevel@tonic-gate length4 length; 7787c478bd9Sstevel@tonic-gate locker4 locker; 7797c478bd9Sstevel@tonic-gate }; 7807c478bd9Sstevel@tonic-gate 7817c478bd9Sstevel@tonic-gate struct LOCK4denied { 7827c478bd9Sstevel@tonic-gate offset4 offset; 7837c478bd9Sstevel@tonic-gate length4 length; 7847c478bd9Sstevel@tonic-gate nfs_lock_type4 locktype; 7857c478bd9Sstevel@tonic-gate lock_owner4 owner; 7867c478bd9Sstevel@tonic-gate }; 7877c478bd9Sstevel@tonic-gate 7887c478bd9Sstevel@tonic-gate struct LOCK4resok { 7897c478bd9Sstevel@tonic-gate stateid4 lock_stateid; 7907c478bd9Sstevel@tonic-gate }; 7917c478bd9Sstevel@tonic-gate 7927c478bd9Sstevel@tonic-gate union LOCK4res switch (nfsstat4 status) { 7937c478bd9Sstevel@tonic-gate case NFS4_OK: 7947c478bd9Sstevel@tonic-gate LOCK4resok resok4; 7957c478bd9Sstevel@tonic-gate case NFS4ERR_DENIED: 7967c478bd9Sstevel@tonic-gate LOCK4denied denied; 7977c478bd9Sstevel@tonic-gate default: 7987c478bd9Sstevel@tonic-gate void; 7997c478bd9Sstevel@tonic-gate }; 8007c478bd9Sstevel@tonic-gate 8017c478bd9Sstevel@tonic-gate struct LOCKT4args { 8027c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 8037c478bd9Sstevel@tonic-gate nfs_lock_type4 locktype; 8047c478bd9Sstevel@tonic-gate offset4 offset; 8057c478bd9Sstevel@tonic-gate length4 length; 8067c478bd9Sstevel@tonic-gate lock_owner4 owner; 8077c478bd9Sstevel@tonic-gate }; 8087c478bd9Sstevel@tonic-gate 8097c478bd9Sstevel@tonic-gate union LOCKT4res switch (nfsstat4 status) { 8107c478bd9Sstevel@tonic-gate case NFS4ERR_DENIED: 8117c478bd9Sstevel@tonic-gate LOCK4denied denied; 8127c478bd9Sstevel@tonic-gate case NFS4_OK: 8137c478bd9Sstevel@tonic-gate void; 8147c478bd9Sstevel@tonic-gate default: 8157c478bd9Sstevel@tonic-gate void; 8167c478bd9Sstevel@tonic-gate }; 8177c478bd9Sstevel@tonic-gate 8187c478bd9Sstevel@tonic-gate struct LOCKU4args { 8197c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 8207c478bd9Sstevel@tonic-gate nfs_lock_type4 locktype; 8217c478bd9Sstevel@tonic-gate seqid4 seqid; 8227c478bd9Sstevel@tonic-gate stateid4 lock_stateid; 8237c478bd9Sstevel@tonic-gate offset4 offset; 8247c478bd9Sstevel@tonic-gate length4 length; 8257c478bd9Sstevel@tonic-gate }; 8267c478bd9Sstevel@tonic-gate 8277c478bd9Sstevel@tonic-gate union LOCKU4res switch (nfsstat4 status) { 8287c478bd9Sstevel@tonic-gate case NFS4_OK: 8297c478bd9Sstevel@tonic-gate stateid4 lock_stateid; 8307c478bd9Sstevel@tonic-gate default: 8317c478bd9Sstevel@tonic-gate void; 8327c478bd9Sstevel@tonic-gate }; 8337c478bd9Sstevel@tonic-gate 8347c478bd9Sstevel@tonic-gate struct LOOKUP4args { 8357c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 8367c478bd9Sstevel@tonic-gate component4 objname; 8377c478bd9Sstevel@tonic-gate }; 8387c478bd9Sstevel@tonic-gate 8397c478bd9Sstevel@tonic-gate struct LOOKUP4res { 8407c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 8417c478bd9Sstevel@tonic-gate nfsstat4 status; 8427c478bd9Sstevel@tonic-gate }; 8437c478bd9Sstevel@tonic-gate 8447c478bd9Sstevel@tonic-gate struct LOOKUPP4res { 8457c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 8467c478bd9Sstevel@tonic-gate nfsstat4 status; 8477c478bd9Sstevel@tonic-gate }; 8487c478bd9Sstevel@tonic-gate 8497c478bd9Sstevel@tonic-gate struct NVERIFY4args { 8507c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 8517c478bd9Sstevel@tonic-gate fattr4 obj_attributes; 8527c478bd9Sstevel@tonic-gate }; 8537c478bd9Sstevel@tonic-gate 8547c478bd9Sstevel@tonic-gate struct NVERIFY4res { 8557c478bd9Sstevel@tonic-gate nfsstat4 status; 8567c478bd9Sstevel@tonic-gate }; 8577c478bd9Sstevel@tonic-gate 858*bbe876c0SMarcel Telka const OPEN4_SHARE_ACCESS_READ = 0x00000001; 859*bbe876c0SMarcel Telka const OPEN4_SHARE_ACCESS_WRITE = 0x00000002; 860*bbe876c0SMarcel Telka const OPEN4_SHARE_ACCESS_BOTH = 0x00000003; 861*bbe876c0SMarcel Telka 862*bbe876c0SMarcel Telka const OPEN4_SHARE_DENY_NONE = 0x00000000; 863*bbe876c0SMarcel Telka const OPEN4_SHARE_DENY_READ = 0x00000001; 864*bbe876c0SMarcel Telka const OPEN4_SHARE_DENY_WRITE = 0x00000002; 865*bbe876c0SMarcel Telka const OPEN4_SHARE_DENY_BOTH = 0x00000003; 8667c478bd9Sstevel@tonic-gate /* 8677c478bd9Sstevel@tonic-gate * Various definitions for OPEN 8687c478bd9Sstevel@tonic-gate */ 8697c478bd9Sstevel@tonic-gate enum createmode4 { 8707c478bd9Sstevel@tonic-gate UNCHECKED4 = 0, 8717c478bd9Sstevel@tonic-gate GUARDED4 = 1, 8727c478bd9Sstevel@tonic-gate EXCLUSIVE4 = 2 8737c478bd9Sstevel@tonic-gate }; 8747c478bd9Sstevel@tonic-gate 8757c478bd9Sstevel@tonic-gate union createhow4 switch (createmode4 mode) { 8767c478bd9Sstevel@tonic-gate case UNCHECKED4: 8777c478bd9Sstevel@tonic-gate case GUARDED4: 8787c478bd9Sstevel@tonic-gate fattr4 createattrs; 8797c478bd9Sstevel@tonic-gate case EXCLUSIVE4: 8807c478bd9Sstevel@tonic-gate verifier4 createverf; 8817c478bd9Sstevel@tonic-gate }; 8827c478bd9Sstevel@tonic-gate 8837c478bd9Sstevel@tonic-gate enum opentype4 { 8847c478bd9Sstevel@tonic-gate OPEN4_NOCREATE = 0, 8857c478bd9Sstevel@tonic-gate OPEN4_CREATE = 1 8867c478bd9Sstevel@tonic-gate }; 8877c478bd9Sstevel@tonic-gate 8887c478bd9Sstevel@tonic-gate union openflag4 switch (opentype4 opentype) { 8897c478bd9Sstevel@tonic-gate case OPEN4_CREATE: 8907c478bd9Sstevel@tonic-gate createhow4 how; 8917c478bd9Sstevel@tonic-gate default: 8927c478bd9Sstevel@tonic-gate void; 8937c478bd9Sstevel@tonic-gate }; 8947c478bd9Sstevel@tonic-gate 8957c478bd9Sstevel@tonic-gate /* Next definitions used for OPEN delegation */ 8967c478bd9Sstevel@tonic-gate enum limit_by4 { 8977c478bd9Sstevel@tonic-gate NFS_LIMIT_SIZE = 1, 8987c478bd9Sstevel@tonic-gate NFS_LIMIT_BLOCKS = 2 8997c478bd9Sstevel@tonic-gate /* others as needed */ 9007c478bd9Sstevel@tonic-gate }; 9017c478bd9Sstevel@tonic-gate 9027c478bd9Sstevel@tonic-gate struct nfs_modified_limit4 { 9037c478bd9Sstevel@tonic-gate uint32_t num_blocks; 9047c478bd9Sstevel@tonic-gate uint32_t bytes_per_block; 9057c478bd9Sstevel@tonic-gate }; 9067c478bd9Sstevel@tonic-gate 9077c478bd9Sstevel@tonic-gate union nfs_space_limit4 switch (limit_by4 limitby) { 9087c478bd9Sstevel@tonic-gate /* limit specified as file size */ 9097c478bd9Sstevel@tonic-gate case NFS_LIMIT_SIZE: 9107c478bd9Sstevel@tonic-gate uint64_t filesize; 9117c478bd9Sstevel@tonic-gate /* limit specified by number of blocks */ 9127c478bd9Sstevel@tonic-gate case NFS_LIMIT_BLOCKS: 9137c478bd9Sstevel@tonic-gate nfs_modified_limit4 mod_blocks; 9147c478bd9Sstevel@tonic-gate } ; 9157c478bd9Sstevel@tonic-gate 9167c478bd9Sstevel@tonic-gate enum open_delegation_type4 { 9177c478bd9Sstevel@tonic-gate OPEN_DELEGATE_NONE = 0, 9187c478bd9Sstevel@tonic-gate OPEN_DELEGATE_READ = 1, 9197c478bd9Sstevel@tonic-gate OPEN_DELEGATE_WRITE = 2 9207c478bd9Sstevel@tonic-gate }; 9217c478bd9Sstevel@tonic-gate 9227c478bd9Sstevel@tonic-gate enum open_claim_type4 { 9237c478bd9Sstevel@tonic-gate CLAIM_NULL = 0, 9247c478bd9Sstevel@tonic-gate CLAIM_PREVIOUS = 1, 9257c478bd9Sstevel@tonic-gate CLAIM_DELEGATE_CUR = 2, 9267c478bd9Sstevel@tonic-gate CLAIM_DELEGATE_PREV = 3 9277c478bd9Sstevel@tonic-gate }; 9287c478bd9Sstevel@tonic-gate 9297c478bd9Sstevel@tonic-gate struct open_claim_delegate_cur4 { 9307c478bd9Sstevel@tonic-gate stateid4 delegate_stateid; 9317c478bd9Sstevel@tonic-gate component4 file; 9327c478bd9Sstevel@tonic-gate }; 9337c478bd9Sstevel@tonic-gate 9347c478bd9Sstevel@tonic-gate union open_claim4 switch (open_claim_type4 claim) { 9357c478bd9Sstevel@tonic-gate /* 936*bbe876c0SMarcel Telka * No special rights to file. 937*bbe876c0SMarcel Telka * Ordinary OPEN of the specified file. 9387c478bd9Sstevel@tonic-gate */ 9397c478bd9Sstevel@tonic-gate case CLAIM_NULL: 9407c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 9417c478bd9Sstevel@tonic-gate component4 file; 9427c478bd9Sstevel@tonic-gate /* 943*bbe876c0SMarcel Telka * Right to the file established by an 944*bbe876c0SMarcel Telka * open previous to server reboot. File 945*bbe876c0SMarcel Telka * identified by filehandle obtained at 946*bbe876c0SMarcel Telka * that time rather than by name. 9477c478bd9Sstevel@tonic-gate */ 9487c478bd9Sstevel@tonic-gate case CLAIM_PREVIOUS: 9497c478bd9Sstevel@tonic-gate /* CURRENT_FH: file being reclaimed */ 9507c478bd9Sstevel@tonic-gate open_delegation_type4 delegate_type; 9517c478bd9Sstevel@tonic-gate 9527c478bd9Sstevel@tonic-gate /* 953*bbe876c0SMarcel Telka * Right to file based on a delegation 954*bbe876c0SMarcel Telka * granted by the server. File is 955*bbe876c0SMarcel Telka * specified by name. 9567c478bd9Sstevel@tonic-gate */ 9577c478bd9Sstevel@tonic-gate case CLAIM_DELEGATE_CUR: 9587c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 9597c478bd9Sstevel@tonic-gate open_claim_delegate_cur4 delegate_cur_info; 9607c478bd9Sstevel@tonic-gate 961*bbe876c0SMarcel Telka /* 962*bbe876c0SMarcel Telka * Right to file based on a delegation 963*bbe876c0SMarcel Telka * granted to a previous boot instance 964*bbe876c0SMarcel Telka * of the client. File is specified by name. 9657c478bd9Sstevel@tonic-gate */ 9667c478bd9Sstevel@tonic-gate case CLAIM_DELEGATE_PREV: 9677c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 9687c478bd9Sstevel@tonic-gate component4 file_delegate_prev; 9697c478bd9Sstevel@tonic-gate }; 9707c478bd9Sstevel@tonic-gate 9717c478bd9Sstevel@tonic-gate /* 9727c478bd9Sstevel@tonic-gate * OPEN: Open a file, potentially receiving an open delegation 9737c478bd9Sstevel@tonic-gate */ 9747c478bd9Sstevel@tonic-gate struct OPEN4args { 9757c478bd9Sstevel@tonic-gate seqid4 seqid; 9767c478bd9Sstevel@tonic-gate uint32_t share_access; 9777c478bd9Sstevel@tonic-gate uint32_t share_deny; 9787c478bd9Sstevel@tonic-gate open_owner4 owner; 9797c478bd9Sstevel@tonic-gate openflag4 openhow; 9807c478bd9Sstevel@tonic-gate open_claim4 claim; 9817c478bd9Sstevel@tonic-gate }; 9827c478bd9Sstevel@tonic-gate 9837c478bd9Sstevel@tonic-gate struct open_read_delegation4 { 9847c478bd9Sstevel@tonic-gate stateid4 stateid; /* Stateid for delegation */ 9857c478bd9Sstevel@tonic-gate bool recall; /* Pre-recalled flag for 9867c478bd9Sstevel@tonic-gate delegations obtained 987*bbe876c0SMarcel Telka by reclaim (CLAIM_PREVIOUS). */ 988*bbe876c0SMarcel Telka 9897c478bd9Sstevel@tonic-gate nfsace4 permissions; /* Defines users who don't 9907c478bd9Sstevel@tonic-gate need an ACCESS call to 991*bbe876c0SMarcel Telka open for read. */ 9927c478bd9Sstevel@tonic-gate }; 9937c478bd9Sstevel@tonic-gate 9947c478bd9Sstevel@tonic-gate struct open_write_delegation4 { 9957c478bd9Sstevel@tonic-gate stateid4 stateid; /* Stateid for delegation */ 9967c478bd9Sstevel@tonic-gate bool recall; /* Pre-recalled flag for 9977c478bd9Sstevel@tonic-gate delegations obtained 9987c478bd9Sstevel@tonic-gate by reclaim 999*bbe876c0SMarcel Telka (CLAIM_PREVIOUS). */ 1000*bbe876c0SMarcel Telka 1001*bbe876c0SMarcel Telka nfs_space_limit4 1002*bbe876c0SMarcel Telka space_limit; /* Defines condition that 10037c478bd9Sstevel@tonic-gate the client must check to 10047c478bd9Sstevel@tonic-gate determine whether the 10057c478bd9Sstevel@tonic-gate file needs to be flushed 1006*bbe876c0SMarcel Telka to the server on close. */ 1007*bbe876c0SMarcel Telka 10087c478bd9Sstevel@tonic-gate nfsace4 permissions; /* Defines users who don't 10097c478bd9Sstevel@tonic-gate need an ACCESS call as 10107c478bd9Sstevel@tonic-gate part of a delegated 10117c478bd9Sstevel@tonic-gate open. */ 10127c478bd9Sstevel@tonic-gate }; 10137c478bd9Sstevel@tonic-gate 10147c478bd9Sstevel@tonic-gate union open_delegation4 10157c478bd9Sstevel@tonic-gate switch (open_delegation_type4 delegation_type) { 10167c478bd9Sstevel@tonic-gate case OPEN_DELEGATE_NONE: 10177c478bd9Sstevel@tonic-gate void; 10187c478bd9Sstevel@tonic-gate case OPEN_DELEGATE_READ: 10197c478bd9Sstevel@tonic-gate open_read_delegation4 read; 10207c478bd9Sstevel@tonic-gate case OPEN_DELEGATE_WRITE: 10217c478bd9Sstevel@tonic-gate open_write_delegation4 write; 10227c478bd9Sstevel@tonic-gate }; 10237c478bd9Sstevel@tonic-gate 10247c478bd9Sstevel@tonic-gate /* 10257c478bd9Sstevel@tonic-gate * Result flags 10267c478bd9Sstevel@tonic-gate */ 1027*bbe876c0SMarcel Telka 10287c478bd9Sstevel@tonic-gate /* Client must confirm open */ 10297c478bd9Sstevel@tonic-gate const OPEN4_RESULT_CONFIRM = 0x00000002; 10307c478bd9Sstevel@tonic-gate /* Type of file locking behavior at the server */ 10317c478bd9Sstevel@tonic-gate const OPEN4_RESULT_LOCKTYPE_POSIX = 0x00000004; 10327c478bd9Sstevel@tonic-gate 10337c478bd9Sstevel@tonic-gate struct OPEN4resok { 10347c478bd9Sstevel@tonic-gate stateid4 stateid; /* Stateid for open */ 1035*bbe876c0SMarcel Telka change_info4 cinfo; /* Directory change info */ 10367c478bd9Sstevel@tonic-gate uint32_t rflags; /* Result flags */ 10377c478bd9Sstevel@tonic-gate bitmap4 attrset; /* attribute set for create */ 10387c478bd9Sstevel@tonic-gate open_delegation4 delegation; /* Info on any open 10397c478bd9Sstevel@tonic-gate delegation */ 10407c478bd9Sstevel@tonic-gate }; 10417c478bd9Sstevel@tonic-gate 10427c478bd9Sstevel@tonic-gate union OPEN4res switch (nfsstat4 status) { 10437c478bd9Sstevel@tonic-gate case NFS4_OK: 10447c478bd9Sstevel@tonic-gate /* CURRENT_FH: opened file */ 10457c478bd9Sstevel@tonic-gate OPEN4resok resok4; 10467c478bd9Sstevel@tonic-gate default: 10477c478bd9Sstevel@tonic-gate void; 10487c478bd9Sstevel@tonic-gate }; 10497c478bd9Sstevel@tonic-gate 10507c478bd9Sstevel@tonic-gate struct OPENATTR4args { 10517c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 10527c478bd9Sstevel@tonic-gate bool createdir; 10537c478bd9Sstevel@tonic-gate }; 10547c478bd9Sstevel@tonic-gate 10557c478bd9Sstevel@tonic-gate struct OPENATTR4res { 10567c478bd9Sstevel@tonic-gate /* CURRENT_FH: named attr directory */ 10577c478bd9Sstevel@tonic-gate nfsstat4 status; 10587c478bd9Sstevel@tonic-gate }; 10597c478bd9Sstevel@tonic-gate 10607c478bd9Sstevel@tonic-gate struct OPEN_CONFIRM4args { 10617c478bd9Sstevel@tonic-gate /* CURRENT_FH: opened file */ 10627c478bd9Sstevel@tonic-gate stateid4 open_stateid; 10637c478bd9Sstevel@tonic-gate seqid4 seqid; 10647c478bd9Sstevel@tonic-gate }; 10657c478bd9Sstevel@tonic-gate 10667c478bd9Sstevel@tonic-gate struct OPEN_CONFIRM4resok { 10677c478bd9Sstevel@tonic-gate stateid4 open_stateid; 10687c478bd9Sstevel@tonic-gate }; 10697c478bd9Sstevel@tonic-gate 10707c478bd9Sstevel@tonic-gate union OPEN_CONFIRM4res switch (nfsstat4 status) { 10717c478bd9Sstevel@tonic-gate case NFS4_OK: 10727c478bd9Sstevel@tonic-gate OPEN_CONFIRM4resok resok4; 10737c478bd9Sstevel@tonic-gate default: 10747c478bd9Sstevel@tonic-gate void; 10757c478bd9Sstevel@tonic-gate }; 10767c478bd9Sstevel@tonic-gate 10777c478bd9Sstevel@tonic-gate struct OPEN_DOWNGRADE4args { 10787c478bd9Sstevel@tonic-gate /* CURRENT_FH: opened file */ 10797c478bd9Sstevel@tonic-gate stateid4 open_stateid; 10807c478bd9Sstevel@tonic-gate seqid4 seqid; 10817c478bd9Sstevel@tonic-gate uint32_t share_access; 10827c478bd9Sstevel@tonic-gate uint32_t share_deny; 10837c478bd9Sstevel@tonic-gate }; 10847c478bd9Sstevel@tonic-gate 10857c478bd9Sstevel@tonic-gate struct OPEN_DOWNGRADE4resok { 10867c478bd9Sstevel@tonic-gate stateid4 open_stateid; 10877c478bd9Sstevel@tonic-gate }; 10887c478bd9Sstevel@tonic-gate 10897c478bd9Sstevel@tonic-gate union OPEN_DOWNGRADE4res switch (nfsstat4 status) { 10907c478bd9Sstevel@tonic-gate case NFS4_OK: 10917c478bd9Sstevel@tonic-gate OPEN_DOWNGRADE4resok resok4; 10927c478bd9Sstevel@tonic-gate default: 10937c478bd9Sstevel@tonic-gate void; 10947c478bd9Sstevel@tonic-gate }; 10957c478bd9Sstevel@tonic-gate 10967c478bd9Sstevel@tonic-gate struct PUTFH4args { 10977c478bd9Sstevel@tonic-gate nfs_fh4 object; 10987c478bd9Sstevel@tonic-gate }; 10997c478bd9Sstevel@tonic-gate 11007c478bd9Sstevel@tonic-gate struct PUTFH4res { 11017c478bd9Sstevel@tonic-gate /* CURRENT_FH: */ 11027c478bd9Sstevel@tonic-gate nfsstat4 status; 11037c478bd9Sstevel@tonic-gate }; 11047c478bd9Sstevel@tonic-gate 11057c478bd9Sstevel@tonic-gate struct PUTPUBFH4res { 11067c478bd9Sstevel@tonic-gate /* CURRENT_FH: public fh */ 11077c478bd9Sstevel@tonic-gate nfsstat4 status; 11087c478bd9Sstevel@tonic-gate }; 11097c478bd9Sstevel@tonic-gate 11107c478bd9Sstevel@tonic-gate struct PUTROOTFH4res { 11117c478bd9Sstevel@tonic-gate /* CURRENT_FH: root fh */ 11127c478bd9Sstevel@tonic-gate nfsstat4 status; 11137c478bd9Sstevel@tonic-gate }; 11147c478bd9Sstevel@tonic-gate 11157c478bd9Sstevel@tonic-gate struct READ4args { 11167c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 11177c478bd9Sstevel@tonic-gate stateid4 stateid; 11187c478bd9Sstevel@tonic-gate offset4 offset; 11197c478bd9Sstevel@tonic-gate count4 count; 11207c478bd9Sstevel@tonic-gate }; 11217c478bd9Sstevel@tonic-gate 11227c478bd9Sstevel@tonic-gate struct READ4resok { 11237c478bd9Sstevel@tonic-gate bool eof; 11247c478bd9Sstevel@tonic-gate opaque data<>; 11257c478bd9Sstevel@tonic-gate }; 11267c478bd9Sstevel@tonic-gate 11277c478bd9Sstevel@tonic-gate union READ4res switch (nfsstat4 status) { 11287c478bd9Sstevel@tonic-gate case NFS4_OK: 11297c478bd9Sstevel@tonic-gate READ4resok resok4; 11307c478bd9Sstevel@tonic-gate default: 11317c478bd9Sstevel@tonic-gate void; 11327c478bd9Sstevel@tonic-gate }; 11337c478bd9Sstevel@tonic-gate 11347c478bd9Sstevel@tonic-gate struct READDIR4args { 11357c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 11367c478bd9Sstevel@tonic-gate nfs_cookie4 cookie; 11377c478bd9Sstevel@tonic-gate verifier4 cookieverf; 11387c478bd9Sstevel@tonic-gate count4 dircount; 11397c478bd9Sstevel@tonic-gate count4 maxcount; 11407c478bd9Sstevel@tonic-gate bitmap4 attr_request; 11417c478bd9Sstevel@tonic-gate }; 11427c478bd9Sstevel@tonic-gate 11437c478bd9Sstevel@tonic-gate struct entry4 { 11447c478bd9Sstevel@tonic-gate nfs_cookie4 cookie; 11457c478bd9Sstevel@tonic-gate component4 name; 11467c478bd9Sstevel@tonic-gate fattr4 attrs; 11477c478bd9Sstevel@tonic-gate entry4 *nextentry; 11487c478bd9Sstevel@tonic-gate }; 11497c478bd9Sstevel@tonic-gate 11507c478bd9Sstevel@tonic-gate struct dirlist4 { 11517c478bd9Sstevel@tonic-gate entry4 *entries; 11527c478bd9Sstevel@tonic-gate bool eof; 11537c478bd9Sstevel@tonic-gate }; 11547c478bd9Sstevel@tonic-gate 11557c478bd9Sstevel@tonic-gate struct READDIR4resok { 11567c478bd9Sstevel@tonic-gate verifier4 cookieverf; 11577c478bd9Sstevel@tonic-gate dirlist4 reply; 11587c478bd9Sstevel@tonic-gate }; 11597c478bd9Sstevel@tonic-gate 11607c478bd9Sstevel@tonic-gate 11617c478bd9Sstevel@tonic-gate union READDIR4res switch (nfsstat4 status) { 11627c478bd9Sstevel@tonic-gate case NFS4_OK: 11637c478bd9Sstevel@tonic-gate READDIR4resok resok4; 11647c478bd9Sstevel@tonic-gate default: 11657c478bd9Sstevel@tonic-gate void; 11667c478bd9Sstevel@tonic-gate }; 11677c478bd9Sstevel@tonic-gate 11687c478bd9Sstevel@tonic-gate 11697c478bd9Sstevel@tonic-gate struct READLINK4resok { 11707c478bd9Sstevel@tonic-gate linktext4 link; 11717c478bd9Sstevel@tonic-gate }; 11727c478bd9Sstevel@tonic-gate 11737c478bd9Sstevel@tonic-gate union READLINK4res switch (nfsstat4 status) { 11747c478bd9Sstevel@tonic-gate case NFS4_OK: 11757c478bd9Sstevel@tonic-gate READLINK4resok resok4; 11767c478bd9Sstevel@tonic-gate default: 11777c478bd9Sstevel@tonic-gate void; 11787c478bd9Sstevel@tonic-gate }; 11797c478bd9Sstevel@tonic-gate 11807c478bd9Sstevel@tonic-gate struct REMOVE4args { 11817c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 11827c478bd9Sstevel@tonic-gate component4 target; 11837c478bd9Sstevel@tonic-gate }; 11847c478bd9Sstevel@tonic-gate 11857c478bd9Sstevel@tonic-gate struct REMOVE4resok { 11867c478bd9Sstevel@tonic-gate change_info4 cinfo; 11877c478bd9Sstevel@tonic-gate }; 11887c478bd9Sstevel@tonic-gate 11897c478bd9Sstevel@tonic-gate union REMOVE4res switch (nfsstat4 status) { 11907c478bd9Sstevel@tonic-gate case NFS4_OK: 11917c478bd9Sstevel@tonic-gate REMOVE4resok resok4; 11927c478bd9Sstevel@tonic-gate default: 11937c478bd9Sstevel@tonic-gate void; 11947c478bd9Sstevel@tonic-gate }; 11957c478bd9Sstevel@tonic-gate 11967c478bd9Sstevel@tonic-gate struct RENAME4args { 11977c478bd9Sstevel@tonic-gate /* SAVED_FH: source directory */ 11987c478bd9Sstevel@tonic-gate component4 oldname; 11997c478bd9Sstevel@tonic-gate /* CURRENT_FH: target directory */ 12007c478bd9Sstevel@tonic-gate component4 newname; 12017c478bd9Sstevel@tonic-gate }; 12027c478bd9Sstevel@tonic-gate 12037c478bd9Sstevel@tonic-gate struct RENAME4resok { 12047c478bd9Sstevel@tonic-gate change_info4 source_cinfo; 12057c478bd9Sstevel@tonic-gate change_info4 target_cinfo; 12067c478bd9Sstevel@tonic-gate }; 12077c478bd9Sstevel@tonic-gate 12087c478bd9Sstevel@tonic-gate union RENAME4res switch (nfsstat4 status) { 12097c478bd9Sstevel@tonic-gate case NFS4_OK: 12107c478bd9Sstevel@tonic-gate RENAME4resok resok4; 12117c478bd9Sstevel@tonic-gate default: 12127c478bd9Sstevel@tonic-gate void; 12137c478bd9Sstevel@tonic-gate }; 12147c478bd9Sstevel@tonic-gate 12157c478bd9Sstevel@tonic-gate struct RENEW4args { 12167c478bd9Sstevel@tonic-gate clientid4 clientid; 12177c478bd9Sstevel@tonic-gate }; 12187c478bd9Sstevel@tonic-gate 12197c478bd9Sstevel@tonic-gate struct RENEW4res { 12207c478bd9Sstevel@tonic-gate nfsstat4 status; 12217c478bd9Sstevel@tonic-gate }; 12227c478bd9Sstevel@tonic-gate 12237c478bd9Sstevel@tonic-gate struct RESTOREFH4res { 12247c478bd9Sstevel@tonic-gate /* CURRENT_FH: value of saved fh */ 12257c478bd9Sstevel@tonic-gate nfsstat4 status; 12267c478bd9Sstevel@tonic-gate }; 12277c478bd9Sstevel@tonic-gate 12287c478bd9Sstevel@tonic-gate struct SAVEFH4res { 12297c478bd9Sstevel@tonic-gate /* SAVED_FH: value of current fh */ 12307c478bd9Sstevel@tonic-gate nfsstat4 status; 12317c478bd9Sstevel@tonic-gate }; 12327c478bd9Sstevel@tonic-gate 12337c478bd9Sstevel@tonic-gate struct SECINFO4args { 12347c478bd9Sstevel@tonic-gate /* CURRENT_FH: directory */ 12357c478bd9Sstevel@tonic-gate component4 name; 12367c478bd9Sstevel@tonic-gate }; 12377c478bd9Sstevel@tonic-gate 12387c478bd9Sstevel@tonic-gate /* 12397c478bd9Sstevel@tonic-gate * From RFC 2203 12407c478bd9Sstevel@tonic-gate */ 12417c478bd9Sstevel@tonic-gate enum rpc_gss_svc_t { 12427c478bd9Sstevel@tonic-gate RPC_GSS_SVC_NONE = 1, 12437c478bd9Sstevel@tonic-gate RPC_GSS_SVC_INTEGRITY = 2, 12447c478bd9Sstevel@tonic-gate RPC_GSS_SVC_PRIVACY = 3 12457c478bd9Sstevel@tonic-gate }; 12467c478bd9Sstevel@tonic-gate 12477c478bd9Sstevel@tonic-gate struct rpcsec_gss_info { 12487c478bd9Sstevel@tonic-gate sec_oid4 oid; 12497c478bd9Sstevel@tonic-gate qop4 qop; 12507c478bd9Sstevel@tonic-gate rpc_gss_svc_t service; 12517c478bd9Sstevel@tonic-gate }; 12527c478bd9Sstevel@tonic-gate 1253*bbe876c0SMarcel Telka /* RPCSEC_GSS has a value of '6'. See RFC 2203 */ 12547c478bd9Sstevel@tonic-gate union secinfo4 switch (uint32_t flavor) { 12557c478bd9Sstevel@tonic-gate case RPCSEC_GSS: 12567c478bd9Sstevel@tonic-gate rpcsec_gss_info flavor_info; 12577c478bd9Sstevel@tonic-gate default: 12587c478bd9Sstevel@tonic-gate void; 12597c478bd9Sstevel@tonic-gate }; 12607c478bd9Sstevel@tonic-gate 12617c478bd9Sstevel@tonic-gate typedef secinfo4 SECINFO4resok<>; 12627c478bd9Sstevel@tonic-gate 12637c478bd9Sstevel@tonic-gate union SECINFO4res switch (nfsstat4 status) { 12647c478bd9Sstevel@tonic-gate case NFS4_OK: 12657c478bd9Sstevel@tonic-gate SECINFO4resok resok4; 12667c478bd9Sstevel@tonic-gate default: 12677c478bd9Sstevel@tonic-gate void; 12687c478bd9Sstevel@tonic-gate }; 12697c478bd9Sstevel@tonic-gate 12707c478bd9Sstevel@tonic-gate struct SETATTR4args { 12717c478bd9Sstevel@tonic-gate /* CURRENT_FH: target object */ 12727c478bd9Sstevel@tonic-gate stateid4 stateid; 12737c478bd9Sstevel@tonic-gate fattr4 obj_attributes; 12747c478bd9Sstevel@tonic-gate }; 12757c478bd9Sstevel@tonic-gate 12767c478bd9Sstevel@tonic-gate struct SETATTR4res { 12777c478bd9Sstevel@tonic-gate nfsstat4 status; 12787c478bd9Sstevel@tonic-gate bitmap4 attrsset; 12797c478bd9Sstevel@tonic-gate }; 12807c478bd9Sstevel@tonic-gate 12817c478bd9Sstevel@tonic-gate struct SETCLIENTID4args { 12827c478bd9Sstevel@tonic-gate nfs_client_id4 client; 12837c478bd9Sstevel@tonic-gate cb_client4 callback; 12847c478bd9Sstevel@tonic-gate uint32_t callback_ident; 12857c478bd9Sstevel@tonic-gate }; 12867c478bd9Sstevel@tonic-gate 12877c478bd9Sstevel@tonic-gate struct SETCLIENTID4resok { 12887c478bd9Sstevel@tonic-gate clientid4 clientid; 12897c478bd9Sstevel@tonic-gate verifier4 setclientid_confirm; 12907c478bd9Sstevel@tonic-gate }; 12917c478bd9Sstevel@tonic-gate 12927c478bd9Sstevel@tonic-gate union SETCLIENTID4res switch (nfsstat4 status) { 12937c478bd9Sstevel@tonic-gate case NFS4_OK: 12947c478bd9Sstevel@tonic-gate SETCLIENTID4resok resok4; 12957c478bd9Sstevel@tonic-gate case NFS4ERR_CLID_INUSE: 12967c478bd9Sstevel@tonic-gate clientaddr4 client_using; 12977c478bd9Sstevel@tonic-gate default: 12987c478bd9Sstevel@tonic-gate void; 12997c478bd9Sstevel@tonic-gate }; 13007c478bd9Sstevel@tonic-gate 13017c478bd9Sstevel@tonic-gate struct SETCLIENTID_CONFIRM4args { 13027c478bd9Sstevel@tonic-gate clientid4 clientid; 13037c478bd9Sstevel@tonic-gate verifier4 setclientid_confirm; 13047c478bd9Sstevel@tonic-gate }; 13057c478bd9Sstevel@tonic-gate 13067c478bd9Sstevel@tonic-gate struct SETCLIENTID_CONFIRM4res { 13077c478bd9Sstevel@tonic-gate nfsstat4 status; 13087c478bd9Sstevel@tonic-gate }; 13097c478bd9Sstevel@tonic-gate 13107c478bd9Sstevel@tonic-gate struct VERIFY4args { 13117c478bd9Sstevel@tonic-gate /* CURRENT_FH: object */ 13127c478bd9Sstevel@tonic-gate fattr4 obj_attributes; 13137c478bd9Sstevel@tonic-gate }; 13147c478bd9Sstevel@tonic-gate 13157c478bd9Sstevel@tonic-gate struct VERIFY4res { 13167c478bd9Sstevel@tonic-gate nfsstat4 status; 13177c478bd9Sstevel@tonic-gate }; 13187c478bd9Sstevel@tonic-gate 13197c478bd9Sstevel@tonic-gate enum stable_how4 { 13207c478bd9Sstevel@tonic-gate UNSTABLE4 = 0, 13217c478bd9Sstevel@tonic-gate DATA_SYNC4 = 1, 13227c478bd9Sstevel@tonic-gate FILE_SYNC4 = 2 13237c478bd9Sstevel@tonic-gate }; 13247c478bd9Sstevel@tonic-gate 13257c478bd9Sstevel@tonic-gate struct WRITE4args { 13267c478bd9Sstevel@tonic-gate /* CURRENT_FH: file */ 13277c478bd9Sstevel@tonic-gate stateid4 stateid; 13287c478bd9Sstevel@tonic-gate offset4 offset; 13297c478bd9Sstevel@tonic-gate stable_how4 stable; 13307c478bd9Sstevel@tonic-gate opaque data<>; 13317c478bd9Sstevel@tonic-gate }; 13327c478bd9Sstevel@tonic-gate 13337c478bd9Sstevel@tonic-gate struct WRITE4resok { 13347c478bd9Sstevel@tonic-gate count4 count; 13357c478bd9Sstevel@tonic-gate stable_how4 committed; 13367c478bd9Sstevel@tonic-gate verifier4 writeverf; 13377c478bd9Sstevel@tonic-gate }; 13387c478bd9Sstevel@tonic-gate 13397c478bd9Sstevel@tonic-gate union WRITE4res switch (nfsstat4 status) { 13407c478bd9Sstevel@tonic-gate case NFS4_OK: 13417c478bd9Sstevel@tonic-gate WRITE4resok resok4; 13427c478bd9Sstevel@tonic-gate default: 13437c478bd9Sstevel@tonic-gate void; 13447c478bd9Sstevel@tonic-gate }; 13457c478bd9Sstevel@tonic-gate 13467c478bd9Sstevel@tonic-gate struct RELEASE_LOCKOWNER4args { 13477c478bd9Sstevel@tonic-gate lock_owner4 lock_owner; 13487c478bd9Sstevel@tonic-gate }; 13497c478bd9Sstevel@tonic-gate 13507c478bd9Sstevel@tonic-gate struct RELEASE_LOCKOWNER4res { 13517c478bd9Sstevel@tonic-gate nfsstat4 status; 13527c478bd9Sstevel@tonic-gate }; 13537c478bd9Sstevel@tonic-gate 13547c478bd9Sstevel@tonic-gate struct ILLEGAL4res { 13557c478bd9Sstevel@tonic-gate nfsstat4 status; 13567c478bd9Sstevel@tonic-gate }; 13577c478bd9Sstevel@tonic-gate 13587c478bd9Sstevel@tonic-gate /* 13597c478bd9Sstevel@tonic-gate * Operation arrays 13607c478bd9Sstevel@tonic-gate */ 13617c478bd9Sstevel@tonic-gate 13627c478bd9Sstevel@tonic-gate enum nfs_opnum4 { 13637c478bd9Sstevel@tonic-gate OP_ACCESS = 3, 13647c478bd9Sstevel@tonic-gate OP_CLOSE = 4, 13657c478bd9Sstevel@tonic-gate OP_COMMIT = 5, 13667c478bd9Sstevel@tonic-gate OP_CREATE = 6, 13677c478bd9Sstevel@tonic-gate OP_DELEGPURGE = 7, 13687c478bd9Sstevel@tonic-gate OP_DELEGRETURN = 8, 13697c478bd9Sstevel@tonic-gate OP_GETATTR = 9, 13707c478bd9Sstevel@tonic-gate OP_GETFH = 10, 13717c478bd9Sstevel@tonic-gate OP_LINK = 11, 13727c478bd9Sstevel@tonic-gate OP_LOCK = 12, 13737c478bd9Sstevel@tonic-gate OP_LOCKT = 13, 13747c478bd9Sstevel@tonic-gate OP_LOCKU = 14, 13757c478bd9Sstevel@tonic-gate OP_LOOKUP = 15, 13767c478bd9Sstevel@tonic-gate OP_LOOKUPP = 16, 13777c478bd9Sstevel@tonic-gate OP_NVERIFY = 17, 13787c478bd9Sstevel@tonic-gate OP_OPEN = 18, 13797c478bd9Sstevel@tonic-gate OP_OPENATTR = 19, 13807c478bd9Sstevel@tonic-gate OP_OPEN_CONFIRM = 20, 13817c478bd9Sstevel@tonic-gate OP_OPEN_DOWNGRADE = 21, 13827c478bd9Sstevel@tonic-gate OP_PUTFH = 22, 13837c478bd9Sstevel@tonic-gate OP_PUTPUBFH = 23, 13847c478bd9Sstevel@tonic-gate OP_PUTROOTFH = 24, 13857c478bd9Sstevel@tonic-gate OP_READ = 25, 13867c478bd9Sstevel@tonic-gate OP_READDIR = 26, 13877c478bd9Sstevel@tonic-gate OP_READLINK = 27, 13887c478bd9Sstevel@tonic-gate OP_REMOVE = 28, 13897c478bd9Sstevel@tonic-gate OP_RENAME = 29, 13907c478bd9Sstevel@tonic-gate OP_RENEW = 30, 13917c478bd9Sstevel@tonic-gate OP_RESTOREFH = 31, 13927c478bd9Sstevel@tonic-gate OP_SAVEFH = 32, 13937c478bd9Sstevel@tonic-gate OP_SECINFO = 33, 13947c478bd9Sstevel@tonic-gate OP_SETATTR = 34, 13957c478bd9Sstevel@tonic-gate OP_SETCLIENTID = 35, 13967c478bd9Sstevel@tonic-gate OP_SETCLIENTID_CONFIRM = 36, 13977c478bd9Sstevel@tonic-gate OP_VERIFY = 37, 13987c478bd9Sstevel@tonic-gate OP_WRITE = 38, 13997c478bd9Sstevel@tonic-gate OP_RELEASE_LOCKOWNER = 39, 14007c478bd9Sstevel@tonic-gate OP_ILLEGAL = 10044 14017c478bd9Sstevel@tonic-gate }; 14027c478bd9Sstevel@tonic-gate 14037c478bd9Sstevel@tonic-gate union nfs_argop4 switch (nfs_opnum4 argop) { 14047c478bd9Sstevel@tonic-gate case OP_ACCESS: ACCESS4args opaccess; 14057c478bd9Sstevel@tonic-gate case OP_CLOSE: CLOSE4args opclose; 14067c478bd9Sstevel@tonic-gate case OP_COMMIT: COMMIT4args opcommit; 14077c478bd9Sstevel@tonic-gate case OP_CREATE: CREATE4args opcreate; 14087c478bd9Sstevel@tonic-gate case OP_DELEGPURGE: DELEGPURGE4args opdelegpurge; 14097c478bd9Sstevel@tonic-gate case OP_DELEGRETURN: DELEGRETURN4args opdelegreturn; 14107c478bd9Sstevel@tonic-gate case OP_GETATTR: GETATTR4args opgetattr; 14117c478bd9Sstevel@tonic-gate case OP_GETFH: void; 14127c478bd9Sstevel@tonic-gate case OP_LINK: LINK4args oplink; 14137c478bd9Sstevel@tonic-gate case OP_LOCK: LOCK4args oplock; 14147c478bd9Sstevel@tonic-gate case OP_LOCKT: LOCKT4args oplockt; 14157c478bd9Sstevel@tonic-gate case OP_LOCKU: LOCKU4args oplocku; 14167c478bd9Sstevel@tonic-gate case OP_LOOKUP: LOOKUP4args oplookup; 14177c478bd9Sstevel@tonic-gate case OP_LOOKUPP: void; 14187c478bd9Sstevel@tonic-gate case OP_NVERIFY: NVERIFY4args opnverify; 14197c478bd9Sstevel@tonic-gate case OP_OPEN: OPEN4args opopen; 14207c478bd9Sstevel@tonic-gate case OP_OPENATTR: OPENATTR4args opopenattr; 14217c478bd9Sstevel@tonic-gate case OP_OPEN_CONFIRM: OPEN_CONFIRM4args opopen_confirm; 1422*bbe876c0SMarcel Telka case OP_OPEN_DOWNGRADE: 1423*bbe876c0SMarcel Telka OPEN_DOWNGRADE4args opopen_downgrade; 14247c478bd9Sstevel@tonic-gate case OP_PUTFH: PUTFH4args opputfh; 14257c478bd9Sstevel@tonic-gate case OP_PUTPUBFH: void; 14267c478bd9Sstevel@tonic-gate case OP_PUTROOTFH: void; 14277c478bd9Sstevel@tonic-gate case OP_READ: READ4args opread; 14287c478bd9Sstevel@tonic-gate case OP_READDIR: READDIR4args opreaddir; 14297c478bd9Sstevel@tonic-gate case OP_READLINK: void; 14307c478bd9Sstevel@tonic-gate case OP_REMOVE: REMOVE4args opremove; 14317c478bd9Sstevel@tonic-gate case OP_RENAME: RENAME4args oprename; 14327c478bd9Sstevel@tonic-gate case OP_RENEW: RENEW4args oprenew; 14337c478bd9Sstevel@tonic-gate case OP_RESTOREFH: void; 14347c478bd9Sstevel@tonic-gate case OP_SAVEFH: void; 14357c478bd9Sstevel@tonic-gate case OP_SECINFO: SECINFO4args opsecinfo; 14367c478bd9Sstevel@tonic-gate case OP_SETATTR: SETATTR4args opsetattr; 14377c478bd9Sstevel@tonic-gate case OP_SETCLIENTID: SETCLIENTID4args opsetclientid; 14387c478bd9Sstevel@tonic-gate case OP_SETCLIENTID_CONFIRM: SETCLIENTID_CONFIRM4args 14397c478bd9Sstevel@tonic-gate opsetclientid_confirm; 14407c478bd9Sstevel@tonic-gate case OP_VERIFY: VERIFY4args opverify; 14417c478bd9Sstevel@tonic-gate case OP_WRITE: WRITE4args opwrite; 1442*bbe876c0SMarcel Telka case OP_RELEASE_LOCKOWNER: 1443*bbe876c0SMarcel Telka RELEASE_LOCKOWNER4args 14447c478bd9Sstevel@tonic-gate oprelease_lockowner; 14457c478bd9Sstevel@tonic-gate case OP_ILLEGAL: void; 14467c478bd9Sstevel@tonic-gate }; 14477c478bd9Sstevel@tonic-gate 14487c478bd9Sstevel@tonic-gate union nfs_resop4 switch (nfs_opnum4 resop) { 14497c478bd9Sstevel@tonic-gate case OP_ACCESS: ACCESS4res opaccess; 14507c478bd9Sstevel@tonic-gate case OP_CLOSE: CLOSE4res opclose; 14517c478bd9Sstevel@tonic-gate case OP_COMMIT: COMMIT4res opcommit; 14527c478bd9Sstevel@tonic-gate case OP_CREATE: CREATE4res opcreate; 14537c478bd9Sstevel@tonic-gate case OP_DELEGPURGE: DELEGPURGE4res opdelegpurge; 14547c478bd9Sstevel@tonic-gate case OP_DELEGRETURN: DELEGRETURN4res opdelegreturn; 14557c478bd9Sstevel@tonic-gate case OP_GETATTR: GETATTR4res opgetattr; 14567c478bd9Sstevel@tonic-gate case OP_GETFH: GETFH4res opgetfh; 14577c478bd9Sstevel@tonic-gate case OP_LINK: LINK4res oplink; 14587c478bd9Sstevel@tonic-gate case OP_LOCK: LOCK4res oplock; 14597c478bd9Sstevel@tonic-gate case OP_LOCKT: LOCKT4res oplockt; 14607c478bd9Sstevel@tonic-gate case OP_LOCKU: LOCKU4res oplocku; 14617c478bd9Sstevel@tonic-gate case OP_LOOKUP: LOOKUP4res oplookup; 14627c478bd9Sstevel@tonic-gate case OP_LOOKUPP: LOOKUPP4res oplookupp; 14637c478bd9Sstevel@tonic-gate case OP_NVERIFY: NVERIFY4res opnverify; 14647c478bd9Sstevel@tonic-gate case OP_OPEN: OPEN4res opopen; 14657c478bd9Sstevel@tonic-gate case OP_OPENATTR: OPENATTR4res opopenattr; 14667c478bd9Sstevel@tonic-gate case OP_OPEN_CONFIRM: OPEN_CONFIRM4res opopen_confirm; 1467*bbe876c0SMarcel Telka case OP_OPEN_DOWNGRADE: 1468*bbe876c0SMarcel Telka OPEN_DOWNGRADE4res 1469*bbe876c0SMarcel Telka opopen_downgrade; 14707c478bd9Sstevel@tonic-gate case OP_PUTFH: PUTFH4res opputfh; 14717c478bd9Sstevel@tonic-gate case OP_PUTPUBFH: PUTPUBFH4res opputpubfh; 14727c478bd9Sstevel@tonic-gate case OP_PUTROOTFH: PUTROOTFH4res opputrootfh; 14737c478bd9Sstevel@tonic-gate case OP_READ: READ4res opread; 14747c478bd9Sstevel@tonic-gate case OP_READDIR: READDIR4res opreaddir; 14757c478bd9Sstevel@tonic-gate case OP_READLINK: READLINK4res opreadlink; 14767c478bd9Sstevel@tonic-gate case OP_REMOVE: REMOVE4res opremove; 14777c478bd9Sstevel@tonic-gate case OP_RENAME: RENAME4res oprename; 14787c478bd9Sstevel@tonic-gate case OP_RENEW: RENEW4res oprenew; 14797c478bd9Sstevel@tonic-gate case OP_RESTOREFH: RESTOREFH4res oprestorefh; 14807c478bd9Sstevel@tonic-gate case OP_SAVEFH: SAVEFH4res opsavefh; 14817c478bd9Sstevel@tonic-gate case OP_SECINFO: SECINFO4res opsecinfo; 14827c478bd9Sstevel@tonic-gate case OP_SETATTR: SETATTR4res opsetattr; 14837c478bd9Sstevel@tonic-gate case OP_SETCLIENTID: SETCLIENTID4res opsetclientid; 1484*bbe876c0SMarcel Telka case OP_SETCLIENTID_CONFIRM: 1485*bbe876c0SMarcel Telka SETCLIENTID_CONFIRM4res 14867c478bd9Sstevel@tonic-gate opsetclientid_confirm; 14877c478bd9Sstevel@tonic-gate case OP_VERIFY: VERIFY4res opverify; 14887c478bd9Sstevel@tonic-gate case OP_WRITE: WRITE4res opwrite; 1489*bbe876c0SMarcel Telka case OP_RELEASE_LOCKOWNER: 1490*bbe876c0SMarcel Telka RELEASE_LOCKOWNER4res 14917c478bd9Sstevel@tonic-gate oprelease_lockowner; 14927c478bd9Sstevel@tonic-gate case OP_ILLEGAL: ILLEGAL4res opillegal; 14937c478bd9Sstevel@tonic-gate }; 14947c478bd9Sstevel@tonic-gate 14957c478bd9Sstevel@tonic-gate struct COMPOUND4args { 14967c478bd9Sstevel@tonic-gate utf8str_cs tag; 14977c478bd9Sstevel@tonic-gate uint32_t minorversion; 14987c478bd9Sstevel@tonic-gate nfs_argop4 argarray<>; 14997c478bd9Sstevel@tonic-gate }; 15007c478bd9Sstevel@tonic-gate 15017c478bd9Sstevel@tonic-gate struct COMPOUND4res { 15027c478bd9Sstevel@tonic-gate nfsstat4 status; 15037c478bd9Sstevel@tonic-gate utf8str_cs tag; 15047c478bd9Sstevel@tonic-gate nfs_resop4 resarray<>; 15057c478bd9Sstevel@tonic-gate }; 15067c478bd9Sstevel@tonic-gate 1507*bbe876c0SMarcel Telka 15087c478bd9Sstevel@tonic-gate /* 15097c478bd9Sstevel@tonic-gate * Remote file service routines 15107c478bd9Sstevel@tonic-gate */ 15117c478bd9Sstevel@tonic-gate program NFS4_PROGRAM { 15127c478bd9Sstevel@tonic-gate version NFS_V4 { 15137c478bd9Sstevel@tonic-gate void 15147c478bd9Sstevel@tonic-gate NFSPROC4_NULL(void) = 0; 15157c478bd9Sstevel@tonic-gate 15167c478bd9Sstevel@tonic-gate COMPOUND4res 15177c478bd9Sstevel@tonic-gate NFSPROC4_COMPOUND(COMPOUND4args) = 1; 15187c478bd9Sstevel@tonic-gate 15197c478bd9Sstevel@tonic-gate } = 4; 15207c478bd9Sstevel@tonic-gate } = 100003; 15217c478bd9Sstevel@tonic-gate 15227c478bd9Sstevel@tonic-gate /* 1523*bbe876c0SMarcel Telka * NFS4 callback procedure definitions and program 15247c478bd9Sstevel@tonic-gate */ 15257c478bd9Sstevel@tonic-gate struct CB_GETATTR4args { 15267c478bd9Sstevel@tonic-gate nfs_fh4 fh; 15277c478bd9Sstevel@tonic-gate bitmap4 attr_request; 15287c478bd9Sstevel@tonic-gate }; 15297c478bd9Sstevel@tonic-gate 15307c478bd9Sstevel@tonic-gate struct CB_GETATTR4resok { 15317c478bd9Sstevel@tonic-gate fattr4 obj_attributes; 15327c478bd9Sstevel@tonic-gate }; 15337c478bd9Sstevel@tonic-gate 15347c478bd9Sstevel@tonic-gate union CB_GETATTR4res switch (nfsstat4 status) { 15357c478bd9Sstevel@tonic-gate case NFS4_OK: 15367c478bd9Sstevel@tonic-gate CB_GETATTR4resok resok4; 15377c478bd9Sstevel@tonic-gate default: 15387c478bd9Sstevel@tonic-gate void; 15397c478bd9Sstevel@tonic-gate }; 15407c478bd9Sstevel@tonic-gate 15417c478bd9Sstevel@tonic-gate struct CB_RECALL4args { 15427c478bd9Sstevel@tonic-gate stateid4 stateid; 15437c478bd9Sstevel@tonic-gate bool truncate; 15447c478bd9Sstevel@tonic-gate nfs_fh4 fh; 15457c478bd9Sstevel@tonic-gate }; 15467c478bd9Sstevel@tonic-gate 15477c478bd9Sstevel@tonic-gate struct CB_RECALL4res { 15487c478bd9Sstevel@tonic-gate nfsstat4 status; 15497c478bd9Sstevel@tonic-gate }; 15507c478bd9Sstevel@tonic-gate 15517c478bd9Sstevel@tonic-gate /* 15527c478bd9Sstevel@tonic-gate * CB_ILLEGAL: Response for illegal operation numbers 15537c478bd9Sstevel@tonic-gate */ 15547c478bd9Sstevel@tonic-gate struct CB_ILLEGAL4res { 15557c478bd9Sstevel@tonic-gate nfsstat4 status; 15567c478bd9Sstevel@tonic-gate }; 15577c478bd9Sstevel@tonic-gate 15587c478bd9Sstevel@tonic-gate /* 15597c478bd9Sstevel@tonic-gate * Various definitions for CB_COMPOUND 15607c478bd9Sstevel@tonic-gate */ 15617c478bd9Sstevel@tonic-gate enum nfs_cb_opnum4 { 15627c478bd9Sstevel@tonic-gate OP_CB_GETATTR = 3, 15637c478bd9Sstevel@tonic-gate OP_CB_RECALL = 4, 15647c478bd9Sstevel@tonic-gate OP_CB_ILLEGAL = 10044 15657c478bd9Sstevel@tonic-gate }; 15667c478bd9Sstevel@tonic-gate 15677c478bd9Sstevel@tonic-gate union nfs_cb_argop4 switch (unsigned argop) { 15687c478bd9Sstevel@tonic-gate case OP_CB_GETATTR: CB_GETATTR4args opcbgetattr; 15697c478bd9Sstevel@tonic-gate case OP_CB_RECALL: CB_RECALL4args opcbrecall; 15707c478bd9Sstevel@tonic-gate case OP_CB_ILLEGAL: void; 15717c478bd9Sstevel@tonic-gate }; 15727c478bd9Sstevel@tonic-gate 15737c478bd9Sstevel@tonic-gate union nfs_cb_resop4 switch (unsigned resop) { 15747c478bd9Sstevel@tonic-gate case OP_CB_GETATTR: CB_GETATTR4res opcbgetattr; 15757c478bd9Sstevel@tonic-gate case OP_CB_RECALL: CB_RECALL4res opcbrecall; 15767c478bd9Sstevel@tonic-gate case OP_CB_ILLEGAL: CB_ILLEGAL4res opcbillegal; 15777c478bd9Sstevel@tonic-gate }; 15787c478bd9Sstevel@tonic-gate 1579*bbe876c0SMarcel Telka 15807c478bd9Sstevel@tonic-gate struct CB_COMPOUND4args { 15817c478bd9Sstevel@tonic-gate utf8str_cs tag; 15827c478bd9Sstevel@tonic-gate uint32_t minorversion; 15837c478bd9Sstevel@tonic-gate uint32_t callback_ident; 15847c478bd9Sstevel@tonic-gate nfs_cb_argop4 argarray<>; 15857c478bd9Sstevel@tonic-gate }; 15867c478bd9Sstevel@tonic-gate 15877c478bd9Sstevel@tonic-gate struct CB_COMPOUND4res { 15887c478bd9Sstevel@tonic-gate nfsstat4 status; 15897c478bd9Sstevel@tonic-gate utf8str_cs tag; 15907c478bd9Sstevel@tonic-gate nfs_cb_resop4 resarray<>; 15917c478bd9Sstevel@tonic-gate }; 15927c478bd9Sstevel@tonic-gate 15937c478bd9Sstevel@tonic-gate 1594*bbe876c0SMarcel Telka 15957c478bd9Sstevel@tonic-gate /* 1596*bbe876c0SMarcel Telka * Program number is in the transient range, since the client 15977c478bd9Sstevel@tonic-gate * will assign the exact transient program number and provide 15987c478bd9Sstevel@tonic-gate * that to the server via the SETCLIENTID operation. 15997c478bd9Sstevel@tonic-gate */ 16007c478bd9Sstevel@tonic-gate program NFS4_CALLBACK { 16017c478bd9Sstevel@tonic-gate version NFS_CB { 16027c478bd9Sstevel@tonic-gate void 16037c478bd9Sstevel@tonic-gate CB_NULL(void) = 0; 16047c478bd9Sstevel@tonic-gate CB_COMPOUND4res 16057c478bd9Sstevel@tonic-gate CB_COMPOUND(CB_COMPOUND4args) = 1; 16067c478bd9Sstevel@tonic-gate } = 1; 16077c478bd9Sstevel@tonic-gate } = 0x40000000; 1608