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