mount.x revision 1.1
11.1Sjtc/*
21.1Sjtc * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
31.1Sjtc * unrestricted use provided that this legend is included on all tape
41.1Sjtc * media and as a part of the software program in whole or part.  Users
51.1Sjtc * may copy or modify Sun RPC without charge, but are not authorized
61.1Sjtc * to license or distribute it to anyone else except as part of a product or
71.1Sjtc * program developed by the user.
81.1Sjtc *
91.1Sjtc * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
101.1Sjtc * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
111.1Sjtc * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
121.1Sjtc *
131.1Sjtc * Sun RPC is provided with no support and without any obligation on the
141.1Sjtc * part of Sun Microsystems, Inc. to assist in its use, correction,
151.1Sjtc * modification or enhancement.
161.1Sjtc *
171.1Sjtc * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
181.1Sjtc * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
191.1Sjtc * OR ANY PART THEREOF.
201.1Sjtc *
211.1Sjtc * In no event will Sun Microsystems, Inc. be liable for any lost revenue
221.1Sjtc * or profits or other special, indirect and consequential damages, even if
231.1Sjtc * Sun has been advised of the possibility of such damages.
241.1Sjtc *
251.1Sjtc * Sun Microsystems, Inc.
261.1Sjtc * 2550 Garcia Avenue
271.1Sjtc * Mountain View, California  94043
281.1Sjtc */
291.1Sjtc
301.1Sjtc/*
311.1Sjtc * Protocol description for the mount program
321.1Sjtc */
331.1Sjtc
341.1Sjtc#ifndef RPC_HDR
351.1Sjtc%#ifndef lint
361.1Sjtc%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
371.1Sjtc%/*static char sccsid[] = "from: @(#)mount.x	2.1 88/08/01 4.0 RPCSRC";*/
381.1Sjtc%static char rcsid[] = "$Id: mount.x,v 1.1 1995/01/12 19:39:47 jtc Exp $";
391.1Sjtc%#endif /* not lint */
401.1Sjtc#endif
411.1Sjtc
421.1Sjtcconst MNTPATHLEN = 1024;	/* maximum bytes in a pathname argument */
431.1Sjtcconst MNTNAMLEN = 255;		/* maximum bytes in a name argument */
441.1Sjtcconst FHSIZE = 32;		/* size in bytes of a file handle */
451.1Sjtc
461.1Sjtc/*
471.1Sjtc * The fhandle is the file handle that the server passes to the client.
481.1Sjtc * All file operations are done using the file handles to refer to a file
491.1Sjtc * or a directory. The file handle can contain whatever information the
501.1Sjtc * server needs to distinguish an individual file.
511.1Sjtc */
521.1Sjtctypedef opaque fhandle[FHSIZE];
531.1Sjtc
541.1Sjtc/*
551.1Sjtc * If a status of zero is returned, the call completed successfully, and
561.1Sjtc * a file handle for the directory follows. A non-zero status indicates
571.1Sjtc * some sort of error. The status corresponds with UNIX error numbers.
581.1Sjtc */
591.1Sjtcunion fhstatus switch (unsigned fhs_status) {
601.1Sjtccase 0:
611.1Sjtc	fhandle fhs_fhandle;
621.1Sjtcdefault:
631.1Sjtc	void;
641.1Sjtc};
651.1Sjtc
661.1Sjtc/*
671.1Sjtc * The type dirpath is the pathname of a directory
681.1Sjtc */
691.1Sjtctypedef string dirpath<MNTPATHLEN>;
701.1Sjtc
711.1Sjtc/*
721.1Sjtc * The type name is used for arbitrary names (hostnames, groupnames)
731.1Sjtc */
741.1Sjtctypedef string name<MNTNAMLEN>;
751.1Sjtc
761.1Sjtc/*
771.1Sjtc * A list of who has what mounted
781.1Sjtc */
791.1Sjtctypedef struct mountbody *mountlist;
801.1Sjtcstruct mountbody {
811.1Sjtc	name ml_hostname;
821.1Sjtc	dirpath ml_directory;
831.1Sjtc	mountlist ml_next;
841.1Sjtc};
851.1Sjtc
861.1Sjtc/*
871.1Sjtc * A list of netgroups
881.1Sjtc */
891.1Sjtctypedef struct groupnode *groups;
901.1Sjtcstruct groupnode {
911.1Sjtc	name gr_name;
921.1Sjtc	groups gr_next;
931.1Sjtc};
941.1Sjtc
951.1Sjtc/*
961.1Sjtc * A list of what is exported and to whom
971.1Sjtc */
981.1Sjtctypedef struct exportnode *exports;
991.1Sjtcstruct exportnode {
1001.1Sjtc	dirpath ex_dir;
1011.1Sjtc	groups ex_groups;
1021.1Sjtc	exports ex_next;
1031.1Sjtc};
1041.1Sjtc
1051.1Sjtcprogram MOUNTPROG {
1061.1Sjtc	/*
1071.1Sjtc	 * Version one of the mount protocol communicates with version two
1081.1Sjtc	 * of the NFS protocol. The only connecting point is the fhandle
1091.1Sjtc	 * structure, which is the same for both protocols.
1101.1Sjtc	 */
1111.1Sjtc	version MOUNTVERS {
1121.1Sjtc		/*
1131.1Sjtc		 * Does no work. It is made available in all RPC services
1141.1Sjtc		 * to allow server reponse testing and timing
1151.1Sjtc		 */
1161.1Sjtc		void
1171.1Sjtc		MOUNTPROC_NULL(void) = 0;
1181.1Sjtc
1191.1Sjtc		/*
1201.1Sjtc		 * If fhs_status is 0, then fhs_fhandle contains the
1211.1Sjtc	 	 * file handle for the directory. This file handle may
1221.1Sjtc		 * be used in the NFS protocol. This procedure also adds
1231.1Sjtc		 * a new entry to the mount list for this client mounting
1241.1Sjtc		 * the directory.
1251.1Sjtc		 * Unix authentication required.
1261.1Sjtc		 */
1271.1Sjtc		fhstatus
1281.1Sjtc		MOUNTPROC_MNT(dirpath) = 1;
1291.1Sjtc
1301.1Sjtc		/*
1311.1Sjtc		 * Returns the list of remotely mounted filesystems. The
1321.1Sjtc		 * mountlist contains one entry for each hostname and
1331.1Sjtc		 * directory pair.
1341.1Sjtc		 */
1351.1Sjtc		mountlist
1361.1Sjtc		MOUNTPROC_DUMP(void) = 2;
1371.1Sjtc
1381.1Sjtc		/*
1391.1Sjtc		 * Removes the mount list entry for the directory
1401.1Sjtc		 * Unix authentication required.
1411.1Sjtc		 */
1421.1Sjtc		void
1431.1Sjtc		MOUNTPROC_UMNT(dirpath) = 3;
1441.1Sjtc
1451.1Sjtc		/*
1461.1Sjtc		 * Removes all of the mount list entries for this client
1471.1Sjtc		 * Unix authentication required.
1481.1Sjtc		 */
1491.1Sjtc		void
1501.1Sjtc		MOUNTPROC_UMNTALL(void) = 4;
1511.1Sjtc
1521.1Sjtc		/*
1531.1Sjtc		 * Returns a list of all the exported filesystems, and which
1541.1Sjtc		 * machines are allowed to import it.
1551.1Sjtc		 */
1561.1Sjtc		exports
1571.1Sjtc		MOUNTPROC_EXPORT(void)  = 5;
1581.1Sjtc
1591.1Sjtc		/*
1601.1Sjtc		 * Identical to MOUNTPROC_EXPORT above
1611.1Sjtc		 */
1621.1Sjtc		exports
1631.1Sjtc		MOUNTPROC_EXPORTALL(void) = 6;
1641.1Sjtc	} = 1;
1651.1Sjtc} = 100005;
166