a6.c revision 15a44745412679c30a6d022733925af70a38b715
/*
* Copyright (C) 1999, 2000 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: a6.c,v 1.15 2000/07/27 09:45:48 tale Exp $ */
#include <config.h>
#include <dns/rdataset.h>
#define MAX_CHAINS 8
#define MAX_DEPTH 16
static inline void
}
static isc_result_t
unsigned int oprefixlen)
{
isc_region_t r;
depth++;
while (result == ISC_R_SUCCESS) {
dns_rdata_toregion(&rdata, &r);
if (prefixlen > oprefixlen) {
/*
* Trying to go to a longer prefix is illegal.
*/
goto next_a6;
}
if (prefixlen < 128) {
ISC_TRUE);
oprefixlen - prefixlen);
}
if (prefixlen != 0) {
dns_name_fromregion(&name, &r);
if (result == ISC_R_SUCCESS) {
/*
* We've found a new A6 rrset.
*/
&name,
&child,
&childsig);
/*
* Keep following the chain.
*/
if (result != ISC_R_SUCCESS)
break;
} else if (result == ISC_R_NOTFOUND &&
/*
* We can't follow this chain, because
* we don't know the next link.
*
* We update the 'depth' and
* 'prefixlen' values so that the
* missing function can make a copy
* of the a6context and resume
* processing after it has found the
* missing a6 context.
*/
} else {
/*
* Either something went wrong, or
* we got a negative cache response.
* In either case, we can't follow
* this chain further, and we don't
* want to call the 'missing'
* function.
*
* Note that we currently require that
* the target of an A6 record is
* a canonical domain name. If the
* find routine returns DNS_R_CNAME or
* DNS_R_DNAME, we do NOT follow the
* chain.
*
* We do want to clean up...
*/
}
}
} else {
/*
* We have a complete chain.
*/
}
if (result == ISC_R_SUCCESS) {
return (ISC_R_QUOTA);
}
}
if (result != ISC_R_NOMORE)
return (result);
return (ISC_R_SUCCESS);
}
void
{
a6ctx->expiration = 0;
}
void
a6ctx->expiration = 0;
}
void
}
void
}
{
if (now == 0)
if (result == ISC_R_QUOTA)
return (result);
}