From 29f70f35a48241eef0a690a00d5211f487972cba Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 4 Aug 2021 11:24:03 +0000 Subject: Adapt to skalibs-2.11 Signed-off-by: Laurent Bercot --- CONTRIBUTING | 5 ++++ DCO | 37 +++++++++++++++++++++++++++++ doc/index.html | 4 ++-- src/caches/dcache_add.c | 8 +++---- src/caches/dcache_clean_expired.c | 2 +- src/caches/dcache_init.c | 4 ++-- src/caches/dcache_load.c | 4 ++-- src/caches/shibari_whitelist_read.c | 2 +- src/clients/s6-dnsip.c | 14 +++++------ src/clients/s6-dnsip4.c | 4 ++-- src/clients/s6-dnsip6.c | 4 ++-- src/clients/s6-dnsmx.c | 4 ++-- src/clients/s6-dnsname.c | 6 ++--- src/clients/s6-dnsns.c | 4 ++-- src/clients/s6-dnsq.c | 8 +++---- src/clients/s6-dnsqr.c | 6 ++--- src/clients/s6-dnssoa.c | 4 ++-- src/clients/s6-dnssrv.c | 4 ++-- src/clients/s6-dnstxt.c | 4 ++-- src/clients/s6-randomip.c | 2 +- src/clients/s6dns-generic-filter.h | 10 ++++---- src/clients/s6dns_generic_filter_main.c | 8 +++---- src/include/s6-dns/dcache.h | 8 +++---- src/include/s6-dns/s6dns-analyze.h | 30 +++++++++++------------ src/include/s6-dns/s6dns-debug.h | 6 ++--- src/include/s6-dns/s6dns-engine.h | 22 ++++++++--------- src/include/s6-dns/s6dns-message.h | 24 +++++++++---------- src/include/s6-dns/s6dns-resolve.h | 28 +++++++++++----------- src/include/s6-dns/skadns.h | 10 ++++---- src/libs6dns/s6dns_analyze_packet.c | 2 +- src/libs6dns/s6dns_analyze_record.c | 2 +- src/libs6dns/s6dns_analyze_record_a.c | 2 +- src/libs6dns/s6dns_analyze_record_aaaa.c | 2 +- src/libs6dns/s6dns_analyze_record_caa.c | 2 +- src/libs6dns/s6dns_analyze_record_domain.c | 2 +- src/libs6dns/s6dns_analyze_record_hinfo.c | 2 +- src/libs6dns/s6dns_analyze_record_mx.c | 2 +- src/libs6dns/s6dns_analyze_record_soa.c | 2 +- src/libs6dns/s6dns_analyze_record_srv.c | 2 +- src/libs6dns/s6dns_analyze_record_strings.c | 2 +- src/libs6dns/s6dns_analyze_record_unknown.c | 2 +- src/libs6dns/s6dns_debug_dumpdt_post_recv.c | 2 +- src/libs6dns/s6dns_debug_dumpdt_post_send.c | 4 ++-- src/libs6dns/s6dns_debug_dumpdt_pre_send.c | 4 ++-- src/libs6dns/s6dns_engine.c | 22 ++++++++--------- src/libs6dns/s6dns_engine_nextdeadline.c | 2 +- src/libs6dns/s6dns_message_parse.c | 2 +- src/libs6dns/s6dns_rci_init.c | 2 +- src/libs6dns/s6dns_resolve_core.c | 2 +- src/libs6dns/s6dns_resolve_dpag.c | 2 +- src/libs6dns/s6dns_resolve_mpag.c | 2 +- src/libs6dns/s6dns_resolve_name4.c | 2 +- src/libs6dns/s6dns_resolve_name6.c | 2 +- src/libs6dns/s6dns_resolve_parse.c | 2 +- src/libs6dns/s6dns_resolven_loop.c | 4 ++-- src/libs6dns/s6dns_resolven_parse.c | 2 +- src/libs6dns/s6dns_resolvenoq.c | 2 +- src/libs6dns/s6dns_resolvenoq_aaaaa.c | 12 +++++----- src/libs6dns/s6dns_resolveq.c | 2 +- src/libs6dns/s6dns_resolveq_aaaaa.c | 12 +++++----- src/skadns/skadns_cancel.c | 2 +- src/skadns/skadns_send.c | 2 +- src/skadns/skadns_start.c | 2 +- src/skadns/skadns_startf.c | 2 +- src/skadns/skadnsd.c | 6 ++--- 65 files changed, 220 insertions(+), 178 deletions(-) create mode 100644 CONTRIBUTING create mode 100644 DCO diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..6279422 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,5 @@ + Please add a Signed-Off-By: line at the end of your commit, +which certifies that you have the right and authority to pass +it on as an open-source patch, as explicited in the Developer's +Certificate of Origin available in this project's DCO file, +or at https://developercertificate.org/ diff --git a/DCO b/DCO new file mode 100644 index 0000000..8201f99 --- /dev/null +++ b/DCO @@ -0,0 +1,37 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/doc/index.html b/doc/index.html index 4dac733..afd87c3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -175,9 +175,9 @@ relevant page.

Similar work

