924. [port] Extend support for pre-RFC2133 IPv6 implementation.
[RT #987]
+ 924. [port] Extend support for pre-RFC2133 IPv6 implementation.
+ [RT #987]
+
919. [bug] rndc would segfault when rndc.conf was missing a
closing brace. [RT #1461]
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.h,v 1.24.4.5 2001/06/26 21:55:52 tale Exp $ */
+/* $Id: net.h,v 1.24.4.6 2001/07/09 22:44:11 gson Exp $ */
#ifndef ISC_NET_H
#define ISC_NET_H 1
#define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */
#endif
+#ifdef ISC_PLATFORM_HAVEIPV6
/*
* Required for some pre RFC2133 implementations.
* IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
#endif
#endif
+#ifndef IN6_IS_ADDR_V4MAPPED
+#define IN6_IS_ADDR_V4MAPPED(x) \
+ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 10) == 0 && \
+ (x)->s6_addr[10] == 0xff && (x)->s6_addr[11] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_V4COMPAT
+#define IN6_IS_ADDR_V4COMPAT(x) \
+ (memcmp((x)->s6_addr, in6addr_any.s6_addr, 12) == 0 && \
+ ((x)->s6_addr[12] != 0 || (x)->s6_addr[13] != 0 || \
+ (x)->s6_addr[14] != 0 || \
+ ((x)->s6_addr[15] != 0 && (x)->s6_addr[15] != 1)))
+#endif
+
+#ifndef IN6_IS_ADDR_MULTICAST
+#define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
+#endif
+
+#ifndef IN6_IS_ADDR_LOOPBACK
+#define IN6_IS_ADDR_LOOPBACK(a) IN6_IS_ADDR_EQUAL(a, &in6addr_loopback)
+#endif
+#endif
+
#ifndef AF_INET6
#define AF_INET6 99
#endif
#endif
/*
- * Cope with a missing in6addr_any.
+ * Cope with a missing in6addr_any and in6addr_loopback.
*/
#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
extern const struct in6_addr isc_net_in6addrany;
#define in6addr_any isc_net_in6addrany
+extern const struct in6_addr isc_net_in6addrloop;
+#define in6addr_loopback isc_net_in6addrloop
#endif
/*
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.c,v 1.16.2.2 2001/01/17 17:30:50 gson Exp $ */
+/* $Id: net.c,v 1.16.2.3 2001/07/09 22:44:09 gson Exp $ */
#include <config.h>
#if defined(ISC_PLATFORM_HAVEIPV6) && defined(ISC_PLATFORM_NEEDIN6ADDRANY)
const struct in6_addr isc_net_in6addrany = IN6ADDR_ANY_INIT;
+const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT;
#endif
static isc_once_t once = ISC_ONCE_INIT;
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: net.h,v 1.8.4.2 2001/02/21 00:15:18 gson Exp $ */
+/* $Id: net.h,v 1.8.4.3 2001/07/09 22:44:12 gson Exp $ */
#ifndef LWRES_NET_H
#define LWRES_NET_H 1
#define in6_addr in_addr6 /* Required for pre RFC2133 implementations. */
#endif
+/*
+ * Required for some pre RFC2133 implementations.
+ * IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT were added in
+ * draft-ietf-ipngwg-bsd-api-04.txt or draft-ietf-ipngwg-bsd-api-05.txt.
+ * If 's6_addr' is defined then assume that there is a union and three
+ * levels otherwise assume two levels required.
+ */
+#ifndef IN6ADDR_ANY_INIT
+#ifdef s6_addr
+#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
+#else
+#define IN6ADDR_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }
+#endif
+#endif
+
+#ifndef IN6ADDR_LOOPBACK_INIT
+#ifdef s6_addr
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+#else
+#define IN6ADDR_LOOPBACK_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } }
+#endif
+#endif
+
#ifndef AF_INET6
#define AF_INET6 99
#endif