types: remove the [u_]quad type and replace with [u]int64
[deb_libnfs.git] / nlm / libnfs-raw-nlm.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-nlm.h"
37
af8d37c8 38uint32_t
763cd6e3
RS
39zdr_nlm_fh4 (ZDR *zdrs, nlm_fh4 *objp)
40{
41 register int32_t *buf;
9c29b498 42 buf = NULL;
763cd6e3
RS
43
44 if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
45 return FALSE;
46 return TRUE;
47}
48
af8d37c8 49uint32_t
763cd6e3
RS
50zdr_nlm4_oh (ZDR *zdrs, nlm4_oh *objp)
51{
52 register int32_t *buf;
9c29b498 53 buf = NULL;
763cd6e3
RS
54
55 if (!zdr_string (zdrs, objp, ~0))
56 return FALSE;
57 return TRUE;
58}
59
af8d37c8 60uint32_t
763cd6e3
RS
61zdr_nlm_cookie (ZDR *zdrs, nlm_cookie *objp)
62{
63 register int32_t *buf;
9c29b498 64 buf = NULL;
763cd6e3
RS
65
66 if (!zdr_bytes (zdrs, (char **)&objp->data.data_val, (u_int *) &objp->data.data_len, ~0))
67 return FALSE;
68 return TRUE;
69}
70
af8d37c8 71uint32_t
763cd6e3
RS
72zdr_nlmstat4 (ZDR *zdrs, nlmstat4 *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_nlm4_holder (ZDR *zdrs, nlm4_holder *objp)
84{
85 register int32_t *buf;
9c29b498 86 buf = NULL;
763cd6e3
RS
87
88 if (!zdr_bool (zdrs, &objp->exclusive))
89 return FALSE;
90 if (!zdr_u_int (zdrs, &objp->svid))
91 return FALSE;
92 if (!zdr_nlm4_oh (zdrs, &objp->oh))
93 return FALSE;
bce63d84 94 if (!zdr_uint64_t (zdrs, &objp->l_offset))
763cd6e3 95 return FALSE;
bce63d84 96 if (!zdr_uint64_t (zdrs, &objp->l_len))
763cd6e3
RS
97 return FALSE;
98 return TRUE;
99}
100
af8d37c8 101uint32_t
763cd6e3
RS
102zdr_nlm4_lock (ZDR *zdrs, nlm4_lock *objp)
103{
104 register int32_t *buf;
9c29b498 105 buf = NULL;
763cd6e3
RS
106
107 if (!zdr_string (zdrs, &objp->caller_name, NLM_MAXNAME))
108 return FALSE;
109 if (!zdr_nlm_fh4 (zdrs, &objp->fh))
110 return FALSE;
111 if (!zdr_nlm4_oh (zdrs, &objp->oh))
112 return FALSE;
113 if (!zdr_u_int (zdrs, &objp->svid))
114 return FALSE;
bce63d84 115 if (!zdr_uint64_t (zdrs, &objp->l_offset))
763cd6e3 116 return FALSE;
bce63d84 117 if (!zdr_uint64_t (zdrs, &objp->l_len))
763cd6e3
RS
118 return FALSE;
119 return TRUE;
120}
121
af8d37c8 122uint32_t
763cd6e3
RS
123zdr_nlm4_share (ZDR *zdrs, nlm4_share *objp)
124{
125 register int32_t *buf;
9c29b498 126 buf = NULL;
763cd6e3
RS
127
128 if (!zdr_string (zdrs, &objp->caller_name, NLM_MAXNAME))
129 return FALSE;
130 if (!zdr_nlm_fh4 (zdrs, &objp->fh))
131 return FALSE;
132 if (!zdr_nlm4_oh (zdrs, &objp->oh))
133 return FALSE;
134 if (!zdr_u_int (zdrs, &objp->mode))
135 return FALSE;
136 if (!zdr_u_int (zdrs, &objp->access))
137 return FALSE;
138 return TRUE;
139}
140
af8d37c8 141uint32_t
763cd6e3
RS
142zdr_nlm4_testres_denied (ZDR *zdrs, nlm4_testres_denied *objp)
143{
144 register int32_t *buf;
9c29b498 145 buf = NULL;
763cd6e3
RS
146
147 if (!zdr_nlm4_holder (zdrs, &objp->holder))
148 return FALSE;
149 return TRUE;
150}
151
af8d37c8 152uint32_t
763cd6e3
RS
153zdr_nlm4_testreply (ZDR *zdrs, nlm4_testreply *objp)
154{
155 register int32_t *buf;
9c29b498 156 buf = NULL;
763cd6e3
RS
157
158 if (!zdr_nlmstat4 (zdrs, &objp->status))
159 return FALSE;
160 switch (objp->status) {
161 case NLM4_DENIED:
162 if (!zdr_nlm4_testres_denied (zdrs, &objp->nlm4_testreply_u.lock))
163 return FALSE;
164 break;
165 default:
166 break;
167 }
168 return TRUE;
169}
170
af8d37c8 171uint32_t
763cd6e3
RS
172zdr_NLM4_TESTres (ZDR *zdrs, NLM4_TESTres *objp)
173{
174 register int32_t *buf;
9c29b498 175 buf = NULL;
763cd6e3
RS
176
177 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
178 return FALSE;
179 if (!zdr_nlm4_testreply (zdrs, &objp->reply))
180 return FALSE;
181 return TRUE;
182}
183
af8d37c8 184uint32_t
763cd6e3
RS
185zdr_NLM4_TESTargs (ZDR *zdrs, NLM4_TESTargs *objp)
186{
187 register int32_t *buf;
9c29b498 188 buf = NULL;
763cd6e3
RS
189
190 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
191 return FALSE;
192 if (!zdr_bool (zdrs, &objp->exclusive))
193 return FALSE;
194 if (!zdr_nlm4_lock (zdrs, &objp->lock))
195 return FALSE;
196 return TRUE;
197}
198
af8d37c8 199uint32_t
763cd6e3
RS
200zdr_NLM4_CANCres (ZDR *zdrs, NLM4_CANCres *objp)
201{
202 register int32_t *buf;
9c29b498 203 buf = NULL;
763cd6e3
RS
204
205 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
206 return FALSE;
207 if (!zdr_nlmstat4 (zdrs, &objp->status))
208 return FALSE;
209 return TRUE;
210}
211
af8d37c8 212uint32_t
763cd6e3
RS
213zdr_NLM4_CANCargs (ZDR *zdrs, NLM4_CANCargs *objp)
214{
215 register int32_t *buf;
9c29b498 216 buf = NULL;
763cd6e3
RS
217
218 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
219 return FALSE;
220 if (!zdr_bool (zdrs, &objp->block))
221 return FALSE;
222 if (!zdr_bool (zdrs, &objp->exclusive))
223 return FALSE;
224 if (!zdr_nlm4_lock (zdrs, &objp->lock))
225 return FALSE;
226 return TRUE;
227}
228
af8d37c8 229uint32_t
763cd6e3
RS
230zdr_NLM4_UNLOCKres (ZDR *zdrs, NLM4_UNLOCKres *objp)
231{
232 register int32_t *buf;
9c29b498 233 buf = NULL;
763cd6e3
RS
234
235 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
236 return FALSE;
237 if (!zdr_nlmstat4 (zdrs, &objp->status))
238 return FALSE;
239 return TRUE;
240}
241
af8d37c8 242uint32_t
763cd6e3
RS
243zdr_NLM4_UNLOCKargs (ZDR *zdrs, NLM4_UNLOCKargs *objp)
244{
245 register int32_t *buf;
9c29b498 246 buf = NULL;
763cd6e3
RS
247
248 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
249 return FALSE;
250 if (!zdr_nlm4_lock (zdrs, &objp->lock))
251 return FALSE;
252 return TRUE;
253}
254
af8d37c8 255uint32_t
763cd6e3
RS
256zdr_NLM4_LOCKres (ZDR *zdrs, NLM4_LOCKres *objp)
257{
258 register int32_t *buf;
9c29b498 259 buf = NULL;
763cd6e3
RS
260
261 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
262 return FALSE;
263 if (!zdr_nlmstat4 (zdrs, &objp->status))
264 return FALSE;
265 return TRUE;
266}
267
af8d37c8 268uint32_t
763cd6e3
RS
269zdr_NLM4_LOCKargs (ZDR *zdrs, NLM4_LOCKargs *objp)
270{
271 register int32_t *buf;
9c29b498 272 buf = NULL;
763cd6e3
RS
273
274 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
275 return FALSE;
276 if (!zdr_bool (zdrs, &objp->block))
277 return FALSE;
278 if (!zdr_bool (zdrs, &objp->exclusive))
279 return FALSE;
280 if (!zdr_nlm4_lock (zdrs, &objp->lock))
281 return FALSE;
282 if (!zdr_bool (zdrs, &objp->reclaim))
283 return FALSE;
284 if (!zdr_int (zdrs, &objp->state))
285 return FALSE;
286 return TRUE;
287}
288
af8d37c8 289uint32_t
763cd6e3
RS
290zdr_NLM4_GRANTEDargs (ZDR *zdrs, NLM4_GRANTEDargs *objp)
291{
292 register int32_t *buf;
9c29b498 293 buf = NULL;
763cd6e3
RS
294
295 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
296 return FALSE;
297 if (!zdr_bool (zdrs, &objp->exclusive))
298 return FALSE;
299 if (!zdr_nlm4_lock (zdrs, &objp->lock))
300 return FALSE;
301 return TRUE;
302}
303
af8d37c8 304uint32_t
763cd6e3
RS
305zdr_NLM4_GRANTEDres (ZDR *zdrs, NLM4_GRANTEDres *objp)
306{
307 register int32_t *buf;
9c29b498 308 buf = NULL;
763cd6e3
RS
309
310 if (!zdr_nlm_cookie (zdrs, &objp->cookie))
311 return FALSE;
312 if (!zdr_nlmstat4 (zdrs, &objp->status))
313 return FALSE;
314 return TRUE;
315}