/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley
* under license from the Regents of the University of
* California.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "mt.h"
#include <stdlib.h>
#include <unistd.h>
#include "yp_b.h"
#include <string.h>
extern int __yp_dobind_cflookup(char *, struct dom_binding **, int);
char **, int *, char **, int *);
static int donext(char *, char *, char *, int, struct dom_binding *,
/*
* This requests the yp server associated with a given domain to return the
* used as an input to the call to ypclnt_next. This part does the parameter
* checking, and the do-until-success loop if 'hardlookup' is set.
*/
int
char *domain,
char *map,
char **key, /* return: key array */
int *keylen, /* return: bytes in key */
char **val, /* return: value array */
int *vallen, /* return: bytes in val */
int hardlookup)
{
int reason;
return (YPERR_BADARGS);
return (YPERR_BADARGS);
for (;;) {
return (reason);
if (hardlookup)
else
return (reason);
} else
break;
} else {
return (YPERR_VERS);
}
}
return (reason);
}
int
char *domain,
char *map,
char **key, /* return: key array */
int *keylen, /* return: bytes in key */
char **val, /* return: value array */
int *vallen) /* return: bytes in val */
{
/* traditional yp_firs loops forever until success */
}
/*
* This part of the "get first" interface talks to ypserv.
*/
static int
char *domain;
char *map;
struct dom_binding *pdomb;
char **key;
int *keylen;
char **val;
int *vallen;
{
unsigned int retval = 0;
/*
* Do the get first request. If the rpc call failed, return with status
* from this point.
*/
case RPC_SUCCESS:
break;
case RPC_TIMEDOUT:
return (YPERR_YPSERV);
default:
return (YPERR_RPC);
}
/* See if the request succeeded */
}
/* Get some memory which the user can get rid of as he likes */
if (!retval) {
}
} else {
}
}
/* Copy the returned key and value byte strings into the new memory */
if (!retval) {
}
return (retval);
}
/*
* This requests the yp server associated with a given domain to return the
* one returned by ypclnt_first or a previous call to ypclnt_next. The
* returned key should be used as an input to the next call to ypclnt_next.
* This part does the parameter checking, and the do-until-success loop.
* if 'hardlookup' is set.
*/
int
char *domain,
char *map,
char *inkey,
int inkeylen,
char **outkey, /* return: key array associated with val */
int *outkeylen, /* return: bytes in key */
char **val, /* return: value array associated with outkey */
int *vallen, /* return: bytes in val */
int hardlookup)
{
int reason;
return (YPERR_BADARGS);
return (YPERR_BADARGS);
for (;;) {
return (reason);
if (hardlookup)
else
return (reason);
} else
break;
} else {
return (YPERR_VERS);
}
}
return (reason);
}
int
char *domain,
char *map,
char *inkey,
int inkeylen,
char **outkey, /* return: key array associated with val */
int *outkeylen, /* return: bytes in key */
char **val, /* return: value array associated with outkey */
int *vallen) /* return: bytes in val */
{
/* traditional yp_next loops forever until success */
}
/*
* This part of the "get next" interface talks to ypserv.
*/
static int
char *domain;
char *map;
char *inkey;
int inkeylen;
struct dom_binding *pdomb;
char **outkey; /* return: key array associated with val */
int *outkeylen; /* return: bytes in key */
char **val; /* return: value array associated with outkey */
int *vallen; /* return: bytes in val */
{
unsigned int retval = 0;
/*
* Do the get next request. If the rpc call failed, return with status
* from this point.
*/
timeout)) {
case RPC_SUCCESS:
break;
case RPC_TIMEDOUT:
return (YPERR_YPSERV);
default:
return (YPERR_RPC);
}
/* See if the request succeeded */
}
/* Get some memory which the user can get rid of as he likes */
if (!retval) {
}
} else {
}
}
/* Copy the returned key and value byte strings into the new memory */
if (!retval) {
}
(char *)&resp);
return (retval);
}