Puts the type code in control of how to actually send the query off. In
particular, this allows `virtual queries' which only actually spawn
child queries for interesting records, and then collate the results.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
/* Return the output resource-record element size; if this is null, then
* the rrsz member can be used.
*/
/* Return the output resource-record element size; if this is null, then
* the rrsz member can be used.
*/
+
+ void (*query_send)(adns_query qu, struct timeval now);
+ /* Send the query to nameservers, and hook it into the appropriate queue.
+ * Normal behaviour is to call adns__query_send, but this can be overridden
+ * for special effects.
+ */
} typeinfo;
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
} typeinfo;
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
qu->id= id;
qu->query_dglen= qu->vb.used;
memcpy(qu->query_dgram,qu->vb.buf,qu->vb.used);
qu->id= id;
qu->query_dglen= qu->vb.used;
memcpy(qu->query_dgram,qu->vb.buf,qu->vb.used);
-
- adns__query_send(qu,now);
+
+ typei->query_send(qu,now);
}
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
}
adns_status adns__ckl_hostname(adns_state ads, adns_queryflags flags,
* cs_*
* gsz_*
* postsort_*
* cs_*
* gsz_*
* postsort_*
#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer,/*printer*/...) \
{ adns_r_##code&adns_rrt_reprmask, rrt,fmt,TYPESZ_M(memb), mf_##memb, \
GLUE(cs_, CAR(__VA_ARGS__)),pa_##parser,di_##comparer, \
#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer,/*printer*/...) \
{ adns_r_##code&adns_rrt_reprmask, rrt,fmt,TYPESZ_M(memb), mf_##memb, \
GLUE(cs_, CAR(__VA_ARGS__)),pa_##parser,di_##comparer, \
- adns__ckl_hostname, 0, adns__getrrsz_default, CDR(__VA_ARGS__) }
+ adns__ckl_hostname, 0, adns__getrrsz_default, adns__query_send, \
+ CDR(__VA_ARGS__) }
#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer,/*printer*/...) \
{ adns_r_##code&adns_rrt_reprmask, rrt,fmt,TYPESZ_M(memb), mf_flat, \
GLUE(cs_, CAR(__VA_ARGS__)),pa_##parser,di_##comparer, \
#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer,/*printer*/...) \
{ adns_r_##code&adns_rrt_reprmask, rrt,fmt,TYPESZ_M(memb), mf_flat, \
GLUE(cs_, CAR(__VA_ARGS__)),pa_##parser,di_##comparer, \
- adns__ckl_hostname, 0, adns__getrrsz_default, CDR(__VA_ARGS__) }
+ adns__ckl_hostname, 0, adns__getrrsz_default, adns__query_send, \
+ CDR(__VA_ARGS__) }