net.c revision 9cd6d409b78a6f833b681c13a68fbdc7c024fe66
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: net.c,v 1.14 2000/12/06 00:30:30 tale Exp $ */
#include <config.h>
#include <errno.h>
#include <unistd.h>
#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
#endif
static isc_result_t
int s;
if (s == -1) {
switch (errno) {
#ifdef EAFNOSUPPORT
case EAFNOSUPPORT:
#endif
#ifdef EPROTONOSUPPORT
case EPROTONOSUPPORT:
#endif
#ifdef EINVAL
case EINVAL:
#endif
return (ISC_R_NOTFOUND);
default:
"socket() %s: %s",
"failed"),
return (ISC_R_UNEXPECTED);
}
}
close (s);
return (ISC_R_SUCCESS);
}
static void
initialize_action(void) {
#ifdef ISC_PLATFORM_HAVEIPV6
#ifdef WANT_IPV6
#ifdef ISC_PLATFORM_HAVEIN6PKTINFO
#else
ipv6_result = 0;
#endif
#endif
#endif
}
static void
initialize(void) {
}
isc_net_probeipv4(void) {
/*
* Check if the system's kernel supports IPv4.
*/
initialize();
return (ipv4_result);
}
isc_net_probeipv6(void) {
/*
* Check if the system's kernel supports IPv6.
*/
initialize();
return (ipv6_result);
}