1996-08-16 01:43:03 +04:00
|
|
|
/* $NetBSD: xdryp.c,v 1.15 1996/08/15 21:43:03 chuck Exp $ */
|
1995-02-27 15:54:33 +03:00
|
|
|
|
1993-05-16 06:47:20 +04:00
|
|
|
/*
|
1996-05-30 00:00:52 +04:00
|
|
|
* Copyright (c) 1996 Jason R. Thorpe <thorpej@NetBSD.ORG>.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
1994-05-25 13:52:05 +04:00
|
|
|
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
|
1993-05-16 06:47:20 +04:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
1994-05-25 13:52:05 +04:00
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Theo de Raadt.
|
1996-05-30 00:00:52 +04:00
|
|
|
* This product includes software developed for the NetBSD Project
|
|
|
|
* by Jason R. Thorpe.
|
1994-05-25 13:52:05 +04:00
|
|
|
* 4. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
1993-05-16 06:47:20 +04:00
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
|
|
|
|
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
|
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
1996-02-05 02:26:21 +03:00
|
|
|
#if defined(LIBC_SCCS) && !defined(lint)
|
1996-08-16 01:43:03 +04:00
|
|
|
static char *rcsid = "$NetBSD: xdryp.c,v 1.15 1996/08/15 21:43:03 chuck Exp $";
|
1993-05-16 06:47:20 +04:00
|
|
|
#endif
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
/*
|
|
|
|
* XDR routines used by the YP protocol. Note that these routines do
|
|
|
|
* not strictly conform to the RPC definition in yp.x. This file
|
|
|
|
* replicates the functions exported by the Sun YP API; reality is
|
|
|
|
* often inaccurate.
|
|
|
|
*/
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <stdio.h>
|
1994-08-07 03:07:47 +04:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1993-04-26 12:23:39 +04:00
|
|
|
#include <ctype.h>
|
|
|
|
#include <rpc/rpc.h>
|
|
|
|
#include <rpc/xdr.h>
|
|
|
|
#include <rpcsvc/yp_prot.h>
|
|
|
|
#include <rpcsvc/ypclnt.h>
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
/*
|
|
|
|
* Functions used only within this file.
|
|
|
|
*/
|
|
|
|
static bool_t xdr_ypbind_binding __P((XDR *, struct ypbind_binding *));
|
|
|
|
static bool_t xdr_ypbind_resptype __P((XDR *, enum ypbind_resptype *));
|
|
|
|
static bool_t xdr_ypstat __P((XDR *, enum ypbind_resptype *));
|
|
|
|
static bool_t xdr_ypmaplist_str __P((XDR *, char *));
|
|
|
|
|
|
|
|
__warn_references(xdr_domainname,
|
|
|
|
"warning: this program uses xdr_domainname(), which is deprecated and buggy.");
|
1993-04-26 12:23:39 +04:00
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_domainname(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
char *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_string(xdrs, &objp, YPMAXDOMAIN);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
__warn_references(xdr_peername,
|
|
|
|
"warning: this program uses xdr_peername(), which is deprecated and buggy.");
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
bool_t
|
|
|
|
xdr_peername(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
char *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_string(xdrs, &objp, YPMAXPEER);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
__warn_references(xdr_mapname,
|
|
|
|
"warning: this program uses xdr_mapname(), which is deprecated and buggy.");
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
bool_t
|
1996-05-30 00:00:52 +04:00
|
|
|
xdr_mapname(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
char *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
return xdr_string(xdrs, &objp, YPMAXMAP);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
1996-05-30 00:00:52 +04:00
|
|
|
xdr_ypdomain_wrap_string(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
char **objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
return xdr_string(xdrs, objp, YPMAXDOMAIN);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypmap_wrap_string(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
char **objp;
|
|
|
|
{
|
|
|
|
return xdr_string(xdrs, objp, YPMAXMAP);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypowner_wrap_string(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
char **objp;
|
|
|
|
{
|
|
|
|
return xdr_string(xdrs, objp, YPMAXPEER);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_datum(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
datum *objp;
|
|
|
|
{
|
|
|
|
return xdr_bytes(xdrs, (char **)&objp->dptr,
|
|
|
|
(u_int *)&objp->dsize, YPMAXRECORD);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypreq_key(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypreq_key *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypdomain_wrap_string(xdrs, (char **)&objp->domain))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypmap_wrap_string(xdrs, (char **)&objp->map))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_datum(xdrs, &objp->keydat))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypreq_nokey(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypreq_nokey *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypdomain_wrap_string(xdrs, (char **)&objp->domain))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!xdr_ypmap_wrap_string(xdrs, (char **)&objp->map))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_yp_inaddr(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct in_addr *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_opaque(xdrs, (caddr_t)&objp->s_addr, sizeof objp->s_addr);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
static bool_t
|
1993-04-26 12:23:39 +04:00
|
|
|
xdr_ypbind_binding(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypbind_binding *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_yp_inaddr(xdrs, &objp->ypbind_binding_addr))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_opaque(xdrs, (void *)&objp->ypbind_binding_port,
|
|
|
|
sizeof objp->ypbind_binding_port))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
static bool_t
|
1993-04-26 12:23:39 +04:00
|
|
|
xdr_ypbind_resptype(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
enum ypbind_resptype *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_enum(xdrs, (enum_t *)objp);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
static bool_t
|
1993-04-26 12:23:39 +04:00
|
|
|
xdr_ypstat(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
enum ypbind_resptype *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_enum(xdrs, (enum_t *)objp);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypbind_resp(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypbind_resp *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypbind_resptype(xdrs, &objp->ypbind_status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
switch (objp->ypbind_status) {
|
|
|
|
case YPBIND_FAIL_VAL:
|
1995-07-15 01:04:17 +04:00
|
|
|
return xdr_u_int(xdrs,
|
1996-05-30 00:00:52 +04:00
|
|
|
(u_int *)&objp->ypbind_respbody.ypbind_error);
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
case YPBIND_SUCC_VAL:
|
1996-05-30 00:00:52 +04:00
|
|
|
return xdr_ypbind_binding(xdrs,
|
|
|
|
&objp->ypbind_respbody.ypbind_bindinfo);
|
|
|
|
|
1993-04-26 12:23:39 +04:00
|
|
|
default:
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
1994-08-07 03:07:47 +04:00
|
|
|
/* NOTREACHED */
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypresp_val(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypresp_val *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)&objp->status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_datum(xdrs, &objp->valdat))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypbind_setdom(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypbind_setdom *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
char *cp = objp->ypsetdom_domain;
|
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypdomain_wrap_string(xdrs, &cp))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
|
|
|
if (!xdr_ypbind_binding(xdrs, &objp->ypsetdom_binding))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->ypsetdom_vers))
|
1996-06-19 00:05:59 +04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypresp_key_val(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypresp_key_val *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)&objp->status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1993-04-26 12:23:39 +04:00
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_datum(xdrs, &objp->valdat))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_datum(xdrs, &objp->keydat))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
1996-05-30 00:00:52 +04:00
|
|
|
xdr_ypall(xdrs, incallback)
|
|
|
|
XDR *xdrs;
|
|
|
|
struct ypall_callback *incallback;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
struct ypresp_key_val out;
|
|
|
|
char key[YPMAXRECORD], val[YPMAXRECORD];
|
|
|
|
bool_t more, status;
|
1995-07-15 01:04:17 +04:00
|
|
|
int size;
|
1993-04-26 12:23:39 +04:00
|
|
|
int r;
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
/*
|
|
|
|
* Set up key/val struct to be used during the transaction.
|
|
|
|
*/
|
1994-08-07 03:07:47 +04:00
|
|
|
memset(&out, 0, sizeof out);
|
1996-05-30 00:00:52 +04:00
|
|
|
out.keydat.dptr = key;
|
|
|
|
out.keydat.dsize = sizeof(key);
|
|
|
|
out.valdat.dptr = val;
|
|
|
|
out.valdat.dsize = sizeof(val);
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
/* Values pending? */
|
|
|
|
if (!xdr_bool(xdrs, &more))
|
|
|
|
return FALSE; /* can't tell! */
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!more)
|
1996-05-30 00:00:52 +04:00
|
|
|
return TRUE; /* no more */
|
|
|
|
|
|
|
|
/* Transfer key/value pair. */
|
|
|
|
status = xdr_ypresp_key_val(xdrs, &out);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we succeeded, call the callback function.
|
|
|
|
* The callback will return TRUE when it wants
|
|
|
|
* no more values. If we fail, indicate the
|
|
|
|
* error.
|
|
|
|
*/
|
1996-06-19 00:05:59 +04:00
|
|
|
if (status) {
|
1996-05-30 00:00:52 +04:00
|
|
|
if ((*incallback->foreach)(out.status,
|
|
|
|
(char *)out.keydat.dptr, out.keydat.dsize,
|
|
|
|
(char *)out.valdat.dptr, out.valdat.dsize,
|
|
|
|
incallback->data))
|
1993-04-26 12:23:39 +04:00
|
|
|
return TRUE;
|
1996-05-30 00:00:52 +04:00
|
|
|
} else
|
|
|
|
return FALSE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypresp_master(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypresp_master *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)&objp->status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_string(xdrs, &objp->master, YPMAXPEER))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
1996-05-30 00:00:52 +04:00
|
|
|
static bool_t
|
1993-04-26 12:23:39 +04:00
|
|
|
xdr_ypmaplist_str(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
char *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1994-08-07 03:07:47 +04:00
|
|
|
return xdr_string(xdrs, &objp, YPMAXMAP+1);
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypmaplist(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypmaplist *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypmaplist_str(xdrs, objp->ypml_name))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_pointer(xdrs, (caddr_t *)&objp->ypml_next,
|
|
|
|
sizeof(struct ypmaplist), xdr_ypmaplist))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypresp_maplist(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypresp_maplist *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)&objp->status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_pointer(xdrs, (caddr_t *)&objp->list,
|
|
|
|
sizeof(struct ypmaplist), xdr_ypmaplist))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypresp_order(xdrs, objp)
|
1996-05-30 00:00:52 +04:00
|
|
|
XDR *xdrs;
|
|
|
|
struct ypresp_order *objp;
|
1993-04-26 12:23:39 +04:00
|
|
|
{
|
1996-05-30 00:00:52 +04:00
|
|
|
if (!xdr_ypstat(xdrs, (enum ypbind_resptype *)&objp->status))
|
1995-07-15 01:04:17 +04:00
|
|
|
return FALSE;
|
1996-05-30 00:00:52 +04:00
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->ordernum))
|
1996-06-19 00:05:59 +04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
1993-04-26 12:23:39 +04:00
|
|
|
}
|
1996-05-30 00:00:52 +04:00
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypreq_xfr(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
struct ypreq_xfr *objp;
|
|
|
|
{
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypmap_parms(xdrs, &objp->map_parms))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->transid))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->proto))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->port))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_ypmap_parms(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
struct ypmap_parms *objp;
|
|
|
|
{
|
1996-08-16 01:43:03 +04:00
|
|
|
if (!xdr_ypdomain_wrap_string(xdrs, (char **)&objp->domain))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-16 01:43:03 +04:00
|
|
|
if (!xdr_ypmap_wrap_string(xdrs, (char **)&objp->map))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->ordernum))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-06-19 00:05:59 +04:00
|
|
|
if (!xdr_ypowner_wrap_string(xdrs, &objp->owner))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool_t
|
|
|
|
xdr_yppushresp_xfr(xdrs, objp)
|
|
|
|
XDR *xdrs;
|
|
|
|
struct yppushresp_xfr *objp;
|
|
|
|
{
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_u_int(xdrs, &objp->transid))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
1996-08-09 14:06:02 +04:00
|
|
|
if (!xdr_enum(xdrs, (enum_t *)&objp->status))
|
1996-05-30 00:00:52 +04:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|