4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 #ident "%Z%%M% %I% %E% SMI"
24 * Copyright (c) 1995 Sun Microsystems, Inc
25 * All rights reserved.
29 * This contains the xdr functions needed by ypserv and the NIS
30 * administrative tools to support the previous version of the NIS protocol.
31 * Note that many "old" xdr functions are called, with the assumption that
32 * they have not changed between the v1 protocol (which this module exists
33 * to support) and the current v2 protocol.
38 #include <rpcsvc/yp_prot.h>
39 #include "ypv1_prot.h"
40 #include <rpcsvc/ypclnt.h>
41 typedef struct xdr_discrim XDR_DISCRIM
;
43 extern bool xdr_ypreq_key();
44 extern bool xdr_ypreq_nokey();
45 extern bool xdr_ypresp_val();
46 extern bool xdr_ypresp_key_val();
47 extern bool xdr_ypmap_parms();
51 * Serializes/deserializes a yprequest structure.
54 _xdr_yprequest(XDR
*xdrs
, struct yprequest
*ps
)
56 XDR_DISCRIM yprequest_arms
[4];
58 yprequest_arms
[0].value
= (int)YPREQ_KEY
;
59 yprequest_arms
[1].value
= (int)YPREQ_NOKEY
;
60 yprequest_arms
[2].value
= (int)YPREQ_KEY
;
61 yprequest_arms
[3].value
= __dontcare__
;
62 yprequest_arms
[0].proc
= (xdrproc_t
)xdr_ypreq_key
;
63 yprequest_arms
[1].proc
= (xdrproc_t
)xdr_ypreq_nokey
;
64 yprequest_arms
[2].proc
= (xdrproc_t
)xdr_ypmap_parms
;
65 yprequest_arms
[3].proc
= (xdrproc_t
)NULL
;
67 return (xdr_union(xdrs
,
68 (int *) &ps
->yp_reqtype
,
69 (char *) &ps
->yp_reqbody
,
70 yprequest_arms
, NULL
));
74 * Serializes/deserializes a ypresponse structure.
77 _xdr_ypresponse(XDR
*xdrs
, struct ypresponse
*ps
)
79 XDR_DISCRIM ypresponse_arms
[4];
81 ypresponse_arms
[0].value
= (int)YPRESP_VAL
;
82 ypresponse_arms
[1].value
= (int)YPRESP_KEY_VAL
;
83 ypresponse_arms
[2].value
= (int)YPRESP_MAP_PARMS
;
84 ypresponse_arms
[3].value
= __dontcare__
;
85 ypresponse_arms
[0].proc
= (xdrproc_t
)xdr_ypresp_val
;
86 ypresponse_arms
[1].proc
= (xdrproc_t
)xdr_ypresp_key_val
;
87 ypresponse_arms
[2].proc
= (xdrproc_t
)xdr_ypmap_parms
;
88 ypresponse_arms
[3].proc
= (xdrproc_t
)NULL
;
90 return (xdr_union(xdrs
,
91 (int *) &ps
->yp_resptype
,
92 (char *) &ps
->yp_respbody
,
93 ypresponse_arms
, NULL
));
96 /* XXX - Excess baggage? - georgn */
99 * Serializes/deserializes a ypbind_oldsetdom structure.
102 _xdr_ypbind_oldsetdom(XDR
*xdrs
, struct ypbind_setdom
*ps
)
104 char *domain
= ps
->ypsetdom_domain
;
106 return (xdr_ypdomain_wrap_string(xdrs
, &domain
) &&
107 xdr_yp_binding(xdrs
, &ps
->ypsetdom_binding
));