xref: /freebsd/include/rpcsvc/mount.x (revision 1130b656e5fe4c2d1ba299e024d1b40eaeebd380)
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.
8  *
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.
12  *
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.
16  *
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.
20  *
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.
24  *
25  * Sun Microsystems, Inc.
26  * 2550 Garcia Avenue
27  * Mountain View, California  94043
28  */
29 
30 /*
31  * Protocol description for the mount program
32  */
33 
34 #ifndef RPC_HDR
35 %#ifndef lint
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 %static char rcsid[] = "$FreeBSD$";
39 %#endif /* not lint */
40 #endif
41 
42 const MNTPATHLEN = 1024;	/* maximum bytes in a pathname argument */
43 const MNTNAMLEN = 255;		/* maximum bytes in a name argument */
44 const FHSIZE = 32;		/* size in bytes of a file handle */
45 
46 /*
47  * The fhandle is the file handle that the server passes to the client.
48  * All file operations are done using the file handles to refer to a file
49  * or a directory. The file handle can contain whatever information the
50  * server needs to distinguish an individual file.
51  */
52 typedef opaque fhandle[FHSIZE];
53 
54 /*
55  * If a status of zero is returned, the call completed successfully, and
56  * a file handle for the directory follows. A non-zero status indicates
57  * some sort of error. The status corresponds with UNIX error numbers.
58  */
59 union fhstatus switch (unsigned fhs_status) {
60 case 0:
61 	fhandle fhs_fhandle;
62 default:
63 	void;
64 };
65 
66 /*
67  * The type dirpath is the pathname of a directory
68  */
69 typedef string dirpath<MNTPATHLEN>;
70 
71 /*
72  * The type name is used for arbitrary names (hostnames, groupnames)
73  */
74 typedef string name<MNTNAMLEN>;
75 
76 /*
77  * A list of who has what mounted
78  */
79 typedef struct mountbody *mountlist;
80 struct mountbody {
81 	name ml_hostname;
82 	dirpath ml_directory;
83 	mountlist ml_next;
84 };
85 
86 /*
87  * A list of netgroups
88  */
89 typedef struct groupnode *groups;
90 struct groupnode {
91 	name gr_name;
92 	groups gr_next;
93 };
94 
95 /*
96  * A list of what is exported and to whom
97  */
98 typedef struct exportnode *exports;
99 struct exportnode {
100 	dirpath ex_dir;
101 	groups ex_groups;
102 	exports ex_next;
103 };
104 
105 program MOUNTPROG {
106 	/*
107 	 * Version one of the mount protocol communicates with version two
108 	 * of the NFS protocol. The only connecting point is the fhandle
109 	 * structure, which is the same for both protocols.
110 	 */
111 	version MOUNTVERS {
112 		/*
113 		 * Does no work. It is made available in all RPC services
114 		 * to allow server reponse testing and timing
115 		 */
116 		void
117 		MOUNTPROC_NULL(void) = 0;
118 
119 		/*
120 		 * If fhs_status is 0, then fhs_fhandle contains the
121 	 	 * file handle for the directory. This file handle may
122 		 * be used in the NFS protocol. This procedure also adds
123 		 * a new entry to the mount list for this client mounting
124 		 * the directory.
125 		 * Unix authentication required.
126 		 */
127 		fhstatus
128 		MOUNTPROC_MNT(dirpath) = 1;
129 
130 		/*
131 		 * Returns the list of remotely mounted filesystems. The
132 		 * mountlist contains one entry for each hostname and
133 		 * directory pair.
134 		 */
135 		mountlist
136 		MOUNTPROC_DUMP(void) = 2;
137 
138 		/*
139 		 * Removes the mount list entry for the directory
140 		 * Unix authentication required.
141 		 */
142 		void
143 		MOUNTPROC_UMNT(dirpath) = 3;
144 
145 		/*
146 		 * Removes all of the mount list entries for this client
147 		 * Unix authentication required.
148 		 */
149 		void
150 		MOUNTPROC_UMNTALL(void) = 4;
151 
152 		/*
153 		 * Returns a list of all the exported filesystems, and which
154 		 * machines are allowed to import it.
155 		 */
156 		exports
157 		MOUNTPROC_EXPORT(void)  = 5;
158 
159 		/*
160 		 * Identical to MOUNTPROC_EXPORT above
161 		 */
162 		exports
163 		MOUNTPROC_EXPORTALL(void) = 6;
164 	} = 1;
165 } = 100005;
166