]> git.decadent.org.uk Git - nfs-utils.git/blob - utils/mount/nfsmount.x
ad4bf99894e8d6b2ee157fda65e07ce270d828f7
[nfs-utils.git] / utils / mount / nfsmount.x
1 %/*
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.
9 % *
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.
13 % *
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.
17 % *
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.
21 % *
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.
25 % *
26 % * Sun Microsystems, Inc.
27 % * 2550 Garcia Avenue
28 % * Mountain View, California  94043
29 % */
30
31 %/*
32 % * Copyright (c) 1985, 1990 by Sun Microsystems, Inc.
33 % */
34 %
35 %/* from @(#)mount.x    1.3 91/03/11 TIRPC 1.0 */
36
37 /*
38  * Protocol description for the mount program
39  */
40
41 #ifdef RPC_HDR
42 %#ifndef _rpcsvc_mount_h
43 %#define _rpcsvc_mount_h
44 #endif
45
46 #ifdef RPC_CLNT
47 %#include <string.h>            /* for memset() */
48 #endif
49 %#include <asm/types.h>
50
51 const MNTPATHLEN = 1024;        /* maximum bytes in a pathname argument */
52 const MNTNAMLEN = 255;          /* maximum bytes in a name argument */
53 const FHSIZE = 32;              /* size in bytes of a file handle */
54 const FHSIZE3 = 64;             /* size in bytes of a file handle */
55
56 /*
57  * The fhandle is the file handle that the server passes to the client.
58  * All file operations are done using the file handles to refer to a file
59  * or a directory. The file handle can contain whatever information the
60  * server needs to distinguish an individual file.
61  */
62 typedef opaque fhandle[FHSIZE]; 
63 typedef opaque fhandle3<FHSIZE3>;
64
65 enum mountstat3 {
66         MNT_OK                  = 0,            /* no error */
67         MNT3ERR_PERM            = 1,            /* not owner */
68         MNT3ERR_NOENT           = 2,            /* No such file or directory */
69         MNT3ERR_IO              = 5,            /* I/O error */
70         MNT3ERR_ACCES           = 13,           /* Permission denied */
71         MNT3ERR_NOTDIR          = 20,           /* Not a directory */
72         MNT3ERR_INVAL           = 22,           /* Invalid argument */
73         MNT3ERR_NAMETOOLONG     = 63,           /* File name too long */
74         MNT3ERR_NOTSUPP         = 10004,        /* Operation not supported */
75         MNT3ERR_SERVERFAULT     = 10006         /* A failure on the server */
76 };
77
78 /*
79  * If a status of zero is returned, the call completed successfully, and 
80  * a file handle for the directory follows. A non-zero status indicates
81  * some sort of error. The status corresponds with UNIX error numbers.
82  */
83 union fhstatus switch (unsigned fhs_status) {
84 case 0:
85         fhandle fhs_fhandle;
86 default:
87         void;
88 };
89
90 struct mountres3_ok {
91         fhandle3 fhandle;
92         int auth_flavours<>;
93 };
94
95 union mountres3 switch (mountstat3 fhs_status) {
96 case MNT_OK:
97         mountres3_ok mountinfo;
98 default:
99         void;
100 };
101
102 /*
103  * The type dirpath is the pathname of a directory
104  */
105 typedef string dirpath<MNTPATHLEN>;
106
107 /*
108  * The type name is used for arbitrary names (hostnames, groupnames)
109  */
110 typedef string name<MNTNAMLEN>;
111
112 /*
113  * A list of who has what mounted
114  */
115 typedef struct mountbody *mountlist;
116 struct mountbody {
117         name ml_hostname;
118         dirpath ml_directory;
119         mountlist ml_next;
120 };
121
122 /*
123  * A list of netgroups
124  */
125 typedef struct groupnode *groups;
126 struct groupnode {
127         name gr_name;
128         groups gr_next;
129 };
130
131 /*
132  * A list of what is exported and to whom
133  */
134 typedef struct exportnode *exports;
135 struct exportnode {
136         dirpath ex_dir;
137         groups ex_groups;
138         exports ex_next;
139 };
140
141 /*
142  * POSIX pathconf information
143  */
144 struct ppathcnf {
145         int     pc_link_max;    /* max links allowed */
146         short   pc_max_canon;   /* max line len for a tty */
147         short   pc_max_input;   /* input a tty can eat all at once */
148         short   pc_name_max;    /* max file name length (dir entry) */
149         short   pc_path_max;    /* max path name length (/x/y/x/.. ) */
150         short   pc_pipe_buf;    /* size of a pipe (bytes) */
151         u_char  pc_vdisable;    /* safe char to turn off c_cc[i] */
152         char    pc_xxx;         /* alignment padding; cc_t == char */
153         short   pc_mask[2];     /* validity and boolean bits */
154 };
155
156 program MOUNTPROG {
157         /*
158          * Version one of the mount protocol communicates with version two
159          * of the NFS protocol. The only connecting point is the fhandle 
160          * structure, which is the same for both protocols.
161          */
162         version MOUNTVERS {
163                 /*
164                  * Does no work. It is made available in all RPC services
165                  * to allow server reponse testing and timing
166                  */
167                 void
168                 MOUNTPROC_NULL(void) = 0;
169
170                 /*      
171                  * If fhs_status is 0, then fhs_fhandle contains the
172                  * file handle for the directory. This file handle may
173                  * be used in the NFS protocol. This procedure also adds
174                  * a new entry to the mount list for this client mounting
175                  * the directory.
176                  * Unix authentication required.
177                  */
178                 fhstatus 
179                 MOUNTPROC_MNT(dirpath) = 1;
180
181                 /*
182                  * Returns the list of remotely mounted filesystems. The 
183                  * mountlist contains one entry for each hostname and 
184                  * directory pair.
185                  */
186                 mountlist
187                 MOUNTPROC_DUMP(void) = 2;
188
189                 /*
190                  * Removes the mount list entry for the directory
191                  * Unix authentication required.
192                  */
193                 void
194                 MOUNTPROC_UMNT(dirpath) = 3;
195
196                 /*
197                  * Removes all of the mount list entries for this client
198                  * Unix authentication required.
199                  */
200                 void
201                 MOUNTPROC_UMNTALL(void) = 4;
202
203                 /*
204                  * Returns a list of all the exported filesystems, and which
205                  * machines are allowed to import it.
206                  */
207                 exports
208                 MOUNTPROC_EXPORT(void)  = 5;
209
210                 /*
211                  * Identical to MOUNTPROC_EXPORT above
212                  */
213                 exports
214                 MOUNTPROC_EXPORTALL(void) = 6;
215         } = 1;
216
217         /*
218          * Version two of the mount protocol communicates with version two
219          * of the NFS protocol.
220          * The only difference from version one is the addition of a POSIX
221          * pathconf call.
222          */
223         version MOUNTVERS_POSIX {
224                 /*
225                  * Does no work. It is made available in all RPC services
226                  * to allow server reponse testing and timing
227                  */
228                 void
229                 MOUNTPROC_NULL(void) = 0;
230
231                 /*      
232                  * If fhs_status is 0, then fhs_fhandle contains the
233                  * file handle for the directory. This file handle may
234                  * be used in the NFS protocol. This procedure also adds
235                  * a new entry to the mount list for this client mounting
236                  * the directory.
237                  * Unix authentication required.
238                  */
239                 fhstatus 
240                 MOUNTPROC_MNT(dirpath) = 1;
241
242                 /*
243                  * Returns the list of remotely mounted filesystems. The 
244                  * mountlist contains one entry for each hostname and 
245                  * directory pair.
246                  */
247                 mountlist
248                 MOUNTPROC_DUMP(void) = 2;
249
250                 /*
251                  * Removes the mount list entry for the directory
252                  * Unix authentication required.
253                  */
254                 void
255                 MOUNTPROC_UMNT(dirpath) = 3;
256
257                 /*
258                  * Removes all of the mount list entries for this client
259                  * Unix authentication required.
260                  */
261                 void
262                 MOUNTPROC_UMNTALL(void) = 4;
263
264                 /*
265                  * Returns a list of all the exported filesystems, and which
266                  * machines are allowed to import it.
267                  */
268                 exports
269                 MOUNTPROC_EXPORT(void)  = 5;
270
271                 /*
272                  * Identical to MOUNTPROC_EXPORT above
273                  */
274                 exports
275                 MOUNTPROC_EXPORTALL(void) = 6;
276
277                 /*
278                  * POSIX pathconf info (Sun hack)
279                  */
280                 ppathcnf
281                 MOUNTPROC_PATHCONF(dirpath) = 7;
282         } = 2;
283         version MOUNT_V3 {
284                 /*
285                  * Does no work. It is made available in all RPC services
286                  * to allow server reponse testing and timing
287                  */
288                 void
289                 MOUNTPROC3_NULL(void) = 0;
290
291                 /*      
292                  * If fhs_status is 0, then fhs_fhandle contains the
293                  * file handle for the directory. This file handle may
294                  * be used in the NFS protocol. This procedure also adds
295                  * a new entry to the mount list for this client mounting
296                  * the directory.
297                  * Unix authentication required.
298                  */
299                 mountres3
300                 MOUNTPROC3_MNT(dirpath) = 1;
301
302                 /*
303                  * Returns the list of remotely mounted filesystems. The 
304                  * mountlist contains one entry for each hostname and 
305                  * directory pair.
306                  */
307                 mountlist
308                 MOUNTPROC3_DUMP(void) = 2;
309
310                 /*
311                  * Removes the mount list entry for the directory
312                  * Unix authentication required.
313                  */
314                 void
315                 MOUNTPROC3_UMNT(dirpath) = 3;
316
317                 /*
318                  * Removes all of the mount list entries for this client
319                  * Unix authentication required.
320                  */
321                 void
322                 MOUNTPROC3_UMNTALL(void) = 4;
323
324                 /*
325                  * Returns a list of all the exported filesystems, and which
326                  * machines are allowed to import it.
327                  */
328                 exports
329                 MOUNTPROC3_EXPORT(void)  = 5;
330
331         } = 3;
332 } = 100005;
333
334 #ifdef RPC_HDR
335 %#endif /*!_rpcsvc_mount_h*/
336 #endif