1 /* @(#)mount.x 2.1 88/08/01 4.0 RPCSRC */ 2 /* @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro */ 3 4 /* 5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 6 * unrestricted use provided that this legend is included on all tape 7 * media and as a part of the software program in whole or part. Users 8 * may copy or modify Sun RPC without charge, but are not authorized 9 * to license or distribute it to anyone else except as part of a product or 10 * program developed by the user. 11 * 12 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 13 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 14 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 15 * 16 * Sun RPC is provided with no support and without any obligation on the 17 * part of Sun Microsystems, Inc. to assist in its use, correction, 18 * modification or enhancement. 19 * 20 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 21 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 22 * OR ANY PART THEREOF. 23 * 24 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 25 * or profits or other special, indirect and consequential damages, even if 26 * Sun has been advised of the possibility of such damages. 27 * 28 * Sun Microsystems, Inc. 29 * 2550 Garcia Avenue 30 * Mountain View, California 94043 31 */ 32 33 /* 34 * Protocol description for the mount program 35 */ 36 37 38 const MNTPATHLEN = 1024; /* maximum bytes in a pathname argument */ 39 const MNTNAMLEN = 255; /* maximum bytes in a name argument */ 40 const FHSIZE = 32; /* size in bytes of a file handle */ 41 42 /* 43 * The fhandle is the file handle that the server passes to the client. 44 * All file operations are done using the file handles to refer to a file 45 * or a directory. The file handle can contain whatever information the 46 * server needs to distinguish an individual file. 47 */ 48 typedef opaque fhandle[FHSIZE]; 49 50 /* 51 * If a status of zero is returned, the call completed successfully, and 52 * a file handle for the directory follows. A non-zero status indicates 53 * some sort of error. The status corresponds with UNIX error numbers. 54 */ 55 union fhstatus switch (unsigned fhs_status) { 56 case 0: 57 fhandle fhs_fhandle; 58 default: 59 void; 60 }; 61 62 /* 63 * The type dirpath is the pathname of a directory 64 */ 65 typedef string dirpath<MNTPATHLEN>; 66 67 /* 68 * The type name is used for arbitrary names (hostnames, groupnames) 69 */ 70 typedef string name<MNTNAMLEN>; 71 72 /* 73 * A list of who has what mounted 74 */ 75 typedef struct mountbody *mountlist; 76 struct mountbody { 77 name ml_hostname; 78 dirpath ml_directory; 79 mountlist ml_next; 80 }; 81 82 /* 83 * A list of netgroups 84 */ 85 typedef struct groupnode *groups; 86 struct groupnode { 87 name gr_name; 88 groups gr_next; 89 }; 90 91 /* 92 * A list of what is exported and to whom 93 */ 94 typedef struct exportnode *exports; 95 struct exportnode { 96 dirpath ex_dir; 97 groups ex_groups; 98 exports ex_next; 99 }; 100 101 program MOUNTPROG { 102 /* 103 * Version one of the mount protocol communicates with version two 104 * of the NFS protocol. The only connecting point is the fhandle 105 * structure, which is the same for both protocols. 106 */ 107 version MOUNTVERS { 108 /* 109 * Does no work. It is made available in all RPC services 110 * to allow server response testing and timing 111 */ 112 void 113 MOUNTPROC_NULL(void) = 0; 114 115 /* 116 * If fhs_status is 0, then fhs_fhandle contains the 117 * file handle for the directory. This file handle may 118 * be used in the NFS protocol. This procedure also adds 119 * a new entry to the mount list for this client mounting 120 * the directory. 121 * Unix authentication required. 122 */ 123 fhstatus 124 MOUNTPROC_MNT(dirpath) = 1; 125 126 /* 127 * Returns the list of remotely mounted filesystems. The 128 * mountlist contains one entry for each hostname and 129 * directory pair. 130 */ 131 mountlist 132 MOUNTPROC_DUMP(void) = 2; 133 134 /* 135 * Removes the mount list entry for the directory 136 * Unix authentication required. 137 */ 138 void 139 MOUNTPROC_UMNT(dirpath) = 3; 140 141 /* 142 * Removes all of the mount list entries for this client 143 * Unix authentication required. 144 */ 145 void 146 MOUNTPROC_UMNTALL(void) = 4; 147 148 /* 149 * Returns a list of all the exported filesystems, and which 150 * machines are allowed to import it. 151 */ 152 exports 153 MOUNTPROC_EXPORT(void) = 5; 154 155 /* 156 * Identical to MOUNTPROC_EXPORT above 157 */ 158 exports 159 MOUNTPROC_EXPORTALL(void) = 6; 160 } = 1; 161 } = 100005; 162