diff --git a/src/caches/dcache_add.c b/src/caches/dcache_add.c index b69b1ca..650f51b 100644 --- a/src/caches/dcache_add.c +++ b/src/caches/dcache_add.c @@ -14,9 +14,9 @@ #include #include "dcache-internal.h" -static void uniquify (avltree const *tree, tain_t *stamp) +static void uniquify (avltree const *tree, tain *stamp) { - static tain_t const nano = { .sec = TAI_ZERO, .nano = 1 } ; + static tain const nano = { .sec = TAI_ZERO, .nano = 1 } ; uint32_t dummy ; while (avltree_search(tree, stamp, &dummy)) tain_add(stamp, stamp, &nano) ; @@ -54,7 +54,7 @@ static inline int dcache_add_node (dcache_t *z, dcache_node_t const *node) return 0 ; } -static inline int dcache_add_unbounded (dcache_t *z, char const *key, uint16_t keylen, char const *data, uint16_t datalen, tain_t const *expire, tain_t const *stamp) +static inline int dcache_add_unbounded (dcache_t *z, char const *key, uint16_t keylen, char const *data, uint16_t datalen, tain const *expire, tain const *stamp) { uint32_t len = (uint32_t)keylen + (uint32_t)datalen ; dcache_node_t y = { .key = { .s = alloc(len) } } ; @@ -76,7 +76,7 @@ static inline int dcache_add_unbounded (dcache_t *z, char const *key, uint16_t k } -int dcache_add (dcache_t *z, uint64_t max, char const *key, uint16_t keylen, char const *data, uint16_t datalen, tain_t const *expire, tain_t const *stamp) +int dcache_add (dcache_t *z, uint64_t max, char const *key, uint16_t keylen, char const *data, uint16_t datalen, tain const *expire, tain const *stamp) { uint64_t size = DCACHE_NODE_OVERHEAD + keylen + datalen ; if (size > max) return (errno = EINVAL, 0) ; diff --git a/src/caches/dcache_clean_expired.c b/src/caches/dcache_clean_expired.c index 5308d8a..8a5b12c 100644 --- a/src/caches/dcache_clean_expired.c +++ b/src/caches/dcache_clean_expired.c @@ -8,7 +8,7 @@ #include #include "dcache-internal.h" -void dcache_clean_expired (dcache_t *z, tain_t const *stamp) +void dcache_clean_expired (dcache_t *z, tain const *stamp) { for (;;) { diff --git a/src/caches/dcache_init.c b/src/caches/dcache_init.c index 93a069c..cc6c635 100644 --- a/src/caches/dcache_init.c +++ b/src/caches/dcache_init.c @@ -22,8 +22,8 @@ static int key_cmp (void const *a, void const *b, void *x) static int tain_cmp (void const *a, void const *b, void *x) { - tain_t const *ta = a ; - tain_t const *tb = b ; + tain const *ta = a ; + tain const *tb = b ; (void)x ; return tain_less(ta, tb) ? -1 : tain_less(tb, ta) ; } diff --git a/src/caches/dcache_load.c b/src/caches/dcache_load.c index 8f9383f..71d38e0 100644 --- a/src/caches/dcache_load.c +++ b/src/caches/dcache_load.c @@ -15,8 +15,8 @@ static inline int dcache_load_node (dcache_t *z, uint64_t max, buffer *b) { - tain_t entry = { .nano = 0 } ; - tain_t expire = { .nano = 0 } ; + tain entry = { .nano = 0 } ; + tain expire = { .nano = 0 } ; uint16_t keylen ; uint16_t datalen ; char pack[TAI_PACK * 2 + 4] ; diff --git a/src/caches/shibari_whitelist_read.c b/src/caches/shibari_whitelist_read.c index 58dd2a0..48fcbcc 100644 --- a/src/caches/shibari_whitelist_read.c +++ b/src/caches/shibari_whitelist_read.c @@ -31,7 +31,7 @@ int shibari_whitelist_read (char const *path, genalloc *ip4, genalloc *ip6) { direntry *d ; size_t pos ; - ip46_t ip ; + ip46 ip ; uint16_t mask ; errno = 0 ; d = readdir(dir) ; diff --git a/src/clients/s6-dnsip.c b/src/clients/s6-dnsip.c index 3b86fe0..06b8400 100644 --- a/src/clients/s6-dnsip.c +++ b/src/clients/s6-dnsip.c @@ -18,8 +18,8 @@ int main (int argc, char const *const *argv) { - genalloc ips = GENALLOC_ZERO ; /* ip46full_t */ - tain_t deadline ; + genalloc ips = GENALLOC_ZERO ; /* ip46full */ + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -28,7 +28,7 @@ int main (int argc, char const *const *argv) for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { @@ -50,13 +50,13 @@ int main (int argc, char const *const *argv) if (r < 0) strerr_diefu2sys((errno == ETIMEDOUT) ? 99 : 111, "resolve ", argv[0]) ; if (!r && errno) strerr_diefu4x(2, "resolve ", argv[0], ": ", s6dns_constants_error_str(errno)) ; } - if (!genalloc_len(ip46full_t, &ips)) return 1 ; + if (!genalloc_len(ip46full, &ips)) return 1 ; - if (flagunsort) random_unsort(ips.s, genalloc_len(ip46full_t, &ips), sizeof(ip46full_t)) ; - for (i = 0 ; i < genalloc_len(ip46full_t, &ips) ; i++) + if (flagunsort) random_unsort(ips.s, genalloc_len(ip46full, &ips), sizeof(ip46full)) ; + for (i = 0 ; i < genalloc_len(ip46full, &ips) ; i++) { char fmt[IP6_FMT] ; - size_t n = ip46full_fmt(fmt, genalloc_s(ip46full_t, &ips) + i) ; + size_t n = ip46full_fmt(fmt, genalloc_s(ip46full, &ips) + i) ; fmt[n++] = '\n' ; if (buffer_put(buffer_1small, fmt, n) < (ssize_t)n) strerr_diefu1sys(111, "write to stdout") ; diff --git a/src/clients/s6-dnsip4.c b/src/clients/s6-dnsip4.c index b46f229..483bfbc 100644 --- a/src/clients/s6-dnsip4.c +++ b/src/clients/s6-dnsip4.c @@ -17,7 +17,7 @@ int main (int argc, char const *const *argv) { stralloc ips = STRALLOC_ZERO ; - tain_t deadline ; + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -26,7 +26,7 @@ int main (int argc, char const *const *argv) for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnsip6.c b/src/clients/s6-dnsip6.c index dd4e87e..5942904 100644 --- a/src/clients/s6-dnsip6.c +++ b/src/clients/s6-dnsip6.c @@ -17,7 +17,7 @@ int main (int argc, char const *const *argv) { stralloc ips = STRALLOC_ZERO ; - tain_t deadline ; + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -26,7 +26,7 @@ int main (int argc, char const *const *argv) for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnsmx.c b/src/clients/s6-dnsmx.c index c91cb44..37d6891 100644 --- a/src/clients/s6-dnsmx.c +++ b/src/clients/s6-dnsmx.c @@ -17,7 +17,7 @@ int main (int argc, char const *const *argv) { genalloc mxs = GENALLOC_ZERO ; /* array of s6dns_message_rr_mx_t */ - tain_t deadline ; + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -25,7 +25,7 @@ int main (int argc, char const *const *argv) PROG = "s6-dnsmx" ; for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnsname.c b/src/clients/s6-dnsname.c index 04e293f..b49718d 100644 --- a/src/clients/s6-dnsname.c +++ b/src/clients/s6-dnsname.c @@ -19,8 +19,8 @@ int main (int argc, char const *const *argv) { genalloc ds = GENALLOC_ZERO ; /* array of s6dns_domain_t */ - tain_t deadline ; - ip46full_t ip = IP46FULL_ZERO ; + tain deadline ; + ip46full ip = IP46FULL_ZERO ; unsigned int t = 0 ; int flagunsort = 0 ; int do4 = 0 ; @@ -28,7 +28,7 @@ int main (int argc, char const *const *argv) PROG = "s6-dnsname" ; for (;;) { - int opt = subgetopt(argc, argv, "46rt:") ; + int opt = lgetopt(argc, argv, "46rt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnsns.c b/src/clients/s6-dnsns.c index 2e343ca..8e803f3 100644 --- a/src/clients/s6-dnsns.c +++ b/src/clients/s6-dnsns.c @@ -18,14 +18,14 @@ int main (int argc, char const *const *argv) { genalloc ds = GENALLOC_ZERO ; /* array of s6dns_domain_t */ - tain_t deadline ; + tain deadline ; unsigned int t = 0 ; int flagqualify = 0 ; int flagunsort = 0 ; PROG = "s6-dnsns" ; for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnsq.c b/src/clients/s6-dnsq.c index 207c58f..d7d915e 100644 --- a/src/clients/s6-dnsq.c +++ b/src/clients/s6-dnsq.c @@ -20,13 +20,13 @@ int main (int argc, char const *const *argv) { - tain_t deadline ; + tain deadline ; unsigned int debuglevel = 0 ; uint16_t qtype ; - genwrite_t *where = &genwrite_stderr ; + genwrite *where = &genwrite_stderr ; PROG = "s6-dnsq" ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; unsigned int t = 0 ; for (;;) { @@ -58,7 +58,7 @@ int main (int argc, char const *const *argv) memset(&servers, 0, sizeof(s6dns_ip46list_t)) ; for (; (i < (unsigned int)(argc - 2)) && (j < S6DNS_MAX_SERVERS) ; i++) { - ip46_t z[S6DNS_MAX_SERVERS] ; + ip46 z[S6DNS_MAX_SERVERS] ; size_t n ; unsigned int k = 0 ; if (!*argv[2+i]) continue ; diff --git a/src/clients/s6-dnsqr.c b/src/clients/s6-dnsqr.c index d32f3b6..cb3fb97 100644 --- a/src/clients/s6-dnsqr.c +++ b/src/clients/s6-dnsqr.c @@ -18,12 +18,12 @@ int main (int argc, char const *const *argv) { - tain_t deadline ; + tain deadline ; unsigned int debuglevel = 0 ; - genwrite_t *where = &genwrite_stderr ; + genwrite *where = &genwrite_stderr ; PROG = "s6-dnsqr" ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; unsigned int t = 0 ; for (;;) { diff --git a/src/clients/s6-dnssoa.c b/src/clients/s6-dnssoa.c index cb8dc55..426919a 100644 --- a/src/clients/s6-dnssoa.c +++ b/src/clients/s6-dnssoa.c @@ -18,7 +18,7 @@ int main (int argc, char const *const *argv) { genalloc soas = GENALLOC_ZERO ; /* array of s6dns_message_rr_soa_t */ - tain_t deadline ; + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -26,7 +26,7 @@ int main (int argc, char const *const *argv) PROG = "s6-dnssoa" ; for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnssrv.c b/src/clients/s6-dnssrv.c index e7d58f9..a3e0dc4 100644 --- a/src/clients/s6-dnssrv.c +++ b/src/clients/s6-dnssrv.c @@ -18,7 +18,7 @@ int main (int argc, char const *const *argv) { genalloc srvs = GENALLOC_ZERO ; /* array of s6dns_message_rr_srv_t */ - tain_t deadline ; + tain deadline ; size_t i = 0 ; unsigned int t = 0 ; int flagqualify = 0 ; @@ -26,7 +26,7 @@ int main (int argc, char const *const *argv) PROG = "s6-dnssrv" ; for (;;) { - int opt = subgetopt(argc, argv, "qt:") ; + int opt = lgetopt(argc, argv, "qt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-dnstxt.c b/src/clients/s6-dnstxt.c index 22e9776..c7c31cd 100644 --- a/src/clients/s6-dnstxt.c +++ b/src/clients/s6-dnstxt.c @@ -21,7 +21,7 @@ int main (int argc, char const *const *argv) stralloc quoted = STRALLOC_ZERO ; stralloc sa = STRALLOC_ZERO ; genalloc offsets = GENALLOC_ZERO ; /* array of size_t */ - tain_t deadline ; + tain deadline ; size_t n ; size_t i = 0 ; unsigned int t = 0 ; @@ -30,7 +30,7 @@ int main (int argc, char const *const *argv) PROG = "s6-dnstxt" ; for (;;) { - int opt = subgetopt(argc, argv, "qrt:") ; + int opt = lgetopt(argc, argv, "qrt:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6-randomip.c b/src/clients/s6-randomip.c index 7103443..9419454 100644 --- a/src/clients/s6-randomip.c +++ b/src/clients/s6-randomip.c @@ -23,7 +23,7 @@ int main (int argc, char const *const *argv) PROG = "s6-randomip" ; for (;;) { - int opt = subgetopt(argc, argv, "46n:") ; + int opt = lgetopt(argc, argv, "46n:") ; if (opt == -1) break ; switch (opt) { diff --git a/src/clients/s6dns-generic-filter.h b/src/clients/s6dns-generic-filter.h index 8b2c738..29f758e 100644 --- a/src/clients/s6dns-generic-filter.h +++ b/src/clients/s6dns-generic-filter.h @@ -8,14 +8,14 @@ #include #include -typedef size_t scan_func_t (s6dns_domain_t *, char const *) ; -typedef scan_func_t *scan_func_t_ref ; -typedef int fmt_func_t (stralloc *, char const *, unsigned int) ; -typedef fmt_func_t *fmt_func_t_ref ; +typedef size_t scan_func (s6dns_domain_t *, char const *) ; +typedef scan_func *scan_func_ref ; +typedef int fmt_func (stralloc *, char const *, unsigned int) ; +typedef fmt_func *fmt_func_ref ; extern size_t s6dns_namescanner (s6dns_domain_t *, char const *) ; extern int s6dns_domainformatter (stralloc *, char const *, unsigned int) ; -extern int s6dns_generic_filter_main (int, char const *const *, char const *const *, uint16_t, scan_func_t_ref, fmt_func_t_ref, char const *) ; +extern int s6dns_generic_filter_main (int, char const *const *, char const *const *, uint16_t, scan_func_ref, fmt_func_ref, char const *) ; extern int flag4 ; extern int flag6 ; diff --git a/src/clients/s6dns_generic_filter_main.c b/src/clients/s6dns_generic_filter_main.c index 8d97780..32eaee6 100644 --- a/src/clients/s6dns_generic_filter_main.c +++ b/src/clients/s6dns_generic_filter_main.c @@ -43,16 +43,16 @@ static void line_recycle (line_t *l) int flag4 = 0 ; int flag6 = 0 ; -int s6dns_generic_filter_main (int argc, char const *const *argv, char const *const *envp, uint16_t qtype, scan_func_t_ref scanner, fmt_func_t_ref formatter, char const *USAGE) +int s6dns_generic_filter_main (int argc, char const *const *argv, char const *const *envp, uint16_t qtype, scan_func_ref scanner, fmt_func_ref formatter, char const *USAGE) { skadns_t a = SKADNS_ZERO ; - tain_t deadline, tto ; + tain deadline, tto ; char const *normalformat = "%s=%d%w%r" ; char const *errorformat = "%s=<%e>%w%r" ; uint16_t maxlines = 256 ; uint16_t maxconn = 128 ; { - subgetopt_t l = SUBGETOPT_ZERO ; + subgetopt l = SUBGETOPT_ZERO ; unsigned int t = 0 ; for (;;) { @@ -185,7 +185,7 @@ int s6dns_generic_filter_main (int argc, char const *const *argv, char const *co } else { - tain_t sendlimit ; + tain sendlimit ; uint16_t id ; line->w[0] = line->swrd.s[line->wpos] ; line->swrd.s[line->wpos] = 0 ; diff --git a/src/include/s6-dns/dcache.h b/src/include/s6-dns/dcache.h index 5209750..e70913f 100644 --- a/src/include/s6-dns/dcache.h +++ b/src/include/s6-dns/dcache.h @@ -24,8 +24,8 @@ struct dcache_node_s { dcache_key_t key ; uint16_t datalen ; - tain_t entry ; - tain_t expire ; + tain entry ; + tain expire ; } ; typedef struct dcache_s dcache_t, *dcache_t_ref ; @@ -42,9 +42,9 @@ struct dcache_s extern void dcache_init (dcache_t *, uint64_t) ; extern dcache_node_t *dcache_search (dcache_t *, char const *, uint16_t) ; -extern int dcache_add (dcache_t *, uint64_t, char const *, uint16_t, char const *, uint16_t, tain_t const *, tain_t const *) ; +extern int dcache_add (dcache_t *, uint64_t, char const *, uint16_t, char const *, uint16_t, tain const *, tain const *) ; #define dcache_add_g(d, max, key, keylen, data, datalen, expire) dcache_add(d, max, key, keylen, data, datalen, (expire), &STAMP) -extern void dcache_clean_expired (dcache_t *, tain_t const *) ; +extern void dcache_clean_expired (dcache_t *, tain const *) ; #define dcache_clean_expired_g(d) dcache_clean_expired((d), &STAMP) extern void dcache_free (dcache_t *) ; diff --git a/src/include/s6-dns/s6dns-analyze.h b/src/include/s6-dns/s6dns-analyze.h index ed4fb17..554a294 100644 --- a/src/include/s6-dns/s6dns-analyze.h +++ b/src/include/s6-dns/s6dns-analyze.h @@ -7,34 +7,34 @@ #include #include -typedef int s6dns_analyze_record_func_t (genwrite_t *, s6dns_message_rr_t const *, char const *, unsigned int, unsigned int) ; -typedef s6dns_analyze_record_func_t *s6dns_analyze_record_func_t_ref ; +typedef int s6dns_analyze_record_func (genwrite *, s6dns_message_rr_t const *, char const *, unsigned int, unsigned int) ; +typedef s6dns_analyze_record_func *s6dns_analyze_record_func_ref ; typedef struct s6dns_analyze_rtypetable_s s6dns_analyze_rtypetable_t, *s6dns_analyze_rtypetable_t_ref ; struct s6dns_analyze_rtypetable_s { uint16_t rtype ; char const *string ; - s6dns_analyze_record_func_t_ref f ; + s6dns_analyze_record_func_ref f ; } ; extern uint16_t s6dns_analyze_qtype_parse (char const *) ; extern s6dns_analyze_rtypetable_t const *s6dns_analyze_rtypetable ; -extern s6dns_analyze_record_func_t s6dns_analyze_record_a ; -extern s6dns_analyze_record_func_t s6dns_analyze_record_aaaa ; -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 ; +extern s6dns_analyze_record_func s6dns_analyze_record_a ; +extern s6dns_analyze_record_func s6dns_analyze_record_aaaa ; +extern s6dns_analyze_record_func s6dns_analyze_record_hinfo ; +extern s6dns_analyze_record_func s6dns_analyze_record_soa ; +extern s6dns_analyze_record_func s6dns_analyze_record_mx ; +extern s6dns_analyze_record_func s6dns_analyze_record_srv ; +extern s6dns_analyze_record_func s6dns_analyze_record_caa ; +extern s6dns_analyze_record_func s6dns_analyze_record_domain ; +extern s6dns_analyze_record_func s6dns_analyze_record_strings ; +extern s6dns_analyze_record_func s6dns_analyze_record_unknown ; -extern s6dns_analyze_record_func_t s6dns_analyze_record ; +extern s6dns_analyze_record_func s6dns_analyze_record ; -extern int s6dns_analyze_packet (genwrite_t *, char const *, unsigned int, int) ; +extern int s6dns_analyze_packet (genwrite *, char const *, unsigned int, int) ; #endif diff --git a/src/include/s6-dns/s6dns-debug.h b/src/include/s6-dns/s6dns-debug.h index acc5818..06da4b6 100644 --- a/src/include/s6-dns/s6dns-debug.h +++ b/src/include/s6-dns/s6dns-debug.h @@ -5,9 +5,9 @@ #include -extern s6dns_debughook_func_t s6dns_debug_dumpdt_post_recv ; -extern s6dns_debughook_func_t s6dns_debug_dumpdt_pre_send ; -extern s6dns_debughook_func_t s6dns_debug_dumpdt_post_send ; +extern s6dns_debughook_func s6dns_debug_dumpdt_post_recv ; +extern s6dns_debughook_func s6dns_debug_dumpdt_pre_send ; +extern s6dns_debughook_func s6dns_debug_dumpdt_post_send ; #define S6DNS_DEBUG_DUMPDT_INIT(gp) { &s6dns_debug_dumpdt_post_recv, &s6dns_debug_dumpdt_pre_send, &s6dns_debug_dumpdt_post_send, (gp) } extern s6dns_debughook_t const s6dns_debug_dumpdt_stdout ; diff --git a/src/include/s6-dns/s6dns-engine.h b/src/include/s6-dns/s6dns-engine.h index 13cfe3a..4884fd9 100644 --- a/src/include/s6-dns/s6dns-engine.h +++ b/src/include/s6-dns/s6dns-engine.h @@ -18,15 +18,15 @@ typedef struct s6dns_engine_s s6dns_engine_t, *s6dns_engine_t_ref ; /* Debug function hooks */ -typedef int s6dns_debughook_func_t (s6dns_engine_t const *, void *) ; -typedef s6dns_debughook_func_t *s6dns_debughook_func_t_ref ; +typedef int s6dns_debughook_func (s6dns_engine_t const *, void *) ; +typedef s6dns_debughook_func *s6dns_debughook_func_ref ; typedef struct s6dns_debughook_s s6dns_debughook_t, *s6dns_debughook_t_ref ; struct s6dns_debughook_s { - s6dns_debughook_func_t_ref post_recv ; - s6dns_debughook_func_t_ref pre_send ; - s6dns_debughook_func_t_ref post_send ; + s6dns_debughook_func_ref post_recv ; + s6dns_debughook_func_ref pre_send ; + s6dns_debughook_func_ref post_send ; void *external ; } ; #define S6DNS_DEBUGHOOK_ZERO { .post_recv = 0, .pre_send = 0, .post_send = 0, .external = 0 } @@ -40,8 +40,8 @@ extern s6dns_debughook_t const s6dns_debughook_zero ; struct s6dns_engine_s { stralloc sa ; /* 2 bytes (qlen) + qlen bytes (query) + answers */ - tain_t deadline ; - tain_t localdeadline ; + tain deadline ; + tain localdeadline ; unsigned int querylen ; int fd ; uint32_t protostate ; @@ -84,22 +84,22 @@ extern void s6dns_engine_freen (s6dns_engine_t *, unsigned int) ; #define s6dns_engine_init(dt, servers, options, q, qlen, qtype, deadline, stamp) s6dns_engine_init_r(dt, servers, options, q, qlen, qtype, &s6dns_debughook_zero, deadline, stamp) #define s6dns_engine_init_g(dt, servers, options, q, qlen, qtype, deadline) s6dns_engine_init(dt, servers, options, q, qlen, qtype, (deadline), &STAMP) -extern int s6dns_engine_init_r (s6dns_engine_t *, s6dns_ip46list_t const *, uint32_t, char const *, unsigned int, uint16_t, s6dns_debughook_t const *, tain_t const *, tain_t const *) ; +extern int s6dns_engine_init_r (s6dns_engine_t *, s6dns_ip46list_t const *, uint32_t, char const *, unsigned int, uint16_t, s6dns_debughook_t const *, tain const *, tain const *) ; #define s6dns_engine_init_r_g(dt, servers, options, q, qlen, qtype, dbh, deadline) s6dns_engine_init_r(dt, servers, options, q, qlen, qtype, dbh, (deadline), &STAMP) /* Call before iopause() */ -extern void s6dns_engine_nextdeadline (s6dns_engine_t const *, tain_t *) ; +extern void s6dns_engine_nextdeadline (s6dns_engine_t const *, tain *) ; #define s6dns_engine_isreadable(dt) ((dt)->flagreading) #define s6dns_engine_iswritable(dt) ((dt)->flagwriting) /* Call after iopause(): _timeout if iopause returns 0, _event otherwise */ -extern int s6dns_engine_timeout (s6dns_engine_t *, tain_t const *) ; +extern int s6dns_engine_timeout (s6dns_engine_t *, tain const *) ; #define s6dns_engine_timeout_g(dt) s6dns_engine_timeout((dt), &STAMP) -extern int s6dns_engine_event (s6dns_engine_t *, tain_t const *) ; +extern int s6dns_engine_event (s6dns_engine_t *, tain const *) ; #define s6dns_engine_event_g(dt) s6dns_engine_event((dt), &STAMP) #define s6dns_engine_packet(dt) ((dt)->sa.s + (dt)->querylen) diff --git a/src/include/s6-dns/s6dns-message.h b/src/include/s6-dns/s6dns-message.h index 0b75f62..eb9c378 100644 --- a/src/include/s6-dns/s6dns-message.h +++ b/src/include/s6-dns/s6dns-message.h @@ -135,8 +135,8 @@ struct s6dns_message_rr_s uint16_t rdlength ; } ; -typedef int s6dns_message_rr_func_t (s6dns_message_rr_t const *, char const *, unsigned int, unsigned int, unsigned int, void *) ; -typedef s6dns_message_rr_func_t *s6dns_message_rr_func_t_ref ; +typedef int s6dns_message_rr_func (s6dns_message_rr_t const *, char const *, unsigned int, unsigned int, unsigned int, void *) ; +typedef s6dns_message_rr_func *s6dns_message_rr_func_ref ; /* mpag: structure to encode several variable-length results */ @@ -162,20 +162,20 @@ struct s6dns_dpag_s #define S6DNS_DPAG_ZERO { .ds = GENALLOC_ZERO, .rtype = 0 } -extern s6dns_message_rr_func_t s6dns_message_parse_answer_strings ; -extern s6dns_message_rr_func_t s6dns_message_parse_answer_domain ; -extern s6dns_message_rr_func_t s6dns_message_parse_answer_a ; -extern s6dns_message_rr_func_t s6dns_message_parse_answer_aaaa ; -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 ; +extern s6dns_message_rr_func s6dns_message_parse_answer_strings ; +extern s6dns_message_rr_func s6dns_message_parse_answer_domain ; +extern s6dns_message_rr_func s6dns_message_parse_answer_a ; +extern s6dns_message_rr_func s6dns_message_parse_answer_aaaa ; +extern s6dns_message_rr_func s6dns_message_parse_answer_mx ; +extern s6dns_message_rr_func s6dns_message_parse_answer_hinfo ; +extern s6dns_message_rr_func s6dns_message_parse_answer_soa ; +extern s6dns_message_rr_func s6dns_message_parse_answer_srv ; +extern s6dns_message_rr_func s6dns_message_parse_answer_caa ; /* The actual parsing function */ -extern int s6dns_message_parse (s6dns_message_header_t_ref, char const *, unsigned int, s6dns_message_rr_func_t_ref, void *) ; +extern int s6dns_message_parse (s6dns_message_header_t_ref, char const *, unsigned int, s6dns_message_rr_func_ref, void *) ; /* Internals of this function, for lower level access */ diff --git a/src/include/s6-dns/s6dns-resolve.h b/src/include/s6-dns/s6dns-resolve.h index 7369ffd..3e8b8c6 100644 --- a/src/include/s6-dns/s6dns-resolve.h +++ b/src/include/s6-dns/s6dns-resolve.h @@ -45,7 +45,7 @@ #define s6dns_resolve_core(d, qtype, deadline, stamp) s6dns_resolve_core_r(d, qtype, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_core_g(d, qtype, deadline) s6dns_resolve_core(d, qtype, (deadline), &STAMP) -extern int s6dns_resolve_core_r (s6dns_domain_t const *, uint16_t, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_core_r (s6dns_domain_t const *, uint16_t, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_core_r_g(d, qtype, dt, servers, dbh, deadline) s6dns_resolve_core_r(d, qtype, dt, servers, dbh, (deadline), &STAMP) @@ -58,7 +58,7 @@ extern int s6dns_resolve_core_r (s6dns_domain_t const *, uint16_t, s6dns_engine_ #define s6dns_resolve_parse(d, qtype, parsefunc, parsedata, deadline, stamp) s6dns_resolve_parse_r(d, qtype, parsefunc, parsedata, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_parse_g(d, qtype, parsefunc, parsedata, deadline) s6dns_resolve_parse(d, qtype, parsefunc, parsedata, (deadline), &STAMP) -extern int s6dns_resolve_parse_r (s6dns_domain_t const *, uint16_t, s6dns_message_rr_func_t_ref, void *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_parse_r (s6dns_domain_t const *, uint16_t, s6dns_message_rr_func_ref, void *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_parse_r_g(d, qtype, parsefunc, parsedata, dt, servers, dbh, deadline) s6dns_resolve_parse_r(d, qtype, parsefunc, parsedata, dt, servers, dbh, (deadline), &STAMP) @@ -68,7 +68,7 @@ extern int s6dns_resolve_parse_r (s6dns_domain_t const *, uint16_t, s6dns_messag #define s6dns_resolvenoq(name, len, qtype, parsefunc, parsedata, deadline, stamp) s6dns_resolvenoq_r(name, len, qtype, parsefunc, parsedata, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolvenoq_g(name, len, qtype, parsefunc, parsedata, deadline) s6dns_resolvenoq(name, len, qtype, parsefunc, parsedata, (deadline), &STAMP) -extern int s6dns_resolvenoq_r (char const *, size_t, uint16_t, s6dns_message_rr_func_t_ref, void *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolvenoq_r (char const *, size_t, uint16_t, s6dns_message_rr_func_ref, void *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolvenoq_r_g(name, len, qtype, parsefunc, parsedata, dt, servers, dbh, deadline) s6dns_resolvenoq_r(name, len, qtype, parsefunc, parsedata, dt, servers, dbh, (deadline), &STAMP) @@ -79,7 +79,7 @@ extern int s6dns_resolvenoq_r (char const *, size_t, uint16_t, s6dns_message_rr_ #define s6dns_resolveq(name, len, qtype, parsefunc, parsedata, deadline, stamp) s6dns_resolveq_r(name, len, qtype, parsefunc, parsedata, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolveq_g(name, len, qtype, parsefunc, parsedata, deadline) s6dns_resolveq(name, len, qtype, parsefunc, parsedata, (deadline), &STAMP) -extern int s6dns_resolveq_r (char const *, size_t, uint16_t, s6dns_message_rr_func_t_ref, void *, s6dns_rci_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolveq_r (char const *, size_t, uint16_t, s6dns_message_rr_func_ref, void *, s6dns_rci_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolveq_r_g(name, len, qtype, parsefunc, parsedata, rci, dbh, deadline) s6dns_resolveq_r(name, len, qtype, parsefunc, parsedata, rci, dbh, (deadline), &STAMP) @@ -98,12 +98,12 @@ extern int s6dns_resolveq_r (char const *, size_t, uint16_t, s6dns_message_rr_fu #define s6dns_resolvenoq_aaaaa(ips, name, len, deadline, stamp) s6dns_resolvenoq_aaaaa_r(ips, name, len, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolvenoq_aaaaa_g(ips, name, len, deadline) s6dns_resolvenoq_aaaaa(ips, name, len, (deadline), &STAMP) -extern int s6dns_resolvenoq_aaaaa_r(genalloc *, char const *, size_t, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolvenoq_aaaaa_r(genalloc *, char const *, size_t, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolvenoq_aaaaa_r_g(ips, name, len, servers, dbh, deadline) s6dns_resolvenoq_aaaaa_r(ips, name, len, servers, dbh, (deadline), &STAMP) #define s6dns_resolveq_aaaaa(ips, name, len, deadline, stamp) s6dns_resolveq_aaaaa_r(ips, name, len, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolveq_aaaaa_g(ips, name, len, deadline) s6dns_resolveq_aaaaa(ips, name, len, (deadline), &STAMP) -extern int s6dns_resolveq_aaaaa_r(genalloc *, char const *, size_t, s6dns_rci_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolveq_aaaaa_r(genalloc *, char const *, size_t, s6dns_rci_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolveq_aaaaa_r_g(ips, name, len, rci, dbh, deadline) s6dns_resolvenoq_aaaaa_r(ips, name, len, rci, dbh, (deadline), &STAMP) @@ -145,12 +145,12 @@ extern int s6dns_resolveq_aaaaa_r(genalloc *, char const *, size_t, s6dns_rci_t #define s6dns_resolve_name4(ds, ip, deadline, stamp) s6dns_resolve_name4_r(ds, ip, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_name4_g(ds, ip, deadline) s6dns_resolve_name4(ds, ip, (deadline), &STAMP) -extern int s6dns_resolve_name4_r (genalloc *, char const *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_name4_r (genalloc *, char const *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_name4_r_g(ds, ip, dt, servers, dbh, deadline) s6dns_resolve_name4_r(ds, ip, dt, servers, dbh, (deadline), &STAMP) #define s6dns_resolve_name6(ds, ip6, deadline, stamp) s6dns_resolve_name6_r(ds, ip6, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_name6_g(ds, ip6, deadline) s6dns_resolve_name6(ds, ip6, (deadline), &STAMP) -extern int s6dns_resolve_name6_r (genalloc *, char const *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_name6_r (genalloc *, char const *, s6dns_engine_t *, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_name6_r_g(ds, ip6, dt, servers, dbh, deadline) s6dns_resolve_name6_r(ds, ip6, dt, servers, dbh, (deadline), &STAMP) #define s6dns_resolve_name46(ds, i, deadline, stamp) s6dns_resolve_name46_r(ds, i, &s6dns_engine_here, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) @@ -206,12 +206,12 @@ extern int s6dns_resolve_name6_r (genalloc *, char const *, s6dns_engine_t *, s6 #define s6dns_resolve_dpag(ds, name, len, qtype, qualif, deadline, stamp) s6dns_resolve_dpag_r(ds, name, len, qtype, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_dpag_g(ds, name, len, qtype, qualif, deadline) s6dns_resolve_dpag(ds, name, len, qtype, qualif, (deadline), &STAMP) -extern int s6dns_resolve_dpag_r (genalloc *, char const *, unsigned int, uint16_t, int, s6dns_engine_t *, s6dns_rci_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_dpag_r (genalloc *, char const *, unsigned int, uint16_t, int, s6dns_engine_t *, s6dns_rci_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_dpag_r_g(ds, name, len, qtype, qualif, dt, rci, dbh, deadline) s6dns_resolve_dpag_r(ds, name, len, qtype, qualif, dt, rci, dbh, (deadline), &STAMP) #define s6dns_resolve_mpag(sa, offsets, name, len, qtype, parsefunc, qualif, deadline, stamp) s6dns_resolve_mpag_r(sa, offsets, name, len, qtype, parsefunc, qualif, &s6dns_engine_here, &s6dns_rci_here, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolve_mpag_g(sa, offsets, name, len, qtype, parsefunc, qualif, deadline) s6dns_resolve_mpag(sa, offsets, name, len, qtype, parsefunc, qualif, (deadline), &STAMP) -extern int s6dns_resolve_mpag_r (stralloc *, genalloc *, char const *, unsigned int, uint16_t, s6dns_message_rr_func_t_ref, int, s6dns_engine_t *, s6dns_rci_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolve_mpag_r (stralloc *, genalloc *, char const *, unsigned int, uint16_t, s6dns_message_rr_func_ref, int, s6dns_engine_t *, s6dns_rci_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolve_mpag_r_g(sa, offsets, name, len, qtype, parsefunc, qualif, dt, rci, dbh, deadline) s6dns_resolve_mpag_r(sa, offsets, name, len, qtype, parsefunc, qualif, dt, rci, dbh, (deadline), &STAMP) @@ -223,15 +223,15 @@ extern int s6dns_resolve_mpag_r (stralloc *, genalloc *, char const *, unsigned asynchronous resolution, use the skadns library. */ -extern int s6dns_resolven_loop (s6dns_engine_t *, unsigned int, unsigned int, tain_t const *, tain_t *) ; +extern int s6dns_resolven_loop (s6dns_engine_t *, unsigned int, unsigned int, tain const *, tain *) ; #define s6dns_resolven_loop_g(list, n, zor, deadline) s6dns_resolven(list, n, zor, (deadline), &STAMP) typedef struct s6dns_resolve_s s6dns_resolve_t, *s6dns_resolve_t_ref ; struct s6dns_resolve_s { s6dns_domain_t q ; - tain_t deadline ; - s6dns_message_rr_func_t_ref parsefunc ; + tain deadline ; + s6dns_message_rr_func_ref parsefunc ; void *data ; uint32_t options ; int status ; @@ -240,7 +240,7 @@ struct s6dns_resolve_s #define s6dns_resolven_parse(list, n, deadline, stamp) s6dns_resolven_parse_r(list, n, &s6dns_rci_here.servers, &s6dns_debughook_zero, deadline, stamp) #define s6dns_resolven_parse_g(list, n, deadline) s6dns_resolven_parse(list, n, (deadline), &STAMP) -extern int s6dns_resolven_parse_r (s6dns_resolve_t *, unsigned int, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain_t const *, tain_t *) ; +extern int s6dns_resolven_parse_r (s6dns_resolve_t *, unsigned int, s6dns_ip46list_t const *, s6dns_debughook_t const *, tain const *, tain *) ; #define s6dns_resolven_parse_r_g(list, n, servers, dbh, deadline) s6dns_resolven_parse_r(list, n, servers, dbh, (deadline), &STAMP) #endif diff --git a/src/include/s6-dns/skadns.h b/src/include/s6-dns/skadns.h index 1b506d9..8f27d2e 100644 --- a/src/include/s6-dns/skadns.h +++ b/src/include/s6-dns/skadns.h @@ -31,7 +31,7 @@ struct skadnsanswer_s typedef struct skadns_s skadns_t, *skadns_t_ref ; struct skadns_s { - textclient_t connection ; + textclient connection ; genalloc list ; /* array of uint16_t */ gensetdyn q ; /* set of skadnsanswer_t */ } ; @@ -41,18 +41,18 @@ extern skadns_t const skadns_zero ; /* Starting and ending a session */ -extern int skadns_start (skadns_t *, char const *, tain_t const *, tain_t *) ; +extern int skadns_start (skadns_t *, char const *, tain const *, tain *) ; #define skadns_start_g(a, path, deadline) skadns_start(a, path, (deadline), &STAMP) -extern int skadns_startf (skadns_t *, tain_t const *, tain_t *) ; +extern int skadns_startf (skadns_t *, tain const *, tain *) ; #define skadns_startf_g(a, deadline) skadns_startf(a, (deadline), &STAMP) extern void skadns_end (skadns_t *) ; /* Synchronous functions */ -extern int skadns_send (skadns_t *, uint16_t *, s6dns_domain_t const *, uint16_t, tain_t const *, tain_t const *, tain_t *) ; +extern int skadns_send (skadns_t *, uint16_t *, s6dns_domain_t const *, uint16_t, tain const *, tain const *, tain *) ; #define skadns_send_g(a, id, d, qtype, limit, deadline) skadns_send(a, id, d, qtype, limit, (deadline), &STAMP) -extern int skadns_cancel (skadns_t *, uint16_t, tain_t const *, tain_t *) ; +extern int skadns_cancel (skadns_t *, uint16_t, tain const *, tain *) ; #define skadns_cancel_g(a, id, deadline) skadns_cancel(a, id, (deadline), &STAMP) diff --git a/src/libs6dns/s6dns_analyze_packet.c b/src/libs6dns/s6dns_analyze_packet.c index 24c2326..4ee1bd4 100644 --- a/src/libs6dns/s6dns_analyze_packet.c +++ b/src/libs6dns/s6dns_analyze_packet.c @@ -16,7 +16,7 @@ #define addfmt(n) if ((*gp->put)(gp->target, fmt, uint_fmt(fmt, (n))) < 0) return 0 #define addfmt16(n) if ((*gp->put)(gp->target, fmt, uint16_fmt(fmt, (n))) < 0) return 0 -int s6dns_analyze_packet (genwrite_t *gp, char const *packet, unsigned int packetlen, int rec) +int s6dns_analyze_packet (genwrite *gp, char const *packet, unsigned int packetlen, int rec) { s6dns_message_header_t h ; s6dns_message_counts_t counts ; diff --git a/src/libs6dns/s6dns_analyze_record.c b/src/libs6dns/s6dns_analyze_record.c index 13d0fa8..46a0517 100644 --- a/src/libs6dns/s6dns_analyze_record.c +++ b/src/libs6dns/s6dns_analyze_record.c @@ -13,7 +13,7 @@ static s6dns_analyze_rtypetable_t const *rtypelookup (uint16_t rtype) return wut ; } -int s6dns_analyze_record (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) +int s6dns_analyze_record (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) { s6dns_analyze_rtypetable_t const *wut = rtypelookup(rr->rtype) ; { diff --git a/src/libs6dns/s6dns_analyze_record_a.c b/src/libs6dns/s6dns_analyze_record_a.c index 41ceee7..cc8354f 100644 --- a/src/libs6dns/s6dns_analyze_record_a.c +++ b/src/libs6dns/s6dns_analyze_record_a.c @@ -7,7 +7,7 @@ #include -int s6dns_analyze_record_a (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) +int s6dns_analyze_record_a (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) { char fmt[IP4_FMT] ; if (rr->rdlength != 4) return (errno = EPROTO, 0) ; diff --git a/src/libs6dns/s6dns_analyze_record_aaaa.c b/src/libs6dns/s6dns_analyze_record_aaaa.c index e60e279..17cdebe 100644 --- a/src/libs6dns/s6dns_analyze_record_aaaa.c +++ b/src/libs6dns/s6dns_analyze_record_aaaa.c @@ -7,7 +7,7 @@ #include -int s6dns_analyze_record_aaaa (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) +int s6dns_analyze_record_aaaa (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) { char fmt[IP6_FMT] ; if (rr->rdlength != 16) return (errno = EPROTO, 0) ; diff --git a/src/libs6dns/s6dns_analyze_record_caa.c b/src/libs6dns/s6dns_analyze_record_caa.c index 076f04b..9a44546 100644 --- a/src/libs6dns/s6dns_analyze_record_caa.c +++ b/src/libs6dns/s6dns_analyze_record_caa.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_caa (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_caa (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_message_rr_caa_t caa ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_domain.c b/src/libs6dns/s6dns_analyze_record_domain.c index a14dd98..c5231c9 100644 --- a/src/libs6dns/s6dns_analyze_record_domain.c +++ b/src/libs6dns/s6dns_analyze_record_domain.c @@ -10,7 +10,7 @@ #include #include -int s6dns_analyze_record_domain (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_domain (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_domain_t d ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_hinfo.c b/src/libs6dns/s6dns_analyze_record_hinfo.c index d8e36b2..cf1df9b 100644 --- a/src/libs6dns/s6dns_analyze_record_hinfo.c +++ b/src/libs6dns/s6dns_analyze_record_hinfo.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_hinfo (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_hinfo (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_message_rr_hinfo_t hinfo ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_mx.c b/src/libs6dns/s6dns_analyze_record_mx.c index ab09c1a..aae3b9f 100644 --- a/src/libs6dns/s6dns_analyze_record_mx.c +++ b/src/libs6dns/s6dns_analyze_record_mx.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_mx (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_mx (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_message_rr_mx_t mx ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_soa.c b/src/libs6dns/s6dns_analyze_record_soa.c index 7f9d4f6..ecfb294 100644 --- a/src/libs6dns/s6dns_analyze_record_soa.c +++ b/src/libs6dns/s6dns_analyze_record_soa.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_soa (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_soa (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_message_rr_soa_t soa ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_srv.c b/src/libs6dns/s6dns_analyze_record_srv.c index 9af1b49..a03f202 100644 --- a/src/libs6dns/s6dns_analyze_record_srv.c +++ b/src/libs6dns/s6dns_analyze_record_srv.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_srv (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_srv (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { s6dns_message_rr_srv_t srv ; size_t len ; diff --git a/src/libs6dns/s6dns_analyze_record_strings.c b/src/libs6dns/s6dns_analyze_record_strings.c index f6f4c85..b3290cc 100644 --- a/src/libs6dns/s6dns_analyze_record_strings.c +++ b/src/libs6dns/s6dns_analyze_record_strings.c @@ -9,7 +9,7 @@ #include #include -int s6dns_analyze_record_strings (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) +int s6dns_analyze_record_strings (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int start) { stralloc sa = STRALLOC_ZERO ; char buf[rr->rdlength] ; diff --git a/src/libs6dns/s6dns_analyze_record_unknown.c b/src/libs6dns/s6dns_analyze_record_unknown.c index b7a276d..033434e 100644 --- a/src/libs6dns/s6dns_analyze_record_unknown.c +++ b/src/libs6dns/s6dns_analyze_record_unknown.c @@ -5,7 +5,7 @@ #include #include -int s6dns_analyze_record_unknown (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) +int s6dns_analyze_record_unknown (genwrite *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) { char fmt[UINT16_FMT] ; if ((*gp->put)(gp->target, "rtype ", 6) < 0) return 0 ; diff --git a/src/libs6dns/s6dns_debug_dumpdt_post_recv.c b/src/libs6dns/s6dns_debug_dumpdt_post_recv.c index 827fce8..8e64953 100644 --- a/src/libs6dns/s6dns_debug_dumpdt_post_recv.c +++ b/src/libs6dns/s6dns_debug_dumpdt_post_recv.c @@ -5,7 +5,7 @@ int s6dns_debug_dumpdt_post_recv (s6dns_engine_t const *dt, void *data) { - genwrite_t *gp = data ; + genwrite *gp = data ; (void)dt ; if ((*gp->put)(gp->target, "Received a packet\n", 19) < 19) return 0 ; if ((*gp->put)(gp->target, "\n", 1) < 1) return 0 ; diff --git a/src/libs6dns/s6dns_debug_dumpdt_post_send.c b/src/libs6dns/s6dns_debug_dumpdt_post_send.c index 21692a0..8d18718 100644 --- a/src/libs6dns/s6dns_debug_dumpdt_post_send.c +++ b/src/libs6dns/s6dns_debug_dumpdt_post_send.c @@ -9,7 +9,7 @@ int s6dns_debug_dumpdt_post_send (s6dns_engine_t const *dt, void *data) { - genwrite_t *gp = data ; + genwrite *gp = data ; size_t len ; char buf[LOCALTMN_FMT] ; if ((*gp->put)(gp->target, "Sent query ", 11) < 11) return 0 ; @@ -21,7 +21,7 @@ int s6dns_debug_dumpdt_post_send (s6dns_engine_t const *dt, void *data) if ((*gp->put)(gp->target, buf, len) < (ssize_t)len) return 0 ; if ((*gp->put)(gp->target, " - next recv deadline is ", 25) < 25) return 0 ; { - localtmn_t l ; + localtmn l ; if (!localtmn_from_tain(&l, &dt->localdeadline, 0)) return 0 ; len = localtmn_fmt(buf, &l) ; } diff --git a/src/libs6dns/s6dns_debug_dumpdt_pre_send.c b/src/libs6dns/s6dns_debug_dumpdt_pre_send.c index 25c887a..0d4ae19 100644 --- a/src/libs6dns/s6dns_debug_dumpdt_pre_send.c +++ b/src/libs6dns/s6dns_debug_dumpdt_pre_send.c @@ -24,7 +24,7 @@ int s6dns_debug_dumpdt_pre_send (s6dns_engine_t const *dt, void *data) { - genwrite_t *gp = data ; + genwrite *gp = data ; size_t len ; char buf[LOCALTMN_FMT] ; if ((*gp->put)(gp->target, "Preparing to send via ", 22) < 22) return 0 ; @@ -37,7 +37,7 @@ int s6dns_debug_dumpdt_pre_send (s6dns_engine_t const *dt, void *data) if ((*gp->put)(gp->target, buf, len) < (ssize_t)len) return 0 ; if ((*gp->put)(gp->target, " with deadline ", 15) < 15) return 0 ; { - localtmn_t l ; + localtmn l ; if (!localtmn_from_tain(&l, &dt->localdeadline, 0)) { if (errno != EOVERFLOW) return 0 ; diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c index a4dc8bc..2d07357 100644 --- a/src/libs6dns/s6dns_engine.c +++ b/src/libs6dns/s6dns_engine.c @@ -115,7 +115,7 @@ static int randombind (int fd, int flag) return (socketbind46(fd, S6DNS_ENGINE_LOCAL0, 0, flag) >= 0) ; } -static int thisudp (s6dns_engine_t *dt, tain_t const *stamp) +static int thisudp (s6dns_engine_t *dt, tain const *stamp) { for (;; dt->curserver++) { @@ -148,7 +148,7 @@ static int thisudp (s6dns_engine_t *dt, tain_t const *stamp) return 1 ; } -static int thistcp (s6dns_engine_t *dt, tain_t const *stamp) +static int thistcp (s6dns_engine_t *dt, tain const *stamp) { for (; dt->curserver < S6DNS_MAX_SERVERS ; dt->curserver++) if (memcmp(s6dns_ip46list_ip(&dt->servers, dt->curserver), S6DNS_ENGINE_LOCAL0, SKALIBS_IP_SIZE)) break ; @@ -179,7 +179,7 @@ static int thistcp (s6dns_engine_t *dt, tain_t const *stamp) /* all the rest is transport-agnostic */ -static int s6dns_engine_prepare (s6dns_engine_t *dt, tain_t const *stamp, int istcp) +static int s6dns_engine_prepare (s6dns_engine_t *dt, tain const *stamp, int istcp) { for (;; dt->curserver++) switch (istcp ? thistcp(dt, stamp) : thisudp(dt, stamp)) @@ -192,7 +192,7 @@ static int s6dns_engine_prepare (s6dns_engine_t *dt, tain_t const *stamp, int is } } -static void prepare_next (s6dns_engine_t *dt, tain_t const *stamp, int istcp) +static void prepare_next (s6dns_engine_t *dt, tain const *stamp, int istcp) { if (!error_isagain(errno)) { @@ -202,7 +202,7 @@ static void prepare_next (s6dns_engine_t *dt, tain_t const *stamp, int istcp) } } -static int s6dns_engine_write_udp (s6dns_engine_t *dt, tain_t const *stamp) +static int s6dns_engine_write_udp (s6dns_engine_t *dt, tain const *stamp) { static unsigned int const s6dns_engine_udp_timeouts[4] = { 1, 3, 11, 45 } ; if (fd_send(dt->fd, dt->sa.s + 2, dt->querylen - 2, 0) < (ssize_t)(dt->querylen - 2)) @@ -215,7 +215,7 @@ static int s6dns_engine_write_udp (s6dns_engine_t *dt, tain_t const *stamp) return (errno = EAGAIN, 1) ; } -static int s6dns_engine_write_tcp (s6dns_engine_t *dt, tain_t const *stamp) +static int s6dns_engine_write_tcp (s6dns_engine_t *dt, tain const *stamp) { size_t r ; r = allwrite(dt->fd, dt->sa.s + dt->protostate, dt->querylen - dt->protostate) ; @@ -236,7 +236,7 @@ static int s6dns_engine_write_tcp (s6dns_engine_t *dt, tain_t const *stamp) return (errno = EAGAIN, 1) ; } -static int s6dns_engine_read_udp (s6dns_engine_t *dt, tain_t const *stamp) +static int s6dns_engine_read_udp (s6dns_engine_t *dt, tain const *stamp) { s6dns_message_header_t h ; char buf[513] ; @@ -282,7 +282,7 @@ static int s6dns_engine_read_udp (s6dns_engine_t *dt, tain_t const *stamp) return 1 ; } -static int s6dns_engine_read_tcp (s6dns_engine_t *dt, tain_t const *stamp) +static int s6dns_engine_read_tcp (s6dns_engine_t *dt, tain const *stamp) { ssize_t r = sanitize_read(s6dns_mininetstring_read(dt->fd, &dt->sa, &dt->protostate)) ; if (r < 0) return (prepare_next(dt, stamp, 1), 0) ; @@ -336,7 +336,7 @@ void s6dns_engine_recycle (s6dns_engine_t *dt) dt->flagstrict = dt->flagtcp = dt->flagconnecting = dt->flagreading = dt->flagwriting = 0 ; } -int s6dns_engine_timeout (s6dns_engine_t *dt, tain_t const *stamp) +int s6dns_engine_timeout (s6dns_engine_t *dt, tain const *stamp) { if (!error_isagain(dt->status)) return (errno = EINVAL, -1) ; else if (tain_less(&dt->deadline, stamp)) goto yes ; @@ -358,7 +358,7 @@ int s6dns_engine_timeout (s6dns_engine_t *dt, tain_t const *stamp) return 1 ; } -int s6dns_engine_event (s6dns_engine_t *dt, tain_t const *stamp) +int s6dns_engine_event (s6dns_engine_t *dt, tain const *stamp) { if (!error_isagain(dt->status)) return (errno = EINVAL, -1) ; if (dt->flagwriting) @@ -378,7 +378,7 @@ int s6dns_engine_event (s6dns_engine_t *dt, tain_t const *stamp) return -1 ; } -int s6dns_engine_init_r (s6dns_engine_t *dt, s6dns_ip46list_t const *servers, uint32_t options, char const *q, unsigned int qlen, uint16_t qtype, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t const *stamp) +int s6dns_engine_init_r (s6dns_engine_t *dt, s6dns_ip46list_t const *servers, uint32_t options, char const *q, unsigned int qlen, uint16_t qtype, s6dns_debughook_t const *dbh, tain const *deadline, tain const *stamp) { s6dns_message_header_t h = S6DNS_MESSAGE_HEADER_ZERO ; if (!stralloc_ready(&dt->sa, qlen + 18)) return 0 ; diff --git a/src/libs6dns/s6dns_engine_nextdeadline.c b/src/libs6dns/s6dns_engine_nextdeadline.c index 09102c7..fdf76eb 100644 --- a/src/libs6dns/s6dns_engine_nextdeadline.c +++ b/src/libs6dns/s6dns_engine_nextdeadline.c @@ -3,7 +3,7 @@ #include #include -void s6dns_engine_nextdeadline (s6dns_engine_t const *dt, tain_t *deadline) +void s6dns_engine_nextdeadline (s6dns_engine_t const *dt, tain *deadline) { if (tain_less(&dt->deadline, deadline)) *deadline = dt->deadline ; if (tain_less(&dt->localdeadline, deadline)) *deadline = dt->localdeadline ; diff --git a/src/libs6dns/s6dns_message_parse.c b/src/libs6dns/s6dns_message_parse.c index 4aaee9a..4bf6d7d 100644 --- a/src/libs6dns/s6dns_message_parse.c +++ b/src/libs6dns/s6dns_message_parse.c @@ -5,7 +5,7 @@ #include #include -int s6dns_message_parse (s6dns_message_header_t *h, char const *packet, unsigned int packetlen, s6dns_message_rr_func_t_ref f, void *data) +int s6dns_message_parse (s6dns_message_header_t *h, char const *packet, unsigned int packetlen, s6dns_message_rr_func_ref f, void *data) { s6dns_message_counts_t counts ; unsigned int pos ; diff --git a/src/libs6dns/s6dns_rci_init.c b/src/libs6dns/s6dns_rci_init.c index 3a1c786..d0a9718 100644 --- a/src/libs6dns/s6dns_rci_init.c +++ b/src/libs6dns/s6dns_rci_init.c @@ -27,7 +27,7 @@ static size_t readit (char const *file, char *buf, size_t max) static inline int s6dns_rci_init_servers (s6dns_rci_t *rci, char const *file, char *tmp, size_t max, size_t *size) { - ip46_t tmplist[S6DNS_MAX_SERVERS] ; + ip46 tmplist[S6DNS_MAX_SERVERS] ; size_t num = 0 ; char const *x = getenv("DNSCACHEIP") ; if (x) ip46_scanlist(tmplist, S6DNS_MAX_SERVERS, x, &num) ; diff --git a/src/libs6dns/s6dns_resolve_core.c b/src/libs6dns/s6dns_resolve_core.c index 1c59edb..5785530 100644 --- a/src/libs6dns/s6dns_resolve_core.c +++ b/src/libs6dns/s6dns_resolve_core.c @@ -5,7 +5,7 @@ #include #include -int s6dns_resolve_core_r (s6dns_domain_t const *d, uint16_t qtype, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_core_r (s6dns_domain_t const *d, uint16_t qtype, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { if (!s6dns_engine_init_r(dt, servers, S6DNS_O_RECURSIVE, d->s, d->len, qtype, dbh, deadline, stamp)) return 0 ; if (!s6dns_resolve_loop_r(dt, deadline, stamp)) diff --git a/src/libs6dns/s6dns_resolve_dpag.c b/src/libs6dns/s6dns_resolve_dpag.c index d77890d..98c5f9b 100644 --- a/src/libs6dns/s6dns_resolve_dpag.c +++ b/src/libs6dns/s6dns_resolve_dpag.c @@ -2,7 +2,7 @@ #include -int s6dns_resolve_dpag_r (genalloc *ds, char const *name, unsigned int len, uint16_t qtype, int qualif, s6dns_engine_t *dt, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_dpag_r (genalloc *ds, char const *name, unsigned int len, uint16_t qtype, int qualif, s6dns_engine_t *dt, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_dpag_t data ; int r ; diff --git a/src/libs6dns/s6dns_resolve_mpag.c b/src/libs6dns/s6dns_resolve_mpag.c index 98282f3..6daa45c 100644 --- a/src/libs6dns/s6dns_resolve_mpag.c +++ b/src/libs6dns/s6dns_resolve_mpag.c @@ -2,7 +2,7 @@ #include -int s6dns_resolve_mpag_r (stralloc *sa, genalloc *offsets, char const *name, unsigned int len, uint16_t qtype, s6dns_message_rr_func_t_ref parsefunc, int qualif, s6dns_engine_t *dt, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_mpag_r (stralloc *sa, genalloc *offsets, char const *name, unsigned int len, uint16_t qtype, s6dns_message_rr_func_ref parsefunc, int qualif, s6dns_engine_t *dt, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_mpag_t data ; int r ; diff --git a/src/libs6dns/s6dns_resolve_name4.c b/src/libs6dns/s6dns_resolve_name4.c index a7d9cae..34f1eef 100644 --- a/src/libs6dns/s6dns_resolve_name4.c +++ b/src/libs6dns/s6dns_resolve_name4.c @@ -4,7 +4,7 @@ #include #include -int s6dns_resolve_name4_r (genalloc *list, char const *ip, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_name4_r (genalloc *list, char const *ip, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_dpag_t data ; s6dns_domain_t d ; diff --git a/src/libs6dns/s6dns_resolve_name6.c b/src/libs6dns/s6dns_resolve_name6.c index 6fd1ce5..b1bcfa1 100644 --- a/src/libs6dns/s6dns_resolve_name6.c +++ b/src/libs6dns/s6dns_resolve_name6.c @@ -4,7 +4,7 @@ #include #include -int s6dns_resolve_name6_r (genalloc *list, char const *ip, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_name6_r (genalloc *list, char const *ip, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_dpag_t data ; s6dns_domain_t d ; diff --git a/src/libs6dns/s6dns_resolve_parse.c b/src/libs6dns/s6dns_resolve_parse.c index b3ecaea..29d78f7 100644 --- a/src/libs6dns/s6dns_resolve_parse.c +++ b/src/libs6dns/s6dns_resolve_parse.c @@ -4,7 +4,7 @@ #include #include -int s6dns_resolve_parse_r (s6dns_domain_t const *d, uint16_t qtype, s6dns_message_rr_func_t_ref parsefunc, void *data, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolve_parse_r (s6dns_domain_t const *d, uint16_t qtype, s6dns_message_rr_func_ref parsefunc, void *data, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { int r ; if (!s6dns_resolve_core_r(d, qtype, dt, servers, dbh, deadline, stamp)) return -1 ; diff --git a/src/libs6dns/s6dns_resolven_loop.c b/src/libs6dns/s6dns_resolven_loop.c index 2cc5da0..bfbda18 100644 --- a/src/libs6dns/s6dns_resolven_loop.c +++ b/src/libs6dns/s6dns_resolven_loop.c @@ -11,14 +11,14 @@ It resolves n dts at the same time. */ -int s6dns_resolven_loop (s6dns_engine_t *dt, unsigned int n, unsigned int or, tain_t const *deadline, tain_t *stamp) +int s6dns_resolven_loop (s6dns_engine_t *dt, unsigned int n, unsigned int or, tain const *deadline, tain *stamp) { iopause_fd x[n] ; unsigned int count = 0 ; unsigned int got = 0 ; while (got < n) { - tain_t localdeadline = *deadline ; + tain localdeadline = *deadline ; int r ; unsigned int i = 0 ; unsigned int j = 0 ; diff --git a/src/libs6dns/s6dns_resolven_parse.c b/src/libs6dns/s6dns_resolven_parse.c index d8b7435..7381e87 100644 --- a/src/libs6dns/s6dns_resolven_parse.c +++ b/src/libs6dns/s6dns_resolven_parse.c @@ -5,7 +5,7 @@ #include #include -int s6dns_resolven_parse_r (s6dns_resolve_t *list, unsigned int n, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolven_parse_r (s6dns_resolve_t *list, unsigned int n, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_engine_t dtl[n] ; unsigned int i = 0 ; diff --git a/src/libs6dns/s6dns_resolvenoq.c b/src/libs6dns/s6dns_resolvenoq.c index f5fc56b..b2b9eaf 100644 --- a/src/libs6dns/s6dns_resolvenoq.c +++ b/src/libs6dns/s6dns_resolvenoq.c @@ -3,7 +3,7 @@ #include #include -int s6dns_resolvenoq_r (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_t_ref parsefunc, void *data, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolvenoq_r (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_ref parsefunc, void *data, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_domain_t d ; if (!s6dns_domain_fromstring_noqualify_encode(&d, name, len)) return -1 ; diff --git a/src/libs6dns/s6dns_resolvenoq_aaaaa.c b/src/libs6dns/s6dns_resolvenoq_aaaaa.c index 378a70a..7069304 100644 --- a/src/libs6dns/s6dns_resolvenoq_aaaaa.c +++ b/src/libs6dns/s6dns_resolvenoq_aaaaa.c @@ -11,7 +11,7 @@ #include #include -int s6dns_resolvenoq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolvenoq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { stralloc sa[2] = { STRALLOC_ZERO, STRALLOC_ZERO } ; s6dns_resolve_t blob[2] ; @@ -33,7 +33,7 @@ int s6dns_resolvenoq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns errno = blob[1].status ? blob[1].status : blob[0].status ; return 0 ; } - if (!genalloc_readyplus(ip46full_t, ips, (sa[0].len >> 4) + (sa[1].len >> 2))) + if (!genalloc_readyplus(ip46full, ips, (sa[0].len >> 4) + (sa[1].len >> 2))) { stralloc_free(&sa[0]) ; stralloc_free(&sa[1]) ; @@ -41,15 +41,15 @@ int s6dns_resolvenoq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns } { int e = (!!sa[0].len << 1) | !!sa[1].len ; - size_t n = genalloc_len(ip46full_t, ips) ; + size_t n = genalloc_len(ip46full, ips) ; size_t i = 0 ; for (; i < (sa[0].len >> 4) ; i++) - ip46full_from_ip6(genalloc_s(ip46full_t, ips) + n + i, sa[0].s + (i << 4)) ; + ip46full_from_ip6(genalloc_s(ip46full, ips) + n + i, sa[0].s + (i << 4)) ; n += i ; for (i = 0 ; i < (sa[1].len >> 2) ; i++) - ip46full_from_ip4(genalloc_s(ip46full_t, ips) + n + i, sa[1].s + (i << 2)) ; + ip46full_from_ip4(genalloc_s(ip46full, ips) + n + i, sa[1].s + (i << 2)) ; n += i ; - genalloc_setlen(ip46full_t, ips, n) ; + genalloc_setlen(ip46full, ips, n) ; stralloc_free(&sa[0]) ; stralloc_free(&sa[1]) ; return e ; diff --git a/src/libs6dns/s6dns_resolveq.c b/src/libs6dns/s6dns_resolveq.c index 3c1d22c..dbb3fc3 100644 --- a/src/libs6dns/s6dns_resolveq.c +++ b/src/libs6dns/s6dns_resolveq.c @@ -9,7 +9,7 @@ #include #include -int s6dns_resolveq_r (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_t_ref parsefunc, void *data, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolveq_r (char const *name, size_t len, uint16_t qtype, s6dns_message_rr_func_ref parsefunc, void *data, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_engine_t dtl[rci->rulesnum] ; unsigned int best = 0 ; diff --git a/src/libs6dns/s6dns_resolveq_aaaaa.c b/src/libs6dns/s6dns_resolveq_aaaaa.c index fe564ae..73e5966 100644 --- a/src/libs6dns/s6dns_resolveq_aaaaa.c +++ b/src/libs6dns/s6dns_resolveq_aaaaa.c @@ -15,19 +15,19 @@ static int addit (genalloc *ips, char const *s, size_t len, int is6) { - size_t base = genalloc_len(ip46full_t, ips) ; + size_t base = genalloc_len(ip46full, ips) ; size_t n = len >> (is6 ? 4 : 2) ; - ip46full_t *p ; - if (!genalloc_readyplus(ip46full_t, ips, n)) return 0 ; - p = genalloc_s(ip46full_t, ips) + base ; + ip46full *p ; + if (!genalloc_readyplus(ip46full, ips, n)) return 0 ; + p = genalloc_s(ip46full, ips) + base ; for (size_t i = 0 ; i < n ; i++) if (is6) ip46full_from_ip6(p + i, s + (i << 4)) ; else ip46full_from_ip4(p + i, s + (i << 2)) ; - genalloc_setlen(ip46full_t, ips, base + n) ; + genalloc_setlen(ip46full, ips, base + n) ; return 1 ; } -int s6dns_resolveq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp) +int s6dns_resolveq_aaaaa_r (genalloc *ips, char const *name, size_t len, s6dns_rci_t const *rci, s6dns_debughook_t const *dbh, tain const *deadline, tain *stamp) { s6dns_engine_t dtl[rci->rulesnum << 1] ; stralloc data = STRALLOC_ZERO ; diff --git a/src/skadns/skadns_cancel.c b/src/skadns/skadns_cancel.c index c5062f6..3b8eff6 100644 --- a/src/skadns/skadns_cancel.c +++ b/src/skadns/skadns_cancel.c @@ -12,7 +12,7 @@ #include #include -int skadns_cancel (skadns_t *a, uint16_t id, tain_t const *deadline, tain_t *stamp) +int skadns_cancel (skadns_t *a, uint16_t id, tain const *deadline, tain *stamp) { int e = errno ; char pack[3] = "--q" ; diff --git a/src/skadns/skadns_send.c b/src/skadns/skadns_send.c index 69f533f..c4769e0 100644 --- a/src/skadns/skadns_send.c +++ b/src/skadns/skadns_send.c @@ -10,7 +10,7 @@ #include -int skadns_send (skadns_t *a, uint16_t *u, s6dns_domain_t const *d, uint16_t qtype, tain_t const *limit, tain_t const *deadline, tain_t *stamp) +int skadns_send (skadns_t *a, uint16_t *u, s6dns_domain_t const *d, uint16_t qtype, tain const *limit, tain const *deadline, tain *stamp) { static skadnsanswer_t const skadnsanswer_initial = { .status = EAGAIN, .data = 0, .len = 0 } ; uint32_t i ; diff --git a/src/skadns/skadns_start.c b/src/skadns/skadns_start.c index dbb7f63..0c67a77 100644 --- a/src/skadns/skadns_start.c +++ b/src/skadns/skadns_start.c @@ -3,7 +3,7 @@ #include #include -int skadns_start (skadns_t *a, char const *path, tain_t const *deadline, tain_t *stamp) +int skadns_start (skadns_t *a, char const *path, tain const *deadline, tain *stamp) { return textclient_start(&a->connection, path, 0, SKADNS_BANNER1, SKADNS_BANNER1_LEN, SKADNS_BANNER2, SKADNS_BANNER2_LEN, deadline, stamp) ; } diff --git a/src/skadns/skadns_startf.c b/src/skadns/skadns_startf.c index 29c44bf..bf20edd 100644 --- a/src/skadns/skadns_startf.c +++ b/src/skadns/skadns_startf.c @@ -4,7 +4,7 @@ #include #include -int skadns_startf (skadns_t *a, tain_t const *deadline, tain_t *stamp) +int skadns_startf (skadns_t *a, tain const *deadline, tain *stamp) { static char const *const cargv[2] = { SKADNSD_PROG, 0 } ; return textclient_startf(&a->connection, cargv, (char const *const *)environ, TEXTCLIENT_OPTION_WAITPID, SKADNS_BANNER1, SKADNS_BANNER1_LEN, SKADNS_BANNER2, SKADNS_BANNER2_LEN, deadline, stamp) ; diff --git a/src/skadns/skadnsd.c b/src/skadns/skadnsd.c index 7711bc1..c405574 100644 --- a/src/skadns/skadnsd.c +++ b/src/skadns/skadnsd.c @@ -64,7 +64,7 @@ static int parse_protocol (struct iovec const *v, void *context) { case 'Q' : /* send a query */ { - tain_t limit ; + tain limit ; uint16_t qtype ; if (v->iov_len < 21) strerr_dief1x(100, "invalid client request") ; if (sp >= SKADNS_MAXCONCURRENCY) @@ -116,7 +116,7 @@ int main (void) if (!s6dns_init()) strerr_diefu1sys(111, "s6dns_init") ; { - tain_t deadline ; + tain deadline ; tain_addsec_g(&deadline, 2) ; if (!textclient_server_01x_init_g(SKADNS_BANNER1, SKADNS_BANNER1_LEN, SKADNS_BANNER2, SKADNS_BANNER2_LEN, &deadline)) strerr_diefu1sys(111, "sync with client") ; @@ -137,7 +137,7 @@ int main (void) x[2].fd = textmessage_sender_fd(textmessage_sender_x) ; x[2].events = IOPAUSE_EXCEPT | (textmessage_sender_isempty(textmessage_sender_x) ? 0 : IOPAUSE_WRITE) ; { - tain_t deadline = TAIN_INFINITE ; + tain deadline = TAIN_INFINITE ; unsigned int i = 0 ; for (; i < sp ; i++) { -- cgit v1.2.3