2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3 * unrestricted use provided that this legend is included on all tape
4 * media and as a part of the software program in whole or part. Users
5 * may copy or modify Sun RPC without charge, but are not authorized
6 * to license or distribute it to anyone else except as part of a product or
7 * program developed by the user.
9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
13 * Sun RPC is provided with no support and without any obligation on the
14 * part of Sun Microsystems, Inc. to assist in its use, correction,
15 * modification or enhancement.
17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19 * OR ANY PART THEREOF.
21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22 * or profits or other special, indirect and consequential damages, even if
23 * Sun has been advised of the possibility of such damages.
25 * Sun Microsystems, Inc.
27 * Mountain View, California 94043
30 #pragma ident "@(#)key_prot.x 1.7 94/04/29 SMI"
33 /* Copyright (c) 1990, 1991 Sun Microsystems, Inc. */
35 #include "rpc/key_prot.h"
38 xdr_keystatus (XDR
* xdrs
, keystatus
* objp
)
40 if (!xdr_enum (xdrs
, (enum_t
*) objp
))
47 xdr_keybuf (XDR
* xdrs
, keybuf objp
)
49 if (!xdr_opaque (xdrs
, objp
, HEXKEYBYTES
))
56 xdr_netnamestr (XDR
* xdrs
, netnamestr
* objp
)
58 if (!xdr_string (xdrs
, objp
, MAXNETNAMELEN
))
65 xdr_cryptkeyarg (XDR
* xdrs
, cryptkeyarg
* objp
)
67 if (!xdr_netnamestr (xdrs
, &objp
->remotename
))
70 if (!xdr_des_block (xdrs
, &objp
->deskey
))
77 xdr_cryptkeyarg2 (XDR
* xdrs
, cryptkeyarg2
* objp
)
79 if (!xdr_netnamestr (xdrs
, &objp
->remotename
))
81 if (!xdr_netobj (xdrs
, &objp
->remotekey
))
83 if (!xdr_des_block (xdrs
, &objp
->deskey
))
89 xdr_cryptkeyres (XDR
* xdrs
, cryptkeyres
* objp
)
91 if (!xdr_keystatus (xdrs
, &objp
->status
))
96 if (!xdr_des_block (xdrs
, &objp
->cryptkeyres_u
.deskey
))
106 xdr_unixcred (XDR
* xdrs
, unixcred
* objp
)
108 if (!xdr_u_int (xdrs
, &objp
->uid
))
110 if (!xdr_u_int (xdrs
, &objp
->gid
))
112 if (!xdr_array (xdrs
, (char **) &objp
->gids
.gids_val
,
113 (u_int
*) & objp
->gids
.gids_len
, MAXGIDS
,
114 sizeof (u_int
), (xdrproc_t
) xdr_u_int
))
120 xdr_getcredres (XDR
* xdrs
, getcredres
* objp
)
122 if (!xdr_keystatus (xdrs
, &objp
->status
))
124 switch (objp
->status
)
127 if (!xdr_unixcred (xdrs
, &objp
->getcredres_u
.cred
))
137 xdr_key_netstarg (XDR
* xdrs
, key_netstarg
* objp
)
139 if (!xdr_keybuf (xdrs
, objp
->st_priv_key
))
141 if (!xdr_keybuf (xdrs
, objp
->st_pub_key
))
143 if (!xdr_netnamestr (xdrs
, &objp
->st_netname
))
149 xdr_key_netstres (XDR
* xdrs
, key_netstres
* objp
)
151 if (!xdr_keystatus (xdrs
, &objp
->status
))
153 switch (objp
->status
)
156 if (!xdr_key_netstarg (xdrs
, &objp
->key_netstres_u
.knet
))