4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
29 * Routines used by ypserv
34 #include <rpcsvc/yp_prot.h>
36 #include <sys/types.h>
37 #include "ypserv_resolv_common.h"
41 extern char *sys_errlist
[];
45 strerror(err
) /* no 4.1.3 strerror() */
48 if (err
> 0 && err
< sys_nerr
)
49 return (sys_errlist
[err
]);
51 return ((char *) NULL
);
56 xdr_ypfwdreq_key4(XDR
*xdrs
, struct ypfwdreq_key4
*ps
)
58 return (xdr_ypmap_wrap_string(xdrs
, &ps
->map
) &&
59 xdr_datum(xdrs
, &ps
->keydat
) &&
60 xdr_u_long(xdrs
, &ps
->xid
) &&
61 xdr_u_long(xdrs
, &ps
->ip
) &&
62 xdr_u_short(xdrs
, &ps
->port
));
67 xdr_ypfwdreq_key6(XDR
*xdrs
, struct ypfwdreq_key6
*ps
)
69 u_int addrsize
= sizeof (struct in6_addr
)/sizeof (uint32_t);
70 char **addrp
= (caddr_t
*)&(ps
->addr
);
72 return (xdr_ypmap_wrap_string(xdrs
, &ps
->map
) &&
73 xdr_datum(xdrs
, &ps
->keydat
) &&
74 xdr_u_long(xdrs
, &ps
->xid
) &&
75 xdr_array(xdrs
, addrp
, &addrsize
, addrsize
,
76 sizeof (uint32_t), xdr_uint32_t
) &&
77 xdr_u_short(xdrs
, &ps
->port
));
82 svc_getxid(SVCXPRT
*xprt
)
84 struct svc_dg_data
*su
= get_svc_dg_data(xprt
);