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