+static adns_status addr_submit(adns_query parent, adns_query *query_r,
+ vbuf *qumsg_vb, int id,
+ const adns_rrtype *rrty, size_t nrrty,
+ adns_queryflags flags, struct timeval now,
+ const qcontext *ctx)
+{
+ /* This is effectively a substitute for adns__internal_submit, intended for
+ * the case where the caller (possibly) only wants a subset of the
+ * available record types. The memory management and callback rules are
+ * the same as for adns__internal_submit.
+ *
+ * Some differences: the query is linked onto the parent's children list
+ * before exit (though the parent's state is not changed, and it is not
+ * linked into the childw list queue).
+ */
+
+ adns_state ads = parent->ads;
+ adns_status err;
+ adns_rrtype type =
+ (adns_r_addr & adns_rrt_reprmask) |
+ (parent->answer->type & ~adns_rrt_reprmask);
+
+ err = adns__internal_submit(ads, query_r, adns__findtype(adns_r_addr),
+ type, qumsg_vb, id, flags | adns__qf_nosend,
+ now, ctx);
+ if (err) return err;
+
+ (*query_r)->parent = parent;
+ LIST_LINK_TAIL_PART(parent->children, *query_r, siblings.);
+ addr_subqueries(*query_r, now, rrty, nrrty);
+ return adns_s_ok;
+}
+
+static void qs_addr(adns_query qu, struct timeval now)
+{
+ adns_rrtype rrty[ADDR_MAXRRTYPES];
+ size_t nrrty;
+
+ addr_rrtypes(qu->ads, qu->answer->type, qu->flags, rrty, &nrrty);
+ addr_subqueries(qu, now, rrty, nrrty);
+}
+