Debian Codegraph @

extra/tirpc/libtirpc-1.3.5/src/key_prot_xdr.c

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