diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2019-02-20 11:35:14 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2019-02-20 11:35:14 +0000 |
commit | 78585c170875e78fe58fd80ea74916dd41e25bb9 (patch) | |
tree | ee33d05d9b34f1a79936d16a0a2978fc58bf5131 /src/libs6dns | |
parent | 64e1ab114e6fcf5e8405fb579f3ce71a5f146b28 (diff) | |
download | s6-dns-78585c170875e78fe58fd80ea74916dd41e25bb9.tar.xz |
Adapt to skalibs/posixishard.h
Diffstat (limited to 'src/libs6dns')
27 files changed, 81 insertions, 37 deletions
diff --git a/src/libs6dns/s6dns_analyze_packet.c b/src/libs6dns/s6dns_analyze_packet.c index facd498..24c2326 100644 --- a/src/libs6dns/s6dns_analyze_packet.c +++ b/src/libs6dns/s6dns_analyze_packet.c @@ -3,8 +3,10 @@ #include <string.h> #include <stdint.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/types.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-domain.h> #include <s6-dns/s6dns-message.h> diff --git a/src/libs6dns/s6dns_analyze_record_a.c b/src/libs6dns/s6dns_analyze_record_a.c index 214c348..41ceee7 100644 --- a/src/libs6dns/s6dns_analyze_record_a.c +++ b/src/libs6dns/s6dns_analyze_record_a.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/fmtscan.h> + #include <s6-dns/s6dns-analyze.h> int s6dns_analyze_record_a (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) diff --git a/src/libs6dns/s6dns_analyze_record_aaaa.c b/src/libs6dns/s6dns_analyze_record_aaaa.c index e28e8bc..e60e279 100644 --- a/src/libs6dns/s6dns_analyze_record_aaaa.c +++ b/src/libs6dns/s6dns_analyze_record_aaaa.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/fmtscan.h> + #include <s6-dns/s6dns-analyze.h> int s6dns_analyze_record_aaaa (genwrite_t *gp, s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos) diff --git a/src/libs6dns/s6dns_analyze_record_caa.c b/src/libs6dns/s6dns_analyze_record_caa.c index fa8ab91..076f04b 100644 --- a/src/libs6dns/s6dns_analyze_record_caa.c +++ b/src/libs6dns/s6dns_analyze_record_caa.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_analyze_record_domain.c b/src/libs6dns/s6dns_analyze_record_domain.c index ca77f1f..a14dd98 100644 --- a/src/libs6dns/s6dns_analyze_record_domain.c +++ b/src/libs6dns/s6dns_analyze_record_domain.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-domain.h> #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> diff --git a/src/libs6dns/s6dns_analyze_record_hinfo.c b/src/libs6dns/s6dns_analyze_record_hinfo.c index d38c657..d8e36b2 100644 --- a/src/libs6dns/s6dns_analyze_record_hinfo.c +++ b/src/libs6dns/s6dns_analyze_record_hinfo.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_analyze_record_mx.c b/src/libs6dns/s6dns_analyze_record_mx.c index 7aeca5d..ab09c1a 100644 --- a/src/libs6dns/s6dns_analyze_record_mx.c +++ b/src/libs6dns/s6dns_analyze_record_mx.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_analyze_record_soa.c b/src/libs6dns/s6dns_analyze_record_soa.c index ed04ca8..7f9d4f6 100644 --- a/src/libs6dns/s6dns_analyze_record_soa.c +++ b/src/libs6dns/s6dns_analyze_record_soa.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_analyze_record_srv.c b/src/libs6dns/s6dns_analyze_record_srv.c index 024825b..9af1b49 100644 --- a/src/libs6dns/s6dns_analyze_record_srv.c +++ b/src/libs6dns/s6dns_analyze_record_srv.c @@ -2,7 +2,9 @@ #include <sys/types.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-fmt.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_analyze_record_strings.c b/src/libs6dns/s6dns_analyze_record_strings.c index 9baa42a..f6f4c85 100644 --- a/src/libs6dns/s6dns_analyze_record_strings.c +++ b/src/libs6dns/s6dns_analyze_record_strings.c @@ -1,9 +1,11 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/stralloc.h> #include <skalibs/skamisc.h> + #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-analyze.h> diff --git a/src/libs6dns/s6dns_constants_error.c b/src/libs6dns/s6dns_constants_error.c index 68a8b4d..6b58ffc 100644 --- a/src/libs6dns/s6dns_constants_error.c +++ b/src/libs6dns/s6dns_constants_error.c @@ -1,7 +1,9 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-constants.h> static s6dns_constants_error_message_t const array[] = diff --git a/src/libs6dns/s6dns_domain_decode.c b/src/libs6dns/s6dns_domain_decode.c index 440f672..6fea0d6 100644 --- a/src/libs6dns/s6dns_domain_decode.c +++ b/src/libs6dns/s6dns_domain_decode.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/bytestr.h> + #include <s6-dns/s6dns-domain.h> static inline unsigned int s6dns_domain_label_decode (char *s, unsigned int max) diff --git a/src/libs6dns/s6dns_engine.c b/src/libs6dns/s6dns_engine.c index 0057b14..a07b1dc 100644 --- a/src/libs6dns/s6dns_engine.c +++ b/src/libs6dns/s6dns_engine.c @@ -5,6 +5,8 @@ #include <strings.h> #include <stdint.h> #include <errno.h> + +#include <skalibs/posixishard.h> #include <skalibs/uint16.h> #include <skalibs/allreadwrite.h> #include <skalibs/error.h> @@ -14,7 +16,7 @@ #include <skalibs/djbunix.h> #include <skalibs/ip46.h> #include <skalibs/random.h> -#include <skalibs/lolstdio.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-message.h> #include <s6-dns/s6dns-engine.h> @@ -33,32 +35,22 @@ static int relevant (char const *q, unsigned int qlen, char const *ans, unsigned { s6dns_message_header_t h ; uint16_t id ; - LOLDEBUG("entering relevant()") ; s6dns_message_header_unpack(ans, &h) ; - LOLDEBUG(" answer qr = %u, opcode = %u, z = %u, qd = %u", h.qr, h.opcode, h.z, h.counts.qd) ; if (!h.qr || h.opcode || h.z || (h.counts.qd != 1)) return 0 ; - LOLDEBUG(" testing answer rd") ; if (h.rd != (q[2] & 1)) return 0 ; - LOLDEBUG(" if strict(%d), testing h.aa and query rd", strict) ; if (strict && !h.aa && !(q[2] & 1)) return 0 ; uint16_unpack_big(q, &id) ; - LOLDEBUG(" testing answer id") ; if (id != h.id) return 0 ; } { char buf[255] ; unsigned int pos = 12 ; unsigned int n = s6dns_message_get_domain_internal(buf, 255, ans, anslen, &pos) ; - LOLDEBUG(" testing return from s6dns_message_get_domain_internal()") ; if (!n) return -1 ; - LOLDEBUG(" testing that pos+4 <= anslen") ; if (pos + 4 > anslen) return (errno = EPROTO, -1) ; - LOLDEBUG(" testing answer domain against query") ; if (qdomain_diff(buf, n, q + 12, qlen - 16)) return 0 ; - LOLDEBUG(" testing answer qclass and qtype against query" ) ; if (memcmp(q + qlen - 4, ans + pos, 4)) return 0 ; } - LOLDEBUG("relevant() returns 1") ; return 1 ; } diff --git a/src/libs6dns/s6dns_message_get_caa.c b/src/libs6dns/s6dns_message_get_caa.c index a97b8c0..649c217 100644 --- a/src/libs6dns/s6dns_message_get_caa.c +++ b/src/libs6dns/s6dns_message_get_caa.c @@ -3,7 +3,9 @@ #include <stdint.h> #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_get_caa (s6dns_message_rr_caa_t *caa, char const *packet, unsigned int packetlen, unsigned int *pos, uint16_t rdlength) diff --git a/src/libs6dns/s6dns_message_get_domain_internal.c b/src/libs6dns/s6dns_message_get_domain_internal.c index fd36e18..154c42c 100644 --- a/src/libs6dns/s6dns_message_get_domain_internal.c +++ b/src/libs6dns/s6dns_message_get_domain_internal.c @@ -2,7 +2,9 @@ #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include "s6dns-message-internal.h" size_t s6dns_message_get_domain_internal (char *out, size_t outmax, char const *s, unsigned int len, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_get_mx.c b/src/libs6dns/s6dns_message_get_mx.c index 8fb8abb..5b9f0d6 100644 --- a/src/libs6dns/s6dns_message_get_mx.c +++ b/src/libs6dns/s6dns_message_get_mx.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/uint16.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_get_mx (s6dns_message_rr_mx_t *mx, char const *packet, unsigned int packetlen, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_get_soa.c b/src/libs6dns/s6dns_message_get_soa.c index c766231..2bec565 100644 --- a/src/libs6dns/s6dns_message_get_soa.c +++ b/src/libs6dns/s6dns_message_get_soa.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/uint32.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_get_soa (s6dns_message_rr_soa_t *soa, char const *packet, unsigned int packetlen, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_get_srv.c b/src/libs6dns/s6dns_message_get_srv.c index 13ecf13..ad983ae 100644 --- a/src/libs6dns/s6dns_message_get_srv.c +++ b/src/libs6dns/s6dns_message_get_srv.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/uint16.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_get_srv (s6dns_message_rr_srv_t *srv, char const *packet, unsigned int packetlen, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_get_string_internal.c b/src/libs6dns/s6dns_message_get_string_internal.c index 9597c36..fe81f52 100644 --- a/src/libs6dns/s6dns_message_get_string_internal.c +++ b/src/libs6dns/s6dns_message_get_string_internal.c @@ -2,7 +2,9 @@ #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include "s6dns-message-internal.h" int s6dns_message_get_string_internal (char *s, size_t max, char const *packet, unsigned int packetlen, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_parse_answer_domain.c b/src/libs6dns/s6dns_message_parse_answer_domain.c index cb67178..25f47df 100644 --- a/src/libs6dns/s6dns_message_parse_answer_domain.c +++ b/src/libs6dns/s6dns_message_parse_answer_domain.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_parse_answer_domain (s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos, unsigned int section, void *stuff) diff --git a/src/libs6dns/s6dns_message_parse_answer_hinfo.c b/src/libs6dns/s6dns_message_parse_answer_hinfo.c index 9ee84f7..c9f70c1 100644 --- a/src/libs6dns/s6dns_message_parse_answer_hinfo.c +++ b/src/libs6dns/s6dns_message_parse_answer_hinfo.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-message.h> diff --git a/src/libs6dns/s6dns_message_parse_answer_mx.c b/src/libs6dns/s6dns_message_parse_answer_mx.c index f9f6df8..53596bc 100644 --- a/src/libs6dns/s6dns_message_parse_answer_mx.c +++ b/src/libs6dns/s6dns_message_parse_answer_mx.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-message.h> diff --git a/src/libs6dns/s6dns_message_parse_answer_soa.c b/src/libs6dns/s6dns_message_parse_answer_soa.c index d78b0b2..860972f 100644 --- a/src/libs6dns/s6dns_message_parse_answer_soa.c +++ b/src/libs6dns/s6dns_message_parse_answer_soa.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-message.h> diff --git a/src/libs6dns/s6dns_message_parse_answer_srv.c b/src/libs6dns/s6dns_message_parse_answer_srv.c index 526d18c..c1b469a 100644 --- a/src/libs6dns/s6dns_message_parse_answer_srv.c +++ b/src/libs6dns/s6dns_message_parse_answer_srv.c @@ -1,8 +1,10 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-constants.h> #include <s6-dns/s6dns-message.h> diff --git a/src/libs6dns/s6dns_message_parse_answer_strings.c b/src/libs6dns/s6dns_message_parse_answer_strings.c index 66ed36b..72c8f7e 100644 --- a/src/libs6dns/s6dns_message_parse_answer_strings.c +++ b/src/libs6dns/s6dns_message_parse_answer_strings.c @@ -2,9 +2,11 @@ #include <string.h> #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/stralloc.h> #include <skalibs/genalloc.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_parse_answer_strings (s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos, unsigned int section, void *stuff) diff --git a/src/libs6dns/s6dns_message_parse_getrr.c b/src/libs6dns/s6dns_message_parse_getrr.c index 8db0c5d..fdfb6dd 100644 --- a/src/libs6dns/s6dns_message_parse_getrr.c +++ b/src/libs6dns/s6dns_message_parse_getrr.c @@ -1,9 +1,11 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> #include <skalibs/uint16.h> #include <skalibs/uint32.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_parse_getrr (s6dns_message_rr_t_ref rr, char const *packet, unsigned int packetlen, unsigned int *pos) diff --git a/src/libs6dns/s6dns_message_parse_init.c b/src/libs6dns/s6dns_message_parse_init.c index fe38e68..cca8150 100644 --- a/src/libs6dns/s6dns_message_parse_init.c +++ b/src/libs6dns/s6dns_message_parse_init.c @@ -1,7 +1,9 @@ /* ISC license. */ #include <errno.h> -#include <skalibs/error.h> + +#include <skalibs/posixishard.h> + #include <s6-dns/s6dns-message.h> int s6dns_message_parse_init (s6dns_message_header_t *h, s6dns_message_counts_t *counts, char const *packet, unsigned int packetlen, unsigned int *pos) |