1 #if defined(LIBC_SCCS) && !defined(lint)
2 static char sccsid[] = "@(#)authdes_prot.c 2.1 88/07/29 4.0 RPCSRC; from 1.6 88/02/08 SMI";
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.
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.
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.
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.
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.
31 * Sun Microsystems, Inc.
33 * Mountain View, California 94043
36 * Copyright (c) 1986-1991 by Sun Microsystems Inc.
40 * authdes_prot.c, XDR routines for DES authentication
43 #include "namespace.h"
44 #include <rpc/types.h>
47 #include <rpc/auth_des.h>
48 #include "un-namespace.h"
50 #define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
53 xdr_authdes_cred(xdrs, cred)
55 struct authdes_cred *cred;
57 enum authdes_namekind *padc_namekind = &cred->adc_namekind;
61 ATTEMPT(xdr_enum(xdrs, (enum_t *) padc_namekind));
62 switch (cred->adc_namekind) {
64 ATTEMPT(xdr_string(xdrs, &cred->adc_fullname.name,
66 ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.key,
68 ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.window,
69 sizeof(cred->adc_fullname.window)));
72 ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_nickname,
73 sizeof(cred->adc_nickname)));
82 xdr_authdes_verf(xdrs, verf)
84 struct authdes_verf *verf;
89 ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_xtimestamp,
91 ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_int_u,
92 sizeof(verf->adv_int_u)));