* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.11 2022/06/25 09:40:20 florian Exp $ */
+/* $Id: rdataset.h,v 1.12 2022/06/25 10:20:30 florian Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
void (*clone)(dns_rdataset_t *source,
dns_rdataset_t *target);
unsigned int (*count)(dns_rdataset_t *rdataset);
- isc_result_t (*addnoqname)(dns_rdataset_t *rdataset,
- dns_name_t *name);
- isc_result_t (*getnoqname)(dns_rdataset_t *rdataset,
- dns_name_t *name,
- dns_rdataset_t *neg,
- dns_rdataset_t *negsig);
- isc_result_t (*addclosest)(dns_rdataset_t *rdataset,
- dns_name_t *name);
- isc_result_t (*getclosest)(dns_rdataset_t *rdataset,
- dns_name_t *name,
- dns_rdataset_t *neg,
- dns_rdataset_t *negsig);
- isc_result_t (*getadditional)(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t **zonep,
- dns_db_t **dbp,
- dns_dbversion_t **versionp,
- dns_dbnode_t **nodep,
- dns_name_t *fname,
- dns_message_t *msg,
- time_t now);
- isc_result_t (*setadditional)(dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype,
- dns_acache_t *acache,
- dns_zone_t *zone,
- dns_db_t *db,
- dns_dbversion_t *version,
- dns_dbnode_t *node,
- dns_name_t *fname);
- isc_result_t (*putadditional)(dns_acache_t *acache,
- dns_rdataset_t *rdataset,
- dns_rdatasetadditional_t type,
- dns_rdatatype_t qtype);
- void (*settrust)(dns_rdataset_t *rdataset,
- dns_trust_t trust);
- void (*expire)(dns_rdataset_t *rdataset);
- void (*clearprefetch)(dns_rdataset_t *rdataset);
} dns_rdatasetmethods_t;
/*%
* increment the counter.
*/
uint32_t count;
- /*
- * This RRSIG RRset should be re-generated around this time.
- * Only valid if DNS_RDATASETATTR_RESIGN is set in attributes.
- */
- time_t resign;
/*@{*/
/*%
* These are for use by the rdataset implementation, and MUST NOT
/*!
* \def DNS_RDATASETATTR_RENDERED
* Used by message.c to indicate that the rdataset was rendered.
- *
- * \def DNS_RDATASETATTR_TTLADJUSTED
- * Used by message.c to indicate that the rdataset's rdata had differing
- * TTL values, and the rdataset->ttl holds the smallest.
- *
- * \def DNS_RDATASETATTR_LOADORDER
- * Output the RRset in load order.
*/
#define DNS_RDATASETATTR_QUESTION 0x00000001
#define DNS_RDATASETATTR_RENDERED 0x00000002 /*%< Used by message.c */
-#define DNS_RDATASETATTR_ANSWERED 0x00000004 /*%< Used by server. */
-#define DNS_RDATASETATTR_CACHE 0x00000008 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWER 0x00000010 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_ANSWERSIG 0x00000020 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_EXTERNAL 0x00000040 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NCACHE 0x00000080 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_CHAINING 0x00000100 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_TTLADJUSTED 0x00000200 /*%< Used by message.c */
-#define DNS_RDATASETATTR_CHASE 0x00001000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_NXDOMAIN 0x00002000
-#define DNS_RDATASETATTR_NOQNAME 0x00004000
-#define DNS_RDATASETATTR_CHECKNAMES 0x00008000 /*%< Used by resolver. */
-#define DNS_RDATASETATTR_LOADORDER 0x00020000
-#define DNS_RDATASETATTR_RESIGN 0x00040000
-#define DNS_RDATASETATTR_CLOSEST 0x00080000
-#define DNS_RDATASETATTR_OPTOUT 0x00100000 /*%< OPTOUT proof */
-#define DNS_RDATASETATTR_PREFETCH 0x00400000
-
-/*%
- * _OMITDNSSEC:
- * Omit DNSSEC records when rendering ncache records.
- */
-#define DNS_RDATASETTOWIRE_OMITDNSSEC 0x0001
void
dns_rdataset_init(dns_rdataset_t *rdataset);
dns_rdatatype_t type;
unsigned int type_start;
- rdataset->attributes |= DNS_RDATASETATTR_LOADORDER;
result = dns_rdataset_first(rdataset);
current_ttl = ctx->current_ttl;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: message.c,v 1.19 2022/06/25 09:40:20 florian Exp $ */
+/* $Id: message.c,v 1.20 2022/06/25 10:20:29 florian Exp $ */
/*! \file */
#define VALID_PSEUDOSECTION(s) (((s) >= DNS_PSEUDOSECTION_ANY) \
&& ((s) < DNS_PSEUDOSECTION_MAX))
-#define OPTOUT(x) (((x)->attributes & DNS_RDATASETATTR_OPTOUT) != 0)
-
/*%
* This is the size of each individual scratchpad buffer, and the numbers
* of various block allocations used within the server.
* currently treat them the as if they were authoritative and
* minimize them.
*/
- if (ttl != rdataset->ttl) {
- rdataset->attributes |= DNS_RDATASETATTR_TTLADJUSTED;
- if (ttl < rdataset->ttl)
- rdataset->ttl = ttl;
- }
+ if (ttl < rdataset->ttl)
+ rdataset->ttl = ttl;
/* Append this rdata to the rdataset. */
dns_rdatalist_fromrdataset(rdataset, &rdatalist);
(sectionid == DNS_SECTION_ANSWER ||
sectionid == DNS_SECTION_AUTHORITY))
msg->flags &= ~DNS_MESSAGEFLAG_AD;
- if (OPTOUT(rdataset))
- msg->flags &= ~DNS_MESSAGEFLAG_AD;
rdataset->attributes |=
DNS_RDATASETATTR_RENDERED;
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist.c,v 1.2 2020/02/18 18:11:27 florian Exp $ */
+/* $Id: rdatalist.c,v 1.3 2022/06/25 10:20:29 florian Exp $ */
/*! \file */
isc__rdatalist_current,
isc__rdatalist_clone,
isc__rdatalist_count,
- isc__rdatalist_addnoqname,
- isc__rdatalist_getnoqname,
- isc__rdatalist_addclosest,
- isc__rdatalist_getclosest,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
};
void
return (count);
}
-
-isc_result_t
-isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name) {
- dns_rdataset_t *neg = NULL;
- dns_rdataset_t *negsig = NULL;
- dns_rdataset_t *rdset;
- dns_ttl_t ttl;
-
- REQUIRE(rdataset != NULL);
-
- for (rdset = ISC_LIST_HEAD(name->list);
- rdset != NULL;
- rdset = ISC_LIST_NEXT(rdset, link))
- {
- if (rdset->rdclass != rdataset->rdclass)
- continue;
- if (rdset->type == dns_rdatatype_nsec ||
- rdset->type == dns_rdatatype_nsec3)
- neg = rdset;
- }
- if (neg == NULL)
- return (ISC_R_NOTFOUND);
-
- for (rdset = ISC_LIST_HEAD(name->list);
- rdset != NULL;
- rdset = ISC_LIST_NEXT(rdset, link))
- {
- if (rdset->type == dns_rdatatype_rrsig &&
- rdset->covers == neg->type)
- negsig = rdset;
- }
-
- if (negsig == NULL)
- return (ISC_R_NOTFOUND);
- /*
- * Minimise ttl.
- */
- ttl = rdataset->ttl;
- if (neg->ttl < ttl)
- ttl = neg->ttl;
- if (negsig->ttl < ttl)
- ttl = negsig->ttl;
- rdataset->ttl = neg->ttl = negsig->ttl = ttl;
- rdataset->attributes |= DNS_RDATASETATTR_NOQNAME;
- rdataset->private6 = name;
- return (ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc__rdatalist_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *neg, dns_rdataset_t *negsig)
-{
- dns_rdataclass_t rdclass = rdataset->rdclass;
- dns_rdataset_t *tneg = NULL;
- dns_rdataset_t *tnegsig = NULL;
- dns_name_t *noqname = rdataset->private6;
-
- REQUIRE(rdataset != NULL);
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_NOQNAME) != 0);
-
- (void)dns_name_dynamic(noqname); /* Sanity Check. */
-
- for (rdataset = ISC_LIST_HEAD(noqname->list);
- rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- {
- if (rdataset->rdclass != rdclass)
- continue;
- if (rdataset->type == dns_rdatatype_nsec ||
- rdataset->type == dns_rdatatype_nsec3)
- tneg = rdataset;
- }
- if (tneg == NULL)
- return (ISC_R_NOTFOUND);
-
- for (rdataset = ISC_LIST_HEAD(noqname->list);
- rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- {
- if (rdataset->type == dns_rdatatype_rrsig &&
- rdataset->covers == tneg->type)
- tnegsig = rdataset;
- }
- if (tnegsig == NULL)
- return (ISC_R_NOTFOUND);
-
- dns_name_clone(noqname, name);
- dns_rdataset_clone(tneg, neg);
- dns_rdataset_clone(tnegsig, negsig);
- return (ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc__rdatalist_addclosest(dns_rdataset_t *rdataset, dns_name_t *name) {
- dns_rdataset_t *neg = NULL;
- dns_rdataset_t *negsig = NULL;
- dns_rdataset_t *rdset;
- dns_ttl_t ttl;
-
- REQUIRE(rdataset != NULL);
-
- for (rdset = ISC_LIST_HEAD(name->list);
- rdset != NULL;
- rdset = ISC_LIST_NEXT(rdset, link))
- {
- if (rdset->rdclass != rdataset->rdclass)
- continue;
- if (rdset->type == dns_rdatatype_nsec ||
- rdset->type == dns_rdatatype_nsec3)
- neg = rdset;
- }
- if (neg == NULL)
- return (ISC_R_NOTFOUND);
-
- for (rdset = ISC_LIST_HEAD(name->list);
- rdset != NULL;
- rdset = ISC_LIST_NEXT(rdset, link))
- {
- if (rdset->type == dns_rdatatype_rrsig &&
- rdset->covers == neg->type)
- negsig = rdset;
- }
-
- if (negsig == NULL)
- return (ISC_R_NOTFOUND);
- /*
- * Minimise ttl.
- */
- ttl = rdataset->ttl;
- if (neg->ttl < ttl)
- ttl = neg->ttl;
- if (negsig->ttl < ttl)
- ttl = negsig->ttl;
- rdataset->ttl = neg->ttl = negsig->ttl = ttl;
- rdataset->attributes |= DNS_RDATASETATTR_CLOSEST;
- rdataset->private7 = name;
- return (ISC_R_SUCCESS);
-}
-
-isc_result_t
-isc__rdatalist_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *neg, dns_rdataset_t *negsig)
-{
- dns_rdataclass_t rdclass = rdataset->rdclass;
- dns_rdataset_t *tneg = NULL;
- dns_rdataset_t *tnegsig = NULL;
- dns_name_t *closest = rdataset->private7;
-
- REQUIRE(rdataset != NULL);
- REQUIRE((rdataset->attributes & DNS_RDATASETATTR_CLOSEST) != 0);
-
- (void)dns_name_dynamic(closest); /* Sanity Check. */
-
- for (rdataset = ISC_LIST_HEAD(closest->list);
- rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- {
- if (rdataset->rdclass != rdclass)
- continue;
- if (rdataset->type == dns_rdatatype_nsec ||
- rdataset->type == dns_rdatatype_nsec3)
- tneg = rdataset;
- }
- if (tneg == NULL)
- return (ISC_R_NOTFOUND);
-
- for (rdataset = ISC_LIST_HEAD(closest->list);
- rdataset != NULL;
- rdataset = ISC_LIST_NEXT(rdataset, link))
- {
- if (rdataset->type == dns_rdatatype_rrsig &&
- rdataset->covers == tneg->type)
- tnegsig = rdataset;
- }
- if (tnegsig == NULL)
- return (ISC_R_NOTFOUND);
-
- dns_name_clone(closest, name);
- dns_rdataset_clone(tneg, neg);
- dns_rdataset_clone(tnegsig, negsig);
- return (ISC_R_SUCCESS);
-}
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist_p.h,v 1.2 2020/02/13 13:53:00 jsg Exp $ */
+/* $Id: rdatalist_p.h,v 1.3 2022/06/25 10:20:29 florian Exp $ */
#ifndef DNS_RDATALIST_P_H
#define DNS_RDATALIST_P_H
unsigned int
isc__rdatalist_count(dns_rdataset_t *rdataset);
-isc_result_t
-isc__rdatalist_addnoqname(dns_rdataset_t *rdataset, dns_name_t *name);
-
-isc_result_t
-isc__rdatalist_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *neg, dns_rdataset_t *negsig);
-
-isc_result_t
-isc__rdatalist_addclosest(dns_rdataset_t *rdataset, dns_name_t *name);
-
-isc_result_t
-isc__rdatalist_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
- dns_rdataset_t *neg, dns_rdataset_t *negsig);
-
#endif /* DNS_RDATALIST_P_H */
rdataset->private5 = NULL;
rdataset->private6 = NULL;
rdataset->private7 = NULL;
- rdataset->resign = 0;
}
void
question_current,
question_clone,
question_count,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
};
void