ReactOS 0.4.15-dev-7934-g1dc8d80
key_prot_xdr.c
Go to the documentation of this file.
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
46xdr_keystatus(register XDR *xdrs, keystatus *objp)
47{
48
49 if (!xdr_enum(xdrs, (enum_t *)objp))
50 return (FALSE);
51 return (TRUE);
52}
53
55xdr_keybuf(register XDR *xdrs, keybuf objp)
56{
57
58 if (!xdr_opaque(xdrs, objp, HEXKEYBYTES))
59 return (FALSE);
60 return (TRUE);
61}
62
64xdr_netnamestr(register XDR *xdrs, netnamestr *objp)
65{
66
67 if (!xdr_string(xdrs, objp, MAXNETNAMELEN))
68 return (FALSE);
69 return (TRUE);
70}
71
73xdr_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
84xdr_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
97xdr_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
113bool_t
114xdr_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,
123 return (FALSE);
124 return (TRUE);
125}
126
127bool_t
128xdr_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
144bool_t
145xdr_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
157bool_t
158xdr_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
bool_t xdr_u_int(XDR *xdrs, u_int *up)
Definition: xdr.c:133
bool_t xdr_string(XDR *xdrs, char **cpp, u_int maxsize)
Definition: xdr.c:678
bool_t xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt)
Definition: xdr.c:484
bool_t xdr_netobj(XDR *xdrs, struct netobj *np)
Definition: xdr.c:609
bool_t xdr_enum(XDR *xdrs, enum_t *ep)
Definition: xdr.c:458
#define MAXNETNAMELEN
Definition: auth.h:78
UINT32 u_int
Definition: types.h:82
int32_t bool_t
Definition: types.h:101
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
int32_t enum_t
Definition: types.h:102
bool_t xdr_key_netstres(register XDR *xdrs, key_netstres *objp)
Definition: key_prot_xdr.c:158
bool_t xdr_unixcred(register XDR *xdrs, unixcred *objp)
Definition: key_prot_xdr.c:114
bool_t xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp)
Definition: key_prot_xdr.c:145
bool_t xdr_netnamestr(register XDR *xdrs, netnamestr *objp)
Definition: key_prot_xdr.c:64
bool_t xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp)
Definition: key_prot_xdr.c:97
bool_t xdr_getcredres(register XDR *xdrs, getcredres *objp)
Definition: key_prot_xdr.c:128
bool_t xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp)
Definition: key_prot_xdr.c:73
bool_t xdr_keybuf(register XDR *xdrs, keybuf objp)
Definition: key_prot_xdr.c:55
bool_t xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp)
Definition: key_prot_xdr.c:84
bool_t xdr_keystatus(register XDR *xdrs, keystatus *objp)
Definition: key_prot_xdr.c:46
bool_t xdr_des_block(XDR *xdrs, des_block *blkp)
Definition: rpc_prot.c:100
Definition: xdr.h:103
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
bool_t xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc)
Definition: xdr_array.c:61