Merge remote-tracking branch 'origin/master'
[unleashed/lotheac.git] / usr / src / uts / common / rpc / sec / key_prot.c
blobf8599ab89dcfd41a1ad7af29af4db878ae8ab7b0
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
28 * Please do not edit this file.
29 * It was generated using rpcgen.
32 #pragma ident "%Z%%M% %I% %E% SMI"
34 #include <rpc/key_prot.h>
35 /* @(#)key_prot.x 1.10 90/01/03 Copyright (c) 1990, 1991 SMI */
38 * Compiled from key_prot.x using rpcgen.
39 * DO NOT EDIT THIS FILE!
40 * This is NOT source code!
43 bool_t
44 xdr_keystatus(XDR *xdrs, keystatus *objp)
46 if (!xdr_enum(xdrs, (enum_t *)objp))
47 return (FALSE);
48 return (TRUE);
51 bool_t
52 xdr_keybuf(XDR *xdrs, keybuf objp)
54 if (!xdr_opaque(xdrs, objp, HEXKEYBYTES))
55 return (FALSE);
56 return (TRUE);
59 bool_t
60 xdr_netnamestr(XDR *xdrs, netnamestr *objp)
62 if (!xdr_string(xdrs, objp, MAXNETNAMELEN))
63 return (FALSE);
65 return (TRUE);
68 bool_t
69 xdr_cryptkeyarg(XDR *xdrs, cryptkeyarg *objp)
71 if (!xdr_netnamestr(xdrs, &objp->remotename))
72 return (FALSE);
73 if (!xdr_des_block(xdrs, &objp->deskey))
74 return (FALSE);
75 return (TRUE);
78 bool_t
79 xdr_cryptkeyarg2(XDR *xdrs, cryptkeyarg2 *objp)
81 if (!xdr_netnamestr(xdrs, &objp->remotename))
82 return (FALSE);
83 if (!xdr_netobj(xdrs, &objp->remotekey))
84 return (FALSE);
85 if (!xdr_des_block(xdrs, &objp->deskey))
86 return (FALSE);
87 return (TRUE);
90 bool_t
91 xdr_cryptkeyres(XDR *xdrs, cryptkeyres *objp)
93 if (!xdr_keystatus(xdrs, &objp->status))
94 return (FALSE);
95 switch (objp->status) {
96 case KEY_SUCCESS:
97 if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
98 return (FALSE);
99 break;
100 default:
101 break;
103 return (TRUE);
106 bool_t
107 xdr_unixcred(XDR *xdrs, unixcred *objp)
109 if (!xdr_u_int(xdrs, &objp->uid))
110 return (FALSE);
111 if (!xdr_u_int(xdrs, &objp->gid))
112 return (FALSE);
113 if (!xdr_array(xdrs, (char **)&objp->gids.gids_val,
114 (uint_t *)&objp->gids.gids_len, MAXGIDS,
115 sizeof (uint_t), (xdrproc_t)xdr_u_int))
116 return (FALSE);
117 return (TRUE);
120 bool_t
121 xdr_getcredres(XDR *xdrs, getcredres *objp)
123 if (!xdr_keystatus(xdrs, &objp->status))
124 return (FALSE);
125 switch (objp->status) {
126 case KEY_SUCCESS:
127 if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
128 return (FALSE);
129 break;
130 default:
131 break;
133 return (TRUE);
136 bool_t
137 xdr_key_netstarg(XDR *xdrs, key_netstarg *objp)
139 if (!xdr_keybuf(xdrs, objp->st_priv_key))
140 return (FALSE);
141 if (!xdr_keybuf(xdrs, objp->st_pub_key))
142 return (FALSE);
145 if (!xdr_netnamestr(xdrs, &objp->st_netname))
146 return (FALSE);
148 return (TRUE);
151 bool_t
152 xdr_key_netstres(XDR *xdrs, key_netstres *objp)
154 if (!xdr_keystatus(xdrs, &objp->status))
155 return (FALSE);
156 switch (objp->status) {
157 case KEY_SUCCESS:
158 if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
159 return (FALSE);
160 break;
161 default:
162 break;
164 return (TRUE);