From 665f12a744dea29a4e5437ecca918ed5d57b5744 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 12 Apr 2018 00:09:40 +0000 Subject: Add CAA record support --- src/libs6dns/s6dns_message_parse_answer_caa.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/libs6dns/s6dns_message_parse_answer_caa.c (limited to 'src/libs6dns/s6dns_message_parse_answer_caa.c') diff --git a/src/libs6dns/s6dns_message_parse_answer_caa.c b/src/libs6dns/s6dns_message_parse_answer_caa.c new file mode 100644 index 0000000..3b78b43 --- /dev/null +++ b/src/libs6dns/s6dns_message_parse_answer_caa.c @@ -0,0 +1,17 @@ +/* ISC license. */ + +#include +#include +#include + +int s6dns_message_parse_answer_caa (s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos, unsigned int section, void *stuff) +{ + if ((section == 2) && (rr->rtype == S6DNS_T_CAA)) + { + genalloc *data = stuff ; + s6dns_message_rr_caa_t caa ; + if (!s6dns_message_get_caa(&caa, packet, packetlen, &pos, rr->rdlength)) return 0 ; + if (!genalloc_append(s6dns_message_rr_caa_t, data, &caa)) return -1 ; + } + return 1 ; +} -- cgit v1.2.3