]> git.saurik.com Git - apple/network_cmds.git/blob - ypserv.tproj/ypserv_xdr_v1.c
network_cmds-245.tar.gz
[apple/network_cmds.git] / ypserv.tproj / ypserv_xdr_v1.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 #include "ypv1.h"
31 #ifndef lint
32 static char rcsid[] = "$OpenBSD: ypserv_xdr_v1.c,v 1.1 1997/03/30 20:51:22 maja Exp $";
33 #endif /* not lint */
34
35 bool_t
36 xdr_ypreqtype(xdrs, objp)
37 XDR *xdrs;
38 ypreqtype *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_ypresptype(xdrs, objp)
51 XDR *xdrs;
52 ypresptype *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 bool_t
64 xdr_yprequest(xdrs, objp)
65 XDR *xdrs;
66 yprequest *objp;
67 {
68 if (!xdr_ypreqtype(xdrs, &objp->yp_reqtype)) {
69 printf("error 1\n");
70 return (FALSE);
71 }
72 switch (objp->yp_reqtype) {
73 case YPREQ_KEY:
74 if (!xdr_ypreq_key(xdrs, &objp->yp_reqbody.yp_req_keytype)) {
75 printf("error 2\n");
76 return (FALSE);
77 }
78 break;
79 case YPREQ_NOKEY:
80 if (!xdr_ypreq_nokey(xdrs, &objp->yp_reqbody.yp_req_nokeytype)) {
81 printf("error 3\n");
82 return (FALSE);
83 }
84 break;
85 case YPREQ_MAP_PARMS:
86 if (!xdr_ypmap_parms(xdrs, &objp->yp_reqbody.yp_req_map_parmstype)) {
87 printf("error 4\n");
88 return (FALSE);
89 }
90 break;
91 default:
92 printf("error 5\n");
93 return (FALSE);
94 }
95 return (TRUE);
96 }
97
98 bool_t
99 xdr_ypresponse(xdrs, objp)
100 XDR *xdrs;
101 ypresponse *objp;
102 {
103
104 register long *buf;
105
106 if (!xdr_ypresptype(xdrs, &objp->yp_resptype)) {
107 return (FALSE);
108 }
109 switch (objp->yp_resptype) {
110 case YPRESP_VAL:
111 if (!xdr_ypresp_val(xdrs, &objp->yp_respbody.yp_resp_valtype)) {
112 return (FALSE);
113 }
114 break;
115 case YPRESP_KEY_VAL:
116 if (!xdr_ypresp_key_val(xdrs, &objp->yp_respbody.yp_resp_key_valtype)) {
117 return (FALSE);
118 }
119 break;
120 case YPRESP_MAP_PARMS:
121 if (!xdr_ypmap_parms(xdrs, &objp->yp_respbody.yp_resp_map_parmstype)) {
122 return (FALSE);
123 }
124 break;
125 default:
126 return (FALSE);
127 }
128 return (TRUE);
129 }
130