*
*/
+bool
+dns_rdatatype_followadditional(dns_rdatatype_t type);
+/*%<
+ * Return true if adding a record of type 'type' to the ADDITIONAL section
+ * of a message can itself trigger the addition of still more data to the
+ * additional section.
+ *
+ * (For example: adding SRV to the ADDITIONAL section may trigger
+ * the addition of address records associated with that SRV.)
+ *
+ * Requires:
+ * \li 'type' is a valid rdata type.
+ *
+ */
+
unsigned int
dns_rdatatype_attributes(dns_rdatatype_t rdtype);
/*%<
#define DNS_RDATATYPEATTR_ATPARENT 0x00000200U
/*% Can exist along side a CNAME */
#define DNS_RDATATYPEATTR_ATCNAME 0x00000400U
+/*% Follow additional */
+#define DNS_RDATATYPEATTR_FOLLOWADDITIONAL 0x00000800U
dns_rdatatype_t
dns_rdata_covers(dns_rdata_t *rdata);
return (false);
}
+bool
+dns_rdatatype_followadditional(dns_rdatatype_t type) {
+ if ((dns_rdatatype_attributes(type) &
+ DNS_RDATATYPEATTR_FOLLOWADDITIONAL) != 0) {
+ return (true);
+ }
+ return (false);
+}
+
bool
dns_rdataclass_ismeta(dns_rdataclass_t rdclass) {
if (rdclass == dns_rdataclass_reserved0 ||
#ifndef RDATA_IN_1_SRV_33_C
#define RDATA_IN_1_SRV_33_C
-#define RRTYPE_SRV_ATTRIBUTES (0)
+#define RRTYPE_SRV_ATTRIBUTES (DNS_RDATATYPEATTR_FOLLOWADDITIONAL)
static inline isc_result_t
fromtext_in_srv(ARGS_FROMTEXT) {
fname = NULL;
/*
- * In a few cases, we want to add additional data for additional
- * data. It's simpler to just deal with special cases here than
- * to try to create a general purpose mechanism and allow the
- * rdata implementations to do it themselves.
- *
- * This involves recursion, but the depth is limited. The
- * most complex case is adding a SRV rdataset, which involves
- * recursing to add address records, which in turn can cause
- * recursion to add KEYs.
+ * In some cases, a record that has been added as additional
+ * data may *also* trigger the addition of additional data.
+ * This cannot go more than MAX_RESTARTS levels deep.
*/
- if (type == dns_rdatatype_srv && trdataset != NULL) {
- /*
- * If we're adding SRV records to the additional data
- * section, it's helpful if we add the SRV additional data
- * as well.
- */
+ if (trdataset != NULL && dns_rdatatype_followadditional(type)) {
eresult = dns_rdataset_additionaldata(
trdataset, query_additional_cb, qctx);
}