mount.x revision 1.4
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.1Sjtc%#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.4Ssimonb%__RCSID("$NetBSD: mount.x,v 1.4 1999/07/02 15:44:13 simonb Exp $"); 401.1Sjtc%#endif /* not lint */ 411.1Sjtc#endif 421.1Sjtc 431.1Sjtcconst MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */ 441.1Sjtcconst MNTNAMLEN = 255; /* maximum bytes in a name argument */ 451.1Sjtcconst FHSIZE = 32; /* size in bytes of a file handle */ 461.1Sjtc 471.1Sjtc/* 481.1Sjtc * The fhandle is the file handle that the server passes to the client. 491.1Sjtc * All file operations are done using the file handles to refer to a file 501.1Sjtc * or a directory. The file handle can contain whatever information the 511.1Sjtc * server needs to distinguish an individual file. 521.1Sjtc */ 531.4Ssimonbtypedef opaque fhandle[FHSIZE]; 541.1Sjtc 551.1Sjtc/* 561.4Ssimonb * If a status of zero is returned, the call completed successfully, and 571.1Sjtc * a file handle for the directory follows. A non-zero status indicates 581.1Sjtc * some sort of error. The status corresponds with UNIX error numbers. 591.1Sjtc */ 601.1Sjtcunion fhstatus switch (unsigned fhs_status) { 611.1Sjtccase 0: 621.1Sjtc fhandle fhs_fhandle; 631.1Sjtcdefault: 641.1Sjtc void; 651.1Sjtc}; 661.1Sjtc 671.1Sjtc/* 681.1Sjtc * The type dirpath is the pathname of a directory 691.1Sjtc */ 701.1Sjtctypedef string dirpath<MNTPATHLEN>; 711.1Sjtc 721.1Sjtc/* 731.1Sjtc * The type name is used for arbitrary names (hostnames, groupnames) 741.1Sjtc */ 751.1Sjtctypedef string name<MNTNAMLEN>; 761.1Sjtc 771.1Sjtc/* 781.1Sjtc * A list of who has what mounted 791.1Sjtc */ 801.1Sjtctypedef struct mountbody *mountlist; 811.1Sjtcstruct mountbody { 821.1Sjtc name ml_hostname; 831.1Sjtc dirpath ml_directory; 841.1Sjtc mountlist ml_next; 851.1Sjtc}; 861.1Sjtc 871.1Sjtc/* 881.1Sjtc * A list of netgroups 891.1Sjtc */ 901.1Sjtctypedef struct groupnode *groups; 911.1Sjtcstruct groupnode { 921.1Sjtc name gr_name; 931.1Sjtc groups gr_next; 941.1Sjtc}; 951.1Sjtc 961.1Sjtc/* 971.1Sjtc * A list of what is exported and to whom 981.1Sjtc */ 991.1Sjtctypedef struct exportnode *exports; 1001.1Sjtcstruct exportnode { 1011.1Sjtc dirpath ex_dir; 1021.1Sjtc groups ex_groups; 1031.1Sjtc exports ex_next; 1041.1Sjtc}; 1051.1Sjtc 1061.1Sjtcprogram MOUNTPROG { 1071.1Sjtc /* 1081.1Sjtc * Version one of the mount protocol communicates with version two 1091.4Ssimonb * of the NFS protocol. The only connecting point is the fhandle 1101.1Sjtc * structure, which is the same for both protocols. 1111.1Sjtc */ 1121.1Sjtc version MOUNTVERS { 1131.1Sjtc /* 1141.1Sjtc * Does no work. It is made available in all RPC services 1151.1Sjtc * to allow server reponse testing and timing 1161.1Sjtc */ 1171.1Sjtc void 1181.1Sjtc MOUNTPROC_NULL(void) = 0; 1191.1Sjtc 1201.4Ssimonb /* 1211.1Sjtc * If fhs_status is 0, then fhs_fhandle contains the 1221.1Sjtc * file handle for the directory. This file handle may 1231.1Sjtc * be used in the NFS protocol. This procedure also adds 1241.1Sjtc * a new entry to the mount list for this client mounting 1251.1Sjtc * the directory. 1261.1Sjtc * Unix authentication required. 1271.1Sjtc */ 1281.4Ssimonb fhstatus 1291.1Sjtc MOUNTPROC_MNT(dirpath) = 1; 1301.1Sjtc 1311.1Sjtc /* 1321.4Ssimonb * Returns the list of remotely mounted filesystems. The 1331.4Ssimonb * mountlist contains one entry for each hostname and 1341.1Sjtc * directory pair. 1351.1Sjtc */ 1361.1Sjtc mountlist 1371.1Sjtc MOUNTPROC_DUMP(void) = 2; 1381.1Sjtc 1391.1Sjtc /* 1401.1Sjtc * Removes the mount list entry for the directory 1411.1Sjtc * Unix authentication required. 1421.1Sjtc */ 1431.1Sjtc void 1441.1Sjtc MOUNTPROC_UMNT(dirpath) = 3; 1451.1Sjtc 1461.1Sjtc /* 1471.1Sjtc * Removes all of the mount list entries for this client 1481.1Sjtc * Unix authentication required. 1491.1Sjtc */ 1501.1Sjtc void 1511.1Sjtc MOUNTPROC_UMNTALL(void) = 4; 1521.1Sjtc 1531.1Sjtc /* 1541.1Sjtc * Returns a list of all the exported filesystems, and which 1551.1Sjtc * machines are allowed to import it. 1561.1Sjtc */ 1571.1Sjtc exports 1581.1Sjtc MOUNTPROC_EXPORT(void) = 5; 1591.1Sjtc 1601.1Sjtc /* 1611.1Sjtc * Identical to MOUNTPROC_EXPORT above 1621.1Sjtc */ 1631.1Sjtc exports 1641.1Sjtc MOUNTPROC_EXPORTALL(void) = 6; 1651.1Sjtc } = 1; 1661.1Sjtc} = 100005; 167