]> git.saurik.com Git - apple/network_cmds.git/blob - ypserv.tproj/ypserv_xdr.c
network_cmds-201.tar.gz
[apple/network_cmds.git] / ypserv.tproj / ypserv_xdr.c
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Please do not edit this file.
27 * It was generated using rpcgen.
28 */
29
30 #include "yp.h"
31 #ifndef lint
32 static char rcsid[] = "$OpenBSD: ypserv_xdr.c,v 1.3 1996/05/30 09:53:31 deraadt Exp $";
33 #endif /* not lint */
34
35 __private_extern__
36 bool_t
37 xdr_ypstat(xdrs, objp)
38 XDR *xdrs;
39 ypstat *objp;
40 {
41
42 register long *buf;
43
44 if (!xdr_enum(xdrs, (enum_t *)objp)) {
45 return (FALSE);
46 }
47 return (TRUE);
48 }
49
50 bool_t
51 xdr_ypxfrstat(xdrs, objp)
52 XDR *xdrs;
53 ypxfrstat *objp;
54 {
55
56 register long *buf;
57
58 if (!xdr_enum(xdrs, (enum_t *)objp)) {
59 return (FALSE);
60 }
61 return (TRUE);
62 }
63
64 __private_extern__
65 bool_t
66 xdr_domainname(xdrs, objp)
67 XDR *xdrs;
68 domainname *objp;
69 {
70
71 register long *buf;
72
73 if (!xdr_string(xdrs, objp, YPMAXDOMAIN)) {
74 return (FALSE);
75 }
76 return (TRUE);
77 }
78
79 __private_extern__
80 bool_t
81 xdr_mapname(xdrs, objp)
82 XDR *xdrs;
83 mapname *objp;
84 {
85
86 register long *buf;
87
88 if (!xdr_string(xdrs, objp, YPMAXMAP)) {
89 return (FALSE);
90 }
91 return (TRUE);
92 }
93
94 __private_extern__
95 bool_t
96 xdr_peername(xdrs, objp)
97 XDR *xdrs;
98 peername *objp;
99 {
100
101 register long *buf;
102
103 if (!xdr_string(xdrs, objp, YPMAXPEER)) {
104 return (FALSE);
105 }
106 return (TRUE);
107 }
108
109 __private_extern__
110 bool_t
111 xdr_keydat(xdrs, objp)
112 XDR *xdrs;
113 keydat *objp;
114 {
115
116 register long *buf;
117
118 if (!xdr_bytes(xdrs, (char **)&objp->keydat_val, (u_int *)&objp->keydat_len, YPMAXRECORD)) {
119 return (FALSE);
120 }
121 return (TRUE);
122 }
123
124 __private_extern__
125 bool_t
126 xdr_valdat(xdrs, objp)
127 XDR *xdrs;
128 valdat *objp;
129 {
130
131 register long *buf;
132
133 if (!xdr_bytes(xdrs, (char **)&objp->valdat_val, (u_int *)&objp->valdat_len, YPMAXRECORD)) {
134 return (FALSE);
135 }
136 return (TRUE);
137 }
138
139 bool_t
140 xdr_ypmap_parms(xdrs, objp)
141 XDR *xdrs;
142 ypmap_parms *objp;
143 {
144
145 register long *buf;
146
147 if (!xdr_domainname(xdrs, &objp->domain)) {
148 return (FALSE);
149 }
150 if (!xdr_mapname(xdrs, &objp->map)) {
151 return (FALSE);
152 }
153 if (!xdr_u_int(xdrs, &objp->ordernum)) {
154 return (FALSE);
155 }
156 if (!xdr_peername(xdrs, &objp->peer)) {
157 return (FALSE);
158 }
159 return (TRUE);
160 }
161
162 __private_extern__
163 bool_t
164 xdr_ypreq_key(xdrs, objp)
165 XDR *xdrs;
166 ypreq_key *objp;
167 {
168
169 register long *buf;
170
171 if (!xdr_domainname(xdrs, &objp->domain)) {
172 return (FALSE);
173 }
174 if (!xdr_mapname(xdrs, &objp->map)) {
175 return (FALSE);
176 }
177 if (!xdr_keydat(xdrs, &objp->key)) {
178 return (FALSE);
179 }
180 return (TRUE);
181 }
182
183 __private_extern__
184 bool_t
185 xdr_ypreq_nokey(xdrs, objp)
186 XDR *xdrs;
187 ypreq_nokey *objp;
188 {
189
190 register long *buf;
191
192 if (!xdr_domainname(xdrs, &objp->domain)) {
193 return (FALSE);
194 }
195 if (!xdr_mapname(xdrs, &objp->map)) {
196 return (FALSE);
197 }
198 return (TRUE);
199 }
200
201 bool_t
202 xdr_ypreq_xfr(xdrs, objp)
203 XDR *xdrs;
204 ypreq_xfr *objp;
205 {
206
207 register long *buf;
208
209 if (!xdr_ypmap_parms(xdrs, &objp->map_parms)) {
210 return (FALSE);
211 }
212 if (!xdr_u_int(xdrs, &objp->transid)) {
213 return (FALSE);
214 }
215 if (!xdr_u_int(xdrs, &objp->prog)) {
216 return (FALSE);
217 }
218 if (!xdr_u_int(xdrs, &objp->port)) {
219 return (FALSE);
220 }
221 return (TRUE);
222 }
223
224 __private_extern__
225 bool_t
226 xdr_ypresp_val(xdrs, objp)
227 XDR *xdrs;
228 ypresp_val *objp;
229 {
230
231 register long *buf;
232
233 if (!xdr_ypstat(xdrs, &objp->stat)) {
234 return (FALSE);
235 }
236 if (!xdr_valdat(xdrs, &objp->val)) {
237 return (FALSE);
238 }
239 return (TRUE);
240 }
241
242 __private_extern__
243 bool_t
244 xdr_ypresp_key_val(xdrs, objp)
245 XDR *xdrs;
246 ypresp_key_val *objp;
247 {
248
249 register long *buf;
250
251 if (!xdr_ypstat(xdrs, &objp->stat)) {
252 return (FALSE);
253 }
254 if (!xdr_valdat(xdrs, &objp->val)) {
255 return (FALSE);
256 }
257 if (!xdr_keydat(xdrs, &objp->key)) {
258 return (FALSE);
259 }
260 return (TRUE);
261 }
262
263 __private_extern__
264 bool_t
265 xdr_ypresp_master(xdrs, objp)
266 XDR *xdrs;
267 ypresp_master *objp;
268 {
269
270 register long *buf;
271
272 if (!xdr_ypstat(xdrs, &objp->stat)) {
273 return (FALSE);
274 }
275 if (!xdr_peername(xdrs, &objp->peer)) {
276 return (FALSE);
277 }
278 return (TRUE);
279 }
280
281 __private_extern__
282 bool_t
283 xdr_ypresp_order(xdrs, objp)
284 XDR *xdrs;
285 ypresp_order *objp;
286 {
287
288 register long *buf;
289
290 if (!xdr_ypstat(xdrs, &objp->stat)) {
291 return (FALSE);
292 }
293 if (!xdr_u_int(xdrs, &objp->ordernum)) {
294 return (FALSE);
295 }
296 return (TRUE);
297 }
298
299 __private_extern__
300 bool_t
301 xdr_ypresp_all(xdrs, objp)
302 XDR *xdrs;
303 ypresp_all *objp;
304 {
305
306 register long *buf;
307
308 if (!xdr_bool(xdrs, &objp->more)) {
309 return (FALSE);
310 }
311 switch (objp->more) {
312 case TRUE:
313 if (!xdr_ypresp_key_val(xdrs, &objp->ypresp_all_u.val)) {
314 return (FALSE);
315 }
316 break;
317 case FALSE:
318 break;
319 default:
320 return (FALSE);
321 }
322 return (TRUE);
323 }
324
325 bool_t
326 xdr_ypresp_xfr(xdrs, objp)
327 XDR *xdrs;
328 ypresp_xfr *objp;
329 {
330
331 register long *buf;
332
333 if (!xdr_u_int(xdrs, &objp->transid)) {
334 return (FALSE);
335 }
336 if (!xdr_ypxfrstat(xdrs, &objp->xfrstat)) {
337 return (FALSE);
338 }
339 return (TRUE);
340 }
341
342 __private_extern__
343 bool_t
344 xdr_ypmaplist(xdrs, objp)
345 XDR *xdrs;
346 ypmaplist *objp;
347 {
348
349 register long *buf;
350
351 if (!xdr_mapname(xdrs, &objp->map)) {
352 return (FALSE);
353 }
354 if (!xdr_pointer(xdrs, (char **)&objp->next, sizeof(ypmaplist), (xdrproc_t)xdr_ypmaplist)) {
355 return (FALSE);
356 }
357 return (TRUE);
358 }
359
360 __private_extern__
361 bool_t
362 xdr_ypresp_maplist(xdrs, objp)
363 XDR *xdrs;
364 ypresp_maplist *objp;
365 {
366
367 register long *buf;
368
369 if (!xdr_ypstat(xdrs, &objp->stat)) {
370 return (FALSE);
371 }
372 if (!xdr_pointer(xdrs, (char **)&objp->maps, sizeof(ypmaplist), (xdrproc_t)xdr_ypmaplist)) {
373 return (FALSE);
374 }
375 return (TRUE);
376 }
377
378 bool_t
379 xdr_yppush_status(xdrs, objp)
380 XDR *xdrs;
381 yppush_status *objp;
382 {
383
384 register long *buf;
385
386 if (!xdr_enum(xdrs, (enum_t *)objp)) {
387 return (FALSE);
388 }
389 return (TRUE);
390 }
391
392 bool_t
393 xdr_yppushresp_xfr(xdrs, objp)
394 XDR *xdrs;
395 yppushresp_xfr *objp;
396 {
397
398 register long *buf;
399
400 if (!xdr_u_int(xdrs, &objp->transid)) {
401 return (FALSE);
402 }
403 if (!xdr_yppush_status(xdrs, &objp->status)) {
404 return (FALSE);
405 }
406 return (TRUE);
407 }
408
409 __private_extern__
410 bool_t
411 xdr_ypbind_resptype(xdrs, objp)
412 XDR *xdrs;
413 ypbind_resptype *objp;
414 {
415
416 register long *buf;
417
418 if (!xdr_enum(xdrs, (enum_t *)objp)) {
419 return (FALSE);
420 }
421 return (TRUE);
422 }
423
424 __private_extern__
425 bool_t
426 xdr_ypbind_binding(xdrs, objp)
427 XDR *xdrs;
428 ypbind_binding *objp;
429 {
430
431 register long *buf;
432
433 int i;
434 if (!xdr_opaque(xdrs, objp->ypbind_binding_addr, 4)) {
435 return (FALSE);
436 }
437 if (!xdr_opaque(xdrs, objp->ypbind_binding_port, 2)) {
438 return (FALSE);
439 }
440 return (TRUE);
441 }
442
443 __private_extern__
444 bool_t
445 xdr_ypbind_resp(xdrs, objp)
446 XDR *xdrs;
447 ypbind_resp *objp;
448 {
449
450 register long *buf;
451
452 if (!xdr_ypbind_resptype(xdrs, &objp->ypbind_status)) {
453 return (FALSE);
454 }
455 switch (objp->ypbind_status) {
456 case YPBIND_FAIL_VAL:
457 if (!xdr_u_int(xdrs, &objp->ypbind_resp_u.ypbind_error)) {
458 return (FALSE);
459 }
460 break;
461 case YPBIND_SUCC_VAL:
462 if (!xdr_ypbind_binding(xdrs, &objp->ypbind_resp_u.ypbind_bindinfo)) {
463 return (FALSE);
464 }
465 break;
466 default:
467 return (FALSE);
468 }
469 return (TRUE);
470 }
471
472 bool_t
473 xdr_ypbind_setdom(xdrs, objp)
474 XDR *xdrs;
475 ypbind_setdom *objp;
476 {
477
478 register long *buf;
479
480 if (!xdr_domainname(xdrs, &objp->ypsetdom_domain)) {
481 return (FALSE);
482 }
483 if (!xdr_ypbind_binding(xdrs, &objp->ypsetdom_binding)) {
484 return (FALSE);
485 }
486 if (!xdr_u_int(xdrs, &objp->ypsetdom_vers)) {
487 return (FALSE);
488 }
489 return (TRUE);
490 }