+1336. [func] Nibble lookups under IP6.ARPA are now supported by
+ dns_byaddr_create(). dns_byaddr_createptrname() is
+ deprecated, use dns_byaddr_createptrname2() instead.
+
1335. [bug] When performing a nonexistence proof, the validator
should discard parent NXTs from higher in the DNS.
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: byaddr.c,v 1.30 2001/11/12 19:05:12 gson Exp $ */
+/* $Id: byaddr.c,v 1.31 2002/07/24 06:42:32 marka Exp $ */
#include <config.h>
isc_result_t
dns_byaddr_createptrname(isc_netaddr_t *address, isc_boolean_t nibble,
dns_name_t *name)
+{
+ unsigned int options;
+
+ options = nibble ? (DNS_BYADDROPT_IPV6NIBBLE|DNS_BYADDROPT_IPV6INT) : 0;
+ return (dns_byaddr_createptrname2(address, options, name));
+}
+
+isc_result_t
+dns_byaddr_createptrname2(isc_netaddr_t *address, unsigned int options,
+ dns_name_t *name)
{
char textname[128];
unsigned char *bytes;
(bytes[1] & 0xff),
(bytes[0] & 0xff));
} else if (address->family == AF_INET6) {
- if (nibble) {
+ if ((options & DNS_BYADDROPT_IPV6NIBBLE) != 0) {
cp = textname;
for (i = 15; i >= 0; i--) {
*cp++ = hex_digits[bytes[i] & 0x0f];
*cp++ = hex_digits[(bytes[i] >> 4) & 0x0f];
*cp++ = '.';
}
- strcpy(cp, "ip6.int.");
+ if ((options & DNS_BYADDROPT_IPV6INT) != 0)
+ strcpy(cp, "ip6.int.");
+ else
+ strcpy(cp, "ip6.arpa.");
} else {
cp = textname;
*cp++ = '\\';
dns_fixedname_init(&byaddr->name);
- result = dns_byaddr_createptrname(address,
- ISC_TF(byaddr->options & DNS_BYADDROPT_IPV6NIBBLE),
- dns_fixedname_name(&byaddr->name));
+ result = dns_byaddr_createptrname2(address, options,
+ dns_fixedname_name(&byaddr->name));
if (result != ISC_R_SUCCESS)
goto cleanup_lock;
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: byaddr.h,v 1.12 2001/01/09 21:52:18 bwelling Exp $ */
+/* $Id: byaddr.h,v 1.13 2002/07/24 06:42:32 marka Exp $ */
#ifndef DNS_BYADDR_H
#define DNS_BYADDR_H 1
} dns_byaddrevent_t;
#define DNS_BYADDROPT_IPV6NIBBLE 0x0001
+#define DNS_BYADDROPT_IPV6INT 0x0002
isc_result_t
dns_byaddr_create(isc_mem_t *mctx, isc_netaddr_t *address, dns_view_t *view,
*
* The 'nibble' format for that address is
*
- * 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.int.
+ * 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa.
*
* The 'bitstring' format will be used unless the DNS_BYADDROPT_IPV6NIBBLE
* option has been set.
+ * DNS_BYADDROPT_IPV6INT can be combined with DNS_BYADDROPT_IPV6NIBBLE
+ * to get nibble lookups under ip6.int.
*
* Requires:
*
isc_result_t
dns_byaddr_createptrname(isc_netaddr_t *address, isc_boolean_t nibble,
dns_name_t *name);
+
+isc_result_t
+dns_byaddr_createptrname2(isc_netaddr_t *address, unsigned int options,
+ dns_name_t *name);
/*
* Creates a name that would be used in a PTR query for this address. The
* nibble flag indicates that the 'nibble' format is to be used if an IPv6
- * address is provided, instead of the 'bitstring' format.
+ * address is provided, instead of the 'bitstring' format. 'options' are
+ * the same as for dns_byaddr_create().
*
* Requires:
*