xref: /dragonfly/sys/vfs/autofs/autofs_ioctl.h (revision 63bc4984)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2016 Tomohiro Kusumi <tkusumi@netbsd.org>
5  * Copyright (c) 2016 The DragonFly Project
6  * Copyright (c) 2013 The FreeBSD Foundation
7  * All rights reserved.
8  *
9  * This software was developed by Edward Tomasz Napierala under sponsorship
10  * from the FreeBSD Foundation.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer.
17  * 2. Redistributions in binary form must reproduce the above copyright
18  *    notice, this list of conditions and the following disclaimer in the
19  *    documentation and/or other materials provided with the distribution.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * $FreeBSD$
34  */
35 
36 #ifndef AUTOFS_IOCTL_H
37 #define AUTOFS_IOCTL_H
38 
39 #include <sys/param.h>
40 #include <sys/ioccom.h>
41 
42 #define AUTOFS_PATH	"/dev/autofs"
43 
44 struct autofs_daemon_request {
45 	/*
46 	 * Request identifier.
47 	 */
48 	int		adr_id;
49 
50 	/*
51 	 * The "from" field, containing map name.  For example,
52 	 * when accessing '/net/192.168.1.3/tank/vm/', that would
53 	 * be '-hosts'.
54 	 */
55 	char		adr_from[MAXPATHLEN];
56 
57 	/*
58 	 * Full path to the node being looked up; for requests that result
59 	 * in actual mount it is the full mount path.
60 	 */
61 	char		adr_path[MAXPATHLEN];
62 
63 	/*
64 	 * Prefix, which is basically the mountpoint from auto_master(5).
65 	 * In example above that would be "/net"; for direct maps it is "/".
66 	 */
67 	char		adr_prefix[MAXPATHLEN];
68 
69 	/*
70 	 * Map key, also used as command argument for dynamic maps; in example
71 	 * above that would be '192.168.1.3'.
72 	 */
73 	char		adr_key[MAXPATHLEN];
74 
75 	/*
76 	 * Mount options from auto_master(5).
77 	 */
78 	char		adr_options[MAXPATHLEN];
79 };
80 
81 struct autofs_daemon_done {
82 	/*
83 	 * Identifier, copied from adr_id.
84 	 */
85 	int		add_id;
86 
87 	/*
88 	 * Set to 1 if the map may contain wildcard entries;
89 	 * otherwise autofs will do negative caching.
90 	 */
91 	int		add_wildcards;
92 
93 	/*
94 	 * Error number, possibly returned to userland.
95 	 */
96 	int		add_error;
97 
98 	/*
99 	 * Reserved for future use.
100 	 */
101 	int		add_spare[7];
102 };
103 
104 #define AUTOFSREQUEST	_IOR('I', 0x01, struct autofs_daemon_request)
105 #define AUTOFSDONE	_IOW('I', 0x03, struct autofs_daemon_done)
106 
107 #endif /* !AUTOFS_IOCTL_H */
108