1 /* 2 * Copyright (c) 1989 Jan-Simon Pendry 3 * Copyright (c) 1989 Imperial College of Science, Technology & Medicine 4 * Copyright (c) 1989 The Regents of the University of California. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * Jan-Simon Pendry at Imperial College, London. 9 * 10 * %sccs.include.redist.c% 11 * 12 * @(#)mount_xdr.c 5.4 (Berkeley) 02/09/92 13 * 14 * $Id: mount_xdr.c,v 5.2.2.1 1992/02/09 15:09:28 jsp beta $ 15 * 16 */ 17 18 #include "am.h" 19 #include "mount.h" 20 21 22 bool_t 23 xdr_fhandle(xdrs, objp) 24 XDR *xdrs; 25 fhandle objp; 26 { 27 if (!xdr_opaque(xdrs, objp, FHSIZE)) { 28 return (FALSE); 29 } 30 return (TRUE); 31 } 32 33 34 35 36 bool_t 37 xdr_fhstatus(xdrs, objp) 38 XDR *xdrs; 39 fhstatus *objp; 40 { 41 if (!xdr_u_int(xdrs, &objp->fhs_status)) { 42 return (FALSE); 43 } 44 switch (objp->fhs_status) { 45 case 0: 46 if (!xdr_fhandle(xdrs, objp->fhstatus_u.fhs_fhandle)) { 47 return (FALSE); 48 } 49 break; 50 } 51 return (TRUE); 52 } 53 54 55 56 57 bool_t 58 xdr_dirpath(xdrs, objp) 59 XDR *xdrs; 60 dirpath *objp; 61 { 62 if (!xdr_string(xdrs, objp, MNTPATHLEN)) { 63 return (FALSE); 64 } 65 return (TRUE); 66 } 67 68 69 70 71 bool_t 72 xdr_name(xdrs, objp) 73 XDR *xdrs; 74 name *objp; 75 { 76 if (!xdr_string(xdrs, objp, MNTNAMLEN)) { 77 return (FALSE); 78 } 79 return (TRUE); 80 } 81 82 83 84 85 bool_t 86 xdr_mountlist(xdrs, objp) 87 XDR *xdrs; 88 mountlist *objp; 89 { 90 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct mountbody), xdr_mountbody)) { 91 return (FALSE); 92 } 93 return (TRUE); 94 } 95 96 97 98 bool_t 99 xdr_mountbody(xdrs, objp) 100 XDR *xdrs; 101 mountbody *objp; 102 { 103 if (!xdr_name(xdrs, &objp->ml_hostname)) { 104 return (FALSE); 105 } 106 if (!xdr_dirpath(xdrs, &objp->ml_directory)) { 107 return (FALSE); 108 } 109 if (!xdr_mountlist(xdrs, &objp->ml_next)) { 110 return (FALSE); 111 } 112 return (TRUE); 113 } 114 115 116 117 118 bool_t 119 xdr_groups(xdrs, objp) 120 XDR *xdrs; 121 groups *objp; 122 { 123 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct groupnode), xdr_groupnode)) { 124 return (FALSE); 125 } 126 return (TRUE); 127 } 128 129 130 131 132 bool_t 133 xdr_groupnode(xdrs, objp) 134 XDR *xdrs; 135 groupnode *objp; 136 { 137 if (!xdr_name(xdrs, &objp->gr_name)) { 138 return (FALSE); 139 } 140 if (!xdr_groups(xdrs, &objp->gr_next)) { 141 return (FALSE); 142 } 143 return (TRUE); 144 } 145 146 147 148 149 bool_t 150 xdr_exports(xdrs, objp) 151 XDR *xdrs; 152 exports *objp; 153 { 154 if (!xdr_pointer(xdrs, (char **)objp, sizeof(struct exportnode), xdr_exportnode)) { 155 return (FALSE); 156 } 157 return (TRUE); 158 } 159 160 161 162 163 bool_t 164 xdr_exportnode(xdrs, objp) 165 XDR *xdrs; 166 exportnode *objp; 167 { 168 if (!xdr_dirpath(xdrs, &objp->ex_dir)) { 169 return (FALSE); 170 } 171 if (!xdr_groups(xdrs, &objp->ex_groups)) { 172 return (FALSE); 173 } 174 if (!xdr_exports(xdrs, &objp->ex_next)) { 175 return (FALSE); 176 } 177 return (TRUE); 178 } 179 180 181