From 7a0f84ec90d6a7167e0be9de80b891596fa0c262 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 10 Dec 2014 09:20:01 +0000 Subject: Compiling bugfixes, small doc update --- doc/libresolv.html | 13 ++++++------- package/deps.mak | 12 +++++++----- src/clients/s6-dnsname.c | 5 +++-- src/clients/s6dns_namescanner.c | 2 +- src/include/s6-dns/s6dns-rci.h | 6 +++--- src/include/s6-dns/s6dns-resolve.h | 12 ++++++------ src/include/s6-dns/skadns.h | 3 --- src/libs6dns/s6dns_analyze_packet.c | 2 +- src/libs6dns/s6dns_constants_error_str.c | 2 +- src/libs6dns/s6dns_engine.c | 2 +- src/libs6dns/s6dns_message_get_domain.c | 2 +- src/skadns/skadns_send.c | 2 +- src/skadns/skadns_update.c | 2 +- src/skadns/skadnsd.c | 4 ++-- 14 files changed, 34 insertions(+), 35 deletions(-) diff --git a/doc/libresolv.html b/doc/libresolv.html index 7a9fd31..8ae2438 100644 --- a/doc/libresolv.html +++ b/doc/libresolv.html @@ -78,13 +78,12 @@ resolution of several queries at once, and to a

It is too big for what it does.

- The libresolv-2.13.so binary file compiled for an i386 -Debian Linux system is roughly 71k bytes. The libs6dns.so.2.0 -file, for the same system, is roughly 41k bytes, while offering -more functionality. libresolv does not do any high-level answer -parsing, so the user still has to do some work after the libresolv -calls. s6-dns tries to be small and still provide the user comfortable -interfaces. + The libresolv-2.13.so binary file compiled for an x86_64 +Debian Linux system is roughly 79k bytes. The libs6dns.so.2.0 +file, for the same system, is roughly the same size, while offering +more functionality: high-level answer parsing, user-friendly +formatting, and in-depth tracing of the DNS resolution process. +What is all that code in libresolv for ?

The API is cumbersome to use.

