just to check my logic here - is my program supposed to remember the type of query it made so it can stuff the packet into the appropriate parsing function? I'm already set up to do that, I'm just trying to check my logic.
Yes, that's correct. You provide the qtype when sending the query, so it is assumed that you know what it is :) The high-level synchronous functions in s6dns-resolve.h are examples on how this works. For instance, s6dns_resolve_aaaa() calls the generic s6dns_resolve_r() routine, providing it with both the S6DNS_T_AAAA qtype and the s6dns_message_parse_answer_aaaa callback. For a generic asynchronous program using skadns, you'd likely store all your query info in a client-side structure indexed by the uint16_t query id that skadns_send() gives you. In this structure, you'd store either the qtype or directly the address of the parsing function you need. -- Laurent
