xref: /titanic_44/usr/src/uts/common/nfs/mount.h (revision a576ab5b6e08c47732b3dedca9eaa8a8cbb85720)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 /*
27  *	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
28  *		All Rights Reserved
29  */
30 
31 #ifndef	_NFS_MOUNT_H
32 #define	_NFS_MOUNT_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #include <sys/pathconf.h>			/* static pathconf kludge */
41 
42 
43 #define	NFS_ARGS_EXTA	1
44 #define	NFS_ARGS_EXTB	2
45 
46 /*
47  * extension data for nfs_args_ext == NFS_ARGS_EXTA.
48  */
49 struct nfs_args_extA {
50 	struct sec_data		*secdata;	/* security data */
51 };
52 
53 /*
54  * extension data for nfs_args_ext == NFS_ARGS_EXTB.
55  */
56 struct nfs_args_extB {
57 	struct sec_data		*secdata;	/* security data */
58 	struct nfs_args		*next;		/* link for failover */
59 };
60 
61 /*
62  * Union structure for future extension.
63  */
64 union nfs_ext {
65 	struct nfs_args_extA	nfs_extA;	/* nfs_args extension v1 */
66 	struct nfs_args_extB	nfs_extB;	/* nfs_args extension v2 */
67 };
68 
69 struct nfs_args {
70 	struct netbuf		*addr;		/* file server address */
71 	struct netbuf		*syncaddr;	/* secure NFS time sync addr */
72 	struct knetconfig	*knconf;	/* transport netconfig struct */
73 	char			*hostname;	/* server's hostname */
74 	char			*netname;	/* server's netname */
75 	caddr_t			fh;		/* File handle to be mounted */
76 	int			flags;		/* flags */
77 	int			wsize;		/* write size in bytes */
78 	int			rsize;		/* read size in bytes */
79 	int			timeo;		/* initial timeout in .1 secs */
80 	int			retrans;	/* times to retry send */
81 	int			acregmin;	/* attr cache file min secs */
82 	int			acregmax;	/* attr cache file max secs */
83 	int			acdirmin;	/* attr cache dir min secs */
84 	int			acdirmax;	/* attr cache dir max secs */
85 	struct pathcnf		*pathconf;	/* static pathconf kludge */
86 	int			nfs_args_ext;	/* the nfs_args extension id */
87 	union nfs_ext		nfs_ext_u;	/* extension union structure */
88 };
89 
90 #ifdef _SYSCALL32
91 struct nfs_args_extA32 {
92 	caddr32_t		secdata;	/* security data */
93 };
94 
95 struct nfs_args_extB32 {
96 	caddr32_t		secdata;	/* security data */
97 	caddr32_t		next;		/* link for failover */
98 };
99 
100 union nfs_ext32 {
101 	struct nfs_args_extA32	nfs_extA;	/* nfs_args extension v1 */
102 	struct nfs_args_extB32	nfs_extB;	/* nfs_args extension v2 */
103 };
104 
105 struct nfs_args32 {
106 	caddr32_t		addr;		/* file server address */
107 	caddr32_t		syncaddr;	/* secure NFS time sync addr */
108 	caddr32_t		knconf;		/* transport netconfig struct */
109 	caddr32_t		hostname;	/* server's hostname */
110 	caddr32_t		netname;	/* server's netname */
111 	caddr32_t		fh;		/* File handle to be mounted */
112 	int32_t			flags;		/* flags */
113 	int32_t			wsize;		/* write size in bytes */
114 	int32_t			rsize;		/* read size in bytes */
115 	int32_t			timeo;		/* initial timeout in .1 secs */
116 	int32_t			retrans;	/* times to retry send */
117 	int32_t			acregmin;	/* attr cache file min secs */
118 	int32_t			acregmax;	/* attr cache file max secs */
119 	int32_t			acdirmin;	/* attr cache dir min secs */
120 	int32_t			acdirmax;	/* attr cache dir max secs */
121 	caddr32_t		pathconf;	/* static pathconf kludge */
122 	int32_t			nfs_args_ext;	/* the nfs_args extension id */
123 	union nfs_ext32		nfs_ext_u;	/* extension union structure */
124 };
125 #endif /* _SYSCALL32 */
126 
127 /*
128  * NFS mount option flags
129  */
130 #define	NFSMNT_SOFT		0x001	/* soft mount (hard is default) */
131 #define	NFSMNT_WSIZE		0x002	/* set write size */
132 #define	NFSMNT_RSIZE		0x004	/* set read size */
133 #define	NFSMNT_TIMEO		0x008	/* set initial timeout */
134 #define	NFSMNT_RETRANS		0x010	/* set number of request retrys */
135 #define	NFSMNT_HOSTNAME		0x020	/* set hostname for error printf */
136 #define	NFSMNT_INT		0x040	/* allow interrupts on hard mount */
137 #define	NFSMNT_NOAC		0x080	/* don't cache attributes */
138 #define	NFSMNT_ACREGMIN		0x0100	/* set min secs for file attr cache */
139 #define	NFSMNT_ACREGMAX		0x0200	/* set max secs for file attr cache */
140 #define	NFSMNT_ACDIRMIN		0x0400	/* set min secs for dir attr cache */
141 #define	NFSMNT_ACDIRMAX		0x0800	/* set max secs for dir attr cache */
142 #define	NFSMNT_SECURE		0x1000	/* secure mount */
143 #define	NFSMNT_NOCTO		0x2000	/* no close-to-open consistency */
144 #define	NFSMNT_KNCONF		0x4000	/* transport's knetconfig structure */
145 #define	NFSMNT_GRPID		0x8000	/* System V-style gid inheritance */
146 #define	NFSMNT_RPCTIMESYNC	0x10000	/* use RPC to do secure NFS time sync */
147 #define	NFSMNT_KERBEROS		0x20000	/* use kerberos credentials */
148 #define	NFSMNT_POSIX		0x40000 /* static pathconf kludge info */
149 #define	NFSMNT_LLOCK		0x80000	/* Local locking (no lock manager) */
150 #define	NFSMNT_LOOPBACK		0x100000 /* Is a loopback mount */
151 #define	NFSMNT_SEMISOFT		0x200000 /* read soft, modify hard */
152 #define	NFSMNT_NOPRINT		0x400000 /* don't print messages */
153 #define	NFSMNT_NEWARGS		0x800000 /* using nfs_args extented structure */
154 #define	NFSMNT_DIRECTIO		0x1000000 /* do direct I/O */
155 #define	NFSMNT_PUBLIC		0x2000000 /* mount was done with url/public */
156 #define	NFSMNT_SECDEFAULT	0x4000000 /* mount using default sec flavor */
157 #define	NFSMNT_TRYRDMA		0x8000000 /* Try RDMA mount,no proto advised */
158 #define	NFSMNT_DORDMA		0x10000000 /* Do an RDMA mount, regardless */
159 #define	NFSMNT_MIRRORMOUNT	0x20000000 /* Is a mirrormount */
160 
161 /*
162  * This will have to change when we do referrals.
163  */
164 #define	NFSMNT_EPHEMERAL	NFSMNT_MIRRORMOUNT
165 
166 #ifdef	__cplusplus
167 }
168 #endif
169 
170 #endif	/* _NFS_MOUNT_H */
171