xref: /illumos-gate/usr/src/uts/common/sys/fs/autofs.h (revision 780213fb)
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
539d3e169Sevanl  * Common Development and Distribution License (the "License").
639d3e169Sevanl  * 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*780213fbSevanl  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_FS_AUTOFS_H
277c478bd9Sstevel@tonic-gate #define	_SYS_FS_AUTOFS_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
3139d3e169Sevanl #include <rpc/clnt.h>
3239d3e169Sevanl #include <gssapi/gssapi.h>
3339d3e169Sevanl #include <sys/vfs.h>
3439d3e169Sevanl #include <sys/dirent.h>
3539d3e169Sevanl #include <sys/types.h>
3639d3e169Sevanl #include <sys/types32.h>
377c478bd9Sstevel@tonic-gate #include <sys/note.h>
387c478bd9Sstevel@tonic-gate #include <sys/time_impl.h>
397c478bd9Sstevel@tonic-gate #include <sys/mntent.h>
4039d3e169Sevanl #include <nfs/mount.h>
4139d3e169Sevanl #include <rpc/rpcsec_gss.h>
427c478bd9Sstevel@tonic-gate #include <sys/zone.h>
4339d3e169Sevanl #include <sys/door.h>
4439d3e169Sevanl #include <rpcsvc/autofs_prot.h>
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
477c478bd9Sstevel@tonic-gate extern "C" {
487c478bd9Sstevel@tonic-gate #endif
497c478bd9Sstevel@tonic-gate 
5039d3e169Sevanl 
517c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate /*
557c478bd9Sstevel@tonic-gate  * Tracing macro; expands to nothing for non-debug kernels.
567c478bd9Sstevel@tonic-gate  */
577c478bd9Sstevel@tonic-gate #ifndef DEBUG
587c478bd9Sstevel@tonic-gate #define	AUTOFS_DPRINT(x)
597c478bd9Sstevel@tonic-gate #else
607c478bd9Sstevel@tonic-gate #define	AUTOFS_DPRINT(x)	auto_dprint x
617c478bd9Sstevel@tonic-gate #endif
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate /*
647c478bd9Sstevel@tonic-gate  * Per AUTOFS mountpoint information.
657c478bd9Sstevel@tonic-gate  */
667c478bd9Sstevel@tonic-gate typedef struct fninfo {
677c478bd9Sstevel@tonic-gate 	struct vfs	*fi_mountvfs;		/* mounted-here VFS */
687c478bd9Sstevel@tonic-gate 	struct vnode	*fi_rootvp;		/* root vnode */
697c478bd9Sstevel@tonic-gate 	struct knetconfig fi_knconf;		/* netconfig */
707c478bd9Sstevel@tonic-gate 	struct netbuf	fi_addr;		/* daemon address */
717c478bd9Sstevel@tonic-gate 	char		*fi_path;		/* autofs mountpoint */
727c478bd9Sstevel@tonic-gate 	char 		*fi_map;		/* context/map-name */
737c478bd9Sstevel@tonic-gate 	char		*fi_subdir;		/* subdir within map */
747c478bd9Sstevel@tonic-gate 	char		*fi_key;		/* key to use on direct maps */
757c478bd9Sstevel@tonic-gate 	char		*fi_opts;		/* default mount options */
767c478bd9Sstevel@tonic-gate 	int		fi_pathlen;		/* autofs mountpoint len */
777c478bd9Sstevel@tonic-gate 	int		fi_maplen;		/* size of context */
787c478bd9Sstevel@tonic-gate 	int		fi_subdirlen;
797c478bd9Sstevel@tonic-gate 	int		fi_keylen;
807c478bd9Sstevel@tonic-gate 	int		fi_optslen;		/* default mount options len */
817c478bd9Sstevel@tonic-gate 	int		fi_refcnt;		/* reference count */
827c478bd9Sstevel@tonic-gate 	int		fi_flags;
837c478bd9Sstevel@tonic-gate 	int		fi_mount_to;
847c478bd9Sstevel@tonic-gate 	int		fi_rpc_to;
857c478bd9Sstevel@tonic-gate 	zoneid_t	fi_zoneid;		/* zone mounted in */
867c478bd9Sstevel@tonic-gate } fninfo_t;
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate /*
897c478bd9Sstevel@tonic-gate  * The AUTOFS locking scheme:
907c478bd9Sstevel@tonic-gate  *
917c478bd9Sstevel@tonic-gate  * The locks:
927c478bd9Sstevel@tonic-gate  * 	fn_lock: protects the fn_node. It must be grabbed to change any
937c478bd9Sstevel@tonic-gate  *		 field on the fn_node, except for those protected by
947c478bd9Sstevel@tonic-gate  *		 fn_rwlock.
957c478bd9Sstevel@tonic-gate  *
967c478bd9Sstevel@tonic-gate  * 	fn_rwlock: readers/writers lock to protect the subdirectory and
977c478bd9Sstevel@tonic-gate  *		   top level list traversal.
987c478bd9Sstevel@tonic-gate  *		   Protects: fn_dirents
997c478bd9Sstevel@tonic-gate  *			     fn_next
1007c478bd9Sstevel@tonic-gate  *		             fn_size
1017c478bd9Sstevel@tonic-gate  *		             fn_linkcnt
1027c478bd9Sstevel@tonic-gate  *                 - Grab readers when checking if certain fn_node exists
1037c478bd9Sstevel@tonic-gate  *                   under fn_dirents.
1047c478bd9Sstevel@tonic-gate  *		   - Grab readers when attempting to reference a node
1057c478bd9Sstevel@tonic-gate  *                   pointed to by fn_dirents, fn_next, and fn_parent.
1067c478bd9Sstevel@tonic-gate  *                 - Grab writers to add a new fnnode under fn_dirents and
1077c478bd9Sstevel@tonic-gate  *		     to remove a node pointed to by fn_dirents or fn_next.
1087c478bd9Sstevel@tonic-gate  *
1097c478bd9Sstevel@tonic-gate  *
1107c478bd9Sstevel@tonic-gate  * The flags:
1117c478bd9Sstevel@tonic-gate  *	MF_INPROG:
1127c478bd9Sstevel@tonic-gate  *		- Indicates a mount request has been sent to the daemon.
1137c478bd9Sstevel@tonic-gate  *		- If this flag is set, the thread sets MF_WAITING on the
1147c478bd9Sstevel@tonic-gate  *                fnnode and sleeps.
1157c478bd9Sstevel@tonic-gate  *
1167c478bd9Sstevel@tonic-gate  *	MF_WAITING:
1177c478bd9Sstevel@tonic-gate  *		- Set by a thread when it puts itself to sleep waiting for
1187c478bd9Sstevel@tonic-gate  *		  the ongoing operation on this fnnode to be done.
1197c478bd9Sstevel@tonic-gate  *
1207c478bd9Sstevel@tonic-gate  * 	MF_LOOKUP:
1217c478bd9Sstevel@tonic-gate  * 		- Indicates a lookup request has been sent to the daemon.
1227c478bd9Sstevel@tonic-gate  *		- If this flag is set, the thread sets MF_WAITING on the
1237c478bd9Sstevel@tonic-gate  *                fnnode and sleeps.
1247c478bd9Sstevel@tonic-gate  *
1257c478bd9Sstevel@tonic-gate  *	MF_IK_MOUNT:
1267c478bd9Sstevel@tonic-gate  *		- This flag is set to indicate the mount was done in the
1277c478bd9Sstevel@tonic-gate  *		  kernel, and so should the unmount.
1287c478bd9Sstevel@tonic-gate  *
1297c478bd9Sstevel@tonic-gate  *	MF_DIRECT:
1307c478bd9Sstevel@tonic-gate  *		- Direct mountpoint if set, indirect otherwise.
1317c478bd9Sstevel@tonic-gate  *
1327c478bd9Sstevel@tonic-gate  *	MF_TRIGGER:
1337c478bd9Sstevel@tonic-gate  *		- This is a trigger node.
1347c478bd9Sstevel@tonic-gate  *
1357c478bd9Sstevel@tonic-gate  *	MF_THISUID_MATCH_RQD:
1367c478bd9Sstevel@tonic-gate  *		- User-relative context binding kind of node.
1377c478bd9Sstevel@tonic-gate  *		- Node with this flag set requires a name match as well
1387c478bd9Sstevel@tonic-gate  *		  as a cred match in order to be returned from the directory
1397c478bd9Sstevel@tonic-gate  *		  hierarchy.
1407c478bd9Sstevel@tonic-gate  *
1417c478bd9Sstevel@tonic-gate  * 	MF_MOUNTPOINT:
1427c478bd9Sstevel@tonic-gate  * 		- At some point automountd mounted a filesystem on this node.
1437c478bd9Sstevel@tonic-gate  * 		If fn_trigger is non-NULL, v_vfsmountedhere is NULL and this
1447c478bd9Sstevel@tonic-gate  * 		flag is set then the filesystem must have been forcibly
1457c478bd9Sstevel@tonic-gate  * 		unmounted.
1467c478bd9Sstevel@tonic-gate  */
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate /*
1497c478bd9Sstevel@tonic-gate  * The inode of AUTOFS
1507c478bd9Sstevel@tonic-gate  */
1517c478bd9Sstevel@tonic-gate typedef struct fnnode {
1527c478bd9Sstevel@tonic-gate 	char		*fn_name;
1537c478bd9Sstevel@tonic-gate 	char		*fn_symlink;		/* if VLNK, this is what it */
1547c478bd9Sstevel@tonic-gate 						/* points to */
1557c478bd9Sstevel@tonic-gate 	int		fn_namelen;
1567c478bd9Sstevel@tonic-gate 	int		fn_symlinklen;
1577c478bd9Sstevel@tonic-gate 	uint_t		fn_linkcnt;		/* link count */
1587c478bd9Sstevel@tonic-gate 	mode_t		fn_mode;		/* file mode bits */
1597c478bd9Sstevel@tonic-gate 	uid_t		fn_uid;			/* owner's uid */
1607c478bd9Sstevel@tonic-gate 	gid_t		fn_gid;			/* group's uid */
1617c478bd9Sstevel@tonic-gate 	int		fn_error;		/* mount/lookup error */
1627c478bd9Sstevel@tonic-gate 	ino_t		fn_nodeid;
1637c478bd9Sstevel@tonic-gate 	off_t		fn_offset;		/* offset into directory */
1647c478bd9Sstevel@tonic-gate 	int		fn_flags;
1657c478bd9Sstevel@tonic-gate 	uint_t		fn_size;		/* size of directory */
1667c478bd9Sstevel@tonic-gate 	struct vnode	*fn_vnode;
1677c478bd9Sstevel@tonic-gate 	struct fnnode	*fn_parent;
1687c478bd9Sstevel@tonic-gate 	struct fnnode	*fn_next;		/* sibling */
1697c478bd9Sstevel@tonic-gate 	struct fnnode	*fn_dirents;		/* children */
1707c478bd9Sstevel@tonic-gate 	struct fnnode	*fn_trigger; 		/* pointer to next level */
1717c478bd9Sstevel@tonic-gate 						/* AUTOFS trigger nodes */
1727c478bd9Sstevel@tonic-gate 	struct action_list *fn_alp;		/* Pointer to mount info */
1737c478bd9Sstevel@tonic-gate 						/* used for remounting */
1747c478bd9Sstevel@tonic-gate 						/* trigger nodes */
1757c478bd9Sstevel@tonic-gate 	cred_t		*fn_cred;		/* pointer to cred, used for */
1767c478bd9Sstevel@tonic-gate 						/* "thisuser" processing */
1777c478bd9Sstevel@tonic-gate 	krwlock_t	fn_rwlock;		/* protects list traversal */
1787c478bd9Sstevel@tonic-gate 	kmutex_t	fn_lock;		/* protects the fnnode */
1797c478bd9Sstevel@tonic-gate 	timestruc_t	fn_atime;
1807c478bd9Sstevel@tonic-gate 	timestruc_t	fn_mtime;
1817c478bd9Sstevel@tonic-gate 	timestruc_t	fn_ctime;
1827c478bd9Sstevel@tonic-gate 	time_t		fn_ref_time;		/* time last referenced */
1837c478bd9Sstevel@tonic-gate 	time_t		fn_unmount_ref_time;	/* last time unmount was done */
1847c478bd9Sstevel@tonic-gate 	kcondvar_t	fn_cv_mount;		/* mount blocking variable */
1857c478bd9Sstevel@tonic-gate 	struct vnode	*fn_seen;		/* vnode already traversed */
1867c478bd9Sstevel@tonic-gate 	kthread_t	*fn_thread;		/* thread that has currently */
1877c478bd9Sstevel@tonic-gate 						/* modified fn_seen */
1887c478bd9Sstevel@tonic-gate 	struct autofs_globals *fn_globals;	/* global variables */
1897c478bd9Sstevel@tonic-gate } fnnode_t;
1907c478bd9Sstevel@tonic-gate 
19139d3e169Sevanl 
1927c478bd9Sstevel@tonic-gate #define	vntofn(vp)	((struct fnnode *)((vp)->v_data))
1937c478bd9Sstevel@tonic-gate #define	fntovn(fnp)	(((fnp)->fn_vnode))
1947c478bd9Sstevel@tonic-gate #define	vfstofni(vfsp)	((struct fninfo *)((vfsp)->vfs_data))
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate #define	MF_DIRECT	0x001
1977c478bd9Sstevel@tonic-gate #define	MF_INPROG	0x002		/* Mount in progress */
1987c478bd9Sstevel@tonic-gate #define	MF_WAITING	0x004
1997c478bd9Sstevel@tonic-gate #define	MF_LOOKUP	0x008		/* Lookup in progress */
2007c478bd9Sstevel@tonic-gate #define	MF_ATTR_WAIT	0x010
2017c478bd9Sstevel@tonic-gate #define	MF_IK_MOUNT	0x040
2027c478bd9Sstevel@tonic-gate #define	MF_TRIGGER	0x080
2037c478bd9Sstevel@tonic-gate #define	MF_THISUID_MATCH_RQD	0x100	/* UID match required for this node */
2047c478bd9Sstevel@tonic-gate 					/* required for thisuser kind of */
2057c478bd9Sstevel@tonic-gate 					/* nodes */
2067c478bd9Sstevel@tonic-gate #define	MF_MOUNTPOINT	0x200		/* Node is/was a mount point */
2077c478bd9Sstevel@tonic-gate 
2087c478bd9Sstevel@tonic-gate #define	AUTOFS_MODE		0555
2097c478bd9Sstevel@tonic-gate #define	AUTOFS_BLOCKSIZE	1024
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate struct autofs_callargs {
2127c478bd9Sstevel@tonic-gate 	fnnode_t	*fnc_fnp;	/* fnnode */
2137c478bd9Sstevel@tonic-gate 	char		*fnc_name;	/* path to lookup/mount */
2147c478bd9Sstevel@tonic-gate 	kthread_t	*fnc_origin;	/* thread that fired up this thread */
2157c478bd9Sstevel@tonic-gate 					/* used for debugging purposes */
2167c478bd9Sstevel@tonic-gate 	cred_t		*fnc_cred;
2177c478bd9Sstevel@tonic-gate };
2187c478bd9Sstevel@tonic-gate 
2197c478bd9Sstevel@tonic-gate struct autofs_globals {
2207c478bd9Sstevel@tonic-gate 	fnnode_t		*fng_rootfnnodep;
2217c478bd9Sstevel@tonic-gate 	int			fng_fnnode_count;
2227c478bd9Sstevel@tonic-gate 	int			fng_printed_not_running_msg;
2237c478bd9Sstevel@tonic-gate 	kmutex_t		fng_unmount_threads_lock;
2247c478bd9Sstevel@tonic-gate 	int			fng_unmount_threads;
2257c478bd9Sstevel@tonic-gate 	int			fng_verbose;
2267c478bd9Sstevel@tonic-gate 	zoneid_t		fng_zoneid;
22739d3e169Sevanl 	pid_t			fng_autofs_pid;
22839d3e169Sevanl 	kmutex_t		fng_autofs_daemon_lock;
22939d3e169Sevanl 	/*
23039d3e169Sevanl 	 * autofs_daemon_lock protects fng_autofs_daemon_dh
23139d3e169Sevanl 	 */
23239d3e169Sevanl 	door_handle_t		fng_autofs_daemon_dh;
2337c478bd9Sstevel@tonic-gate };
2347c478bd9Sstevel@tonic-gate 
235*780213fbSevanl extern kmutex_t autofs_minor_lock;
2367c478bd9Sstevel@tonic-gate extern zone_key_t autofs_key;
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate /*
2397c478bd9Sstevel@tonic-gate  * Sets the MF_INPROG flag on this fnnode.
2407c478bd9Sstevel@tonic-gate  * fnp->fn_lock should be held before this macro is called,
2417c478bd9Sstevel@tonic-gate  * operation is either MF_INPROG or MF_LOOKUP.
2427c478bd9Sstevel@tonic-gate  */
2437c478bd9Sstevel@tonic-gate #define	AUTOFS_BLOCK_OTHERS(fnp, operation)	{ \
2447c478bd9Sstevel@tonic-gate 	ASSERT(MUTEX_HELD(&(fnp)->fn_lock)); \
2457c478bd9Sstevel@tonic-gate 	ASSERT(!((fnp)->fn_flags & operation)); \
2467c478bd9Sstevel@tonic-gate 	(fnp)->fn_flags |= (operation); \
2477c478bd9Sstevel@tonic-gate }
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate #define	AUTOFS_UNBLOCK_OTHERS(fnp, operation)	{ \
2507c478bd9Sstevel@tonic-gate 	auto_unblock_others((fnp), (operation)); \
2517c478bd9Sstevel@tonic-gate }
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate extern struct vnodeops *auto_vnodeops;
2547c478bd9Sstevel@tonic-gate extern const struct fs_operation_def auto_vnodeops_template[];
2557c478bd9Sstevel@tonic-gate 
2567c478bd9Sstevel@tonic-gate /*
2577c478bd9Sstevel@tonic-gate  * Utility routines
2587c478bd9Sstevel@tonic-gate  */
2597c478bd9Sstevel@tonic-gate extern int auto_search(fnnode_t *, char *, fnnode_t **, cred_t *);
2607c478bd9Sstevel@tonic-gate extern int auto_enter(fnnode_t *, char *, fnnode_t **, cred_t *);
2617c478bd9Sstevel@tonic-gate extern void auto_unblock_others(fnnode_t *, uint_t);
2627c478bd9Sstevel@tonic-gate extern int auto_wait4mount(fnnode_t *);
2637c478bd9Sstevel@tonic-gate extern fnnode_t *auto_makefnnode(vtype_t, vfs_t *, char *, cred_t *,
2647c478bd9Sstevel@tonic-gate     struct autofs_globals *);
2657c478bd9Sstevel@tonic-gate extern void auto_freefnnode(fnnode_t *);
2667c478bd9Sstevel@tonic-gate extern void auto_disconnect(fnnode_t *, fnnode_t *);
2677c478bd9Sstevel@tonic-gate extern void auto_do_unmount(struct autofs_globals *);
26839d3e169Sevanl /*PRINTFLIKE4*/
26939d3e169Sevanl extern void auto_log(int verbose, zoneid_t zoneid, int level,
27039d3e169Sevanl 	const char *fmt, ...)
27139d3e169Sevanl     __KPRINTFLIKE(4);
2727c478bd9Sstevel@tonic-gate /*PRINTFLIKE2*/
2737c478bd9Sstevel@tonic-gate extern void auto_dprint(int level, const char *fmt, ...)
2747c478bd9Sstevel@tonic-gate     __KPRINTFLIKE(2);
27539d3e169Sevanl extern int auto_calldaemon(zoneid_t, int, xdrproc_t, void *, xdrproc_t,
27639d3e169Sevanl 	void *, int, bool_t);
2777c478bd9Sstevel@tonic-gate extern int auto_lookup_aux(fnnode_t *, char *, cred_t *);
2787c478bd9Sstevel@tonic-gate extern void auto_new_mount_thread(fnnode_t *, char *, cred_t *);
2797c478bd9Sstevel@tonic-gate extern int auto_nobrowse_option(char *);
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate extern void unmount_tree(struct autofs_globals *, int);
2827c478bd9Sstevel@tonic-gate extern void autofs_free_globals(struct autofs_globals *);
2837c478bd9Sstevel@tonic-gate extern void autofs_shutdown_zone(struct autofs_globals *);
2847c478bd9Sstevel@tonic-gate /*
2857c478bd9Sstevel@tonic-gate  * external routines not defined in any header file
2867c478bd9Sstevel@tonic-gate  */
2877c478bd9Sstevel@tonic-gate extern bool_t xdr_uid_t(XDR *, uid_t *);
2887c478bd9Sstevel@tonic-gate 
2897c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
2907c478bd9Sstevel@tonic-gate 
2917c478bd9Sstevel@tonic-gate /*
29239d3e169Sevanl  * autofs structures and defines needed for use with doors.
29339d3e169Sevanl  */
29439d3e169Sevanl #define	AUTOFS_NULL	0
29539d3e169Sevanl #define	AUTOFS_MOUNT	1
29639d3e169Sevanl #define	AUTOFS_UNMOUNT	2
29739d3e169Sevanl #define	AUTOFS_READDIR	3
29839d3e169Sevanl #define	AUTOFS_LOOKUP	4
29939d3e169Sevanl #define	AUTOFS_SRVINFO	5
30039d3e169Sevanl #define	AUTOFS_MNTINFO	6
30139d3e169Sevanl 
30239d3e169Sevanl /*
30339d3e169Sevanl  * autofs_door_args is a generic structure used to grab the command
30439d3e169Sevanl  * from any of the argument structures passed in.
30539d3e169Sevanl  */
30639d3e169Sevanl 
30739d3e169Sevanl typedef struct {
30839d3e169Sevanl 	int cmd;
30939d3e169Sevanl 	int xdr_len;
31039d3e169Sevanl 	char xdr_arg[1];	/* buffer holding xdr encoded data */
31139d3e169Sevanl } autofs_door_args_t;
31239d3e169Sevanl 
31339d3e169Sevanl 
31439d3e169Sevanl typedef struct {
31539d3e169Sevanl 	int res_status;
31639d3e169Sevanl 	int xdr_len;
31739d3e169Sevanl 	char xdr_res[1];	/* buffer holding xdr encoded data */
31839d3e169Sevanl } autofs_door_res_t;
31939d3e169Sevanl 
32039d3e169Sevanl typedef enum autofs_res autofs_res_t;
32139d3e169Sevanl typedef enum autofs_stat autofs_stat_t;
32239d3e169Sevanl typedef enum autofs_action autofs_action_t;
32339d3e169Sevanl 
32439d3e169Sevanl typedef struct {
32539d3e169Sevanl 	void *	atsd_buf;
32639d3e169Sevanl 	size_t	atsd_len;
32739d3e169Sevanl } autofs_tsd_t;
32839d3e169Sevanl 
32939d3e169Sevanl typedef struct sec_desdata {
33039d3e169Sevanl 	int		nd_sec_syncaddr_len;
33139d3e169Sevanl 	int		nd_sec_knc_semantics;
33239d3e169Sevanl 	int		nd_sec_netnamelen;
33339d3e169Sevanl 	uint64_t	nd_sec_knc_rdev;
33439d3e169Sevanl 	int		nd_sec_knc_unused[8];
33539d3e169Sevanl } sec_desdata_t;
33639d3e169Sevanl 
33739d3e169Sevanl typedef struct sec_gssdata {
33839d3e169Sevanl 	int			element_length;
33939d3e169Sevanl 	rpc_gss_service_t	service;
34039d3e169Sevanl 	char			uname[MAX_NAME_LEN];
34139d3e169Sevanl 	char			inst[MAX_NAME_LEN];
34239d3e169Sevanl 	char			realm[MAX_NAME_LEN];
34339d3e169Sevanl 	uint_t			qop;
34439d3e169Sevanl } sec_gssdata_t;
34539d3e169Sevanl 
34639d3e169Sevanl typedef struct nfs_secdata  {
34739d3e169Sevanl 	sec_desdata_t	nfs_des_clntdata;
34839d3e169Sevanl 	sec_gssdata_t	nfs_gss_clntdata;
34939d3e169Sevanl } nfs_secdata_t;
35039d3e169Sevanl 
35139d3e169Sevanl /*
3527c478bd9Sstevel@tonic-gate  * Comma separated list of mntoptions which are inherited when the
3537c478bd9Sstevel@tonic-gate  * "restrict" option is present.  The RESTRICT option must be first!
3547c478bd9Sstevel@tonic-gate  * This define is shared between the kernel and the automount daemon.
3557c478bd9Sstevel@tonic-gate  */
3567c478bd9Sstevel@tonic-gate #define	RESTRICTED_MNTOPTS	\
3577c478bd9Sstevel@tonic-gate 	MNTOPT_RESTRICT, MNTOPT_NOSUID, MNTOPT_NOSETUID, MNTOPT_NODEVICES
3587c478bd9Sstevel@tonic-gate 
3597c478bd9Sstevel@tonic-gate /*
3607c478bd9Sstevel@tonic-gate  * AUTOFS syscall entry point
3617c478bd9Sstevel@tonic-gate  */
36239d3e169Sevanl enum autofssys_op { AUTOFS_UNMOUNTALL, AUTOFS_SETDOOR };
3637c478bd9Sstevel@tonic-gate 
3647c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
3657c478bd9Sstevel@tonic-gate extern int autofssys(enum autofssys_op, uintptr_t);
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
3687c478bd9Sstevel@tonic-gate 
3697c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3707c478bd9Sstevel@tonic-gate }
3717c478bd9Sstevel@tonic-gate #endif
3727c478bd9Sstevel@tonic-gate 
3737c478bd9Sstevel@tonic-gate #endif	/* _SYS_FS_AUTOFS_H */
374