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/include | |
parent | 8cb636aa0671ac3c23009d8ca75245b2c08168c8 (diff) | |
download | s6-dns-665f12a744dea29a4e5437ecca918ed5d57b5744.tar.xz |
Add CAA record support
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/s6-dns/s6dns-analyze.h | 1 | ||||
-rw-r--r-- | src/include/s6-dns/s6dns-constants.h | 1 | ||||
-rw-r--r-- | src/include/s6-dns/s6dns-fmt.h | 3 | ||||
-rw-r--r-- | src/include/s6-dns/s6dns-message.h | 11 | ||||
-rw-r--r-- | src/include/s6-dns/s6dns-resolve.h | 13 |
5 files changed, 25 insertions, 4 deletions
diff --git a/src/include/s6-dns/s6dns-analyze.h b/src/include/s6-dns/s6dns-analyze.h index 35f34cf..ed4fb17 100644 --- a/src/include/s6-dns/s6dns-analyze.h +++ b/src/include/s6-dns/s6dns-analyze.h @@ -28,6 +28,7 @@ extern s6dns_analyze_record_func_t s6dns_analyze_record_hinfo ; extern s6dns_analyze_record_func_t s6dns_analyze_record_soa ; extern s6dns_analyze_record_func_t s6dns_analyze_record_mx ; extern s6dns_analyze_record_func_t s6dns_analyze_record_srv ; +extern s6dns_analyze_record_func_t s6dns_analyze_record_caa ; extern s6dns_analyze_record_func_t s6dns_analyze_record_domain ; extern s6dns_analyze_record_func_t s6dns_analyze_record_strings ; extern s6dns_analyze_record_func_t s6dns_analyze_record_unknown ; diff --git a/src/include/s6-dns/s6dns-constants.h b/src/include/s6-dns/s6dns-constants.h index ad47dc1..38900d1 100644 --- a/src/include/s6-dns/s6dns-constants.h +++ b/src/include/s6-dns/s6dns-constants.h @@ -25,6 +25,7 @@ #define S6DNS_T_SRV 33U #define S6DNS_T_AXFR 252U #define S6DNS_T_ANY 255U +#define S6DNS_T_CAA 257U #define S6DNS_O_RECURSIVE 0x0001U #define S6DNS_O_STRICT 0x0002U diff --git a/src/include/s6-dns/s6dns-fmt.h b/src/include/s6-dns/s6dns-fmt.h index 4be81ec..d7f00bd 100644 --- a/src/include/s6-dns/s6dns-fmt.h +++ b/src/include/s6-dns/s6dns-fmt.h @@ -26,4 +26,7 @@ extern size_t s6dns_fmt_soa (char *, size_t, s6dns_message_rr_soa_t const *) ; #define S6DNS_FMT_SRV (S6DNS_FMT_DOMAIN + 3 * UINT16_FMT) extern size_t s6dns_fmt_srv (char *, size_t, s6dns_message_rr_srv_t const *) ; +#define S6DNS_FMT_CAA 517 +extern size_t s6dns_fmt_caa (char *, size_t, s6dns_message_rr_caa_t const *) ; + #endif diff --git a/src/include/s6-dns/s6dns-message.h b/src/include/s6-dns/s6dns-message.h index cc3e68e..e57a992 100644 --- a/src/include/s6-dns/s6dns-message.h +++ b/src/include/s6-dns/s6dns-message.h @@ -109,6 +109,16 @@ struct s6dns_message_rr_srv_s extern int s6dns_message_get_srv (s6dns_message_rr_srv_t *, char const *, unsigned int, unsigned int *) ; +typedef struct s6dns_message_rr_caa_s s6dns_message_rr_caa_t, *s6dns_message_rr_caa_t_ref ; +struct s6dns_message_rr_caa_s +{ + uint8_t flags ; + char tag[256] ; + char value[256] ; +} ; + +extern int s6dns_message_get_caa (s6dns_message_rr_caa_t *, char const *, unsigned int, unsigned int *, uint16_t) ; + /* The callback function type: how to parse RRs */ @@ -157,6 +167,7 @@ extern s6dns_message_rr_func_t s6dns_message_parse_answer_mx ; extern s6dns_message_rr_func_t s6dns_message_parse_answer_hinfo ; extern s6dns_message_rr_func_t s6dns_message_parse_answer_soa ; extern s6dns_message_rr_func_t s6dns_message_parse_answer_srv ; +extern s6dns_message_rr_func_t s6dns_message_parse_answer_caa ; /* The actual parsing function */ diff --git a/src/include/s6-dns/s6dns-resolve.h b/src/include/s6-dns/s6dns-resolve.h index fe1425a..a571103 100644 --- a/src/include/s6-dns/s6dns-resolve.h +++ b/src/include/s6-dns/s6dns-resolve.h @@ -183,15 +183,20 @@ extern int s6dns_resolve_name6_r (genalloc *, char const *, s6dns_engine_t *, s6 #define s6dns_resolve_hinfo_r(hinfos, name, len, qualif, dt, rci, dbh, deadline, stamp) s6dns_resolve_r(name, len, S6DNS_T_HINFO, &s6dns_message_parse_answer_hinfo, (hinfos), qualif, dt, rci, dbh, deadline, stamp) #define s6dns_resolve_hinfo_r_g(hinfos, name, len, qualif, dt, rci, dbh, deadline) s6dns_resolve_hinfo_r(hinfos, name, len, qualif, dt, rci, dbh, (deadline), &STAMP) +#define s6dns_resolve_soa(soas, name, len, qualif, deadline, stamp) s6dns_resolve_soa_r(soas, name, len, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) +#define s6dns_resolve_soa_g(soas, name, len, qualif, deadline) s6dns_resolve_soa(soas, name, len, qualif, (deadline), &STAMP) +#define s6dns_resolve_soa_r(soas, name, len, qualif, dt, rci, dbh, deadline, stamp) s6dns_resolve_r(name, len, S6DNS_T_SOA, &s6dns_message_parse_answer_soa, (soas), qualif, dt, rci, dbh, deadline, stamp) +#define s6dns_resolve_soa_r_g(soas, name, len, qualif, dt, rci, dbh, deadline) s6dns_resolve_soa_r(soas, name, len, qualif, dt, rci, dbh, (deadline), &STAMP) + #define s6dns_resolve_srv(srvs, name, len, qualif, deadline, stamp) s6dns_resolve_srv_r(srvs, name, len, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_srv_g(srvs, name, len, qualif, deadline) s6dns_resolve_srv(srvs, name, len, qualif, (deadline), &STAMP) #define s6dns_resolve_srv_r(srvs, name, len, qualif, dt, rci, dbh, deadline, stamp) s6dns_resolve_r(name, len, S6DNS_T_SRV, &s6dns_message_parse_answer_srv, (srvs), qualif, dt, rci, dbh, deadline, stamp) #define s6dns_resolve_srv_r_g(srvs, name, len, qualif, dt, rci, dbh, deadline) s6dns_resolve_srv_r(srvs, name, len, qualif, dt, rci, dbh, (deadline), &STAMP) -#define s6dns_resolve_soa(soas, name, len, qualif, deadline, stamp) s6dns_resolve_soa_r(soas, name, len, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) -#define s6dns_resolve_soa_g(soas, name, len, qualif, deadline) s6dns_resolve_soa(soas, name, len, qualif, (deadline), &STAMP) -#define s6dns_resolve_soa_r(soas, name, len, qualif, dt, rci, dbh, deadline, stamp) s6dns_resolve_r(name, len, S6DNS_T_SOA, &s6dns_message_parse_answer_soa, (soas), qualif, dt, rci, dbh, deadline, stamp) -#define s6dns_resolve_soa_r_g(soas, name, len, qualif, dt, rci, dbh, deadline) s6dns_resolve_soa_r(soas, name, len, qualif, dt, rci, dbh, (deadline), &STAMP) +#define s6dns_resolve_caa(caas, name, len, qualif, deadline, stamp) s6dns_resolve_caa_r(caas, name, len, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) +#define s6dns_resolve_caa_g(caas, name, len, qualif, deadline) s6dns_resolve_caa(caas, name, len, qualif, (deadline), &STAMP) +#define s6dns_resolve_caa_r(caas, name, len, qualif, dt, rci, dbh, deadline, stamp) s6dns_resolve_r(name, len, S6DNS_T_CAA, &s6dns_message_parse_answer_caa, (caas), qualif, dt, rci, dbh, deadline, stamp) +#define s6dns_resolve_caa_r_g(caas, name, len, qualif, dt, rci, dbh, deadline) s6dns_resolve_caa_r(caas, name, len, qualif, dt, rci, dbh, (deadline), &STAMP) /* Internals for the high-level functions. */ |