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