2 % * Copyright (c) 2009, Sun Microsystems, Inc.
3 % * All rights reserved.
5 % * Redistribution and use in source and binary forms, with or without
6 % * modification, are permitted provided that the following conditions are met:
7 % * - Redistributions of source code must retain the above copyright notice,
8 % * this list of conditions and the following disclaimer.
9 % * - Redistributions in binary form must reproduce the above copyright notice,
10 % * this list of conditions and the following disclaimer in the documentation
11 % * and/or other materials provided with the distribution.
12 % * - Neither the name of Sun Microsystems, Inc. nor the names of its
13 % * contributors may be used to endorse or promote products derived
14 % * from this software without specific prior written permission.
16 % * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 % * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 % * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 % * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 % * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 % * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 % * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 % * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 % * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 % * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 % * POSSIBILITY OF SUCH DAMAGE.
30 % * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
33 %/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */
36 * Protocol description for the mount program
40 %#ifndef _rpcsvc_mount_h
41 %#define _rpcsvc_mount_h
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 */
50 * The fhandle is the file handle that the server passes to the client.
51 * All file operations are done using the file handles to refer to a file
52 * or a directory. The file handle can contain whatever information the
53 * server needs to distinguish an individual file.
55 typedef opaque fhandle[FHSIZE];
58 * If a status of zero is returned, the call completed successfully, and
59 * a file handle for the directory follows. A non-zero status indicates
60 * some sort of error. The status corresponds with UNIX error numbers.
62 union fhstatus switch (unsigned fhs_status) {
70 * The type dirpath is the pathname of a directory
72 typedef string dirpath<MNTPATHLEN>;
75 * The type name is used for arbitrary names (hostnames, groupnames)
77 typedef string name<MNTNAMLEN>;
80 * A list of who has what mounted
82 typedef struct mountbody *mountlist;
92 typedef struct groupnode *groups;
99 * A list of what is exported and to whom
101 typedef struct exportnode *exports;
109 * POSIX pathconf information
112 int pc_link_max; /* max links allowed */
113 short pc_max_canon; /* max line len for a tty */
114 short pc_max_input; /* input a tty can eat all at once */
115 short pc_name_max; /* max file name length (dir entry) */
116 short pc_path_max; /* max path name length (/x/y/x/.. ) */
117 short pc_pipe_buf; /* size of a pipe (bytes) */
118 u_char pc_vdisable; /* safe char to turn off c_cc[i] */
119 char pc_xxx; /* alignment padding; cc_t == char */
120 short pc_mask[2]; /* validity and boolean bits */
126 const FHSIZE3 = 64; /* max size of NFSv3 file handle in bytes */
127 typedef opaque fhandle3<FHSIZE3>;
133 MNT_OK = 0, /* no error */
134 MNT3ERR_PERM = 1, /* not owner */
135 MNT3ERR_NOENT = 2, /* no such file or directory */
136 MNT3ERR_IO = 5, /* I/O error */
137 MNT3ERR_ACCES = 13, /* Permission denied */
138 MNT3ERR_NOTDIR = 20, /* Not a directory */
139 MNT3ERR_INVAL = 22, /* Invalid argument */
140 MNT3ERR_NAMETOOLONG = 63, /* File name too long */
141 MNT3ERR_NOTSUPP = 10004,/* Operation not supported */
142 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
148 struct mountres3_ok {
153 union mountres3 switch (mountstat3 fhs_status) {
155 mountres3_ok mountinfo; /* File handle and supported flavors */
162 * Version one of the mount protocol communicates with version two
163 * of the NFS protocol. The only connecting point is the fhandle
164 * structure, which is the same for both protocols.
168 * Does no work. It is made available in all RPC services
169 * to allow server reponse testing and timing
172 MOUNTPROC_NULL(void) = 0;
175 * If fhs_status is 0, then fhs_fhandle contains the
176 * file handle for the directory. This file handle may
177 * be used in the NFS protocol. This procedure also adds
178 * a new entry to the mount list for this client mounting
180 * Unix authentication required.
183 MOUNTPROC_MNT(dirpath) = 1;
186 * Returns the list of remotely mounted filesystems. The
187 * mountlist contains one entry for each hostname and
191 MOUNTPROC_DUMP(void) = 2;
194 * Removes the mount list entry for the directory
195 * Unix authentication required.
198 MOUNTPROC_UMNT(dirpath) = 3;
201 * Removes all of the mount list entries for this client
202 * Unix authentication required.
205 MOUNTPROC_UMNTALL(void) = 4;
208 * Returns a list of all the exported filesystems, and which
209 * machines are allowed to import it.
212 MOUNTPROC_EXPORT(void) = 5;
215 * Identical to MOUNTPROC_EXPORT above
218 MOUNTPROC_EXPORTALL(void) = 6;
222 * Version two of the mount protocol communicates with version two
223 * of the NFS protocol.
224 * The only difference from version one is the addition of a POSIX
227 version MOUNTVERS_POSIX {
229 * Does no work. It is made available in all RPC services
230 * to allow server reponse testing and timing
233 MOUNTPROC_NULL(void) = 0;
236 * If fhs_status is 0, then fhs_fhandle contains the
237 * file handle for the directory. This file handle may
238 * be used in the NFS protocol. This procedure also adds
239 * a new entry to the mount list for this client mounting
241 * Unix authentication required.
244 MOUNTPROC_MNT(dirpath) = 1;
247 * Returns the list of remotely mounted filesystems. The
248 * mountlist contains one entry for each hostname and
252 MOUNTPROC_DUMP(void) = 2;
255 * Removes the mount list entry for the directory
256 * Unix authentication required.
259 MOUNTPROC_UMNT(dirpath) = 3;
262 * Removes all of the mount list entries for this client
263 * Unix authentication required.
266 MOUNTPROC_UMNTALL(void) = 4;
269 * Returns a list of all the exported filesystems, and which
270 * machines are allowed to import it.
273 MOUNTPROC_EXPORT(void) = 5;
276 * Identical to MOUNTPROC_EXPORT above
279 MOUNTPROC_EXPORTALL(void) = 6;
282 * POSIX pathconf info (Sun hack)
285 MOUNTPROC_PATHCONF(dirpath) = 7;
289 * Version 3 of the protocol is for NFSv3
291 version MOUNTVERS_NFSV3 {
293 * Does no work. It is made available in all RPC services
294 * to allow server reponse testing and timing
297 MOUNTPROC3_NULL(void) = 0;
300 * If fhs_status is 0, then fhs_fhandle contains the
301 * file handle for the directory. This file handle may
302 * be used in the NFS protocol. This procedure also adds
303 * a new entry to the mount list for this client mounting
305 * Unix authentication required.
308 MOUNTPROC3_MNT(dirpath) = 1;
311 * Returns the list of remotely mounted filesystems. The
312 * mountlist contains one entry for each hostname and
316 MOUNTPROC3_DUMP(void) = 2;
319 * Removes the mount list entry for the directory
320 * Unix authentication required.
323 MOUNTPROC3_UMNT(dirpath) = 3;
326 * Removes all of the mount list entries for this client
327 * Unix authentication required.
330 MOUNTPROC3_UMNTALL(void) = 4;
333 * Returns a list of all the exported filesystems, and which
334 * machines are allowed to import it.
337 MOUNTPROC3_EXPORT(void) = 5;
342 %#endif /*!_rpcsvc_mount_h*/