]> git.saurik.com Git - apple/network_cmds.git/blame - ypserv.tproj/ypserv_xdr_v1.c
network_cmds-245.1.3.tar.gz
[apple/network_cmds.git] / ypserv.tproj / ypserv_xdr_v1.c
CommitLineData
b7080c8e
A
1/*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
ffda1f4a
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
b7080c8e
A
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
ffda1f4a
A
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
b7080c8e
A
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * Please do not edit this file.
25 * It was generated using rpcgen.
26 */
27
28#include "yp.h"
29#include "ypv1.h"
30#ifndef lint
31static char rcsid[] = "$OpenBSD: ypserv_xdr_v1.c,v 1.1 1997/03/30 20:51:22 maja Exp $";
32#endif /* not lint */
33
34bool_t
35xdr_ypreqtype(xdrs, objp)
36 XDR *xdrs;
37 ypreqtype *objp;
38{
39
40 register long *buf;
41
42 if (!xdr_enum(xdrs, (enum_t *)objp)) {
43 return (FALSE);
44 }
45 return (TRUE);
46}
47
48bool_t
49xdr_ypresptype(xdrs, objp)
50 XDR *xdrs;
51 ypresptype *objp;
52{
53
54 register long *buf;
55
56 if (!xdr_enum(xdrs, (enum_t *)objp)) {
57 return (FALSE);
58 }
59 return (TRUE);
60}
61
62bool_t
63xdr_yprequest(xdrs, objp)
64 XDR *xdrs;
65 yprequest *objp;
66{
67 if (!xdr_ypreqtype(xdrs, &objp->yp_reqtype)) {
68 printf("error 1\n");
69 return (FALSE);
70 }
71 switch (objp->yp_reqtype) {
72 case YPREQ_KEY:
73 if (!xdr_ypreq_key(xdrs, &objp->yp_reqbody.yp_req_keytype)) {
74 printf("error 2\n");
75 return (FALSE);
76 }
77 break;
78 case YPREQ_NOKEY:
79 if (!xdr_ypreq_nokey(xdrs, &objp->yp_reqbody.yp_req_nokeytype)) {
80 printf("error 3\n");
81 return (FALSE);
82 }
83 break;
84 case YPREQ_MAP_PARMS:
85 if (!xdr_ypmap_parms(xdrs, &objp->yp_reqbody.yp_req_map_parmstype)) {
86 printf("error 4\n");
87 return (FALSE);
88 }
89 break;
90 default:
91 printf("error 5\n");
92 return (FALSE);
93 }
94 return (TRUE);
95}
96
97bool_t
98xdr_ypresponse(xdrs, objp)
99 XDR *xdrs;
100 ypresponse *objp;
101{
102
103 register long *buf;
104
105 if (!xdr_ypresptype(xdrs, &objp->yp_resptype)) {
106 return (FALSE);
107 }
108 switch (objp->yp_resptype) {
109 case YPRESP_VAL:
110 if (!xdr_ypresp_val(xdrs, &objp->yp_respbody.yp_resp_valtype)) {
111 return (FALSE);
112 }
113 break;
114 case YPRESP_KEY_VAL:
115 if (!xdr_ypresp_key_val(xdrs, &objp->yp_respbody.yp_resp_key_valtype)) {
116 return (FALSE);
117 }
118 break;
119 case YPRESP_MAP_PARMS:
120 if (!xdr_ypmap_parms(xdrs, &objp->yp_respbody.yp_resp_map_parmstype)) {
121 return (FALSE);
122 }
123 break;
124 default:
125 return (FALSE);
126 }
127 return (TRUE);
128}
129