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]
24 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
32 * Portions of this source code were derived from Berkeley
33 * under license from the Regents of the University of
37 #pragma ident "%Z%%M% %I% %E% SMI"
41 #include <netconfig.h>
43 #include <rpcsvc/yp_prot.h>
44 #include <sys/types.h>
47 xdr_ypbind_resptype(XDR
*xdrs
, ypbind_resptype
*objp
)
49 return (xdr_enum(xdrs
, (enum_t
*)objp
));
53 xdr_ypbind_domain(XDR
*xdrs
, ypbind_domain
*objp
)
55 if (!xdr_string(xdrs
, &objp
->ypbind_domainname
, YPMAXDOMAIN
))
57 return (xdr_rpcvers(xdrs
, &objp
->ypbind_vers
));
61 xdr_ypbind_binding(XDR
*xdrs
, ypbind_binding
*objp
)
63 if (!xdr_pointer(xdrs
, (char **)&objp
->ypbind_nconf
,
64 sizeof (struct netconfig
), xdr_netconfig
))
66 if (!xdr_pointer(xdrs
, (char **)&objp
->ypbind_svcaddr
,
67 sizeof (struct netbuf
), xdr_netbuf
))
69 if (!xdr_string(xdrs
, &objp
->ypbind_servername
, ~0))
71 if (!xdr_rpcvers(xdrs
, &objp
->ypbind_hi_vers
))
73 return (xdr_rpcvers(xdrs
, &objp
->ypbind_lo_vers
));
77 xdr_ypbind_resp(XDR
*xdrs
, ypbind_resp
*objp
)
79 if (!xdr_ypbind_resptype(xdrs
, &objp
->ypbind_status
))
81 switch (objp
->ypbind_status
) {
83 if (!xdr_u_int(xdrs
, &objp
->ypbind_resp_u
.ypbind_error
))
87 if (!xdr_pointer(xdrs
,
88 (char **)&objp
->ypbind_resp_u
.ypbind_bindinfo
,
89 sizeof (ypbind_binding
), xdr_ypbind_binding
))
99 xdr_ypbind_setdom(XDR
*xdrs
, ypbind_setdom
*objp
)
101 if (!xdr_string(xdrs
, &objp
->ypsetdom_domain
, YPMAXDOMAIN
))
103 return (xdr_pointer(xdrs
, (char **)&objp
->ypsetdom_bindinfo
,
104 sizeof (ypbind_binding
), xdr_ypbind_binding
));