Lines Matching defs:dns64
9 /* $Id: dns64.c,v 1.8 2011/03/12 04:59:47 tbox Exp $ */
20 #include <dns/dns64.h>
54 dns_dns64_t *dns64;
74 dns64 = isc_mem_get(mctx, sizeof(dns_dns64_t));
75 if (dns64 == NULL)
77 memset(dns64->bits, 0, sizeof(dns64->bits));
78 memmove(dns64->bits, prefix->type.in6.s6_addr, prefixlen / 8);
80 memmove(dns64->bits + nbytes, suffix->type.in6.s6_addr + nbytes,
82 dns64->clients = NULL;
84 dns_acl_attach(clients, &dns64->clients);
85 dns64->mapped = NULL;
87 dns_acl_attach(mapped, &dns64->mapped);
88 dns64->excluded = NULL;
90 dns_acl_attach(excluded, &dns64->excluded);
91 dns64->prefixlen = prefixlen;
92 dns64->flags = flags;
93 ISC_LINK_INIT(dns64, link);
94 dns64->mctx = NULL;
95 isc_mem_attach(mctx, &dns64->mctx);
96 *dns64p = dns64;
102 dns_dns64_t *dns64;
106 dns64 = *dns64p;
109 REQUIRE(!ISC_LINK_LINKED(dns64, link));
111 if (dns64->clients != NULL)
112 dns_acl_detach(&dns64->clients);
113 if (dns64->mapped != NULL)
114 dns_acl_detach(&dns64->mapped);
115 if (dns64->excluded != NULL)
116 dns_acl_detach(&dns64->excluded);
117 isc_mem_putanddetach(&dns64->mctx, dns64, sizeof(*dns64));
121 dns_dns64_aaaafroma(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
129 if ((dns64->flags & DNS_DNS64_RECURSIVE_ONLY) != 0 &&
133 if ((dns64->flags & DNS_DNS64_BREAK_DNSSEC) == 0 &&
137 if (dns64->clients != NULL) {
138 result = dns_acl_match(reqaddr, reqsigner, dns64->clients, env,
146 if (dns64->mapped != NULL) {
152 result = dns_acl_match(&netaddr, NULL, dns64->mapped, env,
160 nbytes = dns64->prefixlen / 8;
163 memmove(aaaa, dns64->bits, nbytes);
175 memmove(aaaa + nbytes, dns64->bits + nbytes, 16 - nbytes);
180 dns_dns64_next(dns_dns64_t *dns64) {
181 dns64 = ISC_LIST_NEXT(dns64, link);
182 return (dns64);
186 dns_dns64_append(dns_dns64list_t *list, dns_dns64_t *dns64) {
187 ISC_LIST_APPEND(*list, dns64, link);
191 dns_dns64_unlink(dns_dns64list_t *list, dns_dns64_t *dns64) {
192 ISC_LIST_UNLINK(*list, dns64, link);
196 dns_dns64_aaaaok(const dns_dns64_t *dns64, const isc_netaddr_t *reqaddr,
215 for (;dns64 != NULL; dns64 = ISC_LIST_NEXT(dns64, link)) {
216 if ((dns64->flags & DNS_DNS64_RECURSIVE_ONLY) != 0 &&
220 if ((dns64->flags & DNS_DNS64_BREAK_DNSSEC) == 0 &&
224 * Work out if this dns64 structure applies to this client.
226 if (dns64->clients != NULL) {
228 dns64->clients, env,
246 if (dns64->excluded == NULL) {
267 dns64->excluded,