1 /* 2 * Please do not edit this file. 3 * It was generated using rpcgen. 4 */ 5 6 #include <rpc/key_prot.h> 7 /* 8 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 9 * unrestricted use provided that this legend is included on all tape 10 * media and as a part of the software program in whole or part. Users 11 * may copy or modify Sun RPC without charge, but are not authorized 12 * to license or distribute it to anyone else except as part of a product or 13 * program developed by the user. 14 * 15 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 16 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 18 * 19 * Sun RPC is provided with no support and without any obligation on the 20 * part of Sun Microsystems, Inc. to assist in its use, correction, 21 * modification or enhancement. 22 * 23 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 24 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 25 * OR ANY PART THEREOF. 26 * 27 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 28 * or profits or other special, indirect and consequential damages, even if 29 * Sun has been advised of the possibility of such damages. 30 * 31 * Sun Microsystems, Inc. 32 * 2550 Garcia Avenue 33 * Mountain View, California 94043 34 */ 35 #pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI" 36 37 /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */ 38 39 /* 40 * Compiled from key_prot.x using rpcgen. 41 * DO NOT EDIT THIS FILE! 42 * This is NOT source code! 43 */ 44 45 bool_t 46 xdr_keystatus(register XDR *xdrs, keystatus *objp) 47 { 48 49 if (!xdr_enum(xdrs, (enum_t *)objp)) 50 return (FALSE); 51 return (TRUE); 52 } 53 54 bool_t 55 xdr_keybuf(register XDR *xdrs, keybuf objp) 56 { 57 58 if (!xdr_opaque(xdrs, objp, HEXKEYBYTES)) 59 return (FALSE); 60 return (TRUE); 61 } 62 63 bool_t 64 xdr_netnamestr(register XDR *xdrs, netnamestr *objp) 65 { 66 67 if (!xdr_string(xdrs, objp, MAXNETNAMELEN)) 68 return (FALSE); 69 return (TRUE); 70 } 71 72 bool_t 73 xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp) 74 { 75 76 if (!xdr_netnamestr(xdrs, &objp->remotename)) 77 return (FALSE); 78 if (!xdr_des_block(xdrs, &objp->deskey)) 79 return (FALSE); 80 return (TRUE); 81 } 82 83 bool_t 84 xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp) 85 { 86 87 if (!xdr_netnamestr(xdrs, &objp->remotename)) 88 return (FALSE); 89 if (!xdr_netobj(xdrs, &objp->remotekey)) 90 return (FALSE); 91 if (!xdr_des_block(xdrs, &objp->deskey)) 92 return (FALSE); 93 return (TRUE); 94 } 95 96 bool_t 97 xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp) 98 { 99 100 if (!xdr_keystatus(xdrs, &objp->status)) 101 return (FALSE); 102 switch (objp->status) { 103 case KEY_SUCCESS: 104 if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey)) 105 return (FALSE); 106 break; 107 } 108 return (TRUE); 109 } 110 111 bool_t 112 xdr_unixcred(register XDR *xdrs, unixcred *objp) 113 { 114 115 if (!xdr_u_int(xdrs, &objp->uid)) 116 return (FALSE); 117 if (!xdr_u_int(xdrs, &objp->gid)) 118 return (FALSE); 119 if (!xdr_array(xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, MAXGIDS, 120 sizeof (u_int), (xdrproc_t) xdr_u_int)) 121 return (FALSE); 122 return (TRUE); 123 } 124 125 bool_t 126 xdr_getcredres(register XDR *xdrs, getcredres *objp) 127 { 128 129 if (!xdr_keystatus(xdrs, &objp->status)) 130 return (FALSE); 131 switch (objp->status) { 132 case KEY_SUCCESS: 133 if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred)) 134 return (FALSE); 135 break; 136 } 137 return (TRUE); 138 } 139 140 bool_t 141 xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp) 142 { 143 144 if (!xdr_keybuf(xdrs, objp->st_priv_key)) 145 return (FALSE); 146 if (!xdr_keybuf(xdrs, objp->st_pub_key)) 147 return (FALSE); 148 if (!xdr_netnamestr(xdrs, &objp->st_netname)) 149 return (FALSE); 150 return (TRUE); 151 } 152 153 bool_t 154 xdr_key_netstres(register XDR *xdrs, key_netstres *objp) 155 { 156 157 if (!xdr_keystatus(xdrs, &objp->status)) 158 return (FALSE); 159 switch (objp->status) { 160 case KEY_SUCCESS: 161 if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet)) 162 return (FALSE); 163 break; 164 } 165 return (TRUE); 166 } 167