]> git.saurik.com Git - apple/network_cmds.git/blob - rpc_lockd.tproj/nlm_prot_xdr.c
network_cmds-245.8.tar.gz
[apple/network_cmds.git] / rpc_lockd.tproj / nlm_prot_xdr.c
1 /*
2 * Please do not edit this file.
3 * It was generated using rpcgen.
4 */
5
6 #include <rpcsvc/nlm_prot.h>
7 #ifndef lint
8 /*static char sccsid[] = "from: @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro";*/
9 /*static char sccsid[] = "from: * @(#)nlm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
10 static char rcsid[] = "$Id: nlm_prot_xdr.c,v 1.2 2002/09/27 05:04:03 lindak Exp $";
11 #endif /* not lint */
12
13 #if 1
14 /* XXX until we get real int32/64 xdr funcs */
15
16 #define xdr_int32_t xdr_int
17 #define xdr_u_int32_t xdr_u_int
18
19 /*
20 * XDR 64-bit integers
21 */
22 bool_t
23 xdr_int64_t(xdrs, llp)
24 XDR *xdrs;
25 int64_t *llp;
26 {
27 u_long ul[2];
28
29 switch (xdrs->x_op) {
30 case XDR_ENCODE:
31 ul[0] = (u_long) ((u_int64_t) * llp >> 32) & 0xffffffff;
32 ul[1] = (u_long) ((u_int64_t) * llp) & 0xffffffff;
33 if (XDR_PUTLONG(xdrs, (long *) &ul[0]) == FALSE)
34 return (FALSE);
35 return (XDR_PUTLONG(xdrs, (long *) &ul[1]));
36 case XDR_DECODE:
37 if (XDR_GETLONG(xdrs, (long *) &ul[0]) == FALSE)
38 return (FALSE);
39 if (XDR_GETLONG(xdrs, (long *) &ul[1]) == FALSE)
40 return (FALSE);
41 *llp = (int64_t)
42 (((u_int64_t) ul[0] << 32) | ((u_int64_t) ul[1]));
43 return (TRUE);
44 case XDR_FREE:
45 return (TRUE);
46 }
47 /* NOTREACHED */
48 return (FALSE);
49 }
50
51
52 /*
53 * XDR unsigned 64-bit integers
54 */
55 bool_t
56 xdr_u_int64_t(xdrs, ullp)
57 XDR *xdrs;
58 u_int64_t *ullp;
59 {
60 u_long ul[2];
61
62 switch (xdrs->x_op) {
63 case XDR_ENCODE:
64 ul[0] = (u_long) (*ullp >> 32) & 0xffffffff;
65 ul[1] = (u_long) (*ullp) & 0xffffffff;
66 if (XDR_PUTLONG(xdrs, (long *) &ul[0]) == FALSE)
67 return (FALSE);
68 return (XDR_PUTLONG(xdrs, (long *) &ul[1]));
69 case XDR_DECODE:
70 if (XDR_GETLONG(xdrs, (long *) &ul[0]) == FALSE)
71 return (FALSE);
72 if (XDR_GETLONG(xdrs, (long *) &ul[1]) == FALSE)
73 return (FALSE);
74 *ullp = (u_int64_t)
75 (((u_int64_t) ul[0] << 32) | ((u_int64_t) ul[1]));
76 return (TRUE);
77 case XDR_FREE:
78 return (TRUE);
79 }
80 /* NOTREACHED */
81 return (FALSE);
82 }
83 #endif
84
85 bool_t
86 xdr_nlm_stats(XDR *xdrs, nlm_stats *objp)
87 {
88
89 if (!xdr_enum(xdrs, (enum_t *)objp))
90 return (FALSE);
91 return (TRUE);
92 }
93
94 bool_t
95 xdr_nlm_holder(XDR *xdrs, nlm_holder *objp)
96 {
97
98 if (!xdr_bool(xdrs, &objp->exclusive))
99 return (FALSE);
100 if (!xdr_int(xdrs, &objp->svid))
101 return (FALSE);
102 if (!xdr_netobj(xdrs, &objp->oh))
103 return (FALSE);
104 if (!xdr_u_int(xdrs, &objp->l_offset))
105 return (FALSE);
106 if (!xdr_u_int(xdrs, &objp->l_len))
107 return (FALSE);
108 return (TRUE);
109 }
110
111 bool_t
112 xdr_nlm_testrply(XDR *xdrs, nlm_testrply *objp)
113 {
114
115 if (!xdr_nlm_stats(xdrs, &objp->stat))
116 return (FALSE);
117 switch (objp->stat) {
118 case nlm_denied:
119 if (!xdr_nlm_holder(xdrs, &objp->nlm_testrply_u.holder))
120 return (FALSE);
121 break;
122 default:
123 break;
124 }
125 return (TRUE);
126 }
127
128 bool_t
129 xdr_nlm_stat(XDR *xdrs, nlm_stat *objp)
130 {
131
132 if (!xdr_nlm_stats(xdrs, &objp->stat))
133 return (FALSE);
134 return (TRUE);
135 }
136
137 bool_t
138 xdr_nlm_res(XDR *xdrs, nlm_res *objp)
139 {
140
141 if (!xdr_netobj(xdrs, &objp->cookie))
142 return (FALSE);
143 if (!xdr_nlm_stat(xdrs, &objp->stat))
144 return (FALSE);
145 return (TRUE);
146 }
147
148 bool_t
149 xdr_nlm_testres(XDR *xdrs, nlm_testres *objp)
150 {
151
152 if (!xdr_netobj(xdrs, &objp->cookie))
153 return (FALSE);
154 if (!xdr_nlm_testrply(xdrs, &objp->stat))
155 return (FALSE);
156 return (TRUE);
157 }
158
159 bool_t
160 xdr_nlm_lock(XDR *xdrs, nlm_lock *objp)
161 {
162
163 if (!xdr_string(xdrs, &objp->caller_name, LM_MAXSTRLEN))
164 return (FALSE);
165 if (!xdr_netobj(xdrs, &objp->fh))
166 return (FALSE);
167 if (!xdr_netobj(xdrs, &objp->oh))
168 return (FALSE);
169 if (!xdr_int(xdrs, &objp->svid))
170 return (FALSE);
171 if (!xdr_u_int(xdrs, &objp->l_offset))
172 return (FALSE);
173 if (!xdr_u_int(xdrs, &objp->l_len))
174 return (FALSE);
175 return (TRUE);
176 }
177
178 bool_t
179 xdr_nlm_lockargs(XDR *xdrs, nlm_lockargs *objp)
180 {
181
182 if (!xdr_netobj(xdrs, &objp->cookie))
183 return (FALSE);
184 if (!xdr_bool(xdrs, &objp->block))
185 return (FALSE);
186 if (!xdr_bool(xdrs, &objp->exclusive))
187 return (FALSE);
188 if (!xdr_nlm_lock(xdrs, &objp->alock))
189 return (FALSE);
190 if (!xdr_bool(xdrs, &objp->reclaim))
191 return (FALSE);
192 if (!xdr_int(xdrs, &objp->state))
193 return (FALSE);
194 return (TRUE);
195 }
196
197 bool_t
198 xdr_nlm_cancargs(XDR *xdrs, nlm_cancargs *objp)
199 {
200
201 if (!xdr_netobj(xdrs, &objp->cookie))
202 return (FALSE);
203 if (!xdr_bool(xdrs, &objp->block))
204 return (FALSE);
205 if (!xdr_bool(xdrs, &objp->exclusive))
206 return (FALSE);
207 if (!xdr_nlm_lock(xdrs, &objp->alock))
208 return (FALSE);
209 return (TRUE);
210 }
211
212 bool_t
213 xdr_nlm_testargs(XDR *xdrs, nlm_testargs *objp)
214 {
215
216 if (!xdr_netobj(xdrs, &objp->cookie))
217 return (FALSE);
218 if (!xdr_bool(xdrs, &objp->exclusive))
219 return (FALSE);
220 if (!xdr_nlm_lock(xdrs, &objp->alock))
221 return (FALSE);
222 return (TRUE);
223 }
224
225 bool_t
226 xdr_nlm_unlockargs(XDR *xdrs, nlm_unlockargs *objp)
227 {
228
229 if (!xdr_netobj(xdrs, &objp->cookie))
230 return (FALSE);
231 if (!xdr_nlm_lock(xdrs, &objp->alock))
232 return (FALSE);
233 return (TRUE);
234 }
235
236 bool_t
237 xdr_fsh_mode(XDR *xdrs, fsh_mode *objp)
238 {
239
240 if (!xdr_enum(xdrs, (enum_t *)objp))
241 return (FALSE);
242 return (TRUE);
243 }
244
245 bool_t
246 xdr_fsh_access(XDR *xdrs, fsh_access *objp)
247 {
248
249 if (!xdr_enum(xdrs, (enum_t *)objp))
250 return (FALSE);
251 return (TRUE);
252 }
253
254 bool_t
255 xdr_nlm_share(XDR *xdrs, nlm_share *objp)
256 {
257
258 if (!xdr_string(xdrs, &objp->caller_name, LM_MAXSTRLEN))
259 return (FALSE);
260 if (!xdr_netobj(xdrs, &objp->fh))
261 return (FALSE);
262 if (!xdr_netobj(xdrs, &objp->oh))
263 return (FALSE);
264 if (!xdr_fsh_mode(xdrs, &objp->mode))
265 return (FALSE);
266 if (!xdr_fsh_access(xdrs, &objp->access))
267 return (FALSE);
268 return (TRUE);
269 }
270
271 bool_t
272 xdr_nlm_shareargs(XDR *xdrs, nlm_shareargs *objp)
273 {
274
275 if (!xdr_netobj(xdrs, &objp->cookie))
276 return (FALSE);
277 if (!xdr_nlm_share(xdrs, &objp->share))
278 return (FALSE);
279 if (!xdr_bool(xdrs, &objp->reclaim))
280 return (FALSE);
281 return (TRUE);
282 }
283
284 bool_t
285 xdr_nlm_shareres(XDR *xdrs, nlm_shareres *objp)
286 {
287
288 if (!xdr_netobj(xdrs, &objp->cookie))
289 return (FALSE);
290 if (!xdr_nlm_stats(xdrs, &objp->stat))
291 return (FALSE);
292 if (!xdr_int(xdrs, &objp->sequence))
293 return (FALSE);
294 return (TRUE);
295 }
296
297 bool_t
298 xdr_nlm_notify(XDR *xdrs, nlm_notify *objp)
299 {
300
301 if (!xdr_string(xdrs, &objp->name, MAXNAMELEN))
302 return (FALSE);
303 if (!xdr_long(xdrs, &objp->state))
304 return (FALSE);
305 return (TRUE);
306 }
307
308 bool_t
309 xdr_nlm4_stats(XDR *xdrs, nlm4_stats *objp)
310 {
311
312 if (!xdr_enum(xdrs, (enum_t *)objp))
313 return (FALSE);
314 return (TRUE);
315 }
316
317 bool_t
318 xdr_nlm4_stat(XDR *xdrs, nlm4_stat *objp)
319 {
320
321 if (!xdr_nlm4_stats(xdrs, &objp->stat))
322 return (FALSE);
323 return (TRUE);
324 }
325
326 bool_t
327 xdr_nlm4_holder(XDR *xdrs, nlm4_holder *objp)
328 {
329
330 if (!xdr_bool(xdrs, &objp->exclusive))
331 return (FALSE);
332 if (!xdr_u_int32_t(xdrs, &objp->svid))
333 return (FALSE);
334 if (!xdr_netobj(xdrs, &objp->oh))
335 return (FALSE);
336 if (!xdr_u_int64_t(xdrs, &objp->l_offset))
337 return (FALSE);
338 if (!xdr_u_int64_t(xdrs, &objp->l_len))
339 return (FALSE);
340 return (TRUE);
341 }
342
343 bool_t
344 xdr_nlm4_lock(XDR *xdrs, nlm4_lock *objp)
345 {
346
347 if (!xdr_string(xdrs, &objp->caller_name, MAXNAMELEN))
348 return (FALSE);
349 if (!xdr_netobj(xdrs, &objp->fh))
350 return (FALSE);
351 if (!xdr_netobj(xdrs, &objp->oh))
352 return (FALSE);
353 if (!xdr_u_int32_t(xdrs, &objp->svid))
354 return (FALSE);
355 if (!xdr_u_int64_t(xdrs, &objp->l_offset))
356 return (FALSE);
357 if (!xdr_u_int64_t(xdrs, &objp->l_len))
358 return (FALSE);
359 return (TRUE);
360 }
361
362 bool_t
363 xdr_nlm4_share(XDR *xdrs, nlm4_share *objp)
364 {
365
366 if (!xdr_string(xdrs, &objp->caller_name, MAXNAMELEN))
367 return (FALSE);
368 if (!xdr_netobj(xdrs, &objp->fh))
369 return (FALSE);
370 if (!xdr_netobj(xdrs, &objp->oh))
371 return (FALSE);
372 if (!xdr_fsh_mode(xdrs, &objp->mode))
373 return (FALSE);
374 if (!xdr_fsh_access(xdrs, &objp->access))
375 return (FALSE);
376 return (TRUE);
377 }
378
379 bool_t
380 xdr_nlm4_testrply(XDR *xdrs, nlm4_testrply *objp)
381 {
382
383 if (!xdr_nlm4_stats(xdrs, &objp->stat))
384 return (FALSE);
385 switch (objp->stat) {
386 case nlm_denied:
387 if (!xdr_nlm4_holder(xdrs, &objp->nlm4_testrply_u.holder))
388 return (FALSE);
389 break;
390 default:
391 break;
392 }
393 return (TRUE);
394 }
395
396 bool_t
397 xdr_nlm4_testres(XDR *xdrs, nlm4_testres *objp)
398 {
399
400 if (!xdr_netobj(xdrs, &objp->cookie))
401 return (FALSE);
402 if (!xdr_nlm4_testrply(xdrs, &objp->stat))
403 return (FALSE);
404 return (TRUE);
405 }
406
407 bool_t
408 xdr_nlm4_testargs(XDR *xdrs, nlm4_testargs *objp)
409 {
410
411 if (!xdr_netobj(xdrs, &objp->cookie))
412 return (FALSE);
413 if (!xdr_bool(xdrs, &objp->exclusive))
414 return (FALSE);
415 if (!xdr_nlm4_lock(xdrs, &objp->alock))
416 return (FALSE);
417 return (TRUE);
418 }
419
420 bool_t
421 xdr_nlm4_res(XDR *xdrs, nlm4_res *objp)
422 {
423
424 if (!xdr_netobj(xdrs, &objp->cookie))
425 return (FALSE);
426 if (!xdr_nlm4_stat(xdrs, &objp->stat))
427 return (FALSE);
428 return (TRUE);
429 }
430
431 bool_t
432 xdr_nlm4_lockargs(XDR *xdrs, nlm4_lockargs *objp)
433 {
434
435 if (!xdr_netobj(xdrs, &objp->cookie))
436 return (FALSE);
437 if (!xdr_bool(xdrs, &objp->block))
438 return (FALSE);
439 if (!xdr_bool(xdrs, &objp->exclusive))
440 return (FALSE);
441 if (!xdr_nlm4_lock(xdrs, &objp->alock))
442 return (FALSE);
443 if (!xdr_bool(xdrs, &objp->reclaim))
444 return (FALSE);
445 if (!xdr_int(xdrs, &objp->state))
446 return (FALSE);
447 return (TRUE);
448 }
449
450 bool_t
451 xdr_nlm4_cancargs(XDR *xdrs, nlm4_cancargs *objp)
452 {
453
454 if (!xdr_netobj(xdrs, &objp->cookie))
455 return (FALSE);
456 if (!xdr_bool(xdrs, &objp->block))
457 return (FALSE);
458 if (!xdr_bool(xdrs, &objp->exclusive))
459 return (FALSE);
460 if (!xdr_nlm4_lock(xdrs, &objp->alock))
461 return (FALSE);
462 return (TRUE);
463 }
464
465 bool_t
466 xdr_nlm4_unlockargs(XDR *xdrs, nlm4_unlockargs *objp)
467 {
468
469 if (!xdr_netobj(xdrs, &objp->cookie))
470 return (FALSE);
471 if (!xdr_nlm4_lock(xdrs, &objp->alock))
472 return (FALSE);
473 return (TRUE);
474 }
475
476 bool_t
477 xdr_nlm4_shareargs(XDR *xdrs, nlm4_shareargs *objp)
478 {
479
480 if (!xdr_netobj(xdrs, &objp->cookie))
481 return (FALSE);
482 if (!xdr_nlm4_share(xdrs, &objp->share))
483 return (FALSE);
484 if (!xdr_bool(xdrs, &objp->reclaim))
485 return (FALSE);
486 return (TRUE);
487 }
488
489 bool_t
490 xdr_nlm4_shareres(XDR *xdrs, nlm4_shareres *objp)
491 {
492
493 if (!xdr_netobj(xdrs, &objp->cookie))
494 return (FALSE);
495 if (!xdr_nlm4_stats(xdrs, &objp->stat))
496 return (FALSE);
497 if (!xdr_int(xdrs, &objp->sequence))
498 return (FALSE);
499 return (TRUE);
500 }
501
502 bool_t
503 xdr_nlm_sm_status(XDR *xdrs, nlm_sm_status *objp)
504 {
505
506 if (!xdr_string(xdrs, &objp->mon_name, LM_MAXSTRLEN))
507 return (FALSE);
508 if (!xdr_int(xdrs, &objp->state))
509 return (FALSE);
510 if (!xdr_opaque(xdrs, objp->priv, 16))
511 return (FALSE);
512 return (TRUE);
513 }
514
515 bool_t
516 xdr_nlm4_notify(XDR *xdrs, nlm4_notify *objp)
517 {
518
519 if (!xdr_string(xdrs, &objp->name, MAXNAMELEN))
520 return (FALSE);
521 if (!xdr_int32_t(xdrs, &objp->state))
522 return (FALSE);
523 return (TRUE);
524 }