2 * Copyright (c) 2010, Oracle America, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following
12 * disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 * * Neither the name of the "Oracle America, Inc." nor the names of its
15 * contributors may be used to endorse or promote products derived
16 * from this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Protocol description for the mount program
38 %/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
39 %/*static char sccsid[] = "from: @(#)mount.x 2.1 88/08/01 4.0 RPCSRC";*/
40 %#endif /* not lint */
41 %#include <sys/cdefs.h>
42 %__FBSDID("$FreeBSD$");
45 const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
46 const MNTNAMLEN = 255; /* maximum bytes in a name argument */
47 const FHSIZE = 32; /* size in bytes of a file handle */
49 const FHSIZE3 = 64; /* size in bytes of a file handle (v3) */
53 * The fhandle is the file handle that the server passes to the client.
54 * All file operations are done using the file handles to refer to a file
55 * or a directory. The file handle can contain whatever information the
56 * server needs to distinguish an individual file.
58 typedef opaque fhandle[FHSIZE];
60 typedef opaque fhandle3<FHSIZE3>;
64 * If a status of zero is returned, the call completed successfully, and
65 * a file handle for the directory follows. A non-zero status indicates
66 * some sort of error. The status corresponds with UNIX error numbers.
68 union fhstatus switch (unsigned fhs_status) {
77 * Status codes returned by the version 3 mount call.
80 MNT3_OK = 0, /* no error */
81 MNT3ERR_PERM = 1, /* Not owner */
82 MNT3ERR_NOENT = 2, /* No such file or directory */
83 MNT3ERR_IO = 5, /* I/O error */
84 MNT3ERR_ACCES = 13, /* Permission denied */
85 MNT3ERR_NOTDIR = 20, /* Not a directory */
86 MNT3ERR_INVAL = 22, /* Invalid argument */
87 MNT3ERR_NAMETOOLONG = 63, /* Filename too long */
88 MNT3ERR_NOTSUPP = 10004, /* Operation not supported */
89 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
97 union mountres3 switch (mountstat3 fhs_status) {
99 mountres3_ok mountinfo;
106 * The type dirpath is the pathname of a directory
108 typedef string dirpath<MNTPATHLEN>;
111 * The type name is used for arbitrary names (hostnames, groupnames)
113 typedef string name<MNTNAMLEN>;
116 * A list of who has what mounted
118 typedef struct mountbody *mountlist;
121 dirpath ml_directory;
126 * A list of netgroups
128 typedef struct groupnode *groups;
135 * A list of what is exported and to whom
137 typedef struct exportnode *exports;
146 * Version one of the mount protocol communicates with version two
147 * of the NFS protocol. Version three communicates with
148 * version three of the NFS protocol. The only connecting
149 * point is the fhandle structure, which is the same for both
154 * Does no work. It is made available in all RPC services
155 * to allow server response testing and timing
158 MOUNTPROC_NULL(void) = 0;
161 * If fhs_status is 0, then fhs_fhandle contains the
162 * file handle for the directory. This file handle may
163 * be used in the NFS protocol. This procedure also adds
164 * a new entry to the mount list for this client mounting
166 * Unix authentication required.
169 MOUNTPROC_MNT(dirpath) = 1;
172 * Returns the list of remotely mounted filesystems. The
173 * mountlist contains one entry for each hostname and
177 MOUNTPROC_DUMP(void) = 2;
180 * Removes the mount list entry for the directory
181 * Unix authentication required.
184 MOUNTPROC_UMNT(dirpath) = 3;
187 * Removes all of the mount list entries for this client
188 * Unix authentication required.
191 MOUNTPROC_UMNTALL(void) = 4;
194 * Returns a list of all the exported filesystems, and which
195 * machines are allowed to import it.
198 MOUNTPROC_EXPORT(void) = 5;
201 * Identical to MOUNTPROC_EXPORT above
204 MOUNTPROC_EXPORTALL(void) = 6;
209 * Does no work. It is made available in all RPC services
210 * to allow server response testing and timing
213 MOUNTPROC_NULL(void) = 0;
216 * If mountres3.fhs_status is MNT3_OK, then
217 * mountres3.mountinfo contains the file handle for
218 * the directory and a list of acceptable
219 * authentication flavors. This file handle may only
220 * be used in the NFS version 3 protocol. This
221 * procedure also results in the server adding a new
222 * entry to its mount list recording that this client
223 * has mounted the directory. AUTH_UNIX authentication
224 * or better is required.
227 MOUNTPROC_MNT(dirpath) = 1;
230 * Returns the list of remotely mounted filesystems. The
231 * mountlist contains one entry for each hostname and
235 MOUNTPROC_DUMP(void) = 2;
238 * Removes the mount list entry for the directory
239 * Unix authentication required.
242 MOUNTPROC_UMNT(dirpath) = 3;
245 * Removes all of the mount list entries for this client
246 * Unix authentication required.
249 MOUNTPROC_UMNTALL(void) = 4;
252 * Returns a list of all the exported filesystems, and which
253 * machines are allowed to import it.
256 MOUNTPROC_EXPORT(void) = 5;