2 * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2002 Internet Software Consortium.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
28 * IPv6 definitions for systems which do not support IPv6.
34 * No anticipated impact.
40 * No anticipated impact.
47 #define in6_addr in_addr6
50 #ifndef IN6ADDR_ANY_INIT
51 #define IN6ADDR_ANY_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }}
53 #ifndef IN6ADDR_LOOPBACK_INIT
54 #define IN6ADDR_LOOPBACK_INIT {{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 }}
57 LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrany;
58 LIBISC_EXTERNAL_DATA extern const struct in6_addr isc_net_in6addrloop;
63 #ifndef IN6_IS_ADDR_UNSPECIFIED
64 #define IN6_IS_ADDR_UNSPECIFIED(a) (\
65 *((u_long *)((a)->s6_addr) ) == 0 && \
66 *((u_long *)((a)->s6_addr) + 1) == 0 && \
67 *((u_long *)((a)->s6_addr) + 2) == 0 && \
68 *((u_long *)((a)->s6_addr) + 3) == 0 \
75 #ifndef IN6_IS_ADDR_LOOPBACK
76 #define IN6_IS_ADDR_LOOPBACK(a) (\
77 *((u_long *)((a)->s6_addr) ) == 0 && \
78 *((u_long *)((a)->s6_addr) + 1) == 0 && \
79 *((u_long *)((a)->s6_addr) + 2) == 0 && \
80 *((u_long *)((a)->s6_addr) + 3) == htonl(1) \
87 #define IN6_IS_ADDR_V4COMPAT(a) (\
88 *((u_long *)((a)->s6_addr) ) == 0 && \
89 *((u_long *)((a)->s6_addr) + 1) == 0 && \
90 *((u_long *)((a)->s6_addr) + 2) == 0 && \
91 *((u_long *)((a)->s6_addr) + 3) != 0 && \
92 *((u_long *)((a)->s6_addr) + 3) != htonl(1) \
98 #define IN6_IS_ADDR_V4MAPPED(a) (\
99 *((u_long *)((a)->s6_addr) ) == 0 && \
100 *((u_long *)((a)->s6_addr) + 1) == 0 && \
101 *((u_long *)((a)->s6_addr) + 2) == htonl(0x0000ffff))
106 #define IN6_IS_ADDR_MULTICAST(a) \
107 ((a)->s6_addr[0] == 0xffU)
110 * Unicast link / site local.
112 #ifndef IN6_IS_ADDR_LINKLOCAL
113 #define IN6_IS_ADDR_LINKLOCAL(a) (\
114 ((a)->s6_addr[0] == 0xfe) && \
115 (((a)->s6_addr[1] & 0xc0) == 0x80))
118 #ifndef IN6_IS_ADDR_SITELOCAL
119 #define IN6_IS_ADDR_SITELOCAL(a) (\
120 ((a)->s6_addr[0] == 0xfe) && \
121 (((a)->s6_addr[1] & 0xc0) == 0xc0))
124 #endif /* ISC_IPV6_H */