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