diff --git a/package/deps.mak b/package/deps.mak index e298f1b..50e5272 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -8,6 +8,8 @@ src/include/s6-dns/s6dns-engine.h: src/include/s6-dns/s6dns-constants.h src/incl src/include/s6-dns/s6dns-fmt.h: src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h src/include/s6-dns/s6dns-ip46.h: src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-message.h: src/include/s6-dns/s6dns-domain.h +src/include/s6-dns/s6dns-rci.h: src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-ip46.h +src/include/s6-dns/s6dns-resolve.h: src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-engine.h src/include/s6-dns/s6dns-ip46.h src/include/s6-dns/s6dns-message.h src/include/s6-dns/s6dns-rci.h src/include/s6-dns/s6dns.h: src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-engine.h src/include/s6-dns/s6dns-fmt.h src/include/s6-dns/s6dns-ip46.h src/include/s6-dns/s6dns-message.h src/include/s6-dns/s6dns-rci.h src/include/s6-dns/s6dns-resolve.h src/include/s6-dns/skadns.h: src/include/s6-dns/config.h src/include/s6-dns/s6dns-domain.h src/clients/s6dns-generic-filter.h: src/include/s6-dns/s6dns-domain.h @@ -17,7 +19,7 @@ src/clients/s6-dnsip6-filter.o src/clients/s6-dnsip6-filter.lo: src/clients/s6-d src/clients/s6-dnsip6.o src/clients/s6-dnsip6.lo: src/clients/s6-dnsip6.c src/include/s6-dns/s6dns.h src/clients/s6-dnsmx.o src/clients/s6-dnsmx.lo: src/clients/s6-dnsmx.c src/include/s6-dns/s6dns.h src/clients/s6-dnsname-filter.o src/clients/s6-dnsname-filter.lo: src/clients/s6-dnsname-filter.c src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h src/clients/s6dns-generic-filter.h -src/clients/s6-dnsname.o src/clients/s6-dnsname.lo: src/clients/s6-dnsname.c +src/clients/s6-dnsname.o src/clients/s6-dnsname.lo: src/clients/s6-dnsname.c src/include/s6-dns/s6dns.h src/clients/s6-dnsns.o src/clients/s6-dnsns.lo: src/clients/s6-dnsns.c src/include/s6-dns/s6dns.h src/clients/s6-dnsq.o src/clients/s6-dnsq.lo: src/clients/s6-dnsq.c src/include/s6-dns/s6dns-analyze.h src/include/s6-dns/s6dns-debug.h src/include/s6-dns/s6dns.h src/clients/s6-dnsqr.o src/clients/s6-dnsqr.lo: src/clients/s6-dnsqr.c src/include/s6-dns/s6dns-analyze.h src/include/s6-dns/s6dns-debug.h src/include/s6-dns/s6dns.h @@ -27,7 +29,7 @@ src/clients/s6-dnssrv.o src/clients/s6-dnssrv.lo: src/clients/s6-dnssrv.c src/in src/clients/s6-dnstxt.o src/clients/s6-dnstxt.lo: src/clients/s6-dnstxt.c src/include/s6-dns/s6dns.h src/clients/s6-randomip.o src/clients/s6-randomip.lo: src/clients/s6-randomip.c src/clients/s6dns_generic_filter_main.o src/clients/s6dns_generic_filter_main.lo: src/clients/s6dns_generic_filter_main.c src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/skadns.h src/clients/s6dns-generic-filter.h -src/clients/s6dns_namescanner.o src/clients/s6dns_namescanner.lo: src/clients/s6dns_namescanner.c src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-generic-filter.h +src/clients/s6dns_namescanner.o src/clients/s6dns_namescanner.lo: src/clients/s6dns_namescanner.c src/include/s6-dns/s6dns-domain.h src/clients/s6dns-generic-filter.h src/libs6dns/s6dns_analyze_packet.o src/libs6dns/s6dns_analyze_packet.lo: src/libs6dns/s6dns_analyze_packet.c src/include/s6-dns/s6dns-analyze.h src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns_analyze_qtype_parse.o src/libs6dns/s6dns_analyze_qtype_parse.lo: src/libs6dns/s6dns_analyze_qtype_parse.c src/include/s6-dns/s6dns-analyze.h src/include/s6-dns/s6dns-constants.h src/libs6dns/s6dns_analyze_record.o src/libs6dns/s6dns_analyze_record.lo: src/libs6dns/s6dns_analyze_record.c src/include/s6-dns/s6dns-analyze.h src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h @@ -60,7 +62,7 @@ src/libs6dns/s6dns_domain_fromstring_qualify_encode.o src/libs6dns/s6dns_domain_ src/libs6dns/s6dns_domain_noqualify.o src/libs6dns/s6dns_domain_noqualify.lo: src/libs6dns/s6dns_domain_noqualify.c src/include/s6-dns/s6dns-domain.h src/libs6dns/s6dns_domain_qualify.o src/libs6dns/s6dns_domain_qualify.lo: src/libs6dns/s6dns_domain_qualify.c src/include/s6-dns/s6dns-domain.h src/libs6dns/s6dns_domain_tostring.o src/libs6dns/s6dns_domain_tostring.lo: src/libs6dns/s6dns_domain_tostring.c src/include/s6-dns/s6dns-domain.h -src/libs6dns/s6dns_engine.o src/libs6dns/s6dns_engine.lo: src/libs6dns/s6dns_engine.c src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-engine.h src/include/s6-dns/s6dns-message-internal.h src/include/s6-dns/s6dns-message.h +src/libs6dns/s6dns_engine.o src/libs6dns/s6dns_engine.lo: src/libs6dns/s6dns_engine.c src/include/s6-dns/s6dns-constants.h src/include/s6-dns/s6dns-engine.h src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns-message-internal.h src/libs6dns/s6dns_engine_free.o src/libs6dns/s6dns_engine_free.lo: src/libs6dns/s6dns_engine_free.c src/include/s6-dns/s6dns-engine.h src/libs6dns/s6dns_engine_freen.o src/libs6dns/s6dns_engine_freen.lo: src/libs6dns/s6dns_engine_freen.c src/include/s6-dns/s6dns-engine.h src/libs6dns/s6dns_engine_here.o src/libs6dns/s6dns_engine_here.lo: src/libs6dns/s6dns_engine_here.c src/include/s6-dns/s6dns-engine.h @@ -75,7 +77,7 @@ src/libs6dns/s6dns_message_counts_next.o src/libs6dns/s6dns_message_counts_next. src/libs6dns/s6dns_message_counts_pack.o src/libs6dns/s6dns_message_counts_pack.lo: src/libs6dns/s6dns_message_counts_pack.c src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns_message_counts_unpack.o src/libs6dns/s6dns_message_counts_unpack.lo: src/libs6dns/s6dns_message_counts_unpack.c src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns_message_counts_zero.o src/libs6dns/s6dns_message_counts_zero.lo: src/libs6dns/s6dns_message_counts_zero.c src/include/s6-dns/s6dns-message.h -src/libs6dns/s6dns_message_get_domain.o src/libs6dns/s6dns_message_get_domain.lo: src/libs6dns/s6dns_message_get_domain.c src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message-internal.h src/include/s6-dns/s6dns-message.h +src/libs6dns/s6dns_message_get_domain.o src/libs6dns/s6dns_message_get_domain.lo: src/libs6dns/s6dns_message_get_domain.c src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns-message-internal.h src/libs6dns/s6dns_message_get_domain_internal.o src/libs6dns/s6dns_message_get_domain_internal.lo: src/libs6dns/s6dns_message_get_domain_internal.c src/libs6dns/s6dns-message-internal.h src/libs6dns/s6dns_message_get_hinfo.o src/libs6dns/s6dns_message_get_hinfo.lo: src/libs6dns/s6dns_message_get_hinfo.c src/include/s6-dns/s6dns-message.h src/libs6dns/s6dns_message_get_mx.o src/libs6dns/s6dns_message_get_mx.lo: src/libs6dns/s6dns_message_get_mx.c src/include/s6-dns/s6dns-domain.h src/include/s6-dns/s6dns-message.h @@ -124,7 +126,7 @@ src/skadns/skadns_release.o src/skadns/skadns_release.lo: src/skadns/skadns_rele src/skadns/skadns_send.o src/skadns/skadns_send.lo: src/skadns/skadns_send.c src/include/s6-dns/s6dns-domain.h src/include/s6-dns/skadns.h src/skadns/skadns_start.o src/skadns/skadns_start.lo: src/skadns/skadns_start.c src/include/s6-dns/skadns.h src/skadns/skadns_startf.o src/skadns/skadns_startf.lo: src/skadns/skadns_startf.c src/include/s6-dns/skadns.h -src/skadns/skadns_update.o src/skadns/skadns_update.lo: src/skadns/skadns_update.c +src/skadns/skadns_update.o src/skadns/skadns_update.lo: src/skadns/skadns_update.c src/include/s6-dns/skadns.h src/skadns/skadns_zero.o src/skadns/skadns_zero.lo: src/skadns/skadns_zero.c src/include/s6-dns/skadns.h src/skadns/skadnsd.o src/skadns/skadnsd.lo: src/skadns/skadnsd.c src/include/s6-dns/s6dns.h src/include/s6-dns/skadns.h diff --git a/src/clients/s6-dnsname.c b/src/clients/s6-dnsname.c index d65da3a..fe5ab9a 100644 --- a/src/clients/s6-dnsname.c +++ b/src/clients/s6-dnsname.c @@ -1,6 +1,7 @@ /* ISC license. */ #include +#include #include #include #include @@ -9,7 +10,7 @@ #include #include #include -#include +#include #define USAGE "s6-dnsname [ -4 | -6 ] [ -r ] [ -t timeout ] ip" #define dieusage() strerr_dieusage(100, USAGE) @@ -66,7 +67,7 @@ int main (int argc, char const *const *argv) char buf[S6DNS_FMT_DOMAINLIST(genalloc_len(s6dns_domain_t, &ds))] ; unsigned int len = s6dns_fmt_domainlist(buf, S6DNS_FMT_DOMAINLIST(genalloc_len(s6dns_domain_t, &ds)), genalloc_s(s6dns_domain_t, &ds), genalloc_len(s6dns_domain_t, &ds), "\n", 1) ; if (!len) strerr_diefu1sys(111, "format result") ; - if (buffer_putalign(buffer_1, buf, len) < 0) goto err ; + if (buffer_put(buffer_1, buf, len) < 0) goto err ; } if (buffer_putflush(buffer_1, "\n", 1) < 0) goto err ; return 0 ; diff --git a/src/clients/s6dns_namescanner.c b/src/clients/s6dns_namescanner.c index b23fb3d..136b1e8 100644 --- a/src/clients/s6dns_namescanner.c +++ b/src/clients/s6dns_namescanner.c @@ -1,7 +1,7 @@ /* ISC license. */ #include -#include +#include "s6dns-generic-filter.h" unsigned int s6dns_namescanner (s6dns_domain_t *d, char const *s) { diff --git a/src/include/s6-dns/s6dns-rci.h b/src/include/s6-dns/s6dns-rci.h index 5822a71..326e029 100644 --- a/src/include/s6-dns/s6dns-rci.h +++ b/src/include/s6-dns/s6dns-rci.h @@ -4,9 +4,9 @@ #define S6DNS_RCI_H #include -#include -#include -#include +#include +#include +#include /* rci: resolv.conf information */ diff --git a/src/include/s6-dns/s6dns-resolve.h b/src/include/s6-dns/s6dns-resolve.h index d188a67..e7eb629 100644 --- a/src/include/s6-dns/s6dns-resolve.h +++ b/src/include/s6-dns/s6dns-resolve.h @@ -10,12 +10,12 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include /* Synchronous DNS resolution primitives. diff --git a/src/include/s6-dns/skadns.h b/src/include/s6-dns/skadns.h index d5ed82f..b58363a 100644 --- a/src/include/s6-dns/skadns.h +++ b/src/include/s6-dns/skadns.h @@ -4,11 +4,8 @@ #define SKADNS_H #include -#include #include -#include #include -#include #include #include #include diff --git a/src/libs6dns/s6dns_analyze_packet.c b/src/libs6dns/s6dns_analyze_packet.c index 57a5ce5..8932ab3 100644 --- a/src/libs6dns/s6dns_analyze_packet.c +++ b/src/libs6dns/s6dns_analyze_packet.c @@ -3,9 +3,9 @@ #include #include #include +#include #include #include -#include #include #include #include diff --git a/src/libs6dns/s6dns_constants_error_str.c b/src/libs6dns/s6dns_constants_error_str.c index 9dda1a7..6d477c2 100644 --- a/src/libs6dns/s6dns_constants_error_str.c +++ b/src/libs6dns/s6dns_constants_error_str.c @@ -5,7 +5,7 @@ char const *s6dns_constants_error_str (int e) { - s6dns_constants_error_message_t *p = s6dns_constants_error ; + s6dns_constants_error_message_t const *p = s6dns_constants_error ; while ((p->num != e) && (p->num != -1)) p++ ; return p->num == -1 ? error_str(e) : p->string ; } diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c index 4145ef7..207069e 100644 --- a/src/libs6dns/s6dns_engine.c +++ b/src/libs6dns/s6dns_engine.c @@ -14,9 +14,9 @@ #include #include #include -#include #include #include +#include "s6dns-message-internal.h" /* Utility functions */ diff --git a/src/libs6dns/s6dns_message_get_domain.c b/src/libs6dns/s6dns_message_get_domain.c index b51adb5..7d2cfc6 100644 --- a/src/libs6dns/s6dns_message_get_domain.c +++ b/src/libs6dns/s6dns_message_get_domain.c @@ -1,8 +1,8 @@ /* ISC license. */ #include -#include #include +#include "s6dns-message-internal.h" int s6dns_message_get_domain (s6dns_domain_t *d, char const *packet, unsigned int packetlen, unsigned int *pos) { diff --git a/src/skadns/skadns_send.c b/src/skadns/skadns_send.c index 7ee04c7..f8152b7 100644 --- a/src/skadns/skadns_send.c +++ b/src/skadns/skadns_send.c @@ -18,7 +18,7 @@ int skadns_send (skadns_t *a, uint16 *u, s6dns_domain_t const *d, uint16 qtype, unsigned int i ; char tmp[17] = "--Q" ; char err ; - siovec_t v[2] = { { .s = tmp, .len = 17 }, { .s = d->s, .len = d->len } } ; + siovec_t v[2] = { { .s = tmp, .len = 17 }, { .s = (char *)d->s, .len = d->len } } ; if (!gensetdyn_new(&a->q, &i)) return 0 ; uint16_pack_big(tmp, (uint16)i) ; uint16_pack_big(tmp + 3, qtype) ; diff --git a/src/skadns/skadns_update.c b/src/skadns/skadns_update.c index 50f3611..3a86b57 100644 --- a/src/skadns/skadns_update.c +++ b/src/skadns/skadns_update.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include static int msghandler (unixmessage_t const *m, void *context) { diff --git a/src/skadns/skadnsd.c b/src/skadns/skadnsd.c index 7b5419f..473ed1a 100644 --- a/src/skadns/skadnsd.c +++ b/src/skadns/skadnsd.c @@ -37,7 +37,7 @@ static void remove (unsigned int i) static void fail (unsigned int i) { char pack[3] ; - unixmessage_t m = { .s = pack, len = 3, .fds = 0, .nfds = 0 } ; + unixmessage_t m = { .s = pack, .len = 3, .fds = 0, .nfds = 0 } ; uint16_pack_big(pack, a[i].id) ; pack[2] = a[i].dt.status ; s6dns_engine_recycle(&a[i].dt) ; @@ -178,7 +178,7 @@ int main (void) unixmessage_v_t mv = { .v = v, .vlen = 2, .fds = 0, .nfds = 0 } ; uint16_pack_big(pack, a[i].id) ; pack[2] = 0 ; - if (!unixmessage_putv(unixmessage_sender_x, v, 2)) + if (!unixmessage_putv(unixmessage_sender_x, &mv)) strerr_diefu1sys(111, "unixmessage_put") ; s6dns_engine_recycle(&a[i].dt) ; remove(i--) ; -- cgit v1.2.3