RPC: get rid of bool_t
[deb_libnfs.git] / mount / libnfs-raw-mount.c
CommitLineData
a0c4ea7d
RS
1/*
2Copyright (c) 2014, Ronnie Sahlberg
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7
81. Redistributions of source code must retain the above copyright notice, this
9 list of conditions and the following disclaimer.
102. Redistributions in binary form must reproduce the above copyright notice,
11 this list of conditions and the following disclaimer in the documentation
12 and/or other materials provided with the distribution.
13
14THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
15ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
18ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
25The views and conclusions contained in the software and documentation are those
26of the authors and should not be interpreted as representing official policies,
27either expressed or implied, of the FreeBSD Project.
28*/
29
763cd6e3
RS
30/*
31 * Please do not edit this file.
32 * It was generated using rpcgen.
33 */
34
35#include "libnfs-zdr.h"
36#include "libnfs-raw-mount.h"
37
af8d37c8 38uint32_t
763cd6e3
RS
39zdr_fhandle3 (ZDR *zdrs, fhandle3 *objp)
40{
41 register int32_t *buf;
9c29b498 42 buf = NULL;
763cd6e3
RS
43
44 if (!zdr_bytes (zdrs, (char **)&objp->fhandle3_val, (u_int *) &objp->fhandle3_len, FHSIZE3))
45 return FALSE;
46 return TRUE;
47}
48
af8d37c8 49uint32_t
763cd6e3
RS
50zdr_dirpath (ZDR *zdrs, dirpath *objp)
51{
52 register int32_t *buf;
9c29b498 53 buf = NULL;
763cd6e3
RS
54
55 if (!zdr_string (zdrs, objp, MNTPATHLEN))
56 return FALSE;
57 return TRUE;
58}
59
af8d37c8 60uint32_t
763cd6e3
RS
61zdr_name (ZDR *zdrs, name *objp)
62{
63 register int32_t *buf;
9c29b498 64 buf = NULL;
763cd6e3
RS
65
66 if (!zdr_string (zdrs, objp, MNTNAMLEN))
67 return FALSE;
68 return TRUE;
69}
70
af8d37c8 71uint32_t
763cd6e3
RS
72zdr_mountstat3 (ZDR *zdrs, mountstat3 *objp)
73{
74 register int32_t *buf;
9c29b498 75 buf = NULL;
763cd6e3
RS
76
77 if (!zdr_enum (zdrs, (enum_t *) objp))
78 return FALSE;
79 return TRUE;
80}
81
af8d37c8 82uint32_t
763cd6e3
RS
83zdr_mountlist (ZDR *zdrs, mountlist *objp)
84{
85 register int32_t *buf;
9c29b498 86 buf = NULL;
763cd6e3
RS
87
88 if (!zdr_pointer (zdrs, (char **)objp, sizeof (struct mountbody), (zdrproc_t) zdr_mountbody))
89 return FALSE;
90 return TRUE;
91}
92
af8d37c8 93uint32_t
763cd6e3
RS
94zdr_mountbody (ZDR *zdrs, mountbody *objp)
95{
96 register int32_t *buf;
9c29b498 97 buf = NULL;
763cd6e3
RS
98
99 if (!zdr_name (zdrs, &objp->ml_hostname))
100 return FALSE;
101 if (!zdr_dirpath (zdrs, &objp->ml_directory))
102 return FALSE;
103 if (!zdr_mountlist (zdrs, &objp->ml_next))
104 return FALSE;
105 return TRUE;
106}
107
af8d37c8 108uint32_t
763cd6e3
RS
109zdr_groups (ZDR *zdrs, groups *objp)
110{
111 register int32_t *buf;
9c29b498 112 buf = NULL;
763cd6e3
RS
113
114 if (!zdr_pointer (zdrs, (char **)objp, sizeof (struct groupnode), (zdrproc_t) zdr_groupnode))
115 return FALSE;
116 return TRUE;
117}
118
af8d37c8 119uint32_t
763cd6e3
RS
120zdr_groupnode (ZDR *zdrs, groupnode *objp)
121{
122 register int32_t *buf;
9c29b498 123 buf = NULL;
763cd6e3
RS
124
125 if (!zdr_name (zdrs, &objp->gr_name))
126 return FALSE;
127 if (!zdr_groups (zdrs, &objp->gr_next))
128 return FALSE;
129 return TRUE;
130}
131
af8d37c8 132uint32_t
763cd6e3
RS
133zdr_exports (ZDR *zdrs, exports *objp)
134{
135 register int32_t *buf;
9c29b498 136 buf = NULL;
763cd6e3
RS
137
138 if (!zdr_pointer (zdrs, (char **)objp, sizeof (struct exportnode), (zdrproc_t) zdr_exportnode))
139 return FALSE;
140 return TRUE;
141}
142
af8d37c8 143uint32_t
763cd6e3
RS
144zdr_exportnode (ZDR *zdrs, exportnode *objp)
145{
146 register int32_t *buf;
9c29b498 147 buf = NULL;
763cd6e3
RS
148
149 if (!zdr_dirpath (zdrs, &objp->ex_dir))
150 return FALSE;
151 if (!zdr_groups (zdrs, &objp->ex_groups))
152 return FALSE;
153 if (!zdr_exports (zdrs, &objp->ex_next))
154 return FALSE;
155 return TRUE;
156}
157
af8d37c8 158uint32_t
763cd6e3
RS
159zdr_mountres3_ok (ZDR *zdrs, mountres3_ok *objp)
160{
161 register int32_t *buf;
9c29b498 162 buf = NULL;
763cd6e3
RS
163
164 if (!zdr_fhandle3 (zdrs, &objp->fhandle))
165 return FALSE;
166 if (!zdr_array (zdrs, (char **)&objp->auth_flavors.auth_flavors_val, (u_int *) &objp->auth_flavors.auth_flavors_len, ~0,
167 sizeof (int), (zdrproc_t) zdr_int))
168 return FALSE;
169 return TRUE;
170}
171
af8d37c8 172uint32_t
763cd6e3
RS
173zdr_mountres3 (ZDR *zdrs, mountres3 *objp)
174{
175 register int32_t *buf;
9c29b498 176 buf = NULL;
763cd6e3
RS
177
178 if (!zdr_mountstat3 (zdrs, &objp->fhs_status))
179 return FALSE;
180 switch (objp->fhs_status) {
181 case MNT3_OK:
182 if (!zdr_mountres3_ok (zdrs, &objp->mountres3_u.mountinfo))
183 return FALSE;
184 break;
185 default:
186 break;
187 }
188 return TRUE;
189}
190
af8d37c8 191uint32_t
763cd6e3
RS
192zdr_mountstat1 (ZDR *zdrs, mountstat1 *objp)
193{
194 register int32_t *buf;
9c29b498 195 buf = NULL;
763cd6e3
RS
196
197 if (!zdr_enum (zdrs, (enum_t *) objp))
198 return FALSE;
199 return TRUE;
200}
201
af8d37c8 202uint32_t
763cd6e3
RS
203zdr_fhandle1 (ZDR *zdrs, fhandle1 objp)
204{
205 register int32_t *buf;
9c29b498 206 buf = NULL;
763cd6e3
RS
207
208 if (!zdr_opaque (zdrs, objp, FHSIZE))
209 return FALSE;
210 return TRUE;
211}
212
af8d37c8 213uint32_t
763cd6e3
RS
214zdr_mountres1_ok (ZDR *zdrs, mountres1_ok *objp)
215{
216 register int32_t *buf;
9c29b498 217 buf = NULL;
763cd6e3
RS
218
219 if (!zdr_fhandle1 (zdrs, objp->fhandle))
220 return FALSE;
221 return TRUE;
222}
223
af8d37c8 224uint32_t
763cd6e3
RS
225zdr_mountres1 (ZDR *zdrs, mountres1 *objp)
226{
227 register int32_t *buf;
9c29b498 228 buf = NULL;
763cd6e3
RS
229
230 if (!zdr_mountstat1 (zdrs, &objp->fhs_status))
231 return FALSE;
232 switch (objp->fhs_status) {
233 case MNT1_OK:
234 if (!zdr_mountres1_ok (zdrs, &objp->mountres1_u.mountinfo))
235 return FALSE;
236 break;
237 default:
238 break;
239 }
240 return TRUE;
241}