1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate #ifdef RPC_HDR 28*7c478bd9Sstevel@tonic-gate %/* 29*7c478bd9Sstevel@tonic-gate % * Definitions for uint64, int64, uint32, and int32 30*7c478bd9Sstevel@tonic-gate % */ 31*7c478bd9Sstevel@tonic-gate %#include <rpc/rpc_sztypes.h> 32*7c478bd9Sstevel@tonic-gate % 33*7c478bd9Sstevel@tonic-gate #endif 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate const NFS_PORT = 2049; 36*7c478bd9Sstevel@tonic-gate const NFS_MAXDATA = 8192; 37*7c478bd9Sstevel@tonic-gate const NFS_MAXPATHLEN = 1024; 38*7c478bd9Sstevel@tonic-gate const NFS_MAXNAMLEN = 255; 39*7c478bd9Sstevel@tonic-gate const NFS_FHSIZE = 32; 40*7c478bd9Sstevel@tonic-gate const NFS_COOKIESIZE = 4; 41*7c478bd9Sstevel@tonic-gate const NFS_FIFO_DEV = -1; /* size kludge for named pipes */ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate /* 44*7c478bd9Sstevel@tonic-gate * File types 45*7c478bd9Sstevel@tonic-gate */ 46*7c478bd9Sstevel@tonic-gate const NFSMODE_FMT = 0170000; /* type of file */ 47*7c478bd9Sstevel@tonic-gate const NFSMODE_DIR = 0040000; /* directory */ 48*7c478bd9Sstevel@tonic-gate const NFSMODE_CHR = 0020000; /* character special */ 49*7c478bd9Sstevel@tonic-gate const NFSMODE_BLK = 0060000; /* block special */ 50*7c478bd9Sstevel@tonic-gate const NFSMODE_REG = 0100000; /* regular */ 51*7c478bd9Sstevel@tonic-gate const NFSMODE_LNK = 0120000; /* symbolic link */ 52*7c478bd9Sstevel@tonic-gate const NFSMODE_SOCK = 0140000; /* socket */ 53*7c478bd9Sstevel@tonic-gate const NFSMODE_FIFO = 0010000; /* fifo */ 54*7c478bd9Sstevel@tonic-gate 55*7c478bd9Sstevel@tonic-gate /* 56*7c478bd9Sstevel@tonic-gate * Error status 57*7c478bd9Sstevel@tonic-gate */ 58*7c478bd9Sstevel@tonic-gate enum nfsstat { 59*7c478bd9Sstevel@tonic-gate NFS_OK= 0, /* no error */ 60*7c478bd9Sstevel@tonic-gate NFSERR_PERM=1, /* Not owner */ 61*7c478bd9Sstevel@tonic-gate NFSERR_NOENT=2, /* No such file or directory */ 62*7c478bd9Sstevel@tonic-gate NFSERR_IO=5, /* I/O error */ 63*7c478bd9Sstevel@tonic-gate NFSERR_NXIO=6, /* No such device or address */ 64*7c478bd9Sstevel@tonic-gate NFSERR_ACCES=13, /* Permission denied */ 65*7c478bd9Sstevel@tonic-gate NFSERR_EXIST=17, /* File exists */ 66*7c478bd9Sstevel@tonic-gate NFSERR_XDEV=18, /* Cross-device link */ 67*7c478bd9Sstevel@tonic-gate NFSERR_NODEV=19, /* No such device */ 68*7c478bd9Sstevel@tonic-gate NFSERR_NOTDIR=20, /* Not a directory*/ 69*7c478bd9Sstevel@tonic-gate NFSERR_ISDIR=21, /* Is a directory */ 70*7c478bd9Sstevel@tonic-gate NFSERR_INVAL=22, /* Invalid argument */ 71*7c478bd9Sstevel@tonic-gate NFSERR_FBIG=27, /* File too large */ 72*7c478bd9Sstevel@tonic-gate NFSERR_NOSPC=28, /* No space left on device */ 73*7c478bd9Sstevel@tonic-gate NFSERR_ROFS=30, /* Read-only file system */ 74*7c478bd9Sstevel@tonic-gate NFSERR_OPNOTSUPP=45, /* Operation not supported */ 75*7c478bd9Sstevel@tonic-gate NFSERR_NAMETOOLONG=63, /* File name too long */ 76*7c478bd9Sstevel@tonic-gate NFSERR_NOTEMPTY=66, /* Directory not empty */ 77*7c478bd9Sstevel@tonic-gate NFSERR_DQUOT=69, /* Disc quota exceeded */ 78*7c478bd9Sstevel@tonic-gate NFSERR_STALE=70, /* Stale NFS file handle */ 79*7c478bd9Sstevel@tonic-gate NFSERR_REMOTE=71, /* Object is remote */ 80*7c478bd9Sstevel@tonic-gate NFSERR_WFLUSH=72 /* write cache flushed */ 81*7c478bd9Sstevel@tonic-gate }; 82*7c478bd9Sstevel@tonic-gate 83*7c478bd9Sstevel@tonic-gate /* 84*7c478bd9Sstevel@tonic-gate * File types 85*7c478bd9Sstevel@tonic-gate */ 86*7c478bd9Sstevel@tonic-gate enum ftype { 87*7c478bd9Sstevel@tonic-gate NFNON = 0, /* non-file */ 88*7c478bd9Sstevel@tonic-gate NFREG = 1, /* regular file */ 89*7c478bd9Sstevel@tonic-gate NFDIR = 2, /* directory */ 90*7c478bd9Sstevel@tonic-gate NFBLK = 3, /* block special */ 91*7c478bd9Sstevel@tonic-gate NFCHR = 4, /* character special */ 92*7c478bd9Sstevel@tonic-gate NFLNK = 5, /* symbolic link */ 93*7c478bd9Sstevel@tonic-gate NFSOCK = 6, /* unix domain sockets */ 94*7c478bd9Sstevel@tonic-gate NFBAD = 7, /* unused */ 95*7c478bd9Sstevel@tonic-gate NFFIFO = 8 /* named pipe */ 96*7c478bd9Sstevel@tonic-gate }; 97*7c478bd9Sstevel@tonic-gate 98*7c478bd9Sstevel@tonic-gate /* 99*7c478bd9Sstevel@tonic-gate * File access handle 100*7c478bd9Sstevel@tonic-gate */ 101*7c478bd9Sstevel@tonic-gate struct nfs_fh { 102*7c478bd9Sstevel@tonic-gate opaque data[NFS_FHSIZE]; 103*7c478bd9Sstevel@tonic-gate }; 104*7c478bd9Sstevel@tonic-gate 105*7c478bd9Sstevel@tonic-gate /* 106*7c478bd9Sstevel@tonic-gate * Timeval 107*7c478bd9Sstevel@tonic-gate */ 108*7c478bd9Sstevel@tonic-gate struct nfstime { 109*7c478bd9Sstevel@tonic-gate unsigned seconds; 110*7c478bd9Sstevel@tonic-gate unsigned useconds; 111*7c478bd9Sstevel@tonic-gate }; 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gate 114*7c478bd9Sstevel@tonic-gate /* 115*7c478bd9Sstevel@tonic-gate * File attributes 116*7c478bd9Sstevel@tonic-gate */ 117*7c478bd9Sstevel@tonic-gate struct fattr { 118*7c478bd9Sstevel@tonic-gate ftype type; /* file type */ 119*7c478bd9Sstevel@tonic-gate unsigned mode; /* protection mode bits */ 120*7c478bd9Sstevel@tonic-gate unsigned nlink; /* # hard links */ 121*7c478bd9Sstevel@tonic-gate unsigned uid; /* owner user id */ 122*7c478bd9Sstevel@tonic-gate unsigned gid; /* owner group id */ 123*7c478bd9Sstevel@tonic-gate unsigned size; /* file size in bytes */ 124*7c478bd9Sstevel@tonic-gate unsigned blocksize; /* prefered block size */ 125*7c478bd9Sstevel@tonic-gate unsigned rdev; /* special device # */ 126*7c478bd9Sstevel@tonic-gate unsigned blocks; /* Kb of disk used by file */ 127*7c478bd9Sstevel@tonic-gate unsigned fsid; /* device # */ 128*7c478bd9Sstevel@tonic-gate unsigned fileid; /* inode # */ 129*7c478bd9Sstevel@tonic-gate nfstime atime; /* time of last access */ 130*7c478bd9Sstevel@tonic-gate nfstime mtime; /* time of last modification */ 131*7c478bd9Sstevel@tonic-gate nfstime ctime; /* time of last change */ 132*7c478bd9Sstevel@tonic-gate }; 133*7c478bd9Sstevel@tonic-gate 134*7c478bd9Sstevel@tonic-gate /* 135*7c478bd9Sstevel@tonic-gate * File attributes which can be set 136*7c478bd9Sstevel@tonic-gate */ 137*7c478bd9Sstevel@tonic-gate struct sattr { 138*7c478bd9Sstevel@tonic-gate unsigned mode; /* protection mode bits */ 139*7c478bd9Sstevel@tonic-gate unsigned uid; /* owner user id */ 140*7c478bd9Sstevel@tonic-gate unsigned gid; /* owner group id */ 141*7c478bd9Sstevel@tonic-gate unsigned size; /* file size in bytes */ 142*7c478bd9Sstevel@tonic-gate nfstime atime; /* time of last access */ 143*7c478bd9Sstevel@tonic-gate nfstime mtime; /* time of last modification */ 144*7c478bd9Sstevel@tonic-gate }; 145*7c478bd9Sstevel@tonic-gate 146*7c478bd9Sstevel@tonic-gate 147*7c478bd9Sstevel@tonic-gate typedef string filename<NFS_MAXNAMLEN>; 148*7c478bd9Sstevel@tonic-gate typedef string nfspath<NFS_MAXPATHLEN>; 149*7c478bd9Sstevel@tonic-gate 150*7c478bd9Sstevel@tonic-gate /* 151*7c478bd9Sstevel@tonic-gate * Reply status with file attributes 152*7c478bd9Sstevel@tonic-gate */ 153*7c478bd9Sstevel@tonic-gate union attrstat switch (nfsstat status) { 154*7c478bd9Sstevel@tonic-gate case NFS_OK: 155*7c478bd9Sstevel@tonic-gate fattr attributes; 156*7c478bd9Sstevel@tonic-gate default: 157*7c478bd9Sstevel@tonic-gate void; 158*7c478bd9Sstevel@tonic-gate }; 159*7c478bd9Sstevel@tonic-gate 160*7c478bd9Sstevel@tonic-gate struct sattrargs { 161*7c478bd9Sstevel@tonic-gate nfs_fh file; 162*7c478bd9Sstevel@tonic-gate sattr attributes; 163*7c478bd9Sstevel@tonic-gate }; 164*7c478bd9Sstevel@tonic-gate 165*7c478bd9Sstevel@tonic-gate /* 166*7c478bd9Sstevel@tonic-gate * Arguments for directory operations 167*7c478bd9Sstevel@tonic-gate */ 168*7c478bd9Sstevel@tonic-gate struct diropargs { 169*7c478bd9Sstevel@tonic-gate nfs_fh dir; /* directory file handle */ 170*7c478bd9Sstevel@tonic-gate filename name; /* name (up to NFS_MAXNAMLEN bytes) */ 171*7c478bd9Sstevel@tonic-gate }; 172*7c478bd9Sstevel@tonic-gate 173*7c478bd9Sstevel@tonic-gate struct diropokres { 174*7c478bd9Sstevel@tonic-gate nfs_fh file; 175*7c478bd9Sstevel@tonic-gate fattr attributes; 176*7c478bd9Sstevel@tonic-gate }; 177*7c478bd9Sstevel@tonic-gate 178*7c478bd9Sstevel@tonic-gate /* 179*7c478bd9Sstevel@tonic-gate * Results from directory operation 180*7c478bd9Sstevel@tonic-gate */ 181*7c478bd9Sstevel@tonic-gate union diropres switch (nfsstat status) { 182*7c478bd9Sstevel@tonic-gate case NFS_OK: 183*7c478bd9Sstevel@tonic-gate diropokres diropres; 184*7c478bd9Sstevel@tonic-gate default: 185*7c478bd9Sstevel@tonic-gate void; 186*7c478bd9Sstevel@tonic-gate }; 187*7c478bd9Sstevel@tonic-gate 188*7c478bd9Sstevel@tonic-gate union readlinkres switch (nfsstat status) { 189*7c478bd9Sstevel@tonic-gate case NFS_OK: 190*7c478bd9Sstevel@tonic-gate nfspath data; 191*7c478bd9Sstevel@tonic-gate default: 192*7c478bd9Sstevel@tonic-gate void; 193*7c478bd9Sstevel@tonic-gate }; 194*7c478bd9Sstevel@tonic-gate 195*7c478bd9Sstevel@tonic-gate /* 196*7c478bd9Sstevel@tonic-gate * Arguments to remote read 197*7c478bd9Sstevel@tonic-gate */ 198*7c478bd9Sstevel@tonic-gate struct readargs { 199*7c478bd9Sstevel@tonic-gate nfs_fh file; /* handle for file */ 200*7c478bd9Sstevel@tonic-gate unsigned offset; /* byte offset in file */ 201*7c478bd9Sstevel@tonic-gate unsigned count; /* immediate read count */ 202*7c478bd9Sstevel@tonic-gate unsigned totalcount; /* total read count (from this offset)*/ 203*7c478bd9Sstevel@tonic-gate }; 204*7c478bd9Sstevel@tonic-gate 205*7c478bd9Sstevel@tonic-gate /* 206*7c478bd9Sstevel@tonic-gate * Status OK portion of remote read reply 207*7c478bd9Sstevel@tonic-gate */ 208*7c478bd9Sstevel@tonic-gate struct readokres { 209*7c478bd9Sstevel@tonic-gate fattr attributes; /* attributes, need for pagin*/ 210*7c478bd9Sstevel@tonic-gate opaque data<NFS_MAXDATA>; 211*7c478bd9Sstevel@tonic-gate }; 212*7c478bd9Sstevel@tonic-gate 213*7c478bd9Sstevel@tonic-gate union readres switch (nfsstat status) { 214*7c478bd9Sstevel@tonic-gate case NFS_OK: 215*7c478bd9Sstevel@tonic-gate readokres reply; 216*7c478bd9Sstevel@tonic-gate default: 217*7c478bd9Sstevel@tonic-gate void; 218*7c478bd9Sstevel@tonic-gate }; 219*7c478bd9Sstevel@tonic-gate 220*7c478bd9Sstevel@tonic-gate /* 221*7c478bd9Sstevel@tonic-gate * Arguments to remote write 222*7c478bd9Sstevel@tonic-gate */ 223*7c478bd9Sstevel@tonic-gate struct writeargs { 224*7c478bd9Sstevel@tonic-gate nfs_fh file; /* handle for file */ 225*7c478bd9Sstevel@tonic-gate unsigned beginoffset; /* beginning byte offset in file */ 226*7c478bd9Sstevel@tonic-gate unsigned offset; /* current byte offset in file */ 227*7c478bd9Sstevel@tonic-gate unsigned totalcount; /* total write count (to this offset)*/ 228*7c478bd9Sstevel@tonic-gate opaque data<NFS_MAXDATA>; 229*7c478bd9Sstevel@tonic-gate }; 230*7c478bd9Sstevel@tonic-gate 231*7c478bd9Sstevel@tonic-gate struct createargs { 232*7c478bd9Sstevel@tonic-gate diropargs where; 233*7c478bd9Sstevel@tonic-gate sattr attributes; 234*7c478bd9Sstevel@tonic-gate }; 235*7c478bd9Sstevel@tonic-gate 236*7c478bd9Sstevel@tonic-gate struct renameargs { 237*7c478bd9Sstevel@tonic-gate diropargs from; 238*7c478bd9Sstevel@tonic-gate diropargs to; 239*7c478bd9Sstevel@tonic-gate }; 240*7c478bd9Sstevel@tonic-gate 241*7c478bd9Sstevel@tonic-gate struct linkargs { 242*7c478bd9Sstevel@tonic-gate nfs_fh from; 243*7c478bd9Sstevel@tonic-gate diropargs to; 244*7c478bd9Sstevel@tonic-gate }; 245*7c478bd9Sstevel@tonic-gate 246*7c478bd9Sstevel@tonic-gate struct symlinkargs { 247*7c478bd9Sstevel@tonic-gate diropargs from; 248*7c478bd9Sstevel@tonic-gate nfspath to; 249*7c478bd9Sstevel@tonic-gate sattr attributes; 250*7c478bd9Sstevel@tonic-gate }; 251*7c478bd9Sstevel@tonic-gate 252*7c478bd9Sstevel@tonic-gate 253*7c478bd9Sstevel@tonic-gate typedef opaque nfscookie[NFS_COOKIESIZE]; 254*7c478bd9Sstevel@tonic-gate 255*7c478bd9Sstevel@tonic-gate /* 256*7c478bd9Sstevel@tonic-gate * Arguments to readdir 257*7c478bd9Sstevel@tonic-gate */ 258*7c478bd9Sstevel@tonic-gate struct readdirargs { 259*7c478bd9Sstevel@tonic-gate nfs_fh dir; /* directory handle */ 260*7c478bd9Sstevel@tonic-gate nfscookie cookie; 261*7c478bd9Sstevel@tonic-gate unsigned count; /* number of directory bytes to read */ 262*7c478bd9Sstevel@tonic-gate }; 263*7c478bd9Sstevel@tonic-gate 264*7c478bd9Sstevel@tonic-gate struct entry { 265*7c478bd9Sstevel@tonic-gate unsigned fileid; 266*7c478bd9Sstevel@tonic-gate filename name; 267*7c478bd9Sstevel@tonic-gate nfscookie cookie; 268*7c478bd9Sstevel@tonic-gate entry *nextentry; 269*7c478bd9Sstevel@tonic-gate }; 270*7c478bd9Sstevel@tonic-gate 271*7c478bd9Sstevel@tonic-gate struct dirlist { 272*7c478bd9Sstevel@tonic-gate entry *entries; 273*7c478bd9Sstevel@tonic-gate bool eof; 274*7c478bd9Sstevel@tonic-gate }; 275*7c478bd9Sstevel@tonic-gate 276*7c478bd9Sstevel@tonic-gate union readdirres switch (nfsstat status) { 277*7c478bd9Sstevel@tonic-gate case NFS_OK: 278*7c478bd9Sstevel@tonic-gate dirlist reply; 279*7c478bd9Sstevel@tonic-gate default: 280*7c478bd9Sstevel@tonic-gate void; 281*7c478bd9Sstevel@tonic-gate }; 282*7c478bd9Sstevel@tonic-gate 283*7c478bd9Sstevel@tonic-gate struct statfsokres { 284*7c478bd9Sstevel@tonic-gate unsigned tsize; /* preferred transfer size in bytes */ 285*7c478bd9Sstevel@tonic-gate unsigned bsize; /* fundamental file system block size */ 286*7c478bd9Sstevel@tonic-gate unsigned blocks; /* total blocks in file system */ 287*7c478bd9Sstevel@tonic-gate unsigned bfree; /* free blocks in fs */ 288*7c478bd9Sstevel@tonic-gate unsigned bavail; /* free blocks avail to non-superuser */ 289*7c478bd9Sstevel@tonic-gate }; 290*7c478bd9Sstevel@tonic-gate 291*7c478bd9Sstevel@tonic-gate union statfsres switch (nfsstat status) { 292*7c478bd9Sstevel@tonic-gate case NFS_OK: 293*7c478bd9Sstevel@tonic-gate statfsokres reply; 294*7c478bd9Sstevel@tonic-gate default: 295*7c478bd9Sstevel@tonic-gate void; 296*7c478bd9Sstevel@tonic-gate }; 297*7c478bd9Sstevel@tonic-gate 298*7c478bd9Sstevel@tonic-gate /* 299*7c478bd9Sstevel@tonic-gate * Remote file service routines 300*7c478bd9Sstevel@tonic-gate */ 301*7c478bd9Sstevel@tonic-gate program NFS_PROGRAM { 302*7c478bd9Sstevel@tonic-gate version NFS_VERSION { 303*7c478bd9Sstevel@tonic-gate void 304*7c478bd9Sstevel@tonic-gate NFSPROC_NULL(void) = 0; 305*7c478bd9Sstevel@tonic-gate 306*7c478bd9Sstevel@tonic-gate attrstat 307*7c478bd9Sstevel@tonic-gate NFSPROC_GETATTR(nfs_fh) = 1; 308*7c478bd9Sstevel@tonic-gate 309*7c478bd9Sstevel@tonic-gate attrstat 310*7c478bd9Sstevel@tonic-gate NFSPROC_SETATTR(sattrargs) = 2; 311*7c478bd9Sstevel@tonic-gate 312*7c478bd9Sstevel@tonic-gate void 313*7c478bd9Sstevel@tonic-gate NFSPROC_ROOT(void) = 3; 314*7c478bd9Sstevel@tonic-gate 315*7c478bd9Sstevel@tonic-gate diropres 316*7c478bd9Sstevel@tonic-gate NFSPROC_LOOKUP(diropargs) = 4; 317*7c478bd9Sstevel@tonic-gate 318*7c478bd9Sstevel@tonic-gate readlinkres 319*7c478bd9Sstevel@tonic-gate NFSPROC_READLINK(nfs_fh) = 5; 320*7c478bd9Sstevel@tonic-gate 321*7c478bd9Sstevel@tonic-gate readres 322*7c478bd9Sstevel@tonic-gate NFSPROC_READ(readargs) = 6; 323*7c478bd9Sstevel@tonic-gate 324*7c478bd9Sstevel@tonic-gate void 325*7c478bd9Sstevel@tonic-gate NFSPROC_WRITECACHE(void) = 7; 326*7c478bd9Sstevel@tonic-gate 327*7c478bd9Sstevel@tonic-gate attrstat 328*7c478bd9Sstevel@tonic-gate NFSPROC_WRITE(writeargs) = 8; 329*7c478bd9Sstevel@tonic-gate 330*7c478bd9Sstevel@tonic-gate diropres 331*7c478bd9Sstevel@tonic-gate NFSPROC_CREATE(createargs) = 9; 332*7c478bd9Sstevel@tonic-gate 333*7c478bd9Sstevel@tonic-gate nfsstat 334*7c478bd9Sstevel@tonic-gate NFSPROC_REMOVE(diropargs) = 10; 335*7c478bd9Sstevel@tonic-gate 336*7c478bd9Sstevel@tonic-gate nfsstat 337*7c478bd9Sstevel@tonic-gate NFSPROC_RENAME(renameargs) = 11; 338*7c478bd9Sstevel@tonic-gate 339*7c478bd9Sstevel@tonic-gate nfsstat 340*7c478bd9Sstevel@tonic-gate NFSPROC_LINK(linkargs) = 12; 341*7c478bd9Sstevel@tonic-gate 342*7c478bd9Sstevel@tonic-gate nfsstat 343*7c478bd9Sstevel@tonic-gate NFSPROC_SYMLINK(symlinkargs) = 13; 344*7c478bd9Sstevel@tonic-gate 345*7c478bd9Sstevel@tonic-gate diropres 346*7c478bd9Sstevel@tonic-gate NFSPROC_MKDIR(createargs) = 14; 347*7c478bd9Sstevel@tonic-gate 348*7c478bd9Sstevel@tonic-gate nfsstat 349*7c478bd9Sstevel@tonic-gate NFSPROC_RMDIR(diropargs) = 15; 350*7c478bd9Sstevel@tonic-gate 351*7c478bd9Sstevel@tonic-gate readdirres 352*7c478bd9Sstevel@tonic-gate NFSPROC_READDIR(readdirargs) = 16; 353*7c478bd9Sstevel@tonic-gate 354*7c478bd9Sstevel@tonic-gate statfsres 355*7c478bd9Sstevel@tonic-gate NFSPROC_STATFS(nfs_fh) = 17; 356*7c478bd9Sstevel@tonic-gate } = 2; 357*7c478bd9Sstevel@tonic-gate } = 100003; 358*7c478bd9Sstevel@tonic-gate 359*7c478bd9Sstevel@tonic-gate /* 360*7c478bd9Sstevel@tonic-gate * Version 3 declarations and definitions. 361*7c478bd9Sstevel@tonic-gate */ 362*7c478bd9Sstevel@tonic-gate 363*7c478bd9Sstevel@tonic-gate /* 364*7c478bd9Sstevel@tonic-gate * Sizes 365*7c478bd9Sstevel@tonic-gate */ 366*7c478bd9Sstevel@tonic-gate const NFS3_FHSIZE = 64; 367*7c478bd9Sstevel@tonic-gate const NFS3_COOKIEVERFSIZE = 8; 368*7c478bd9Sstevel@tonic-gate const NFS3_CREATEVERFSIZE = 8; 369*7c478bd9Sstevel@tonic-gate const NFS3_WRITEVERFSIZE = 8; 370*7c478bd9Sstevel@tonic-gate 371*7c478bd9Sstevel@tonic-gate /* 372*7c478bd9Sstevel@tonic-gate * Basic data types 373*7c478bd9Sstevel@tonic-gate */ 374*7c478bd9Sstevel@tonic-gate typedef string filename3<>; 375*7c478bd9Sstevel@tonic-gate typedef string nfspath3<>; 376*7c478bd9Sstevel@tonic-gate typedef uint64 fileid3; 377*7c478bd9Sstevel@tonic-gate typedef uint64 cookie3; 378*7c478bd9Sstevel@tonic-gate typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE]; 379*7c478bd9Sstevel@tonic-gate typedef opaque createverf3[NFS3_CREATEVERFSIZE]; 380*7c478bd9Sstevel@tonic-gate typedef opaque writeverf3[NFS3_WRITEVERFSIZE]; 381*7c478bd9Sstevel@tonic-gate typedef uint32 uid3; 382*7c478bd9Sstevel@tonic-gate typedef uint32 gid3; 383*7c478bd9Sstevel@tonic-gate typedef uint64 size3; 384*7c478bd9Sstevel@tonic-gate typedef uint64 offset3; 385*7c478bd9Sstevel@tonic-gate typedef uint32 mode3; 386*7c478bd9Sstevel@tonic-gate typedef uint32 count3; 387*7c478bd9Sstevel@tonic-gate 388*7c478bd9Sstevel@tonic-gate /* 389*7c478bd9Sstevel@tonic-gate * Error status 390*7c478bd9Sstevel@tonic-gate */ 391*7c478bd9Sstevel@tonic-gate enum nfsstat3 { 392*7c478bd9Sstevel@tonic-gate NFS3_OK = 0, 393*7c478bd9Sstevel@tonic-gate NFS3ERR_PERM = 1, 394*7c478bd9Sstevel@tonic-gate NFS3ERR_NOENT = 2, 395*7c478bd9Sstevel@tonic-gate NFS3ERR_IO = 5, 396*7c478bd9Sstevel@tonic-gate NFS3ERR_NXIO = 6, 397*7c478bd9Sstevel@tonic-gate NFS3ERR_ACCES = 13, 398*7c478bd9Sstevel@tonic-gate NFS3ERR_EXIST = 17, 399*7c478bd9Sstevel@tonic-gate NFS3ERR_XDEV = 18, 400*7c478bd9Sstevel@tonic-gate NFS3ERR_NODEV = 19, 401*7c478bd9Sstevel@tonic-gate NFS3ERR_NOTDIR = 20, 402*7c478bd9Sstevel@tonic-gate NFS3ERR_ISDIR = 21, 403*7c478bd9Sstevel@tonic-gate NFS3ERR_INVAL = 22, 404*7c478bd9Sstevel@tonic-gate NFS3ERR_FBIG = 27, 405*7c478bd9Sstevel@tonic-gate NFS3ERR_NOSPC = 28, 406*7c478bd9Sstevel@tonic-gate NFS3ERR_ROFS = 30, 407*7c478bd9Sstevel@tonic-gate NFS3ERR_MLINK = 31, 408*7c478bd9Sstevel@tonic-gate NFS3ERR_NAMETOOLONG = 63, 409*7c478bd9Sstevel@tonic-gate NFS3ERR_NOTEMPTY = 66, 410*7c478bd9Sstevel@tonic-gate NFS3ERR_DQUOT = 69, 411*7c478bd9Sstevel@tonic-gate NFS3ERR_STALE = 70, 412*7c478bd9Sstevel@tonic-gate NFS3ERR_REMOTE = 71, 413*7c478bd9Sstevel@tonic-gate NFS3ERR_BADHANDLE = 10001, 414*7c478bd9Sstevel@tonic-gate NFS3ERR_NOT_SYNC = 10002, 415*7c478bd9Sstevel@tonic-gate NFS3ERR_BAD_COOKIE = 10003, 416*7c478bd9Sstevel@tonic-gate NFS3ERR_NOTSUPP = 10004, 417*7c478bd9Sstevel@tonic-gate NFS3ERR_TOOSMALL = 10005, 418*7c478bd9Sstevel@tonic-gate NFS3ERR_SERVERFAULT = 10006, 419*7c478bd9Sstevel@tonic-gate NFS3ERR_BADTYPE = 10007, 420*7c478bd9Sstevel@tonic-gate NFS3ERR_JUKEBOX = 10008 421*7c478bd9Sstevel@tonic-gate }; 422*7c478bd9Sstevel@tonic-gate 423*7c478bd9Sstevel@tonic-gate /* 424*7c478bd9Sstevel@tonic-gate * File types 425*7c478bd9Sstevel@tonic-gate */ 426*7c478bd9Sstevel@tonic-gate enum ftype3 { 427*7c478bd9Sstevel@tonic-gate NF3REG = 1, 428*7c478bd9Sstevel@tonic-gate NF3DIR = 2, 429*7c478bd9Sstevel@tonic-gate NF3BLK = 3, 430*7c478bd9Sstevel@tonic-gate NF3CHR = 4, 431*7c478bd9Sstevel@tonic-gate NF3LNK = 5, 432*7c478bd9Sstevel@tonic-gate NF3SOCK = 6, 433*7c478bd9Sstevel@tonic-gate NF3FIFO = 7 434*7c478bd9Sstevel@tonic-gate }; 435*7c478bd9Sstevel@tonic-gate 436*7c478bd9Sstevel@tonic-gate struct specdata3 { 437*7c478bd9Sstevel@tonic-gate uint32 specdata1; 438*7c478bd9Sstevel@tonic-gate uint32 specdata2; 439*7c478bd9Sstevel@tonic-gate }; 440*7c478bd9Sstevel@tonic-gate 441*7c478bd9Sstevel@tonic-gate /* 442*7c478bd9Sstevel@tonic-gate * File access handle 443*7c478bd9Sstevel@tonic-gate */ 444*7c478bd9Sstevel@tonic-gate struct nfs_fh3 { 445*7c478bd9Sstevel@tonic-gate opaque data<NFS3_FHSIZE>; 446*7c478bd9Sstevel@tonic-gate }; 447*7c478bd9Sstevel@tonic-gate 448*7c478bd9Sstevel@tonic-gate /* 449*7c478bd9Sstevel@tonic-gate * Timeval 450*7c478bd9Sstevel@tonic-gate */ 451*7c478bd9Sstevel@tonic-gate struct nfstime3 { 452*7c478bd9Sstevel@tonic-gate uint32 seconds; 453*7c478bd9Sstevel@tonic-gate uint32 nseconds; 454*7c478bd9Sstevel@tonic-gate }; 455*7c478bd9Sstevel@tonic-gate 456*7c478bd9Sstevel@tonic-gate /* 457*7c478bd9Sstevel@tonic-gate * File attributes 458*7c478bd9Sstevel@tonic-gate */ 459*7c478bd9Sstevel@tonic-gate struct fattr3 { 460*7c478bd9Sstevel@tonic-gate ftype3 type; 461*7c478bd9Sstevel@tonic-gate mode3 mode; 462*7c478bd9Sstevel@tonic-gate uint32 nlink; 463*7c478bd9Sstevel@tonic-gate uid3 uid; 464*7c478bd9Sstevel@tonic-gate gid3 gid; 465*7c478bd9Sstevel@tonic-gate size3 size; 466*7c478bd9Sstevel@tonic-gate size3 used; 467*7c478bd9Sstevel@tonic-gate specdata3 rdev; 468*7c478bd9Sstevel@tonic-gate uint64 fsid; 469*7c478bd9Sstevel@tonic-gate fileid3 fileid; 470*7c478bd9Sstevel@tonic-gate nfstime3 atime; 471*7c478bd9Sstevel@tonic-gate nfstime3 mtime; 472*7c478bd9Sstevel@tonic-gate nfstime3 ctime; 473*7c478bd9Sstevel@tonic-gate }; 474*7c478bd9Sstevel@tonic-gate 475*7c478bd9Sstevel@tonic-gate /* 476*7c478bd9Sstevel@tonic-gate * File attributes 477*7c478bd9Sstevel@tonic-gate */ 478*7c478bd9Sstevel@tonic-gate union post_op_attr switch (bool attributes_follow) { 479*7c478bd9Sstevel@tonic-gate case TRUE: 480*7c478bd9Sstevel@tonic-gate fattr3 attributes; 481*7c478bd9Sstevel@tonic-gate case FALSE: 482*7c478bd9Sstevel@tonic-gate void; 483*7c478bd9Sstevel@tonic-gate }; 484*7c478bd9Sstevel@tonic-gate 485*7c478bd9Sstevel@tonic-gate struct wcc_attr { 486*7c478bd9Sstevel@tonic-gate size3 size; 487*7c478bd9Sstevel@tonic-gate nfstime3 mtime; 488*7c478bd9Sstevel@tonic-gate nfstime3 ctime; 489*7c478bd9Sstevel@tonic-gate }; 490*7c478bd9Sstevel@tonic-gate 491*7c478bd9Sstevel@tonic-gate union pre_op_attr switch (bool attributes_follow) { 492*7c478bd9Sstevel@tonic-gate case TRUE: 493*7c478bd9Sstevel@tonic-gate wcc_attr attributes; 494*7c478bd9Sstevel@tonic-gate case FALSE: 495*7c478bd9Sstevel@tonic-gate void; 496*7c478bd9Sstevel@tonic-gate }; 497*7c478bd9Sstevel@tonic-gate 498*7c478bd9Sstevel@tonic-gate struct wcc_data { 499*7c478bd9Sstevel@tonic-gate pre_op_attr before; 500*7c478bd9Sstevel@tonic-gate post_op_attr after; 501*7c478bd9Sstevel@tonic-gate }; 502*7c478bd9Sstevel@tonic-gate 503*7c478bd9Sstevel@tonic-gate union post_op_fh3 switch (bool handle_follows) { 504*7c478bd9Sstevel@tonic-gate case TRUE: 505*7c478bd9Sstevel@tonic-gate nfs_fh3 handle; 506*7c478bd9Sstevel@tonic-gate case FALSE: 507*7c478bd9Sstevel@tonic-gate void; 508*7c478bd9Sstevel@tonic-gate }; 509*7c478bd9Sstevel@tonic-gate 510*7c478bd9Sstevel@tonic-gate enum time_how { 511*7c478bd9Sstevel@tonic-gate DONT_CHANGE = 0, 512*7c478bd9Sstevel@tonic-gate SET_TO_SERVER_TIME = 1, 513*7c478bd9Sstevel@tonic-gate SET_TO_CLIENT_TIME = 2 514*7c478bd9Sstevel@tonic-gate }; 515*7c478bd9Sstevel@tonic-gate 516*7c478bd9Sstevel@tonic-gate union set_mode3 switch (bool set_it) { 517*7c478bd9Sstevel@tonic-gate case TRUE: 518*7c478bd9Sstevel@tonic-gate mode3 mode; 519*7c478bd9Sstevel@tonic-gate default: 520*7c478bd9Sstevel@tonic-gate void; 521*7c478bd9Sstevel@tonic-gate }; 522*7c478bd9Sstevel@tonic-gate 523*7c478bd9Sstevel@tonic-gate union set_uid3 switch (bool set_it) { 524*7c478bd9Sstevel@tonic-gate case TRUE: 525*7c478bd9Sstevel@tonic-gate uid3 uid; 526*7c478bd9Sstevel@tonic-gate default: 527*7c478bd9Sstevel@tonic-gate void; 528*7c478bd9Sstevel@tonic-gate }; 529*7c478bd9Sstevel@tonic-gate 530*7c478bd9Sstevel@tonic-gate union set_gid3 switch (bool set_it) { 531*7c478bd9Sstevel@tonic-gate case TRUE: 532*7c478bd9Sstevel@tonic-gate gid3 gid; 533*7c478bd9Sstevel@tonic-gate default: 534*7c478bd9Sstevel@tonic-gate void; 535*7c478bd9Sstevel@tonic-gate }; 536*7c478bd9Sstevel@tonic-gate 537*7c478bd9Sstevel@tonic-gate union set_size3 switch (bool set_it) { 538*7c478bd9Sstevel@tonic-gate case TRUE: 539*7c478bd9Sstevel@tonic-gate size3 size; 540*7c478bd9Sstevel@tonic-gate default: 541*7c478bd9Sstevel@tonic-gate void; 542*7c478bd9Sstevel@tonic-gate }; 543*7c478bd9Sstevel@tonic-gate 544*7c478bd9Sstevel@tonic-gate union set_atime switch (time_how set_it) { 545*7c478bd9Sstevel@tonic-gate case SET_TO_CLIENT_TIME: 546*7c478bd9Sstevel@tonic-gate nfstime3 atime; 547*7c478bd9Sstevel@tonic-gate default: 548*7c478bd9Sstevel@tonic-gate void; 549*7c478bd9Sstevel@tonic-gate }; 550*7c478bd9Sstevel@tonic-gate 551*7c478bd9Sstevel@tonic-gate union set_mtime switch (time_how set_it) { 552*7c478bd9Sstevel@tonic-gate case SET_TO_CLIENT_TIME: 553*7c478bd9Sstevel@tonic-gate nfstime3 mtime; 554*7c478bd9Sstevel@tonic-gate default: 555*7c478bd9Sstevel@tonic-gate void; 556*7c478bd9Sstevel@tonic-gate }; 557*7c478bd9Sstevel@tonic-gate 558*7c478bd9Sstevel@tonic-gate struct sattr3 { 559*7c478bd9Sstevel@tonic-gate set_mode3 mode; 560*7c478bd9Sstevel@tonic-gate set_uid3 uid; 561*7c478bd9Sstevel@tonic-gate set_gid3 gid; 562*7c478bd9Sstevel@tonic-gate set_size3 size; 563*7c478bd9Sstevel@tonic-gate set_atime atime; 564*7c478bd9Sstevel@tonic-gate set_mtime mtime; 565*7c478bd9Sstevel@tonic-gate }; 566*7c478bd9Sstevel@tonic-gate 567*7c478bd9Sstevel@tonic-gate struct diropargs3 { 568*7c478bd9Sstevel@tonic-gate nfs_fh3 dir; 569*7c478bd9Sstevel@tonic-gate filename3 name; 570*7c478bd9Sstevel@tonic-gate }; 571*7c478bd9Sstevel@tonic-gate 572*7c478bd9Sstevel@tonic-gate /* 573*7c478bd9Sstevel@tonic-gate * GETATTR: Get file attributes 574*7c478bd9Sstevel@tonic-gate */ 575*7c478bd9Sstevel@tonic-gate struct GETATTR3args { 576*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 577*7c478bd9Sstevel@tonic-gate }; 578*7c478bd9Sstevel@tonic-gate 579*7c478bd9Sstevel@tonic-gate struct GETATTR3resok { 580*7c478bd9Sstevel@tonic-gate fattr3 obj_attributes; 581*7c478bd9Sstevel@tonic-gate }; 582*7c478bd9Sstevel@tonic-gate 583*7c478bd9Sstevel@tonic-gate union GETATTR3res switch (nfsstat3 status) { 584*7c478bd9Sstevel@tonic-gate case NFS3_OK: 585*7c478bd9Sstevel@tonic-gate GETATTR3resok resok; 586*7c478bd9Sstevel@tonic-gate default: 587*7c478bd9Sstevel@tonic-gate void; 588*7c478bd9Sstevel@tonic-gate }; 589*7c478bd9Sstevel@tonic-gate 590*7c478bd9Sstevel@tonic-gate /* 591*7c478bd9Sstevel@tonic-gate * SETATTR: Set file attributes 592*7c478bd9Sstevel@tonic-gate */ 593*7c478bd9Sstevel@tonic-gate union sattrguard3 switch (bool check) { 594*7c478bd9Sstevel@tonic-gate case TRUE: 595*7c478bd9Sstevel@tonic-gate nfstime3 obj_ctime; 596*7c478bd9Sstevel@tonic-gate case FALSE: 597*7c478bd9Sstevel@tonic-gate void; 598*7c478bd9Sstevel@tonic-gate }; 599*7c478bd9Sstevel@tonic-gate 600*7c478bd9Sstevel@tonic-gate struct SETATTR3args { 601*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 602*7c478bd9Sstevel@tonic-gate sattr3 new_attributes; 603*7c478bd9Sstevel@tonic-gate sattrguard3 guard; 604*7c478bd9Sstevel@tonic-gate }; 605*7c478bd9Sstevel@tonic-gate 606*7c478bd9Sstevel@tonic-gate struct SETATTR3resok { 607*7c478bd9Sstevel@tonic-gate wcc_data obj_wcc; 608*7c478bd9Sstevel@tonic-gate }; 609*7c478bd9Sstevel@tonic-gate 610*7c478bd9Sstevel@tonic-gate struct SETATTR3resfail { 611*7c478bd9Sstevel@tonic-gate wcc_data obj_wcc; 612*7c478bd9Sstevel@tonic-gate }; 613*7c478bd9Sstevel@tonic-gate 614*7c478bd9Sstevel@tonic-gate union SETATTR3res switch (nfsstat3 status) { 615*7c478bd9Sstevel@tonic-gate case NFS3_OK: 616*7c478bd9Sstevel@tonic-gate SETATTR3resok resok; 617*7c478bd9Sstevel@tonic-gate default: 618*7c478bd9Sstevel@tonic-gate SETATTR3resfail resfail; 619*7c478bd9Sstevel@tonic-gate }; 620*7c478bd9Sstevel@tonic-gate 621*7c478bd9Sstevel@tonic-gate /* 622*7c478bd9Sstevel@tonic-gate * LOOKUP: Lookup filename 623*7c478bd9Sstevel@tonic-gate */ 624*7c478bd9Sstevel@tonic-gate struct LOOKUP3args { 625*7c478bd9Sstevel@tonic-gate diropargs3 what; 626*7c478bd9Sstevel@tonic-gate }; 627*7c478bd9Sstevel@tonic-gate 628*7c478bd9Sstevel@tonic-gate struct LOOKUP3resok { 629*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 630*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 631*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 632*7c478bd9Sstevel@tonic-gate }; 633*7c478bd9Sstevel@tonic-gate 634*7c478bd9Sstevel@tonic-gate struct LOOKUP3resfail { 635*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 636*7c478bd9Sstevel@tonic-gate }; 637*7c478bd9Sstevel@tonic-gate 638*7c478bd9Sstevel@tonic-gate union LOOKUP3res switch (nfsstat3 status) { 639*7c478bd9Sstevel@tonic-gate case NFS3_OK: 640*7c478bd9Sstevel@tonic-gate LOOKUP3resok resok; 641*7c478bd9Sstevel@tonic-gate default: 642*7c478bd9Sstevel@tonic-gate LOOKUP3resfail resfail; 643*7c478bd9Sstevel@tonic-gate }; 644*7c478bd9Sstevel@tonic-gate 645*7c478bd9Sstevel@tonic-gate /* 646*7c478bd9Sstevel@tonic-gate * ACCESS: Check access permission 647*7c478bd9Sstevel@tonic-gate */ 648*7c478bd9Sstevel@tonic-gate const ACCESS3_READ = 0x0001; 649*7c478bd9Sstevel@tonic-gate const ACCESS3_LOOKUP = 0x0002; 650*7c478bd9Sstevel@tonic-gate const ACCESS3_MODIFY = 0x0004; 651*7c478bd9Sstevel@tonic-gate const ACCESS3_EXTEND = 0x0008; 652*7c478bd9Sstevel@tonic-gate const ACCESS3_DELETE = 0x0010; 653*7c478bd9Sstevel@tonic-gate const ACCESS3_EXECUTE = 0x0020; 654*7c478bd9Sstevel@tonic-gate 655*7c478bd9Sstevel@tonic-gate struct ACCESS3args { 656*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 657*7c478bd9Sstevel@tonic-gate uint32 access; 658*7c478bd9Sstevel@tonic-gate }; 659*7c478bd9Sstevel@tonic-gate 660*7c478bd9Sstevel@tonic-gate struct ACCESS3resok { 661*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 662*7c478bd9Sstevel@tonic-gate uint32 access; 663*7c478bd9Sstevel@tonic-gate }; 664*7c478bd9Sstevel@tonic-gate 665*7c478bd9Sstevel@tonic-gate struct ACCESS3resfail { 666*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 667*7c478bd9Sstevel@tonic-gate }; 668*7c478bd9Sstevel@tonic-gate 669*7c478bd9Sstevel@tonic-gate union ACCESS3res switch (nfsstat3 status) { 670*7c478bd9Sstevel@tonic-gate case NFS3_OK: 671*7c478bd9Sstevel@tonic-gate ACCESS3resok resok; 672*7c478bd9Sstevel@tonic-gate default: 673*7c478bd9Sstevel@tonic-gate ACCESS3resfail resfail; 674*7c478bd9Sstevel@tonic-gate }; 675*7c478bd9Sstevel@tonic-gate 676*7c478bd9Sstevel@tonic-gate /* 677*7c478bd9Sstevel@tonic-gate * READLINK: Read from symbolic link 678*7c478bd9Sstevel@tonic-gate */ 679*7c478bd9Sstevel@tonic-gate struct READLINK3args { 680*7c478bd9Sstevel@tonic-gate nfs_fh3 symlink; 681*7c478bd9Sstevel@tonic-gate }; 682*7c478bd9Sstevel@tonic-gate 683*7c478bd9Sstevel@tonic-gate struct READLINK3resok { 684*7c478bd9Sstevel@tonic-gate post_op_attr symlink_attributes; 685*7c478bd9Sstevel@tonic-gate nfspath3 data; 686*7c478bd9Sstevel@tonic-gate }; 687*7c478bd9Sstevel@tonic-gate 688*7c478bd9Sstevel@tonic-gate struct READLINK3resfail { 689*7c478bd9Sstevel@tonic-gate post_op_attr symlink_attributes; 690*7c478bd9Sstevel@tonic-gate }; 691*7c478bd9Sstevel@tonic-gate 692*7c478bd9Sstevel@tonic-gate union READLINK3res switch (nfsstat3 status) { 693*7c478bd9Sstevel@tonic-gate case NFS3_OK: 694*7c478bd9Sstevel@tonic-gate READLINK3resok resok; 695*7c478bd9Sstevel@tonic-gate default: 696*7c478bd9Sstevel@tonic-gate READLINK3resfail resfail; 697*7c478bd9Sstevel@tonic-gate }; 698*7c478bd9Sstevel@tonic-gate 699*7c478bd9Sstevel@tonic-gate /* 700*7c478bd9Sstevel@tonic-gate * READ: Read from file 701*7c478bd9Sstevel@tonic-gate */ 702*7c478bd9Sstevel@tonic-gate struct READ3args { 703*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 704*7c478bd9Sstevel@tonic-gate offset3 offset; 705*7c478bd9Sstevel@tonic-gate count3 count; 706*7c478bd9Sstevel@tonic-gate }; 707*7c478bd9Sstevel@tonic-gate 708*7c478bd9Sstevel@tonic-gate struct READ3resok { 709*7c478bd9Sstevel@tonic-gate post_op_attr file_attributes; 710*7c478bd9Sstevel@tonic-gate count3 count; 711*7c478bd9Sstevel@tonic-gate bool eof; 712*7c478bd9Sstevel@tonic-gate opaque data<>; 713*7c478bd9Sstevel@tonic-gate }; 714*7c478bd9Sstevel@tonic-gate 715*7c478bd9Sstevel@tonic-gate struct READ3resfail { 716*7c478bd9Sstevel@tonic-gate post_op_attr file_attributes; 717*7c478bd9Sstevel@tonic-gate }; 718*7c478bd9Sstevel@tonic-gate 719*7c478bd9Sstevel@tonic-gate union READ3res switch (nfsstat3 status) { 720*7c478bd9Sstevel@tonic-gate case NFS3_OK: 721*7c478bd9Sstevel@tonic-gate READ3resok resok; 722*7c478bd9Sstevel@tonic-gate default: 723*7c478bd9Sstevel@tonic-gate READ3resfail resfail; 724*7c478bd9Sstevel@tonic-gate }; 725*7c478bd9Sstevel@tonic-gate 726*7c478bd9Sstevel@tonic-gate /* 727*7c478bd9Sstevel@tonic-gate * WRITE: Write to file 728*7c478bd9Sstevel@tonic-gate */ 729*7c478bd9Sstevel@tonic-gate enum stable_how { 730*7c478bd9Sstevel@tonic-gate UNSTABLE = 0, 731*7c478bd9Sstevel@tonic-gate DATA_SYNC = 1, 732*7c478bd9Sstevel@tonic-gate FILE_SYNC = 2 733*7c478bd9Sstevel@tonic-gate }; 734*7c478bd9Sstevel@tonic-gate 735*7c478bd9Sstevel@tonic-gate struct WRITE3args { 736*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 737*7c478bd9Sstevel@tonic-gate offset3 offset; 738*7c478bd9Sstevel@tonic-gate count3 count; 739*7c478bd9Sstevel@tonic-gate stable_how stable; 740*7c478bd9Sstevel@tonic-gate opaque data<>; 741*7c478bd9Sstevel@tonic-gate }; 742*7c478bd9Sstevel@tonic-gate 743*7c478bd9Sstevel@tonic-gate struct WRITE3resok { 744*7c478bd9Sstevel@tonic-gate wcc_data file_wcc; 745*7c478bd9Sstevel@tonic-gate count3 count; 746*7c478bd9Sstevel@tonic-gate stable_how committed; 747*7c478bd9Sstevel@tonic-gate writeverf3 verf; 748*7c478bd9Sstevel@tonic-gate }; 749*7c478bd9Sstevel@tonic-gate 750*7c478bd9Sstevel@tonic-gate struct WRITE3resfail { 751*7c478bd9Sstevel@tonic-gate wcc_data file_wcc; 752*7c478bd9Sstevel@tonic-gate }; 753*7c478bd9Sstevel@tonic-gate 754*7c478bd9Sstevel@tonic-gate union WRITE3res switch (nfsstat3 status) { 755*7c478bd9Sstevel@tonic-gate case NFS3_OK: 756*7c478bd9Sstevel@tonic-gate WRITE3resok resok; 757*7c478bd9Sstevel@tonic-gate default: 758*7c478bd9Sstevel@tonic-gate WRITE3resfail resfail; 759*7c478bd9Sstevel@tonic-gate }; 760*7c478bd9Sstevel@tonic-gate 761*7c478bd9Sstevel@tonic-gate /* 762*7c478bd9Sstevel@tonic-gate * CREATE: Create a file 763*7c478bd9Sstevel@tonic-gate */ 764*7c478bd9Sstevel@tonic-gate enum createmode3 { 765*7c478bd9Sstevel@tonic-gate UNCHECKED = 0, 766*7c478bd9Sstevel@tonic-gate GUARDED = 1, 767*7c478bd9Sstevel@tonic-gate EXCLUSIVE = 2 768*7c478bd9Sstevel@tonic-gate }; 769*7c478bd9Sstevel@tonic-gate 770*7c478bd9Sstevel@tonic-gate union createhow3 switch (createmode3 mode) { 771*7c478bd9Sstevel@tonic-gate case UNCHECKED: 772*7c478bd9Sstevel@tonic-gate case GUARDED: 773*7c478bd9Sstevel@tonic-gate sattr3 obj_attributes; 774*7c478bd9Sstevel@tonic-gate case EXCLUSIVE: 775*7c478bd9Sstevel@tonic-gate createverf3 verf; 776*7c478bd9Sstevel@tonic-gate }; 777*7c478bd9Sstevel@tonic-gate 778*7c478bd9Sstevel@tonic-gate struct CREATE3args { 779*7c478bd9Sstevel@tonic-gate diropargs3 where; 780*7c478bd9Sstevel@tonic-gate createhow3 how; 781*7c478bd9Sstevel@tonic-gate }; 782*7c478bd9Sstevel@tonic-gate 783*7c478bd9Sstevel@tonic-gate struct CREATE3resok { 784*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 785*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 786*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 787*7c478bd9Sstevel@tonic-gate }; 788*7c478bd9Sstevel@tonic-gate 789*7c478bd9Sstevel@tonic-gate struct CREATE3resfail { 790*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 791*7c478bd9Sstevel@tonic-gate }; 792*7c478bd9Sstevel@tonic-gate 793*7c478bd9Sstevel@tonic-gate union CREATE3res switch (nfsstat3 status) { 794*7c478bd9Sstevel@tonic-gate case NFS3_OK: 795*7c478bd9Sstevel@tonic-gate CREATE3resok resok; 796*7c478bd9Sstevel@tonic-gate default: 797*7c478bd9Sstevel@tonic-gate CREATE3resfail resfail; 798*7c478bd9Sstevel@tonic-gate }; 799*7c478bd9Sstevel@tonic-gate 800*7c478bd9Sstevel@tonic-gate /* 801*7c478bd9Sstevel@tonic-gate * MKDIR: Create a directory 802*7c478bd9Sstevel@tonic-gate */ 803*7c478bd9Sstevel@tonic-gate struct MKDIR3args { 804*7c478bd9Sstevel@tonic-gate diropargs3 where; 805*7c478bd9Sstevel@tonic-gate sattr3 attributes; 806*7c478bd9Sstevel@tonic-gate }; 807*7c478bd9Sstevel@tonic-gate 808*7c478bd9Sstevel@tonic-gate struct MKDIR3resok { 809*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 810*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 811*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 812*7c478bd9Sstevel@tonic-gate }; 813*7c478bd9Sstevel@tonic-gate 814*7c478bd9Sstevel@tonic-gate struct MKDIR3resfail { 815*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 816*7c478bd9Sstevel@tonic-gate }; 817*7c478bd9Sstevel@tonic-gate 818*7c478bd9Sstevel@tonic-gate union MKDIR3res switch (nfsstat3 status) { 819*7c478bd9Sstevel@tonic-gate case NFS3_OK: 820*7c478bd9Sstevel@tonic-gate MKDIR3resok resok; 821*7c478bd9Sstevel@tonic-gate default: 822*7c478bd9Sstevel@tonic-gate MKDIR3resfail resfail; 823*7c478bd9Sstevel@tonic-gate }; 824*7c478bd9Sstevel@tonic-gate 825*7c478bd9Sstevel@tonic-gate /* 826*7c478bd9Sstevel@tonic-gate * SYMLINK: Create a symbolic link 827*7c478bd9Sstevel@tonic-gate */ 828*7c478bd9Sstevel@tonic-gate struct symlinkdata3 { 829*7c478bd9Sstevel@tonic-gate sattr3 symlink_attributes; 830*7c478bd9Sstevel@tonic-gate nfspath3 symlink_data; 831*7c478bd9Sstevel@tonic-gate }; 832*7c478bd9Sstevel@tonic-gate 833*7c478bd9Sstevel@tonic-gate struct SYMLINK3args { 834*7c478bd9Sstevel@tonic-gate diropargs3 where; 835*7c478bd9Sstevel@tonic-gate symlinkdata3 symlink; 836*7c478bd9Sstevel@tonic-gate }; 837*7c478bd9Sstevel@tonic-gate 838*7c478bd9Sstevel@tonic-gate struct SYMLINK3resok { 839*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 840*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 841*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 842*7c478bd9Sstevel@tonic-gate }; 843*7c478bd9Sstevel@tonic-gate 844*7c478bd9Sstevel@tonic-gate struct SYMLINK3resfail { 845*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 846*7c478bd9Sstevel@tonic-gate }; 847*7c478bd9Sstevel@tonic-gate 848*7c478bd9Sstevel@tonic-gate union SYMLINK3res switch (nfsstat3 status) { 849*7c478bd9Sstevel@tonic-gate case NFS3_OK: 850*7c478bd9Sstevel@tonic-gate SYMLINK3resok resok; 851*7c478bd9Sstevel@tonic-gate default: 852*7c478bd9Sstevel@tonic-gate SYMLINK3resfail resfail; 853*7c478bd9Sstevel@tonic-gate }; 854*7c478bd9Sstevel@tonic-gate 855*7c478bd9Sstevel@tonic-gate /* 856*7c478bd9Sstevel@tonic-gate * MKNOD: Create a special file 857*7c478bd9Sstevel@tonic-gate */ 858*7c478bd9Sstevel@tonic-gate struct devicedata3 { 859*7c478bd9Sstevel@tonic-gate sattr3 dev_attributes; 860*7c478bd9Sstevel@tonic-gate specdata3 spec; 861*7c478bd9Sstevel@tonic-gate }; 862*7c478bd9Sstevel@tonic-gate 863*7c478bd9Sstevel@tonic-gate union mknoddata3 switch (ftype3 type) { 864*7c478bd9Sstevel@tonic-gate case NF3CHR: 865*7c478bd9Sstevel@tonic-gate case NF3BLK: 866*7c478bd9Sstevel@tonic-gate devicedata3 device; 867*7c478bd9Sstevel@tonic-gate case NF3SOCK: 868*7c478bd9Sstevel@tonic-gate case NF3FIFO: 869*7c478bd9Sstevel@tonic-gate sattr3 pipe_attributes; 870*7c478bd9Sstevel@tonic-gate default: 871*7c478bd9Sstevel@tonic-gate void; 872*7c478bd9Sstevel@tonic-gate }; 873*7c478bd9Sstevel@tonic-gate 874*7c478bd9Sstevel@tonic-gate struct MKNOD3args { 875*7c478bd9Sstevel@tonic-gate diropargs3 where; 876*7c478bd9Sstevel@tonic-gate mknoddata3 what; 877*7c478bd9Sstevel@tonic-gate }; 878*7c478bd9Sstevel@tonic-gate 879*7c478bd9Sstevel@tonic-gate struct MKNOD3resok { 880*7c478bd9Sstevel@tonic-gate post_op_fh3 obj; 881*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 882*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 883*7c478bd9Sstevel@tonic-gate }; 884*7c478bd9Sstevel@tonic-gate 885*7c478bd9Sstevel@tonic-gate struct MKNOD3resfail { 886*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 887*7c478bd9Sstevel@tonic-gate }; 888*7c478bd9Sstevel@tonic-gate 889*7c478bd9Sstevel@tonic-gate union MKNOD3res switch (nfsstat3 status) { 890*7c478bd9Sstevel@tonic-gate case NFS3_OK: 891*7c478bd9Sstevel@tonic-gate MKNOD3resok resok; 892*7c478bd9Sstevel@tonic-gate default: 893*7c478bd9Sstevel@tonic-gate MKNOD3resfail resfail; 894*7c478bd9Sstevel@tonic-gate }; 895*7c478bd9Sstevel@tonic-gate 896*7c478bd9Sstevel@tonic-gate /* 897*7c478bd9Sstevel@tonic-gate * REMOVE: Remove a file 898*7c478bd9Sstevel@tonic-gate */ 899*7c478bd9Sstevel@tonic-gate struct REMOVE3args { 900*7c478bd9Sstevel@tonic-gate diropargs3 object; 901*7c478bd9Sstevel@tonic-gate }; 902*7c478bd9Sstevel@tonic-gate 903*7c478bd9Sstevel@tonic-gate struct REMOVE3resok { 904*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 905*7c478bd9Sstevel@tonic-gate }; 906*7c478bd9Sstevel@tonic-gate 907*7c478bd9Sstevel@tonic-gate struct REMOVE3resfail { 908*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 909*7c478bd9Sstevel@tonic-gate }; 910*7c478bd9Sstevel@tonic-gate 911*7c478bd9Sstevel@tonic-gate union REMOVE3res switch (nfsstat3 status) { 912*7c478bd9Sstevel@tonic-gate case NFS3_OK: 913*7c478bd9Sstevel@tonic-gate REMOVE3resok resok; 914*7c478bd9Sstevel@tonic-gate default: 915*7c478bd9Sstevel@tonic-gate REMOVE3resfail resfail; 916*7c478bd9Sstevel@tonic-gate }; 917*7c478bd9Sstevel@tonic-gate 918*7c478bd9Sstevel@tonic-gate /* 919*7c478bd9Sstevel@tonic-gate * RMDIR: Remove a directory 920*7c478bd9Sstevel@tonic-gate */ 921*7c478bd9Sstevel@tonic-gate struct RMDIR3args { 922*7c478bd9Sstevel@tonic-gate diropargs3 object; 923*7c478bd9Sstevel@tonic-gate }; 924*7c478bd9Sstevel@tonic-gate 925*7c478bd9Sstevel@tonic-gate struct RMDIR3resok { 926*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 927*7c478bd9Sstevel@tonic-gate }; 928*7c478bd9Sstevel@tonic-gate 929*7c478bd9Sstevel@tonic-gate struct RMDIR3resfail { 930*7c478bd9Sstevel@tonic-gate wcc_data dir_wcc; 931*7c478bd9Sstevel@tonic-gate }; 932*7c478bd9Sstevel@tonic-gate 933*7c478bd9Sstevel@tonic-gate union RMDIR3res switch (nfsstat3 status) { 934*7c478bd9Sstevel@tonic-gate case NFS3_OK: 935*7c478bd9Sstevel@tonic-gate RMDIR3resok resok; 936*7c478bd9Sstevel@tonic-gate default: 937*7c478bd9Sstevel@tonic-gate RMDIR3resfail resfail; 938*7c478bd9Sstevel@tonic-gate }; 939*7c478bd9Sstevel@tonic-gate 940*7c478bd9Sstevel@tonic-gate /* 941*7c478bd9Sstevel@tonic-gate * RENAME: Rename a file or directory 942*7c478bd9Sstevel@tonic-gate */ 943*7c478bd9Sstevel@tonic-gate struct RENAME3args { 944*7c478bd9Sstevel@tonic-gate diropargs3 from; 945*7c478bd9Sstevel@tonic-gate diropargs3 to; 946*7c478bd9Sstevel@tonic-gate }; 947*7c478bd9Sstevel@tonic-gate 948*7c478bd9Sstevel@tonic-gate struct RENAME3resok { 949*7c478bd9Sstevel@tonic-gate wcc_data fromdir_wcc; 950*7c478bd9Sstevel@tonic-gate wcc_data todir_wcc; 951*7c478bd9Sstevel@tonic-gate }; 952*7c478bd9Sstevel@tonic-gate 953*7c478bd9Sstevel@tonic-gate struct RENAME3resfail { 954*7c478bd9Sstevel@tonic-gate wcc_data fromdir_wcc; 955*7c478bd9Sstevel@tonic-gate wcc_data todir_wcc; 956*7c478bd9Sstevel@tonic-gate }; 957*7c478bd9Sstevel@tonic-gate 958*7c478bd9Sstevel@tonic-gate union RENAME3res switch (nfsstat3 status) { 959*7c478bd9Sstevel@tonic-gate case NFS3_OK: 960*7c478bd9Sstevel@tonic-gate RENAME3resok resok; 961*7c478bd9Sstevel@tonic-gate default: 962*7c478bd9Sstevel@tonic-gate RENAME3resfail resfail; 963*7c478bd9Sstevel@tonic-gate }; 964*7c478bd9Sstevel@tonic-gate 965*7c478bd9Sstevel@tonic-gate /* 966*7c478bd9Sstevel@tonic-gate * LINK: Create link to an object 967*7c478bd9Sstevel@tonic-gate */ 968*7c478bd9Sstevel@tonic-gate struct LINK3args { 969*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 970*7c478bd9Sstevel@tonic-gate diropargs3 link; 971*7c478bd9Sstevel@tonic-gate }; 972*7c478bd9Sstevel@tonic-gate 973*7c478bd9Sstevel@tonic-gate struct LINK3resok { 974*7c478bd9Sstevel@tonic-gate post_op_attr file_attributes; 975*7c478bd9Sstevel@tonic-gate wcc_data linkdir_wcc; 976*7c478bd9Sstevel@tonic-gate }; 977*7c478bd9Sstevel@tonic-gate 978*7c478bd9Sstevel@tonic-gate struct LINK3resfail { 979*7c478bd9Sstevel@tonic-gate post_op_attr file_attributes; 980*7c478bd9Sstevel@tonic-gate wcc_data linkdir_wcc; 981*7c478bd9Sstevel@tonic-gate }; 982*7c478bd9Sstevel@tonic-gate 983*7c478bd9Sstevel@tonic-gate union LINK3res switch (nfsstat3 status) { 984*7c478bd9Sstevel@tonic-gate case NFS3_OK: 985*7c478bd9Sstevel@tonic-gate LINK3resok resok; 986*7c478bd9Sstevel@tonic-gate default: 987*7c478bd9Sstevel@tonic-gate LINK3resfail resfail; 988*7c478bd9Sstevel@tonic-gate }; 989*7c478bd9Sstevel@tonic-gate 990*7c478bd9Sstevel@tonic-gate /* 991*7c478bd9Sstevel@tonic-gate * READDIR: Read from directory 992*7c478bd9Sstevel@tonic-gate */ 993*7c478bd9Sstevel@tonic-gate struct READDIR3args { 994*7c478bd9Sstevel@tonic-gate nfs_fh3 dir; 995*7c478bd9Sstevel@tonic-gate cookie3 cookie; 996*7c478bd9Sstevel@tonic-gate cookieverf3 cookieverf; 997*7c478bd9Sstevel@tonic-gate count3 count; 998*7c478bd9Sstevel@tonic-gate }; 999*7c478bd9Sstevel@tonic-gate 1000*7c478bd9Sstevel@tonic-gate struct entry3 { 1001*7c478bd9Sstevel@tonic-gate fileid3 fileid; 1002*7c478bd9Sstevel@tonic-gate filename3 name; 1003*7c478bd9Sstevel@tonic-gate cookie3 cookie; 1004*7c478bd9Sstevel@tonic-gate entry3 *nextentry; 1005*7c478bd9Sstevel@tonic-gate }; 1006*7c478bd9Sstevel@tonic-gate 1007*7c478bd9Sstevel@tonic-gate struct dirlist3 { 1008*7c478bd9Sstevel@tonic-gate entry3 *entries; 1009*7c478bd9Sstevel@tonic-gate bool eof; 1010*7c478bd9Sstevel@tonic-gate }; 1011*7c478bd9Sstevel@tonic-gate 1012*7c478bd9Sstevel@tonic-gate struct READDIR3resok { 1013*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 1014*7c478bd9Sstevel@tonic-gate cookieverf3 cookieverf; 1015*7c478bd9Sstevel@tonic-gate dirlist3 reply; 1016*7c478bd9Sstevel@tonic-gate }; 1017*7c478bd9Sstevel@tonic-gate 1018*7c478bd9Sstevel@tonic-gate struct READDIR3resfail { 1019*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 1020*7c478bd9Sstevel@tonic-gate }; 1021*7c478bd9Sstevel@tonic-gate 1022*7c478bd9Sstevel@tonic-gate union READDIR3res switch (nfsstat3 status) { 1023*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1024*7c478bd9Sstevel@tonic-gate READDIR3resok resok; 1025*7c478bd9Sstevel@tonic-gate default: 1026*7c478bd9Sstevel@tonic-gate READDIR3resfail resfail; 1027*7c478bd9Sstevel@tonic-gate }; 1028*7c478bd9Sstevel@tonic-gate 1029*7c478bd9Sstevel@tonic-gate /* 1030*7c478bd9Sstevel@tonic-gate * READDIRPLUS: Extended read from a directory 1031*7c478bd9Sstevel@tonic-gate */ 1032*7c478bd9Sstevel@tonic-gate struct READDIRPLUS3args { 1033*7c478bd9Sstevel@tonic-gate nfs_fh3 dir; 1034*7c478bd9Sstevel@tonic-gate cookie3 cookie; 1035*7c478bd9Sstevel@tonic-gate cookieverf3 cookieverf; 1036*7c478bd9Sstevel@tonic-gate count3 dircount; 1037*7c478bd9Sstevel@tonic-gate count3 maxcount; 1038*7c478bd9Sstevel@tonic-gate }; 1039*7c478bd9Sstevel@tonic-gate 1040*7c478bd9Sstevel@tonic-gate struct entryplus3 { 1041*7c478bd9Sstevel@tonic-gate fileid3 fileid; 1042*7c478bd9Sstevel@tonic-gate filename3 name; 1043*7c478bd9Sstevel@tonic-gate cookie3 cookie; 1044*7c478bd9Sstevel@tonic-gate post_op_attr name_attributes; 1045*7c478bd9Sstevel@tonic-gate post_op_fh3 name_handle; 1046*7c478bd9Sstevel@tonic-gate entryplus3 *nextentry; 1047*7c478bd9Sstevel@tonic-gate }; 1048*7c478bd9Sstevel@tonic-gate 1049*7c478bd9Sstevel@tonic-gate struct dirlistplus3 { 1050*7c478bd9Sstevel@tonic-gate entryplus3 *entries; 1051*7c478bd9Sstevel@tonic-gate bool eof; 1052*7c478bd9Sstevel@tonic-gate }; 1053*7c478bd9Sstevel@tonic-gate 1054*7c478bd9Sstevel@tonic-gate struct READDIRPLUS3resok { 1055*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 1056*7c478bd9Sstevel@tonic-gate cookieverf3 cookieverf; 1057*7c478bd9Sstevel@tonic-gate dirlistplus3 reply; 1058*7c478bd9Sstevel@tonic-gate }; 1059*7c478bd9Sstevel@tonic-gate 1060*7c478bd9Sstevel@tonic-gate struct READDIRPLUS3resfail { 1061*7c478bd9Sstevel@tonic-gate post_op_attr dir_attributes; 1062*7c478bd9Sstevel@tonic-gate }; 1063*7c478bd9Sstevel@tonic-gate 1064*7c478bd9Sstevel@tonic-gate union READDIRPLUS3res switch (nfsstat3 status) { 1065*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1066*7c478bd9Sstevel@tonic-gate READDIRPLUS3resok resok; 1067*7c478bd9Sstevel@tonic-gate default: 1068*7c478bd9Sstevel@tonic-gate READDIRPLUS3resfail resfail; 1069*7c478bd9Sstevel@tonic-gate }; 1070*7c478bd9Sstevel@tonic-gate 1071*7c478bd9Sstevel@tonic-gate /* 1072*7c478bd9Sstevel@tonic-gate * FSSTAT: Get dynamic file system information 1073*7c478bd9Sstevel@tonic-gate */ 1074*7c478bd9Sstevel@tonic-gate struct FSSTAT3args { 1075*7c478bd9Sstevel@tonic-gate nfs_fh3 fsroot; 1076*7c478bd9Sstevel@tonic-gate }; 1077*7c478bd9Sstevel@tonic-gate 1078*7c478bd9Sstevel@tonic-gate struct FSSTAT3resok { 1079*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1080*7c478bd9Sstevel@tonic-gate size3 tbytes; 1081*7c478bd9Sstevel@tonic-gate size3 fbytes; 1082*7c478bd9Sstevel@tonic-gate size3 abytes; 1083*7c478bd9Sstevel@tonic-gate size3 tfiles; 1084*7c478bd9Sstevel@tonic-gate size3 ffiles; 1085*7c478bd9Sstevel@tonic-gate size3 afiles; 1086*7c478bd9Sstevel@tonic-gate uint32 invarsec; 1087*7c478bd9Sstevel@tonic-gate }; 1088*7c478bd9Sstevel@tonic-gate 1089*7c478bd9Sstevel@tonic-gate struct FSSTAT3resfail { 1090*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1091*7c478bd9Sstevel@tonic-gate }; 1092*7c478bd9Sstevel@tonic-gate 1093*7c478bd9Sstevel@tonic-gate union FSSTAT3res switch (nfsstat3 status) { 1094*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1095*7c478bd9Sstevel@tonic-gate FSSTAT3resok resok; 1096*7c478bd9Sstevel@tonic-gate default: 1097*7c478bd9Sstevel@tonic-gate FSSTAT3resfail resfail; 1098*7c478bd9Sstevel@tonic-gate }; 1099*7c478bd9Sstevel@tonic-gate 1100*7c478bd9Sstevel@tonic-gate /* 1101*7c478bd9Sstevel@tonic-gate * FSINFO: Get static file system information 1102*7c478bd9Sstevel@tonic-gate */ 1103*7c478bd9Sstevel@tonic-gate 1104*7c478bd9Sstevel@tonic-gate const FSF3_LINK = 0x0001; 1105*7c478bd9Sstevel@tonic-gate const FSF3_SYMLINK = 0x0002; 1106*7c478bd9Sstevel@tonic-gate const FSF3_HOMOGENEOUS = 0x0008; 1107*7c478bd9Sstevel@tonic-gate const FSF3_CANSETTIME = 0x0010; 1108*7c478bd9Sstevel@tonic-gate 1109*7c478bd9Sstevel@tonic-gate struct FSINFO3args { 1110*7c478bd9Sstevel@tonic-gate nfs_fh3 fsroot; 1111*7c478bd9Sstevel@tonic-gate }; 1112*7c478bd9Sstevel@tonic-gate 1113*7c478bd9Sstevel@tonic-gate struct FSINFO3resok { 1114*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1115*7c478bd9Sstevel@tonic-gate uint32 rtmax; 1116*7c478bd9Sstevel@tonic-gate uint32 rtpref; 1117*7c478bd9Sstevel@tonic-gate uint32 rtmult; 1118*7c478bd9Sstevel@tonic-gate uint32 wtmax; 1119*7c478bd9Sstevel@tonic-gate uint32 wtpref; 1120*7c478bd9Sstevel@tonic-gate uint32 wtmult; 1121*7c478bd9Sstevel@tonic-gate uint32 dtpref; 1122*7c478bd9Sstevel@tonic-gate size3 maxfilesize; 1123*7c478bd9Sstevel@tonic-gate nfstime3 time_delta; 1124*7c478bd9Sstevel@tonic-gate uint32 properties; 1125*7c478bd9Sstevel@tonic-gate }; 1126*7c478bd9Sstevel@tonic-gate 1127*7c478bd9Sstevel@tonic-gate struct FSINFO3resfail { 1128*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1129*7c478bd9Sstevel@tonic-gate }; 1130*7c478bd9Sstevel@tonic-gate 1131*7c478bd9Sstevel@tonic-gate union FSINFO3res switch (nfsstat3 status) { 1132*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1133*7c478bd9Sstevel@tonic-gate FSINFO3resok resok; 1134*7c478bd9Sstevel@tonic-gate default: 1135*7c478bd9Sstevel@tonic-gate FSINFO3resfail resfail; 1136*7c478bd9Sstevel@tonic-gate }; 1137*7c478bd9Sstevel@tonic-gate 1138*7c478bd9Sstevel@tonic-gate /* 1139*7c478bd9Sstevel@tonic-gate * PATHCONF: Retrieve POSIX information 1140*7c478bd9Sstevel@tonic-gate */ 1141*7c478bd9Sstevel@tonic-gate struct PATHCONF3args { 1142*7c478bd9Sstevel@tonic-gate nfs_fh3 object; 1143*7c478bd9Sstevel@tonic-gate }; 1144*7c478bd9Sstevel@tonic-gate 1145*7c478bd9Sstevel@tonic-gate struct PATHCONF3resok { 1146*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1147*7c478bd9Sstevel@tonic-gate uint32 linkmax; 1148*7c478bd9Sstevel@tonic-gate uint32 name_max; 1149*7c478bd9Sstevel@tonic-gate bool no_trunc; 1150*7c478bd9Sstevel@tonic-gate bool chown_restricted; 1151*7c478bd9Sstevel@tonic-gate bool case_insensitive; 1152*7c478bd9Sstevel@tonic-gate bool case_preserving; 1153*7c478bd9Sstevel@tonic-gate }; 1154*7c478bd9Sstevel@tonic-gate 1155*7c478bd9Sstevel@tonic-gate struct PATHCONF3resfail { 1156*7c478bd9Sstevel@tonic-gate post_op_attr obj_attributes; 1157*7c478bd9Sstevel@tonic-gate }; 1158*7c478bd9Sstevel@tonic-gate 1159*7c478bd9Sstevel@tonic-gate union PATHCONF3res switch (nfsstat3 status) { 1160*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1161*7c478bd9Sstevel@tonic-gate PATHCONF3resok resok; 1162*7c478bd9Sstevel@tonic-gate default: 1163*7c478bd9Sstevel@tonic-gate PATHCONF3resfail resfail; 1164*7c478bd9Sstevel@tonic-gate }; 1165*7c478bd9Sstevel@tonic-gate 1166*7c478bd9Sstevel@tonic-gate /* 1167*7c478bd9Sstevel@tonic-gate * COMMIT: Commit cached data on a server to stable storage 1168*7c478bd9Sstevel@tonic-gate */ 1169*7c478bd9Sstevel@tonic-gate struct COMMIT3args { 1170*7c478bd9Sstevel@tonic-gate nfs_fh3 file; 1171*7c478bd9Sstevel@tonic-gate offset3 offset; 1172*7c478bd9Sstevel@tonic-gate count3 count; 1173*7c478bd9Sstevel@tonic-gate }; 1174*7c478bd9Sstevel@tonic-gate 1175*7c478bd9Sstevel@tonic-gate struct COMMIT3resok { 1176*7c478bd9Sstevel@tonic-gate wcc_data file_wcc; 1177*7c478bd9Sstevel@tonic-gate writeverf3 verf; 1178*7c478bd9Sstevel@tonic-gate }; 1179*7c478bd9Sstevel@tonic-gate 1180*7c478bd9Sstevel@tonic-gate struct COMMIT3resfail { 1181*7c478bd9Sstevel@tonic-gate wcc_data file_wcc; 1182*7c478bd9Sstevel@tonic-gate }; 1183*7c478bd9Sstevel@tonic-gate 1184*7c478bd9Sstevel@tonic-gate union COMMIT3res switch (nfsstat3 status) { 1185*7c478bd9Sstevel@tonic-gate case NFS3_OK: 1186*7c478bd9Sstevel@tonic-gate COMMIT3resok resok; 1187*7c478bd9Sstevel@tonic-gate default: 1188*7c478bd9Sstevel@tonic-gate COMMIT3resfail resfail; 1189*7c478bd9Sstevel@tonic-gate }; 1190*7c478bd9Sstevel@tonic-gate 1191*7c478bd9Sstevel@tonic-gate /* 1192*7c478bd9Sstevel@tonic-gate * Remote file service routines 1193*7c478bd9Sstevel@tonic-gate */ 1194*7c478bd9Sstevel@tonic-gate program NFS3_PROGRAM { 1195*7c478bd9Sstevel@tonic-gate version NFS_V3 { 1196*7c478bd9Sstevel@tonic-gate void 1197*7c478bd9Sstevel@tonic-gate NFSPROC3_NULL(void) = 0; 1198*7c478bd9Sstevel@tonic-gate 1199*7c478bd9Sstevel@tonic-gate GETATTR3res 1200*7c478bd9Sstevel@tonic-gate NFSPROC3_GETATTR(GETATTR3args) = 1; 1201*7c478bd9Sstevel@tonic-gate 1202*7c478bd9Sstevel@tonic-gate SETATTR3res 1203*7c478bd9Sstevel@tonic-gate NFSPROC3_SETATTR(SETATTR3args) = 2; 1204*7c478bd9Sstevel@tonic-gate 1205*7c478bd9Sstevel@tonic-gate LOOKUP3res 1206*7c478bd9Sstevel@tonic-gate NFSPROC3_LOOKUP(LOOKUP3args) = 3; 1207*7c478bd9Sstevel@tonic-gate 1208*7c478bd9Sstevel@tonic-gate ACCESS3res 1209*7c478bd9Sstevel@tonic-gate NFSPROC3_ACCESS(ACCESS3args) = 4; 1210*7c478bd9Sstevel@tonic-gate 1211*7c478bd9Sstevel@tonic-gate READLINK3res 1212*7c478bd9Sstevel@tonic-gate NFSPROC3_READLINK(READLINK3args) = 5; 1213*7c478bd9Sstevel@tonic-gate 1214*7c478bd9Sstevel@tonic-gate READ3res 1215*7c478bd9Sstevel@tonic-gate NFSPROC3_READ(READ3args) = 6; 1216*7c478bd9Sstevel@tonic-gate 1217*7c478bd9Sstevel@tonic-gate WRITE3res 1218*7c478bd9Sstevel@tonic-gate NFSPROC3_WRITE(WRITE3args) = 7; 1219*7c478bd9Sstevel@tonic-gate 1220*7c478bd9Sstevel@tonic-gate CREATE3res 1221*7c478bd9Sstevel@tonic-gate NFSPROC3_CREATE(CREATE3args) = 8; 1222*7c478bd9Sstevel@tonic-gate 1223*7c478bd9Sstevel@tonic-gate MKDIR3res 1224*7c478bd9Sstevel@tonic-gate NFSPROC3_MKDIR(MKDIR3args) = 9; 1225*7c478bd9Sstevel@tonic-gate 1226*7c478bd9Sstevel@tonic-gate SYMLINK3res 1227*7c478bd9Sstevel@tonic-gate NFSPROC3_SYMLINK(SYMLINK3args) = 10; 1228*7c478bd9Sstevel@tonic-gate 1229*7c478bd9Sstevel@tonic-gate MKNOD3res 1230*7c478bd9Sstevel@tonic-gate NFSPROC3_MKNOD(MKNOD3args) = 11; 1231*7c478bd9Sstevel@tonic-gate 1232*7c478bd9Sstevel@tonic-gate REMOVE3res 1233*7c478bd9Sstevel@tonic-gate NFSPROC3_REMOVE(REMOVE3args) = 12; 1234*7c478bd9Sstevel@tonic-gate 1235*7c478bd9Sstevel@tonic-gate RMDIR3res 1236*7c478bd9Sstevel@tonic-gate NFSPROC3_RMDIR(RMDIR3args) = 13; 1237*7c478bd9Sstevel@tonic-gate 1238*7c478bd9Sstevel@tonic-gate RENAME3res 1239*7c478bd9Sstevel@tonic-gate NFSPROC3_RENAME(RENAME3args) = 14; 1240*7c478bd9Sstevel@tonic-gate 1241*7c478bd9Sstevel@tonic-gate LINK3res 1242*7c478bd9Sstevel@tonic-gate NFSPROC3_LINK(LINK3args) = 15; 1243*7c478bd9Sstevel@tonic-gate 1244*7c478bd9Sstevel@tonic-gate READDIR3res 1245*7c478bd9Sstevel@tonic-gate NFSPROC3_READDIR(READDIR3args) = 16; 1246*7c478bd9Sstevel@tonic-gate 1247*7c478bd9Sstevel@tonic-gate READDIRPLUS3res 1248*7c478bd9Sstevel@tonic-gate NFSPROC3_READDIRPLUS(READDIRPLUS3args) = 17; 1249*7c478bd9Sstevel@tonic-gate 1250*7c478bd9Sstevel@tonic-gate FSSTAT3res 1251*7c478bd9Sstevel@tonic-gate NFSPROC3_FSSTAT(FSSTAT3args) = 18; 1252*7c478bd9Sstevel@tonic-gate 1253*7c478bd9Sstevel@tonic-gate FSINFO3res 1254*7c478bd9Sstevel@tonic-gate NFSPROC3_FSINFO(FSINFO3args) = 19; 1255*7c478bd9Sstevel@tonic-gate 1256*7c478bd9Sstevel@tonic-gate PATHCONF3res 1257*7c478bd9Sstevel@tonic-gate NFSPROC3_PATHCONF(PATHCONF3args) = 20; 1258*7c478bd9Sstevel@tonic-gate 1259*7c478bd9Sstevel@tonic-gate COMMIT3res 1260*7c478bd9Sstevel@tonic-gate NFSPROC3_COMMIT(COMMIT3args) = 21; 1261*7c478bd9Sstevel@tonic-gate } = 3; 1262*7c478bd9Sstevel@tonic-gate } = 100003; 1263