xref: /freebsd/lib/libc/rpc/key_prot_xdr.c (revision 8d6301358e34f15e019022cc5321bbd950a1fa01)
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  */
378360efbdSAlfred Perlstein /* From: #pragma ident	"@(#)key_prot.x	1.7	94/04/29 SMI" */
388360efbdSAlfred Perlstein /* $FreeBSD$ */
39e8636dfdSBill Paul /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
40e8636dfdSBill Paul 
41e8636dfdSBill Paul /*
42e8636dfdSBill Paul  * Compiled from key_prot.x using rpcgen.
43e8636dfdSBill Paul  * DO NOT EDIT THIS FILE!
44e8636dfdSBill Paul  * This is NOT source code!
45e8636dfdSBill Paul  */
46e8636dfdSBill Paul 
47e8636dfdSBill Paul bool_t
48e8636dfdSBill Paul xdr_keystatus(register XDR *xdrs, keystatus *objp)
49e8636dfdSBill Paul {
50e8636dfdSBill Paul 
51e8636dfdSBill Paul 	if (!xdr_enum(xdrs, (enum_t *)objp))
52e8636dfdSBill Paul 		return (FALSE);
53e8636dfdSBill Paul 	return (TRUE);
54e8636dfdSBill Paul }
55e8636dfdSBill Paul 
56e8636dfdSBill Paul bool_t
57e8636dfdSBill Paul xdr_keybuf(register XDR *xdrs, keybuf objp)
58e8636dfdSBill Paul {
59e8636dfdSBill Paul 
60e8636dfdSBill Paul 	if (!xdr_opaque(xdrs, objp, HEXKEYBYTES))
61e8636dfdSBill Paul 		return (FALSE);
62e8636dfdSBill Paul 	return (TRUE);
63e8636dfdSBill Paul }
64e8636dfdSBill Paul 
65e8636dfdSBill Paul bool_t
66e8636dfdSBill Paul xdr_netnamestr(register XDR *xdrs, netnamestr *objp)
67e8636dfdSBill Paul {
68e8636dfdSBill Paul 
69e8636dfdSBill Paul 	if (!xdr_string(xdrs, objp, MAXNETNAMELEN))
70e8636dfdSBill Paul 		return (FALSE);
71e8636dfdSBill Paul 	return (TRUE);
72e8636dfdSBill Paul }
73e8636dfdSBill Paul 
74e8636dfdSBill Paul bool_t
75e8636dfdSBill Paul xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp)
76e8636dfdSBill Paul {
77e8636dfdSBill Paul 
78e8636dfdSBill Paul 	if (!xdr_netnamestr(xdrs, &objp->remotename))
79e8636dfdSBill Paul 		return (FALSE);
80e8636dfdSBill Paul 	if (!xdr_des_block(xdrs, &objp->deskey))
81e8636dfdSBill Paul 		return (FALSE);
82e8636dfdSBill Paul 	return (TRUE);
83e8636dfdSBill Paul }
84e8636dfdSBill Paul 
85e8636dfdSBill Paul bool_t
86e8636dfdSBill Paul xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp)
87e8636dfdSBill Paul {
88e8636dfdSBill Paul 
89e8636dfdSBill Paul 	if (!xdr_netnamestr(xdrs, &objp->remotename))
90e8636dfdSBill Paul 		return (FALSE);
91e8636dfdSBill Paul 	if (!xdr_netobj(xdrs, &objp->remotekey))
92e8636dfdSBill Paul 		return (FALSE);
93e8636dfdSBill Paul 	if (!xdr_des_block(xdrs, &objp->deskey))
94e8636dfdSBill Paul 		return (FALSE);
95e8636dfdSBill Paul 	return (TRUE);
96e8636dfdSBill Paul }
97e8636dfdSBill Paul 
98e8636dfdSBill Paul bool_t
99e8636dfdSBill Paul xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
100e8636dfdSBill Paul {
101e8636dfdSBill Paul 
102e8636dfdSBill Paul 	if (!xdr_keystatus(xdrs, &objp->status))
103e8636dfdSBill Paul 		return (FALSE);
104e8636dfdSBill Paul 	switch (objp->status) {
105e8636dfdSBill Paul 	case KEY_SUCCESS:
106e8636dfdSBill Paul 		if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
107e8636dfdSBill Paul 			return (FALSE);
108e8636dfdSBill Paul 		break;
1098d630135SAlfred Perlstein 	default:
1108d630135SAlfred Perlstein 		break;
111e8636dfdSBill Paul 	}
112e8636dfdSBill Paul 	return (TRUE);
113e8636dfdSBill Paul }
114e8636dfdSBill Paul 
115e8636dfdSBill Paul bool_t
116e8636dfdSBill Paul xdr_unixcred(register XDR *xdrs, unixcred *objp)
117e8636dfdSBill Paul {
118e8636dfdSBill Paul 
119e8636dfdSBill Paul 	if (!xdr_u_int(xdrs, &objp->uid))
120e8636dfdSBill Paul 		return (FALSE);
121e8636dfdSBill Paul 	if (!xdr_u_int(xdrs, &objp->gid))
122e8636dfdSBill Paul 		return (FALSE);
123e8636dfdSBill Paul 	if (!xdr_array(xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, MAXGIDS,
124e8636dfdSBill Paul 		sizeof (u_int), (xdrproc_t) xdr_u_int))
125e8636dfdSBill Paul 		return (FALSE);
126e8636dfdSBill Paul 	return (TRUE);
127e8636dfdSBill Paul }
128e8636dfdSBill Paul 
129e8636dfdSBill Paul bool_t
130e8636dfdSBill Paul xdr_getcredres(register XDR *xdrs, getcredres *objp)
131e8636dfdSBill Paul {
132e8636dfdSBill Paul 
133e8636dfdSBill Paul 	if (!xdr_keystatus(xdrs, &objp->status))
134e8636dfdSBill Paul 		return (FALSE);
135e8636dfdSBill Paul 	switch (objp->status) {
136e8636dfdSBill Paul 	case KEY_SUCCESS:
137e8636dfdSBill Paul 		if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
138e8636dfdSBill Paul 			return (FALSE);
139e8636dfdSBill Paul 		break;
1408d630135SAlfred Perlstein 	default:
1418d630135SAlfred Perlstein 		break;
142e8636dfdSBill Paul 	}
143e8636dfdSBill Paul 	return (TRUE);
144e8636dfdSBill Paul }
145e8636dfdSBill Paul 
146e8636dfdSBill Paul bool_t
147e8636dfdSBill Paul xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp)
148e8636dfdSBill Paul {
149e8636dfdSBill Paul 
150e8636dfdSBill Paul 	if (!xdr_keybuf(xdrs, objp->st_priv_key))
151e8636dfdSBill Paul 		return (FALSE);
152e8636dfdSBill Paul 	if (!xdr_keybuf(xdrs, objp->st_pub_key))
153e8636dfdSBill Paul 		return (FALSE);
154e8636dfdSBill Paul 	if (!xdr_netnamestr(xdrs, &objp->st_netname))
155e8636dfdSBill Paul 		return (FALSE);
156e8636dfdSBill Paul 	return (TRUE);
157e8636dfdSBill Paul }
158e8636dfdSBill Paul 
159e8636dfdSBill Paul bool_t
160e8636dfdSBill Paul xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
161e8636dfdSBill Paul {
162e8636dfdSBill Paul 
163e8636dfdSBill Paul 	if (!xdr_keystatus(xdrs, &objp->status))
164e8636dfdSBill Paul 		return (FALSE);
165e8636dfdSBill Paul 	switch (objp->status) {
166e8636dfdSBill Paul 	case KEY_SUCCESS:
167e8636dfdSBill Paul 		if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
168e8636dfdSBill Paul 			return (FALSE);
169e8636dfdSBill Paul 		break;
1708d630135SAlfred Perlstein 	default:
1718d630135SAlfred Perlstein 		break;
172e8636dfdSBill Paul 	}
173e8636dfdSBill Paul 	return (TRUE);
174e8636dfdSBill Paul }
175