From ae27cfaba3ba8c74eeb46881bede536f5b6287a8 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Thu, 8 Jul 1999 02:45:17 +0000 Subject: [PATCH] add isc_net_haveipv[46]; cleanups --- lib/isc/unix/include/isc/net.h.in | 57 +++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/lib/isc/unix/include/isc/net.h.in b/lib/isc/unix/include/isc/net.h.in index e1844aff87..f5fff21105 100644 --- a/lib/isc/unix/include/isc/net.h.in +++ b/lib/isc/unix/include/isc/net.h.in @@ -55,16 +55,10 @@ * RFC 2553 */ - /*** - *** Imports. + *** Defines. ***/ -#include -#include - -#include - /* * If sockaddrs on this system have an sa_len field, ISC_NET_HAVESALEN will * be defined. @@ -75,18 +69,59 @@ * If this system needs AF_INET6, ISC_NET_NEEDAFINET6 will be defined. */ @ISC_NET_NEEDAFINET6@ -#ifdef ISC_NET_NEEDAFINET6 -#define AF_INET6 99 -#define PF_INET6 AF_INET6 -#endif /* * If this system needs the IPv6 structure definitions, ISC_NET_HAVEIPV6 * will not be defined, and the structure definintions will be included. */ @ISC_NET_HAVEIPV6@ + +/*** + *** Imports. + ***/ + +#include +#include + +#include + +#include + +#ifdef ISC_NET_NEEDAFINET6 +#define AF_INET6 99 +#define PF_INET6 AF_INET6 +#endif + #ifndef ISC_NET_HAVEIPV6 #include #endif +/*** + *** Functions. + ***/ + +isc_result_t +isc_net_haveipv4(void); +/* + * Check if the system's kernel supports IPv4. + * + * Returns: + * + * ISC_R_SUCCESS IPv4 is supported. + * ISC_R_NOTFOUND IPv4 is not supported. + * ISC_R_UNEXPECTED + */ + +isc_result_t +isc_net_haveipv6(void); +/* + * Check if the system's kernel supports IPv6. + * + * Returns: + * + * ISC_R_SUCCESS IPv4 is supported. + * ISC_R_NOTFOUND IPv4 is not supported. + * ISC_R_UNEXPECTED + */ + #endif /* ISC_NET_H */