xref: /illumos-gate/usr/src/uts/common/nfs/mount.h (revision 2f172c55ef76964744bc62b4500ece87f3089b4d)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5b9238976Sth199096  * Common Development and Distribution License (the "License").
6b9238976Sth199096  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*2f172c55SRobert Thurlow  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate /*
277c478bd9Sstevel@tonic-gate  *	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
287c478bd9Sstevel@tonic-gate  *		All Rights Reserved
297c478bd9Sstevel@tonic-gate  */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifndef	_NFS_MOUNT_H
327c478bd9Sstevel@tonic-gate #define	_NFS_MOUNT_H
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #include <sys/pathconf.h>			/* static pathconf kludge */
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate 
417c478bd9Sstevel@tonic-gate #define	NFS_ARGS_EXTA	1
427c478bd9Sstevel@tonic-gate #define	NFS_ARGS_EXTB	2
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * extension data for nfs_args_ext == NFS_ARGS_EXTA.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate struct nfs_args_extA {
487c478bd9Sstevel@tonic-gate 	struct sec_data		*secdata;	/* security data */
497c478bd9Sstevel@tonic-gate };
507c478bd9Sstevel@tonic-gate 
517c478bd9Sstevel@tonic-gate /*
527c478bd9Sstevel@tonic-gate  * extension data for nfs_args_ext == NFS_ARGS_EXTB.
537c478bd9Sstevel@tonic-gate  */
547c478bd9Sstevel@tonic-gate struct nfs_args_extB {
557c478bd9Sstevel@tonic-gate 	struct sec_data		*secdata;	/* security data */
567c478bd9Sstevel@tonic-gate 	struct nfs_args		*next;		/* link for failover */
577c478bd9Sstevel@tonic-gate };
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate /*
607c478bd9Sstevel@tonic-gate  * Union structure for future extension.
617c478bd9Sstevel@tonic-gate  */
627c478bd9Sstevel@tonic-gate union nfs_ext {
637c478bd9Sstevel@tonic-gate 	struct nfs_args_extA	nfs_extA;	/* nfs_args extension v1 */
647c478bd9Sstevel@tonic-gate 	struct nfs_args_extB	nfs_extB;	/* nfs_args extension v2 */
657c478bd9Sstevel@tonic-gate };
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate struct nfs_args {
687c478bd9Sstevel@tonic-gate 	struct netbuf		*addr;		/* file server address */
697c478bd9Sstevel@tonic-gate 	struct netbuf		*syncaddr;	/* secure NFS time sync addr */
707c478bd9Sstevel@tonic-gate 	struct knetconfig	*knconf;	/* transport netconfig struct */
717c478bd9Sstevel@tonic-gate 	char			*hostname;	/* server's hostname */
727c478bd9Sstevel@tonic-gate 	char			*netname;	/* server's netname */
737c478bd9Sstevel@tonic-gate 	caddr_t			fh;		/* File handle to be mounted */
747c478bd9Sstevel@tonic-gate 	int			flags;		/* flags */
757c478bd9Sstevel@tonic-gate 	int			wsize;		/* write size in bytes */
767c478bd9Sstevel@tonic-gate 	int			rsize;		/* read size in bytes */
777c478bd9Sstevel@tonic-gate 	int			timeo;		/* initial timeout in .1 secs */
787c478bd9Sstevel@tonic-gate 	int			retrans;	/* times to retry send */
797c478bd9Sstevel@tonic-gate 	int			acregmin;	/* attr cache file min secs */
807c478bd9Sstevel@tonic-gate 	int			acregmax;	/* attr cache file max secs */
817c478bd9Sstevel@tonic-gate 	int			acdirmin;	/* attr cache dir min secs */
827c478bd9Sstevel@tonic-gate 	int			acdirmax;	/* attr cache dir max secs */
837c478bd9Sstevel@tonic-gate 	struct pathcnf		*pathconf;	/* static pathconf kludge */
847c478bd9Sstevel@tonic-gate 	int			nfs_args_ext;	/* the nfs_args extension id */
857c478bd9Sstevel@tonic-gate 	union nfs_ext		nfs_ext_u;	/* extension union structure */
867c478bd9Sstevel@tonic-gate };
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32
897c478bd9Sstevel@tonic-gate struct nfs_args_extA32 {
907c478bd9Sstevel@tonic-gate 	caddr32_t		secdata;	/* security data */
917c478bd9Sstevel@tonic-gate };
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate struct nfs_args_extB32 {
947c478bd9Sstevel@tonic-gate 	caddr32_t		secdata;	/* security data */
957c478bd9Sstevel@tonic-gate 	caddr32_t		next;		/* link for failover */
967c478bd9Sstevel@tonic-gate };
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate union nfs_ext32 {
997c478bd9Sstevel@tonic-gate 	struct nfs_args_extA32	nfs_extA;	/* nfs_args extension v1 */
1007c478bd9Sstevel@tonic-gate 	struct nfs_args_extB32	nfs_extB;	/* nfs_args extension v2 */
1017c478bd9Sstevel@tonic-gate };
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate struct nfs_args32 {
1047c478bd9Sstevel@tonic-gate 	caddr32_t		addr;		/* file server address */
1057c478bd9Sstevel@tonic-gate 	caddr32_t		syncaddr;	/* secure NFS time sync addr */
1067c478bd9Sstevel@tonic-gate 	caddr32_t		knconf;		/* transport netconfig struct */
1077c478bd9Sstevel@tonic-gate 	caddr32_t		hostname;	/* server's hostname */
1087c478bd9Sstevel@tonic-gate 	caddr32_t		netname;	/* server's netname */
1097c478bd9Sstevel@tonic-gate 	caddr32_t		fh;		/* File handle to be mounted */
1107c478bd9Sstevel@tonic-gate 	int32_t			flags;		/* flags */
1117c478bd9Sstevel@tonic-gate 	int32_t			wsize;		/* write size in bytes */
1127c478bd9Sstevel@tonic-gate 	int32_t			rsize;		/* read size in bytes */
1137c478bd9Sstevel@tonic-gate 	int32_t			timeo;		/* initial timeout in .1 secs */
1147c478bd9Sstevel@tonic-gate 	int32_t			retrans;	/* times to retry send */
1157c478bd9Sstevel@tonic-gate 	int32_t			acregmin;	/* attr cache file min secs */
1167c478bd9Sstevel@tonic-gate 	int32_t			acregmax;	/* attr cache file max secs */
1177c478bd9Sstevel@tonic-gate 	int32_t			acdirmin;	/* attr cache dir min secs */
1187c478bd9Sstevel@tonic-gate 	int32_t			acdirmax;	/* attr cache dir max secs */
1197c478bd9Sstevel@tonic-gate 	caddr32_t		pathconf;	/* static pathconf kludge */
1207c478bd9Sstevel@tonic-gate 	int32_t			nfs_args_ext;	/* the nfs_args extension id */
1217c478bd9Sstevel@tonic-gate 	union nfs_ext32		nfs_ext_u;	/* extension union structure */
1227c478bd9Sstevel@tonic-gate };
1237c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /*
1267c478bd9Sstevel@tonic-gate  * NFS mount option flags
1277c478bd9Sstevel@tonic-gate  */
1287c478bd9Sstevel@tonic-gate #define	NFSMNT_SOFT		0x001	/* soft mount (hard is default) */
1297c478bd9Sstevel@tonic-gate #define	NFSMNT_WSIZE		0x002	/* set write size */
1307c478bd9Sstevel@tonic-gate #define	NFSMNT_RSIZE		0x004	/* set read size */
1317c478bd9Sstevel@tonic-gate #define	NFSMNT_TIMEO		0x008	/* set initial timeout */
1327c478bd9Sstevel@tonic-gate #define	NFSMNT_RETRANS		0x010	/* set number of request retrys */
1337c478bd9Sstevel@tonic-gate #define	NFSMNT_HOSTNAME		0x020	/* set hostname for error printf */
1347c478bd9Sstevel@tonic-gate #define	NFSMNT_INT		0x040	/* allow interrupts on hard mount */
1357c478bd9Sstevel@tonic-gate #define	NFSMNT_NOAC		0x080	/* don't cache attributes */
1367c478bd9Sstevel@tonic-gate #define	NFSMNT_ACREGMIN		0x0100	/* set min secs for file attr cache */
1377c478bd9Sstevel@tonic-gate #define	NFSMNT_ACREGMAX		0x0200	/* set max secs for file attr cache */
1387c478bd9Sstevel@tonic-gate #define	NFSMNT_ACDIRMIN		0x0400	/* set min secs for dir attr cache */
1397c478bd9Sstevel@tonic-gate #define	NFSMNT_ACDIRMAX		0x0800	/* set max secs for dir attr cache */
1407c478bd9Sstevel@tonic-gate #define	NFSMNT_SECURE		0x1000	/* secure mount */
1417c478bd9Sstevel@tonic-gate #define	NFSMNT_NOCTO		0x2000	/* no close-to-open consistency */
1427c478bd9Sstevel@tonic-gate #define	NFSMNT_KNCONF		0x4000	/* transport's knetconfig structure */
1437c478bd9Sstevel@tonic-gate #define	NFSMNT_GRPID		0x8000	/* System V-style gid inheritance */
1447c478bd9Sstevel@tonic-gate #define	NFSMNT_RPCTIMESYNC	0x10000	/* use RPC to do secure NFS time sync */
1457c478bd9Sstevel@tonic-gate #define	NFSMNT_KERBEROS		0x20000	/* use kerberos credentials */
1467c478bd9Sstevel@tonic-gate #define	NFSMNT_POSIX		0x40000 /* static pathconf kludge info */
1477c478bd9Sstevel@tonic-gate #define	NFSMNT_LLOCK		0x80000	/* Local locking (no lock manager) */
1487c478bd9Sstevel@tonic-gate #define	NFSMNT_LOOPBACK		0x100000 /* Is a loopback mount */
1497c478bd9Sstevel@tonic-gate #define	NFSMNT_SEMISOFT		0x200000 /* read soft, modify hard */
1507c478bd9Sstevel@tonic-gate #define	NFSMNT_NOPRINT		0x400000 /* don't print messages */
1517c478bd9Sstevel@tonic-gate #define	NFSMNT_NEWARGS		0x800000 /* using nfs_args extented structure */
1527c478bd9Sstevel@tonic-gate #define	NFSMNT_DIRECTIO		0x1000000 /* do direct I/O */
1537c478bd9Sstevel@tonic-gate #define	NFSMNT_PUBLIC		0x2000000 /* mount was done with url/public */
1547c478bd9Sstevel@tonic-gate #define	NFSMNT_SECDEFAULT	0x4000000 /* mount using default sec flavor */
1557c478bd9Sstevel@tonic-gate #define	NFSMNT_TRYRDMA		0x8000000 /* Try RDMA mount,no proto advised */
1567c478bd9Sstevel@tonic-gate #define	NFSMNT_DORDMA		0x10000000 /* Do an RDMA mount, regardless */
157b9238976Sth199096 #define	NFSMNT_MIRRORMOUNT	0x20000000 /* Is a mirrormount */
158*2f172c55SRobert Thurlow #define	NFSMNT_REFERRAL		0x40000000 /* Is a referral */
159b9238976Sth199096 
160*2f172c55SRobert Thurlow #define	NFSMNT_EPHEMERAL	(NFSMNT_MIRRORMOUNT | NFSMNT_REFERRAL)
1617c478bd9Sstevel@tonic-gate 
1627c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1637c478bd9Sstevel@tonic-gate }
1647c478bd9Sstevel@tonic-gate #endif
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate #endif	/* _NFS_MOUNT_H */
167