-static const struct revparse_domain {
- int af; /* address family */
- int nrevlab; /* n of reverse-address labels */
- adns_rrtype rrtype; /* forward-lookup type */
-
- int (*rev_parsecomp)(const char *p, size_t n);
- /* parse a single component from a label; return the integer value, or -1
- * if it was unintelligible.
- */
-
- void (*rev_mkaddr)(adns_sockaddr *addr, const byte *ipv);
- /* write out the parsed protocol address from a vector of parsed components */
-
- const char *const tail[3]; /* tail label names */
-} revparse_domains[NREVDOMAINS] = {
- { AF_INET, 4, adns_r_a, inet_rev_parsecomp, inet_rev_mkaddr,
- { DNS_INADDR_ARPA, 0 } },
- { AF_INET6, 32, adns_r_aaaa, inet6_rev_parsecomp, inet6_rev_mkaddr,
- { DNS_IP6_ARPA, 0 } },
-};
+static bool revparse_inet6(struct revparse_state *rps,
+ const char *dgram, int nlabels,
+ adns_rrtype *rrtype_r, adns_sockaddr *addr_r) {
+ if (!revparse_check_tail(rps,dgram,nlabels,32,"ip6")) return 0;