chiark / gitweb /
Change how addr queries track which subqueries to make.
[adns] / src / internal.h
index bddb1979025d03d14b681e2c862fe194eaf8281b..f5f185ec1be1df90721b1c5ed6bef6ad72fc9390 100644 (file)
@@ -72,7 +72,6 @@ typedef unsigned char byte;
 #define DNS_INADDR_ARPA "in-addr", "arpa"
 #define DNS_IP6_ARPA "ip6", "arpa"
 
-#define ADDR_MAXRRTYPES 2
 #define MAX_ADDRSTRLEN 64
 
 #define STRINGIFY(x) REALLY_STRINGIFY(x)
@@ -96,8 +95,6 @@ typedef enum {
 } dns_rcode;
 
 enum {
-  adns__qf_senddirect = 0x00100000,/* don't call the `query_send' type hook */
-  adns__qf_nosend     = 0x00200000,/* don't send the query when submitting */
   adns__qf_addr_answer= 0x01000000,/* addr query received an answer */
   adns__qf_addr_cname = 0x02000000 /* addr subquery performed on cname */
 };
@@ -243,10 +240,19 @@ union maxalign {
 typedef struct {
   void *ext;
   void (*callback)(adns_query parent, adns_query child);
+
   union {
     struct afinfo_addr ptr_parent_addr;
     adns_rr_hostaddr *hostaddr;
-  } info;
+  } pinfo; /* state for use by parent's callback function */
+
+  union {
+    struct {
+      unsigned want, have;
+    } addr;
+  } tinfo; /* type-specific state for the query itself: zero-init if you
+           * don't know better. */
+
 } qcontext;
 
 struct adns__query {
@@ -301,13 +307,6 @@ struct adns__query {
   struct timeval timeout;
   time_t expires; /* Earliest expiry time of any record we used. */
 
-  union {
-    struct {
-      size_t nrrty, onrrty;
-      adns_rrtype rrty[ADDR_MAXRRTYPES];
-    } addr;
-  } t;                                 /* type-specific state */
-
   qcontext ctx;
 
   /* Possible states: