/*
* 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 (c) 1991, 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <malloc.h>
#include <netinet/in_systm.h>
#include <netinet/if_ether.h>
#include <netdb.h>
#include <string.h>
#include <signal.h>
#include <setjmp.h>
/*
* Note: If making changes to this file, check also the file
* as it has the same functions there.
*/
struct hostdata {
char *h_hostname;
int h_pktsout;
int h_pktsin;
};
struct hostdata4 {
char *h4_hostname;
int h4_pktsout;
int h4_pktsin;
};
struct hostdata6 {
char *h6_hostname;
int h6_pktsout;
int h6_pktsin;
};
/* ARGSUSED */
static void
wakeup(int n)
{
}
extern char *inet_ntoa();
static struct hostdata *
{
register struct hostdata4 *h;
int error_num;
return ((struct hostdata *)h);
}
/* not found. Put it in */
/*
* Set an alarm here so we don't get held up by
* an unresponsive name server.
* Give it 3 sec to do its work.
*/
(void) alarm(3);
if (np)
}
(void) alarm(0);
} else {
}
}
static struct hostdata *
{
struct hostdata6 *h;
int error_num;
char *addname;
h = h->h6_next) {
return ((struct hostdata *)h);
}
/* not in the hash table, put it in */
/*
* Set an alarm here so we don't get held up by
* an unresponsive name server.
* Give it 3 sec to do its work.
*/
(void) alarm(3);
(void) alarm(0);
} else {
}
else {
}
return (retval);
}
static struct hostdata *
int family;
void *ipaddr;
char *name;
{
int hashval;
switch (family) {
case AF_INET:
if (n == NULL)
goto alloc_failed;
if (n->h_hostname == NULL)
goto alloc_failed;
break;
case AF_INET6:
if (n == NULL)
goto alloc_failed;
if (n->h_hostname == NULL)
goto alloc_failed;
sizeof (struct in6_addr));
break;
default:
"nfslog: addhost ERROR: Unknown address family: %d",
family);
return (NULL);
}
*hp = n;
return (n);
if (n != NULL)
free(n);
return (NULL);
}
char *
{
switch (family) {
case AF_INET:
break;
case AF_INET6:
break;
default:
"family: %d\n", family);
}
}