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 or with the express written consent of
8 % * Sun Microsystems, Inc.
10 % * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 % * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12 % * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 % * Sun RPC is provided with no support and without any obligation on the
15 % * part of Sun Microsystems, Inc. to assist in its use, correction,
16 % * modification or enhancement.
18 % * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 % * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 % * OR ANY PART THEREOF.
22 % * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 % * or profits or other special, indirect and consequential damages, even if
24 % * Sun has been advised of the possibility of such damages.
26 % * Sun Microsystems, Inc.
27 % * 2550 Garcia Avenue
28 % * Mountain View, California 94043
32 % * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
35 %/* from @(#)mount.x 1.3 91/03/11 TIRPC 1.0 */
38 * Protocol description for the mount program
42 %#ifndef _rpcsvc_mount_h
43 %#define _rpcsvc_mount_h
47 const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */
48 const MNTNAMLEN = 255; /* maximum bytes in a name argument */
49 const FHSIZE = 32; /* size in bytes of a file handle */
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];
60 * If a status of zero is returned, the call completed successfully, and
61 * a file handle for the directory follows. A non-zero status indicates
62 * some sort of error. The status corresponds with UNIX error numbers.
64 union fhstatus switch (unsigned fhs_status) {
72 * The type dirpath is the pathname of a directory
74 typedef string dirpath<MNTPATHLEN>;
77 * The type name is used for arbitrary names (hostnames, groupnames)
79 typedef string name<MNTNAMLEN>;
82 * A list of who has what mounted
84 typedef struct mountbody *mountlist;
94 typedef struct groupnode *groups;
101 * A list of what is exported and to whom
103 typedef struct exportnode *exports;
111 * POSIX pathconf information
114 int pc_link_max; /* max links allowed */
115 short pc_max_canon; /* max line len for a tty */
116 short pc_max_input; /* input a tty can eat all at once */
117 short pc_name_max; /* max file name length (dir entry) */
118 short pc_path_max; /* max path name length (/x/y/x/.. ) */
119 short pc_pipe_buf; /* size of a pipe (bytes) */
120 u_char pc_vdisable; /* safe char to turn off c_cc[i] */
121 char pc_xxx; /* alignment padding; cc_t == char */
122 short pc_mask[2]; /* validity and boolean bits */
128 const FHSIZE3 = 64; /* max size of NFSv3 file handle in bytes */
129 typedef opaque fhandle3<FHSIZE3>;
135 MNT_OK = 0, /* no error */
136 MNT3ERR_PERM = 1, /* not owner */
137 MNT3ERR_NOENT = 2, /* no such file or directory */
138 MNT3ERR_IO = 5, /* I/O error */
139 MNT3ERR_ACCES = 13, /* Permission denied */
140 MNT3ERR_NOTDIR = 20, /* Not a directory */
141 MNT3ERR_INVAL = 22, /* Invalid argument */
142 MNT3ERR_NAMETOOLONG = 63, /* File name too long */
143 MNT3ERR_NOTSUPP = 10004,/* Operation not supported */
144 MNT3ERR_SERVERFAULT = 10006 /* A failure on the server */
150 struct mountres3_ok {
155 union mountres3 switch (mountstat3 fhs_status) {
157 mountres3_ok mountinfo; /* File handle and supported flavors */
164 * Version one of the mount protocol communicates with version two
165 * of the NFS protocol. The only connecting point is the fhandle
166 * structure, which is the same for both protocols.
170 * Does no work. It is made available in all RPC services
171 * to allow server reponse testing and timing
174 MOUNTPROC_NULL(void) = 0;
177 * If fhs_status is 0, then fhs_fhandle contains the
178 * file handle for the directory. This file handle may
179 * be used in the NFS protocol. This procedure also adds
180 * a new entry to the mount list for this client mounting
182 * Unix authentication required.
185 MOUNTPROC_MNT(dirpath) = 1;
188 * Returns the list of remotely mounted filesystems. The
189 * mountlist contains one entry for each hostname and
193 MOUNTPROC_DUMP(void) = 2;
196 * Removes the mount list entry for the directory
197 * Unix authentication required.
200 MOUNTPROC_UMNT(dirpath) = 3;
203 * Removes all of the mount list entries for this client
204 * Unix authentication required.
207 MOUNTPROC_UMNTALL(void) = 4;
210 * Returns a list of all the exported filesystems, and which
211 * machines are allowed to import it.
214 MOUNTPROC_EXPORT(void) = 5;
217 * Identical to MOUNTPROC_EXPORT above
220 MOUNTPROC_EXPORTALL(void) = 6;
224 * Version two of the mount protocol communicates with version two
225 * of the NFS protocol.
226 * The only difference from version one is the addition of a POSIX
229 version MOUNTVERS_POSIX {
231 * Does no work. It is made available in all RPC services
232 * to allow server reponse testing and timing
235 MOUNTPROC_NULL(void) = 0;
238 * If fhs_status is 0, then fhs_fhandle contains the
239 * file handle for the directory. This file handle may
240 * be used in the NFS protocol. This procedure also adds
241 * a new entry to the mount list for this client mounting
243 * Unix authentication required.
246 MOUNTPROC_MNT(dirpath) = 1;
249 * Returns the list of remotely mounted filesystems. The
250 * mountlist contains one entry for each hostname and
254 MOUNTPROC_DUMP(void) = 2;
257 * Removes the mount list entry for the directory
258 * Unix authentication required.
261 MOUNTPROC_UMNT(dirpath) = 3;
264 * Removes all of the mount list entries for this client
265 * Unix authentication required.
268 MOUNTPROC_UMNTALL(void) = 4;
271 * Returns a list of all the exported filesystems, and which
272 * machines are allowed to import it.
275 MOUNTPROC_EXPORT(void) = 5;
278 * Identical to MOUNTPROC_EXPORT above
281 MOUNTPROC_EXPORTALL(void) = 6;
284 * POSIX pathconf info (Sun hack)
287 MOUNTPROC_PATHCONF(dirpath) = 7;
291 * Version 3 of the protocol is for NFSv3
293 version MOUNTVERS_NFSV3 {
295 * Does no work. It is made available in all RPC services
296 * to allow server reponse testing and timing
299 MOUNTPROC3_NULL(void) = 0;
302 * If fhs_status is 0, then fhs_fhandle contains the
303 * file handle for the directory. This file handle may
304 * be used in the NFS protocol. This procedure also adds
305 * a new entry to the mount list for this client mounting
307 * Unix authentication required.
310 MOUNTPROC3_MNT(dirpath) = 1;
313 * Returns the list of remotely mounted filesystems. The
314 * mountlist contains one entry for each hostname and
318 MOUNTPROC3_DUMP(void) = 2;
321 * Removes the mount list entry for the directory
322 * Unix authentication required.
325 MOUNTPROC3_UMNT(dirpath) = 3;
328 * Removes all of the mount list entries for this client
329 * Unix authentication required.
332 MOUNTPROC3_UMNTALL(void) = 4;
335 * Returns a list of all the exported filesystems, and which
336 * machines are allowed to import it.
339 MOUNTPROC3_EXPORT(void) = 5;
344 %#endif /*!_rpcsvc_mount_h*/