2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
31 * Protocol description for the mount program
36 %/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
37 %/*static char sccsid[] = "from: @(#)mount.x 2.1 88/08/01 4.0 RPCSRC";*/
38 %#endif /* not lint */
39 %#include <sys/cdefs.h>
40 %__FBSDID("$FreeBSD$");
43 const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
44 const MNTNAMLEN = 255; /* maximum bytes in a name argument */
45 const FHSIZE = 32; /* size in bytes of a file handle */
47 const FHSIZE3 = 64; /* size in bytes of a file handle (v3) */
51 * The fhandle is the file handle that the server passes to the client.
52 * All file operations are done using the file handles to refer to a file
53 * or a directory. The file handle can contain whatever information the
54 * server needs to distinguish an individual file.
56 typedef opaque fhandle[FHSIZE];
58 typedef opaque fhandle3<FHSIZE3>;
62 * If a status of zero is returned, the call completed successfully, and
63 * a file handle for the directory follows. A non-zero status indicates
64 * some sort of error. The status corresponds with UNIX error numbers.
66 union fhstatus switch (unsigned fhs_status) {
75 * Status codes returned by the version 3 mount call.
78 MNT3_OK = 0, /* no error */
79 MNT3ERR_PERM = 1, /* Not owner */
80 MNT3ERR_NOENT = 2, /* No such file or directory */
81 MNT3ERR_IO = 5, /* I/O error */
82 MNT3ERR_ACCES = 13, /* Permission denied */
83 MNT3ERR_NOTDIR = 20, /* Not a directory */
84 MNT3ERR_INVAL = 22, /* Invalid argument */
85 MNT3ERR_NAMETOOLONG = 63, /* Filename too long */
86 MNT3ERR_NOTSUPP = 10004, /* Operation not supported */
87 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
95 union mountres3 switch (mountstat3 fhs_status) {
97 mountres3_ok mountinfo;
104 * The type dirpath is the pathname of a directory
106 typedef string dirpath<MNTPATHLEN>;
109 * The type name is used for arbitrary names (hostnames, groupnames)
111 typedef string name<MNTNAMLEN>;
114 * A list of who has what mounted
116 typedef struct mountbody *mountlist;
119 dirpath ml_directory;
124 * A list of netgroups
126 typedef struct groupnode *groups;
133 * A list of what is exported and to whom
135 typedef struct exportnode *exports;
144 * Version one of the mount protocol communicates with version two
145 * of the NFS protocol. Version three communicates with
146 * version three of the NFS protocol. The only connecting
147 * point is the fhandle structure, which is the same for both
152 * Does no work. It is made available in all RPC services
153 * to allow server reponse testing and timing
156 MOUNTPROC_NULL(void) = 0;
159 * If fhs_status is 0, then fhs_fhandle contains the
160 * file handle for the directory. This file handle may
161 * be used in the NFS protocol. This procedure also adds
162 * a new entry to the mount list for this client mounting
164 * Unix authentication required.
167 MOUNTPROC_MNT(dirpath) = 1;
170 * Returns the list of remotely mounted filesystems. The
171 * mountlist contains one entry for each hostname and
175 MOUNTPROC_DUMP(void) = 2;
178 * Removes the mount list entry for the directory
179 * Unix authentication required.
182 MOUNTPROC_UMNT(dirpath) = 3;
185 * Removes all of the mount list entries for this client
186 * Unix authentication required.
189 MOUNTPROC_UMNTALL(void) = 4;
192 * Returns a list of all the exported filesystems, and which
193 * machines are allowed to import it.
196 MOUNTPROC_EXPORT(void) = 5;
199 * Identical to MOUNTPROC_EXPORT above
202 MOUNTPROC_EXPORTALL(void) = 6;
207 * Does no work. It is made available in all RPC services
208 * to allow server reponse testing and timing
211 MOUNTPROC_NULL(void) = 0;
214 * If mountres3.fhs_status is MNT3_OK, then
215 * mountres3.mountinfo contains the file handle for
216 * the directory and a list of acceptable
217 * authentication flavors. This file handle may only
218 * be used in the NFS version 3 protocol. This
219 * procedure also results in the server adding a new
220 * entry to its mount list recording that this client
221 * has mounted the directory. AUTH_UNIX authentication
222 * or better is required.
225 MOUNTPROC_MNT(dirpath) = 1;
228 * Returns the list of remotely mounted filesystems. The
229 * mountlist contains one entry for each hostname and
233 MOUNTPROC_DUMP(void) = 2;
236 * Removes the mount list entry for the directory
237 * Unix authentication required.
240 MOUNTPROC_UMNT(dirpath) = 3;
243 * Removes all of the mount list entries for this client
244 * Unix authentication required.
247 MOUNTPROC_UMNTALL(void) = 4;
250 * Returns a list of all the exported filesystems, and which
251 * machines are allowed to import it.
254 MOUNTPROC_EXPORT(void) = 5;