autofs_ioctl.h revision 270096
1270096Strasz/*-
2270096Strasz * Copyright (c) 2013 The FreeBSD Foundation
3270096Strasz * All rights reserved.
4270096Strasz *
5270096Strasz * This software was developed by Edward Tomasz Napierala under sponsorship
6270096Strasz * from the FreeBSD Foundation.
7270096Strasz *
8270096Strasz * Redistribution and use in source and binary forms, with or without
9270096Strasz * modification, are permitted provided that the following conditions
10270096Strasz * are met:
11270096Strasz * 1. Redistributions of source code must retain the above copyright
12270096Strasz *    notice, this list of conditions and the following disclaimer.
13270096Strasz * 2. Redistributions in binary form must reproduce the above copyright
14270096Strasz *    notice, this list of conditions and the following disclaimer in the
15270096Strasz *    documentation and/or other materials provided with the distribution.
16270096Strasz *
17270096Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18270096Strasz * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19270096Strasz * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20270096Strasz * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21270096Strasz * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22270096Strasz * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23270096Strasz * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24270096Strasz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25270096Strasz * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26270096Strasz * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27270096Strasz * SUCH DAMAGE.
28270096Strasz *
29270096Strasz * $FreeBSD: head/sys/fs/autofs/autofs_ioctl.h 270096 2014-08-17 09:44:42Z trasz $
30270096Strasz */
31270096Strasz
32270096Strasz#ifndef AUTOFS_IOCTL_H
33270096Strasz#define	AUTOFS_IOCTL_H
34270096Strasz
35270096Strasz#define	AUTOFS_PATH		"/dev/autofs"
36270096Strasz
37270096Straszstruct autofs_daemon_request {
38270096Strasz	/*
39270096Strasz	 * Request identifier.
40270096Strasz	 */
41270096Strasz	int		adr_id;
42270096Strasz
43270096Strasz	/*
44270096Strasz	 * The "from" field, containing map name.  For example,
45270096Strasz	 * when accessing '/net/192.168.1.3/tank/vm/', that would
46270096Strasz	 * be '-hosts'.
47270096Strasz	 */
48270096Strasz	char		adr_from[MAXPATHLEN];
49270096Strasz
50270096Strasz	/*
51270096Strasz	 * Full path to the node being looked up; for requests that result
52270096Strasz	 * in actual mount it is the full mount path.
53270096Strasz	 */
54270096Strasz	char		adr_path[MAXPATHLEN];
55270096Strasz
56270096Strasz	/*
57270096Strasz	 * Prefix, which is basically the mountpoint from auto_master(5).
58270096Strasz	 * In example above that would be "/net"; for direct maps it is "/".
59270096Strasz	 */
60270096Strasz	char		adr_prefix[MAXPATHLEN];
61270096Strasz
62270096Strasz	/*
63270096Strasz	 * Map key, also used as command argument for dynamic maps; in example
64270096Strasz	 * above that would be '192.168.1.3'.
65270096Strasz	 */
66270096Strasz	char		adr_key[MAXPATHLEN];
67270096Strasz
68270096Strasz	/*
69270096Strasz	 * Mount options from auto_master(5).
70270096Strasz	 */
71270096Strasz	char		adr_options[MAXPATHLEN];
72270096Strasz};
73270096Strasz
74270096Straszstruct autofs_daemon_done {
75270096Strasz	/*
76270096Strasz	 * Identifier, copied from adr_id.
77270096Strasz	 */
78270096Strasz	int		add_id;
79270096Strasz
80270096Strasz	/*
81270096Strasz	 * Error number, possibly returned to userland.
82270096Strasz	 */
83270096Strasz	int		add_error;
84270096Strasz};
85270096Strasz
86270096Strasz#define	AUTOFSREQUEST	_IOR('I', 0x01, struct autofs_daemon_request)
87270096Strasz#define	AUTOFSDONE	_IOW('I', 0x02, struct autofs_daemon_done)
88270096Strasz
89270096Strasz#endif /* !AUTOFS_IOCTL_H */
90