xref: /illumos-gate/usr/src/lib/libnsl/yp/yp_xdr.c (revision 61961e0f)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*61961e0fSrobinson  */
22*61961e0fSrobinson 
23*61961e0fSrobinson /*
24*61961e0fSrobinson  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
257c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate /*	Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
297c478bd9Sstevel@tonic-gate /*	  All Rights Reserved   */
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate /*
327c478bd9Sstevel@tonic-gate  * Portions of this source code were derived from Berkeley
337c478bd9Sstevel@tonic-gate  * under license from the Regents of the University of
347c478bd9Sstevel@tonic-gate  * California.
357c478bd9Sstevel@tonic-gate  */
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * This contains ALL xdr routines used by the YP rpc interface.
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate 
43*61961e0fSrobinson #include <unistd.h>
44*61961e0fSrobinson #include <stdlib.h>
457c478bd9Sstevel@tonic-gate #include <rpc/rpc.h>
467c478bd9Sstevel@tonic-gate #include "yp_b.h"
477c478bd9Sstevel@tonic-gate #include <rpcsvc/yp_prot.h>
487c478bd9Sstevel@tonic-gate #include <rpcsvc/ypclnt.h>
497c478bd9Sstevel@tonic-gate #include <sys/types.h>
507c478bd9Sstevel@tonic-gate #include <limits.h>
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate static bool xdr_ypmaplist(XDR *, struct ypmaplist **);
537c478bd9Sstevel@tonic-gate static bool xdr_ypmaplist_wrap_string(XDR *, char *);
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate typedef struct xdr_discrim XDR_DISCRIM;
56*61961e0fSrobinson extern bool xdr_ypreq_key(XDR *, struct ypreq_key *);
57*61961e0fSrobinson extern bool xdr_ypreq_nokey(XDR *, struct ypreq_nokey *);
58*61961e0fSrobinson extern bool xdr_ypresp_val(XDR *, struct ypresp_val *);
59*61961e0fSrobinson extern bool xdr_ypresp_key_val(XDR *, struct ypresp_key_val *);
60*61961e0fSrobinson extern bool xdr_ypmap_parms(XDR *, struct ypmap_parms *);
61*61961e0fSrobinson extern bool xdr_ypowner_wrap_string(XDR *, char **);
62*61961e0fSrobinson extern bool xdr_ypreq_newname_string(XDR *, char **);
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate /*
667c478bd9Sstevel@tonic-gate  * Serializes/deserializes a dbm datum data structure.
677c478bd9Sstevel@tonic-gate  */
687c478bd9Sstevel@tonic-gate bool
69*61961e0fSrobinson xdr_datum(XDR *xdrs, datum *pdatum)
707c478bd9Sstevel@tonic-gate {
71*61961e0fSrobinson 	bool res;
727c478bd9Sstevel@tonic-gate 	uint_t dsize;
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate 	/*
757c478bd9Sstevel@tonic-gate 	 * LP64 case :
767c478bd9Sstevel@tonic-gate 	 * xdr_bytes() expects a uint_t for the 3rd argument. Since
777c478bd9Sstevel@tonic-gate 	 * datum.dsize is a long, we need a new temporary to pass to
787c478bd9Sstevel@tonic-gate 	 * xdr_bytes()
797c478bd9Sstevel@tonic-gate 	 */
807c478bd9Sstevel@tonic-gate 	if (xdrs->x_op == XDR_ENCODE) {
817c478bd9Sstevel@tonic-gate 		if (pdatum->dsize > UINT_MAX)
827c478bd9Sstevel@tonic-gate 			return (FALSE);
837c478bd9Sstevel@tonic-gate 	}
847c478bd9Sstevel@tonic-gate 	dsize = (uint_t)pdatum->dsize;
85*61961e0fSrobinson 	res = (bool)xdr_bytes(xdrs, (char **)&(pdatum->dptr), &dsize,
86*61961e0fSrobinson 								YPMAXRECORD);
877c478bd9Sstevel@tonic-gate 	if (xdrs->x_op == XDR_DECODE) {
887c478bd9Sstevel@tonic-gate 		pdatum->dsize = dsize;
897c478bd9Sstevel@tonic-gate 	}
907c478bd9Sstevel@tonic-gate 
91*61961e0fSrobinson 	return (res);
927c478bd9Sstevel@tonic-gate }
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate /*
967c478bd9Sstevel@tonic-gate  * Serializes/deserializes a domain name string.  This is a "wrapper" for
977c478bd9Sstevel@tonic-gate  * xdr_string which knows about the maximum domain name size.
987c478bd9Sstevel@tonic-gate  */
997c478bd9Sstevel@tonic-gate bool
100*61961e0fSrobinson xdr_ypdomain_wrap_string(XDR *xdrs, char **ppstring)
1017c478bd9Sstevel@tonic-gate {
102*61961e0fSrobinson 	return ((bool)xdr_string(xdrs, ppstring, YPMAXDOMAIN));
1037c478bd9Sstevel@tonic-gate }
1047c478bd9Sstevel@tonic-gate 
1057c478bd9Sstevel@tonic-gate /*
1067c478bd9Sstevel@tonic-gate  * Serializes/deserializes a map name string.  This is a "wrapper" for
1077c478bd9Sstevel@tonic-gate  * xdr_string which knows about the maximum map name size.
1087c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate bool
110*61961e0fSrobinson xdr_ypmap_wrap_string(XDR *xdrs, char **ppstring)
1117c478bd9Sstevel@tonic-gate {
112*61961e0fSrobinson 	return ((bool)xdr_string(xdrs, ppstring, YPMAXMAP));
1137c478bd9Sstevel@tonic-gate }
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate /*
1167c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypreq_key structure.
1177c478bd9Sstevel@tonic-gate  */
1187c478bd9Sstevel@tonic-gate bool
119*61961e0fSrobinson xdr_ypreq_key(XDR *xdrs, struct ypreq_key *ps)
1207c478bd9Sstevel@tonic-gate {
121*61961e0fSrobinson 	return ((bool)(xdr_ypdomain_wrap_string(xdrs, &ps->domain) &&
1227c478bd9Sstevel@tonic-gate 		    xdr_ypmap_wrap_string(xdrs, &ps->map) &&
123*61961e0fSrobinson 		    xdr_datum(xdrs, &ps->keydat)));
1247c478bd9Sstevel@tonic-gate }
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /*
1277c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypreq_nokey structure.
1287c478bd9Sstevel@tonic-gate  */
1297c478bd9Sstevel@tonic-gate bool
130*61961e0fSrobinson xdr_ypreq_nokey(XDR *xdrs, struct ypreq_nokey *ps)
1317c478bd9Sstevel@tonic-gate {
132*61961e0fSrobinson 	return ((bool)(xdr_ypdomain_wrap_string(xdrs, &ps->domain) &&
133*61961e0fSrobinson 		    xdr_ypmap_wrap_string(xdrs, &ps->map)));
1347c478bd9Sstevel@tonic-gate }
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /*
1377c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypresp_val structure.
1387c478bd9Sstevel@tonic-gate  */
1397c478bd9Sstevel@tonic-gate bool
140*61961e0fSrobinson xdr_ypresp_val(XDR *xdrs, struct ypresp_val *ps)
1417c478bd9Sstevel@tonic-gate {
142*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->status) &&
143*61961e0fSrobinson 		    xdr_datum(xdrs, &ps->valdat)));
1447c478bd9Sstevel@tonic-gate }
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate /*
1477c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypresp_key_val structure.
1487c478bd9Sstevel@tonic-gate  */
1497c478bd9Sstevel@tonic-gate bool
150*61961e0fSrobinson xdr_ypresp_key_val(XDR *xdrs, struct ypresp_key_val *ps)
1517c478bd9Sstevel@tonic-gate {
152*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->status) &&
1537c478bd9Sstevel@tonic-gate 	    xdr_datum(xdrs, &ps->valdat) &&
154*61961e0fSrobinson 	    xdr_datum(xdrs, &ps->keydat)));
1557c478bd9Sstevel@tonic-gate }
1567c478bd9Sstevel@tonic-gate 
1577c478bd9Sstevel@tonic-gate /*
1587c478bd9Sstevel@tonic-gate  * Serializes/deserializes a peer server's node name
1597c478bd9Sstevel@tonic-gate  */
1607c478bd9Sstevel@tonic-gate bool
161*61961e0fSrobinson xdr_ypowner_wrap_string(XDR *xdrs, char **ppstring)
1627c478bd9Sstevel@tonic-gate {
163*61961e0fSrobinson 	return ((bool)xdr_string(xdrs, ppstring, YPMAXPEER));
1647c478bd9Sstevel@tonic-gate }
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /*
1677c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypmap_parms structure.
1687c478bd9Sstevel@tonic-gate  */
1697c478bd9Sstevel@tonic-gate bool
170*61961e0fSrobinson xdr_ypmap_parms(XDR *xdrs, struct ypmap_parms *ps)
1717c478bd9Sstevel@tonic-gate {
172*61961e0fSrobinson 	return ((bool)(xdr_ypdomain_wrap_string(xdrs, &ps->domain) &&
1737c478bd9Sstevel@tonic-gate 	    xdr_ypmap_wrap_string(xdrs, &ps->map) &&
1747c478bd9Sstevel@tonic-gate 	    xdr_u_int(xdrs, &ps->ordernum) &&
175*61961e0fSrobinson 	    xdr_ypowner_wrap_string(xdrs, &ps->owner)));
1767c478bd9Sstevel@tonic-gate }
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate /*
1797c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypreq_newxfr name
1807c478bd9Sstevel@tonic-gate  */
1817c478bd9Sstevel@tonic-gate bool
182*61961e0fSrobinson xdr_ypreq_newname_string(XDR *xdrs, char **ppstring)
1837c478bd9Sstevel@tonic-gate {
184*61961e0fSrobinson 	return ((bool)xdr_string(xdrs, ppstring, 256));
1857c478bd9Sstevel@tonic-gate }
1867c478bd9Sstevel@tonic-gate 
1877c478bd9Sstevel@tonic-gate /*
1887c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypresp_master structure.
1897c478bd9Sstevel@tonic-gate  */
1907c478bd9Sstevel@tonic-gate bool
191*61961e0fSrobinson xdr_ypresp_master(XDR *xdrs, struct ypresp_master *ps)
1927c478bd9Sstevel@tonic-gate {
193*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->status) &&
194*61961e0fSrobinson 	    xdr_ypowner_wrap_string(xdrs, &ps->master)));
1957c478bd9Sstevel@tonic-gate }
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate /*
1987c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypresp_order structure.
1997c478bd9Sstevel@tonic-gate  */
2007c478bd9Sstevel@tonic-gate bool
201*61961e0fSrobinson xdr_ypresp_order(XDR *xdrs, struct ypresp_order *ps)
2027c478bd9Sstevel@tonic-gate {
203*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->status) &&
204*61961e0fSrobinson 	    xdr_u_int(xdrs, &ps->ordernum)));
2057c478bd9Sstevel@tonic-gate }
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate /*
2087c478bd9Sstevel@tonic-gate  * This is like xdr_ypmap_wrap_string except that it serializes/deserializes
2097c478bd9Sstevel@tonic-gate  * an array, instead of a pointer, so xdr_reference can work on the structure
2107c478bd9Sstevel@tonic-gate  * containing the char array itself.
2117c478bd9Sstevel@tonic-gate  */
2127c478bd9Sstevel@tonic-gate static bool
213*61961e0fSrobinson xdr_ypmaplist_wrap_string(XDR *xdrs, char *pstring)
2147c478bd9Sstevel@tonic-gate {
2157c478bd9Sstevel@tonic-gate 	char *s;
2167c478bd9Sstevel@tonic-gate 
2177c478bd9Sstevel@tonic-gate 	s = pstring;
218*61961e0fSrobinson 	return ((bool)xdr_string(xdrs, &s, YPMAXMAP));
2197c478bd9Sstevel@tonic-gate }
2207c478bd9Sstevel@tonic-gate 
2217c478bd9Sstevel@tonic-gate /*
2227c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypmaplist.
2237c478bd9Sstevel@tonic-gate  */
2247c478bd9Sstevel@tonic-gate static bool
225*61961e0fSrobinson xdr_ypmaplist(XDR *xdrs, struct ypmaplist **lst)
2267c478bd9Sstevel@tonic-gate {
2277c478bd9Sstevel@tonic-gate 	bool_t more_elements;
2287c478bd9Sstevel@tonic-gate 	int freeing = (xdrs->x_op == XDR_FREE);
2297c478bd9Sstevel@tonic-gate 	struct ypmaplist **next;
2307c478bd9Sstevel@tonic-gate 
2317c478bd9Sstevel@tonic-gate 	for (;;) {
232*61961e0fSrobinson 		more_elements = (*lst != NULL);
2337c478bd9Sstevel@tonic-gate 
234*61961e0fSrobinson 		if (!xdr_bool(xdrs, &more_elements))
2357c478bd9Sstevel@tonic-gate 			return (FALSE);
2367c478bd9Sstevel@tonic-gate 
237*61961e0fSrobinson 		if (!more_elements)
2387c478bd9Sstevel@tonic-gate 			return (TRUE);  /* All done */
2397c478bd9Sstevel@tonic-gate 
2407c478bd9Sstevel@tonic-gate 		if (freeing)
2417c478bd9Sstevel@tonic-gate 			next = &((*lst)->ypml_next);
2427c478bd9Sstevel@tonic-gate 
243*61961e0fSrobinson 		if (!xdr_reference(xdrs, (caddr_t *)lst,
244*61961e0fSrobinson 			(uint_t)sizeof (struct ypmaplist),
245*61961e0fSrobinson 		    (xdrproc_t)xdr_ypmaplist_wrap_string))
2467c478bd9Sstevel@tonic-gate 			return (FALSE);
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate 		lst = (freeing) ? next : &((*lst)->ypml_next);
2497c478bd9Sstevel@tonic-gate 	}
2507c478bd9Sstevel@tonic-gate 	/*NOTREACHED*/
2517c478bd9Sstevel@tonic-gate }
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate /*
2547c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypresp_maplist.
2557c478bd9Sstevel@tonic-gate  */
2567c478bd9Sstevel@tonic-gate bool
257*61961e0fSrobinson xdr_ypresp_maplist(XDR *xdrs, struct ypresp_maplist *ps)
2587c478bd9Sstevel@tonic-gate {
259*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->status) &&
260*61961e0fSrobinson 		xdr_ypmaplist(xdrs, &ps->list)));
2617c478bd9Sstevel@tonic-gate }
2627c478bd9Sstevel@tonic-gate 
2637c478bd9Sstevel@tonic-gate /*
2647c478bd9Sstevel@tonic-gate  * Serializes/deserializes a yppushresp_xfr structure.
2657c478bd9Sstevel@tonic-gate  */
2667c478bd9Sstevel@tonic-gate bool
267*61961e0fSrobinson xdr_yppushresp_xfr(XDR *xdrs, struct yppushresp_xfr *ps)
2687c478bd9Sstevel@tonic-gate {
269*61961e0fSrobinson 	return ((bool)(xdr_u_int(xdrs, &ps->transid) &&
270*61961e0fSrobinson 	    xdr_u_int(xdrs, &ps->status)));
2717c478bd9Sstevel@tonic-gate }
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate /*
2757c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypreq_xfr structure.
2767c478bd9Sstevel@tonic-gate  */
2777c478bd9Sstevel@tonic-gate bool
278*61961e0fSrobinson xdr_ypreq_newxfr(XDR *xdrs, struct ypreq_newxfr *ps)
2797c478bd9Sstevel@tonic-gate {
280*61961e0fSrobinson 	return ((bool)(xdr_ypmap_parms(xdrs, &ps->map_parms) &&
2817c478bd9Sstevel@tonic-gate 	    xdr_u_int(xdrs, &ps->transid) &&
2827c478bd9Sstevel@tonic-gate 	    xdr_u_int(xdrs, &ps->proto) &&
283*61961e0fSrobinson 	    xdr_string(xdrs, &ps->name, 256)));
2847c478bd9Sstevel@tonic-gate }
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate /*
2877c478bd9Sstevel@tonic-gate  * Serializes/deserializes a ypreq_xfr structure.
2887c478bd9Sstevel@tonic-gate  */
2897c478bd9Sstevel@tonic-gate bool
290*61961e0fSrobinson xdr_ypreq_xfr(XDR *xdrs, struct ypreq_xfr *ps)
2917c478bd9Sstevel@tonic-gate {
292*61961e0fSrobinson 	return ((bool)(xdr_ypmap_parms(xdrs, &ps->map_parms) &&
2937c478bd9Sstevel@tonic-gate 	    xdr_u_int(xdrs, &ps->transid) &&
2947c478bd9Sstevel@tonic-gate 	    xdr_u_int(xdrs, &ps->proto) &&
295*61961e0fSrobinson 	    xdr_u_short(xdrs, &ps->port)));
2967c478bd9Sstevel@tonic-gate }
2977c478bd9Sstevel@tonic-gate 
2987c478bd9Sstevel@tonic-gate 
2997c478bd9Sstevel@tonic-gate /*
3007c478bd9Sstevel@tonic-gate  * Serializes/deserializes a stream of struct ypresp_key_val's.  This is used
3017c478bd9Sstevel@tonic-gate  * only by the client side of the batch enumerate operation.
3027c478bd9Sstevel@tonic-gate  */
3037c478bd9Sstevel@tonic-gate bool
304*61961e0fSrobinson xdr_ypall(XDR *xdrs, struct ypall_callback *callback)
3057c478bd9Sstevel@tonic-gate {
3067c478bd9Sstevel@tonic-gate 	bool_t more;
3077c478bd9Sstevel@tonic-gate 	struct ypresp_key_val kv;
3087c478bd9Sstevel@tonic-gate 	char keybuf[YPMAXRECORD];
3097c478bd9Sstevel@tonic-gate 	char valbuf[YPMAXRECORD];
3107c478bd9Sstevel@tonic-gate 
311*61961e0fSrobinson 	if (xdrs->x_op == XDR_ENCODE)
3127c478bd9Sstevel@tonic-gate 		return (FALSE);
3137c478bd9Sstevel@tonic-gate 
314*61961e0fSrobinson 	if (xdrs->x_op == XDR_FREE)
3157c478bd9Sstevel@tonic-gate 		return (TRUE);
3167c478bd9Sstevel@tonic-gate 
3177c478bd9Sstevel@tonic-gate 	kv.keydat.dptr = keybuf;
3187c478bd9Sstevel@tonic-gate 	kv.valdat.dptr = valbuf;
3197c478bd9Sstevel@tonic-gate 	kv.keydat.dsize = YPMAXRECORD;
3207c478bd9Sstevel@tonic-gate 	kv.valdat.dsize = YPMAXRECORD;
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate 	for (;;) {
323*61961e0fSrobinson 		if (!xdr_bool(xdrs, &more))
3247c478bd9Sstevel@tonic-gate 			return (FALSE);
3257c478bd9Sstevel@tonic-gate 
326*61961e0fSrobinson 		if (!more)
3277c478bd9Sstevel@tonic-gate 			return (TRUE);
3287c478bd9Sstevel@tonic-gate 
329*61961e0fSrobinson 		if (!xdr_ypresp_key_val(xdrs, &kv))
3307c478bd9Sstevel@tonic-gate 			return (FALSE);
331*61961e0fSrobinson 		if ((*callback->foreach)(kv.status, kv.keydat.dptr,
332*61961e0fSrobinson 			    kv.keydat.dsize, kv.valdat.dptr, kv.valdat.dsize,
333*61961e0fSrobinson 			    callback->data))
334*61961e0fSrobinson 			return (TRUE);
3357c478bd9Sstevel@tonic-gate 	}
3367c478bd9Sstevel@tonic-gate }
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate bool_t
339*61961e0fSrobinson xdr_netconfig(XDR *xdrs, struct netconfig *objp)
3407c478bd9Sstevel@tonic-gate {
341*61961e0fSrobinson 	if (!xdr_string(xdrs, &objp->nc_netid, ~0))
3427c478bd9Sstevel@tonic-gate 		return (FALSE);
343*61961e0fSrobinson 	if (!xdr_u_int(xdrs, &objp->nc_semantics))
3447c478bd9Sstevel@tonic-gate 		return (FALSE);
345*61961e0fSrobinson 	if (!xdr_u_int(xdrs, &objp->nc_flag))
3467c478bd9Sstevel@tonic-gate 		return (FALSE);
347*61961e0fSrobinson 	if (!xdr_string(xdrs, &objp->nc_protofmly, ~0))
3487c478bd9Sstevel@tonic-gate 		return (FALSE);
349*61961e0fSrobinson 	if (!xdr_string(xdrs, &objp->nc_proto, ~0))
3507c478bd9Sstevel@tonic-gate 		return (FALSE);
351*61961e0fSrobinson 	if (!xdr_string(xdrs, &objp->nc_device, ~0))
3527c478bd9Sstevel@tonic-gate 		return (FALSE);
353*61961e0fSrobinson 	if (!xdr_array(xdrs, (char **)&objp->nc_lookups,
354*61961e0fSrobinson 		(uint_t *)&objp->nc_nlookups, 100, sizeof (char *),
355*61961e0fSrobinson 		xdr_wrapstring))
3567c478bd9Sstevel@tonic-gate 		return (FALSE);
357*61961e0fSrobinson 	return ((bool)xdr_vector(xdrs, (char *)objp->nc_unused,
358*61961e0fSrobinson 		8, sizeof (uint_t), xdr_u_int));
3597c478bd9Sstevel@tonic-gate }
360