From f01c8453d56f810031ded37ed9e37e71e7474089 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 12 Apr 2018 00:32:03 +0000 Subject: Document the CAA functions --- doc/libs6dns/s6dns-fmt.html | 9 +++++++++ doc/libs6dns/s6dns-message.html | 16 ++++++++++++++++ doc/libs6dns/s6dns-resolve.html | 10 ++++++++++ 3 files changed, 35 insertions(+) diff --git a/doc/libs6dns/s6dns-fmt.html b/doc/libs6dns/s6dns-fmt.html index 9534c76..247257a 100644 --- a/doc/libs6dns/s6dns-fmt.html +++ b/doc/libs6dns/s6dns-fmt.html @@ -89,5 +89,14 @@ the output would be more than max bytes, 0 ENAMETOOLONG is returned. To avoid that, S6DNS_FMT_SRV is a suitable number of bytes to preallocate s.

+

+ size_t s6dns_fmt_caa (char *s, size_t max, s6dns_message_rr_caa_t const *p)
+Writes into string s the CAA contained in *p: flags, then tag, +then value, separated by spaces. +Returns the number of bytes written, or 0 in case of failure. If +the output would be more than max bytes, 0 ENAMETOOLONG is returned. +To avoid that, S6DNS_FMT_CAA is a suitable number of bytes to preallocate s. +

+ diff --git a/doc/libs6dns/s6dns-message.html b/doc/libs6dns/s6dns-message.html index 675dac5..5eb0413 100644 --- a/doc/libs6dns/s6dns-message.html +++ b/doc/libs6dns/s6dns-message.html @@ -79,6 +79,7 @@ also provided. The list includes:
  • s6dns_message_rr_mx for MX RRs
  • s6dns_message_rr_soa for SOA RRs
  • s6dns_message_rr_srv for SRV RRs
  • +
  • s6dns_message_rr_caa for CAA RRs
  • Functions

    @@ -167,6 +168,13 @@ Reads a SOA RR and stores it into *p. Returns 1 on success or 0 on fail Reads a SRV RR and stores it into *p. Returns 1 on success or 0 on failure.

    +

    + int s6dns_message_get_caa (s6dns_message_rr_caa_t *p, char const *packet, unsigned int packetlen, unsigned int *pos, uint16_t rdlength)
    +Reads a CAA RR and stores it into *p. Returns 1 on success or 0 on failure. +rdlength is the length of the RDATA field of the record; this value is +needed to properly parse a CAA record. +

    +

    High-level RR-specific parsing functions

    @@ -233,6 +241,14 @@ Parses SRV RRs located in the answer section of the packet. The containing s6dns_message_rr_srv_t structures.

    +

    + s6dns_message_func_t s6dns_message_parse_answer_caa
    +Parses CAA RRs located in the answer section of the packet. The +data argument is interpreted as a pointer to a +genalloc +containing s6dns_message_rr_caa_t structures. +

    +

    High-level packet parsing

    diff --git a/doc/libs6dns/s6dns-resolve.html b/doc/libs6dns/s6dns-resolve.html index 9f0871f..69596f8 100644 --- a/doc/libs6dns/s6dns-resolve.html +++ b/doc/libs6dns/s6dns-resolve.html @@ -283,6 +283,16 @@ appended to the genalloc *srvs, which contains an array of s6dns_message_rr_srv_t.

    +

    + int s6dns_resolve_caa_g (genalloc *caas, char const *name, +size_t len, int qualif, tain_t const *deadline)
    + Performs a CAA query on name name of length len, qualifying it +iff qualif is nonzero. Returns -1 if an error occurs, or 0 if no answer +can be obtained from servers, or 1 if it succeeds, in which case the domains are +appended to the genalloc *caas, which contains an array of +s6dns_message_rr_caa_t. +

    +

    int s6dns_resolve_txt_g (stralloc *sa, genalloc *offsets, char const *name, unsigned int len, int qualif, tain_t const *deadline)
    -- cgit v1.2.3