mount.x revision 1.6
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.4Ssimonb *
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.4Ssimonb *
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.4Ssimonb *
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.4Ssimonb *
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.4Ssimonb *
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.3Slukem%#include <sys/cdefs.h>
361.6Skleink%#ifndef __lint__
371.1Sjtc%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
381.1Sjtc%/*static char sccsid[] = "from: @(#)mount.x	2.1 88/08/01 4.0 RPCSRC";*/
391.6Skleink%__RCSID("$NetBSD: mount.x,v 1.6 2004/07/01 22:52:34 kleink Exp $");
401.5Syamt%/*	$FreeBSD: src/include/rpcsvc/mount.x,v 1.7 2003/05/04 02:51:42 obrien Exp $	*/
411.6Skleink%#endif /* not __lint__ */
421.1Sjtc#endif
431.1Sjtc
441.1Sjtcconst MNTPATHLEN = 1024;	/* maximum bytes in a pathname argument */
451.1Sjtcconst MNTNAMLEN = 255;		/* maximum bytes in a name argument */
461.1Sjtcconst FHSIZE = 32;		/* size in bytes of a file handle */
471.5Syamtconst FHSIZE3 = 64;		/* size in bytes of a file handle (v3) */
481.1Sjtc
491.1Sjtc/*
501.1Sjtc * The fhandle is the file handle that the server passes to the client.
511.1Sjtc * All file operations are done using the file handles to refer to a file
521.1Sjtc * or a directory. The file handle can contain whatever information the
531.1Sjtc * server needs to distinguish an individual file.
541.1Sjtc */
551.4Ssimonbtypedef opaque fhandle[FHSIZE];
561.5Syamttypedef opaque fhandle3<FHSIZE3>;
571.1Sjtc
581.1Sjtc/*
591.4Ssimonb * If a status of zero is returned, the call completed successfully, and
601.1Sjtc * a file handle for the directory follows. A non-zero status indicates
611.1Sjtc * some sort of error. The status corresponds with UNIX error numbers.
621.1Sjtc */
631.1Sjtcunion fhstatus switch (unsigned fhs_status) {
641.1Sjtccase 0:
651.1Sjtc	fhandle fhs_fhandle;
661.1Sjtcdefault:
671.1Sjtc	void;
681.1Sjtc};
691.1Sjtc
701.1Sjtc/*
711.5Syamt * Status codes returned by the version 3 mount call.
721.5Syamt */
731.5Syamtenum mountstat3 {
741.5Syamt	MNT3_OK = 0,                 /* no error */
751.5Syamt	MNT3ERR_PERM = 1,            /* Not owner */
761.5Syamt	MNT3ERR_NOENT = 2,           /* No such file or directory */
771.5Syamt	MNT3ERR_IO = 5,              /* I/O error */
781.5Syamt	MNT3ERR_ACCES = 13,          /* Permission denied */
791.5Syamt	MNT3ERR_NOTDIR = 20,         /* Not a directory */
801.5Syamt	MNT3ERR_INVAL = 22,          /* Invalid argument */
811.5Syamt	MNT3ERR_NAMETOOLONG = 63,    /* Filename too long */
821.5Syamt	MNT3ERR_NOTSUPP = 10004,     /* Operation not supported */
831.5Syamt	MNT3ERR_SERVERFAULT = 10006  /* A failure on the server */
841.5Syamt};
851.5Syamt
861.5Syamtstruct mountres3_ok {
871.5Syamt	fhandle3	fhandle;
881.5Syamt	int		auth_flavors<>;
891.5Syamt};
901.5Syamt
911.5Syamtunion mountres3 switch (mountstat3 fhs_status) {
921.5Syamtcase 0:
931.5Syamt	mountres3_ok	mountinfo;
941.5Syamtdefault:
951.5Syamt	void;
961.5Syamt};
971.5Syamt
981.5Syamt/*
991.1Sjtc * The type dirpath is the pathname of a directory
1001.1Sjtc */
1011.1Sjtctypedef string dirpath<MNTPATHLEN>;
1021.1Sjtc
1031.1Sjtc/*
1041.1Sjtc * The type name is used for arbitrary names (hostnames, groupnames)
1051.1Sjtc */
1061.1Sjtctypedef string name<MNTNAMLEN>;
1071.1Sjtc
1081.1Sjtc/*
1091.1Sjtc * A list of who has what mounted
1101.1Sjtc */
1111.1Sjtctypedef struct mountbody *mountlist;
1121.1Sjtcstruct mountbody {
1131.1Sjtc	name ml_hostname;
1141.1Sjtc	dirpath ml_directory;
1151.1Sjtc	mountlist ml_next;
1161.1Sjtc};
1171.1Sjtc
1181.1Sjtc/*
1191.1Sjtc * A list of netgroups
1201.1Sjtc */
1211.1Sjtctypedef struct groupnode *groups;
1221.1Sjtcstruct groupnode {
1231.1Sjtc	name gr_name;
1241.1Sjtc	groups gr_next;
1251.1Sjtc};
1261.1Sjtc
1271.1Sjtc/*
1281.1Sjtc * A list of what is exported and to whom
1291.1Sjtc */
1301.1Sjtctypedef struct exportnode *exports;
1311.1Sjtcstruct exportnode {
1321.1Sjtc	dirpath ex_dir;
1331.1Sjtc	groups ex_groups;
1341.1Sjtc	exports ex_next;
1351.1Sjtc};
1361.1Sjtc
1371.1Sjtcprogram MOUNTPROG {
1381.1Sjtc	/*
1391.1Sjtc	 * Version one of the mount protocol communicates with version two
1401.5Syamt	 * of the NFS protocol. Version three communicates with
1411.5Syamt	 * version three of the NFS protocol. The only connecting
1421.5Syamt	 * point is the fhandle structure, which is the same for both
1431.5Syamt	 * protocols.
1441.1Sjtc	 */
1451.1Sjtc	version MOUNTVERS {
1461.1Sjtc		/*
1471.1Sjtc		 * Does no work. It is made available in all RPC services
1481.1Sjtc		 * to allow server reponse testing and timing
1491.1Sjtc		 */
1501.1Sjtc		void
1511.1Sjtc		MOUNTPROC_NULL(void) = 0;
1521.1Sjtc
1531.4Ssimonb		/*
1541.1Sjtc		 * If fhs_status is 0, then fhs_fhandle contains the
1551.1Sjtc	 	 * file handle for the directory. This file handle may
1561.1Sjtc		 * be used in the NFS protocol. This procedure also adds
1571.1Sjtc		 * a new entry to the mount list for this client mounting
1581.1Sjtc		 * the directory.
1591.1Sjtc		 * Unix authentication required.
1601.1Sjtc		 */
1611.4Ssimonb		fhstatus
1621.1Sjtc		MOUNTPROC_MNT(dirpath) = 1;
1631.1Sjtc
1641.1Sjtc		/*
1651.4Ssimonb		 * Returns the list of remotely mounted filesystems. The
1661.4Ssimonb		 * mountlist contains one entry for each hostname and
1671.1Sjtc		 * directory pair.
1681.1Sjtc		 */
1691.1Sjtc		mountlist
1701.1Sjtc		MOUNTPROC_DUMP(void) = 2;
1711.1Sjtc
1721.1Sjtc		/*
1731.1Sjtc		 * Removes the mount list entry for the directory
1741.1Sjtc		 * Unix authentication required.
1751.1Sjtc		 */
1761.1Sjtc		void
1771.1Sjtc		MOUNTPROC_UMNT(dirpath) = 3;
1781.1Sjtc
1791.1Sjtc		/*
1801.1Sjtc		 * Removes all of the mount list entries for this client
1811.1Sjtc		 * Unix authentication required.
1821.1Sjtc		 */
1831.1Sjtc		void
1841.1Sjtc		MOUNTPROC_UMNTALL(void) = 4;
1851.1Sjtc
1861.1Sjtc		/*
1871.1Sjtc		 * Returns a list of all the exported filesystems, and which
1881.1Sjtc		 * machines are allowed to import it.
1891.1Sjtc		 */
1901.1Sjtc		exports
1911.1Sjtc		MOUNTPROC_EXPORT(void)  = 5;
1921.1Sjtc
1931.1Sjtc		/*
1941.1Sjtc		 * Identical to MOUNTPROC_EXPORT above
1951.1Sjtc		 */
1961.1Sjtc		exports
1971.1Sjtc		MOUNTPROC_EXPORTALL(void) = 6;
1981.1Sjtc	} = 1;
1991.5Syamt	version MOUNTVERS3 {
2001.5Syamt		/*
2011.5Syamt		 * Does no work. It is made available in all RPC services
2021.5Syamt		 * to allow server reponse testing and timing
2031.5Syamt		 */
2041.5Syamt		void
2051.5Syamt		MOUNTPROC_NULL(void) = 0;
2061.5Syamt
2071.5Syamt		/*
2081.5Syamt		 * If mountres3.fhs_status is MNT3_OK, then
2091.5Syamt		 * mountres3.mountinfo contains the file handle for
2101.5Syamt		 * the directory and a list of acceptable
2111.5Syamt		 * authentication flavors.  This file handle may only
2121.5Syamt		 * be used in the NFS version 3 protocol.  This
2131.5Syamt		 * procedure also results in the server adding a new
2141.5Syamt		 * entry to its mount list recording that this client
2151.5Syamt		 * has mounted the directory. AUTH_UNIX authentication
2161.5Syamt		 * or better is required.
2171.5Syamt		 */
2181.5Syamt		mountres3
2191.5Syamt		MOUNTPROC_MNT(dirpath) = 1;
2201.5Syamt
2211.5Syamt		/*
2221.5Syamt		 * Returns the list of remotely mounted filesystems. The
2231.5Syamt		 * mountlist contains one entry for each hostname and
2241.5Syamt		 * directory pair.
2251.5Syamt		 */
2261.5Syamt		mountlist
2271.5Syamt		MOUNTPROC_DUMP(void) = 2;
2281.5Syamt
2291.5Syamt		/*
2301.5Syamt		 * Removes the mount list entry for the directory
2311.5Syamt		 * Unix authentication required.
2321.5Syamt		 */
2331.5Syamt		void
2341.5Syamt		MOUNTPROC_UMNT(dirpath) = 3;
2351.5Syamt
2361.5Syamt		/*
2371.5Syamt		 * Removes all of the mount list entries for this client
2381.5Syamt		 * Unix authentication required.
2391.5Syamt		 */
2401.5Syamt		void
2411.5Syamt		MOUNTPROC_UMNTALL(void) = 4;
2421.5Syamt
2431.5Syamt		/*
2441.5Syamt		 * Returns a list of all the exported filesystems, and which
2451.5Syamt		 * machines are allowed to import it.
2461.5Syamt		 */
2471.5Syamt		exports
2481.5Syamt		MOUNTPROC_EXPORT(void)  = 5;
2491.5Syamt	} = 3;
2501.1Sjtc} = 100005;
251