/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: misc.c 146 2006-03-24 00:26:54Z njacobs $ */
#pragma ident "%Z%%M% %I% %E% SMI"
/*LINTLIBRARY*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <papi.h>
#include <uri.h>
#include <config-site.h>
/*
* The implementations of strlcpy() and strlcat() have been taken directly
* from OpenSolaris. The contents of this file originated from
*/
#ifndef HAVE_STRLCPY
{
if (len == 0)
return (slen);
else
return (slen);
}
#endif
#ifndef HAVE_STRLCAT
{
df++;
}
#endif
#include <sys/systeminfo.h>
#include <netdb.h>
static struct in6_addr **
{
int s;
struct lifnum n;
struct lifconf c;
struct lifreq *r;
int count;
/* we need a socket to get the interfaces */
return (0);
/* get the number of interfaces */
memset(&n, 0, sizeof (n));
n.lifn_family = AF_UNSPEC;
if (ioctl(s, SIOCGLIFNUM, (char *)&n) < 0) {
close(s);
return (0); /* no interfaces */
}
/* get the interface(s) configuration */
memset(&c, 0, sizeof (c));
c.lifc_family = AF_UNSPEC;
if (ioctl(s, SIOCGLIFCONF, (char *)&c) < 0) {
close(s);
return (0); /* can't get interface(s) configuration */
}
close(s);
r = c.lifc_req;
case AF_INET: {
struct sockaddr_in *s =
(struct sockaddr_in *)&r->lifr_addr;
}
break;
case AF_INET6: {
struct sockaddr_in6 *s =
(struct sockaddr_in6 *)&r->lifr_addr;
}
break;
}
list_append(&result, a);
}
}
return (result);
}
static int
{
int rc = 0;
int errnum;
/* are there any local interfaces */
return (0);
/* cycle through the host db addresses */
int i;
int j;
sizeof (struct in6_addr)) == 0)
rc = 1;
}
}
return (rc);
}
#endif
int
{
/* is it "localhost" */
return (1);
/* is it the {nodename} */
return (1);
/* does it match one of the host's configured interfaces */
if (match_interfaces(host) != 0)
return (1);
#endif
return (0);
}