1 /*
2  * Please do not edit this file.
3  * It was generated using rpcgen.
4  */
5 
6 #ifndef _WIN32
7 #include <rpc/key_prot.h>
8 /*
9  * Copyright (c) 2009, Sun Microsystems, Inc.
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions are met:
14  * - Redistributions of source code must retain the above copyright notice,
15  *   this list of conditions and the following disclaimer.
16  * - Redistributions in binary form must reproduce the above copyright notice,
17  *   this list of conditions and the following disclaimer in the documentation
18  *   and/or other materials provided with the distribution.
19  * - Neither the name of Sun Microsystems, Inc. nor the names of its
20  *   contributors may be used to endorse or promote products derived
21  *   from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 /* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
36 
37 //#include <sys/cdefs.h>
38 
39 /*
40  * Compiled from key_prot.x using rpcgen.
41  * DO NOT EDIT THIS FILE!
42  * This is NOT source code!
43  */
44 
45 bool_t
xdr_keystatus(register XDR * xdrs,keystatus * objp)46 xdr_keystatus(register XDR *xdrs, keystatus *objp)
47 {
48 
49 	if (!xdr_enum(xdrs, (enum_t *)objp))
50 		return (FALSE);
51 	return (TRUE);
52 }
53 
54 bool_t
xdr_keybuf(register XDR * xdrs,keybuf objp)55 xdr_keybuf(register XDR *xdrs, keybuf objp)
56 {
57 
58 	if (!xdr_opaque(xdrs, objp, HEXKEYBYTES))
59 		return (FALSE);
60 	return (TRUE);
61 }
62 
63 bool_t
xdr_netnamestr(register XDR * xdrs,netnamestr * objp)64 xdr_netnamestr(register XDR *xdrs, netnamestr *objp)
65 {
66 
67 	if (!xdr_string(xdrs, objp, MAXNETNAMELEN))
68 		return (FALSE);
69 	return (TRUE);
70 }
71 
72 bool_t
xdr_cryptkeyarg(register XDR * xdrs,cryptkeyarg * objp)73 xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp)
74 {
75 
76 	if (!xdr_netnamestr(xdrs, &objp->remotename))
77 		return (FALSE);
78 	if (!xdr_des_block(xdrs, &objp->deskey))
79 		return (FALSE);
80 	return (TRUE);
81 }
82 
83 bool_t
xdr_cryptkeyarg2(register XDR * xdrs,cryptkeyarg2 * objp)84 xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp)
85 {
86 
87 	if (!xdr_netnamestr(xdrs, &objp->remotename))
88 		return (FALSE);
89 	if (!xdr_netobj(xdrs, &objp->remotekey))
90 		return (FALSE);
91 	if (!xdr_des_block(xdrs, &objp->deskey))
92 		return (FALSE);
93 	return (TRUE);
94 }
95 
96 bool_t
xdr_cryptkeyres(register XDR * xdrs,cryptkeyres * objp)97 xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
98 {
99 
100 	if (!xdr_keystatus(xdrs, &objp->status))
101 		return (FALSE);
102 	switch (objp->status) {
103 	case KEY_SUCCESS:
104 		if (!xdr_des_block(xdrs, &objp->cryptkeyres_u.deskey))
105 			return (FALSE);
106 		break;
107 	default:
108 		break;
109 	}
110 	return (TRUE);
111 }
112 
113 bool_t
xdr_unixcred(register XDR * xdrs,unixcred * objp)114 xdr_unixcred(register XDR *xdrs, unixcred *objp)
115 {
116 
117 	if (!xdr_u_int(xdrs, &objp->uid))
118 		return (FALSE);
119 	if (!xdr_u_int(xdrs, &objp->gid))
120 		return (FALSE);
121 	if (!xdr_array(xdrs, (char **)&objp->gids.gids_val, (u_int *) &objp->gids.gids_len, MAXGIDS,
122 		sizeof (u_int), (xdrproc_t) xdr_u_int))
123 		return (FALSE);
124 	return (TRUE);
125 }
126 
127 bool_t
xdr_getcredres(register XDR * xdrs,getcredres * objp)128 xdr_getcredres(register XDR *xdrs, getcredres *objp)
129 {
130 
131 	if (!xdr_keystatus(xdrs, &objp->status))
132 		return (FALSE);
133 	switch (objp->status) {
134 	case KEY_SUCCESS:
135 		if (!xdr_unixcred(xdrs, &objp->getcredres_u.cred))
136 			return (FALSE);
137 		break;
138 	default:
139 		break;
140 	}
141 	return (TRUE);
142 }
143 
144 bool_t
xdr_key_netstarg(register XDR * xdrs,key_netstarg * objp)145 xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp)
146 {
147 
148 	if (!xdr_keybuf(xdrs, objp->st_priv_key))
149 		return (FALSE);
150 	if (!xdr_keybuf(xdrs, objp->st_pub_key))
151 		return (FALSE);
152 	if (!xdr_netnamestr(xdrs, &objp->st_netname))
153 		return (FALSE);
154 	return (TRUE);
155 }
156 
157 bool_t
xdr_key_netstres(register XDR * xdrs,key_netstres * objp)158 xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
159 {
160 
161 	if (!xdr_keystatus(xdrs, &objp->status))
162 		return (FALSE);
163 	switch (objp->status) {
164 	case KEY_SUCCESS:
165 		if (!xdr_key_netstarg(xdrs, &objp->key_netstres_u.knet))
166 			return (FALSE);
167 		break;
168 	default:
169 		break;
170 	}
171 	return (TRUE);
172 }
173 #endif
174