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