Re: [s6-dns/skadns] It's not documented anywhere, so I shall ask here - how does one go from the char const *skadns_packet of length skadns_packetlen to the actual answers one has received from the DNS?

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Mon, 03 Oct 2022 09:11:46 +0000

>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
Received on Mon Oct 03 2022 - 11:11:46 CEST

This archive was generated by hypermail 2.4.0 : Mon Oct 03 2022 - 11:12:17 CEST