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>
44 const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
45 const MNTNAMLEN = 255; /* maximum bytes in a name argument */
46 const FHSIZE = 32; /* size in bytes of a file handle */
48 const FHSIZE3 = 64; /* size in bytes of a file handle (v3) */
52 * The fhandle is the file handle that the server passes to the client.
53 * All file operations are done using the file handles to refer to a file
54 * or a directory. The file handle can contain whatever information the
55 * server needs to distinguish an individual file.
57 typedef opaque fhandle[FHSIZE];
59 typedef opaque fhandle3<FHSIZE3>;
63 * If a status of zero is returned, the call completed successfully, and
64 * a file handle for the directory follows. A non-zero status indicates
65 * some sort of error. The status corresponds with UNIX error numbers.
67 union fhstatus switch (unsigned fhs_status) {
76 * Status codes returned by the version 3 mount call.
79 MNT3_OK = 0, /* no error */
80 MNT3ERR_PERM = 1, /* Not owner */
81 MNT3ERR_NOENT = 2, /* No such file or directory */
82 MNT3ERR_IO = 5, /* I/O error */
83 MNT3ERR_ACCES = 13, /* Permission denied */
84 MNT3ERR_NOTDIR = 20, /* Not a directory */
85 MNT3ERR_INVAL = 22, /* Invalid argument */
86 MNT3ERR_NAMETOOLONG = 63, /* Filename too long */
87 MNT3ERR_NOTSUPP = 10004, /* Operation not supported */
88 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
96 union mountres3 switch (mountstat3 fhs_status) {
98 mountres3_ok mountinfo;
105 * The type dirpath is the pathname of a directory
107 typedef string dirpath<MNTPATHLEN>;
110 * The type name is used for arbitrary names (hostnames, groupnames)
112 typedef string name<MNTNAMLEN>;
115 * A list of who has what mounted
117 typedef struct mountbody *mountlist;
120 dirpath ml_directory;
125 * A list of netgroups
127 typedef struct groupnode *groups;
134 * A list of what is exported and to whom
136 typedef struct exportnode *exports;
145 * Version one of the mount protocol communicates with version two
146 * of the NFS protocol. Version three communicates with
147 * version three of the NFS protocol. The only connecting
148 * point is the fhandle structure, which is the same for both
153 * Does no work. It is made available in all RPC services
154 * to allow server response testing and timing
157 MOUNTPROC_NULL(void) = 0;
160 * If fhs_status is 0, then fhs_fhandle contains the
161 * file handle for the directory. This file handle may
162 * be used in the NFS protocol. This procedure also adds
163 * a new entry to the mount list for this client mounting
165 * Unix authentication required.
168 MOUNTPROC_MNT(dirpath) = 1;
171 * Returns the list of remotely mounted filesystems. The
172 * mountlist contains one entry for each hostname and
176 MOUNTPROC_DUMP(void) = 2;
179 * Removes the mount list entry for the directory
180 * Unix authentication required.
183 MOUNTPROC_UMNT(dirpath) = 3;
186 * Removes all of the mount list entries for this client
187 * Unix authentication required.
190 MOUNTPROC_UMNTALL(void) = 4;
193 * Returns a list of all the exported filesystems, and which
194 * machines are allowed to import it.
197 MOUNTPROC_EXPORT(void) = 5;
200 * Identical to MOUNTPROC_EXPORT above
203 MOUNTPROC_EXPORTALL(void) = 6;
208 * Does no work. It is made available in all RPC services
209 * to allow server response testing and timing
212 MOUNTPROC_NULL(void) = 0;
215 * If mountres3.fhs_status is MNT3_OK, then
216 * mountres3.mountinfo contains the file handle for
217 * the directory and a list of acceptable
218 * authentication flavors. This file handle may only
219 * be used in the NFS version 3 protocol. This
220 * procedure also results in the server adding a new
221 * entry to its mount list recording that this client
222 * has mounted the directory. AUTH_UNIX authentication
223 * or better is required.
226 MOUNTPROC_MNT(dirpath) = 1;
229 * Returns the list of remotely mounted filesystems. The
230 * mountlist contains one entry for each hostname and
234 MOUNTPROC_DUMP(void) = 2;
237 * Removes the mount list entry for the directory
238 * Unix authentication required.
241 MOUNTPROC_UMNT(dirpath) = 3;
244 * Removes all of the mount list entries for this client
245 * Unix authentication required.
248 MOUNTPROC_UMNTALL(void) = 4;
251 * Returns a list of all the exported filesystems, and which
252 * machines are allowed to import it.
255 MOUNTPROC_EXPORT(void) = 5;