From: Danny Mayer Date: Thu, 1 Aug 2002 03:56:08 +0000 (+0000) Subject: ipv6 cleanup and reorganization of header information X-Git-Tag: v9.2.3rc1~104^2~424 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=dd472802de36fd7db8c9bfcabfe72b07c5e07b7f;p=thirdparty%2Fbind9.git ipv6 cleanup and reorganization of header information --- diff --git a/lib/isc/win32/include/isc/ipv6.h b/lib/isc/win32/include/isc/ipv6.h index 000e9ff64cc..3822731d81a 100644 --- a/lib/isc/win32/include/isc/ipv6.h +++ b/lib/isc/win32/include/isc/ipv6.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ipv6.h,v 1.9 2001/07/17 20:29:33 gson Exp $ */ +/* $Id: ipv6.h,v 1.10 2002/08/01 03:56:08 mayer Exp $ */ #ifndef ISC_IPV6_H #define ISC_IPV6_H 1 @@ -25,17 +25,24 @@ *****/ /* - * This file defines additional information necessary for IP v6 support + * IPv6 definitions for systems which do not support IPv6. + * + * MP: + * No impact. + * + * Reliability: + * No anticipated impact. + * + * Resources: + * N/A. + * + * Security: + * No anticipated impact. + * + * Standards: + * RFC 2553. */ -#ifndef AF_INET6 -#define AF_INET6 99 -#endif - -#ifndef PF_INET6 -#define PF_INET6 AF_INET6 -#endif - #define s6_addr8 s6_addr #define in6_addr in_addr6 @@ -45,52 +52,45 @@ LIBISC_EXTERNAL_DATA extern const struct in_addr6 in6addr_any; LIBISC_EXTERNAL_DATA extern const struct in_addr6 in6addr_loopback; -#ifndef ISC_PLATFORM_HAVEIN6PKTINFO -struct in6_pktinfo { - struct in6_addr ipi6_addr; /* src/dst IPv6 address */ - unsigned int ipi6_ifindex; /* send/recv interface index */ -}; -#endif - /* * Unspecified */ -#define IN6_IS_ADDR_UNSPECIFIED(x) \ -*((u_long *)((x)->s6_addr) ) == 0 && \ -*((u_long *)((x)->s6_addr) + 1) == 0 && \ -*((u_long *)((x)->s6_addr) + 2) == 0 && \ -*((u_long *)((x)->s6_addr) + 3) == 1 \ +#define IN6_IS_ADDR_UNSPECIFIED(a) \ +*((u_long *)((a)->s6_addr) ) == 0 && \ +*((u_long *)((a)->s6_addr) + 1) == 0 && \ +*((u_long *)((a)->s6_addr) + 2) == 0 && \ +*((u_long *)((a)->s6_addr) + 3) == 0 \ ) /* * Loopback */ -#define IN6_IS_ADDR_LOOPBACK(x) (\ -*((u_long *)((x)->s6_addr) ) == 0 && \ -*((u_long *)((x)->s6_addr) + 1) == 0 && \ -*((u_long *)((x)->s6_addr) + 2) == 0 && \ -*((u_long *)((x)->s6_addr) + 3) == 1 \ +#define IN6_IS_ADDR_LOOPBACK(a) (\ +*((u_long *)((a)->s6_addr) ) == 0 && \ +*((u_long *)((a)->s6_addr) + 1) == 0 && \ +*((u_long *)((a)->s6_addr) + 2) == 0 && \ +*((u_long *)((a)->s6_addr) + 3) == htonl(1) \ ) /* * IPv4 compatible */ -#define IN6_IS_ADDR_V4COMPAT(x) (\ -*((u_long *)((x)->s6_addr) ) == 0 && \ -*((u_long *)((x)->s6_addr) + 1) == 0 && \ -*((u_long *)((x)->s6_addr) + 2) == 0 && \ -*((u_long *)((x)->s6_addr) + 3) != 0 && \ -*((u_long *)((x)->s6_addr) + 3) != htonl(1) \ +#define IN6_IS_ADDR_V4COMPAT(a) (\ +*((u_long *)((a)->s6_addr) ) == 0 && \ +*((u_long *)((a)->s6_addr) + 1) == 0 && \ +*((u_long *)((a)->s6_addr) + 2) == 0 && \ +*((u_long *)((a)->s6_addr) + 3) != 0 && \ +*((u_long *)((a)->s6_addr) + 3) != htonl(1) \ ) /* * Mapped */ -#define IN6_IS_ADDR_V4MAPPED(x) (\ -*((u_long *)((x)->s6_addr) ) == 0 && \ -*((u_long *)((x)->s6_addr) + 1) == 0 && \ -*((u_long *)((x)->s6_addr) + 2) == htonl(0x0000ffff)) +#define IN6_IS_ADDR_V4MAPPED(a) (\ +*((u_long *)((a)->s6_addr) ) == 0 && \ +*((u_long *)((a)->s6_addr) + 1) == 0 && \ +*((u_long *)((a)->s6_addr) + 2) == htonl(0x0000ffff)) /* * Multicast @@ -98,6 +98,14 @@ struct in6_pktinfo { #define IN6_IS_ADDR_MULTICAST(a) \ ((a)->s6_addr8[0] == 0xffU) -ISC_LANG_ENDDECLS +/* + * Unicast link / site local. + */ +#define IN6_IS_ADDR_LINKLOCAL(a) (\ +(*((u_long *)((a)->s6_addr) ) == 0xfe) && \ +((*((u_long *)((a)->s6_addr) + 1) & 0xc0) == 0x80)) +#define IN6_IS_ADDR_SITELOCAL(a) (\ +(*((u_long *)((a)->s6_addr) ) == 0xfe) && \ +((*((u_long *)((a)->s6_addr) + 1) & 0xc0) == 0xc0)) #endif /* ISC_IPV6_H */ diff --git a/lib/isc/win32/include/isc/net.h b/lib/isc/win32/include/isc/net.h index 50bf1995ef2..43e54fbe366 100644 --- a/lib/isc/win32/include/isc/net.h +++ b/lib/isc/win32/include/isc/net.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: net.h,v 1.16 2001/11/27 00:56:25 gson Exp $ */ +/* $Id: net.h,v 1.17 2002/08/01 03:56:08 mayer Exp $ */ #ifndef ISC_NET_H #define ISC_NET_H 1 @@ -105,6 +105,18 @@ * a variable */ #undef interface + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f000001UL +#endif + +#ifndef ISC_PLATFORM_HAVEIN6PKTINFO +struct in6_pktinfo { + struct in6_addr ipi6_addr; /* src/dst IPv6 address */ + unsigned int ipi6_ifindex; /* send/recv interface index */ +}; +#endif + /* * Ensure type in_port_t is defined. */