Home | History | Annotate | Line # | Download | only in nfs
nfsproto.h revision 1.5
      1  1.5  christos /*	$NetBSD: nfsproto.h,v 1.5 1997/10/17 00:02:16 christos Exp $	*/
      2  1.1      fvdl 
      3  1.1      fvdl /*
      4  1.1      fvdl  * Copyright (c) 1989, 1993
      5  1.1      fvdl  *	The Regents of the University of California.  All rights reserved.
      6  1.1      fvdl  *
      7  1.1      fvdl  * This code is derived from software contributed to Berkeley by
      8  1.1      fvdl  * Rick Macklem at The University of Guelph.
      9  1.1      fvdl  *
     10  1.1      fvdl  * Redistribution and use in source and binary forms, with or without
     11  1.1      fvdl  * modification, are permitted provided that the following conditions
     12  1.1      fvdl  * are met:
     13  1.1      fvdl  * 1. Redistributions of source code must retain the above copyright
     14  1.1      fvdl  *    notice, this list of conditions and the following disclaimer.
     15  1.1      fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1      fvdl  *    notice, this list of conditions and the following disclaimer in the
     17  1.1      fvdl  *    documentation and/or other materials provided with the distribution.
     18  1.1      fvdl  * 3. All advertising materials mentioning features or use of this software
     19  1.1      fvdl  *    must display the following acknowledgement:
     20  1.1      fvdl  *	This product includes software developed by the University of
     21  1.1      fvdl  *	California, Berkeley and its contributors.
     22  1.1      fvdl  * 4. Neither the name of the University nor the names of its contributors
     23  1.1      fvdl  *    may be used to endorse or promote products derived from this software
     24  1.1      fvdl  *    without specific prior written permission.
     25  1.1      fvdl  *
     26  1.1      fvdl  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27  1.1      fvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  1.1      fvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  1.1      fvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30  1.1      fvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  1.1      fvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  1.1      fvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  1.1      fvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  1.1      fvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  1.1      fvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  1.1      fvdl  * SUCH DAMAGE.
     37  1.1      fvdl  *
     38  1.1      fvdl  *	@(#)nfsproto.h	8.2 (Berkeley) 3/30/95
     39  1.1      fvdl  */
     40  1.1      fvdl 
     41  1.1      fvdl #ifndef _NFS_NFSPROTO_H_
     42  1.1      fvdl #define _NFS_NFSPROTO_H_
     43  1.1      fvdl 
     44  1.1      fvdl 
     45  1.1      fvdl /*
     46  1.1      fvdl  * nfs definitions as per the Version 2 and 3 specs
     47  1.1      fvdl  */
     48  1.1      fvdl 
     49  1.1      fvdl /*
     50  1.1      fvdl  * Constants as defined in the Sun NFS Version 2 and 3 specs.
     51  1.1      fvdl  * "NFS: Network File System Protocol Specification" RFC1094
     52  1.1      fvdl  * and in the "NFS: Network File System Version 3 Protocol
     53  1.1      fvdl  * Specification"
     54  1.1      fvdl  */
     55  1.1      fvdl 
     56  1.1      fvdl #define NFS_PORT	2049
     57  1.1      fvdl #define	NFS_PROG	100003
     58  1.1      fvdl #define NFS_VER2	2
     59  1.1      fvdl #define	NFS_VER3	3
     60  1.1      fvdl #define NFS_V2MAXDATA	8192
     61  1.1      fvdl #define	NFS_MAXDGRAMDATA 16384
     62  1.1      fvdl #define	NFS_MAXDATA	32768
     63  1.1      fvdl #define	NFS_MAXPATHLEN	1024
     64  1.1      fvdl #define	NFS_MAXNAMLEN	255
     65  1.1      fvdl #define	NFS_MAXPKTHDR	404
     66  1.1      fvdl #define NFS_MAXPACKET	(NFS_MAXPKTHDR + NFS_MAXDATA)
     67  1.1      fvdl #define	NFS_MINPACKET	20
     68  1.1      fvdl #define	NFS_FABLKSIZE	512	/* Size in bytes of a block wrt fa_blocks */
     69  1.1      fvdl 
     70  1.1      fvdl /* Stat numbers for rpc returns (version 2 and 3) */
     71  1.1      fvdl #define	NFS_OK			0
     72  1.1      fvdl #define	NFSERR_PERM		1
     73  1.1      fvdl #define	NFSERR_NOENT		2
     74  1.1      fvdl #define	NFSERR_IO		5
     75  1.1      fvdl #define	NFSERR_NXIO		6
     76  1.1      fvdl #define	NFSERR_ACCES		13
     77  1.1      fvdl #define	NFSERR_EXIST		17
     78  1.1      fvdl #define	NFSERR_XDEV		18	/* Version 3 only */
     79  1.1      fvdl #define	NFSERR_NODEV		19
     80  1.1      fvdl #define	NFSERR_NOTDIR		20
     81  1.1      fvdl #define	NFSERR_ISDIR		21
     82  1.1      fvdl #define	NFSERR_INVAL		22	/* Version 3 only */
     83  1.1      fvdl #define	NFSERR_FBIG		27
     84  1.1      fvdl #define	NFSERR_NOSPC		28
     85  1.1      fvdl #define	NFSERR_ROFS		30
     86  1.1      fvdl #define	NFSERR_MLINK		31	/* Version 3 only */
     87  1.1      fvdl #define	NFSERR_NAMETOL		63
     88  1.1      fvdl #define	NFSERR_NOTEMPTY		66
     89  1.1      fvdl #define	NFSERR_DQUOT		69
     90  1.1      fvdl #define	NFSERR_STALE		70
     91  1.1      fvdl #define	NFSERR_REMOTE		71	/* Version 3 only */
     92  1.1      fvdl #define	NFSERR_WFLUSH		99	/* Version 2 only */
     93  1.1      fvdl #define	NFSERR_BADHANDLE	10001	/* The rest Version 3 only */
     94  1.1      fvdl #define	NFSERR_NOT_SYNC		10002
     95  1.1      fvdl #define	NFSERR_BAD_COOKIE	10003
     96  1.1      fvdl #define	NFSERR_NOTSUPP		10004
     97  1.1      fvdl #define	NFSERR_TOOSMALL		10005
     98  1.1      fvdl #define	NFSERR_SERVERFAULT	10006
     99  1.1      fvdl #define	NFSERR_BADTYPE		10007
    100  1.1      fvdl #define	NFSERR_JUKEBOX		10008
    101  1.1      fvdl #define NFSERR_TRYLATER		NFSERR_JUKEBOX
    102  1.1      fvdl #define	NFSERR_STALEWRITEVERF	30001	/* Fake return for nfs_commit() */
    103  1.1      fvdl 
    104  1.1      fvdl #define NFSERR_RETVOID		0x20000000 /* Return void, not error */
    105  1.1      fvdl #define NFSERR_AUTHERR		0x40000000 /* Mark an authentication error */
    106  1.1      fvdl #define NFSERR_RETERR		0x80000000 /* Mark an error return for V3 */
    107  1.1      fvdl 
    108  1.1      fvdl /* Sizes in bytes of various nfs rpc components */
    109  1.1      fvdl #define	NFSX_UNSIGNED	4
    110  1.1      fvdl 
    111  1.1      fvdl /* specific to NFS Version 2 */
    112  1.1      fvdl #define	NFSX_V2FH	32
    113  1.1      fvdl #define	NFSX_V2FATTR	68
    114  1.1      fvdl #define	NFSX_V2SATTR	32
    115  1.1      fvdl #define	NFSX_V2COOKIE	4
    116  1.1      fvdl #define NFSX_V2STATFS	20
    117  1.1      fvdl 
    118  1.1      fvdl /* specific to NFS Version 3 */
    119  1.1      fvdl #define NFSX_V3FH		(sizeof (fhandle_t)) /* size this server uses */
    120  1.1      fvdl #define	NFSX_V3FHMAX		64	/* max. allowed by protocol */
    121  1.1      fvdl #define NFSX_V3FATTR		84
    122  1.1      fvdl #define NFSX_V3SATTR		60	/* max. all fields filled in */
    123  1.1      fvdl #define NFSX_V3SRVSATTR		(sizeof (struct nfsv3_sattr))
    124  1.1      fvdl #define NFSX_V3POSTOPATTR	(NFSX_V3FATTR + NFSX_UNSIGNED)
    125  1.1      fvdl #define NFSX_V3WCCDATA		(NFSX_V3POSTOPATTR + 8 * NFSX_UNSIGNED)
    126  1.1      fvdl #define NFSX_V3COOKIEVERF 	8
    127  1.1      fvdl #define NFSX_V3WRITEVERF 	8
    128  1.1      fvdl #define NFSX_V3CREATEVERF	8
    129  1.1      fvdl #define NFSX_V3STATFS		52
    130  1.1      fvdl #define NFSX_V3FSINFO		48
    131  1.1      fvdl #define NFSX_V3PATHCONF		24
    132  1.1      fvdl 
    133  1.1      fvdl /* variants for both versions */
    134  1.1      fvdl #define NFSX_FH(v3)		((v3) ? (NFSX_V3FHMAX + NFSX_UNSIGNED) : \
    135  1.1      fvdl 					NFSX_V2FH)
    136  1.1      fvdl #define NFSX_SRVFH(v3)		((v3) ? NFSX_V3FH : NFSX_V2FH)
    137  1.1      fvdl #define	NFSX_FATTR(v3)		((v3) ? NFSX_V3FATTR : NFSX_V2FATTR)
    138  1.1      fvdl #define NFSX_PREOPATTR(v3)	((v3) ? (7 * NFSX_UNSIGNED) : 0)
    139  1.1      fvdl #define NFSX_POSTOPATTR(v3)	((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : 0)
    140  1.1      fvdl #define NFSX_POSTOPORFATTR(v3)	((v3) ? (NFSX_V3FATTR + NFSX_UNSIGNED) : \
    141  1.1      fvdl 					NFSX_V2FATTR)
    142  1.1      fvdl #define NFSX_WCCDATA(v3)	((v3) ? NFSX_V3WCCDATA : 0)
    143  1.1      fvdl #define NFSX_WCCORFATTR(v3)	((v3) ? NFSX_V3WCCDATA : NFSX_V2FATTR)
    144  1.1      fvdl #define	NFSX_SATTR(v3)		((v3) ? NFSX_V3SATTR : NFSX_V2SATTR)
    145  1.1      fvdl #define	NFSX_COOKIEVERF(v3)	((v3) ? NFSX_V3COOKIEVERF : 0)
    146  1.1      fvdl #define	NFSX_WRITEVERF(v3)	((v3) ? NFSX_V3WRITEVERF : 0)
    147  1.1      fvdl #define NFSX_READDIR(v3)	((v3) ? (5 * NFSX_UNSIGNED) : \
    148  1.1      fvdl 					(2 * NFSX_UNSIGNED))
    149  1.1      fvdl #define	NFSX_STATFS(v3)		((v3) ? NFSX_V3STATFS : NFSX_V2STATFS)
    150  1.1      fvdl 
    151  1.1      fvdl /* nfs rpc procedure numbers (before version mapping) */
    152  1.1      fvdl #define	NFSPROC_NULL		0
    153  1.1      fvdl #define	NFSPROC_GETATTR		1
    154  1.1      fvdl #define	NFSPROC_SETATTR		2
    155  1.1      fvdl #define	NFSPROC_LOOKUP		3
    156  1.1      fvdl #define	NFSPROC_ACCESS		4
    157  1.1      fvdl #define	NFSPROC_READLINK	5
    158  1.1      fvdl #define	NFSPROC_READ		6
    159  1.1      fvdl #define	NFSPROC_WRITE		7
    160  1.1      fvdl #define	NFSPROC_CREATE		8
    161  1.1      fvdl #define	NFSPROC_MKDIR		9
    162  1.1      fvdl #define	NFSPROC_SYMLINK		10
    163  1.1      fvdl #define	NFSPROC_MKNOD		11
    164  1.1      fvdl #define	NFSPROC_REMOVE		12
    165  1.1      fvdl #define	NFSPROC_RMDIR		13
    166  1.1      fvdl #define	NFSPROC_RENAME		14
    167  1.1      fvdl #define	NFSPROC_LINK		15
    168  1.1      fvdl #define	NFSPROC_READDIR		16
    169  1.1      fvdl #define	NFSPROC_READDIRPLUS	17
    170  1.1      fvdl #define	NFSPROC_FSSTAT		18
    171  1.1      fvdl #define	NFSPROC_FSINFO		19
    172  1.1      fvdl #define	NFSPROC_PATHCONF	20
    173  1.1      fvdl #define	NFSPROC_COMMIT		21
    174  1.1      fvdl 
    175  1.1      fvdl /* And leasing (nqnfs) procedure numbers (must be last) */
    176  1.1      fvdl #define	NQNFSPROC_GETLEASE	22
    177  1.1      fvdl #define	NQNFSPROC_VACATED	23
    178  1.1      fvdl #define	NQNFSPROC_EVICTED	24
    179  1.1      fvdl 
    180  1.1      fvdl #define NFSPROC_NOOP		25
    181  1.1      fvdl #define	NFS_NPROCS		26
    182  1.1      fvdl 
    183  1.1      fvdl /* Actual Version 2 procedure numbers */
    184  1.1      fvdl #define	NFSV2PROC_NULL		0
    185  1.1      fvdl #define	NFSV2PROC_GETATTR	1
    186  1.1      fvdl #define	NFSV2PROC_SETATTR	2
    187  1.1      fvdl #define	NFSV2PROC_NOOP		3
    188  1.1      fvdl #define	NFSV2PROC_ROOT		NFSV2PROC_NOOP	/* Obsolete */
    189  1.1      fvdl #define	NFSV2PROC_LOOKUP	4
    190  1.1      fvdl #define	NFSV2PROC_READLINK	5
    191  1.1      fvdl #define	NFSV2PROC_READ		6
    192  1.1      fvdl #define	NFSV2PROC_WRITECACHE	NFSV2PROC_NOOP	/* Obsolete */
    193  1.1      fvdl #define	NFSV2PROC_WRITE		8
    194  1.1      fvdl #define	NFSV2PROC_CREATE	9
    195  1.1      fvdl #define	NFSV2PROC_REMOVE	10
    196  1.1      fvdl #define	NFSV2PROC_RENAME	11
    197  1.1      fvdl #define	NFSV2PROC_LINK		12
    198  1.1      fvdl #define	NFSV2PROC_SYMLINK	13
    199  1.1      fvdl #define	NFSV2PROC_MKDIR		14
    200  1.1      fvdl #define	NFSV2PROC_RMDIR		15
    201  1.1      fvdl #define	NFSV2PROC_READDIR	16
    202  1.1      fvdl #define	NFSV2PROC_STATFS	17
    203  1.1      fvdl 
    204  1.1      fvdl /*
    205  1.1      fvdl  * Constants used by the Version 3 protocol for various RPCs
    206  1.1      fvdl  */
    207  1.1      fvdl #define NFSV3SATTRTIME_DONTCHANGE	0
    208  1.1      fvdl #define NFSV3SATTRTIME_TOSERVER		1
    209  1.1      fvdl #define NFSV3SATTRTIME_TOCLIENT		2
    210  1.1      fvdl 
    211  1.1      fvdl #define NFSV3ACCESS_READ		0x01
    212  1.1      fvdl #define NFSV3ACCESS_LOOKUP		0x02
    213  1.1      fvdl #define NFSV3ACCESS_MODIFY		0x04
    214  1.1      fvdl #define NFSV3ACCESS_EXTEND		0x08
    215  1.1      fvdl #define NFSV3ACCESS_DELETE		0x10
    216  1.1      fvdl #define NFSV3ACCESS_EXECUTE		0x20
    217  1.1      fvdl 
    218  1.1      fvdl #define NFSV3WRITE_UNSTABLE		0
    219  1.1      fvdl #define NFSV3WRITE_DATASYNC		1
    220  1.1      fvdl #define NFSV3WRITE_FILESYNC		2
    221  1.1      fvdl 
    222  1.1      fvdl #define NFSV3CREATE_UNCHECKED		0
    223  1.1      fvdl #define NFSV3CREATE_GUARDED		1
    224  1.1      fvdl #define NFSV3CREATE_EXCLUSIVE		2
    225  1.1      fvdl 
    226  1.1      fvdl #define NFSV3FSINFO_LINK		0x01
    227  1.1      fvdl #define NFSV3FSINFO_SYMLINK		0x02
    228  1.1      fvdl #define NFSV3FSINFO_HOMOGENEOUS		0x08
    229  1.1      fvdl #define NFSV3FSINFO_CANSETTIME		0x10
    230  1.1      fvdl 
    231  1.1      fvdl /* Conversion macros */
    232  1.1      fvdl #define	vtonfsv2_mode(t,m) \
    233  1.1      fvdl 		txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : \
    234  1.1      fvdl 				MAKEIMODE((t), (m)))
    235  1.2   mycroft #define vtonfsv3_mode(m)	txdr_unsigned((m) & ALLPERMS)
    236  1.5  christos #define	nfstov_mode(a)		(fxdr_unsigned(u_int32_t, (a)) & ALLPERMS)
    237  1.1      fvdl #define	vtonfsv2_type(a)	txdr_unsigned(nfsv2_type[((int32_t)(a))])
    238  1.1      fvdl #define	vtonfsv3_type(a)	txdr_unsigned(nfsv3_type[((int32_t)(a))])
    239  1.1      fvdl #define	nfsv2tov_type(a)	nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
    240  1.1      fvdl #define	nfsv3tov_type(a)	nv3tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]
    241  1.1      fvdl 
    242  1.1      fvdl /* File types */
    243  1.1      fvdl typedef enum { NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5,
    244  1.1      fvdl 	NFSOCK=6, NFFIFO=7 } nfstype;
    245  1.1      fvdl 
    246  1.1      fvdl /* Structs for common parts of the rpc's */
    247  1.1      fvdl /*
    248  1.1      fvdl  * File Handle (32 bytes for version 2), variable up to 64 for version 3.
    249  1.1      fvdl  * File Handles of up to NFS_SMALLFH in size are stored directly in the
    250  1.1      fvdl  * nfs node, whereas larger ones are malloc'd. (This never happens when
    251  1.1      fvdl  * NFS_SMALLFH is set to 64.)
    252  1.1      fvdl  * NFS_SMALLFH should be in the range of 32 to 64 and be divisible by 4.
    253  1.1      fvdl  */
    254  1.1      fvdl #ifndef NFS_SMALLFH
    255  1.5  christos #define NFS_SMALLFH	38
    256  1.1      fvdl #endif
    257  1.1      fvdl union nfsfh {
    258  1.1      fvdl 	fhandle_t fh_generic;
    259  1.1      fvdl 	u_char    fh_bytes[NFS_SMALLFH];
    260  1.1      fvdl };
    261  1.1      fvdl typedef union nfsfh nfsfh_t;
    262  1.1      fvdl 
    263  1.1      fvdl struct nfsv2_time {
    264  1.1      fvdl 	u_int32_t nfsv2_sec;
    265  1.1      fvdl 	u_int32_t nfsv2_usec;
    266  1.1      fvdl };
    267  1.1      fvdl typedef struct nfsv2_time	nfstime2;
    268  1.1      fvdl 
    269  1.1      fvdl struct nfsv3_time {
    270  1.1      fvdl 	u_int32_t nfsv3_sec;
    271  1.1      fvdl 	u_int32_t nfsv3_nsec;
    272  1.1      fvdl };
    273  1.1      fvdl typedef struct nfsv3_time	nfstime3;
    274  1.1      fvdl 
    275  1.1      fvdl /*
    276  1.1      fvdl  * Quads are defined as arrays of 2 longs to ensure dense packing for the
    277  1.1      fvdl  * protocol and to facilitate xdr conversion.
    278  1.1      fvdl  */
    279  1.1      fvdl struct nfs_uquad {
    280  1.1      fvdl 	u_int32_t nfsuquad[2];
    281  1.1      fvdl };
    282  1.1      fvdl typedef	struct nfs_uquad	nfsuint64;
    283  1.1      fvdl 
    284  1.1      fvdl /*
    285  1.1      fvdl  * Used to convert between two u_longs and a u_quad_t.
    286  1.1      fvdl  */
    287  1.1      fvdl union nfs_quadconvert {
    288  1.1      fvdl 	u_int32_t lval[2];
    289  1.1      fvdl 	u_quad_t  qval;
    290  1.1      fvdl };
    291  1.1      fvdl typedef union nfs_quadconvert	nfsquad_t;
    292  1.1      fvdl 
    293  1.1      fvdl /*
    294  1.1      fvdl  * NFS Version 3 special file number.
    295  1.1      fvdl  */
    296  1.1      fvdl struct nfsv3_spec {
    297  1.1      fvdl 	u_int32_t specdata1;
    298  1.1      fvdl 	u_int32_t specdata2;
    299  1.1      fvdl };
    300  1.1      fvdl typedef	struct nfsv3_spec	nfsv3spec;
    301  1.1      fvdl 
    302  1.1      fvdl /*
    303  1.1      fvdl  * File attributes and setable attributes. These structures cover both
    304  1.1      fvdl  * NFS version 2 and the version 3 protocol. Note that the union is only
    305  1.1      fvdl  * used so that one pointer can refer to both variants. These structures
    306  1.1      fvdl  * go out on the wire and must be densely packed, so no quad data types
    307  1.1      fvdl  * are used. (all fields are longs or u_longs or structures of same)
    308  1.1      fvdl  * NB: You can't do sizeof(struct nfs_fattr), you must use the
    309  1.1      fvdl  *     NFSX_FATTR(v3) macro.
    310  1.1      fvdl  */
    311  1.1      fvdl struct nfs_fattr {
    312  1.1      fvdl 	u_int32_t fa_type;
    313  1.1      fvdl 	u_int32_t fa_mode;
    314  1.1      fvdl 	u_int32_t fa_nlink;
    315  1.1      fvdl 	u_int32_t fa_uid;
    316  1.1      fvdl 	u_int32_t fa_gid;
    317  1.1      fvdl 	union {
    318  1.1      fvdl 		struct {
    319  1.1      fvdl 			u_int32_t nfsv2fa_size;
    320  1.1      fvdl 			u_int32_t nfsv2fa_blocksize;
    321  1.1      fvdl 			u_int32_t nfsv2fa_rdev;
    322  1.1      fvdl 			u_int32_t nfsv2fa_blocks;
    323  1.1      fvdl 			u_int32_t nfsv2fa_fsid;
    324  1.1      fvdl 			u_int32_t nfsv2fa_fileid;
    325  1.1      fvdl 			nfstime2  nfsv2fa_atime;
    326  1.1      fvdl 			nfstime2  nfsv2fa_mtime;
    327  1.1      fvdl 			nfstime2  nfsv2fa_ctime;
    328  1.1      fvdl 		} fa_nfsv2;
    329  1.1      fvdl 		struct {
    330  1.1      fvdl 			nfsuint64 nfsv3fa_size;
    331  1.1      fvdl 			nfsuint64 nfsv3fa_used;
    332  1.1      fvdl 			nfsv3spec nfsv3fa_rdev;
    333  1.1      fvdl 			nfsuint64 nfsv3fa_fsid;
    334  1.1      fvdl 			nfsuint64 nfsv3fa_fileid;
    335  1.1      fvdl 			nfstime3  nfsv3fa_atime;
    336  1.1      fvdl 			nfstime3  nfsv3fa_mtime;
    337  1.1      fvdl 			nfstime3  nfsv3fa_ctime;
    338  1.1      fvdl 		} fa_nfsv3;
    339  1.1      fvdl 	} fa_un;
    340  1.1      fvdl };
    341  1.1      fvdl 
    342  1.1      fvdl /* and some ugly defines for accessing union components */
    343  1.1      fvdl #define	fa2_size		fa_un.fa_nfsv2.nfsv2fa_size
    344  1.1      fvdl #define	fa2_blocksize		fa_un.fa_nfsv2.nfsv2fa_blocksize
    345  1.1      fvdl #define	fa2_rdev		fa_un.fa_nfsv2.nfsv2fa_rdev
    346  1.1      fvdl #define	fa2_blocks		fa_un.fa_nfsv2.nfsv2fa_blocks
    347  1.1      fvdl #define	fa2_fsid		fa_un.fa_nfsv2.nfsv2fa_fsid
    348  1.1      fvdl #define	fa2_fileid		fa_un.fa_nfsv2.nfsv2fa_fileid
    349  1.1      fvdl #define	fa2_atime		fa_un.fa_nfsv2.nfsv2fa_atime
    350  1.1      fvdl #define	fa2_mtime		fa_un.fa_nfsv2.nfsv2fa_mtime
    351  1.1      fvdl #define	fa2_ctime		fa_un.fa_nfsv2.nfsv2fa_ctime
    352  1.1      fvdl #define	fa3_size		fa_un.fa_nfsv3.nfsv3fa_size
    353  1.1      fvdl #define	fa3_used		fa_un.fa_nfsv3.nfsv3fa_used
    354  1.1      fvdl #define	fa3_rdev		fa_un.fa_nfsv3.nfsv3fa_rdev
    355  1.1      fvdl #define	fa3_fsid		fa_un.fa_nfsv3.nfsv3fa_fsid
    356  1.1      fvdl #define	fa3_fileid		fa_un.fa_nfsv3.nfsv3fa_fileid
    357  1.1      fvdl #define	fa3_atime		fa_un.fa_nfsv3.nfsv3fa_atime
    358  1.1      fvdl #define	fa3_mtime		fa_un.fa_nfsv3.nfsv3fa_mtime
    359  1.1      fvdl #define	fa3_ctime		fa_un.fa_nfsv3.nfsv3fa_ctime
    360  1.1      fvdl 
    361  1.1      fvdl struct nfsv2_sattr {
    362  1.1      fvdl 	u_int32_t sa_mode;
    363  1.1      fvdl 	u_int32_t sa_uid;
    364  1.1      fvdl 	u_int32_t sa_gid;
    365  1.1      fvdl 	u_int32_t sa_size;
    366  1.1      fvdl 	nfstime2  sa_atime;
    367  1.1      fvdl 	nfstime2  sa_mtime;
    368  1.1      fvdl };
    369  1.1      fvdl 
    370  1.1      fvdl /*
    371  1.1      fvdl  * NFS Version 3 sattr structure for the new node creation case.
    372  1.1      fvdl  */
    373  1.1      fvdl struct nfsv3_sattr {
    374  1.1      fvdl 	u_int32_t sa_modetrue;
    375  1.1      fvdl 	u_int32_t sa_mode;
    376  1.1      fvdl 	u_int32_t sa_uidfalse;
    377  1.1      fvdl 	u_int32_t sa_gidfalse;
    378  1.1      fvdl 	u_int32_t sa_sizefalse;
    379  1.1      fvdl 	u_int32_t sa_atimetype;
    380  1.1      fvdl 	nfstime3  sa_atime;
    381  1.1      fvdl 	u_int32_t sa_mtimetype;
    382  1.1      fvdl 	nfstime3  sa_mtime;
    383  1.1      fvdl };
    384  1.1      fvdl 
    385  1.1      fvdl struct nfs_statfs {
    386  1.1      fvdl 	union {
    387  1.1      fvdl 		struct {
    388  1.1      fvdl 			u_int32_t nfsv2sf_tsize;
    389  1.1      fvdl 			u_int32_t nfsv2sf_bsize;
    390  1.1      fvdl 			u_int32_t nfsv2sf_blocks;
    391  1.1      fvdl 			u_int32_t nfsv2sf_bfree;
    392  1.1      fvdl 			u_int32_t nfsv2sf_bavail;
    393  1.1      fvdl 		} sf_nfsv2;
    394  1.1      fvdl 		struct {
    395  1.1      fvdl 			nfsuint64 nfsv3sf_tbytes;
    396  1.1      fvdl 			nfsuint64 nfsv3sf_fbytes;
    397  1.1      fvdl 			nfsuint64 nfsv3sf_abytes;
    398  1.1      fvdl 			nfsuint64 nfsv3sf_tfiles;
    399  1.1      fvdl 			nfsuint64 nfsv3sf_ffiles;
    400  1.1      fvdl 			nfsuint64 nfsv3sf_afiles;
    401  1.1      fvdl 			u_int32_t nfsv3sf_invarsec;
    402  1.1      fvdl 		} sf_nfsv3;
    403  1.1      fvdl 	} sf_un;
    404  1.1      fvdl };
    405  1.1      fvdl 
    406  1.1      fvdl #define sf_tsize	sf_un.sf_nfsv2.nfsv2sf_tsize
    407  1.1      fvdl #define sf_bsize	sf_un.sf_nfsv2.nfsv2sf_bsize
    408  1.1      fvdl #define sf_blocks	sf_un.sf_nfsv2.nfsv2sf_blocks
    409  1.1      fvdl #define sf_bfree	sf_un.sf_nfsv2.nfsv2sf_bfree
    410  1.1      fvdl #define sf_bavail	sf_un.sf_nfsv2.nfsv2sf_bavail
    411  1.1      fvdl #define sf_tbytes	sf_un.sf_nfsv3.nfsv3sf_tbytes
    412  1.1      fvdl #define sf_fbytes	sf_un.sf_nfsv3.nfsv3sf_fbytes
    413  1.1      fvdl #define sf_abytes	sf_un.sf_nfsv3.nfsv3sf_abytes
    414  1.1      fvdl #define sf_tfiles	sf_un.sf_nfsv3.nfsv3sf_tfiles
    415  1.1      fvdl #define sf_ffiles	sf_un.sf_nfsv3.nfsv3sf_ffiles
    416  1.1      fvdl #define sf_afiles	sf_un.sf_nfsv3.nfsv3sf_afiles
    417  1.1      fvdl #define sf_invarsec	sf_un.sf_nfsv3.nfsv3sf_invarsec
    418  1.1      fvdl 
    419  1.1      fvdl struct nfsv3_fsinfo {
    420  1.1      fvdl 	u_int32_t fs_rtmax;
    421  1.1      fvdl 	u_int32_t fs_rtpref;
    422  1.1      fvdl 	u_int32_t fs_rtmult;
    423  1.1      fvdl 	u_int32_t fs_wtmax;
    424  1.1      fvdl 	u_int32_t fs_wtpref;
    425  1.1      fvdl 	u_int32_t fs_wtmult;
    426  1.1      fvdl 	u_int32_t fs_dtpref;
    427  1.1      fvdl 	nfsuint64 fs_maxfilesize;
    428  1.1      fvdl 	nfstime3  fs_timedelta;
    429  1.1      fvdl 	u_int32_t fs_properties;
    430  1.1      fvdl };
    431  1.1      fvdl 
    432  1.1      fvdl struct nfsv3_pathconf {
    433  1.1      fvdl 	u_int32_t pc_linkmax;
    434  1.1      fvdl 	u_int32_t pc_namemax;
    435  1.1      fvdl 	u_int32_t pc_notrunc;
    436  1.1      fvdl 	u_int32_t pc_chownrestricted;
    437  1.1      fvdl 	u_int32_t pc_caseinsensitive;
    438  1.1      fvdl 	u_int32_t pc_casepreserving;
    439  1.1      fvdl };
    440  1.1      fvdl 
    441  1.1      fvdl #endif
    442