diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-04-12 00:09:40 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-04-12 00:09:40 +0000 |
commit | 665f12a744dea29a4e5437ecca918ed5d57b5744 (patch) | |
tree | 1e327fa9a76cda9c7d67a766f7ab289986f43284 /src/libs6dns/s6dns_message_parse_answer_caa.c | |
parent | 8cb636aa0671ac3c23009d8ca75245b2c08168c8 (diff) | |
download | s6-dns-665f12a744dea29a4e5437ecca918ed5d57b5744.tar.xz |
Add CAA record support
Diffstat (limited to 'src/libs6dns/s6dns_message_parse_answer_caa.c')
-rw-r--r-- | src/libs6dns/s6dns_message_parse_answer_caa.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 <skalibs/genalloc.h> +#include <s6-dns/s6dns-constants.h> +#include <s6-dns/s6dns-message.h> + +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 ; +} |