source: rtems-libbsd/freebsd/lib/libc/rpc/key_prot_xdr.c @ 60b1d40

5-freebsd-12freebsd-9.3
Last change on this file since 60b1d40 was 60b1d40, checked in by Sebastian Huber <sebastian.huber@…>, on Jun 9, 2016 at 8:23:57 AM

RPC(3): Import from FreeBSD

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