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 (!INTUSE(xdr_enum
) (xdrs
, (enum_t
*) objp
))
48 xdr_keybuf (XDR
* xdrs
, keybuf objp
)
50 if (!INTUSE(xdr_opaque
) (xdrs
, objp
, HEXKEYBYTES
))
58 xdr_netnamestr (XDR
* xdrs
, netnamestr
* objp
)
60 if (!INTUSE(xdr_string
) (xdrs
, objp
, MAXNETNAMELEN
))
65 INTDEF(xdr_netnamestr
)
68 xdr_cryptkeyarg (XDR
* xdrs
, cryptkeyarg
* objp
)
70 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->remotename
))
73 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->deskey
))
78 INTDEF(xdr_cryptkeyarg
)
81 xdr_cryptkeyarg2 (XDR
* xdrs
, cryptkeyarg2
* objp
)
83 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->remotename
))
85 if (!INTUSE(xdr_netobj
) (xdrs
, &objp
->remotekey
))
87 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->deskey
))
91 INTDEF(xdr_cryptkeyarg2
)
94 xdr_cryptkeyres (XDR
* xdrs
, cryptkeyres
* objp
)
96 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
101 if (!INTUSE(xdr_des_block
) (xdrs
, &objp
->cryptkeyres_u
.deskey
))
109 INTDEF(xdr_cryptkeyres
)
112 xdr_unixcred (XDR
* xdrs
, unixcred
* objp
)
114 if (!INTUSE(xdr_u_int
) (xdrs
, &objp
->uid
))
116 if (!INTUSE(xdr_u_int
) (xdrs
, &objp
->gid
))
118 if (!INTUSE(xdr_array
) (xdrs
, (void *) &objp
->gids
.gids_val
,
119 (u_int
*) & objp
->gids
.gids_len
, MAXGIDS
,
120 sizeof (u_int
), (xdrproc_t
) INTUSE(xdr_u_int
)))
127 xdr_getcredres (XDR
* xdrs
, getcredres
* objp
)
129 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
131 switch (objp
->status
)
134 if (!INTUSE(xdr_unixcred
) (xdrs
, &objp
->getcredres_u
.cred
))
144 xdr_key_netstarg (XDR
* xdrs
, key_netstarg
* objp
)
146 if (!INTUSE(xdr_keybuf
) (xdrs
, objp
->st_priv_key
))
148 if (!INTUSE(xdr_keybuf
) (xdrs
, objp
->st_pub_key
))
150 if (!INTUSE(xdr_netnamestr
) (xdrs
, &objp
->st_netname
))
154 INTDEF(xdr_key_netstarg
)
157 xdr_key_netstres (XDR
* xdrs
, key_netstres
* objp
)
159 if (!INTUSE(xdr_keystatus
) (xdrs
, &objp
->status
))
161 switch (objp
->status
)
164 if (!INTUSE(xdr_key_netstarg
) (xdrs
, &objp
->key_netstres_u
.knet
))
172 INTDEF(xdr_key_netstres
)