xref: /freebsd-src/sys/fs/autofs/autofs_ioctl.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
13914ddf8SEdward Tomasz Napierala /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
318dffafaSEdward Tomasz Napierala  *
43914ddf8SEdward Tomasz Napierala  * Copyright (c) 2013 The FreeBSD Foundation
53914ddf8SEdward Tomasz Napierala  *
63914ddf8SEdward Tomasz Napierala  * This software was developed by Edward Tomasz Napierala under sponsorship
73914ddf8SEdward Tomasz Napierala  * from the FreeBSD Foundation.
83914ddf8SEdward Tomasz Napierala  *
93914ddf8SEdward Tomasz Napierala  * Redistribution and use in source and binary forms, with or without
103914ddf8SEdward Tomasz Napierala  * modification, are permitted provided that the following conditions
113914ddf8SEdward Tomasz Napierala  * are met:
123914ddf8SEdward Tomasz Napierala  * 1. Redistributions of source code must retain the above copyright
133914ddf8SEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer.
143914ddf8SEdward Tomasz Napierala  * 2. Redistributions in binary form must reproduce the above copyright
153914ddf8SEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer in the
163914ddf8SEdward Tomasz Napierala  *    documentation and/or other materials provided with the distribution.
173914ddf8SEdward Tomasz Napierala  *
183914ddf8SEdward Tomasz Napierala  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
193914ddf8SEdward Tomasz Napierala  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
203914ddf8SEdward Tomasz Napierala  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
213914ddf8SEdward Tomasz Napierala  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
223914ddf8SEdward Tomasz Napierala  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
233914ddf8SEdward Tomasz Napierala  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
243914ddf8SEdward Tomasz Napierala  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
253914ddf8SEdward Tomasz Napierala  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
263914ddf8SEdward Tomasz Napierala  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
273914ddf8SEdward Tomasz Napierala  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
283914ddf8SEdward Tomasz Napierala  * SUCH DAMAGE.
293914ddf8SEdward Tomasz Napierala  */
303914ddf8SEdward Tomasz Napierala 
313914ddf8SEdward Tomasz Napierala #ifndef AUTOFS_IOCTL_H
323914ddf8SEdward Tomasz Napierala #define	AUTOFS_IOCTL_H
333914ddf8SEdward Tomasz Napierala 
343914ddf8SEdward Tomasz Napierala #define	AUTOFS_PATH		"/dev/autofs"
353914ddf8SEdward Tomasz Napierala 
363914ddf8SEdward Tomasz Napierala struct autofs_daemon_request {
373914ddf8SEdward Tomasz Napierala 	/*
383914ddf8SEdward Tomasz Napierala 	 * Request identifier.
393914ddf8SEdward Tomasz Napierala 	 */
403914ddf8SEdward Tomasz Napierala 	int		adr_id;
413914ddf8SEdward Tomasz Napierala 
423914ddf8SEdward Tomasz Napierala 	/*
433914ddf8SEdward Tomasz Napierala 	 * The "from" field, containing map name.  For example,
443914ddf8SEdward Tomasz Napierala 	 * when accessing '/net/192.168.1.3/tank/vm/', that would
453914ddf8SEdward Tomasz Napierala 	 * be '-hosts'.
463914ddf8SEdward Tomasz Napierala 	 */
473914ddf8SEdward Tomasz Napierala 	char		adr_from[MAXPATHLEN];
483914ddf8SEdward Tomasz Napierala 
493914ddf8SEdward Tomasz Napierala 	/*
503914ddf8SEdward Tomasz Napierala 	 * Full path to the node being looked up; for requests that result
513914ddf8SEdward Tomasz Napierala 	 * in actual mount it is the full mount path.
523914ddf8SEdward Tomasz Napierala 	 */
533914ddf8SEdward Tomasz Napierala 	char		adr_path[MAXPATHLEN];
543914ddf8SEdward Tomasz Napierala 
553914ddf8SEdward Tomasz Napierala 	/*
563914ddf8SEdward Tomasz Napierala 	 * Prefix, which is basically the mountpoint from auto_master(5).
573914ddf8SEdward Tomasz Napierala 	 * In example above that would be "/net"; for direct maps it is "/".
583914ddf8SEdward Tomasz Napierala 	 */
593914ddf8SEdward Tomasz Napierala 	char		adr_prefix[MAXPATHLEN];
603914ddf8SEdward Tomasz Napierala 
613914ddf8SEdward Tomasz Napierala 	/*
623914ddf8SEdward Tomasz Napierala 	 * Map key, also used as command argument for dynamic maps; in example
633914ddf8SEdward Tomasz Napierala 	 * above that would be '192.168.1.3'.
643914ddf8SEdward Tomasz Napierala 	 */
653914ddf8SEdward Tomasz Napierala 	char		adr_key[MAXPATHLEN];
663914ddf8SEdward Tomasz Napierala 
673914ddf8SEdward Tomasz Napierala 	/*
683914ddf8SEdward Tomasz Napierala 	 * Mount options from auto_master(5).
693914ddf8SEdward Tomasz Napierala 	 */
703914ddf8SEdward Tomasz Napierala 	char		adr_options[MAXPATHLEN];
713914ddf8SEdward Tomasz Napierala };
723914ddf8SEdward Tomasz Napierala 
7329836e07SEdward Tomasz Napierala /*
7429836e07SEdward Tomasz Napierala  * Compatibility with 10.1-RELEASE automountd(8).
7529836e07SEdward Tomasz Napierala  */
7629836e07SEdward Tomasz Napierala struct autofs_daemon_done_101 {
7729836e07SEdward Tomasz Napierala 	/*
7829836e07SEdward Tomasz Napierala 	 * Identifier, copied from adr_id.
7929836e07SEdward Tomasz Napierala 	 */
8029836e07SEdward Tomasz Napierala 	int		add_id;
8129836e07SEdward Tomasz Napierala 
8229836e07SEdward Tomasz Napierala 	/*
8329836e07SEdward Tomasz Napierala 	 * Error number, possibly returned to userland.
8429836e07SEdward Tomasz Napierala 	 */
8529836e07SEdward Tomasz Napierala 	int		add_error;
8629836e07SEdward Tomasz Napierala };
8729836e07SEdward Tomasz Napierala 
883914ddf8SEdward Tomasz Napierala struct autofs_daemon_done {
893914ddf8SEdward Tomasz Napierala 	/*
903914ddf8SEdward Tomasz Napierala 	 * Identifier, copied from adr_id.
913914ddf8SEdward Tomasz Napierala 	 */
923914ddf8SEdward Tomasz Napierala 	int		add_id;
933914ddf8SEdward Tomasz Napierala 
943914ddf8SEdward Tomasz Napierala 	/*
954cdc52bdSEdward Tomasz Napierala 	 * Set to 1 if the map may contain wildcard entries;
964cdc52bdSEdward Tomasz Napierala 	 * otherwise autofs will do negative caching.
974cdc52bdSEdward Tomasz Napierala 	 */
984cdc52bdSEdward Tomasz Napierala 	int		add_wildcards;
994cdc52bdSEdward Tomasz Napierala 
1004cdc52bdSEdward Tomasz Napierala 	/*
1013914ddf8SEdward Tomasz Napierala 	 * Error number, possibly returned to userland.
1023914ddf8SEdward Tomasz Napierala 	 */
1033914ddf8SEdward Tomasz Napierala 	int		add_error;
10429836e07SEdward Tomasz Napierala 
10529836e07SEdward Tomasz Napierala 	/*
10629836e07SEdward Tomasz Napierala 	 * Reserved for future use.
10729836e07SEdward Tomasz Napierala 	 */
10829836e07SEdward Tomasz Napierala 	int		add_spare[7];
1093914ddf8SEdward Tomasz Napierala };
1103914ddf8SEdward Tomasz Napierala 
1113914ddf8SEdward Tomasz Napierala #define	AUTOFSREQUEST	_IOR('I', 0x01, struct autofs_daemon_request)
11229836e07SEdward Tomasz Napierala #define	AUTOFSDONE101	_IOW('I', 0x02, struct autofs_daemon_done_101)
11329836e07SEdward Tomasz Napierala #define	AUTOFSDONE	_IOW('I', 0x03, struct autofs_daemon_done)
1143914ddf8SEdward Tomasz Napierala 
1153914ddf8SEdward Tomasz Napierala #endif /* !AUTOFS_IOCTL_H */
116