X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/adns/blobdiff_plain/bc01473efdcf59eb593c7c7019d196c30b305228..cd1bde2f17b3a8459ce356c7567b6b9fb2ca9f2a:/src/internal.h?ds=inline diff --git a/src/internal.h b/src/internal.h index 33086f6..672e3a9 100644 --- a/src/internal.h +++ b/src/internal.h @@ -50,6 +50,8 @@ typedef unsigned char byte; #define DNS_HDRSIZE 12 #define DNS_CLASS_IN 1 +#define DNS_INADDR_ARPA "in-addr", "arpa" + typedef enum { rcode_noerror, rcode_formaterror, @@ -75,16 +77,6 @@ typedef struct { byte *buf; } vbuf; -typedef union { - void *ext; - struct { - void (*callback)(adns_query parent, adns_query child); - union { - adns_rr_hostaddr *hostaddr; - } info; - } intern; -} qcontext; - typedef struct { adns_state ads; adns_query qu; @@ -142,6 +134,15 @@ union maxalign { union maxalign *up; } data; +typedef struct { + void *ext; + void (*callback)(adns_query parent, adns_query child); + union { + adns_rr_addr ptr_parent_addr; + adns_rr_hostaddr *hostaddr; + } info; +} qcontext; + struct adns__query { adns_state ads; enum { query_udp, query_tcpwait, query_tcpsent, query_child, query_done } state; @@ -179,7 +180,8 @@ struct adns__query { int udpnextserver; unsigned long udpsent, tcpfailed; /* bitmap indexed by server */ struct timeval timeout; - qcontext context; + + qcontext ctx; /* Possible states: *