rpc_bootstrap.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 2002 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 <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <tiuser.h>
#include <netdir.h>
#include <netdb.h>
#include <rpc/pmap_clnt.h>
int __rpcb_getaddr_bootstrap();
struct hostent *__files_gethostbyname();
extern int hostNotKnownLocally;
static char *__map_addr();
/*
* __clnt_tp_create_bootstrap()
*
* This routine is NOT TRANSPORT INDEPENDENT.
*
* translation and does it itself instead of calling netdir_getbyname
* thereby avoids recursion.
*/
CLIENT *
char *hostname;
{
struct sockaddr_in6 *sa;
int fd;
return (NULL);
}
return (NULL);
}
if (! svc_taddr) {
return (NULL);
}
if (! sa) {
return (NULL);
}
return (NULL);
}
if (cl == 0) {
}
return (cl);
}
/*
* __rpcb_getaddr_bootstrap()
*
* This is our internal function that replaces rpcb_getaddr(). We
* build our own to prevent calling netdir_getbyname() which could
* recurse to the nameservice.
*/
int
char *hostname;
{
char *svc_uaddr;
struct sockaddr_in *sa;
struct sockaddr_in6 *sa6;
struct netbuf rpcb_taddr;
struct sockaddr_in local_sa;
struct sockaddr_in6 local_sa6;
int i, ipaddrlen;
return (FALSE);
}
/* Get the address of the RPCBIND at hostname */
hostNotKnownLocally = 1;
return (FALSE);
}
switch (hent->h_addrtype) {
case AF_INET:
break;
case AF_INET6:
break;
default:
return (FALSE);
}
if (! svc_uaddr)
return (FALSE);
/* do a local uaddr2taddr and stuff in the memory supplied by the caller */
/* Look for the first '.' starting from the end */
for (i = ipaddrlen-1; i >= 0; i--)
if (ipaddr[i] == '.') break;
/* Find the second dot (still counting from the end) */
for (i--; i >= 0; i--)
if (ipaddr[i] == '.') break;
/* If we didn't find it, the uaddr has a syntax error */
if (i < 0) {
return (FALSE);
}
ipaddr[i] = '\0';
return (FALSE);
}
} else {
return (FALSE);
}
}
return (TRUE);
}
/*
* __map_addr()
*
*/
static char *
{
int fd; /* Stream file descriptor */
/*
* First we open a connection to the remote rpcbind process.
*/
return (NULL);
}
if (! client) {
return (NULL);
}
/*
* Now make the call to get the NIS service address.
*/
if (clnt_st == RPC_SUCCESS) {
if (*ua == '\0') {
return (NULL);
}
return (ua);
} else if (((clnt_st == RPC_PROGVERSMISMATCH) ||
(clnt_st == RPC_PROGUNAVAIL) ||
(clnt_st == RPC_TIMEDOUT)) &&
/*
* version 3 not available. Try version 2
* The assumption here is that the netbuf
* is arranged in the sockaddr_in
* style for IP cases.
*/
struct sockaddr_in *sa;
int protocol;
char buf[32];
char *res;
if (port != 0) {
/* print s_addr (and port) in host byte order */
port & 0xff);
if (res != 0) {
} else {
}
} else {
}
return (res);
}
return (NULL);
}
#define MAXALIASES 35
static char *host_aliases[MAXALIASES];
static char *host_addrs[] = {
};
static char *any();
static struct hostent *__files_gethostent();
struct hostent *
{
register char **cp;
char **file;
} else {
return (0);
}
continue;
continue;
return (hp);
}
return (hp);
}
}
}
return (0);
}
static struct hostent *
{
char *p;
register char *cp, **q;
void *addr;
int len;
return (NULL);
return (NULL);
if (*p == '#')
goto again;
goto again;
*cp = '\0';
goto again;
*cp++ = '\0';
/* THIS STUFF IS INTERNET SPECIFIC */
if (isV6Addr(p)) {
} else {
}
goto again;
cp++;
*cp++ = '\0';
cp++;
continue;
}
*q++ = cp;
*cp++ = '\0';
}
*q = NULL;
return (&host);
}
static char *
register char *cp;
char *match;
{
register char *mp, c;
while (c = *cp) {
if (*mp == c)
return (cp);
cp++;
}
return ((char *)0);
}