diff --git a/src/Makefile.in b/src/Makefile.in index a4e632b2..f0ab2074 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -230,14 +230,14 @@ const-info.lo const-info.o: $(srcdir)/const-info.c \ getdns/getdns_extra.h \ $(srcdir)/const-info.h context.lo context.o: $(srcdir)/context.c \ - config.h $(srcdir)/debug.h \ - $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h \ + config.h \ + $(srcdir)/debug.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/context.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \ $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/util-internal.h \ $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/dnssec.h $(srcdir)/stub.h \ - $(srcdir)/list.h + $(srcdir)/list.h $(srcdir)/dict.h convert.lo convert.o: $(srcdir)/convert.c \ config.h \ getdns/getdns.h \ @@ -245,17 +245,18 @@ convert.lo convert.o: $(srcdir)/convert.c \ $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \ $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \ - $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h + $(srcdir)/gldns/wire2str.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/convert.h dict.lo dict.o: $(srcdir)/dict.c $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h \ - config.h $(srcdir)/context.h \ - $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + config.h \ + $(srcdir)/context.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \ $(srcdir)/dict.h $(srcdir)/list.h $(srcdir)/const-info.h $(srcdir)/gldns/wire2str.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c \ - config.h $(srcdir)/debug.h \ + config.h \ + $(srcdir)/debug.h \ getdns/getdns.h \ $(srcdir)/context.h \ getdns/getdns_extra.h \ @@ -276,8 +277,8 @@ list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h \ - config.h $(srcdir)/context.h \ - $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + config.h \ + $(srcdir)/context.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h \ $(srcdir)/list.h $(srcdir)/dict.h request-internal.lo request-internal.o: $(srcdir)/request-internal.c \ @@ -288,7 +289,7 @@ request-internal.lo request-internal.o: $(srcdir)/request-internal.c \ $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h \ $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \ $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h \ - $(srcdir)/gldns/rrdef.h $(srcdir)/dict.h + $(srcdir)/gldns/rrdef.h $(srcdir)/dict.h $(srcdir)/debug.h rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h \ config.h \ getdns/getdns.h \ @@ -299,21 +300,23 @@ rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h \ $(srcdir)/gldns/pkthdr.h $(srcdir)/dict.h rr-iter.lo rr-iter.o: $(srcdir)/rr-iter.c $(srcdir)/rr-iter.h \ getdns/getdns.h \ - $(srcdir)/rr-dict.h config.h \ + $(srcdir)/rr-dict.h \ + config.h \ $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h stub.lo stub.o: $(srcdir)/stub.c \ - config.h $(srcdir)/debug.h \ - $(srcdir)/stub.h \ + config.h \ + $(srcdir)/debug.h $(srcdir)/stub.h \ getdns/getdns.h \ $(srcdir)/types-internal.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/rrdef.h \ - $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h $(srcdir)/context.h \ - $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/wire2str.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \ + $(srcdir)/context.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/general.h sync.lo sync.o: $(srcdir)/sync.c \ getdns/getdns.h \ - config.h $(srcdir)/context.h \ + config.h \ + $(srcdir)/context.h \ getdns/getdns_extra.h \ $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \ $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/general.h \ @@ -327,6 +330,7 @@ util-internal.lo util-internal.o: $(srcdir)/util-internal.c \ $(srcdir)/list.h $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h \ $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-iter.h $(srcdir)/rr-dict.h \ $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h +version.lo version.o: version.c gbuffer.lo gbuffer.o: $(srcdir)/gldns/gbuffer.c \ config.h \ $(srcdir)/gldns/gbuffer.h @@ -393,14 +397,14 @@ libevent.lo libevent.o: $(srcdir)/extension/libevent.c \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/getdns/getdns_ext_libevent.h libmini_event.lo libmini_event.o: $(srcdir)/extension/libmini_event.c \ - config.h $(srcdir)/debug.h \ - $(srcdir)/types-internal.h \ + config.h \ + $(srcdir)/debug.h $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h libuv.lo libuv.o: $(srcdir)/extension/libuv.c \ - config.h $(srcdir)/debug.h \ - $(srcdir)/types-internal.h \ + config.h \ + $(srcdir)/debug.h $(srcdir)/types-internal.h \ getdns/getdns.h \ getdns/getdns_extra.h \ $(srcdir)/util/rbtree.h $(srcdir)/getdns/getdns_ext_libuv.h diff --git a/src/convert.c b/src/convert.c index c7344875..f2293d06 100644 --- a/src/convert.c +++ b/src/convert.c @@ -47,6 +47,8 @@ #include "gldns/wire2str.h" #include "gldns/str2wire.h" #include "dict.h" +#include "list.h" +#include "convert.h" /* stuff to make it compile pedantically */ #define UNUSED_PARAM(x) ((void)(x)) @@ -295,15 +297,26 @@ getdns_rr_dict2wire_scan( return GETDNS_RETURN_GOOD; } +static struct mem_funcs _getdns_plain_mem_funcs = { + MF_PLAIN, .mf.pln = { malloc, realloc, free } +}; + +getdns_return_t +_getdns_wire2rr_dict(struct mem_funcs *mf, + const uint8_t *wire, size_t wire_len, getdns_dict **rr_dict) +{ + return _getdns_wire2rr_dict_scan(mf, &wire, &wire_len, rr_dict); +} getdns_return_t getdns_wire2rr_dict( const uint8_t *wire, size_t wire_len, getdns_dict **rr_dict) { - return getdns_wire2rr_dict_scan(&wire, &wire_len, rr_dict); + return _getdns_wire2rr_dict( + &_getdns_plain_mem_funcs, wire, wire_len, rr_dict); } getdns_return_t -getdns_wire2rr_dict_buf( +_getdns_wire2rr_dict_buf(struct mem_funcs *mf, const uint8_t *wire, size_t *wire_len, getdns_dict **rr_dict) { size_t my_wire_len; @@ -314,20 +327,24 @@ getdns_wire2rr_dict_buf( else my_wire_len = *wire_len; - if ((r = getdns_wire2rr_dict_scan(&wire, &my_wire_len, rr_dict))) + if ((r = _getdns_wire2rr_dict_scan(mf, &wire, &my_wire_len, rr_dict))) return r; *wire_len -= my_wire_len; return GETDNS_RETURN_GOOD; } +getdns_return_t +getdns_wire2rr_dict_buf( + const uint8_t *wire, size_t *wire_len, getdns_dict **rr_dict) +{ + return _getdns_wire2rr_dict_buf( + &_getdns_plain_mem_funcs, wire, wire_len, rr_dict); +} getdns_return_t -getdns_wire2rr_dict_scan( +_getdns_wire2rr_dict_scan(struct mem_funcs *mf, const uint8_t **wire, size_t *wire_len, getdns_dict **rr_dict) { - static struct mem_funcs plain_mem_funcs = { - MF_PLAIN, .mf.pln = { malloc, realloc, free } - }; _getdns_rr_iter rr_iter_spc, *rr_iter; if (!wire || !*wire || !wire_len || !rr_dict) @@ -337,14 +354,21 @@ getdns_wire2rr_dict_scan( &rr_iter_spc, *wire, *wire_len))) return GETDNS_RETURN_GENERIC_ERROR; - if (!(*rr_dict = _getdns_rr_iter2rr_dict(&plain_mem_funcs, rr_iter))) + if (!(*rr_dict = _getdns_rr_iter2rr_dict(mf, rr_iter))) return GETDNS_RETURN_MEMORY_ERROR; *wire_len -= (rr_iter->nxt - rr_iter->pos); - *wire = rr_iter->pos; + *wire = rr_iter->nxt; return GETDNS_RETURN_GOOD; } +getdns_return_t +getdns_wire2rr_dict_scan( + const uint8_t **wire, size_t *wire_len, getdns_dict **rr_dict) +{ + return _getdns_wire2rr_dict_scan( + &_getdns_plain_mem_funcs, wire, wire_len, rr_dict); +} getdns_return_t @@ -445,7 +469,7 @@ getdns_rr_dict2str_scan( getdns_return_t -getdns_str2rr_dict( +_getdns_str2rr_dict(struct mem_funcs *mf, const char *str, getdns_dict **rr_dict, const char *origin, uint32_t default_ttl) { uint8_t wire_spc[4096], *wire = wire_spc; @@ -468,20 +492,92 @@ getdns_str2rr_dict( e = gldns_str2wire_rr_buf(str, wire, &wire_len, NULL, default_ttl, origin_wf, origin_len, NULL, 0); if (GLDNS_WIREPARSE_ERROR(e) == GLDNS_WIREPARSE_ERR_BUFFER_TOO_SMALL) { - if (!(wire = malloc((wire_len = GLDNS_RR_BUF_SIZE)))) + + if (!(wire = GETDNS_XMALLOC( + *mf, uint8_t, (wire_len = GLDNS_RR_BUF_SIZE)))) return GETDNS_RETURN_MEMORY_ERROR; e = gldns_str2wire_rr_buf(str, wire, &wire_len, NULL, default_ttl, origin_wf, origin_len, NULL, 0); } if (e) { if (wire != wire_spc) - free(wire); + GETDNS_FREE(*mf, wire); return GETDNS_RETURN_GENERIC_ERROR; } - r = getdns_wire2rr_dict(wire, wire_len, rr_dict); + r = _getdns_wire2rr_dict(mf, wire, wire_len, rr_dict); if (wire != wire_spc) - free(wire); + GETDNS_FREE(*mf, wire); + return r; +} +getdns_return_t +getdns_str2rr_dict( + const char *str, getdns_dict **rr_dict, const char *origin, uint32_t default_ttl) +{ + return _getdns_str2rr_dict( + &_getdns_plain_mem_funcs, str, rr_dict, origin, default_ttl); +} + + +getdns_return_t +_getdns_fp2rr_list(struct mem_funcs *mf, + FILE *in, getdns_list **rr_list, const char *origin, uint32_t default_ttl) +{ + struct gldns_file_parse_state pst; + getdns_list *rrs; + getdns_return_t r = GETDNS_RETURN_GOOD; + uint8_t *rr; + size_t len, dname_len; + getdns_dict *rr_dict; + + if (!in || !rr_list) + return GETDNS_RETURN_INVALID_PARAMETER; + + if (!origin) { + *pst.origin = 0; + pst.origin_len = 0; + + } else if (gldns_str2wire_dname_buf(origin,pst.origin,&pst.origin_len)) + return GETDNS_RETURN_GENERIC_ERROR; + + *pst.prev_rr = 0; + pst.prev_rr_len = 1; + pst.default_ttl = default_ttl; + pst.lineno = 1; + + if (!(rrs = _getdns_list_create_with_mf(mf))) + return GETDNS_RETURN_MEMORY_ERROR; + + + if (!(rr = GETDNS_XMALLOC(*mf, uint8_t, GLDNS_RR_BUF_SIZE))) + r = GETDNS_RETURN_MEMORY_ERROR; + + else while (r == GETDNS_RETURN_GOOD && !feof(in)) { + len = GLDNS_RR_BUF_SIZE; + dname_len = 0; + if (gldns_fp2wire_rr_buf(in, rr, &len, &dname_len, &pst)) + break; + if (len == 0) + continue; + if ((r = _getdns_wire2rr_dict(mf, rr, len, &rr_dict))) + break; + r = _getdns_list_append_dict(rrs, rr_dict); + getdns_dict_destroy(rr_dict); + } + if (rr) + GETDNS_FREE(*mf, rr); + if (r) + getdns_list_destroy(rrs); + else + *rr_list = rrs; return r; } +getdns_return_t +getdns_fp2rr_list( + FILE *in, getdns_list **rr_list, const char *origin, uint32_t default_ttl) +{ + return _getdns_fp2rr_list( + &_getdns_plain_mem_funcs, in, rr_list, origin, default_ttl); +} + /* convert.c */ diff --git a/src/convert.h b/src/convert.h new file mode 100644 index 00000000..18b982ed --- /dev/null +++ b/src/convert.h @@ -0,0 +1,57 @@ +/** + * + * \file convert.h + * @brief getdns label conversion functions + * + */ + +/* + * Copyright (c) 2013, NLnet Labs, Verisign, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the names of the copyright holders nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL Verisign, Inc. BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _GETDNS_CONVERT_H_ +#define _GETDNS_CONVERT_H_ + +#include "types-internal.h" +#include + +getdns_return_t _getdns_wire2rr_dict(struct mem_funcs *mf, + const uint8_t *wire, size_t wire_len, getdns_dict **rr_dict); + +getdns_return_t _getdns_wire2rr_dict_buf(struct mem_funcs *mf, + const uint8_t *wire, size_t *wire_len, getdns_dict **rr_dict); + +getdns_return_t _getdns_wire2rr_dict_scan(struct mem_funcs *mf, + const uint8_t **wire, size_t *wire_len, getdns_dict **rr_dict); + +getdns_return_t _getdns_str2rr_dict(struct mem_funcs *mf, const char *str, + getdns_dict **rr_dict, const char *origin, uint32_t default_ttl); + +getdns_return_t _getdns_fp2rr_list(struct mem_funcs *mf, FILE *in, + getdns_list **rr_list, const char *origin, uint32_t default_ttl); + +#endif +/* convert.h */ diff --git a/src/getdns/getdns_extra.h.in b/src/getdns/getdns_extra.h.in index a66ee2f9..a33e6f4a 100644 --- a/src/getdns/getdns_extra.h.in +++ b/src/getdns/getdns_extra.h.in @@ -30,6 +30,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -560,6 +561,19 @@ getdns_str2rr_dict( const char *str, getdns_dict **rr_dict, const char *origin, uint32_t default_ttl); +/** + * Read the zonefile and convert to a list of rr_dict's. + * + * @param fp String representation of the resource record. + * @return rr_list The result list of rr_dicts representing the zone file. + * @param origin Default suffix for not fully qualified domain names + * @param default_ttl Default ttl + * @return GETDNS_RETURN_GOOD on success or an error code on failure. + */ +getdns_return_t +getdns_fp2rr_list( + FILE *in, getdns_list **rr_list, + const char *origin, uint32_t default_ttl); #ifdef __cplusplus } diff --git a/src/libgetdns.symbols b/src/libgetdns.symbols index 2983f1fc..2503c48c 100644 --- a/src/libgetdns.symbols +++ b/src/libgetdns.symbols @@ -83,6 +83,7 @@ getdns_dict_set_list getdns_dict_util_get_string getdns_dict_util_set_string getdns_display_ip_address +getdns_fp2rr_list getdns_general getdns_general_sync getdns_get_api_version @@ -115,7 +116,11 @@ getdns_print_json_dict getdns_print_json_list getdns_root_trust_anchor getdns_rr_dict2str +getdns_rr_dict2str_buf +getdns_rr_dict2str_scan getdns_rr_dict2wire +getdns_rr_dict2wire_buf +getdns_rr_dict2wire_scan getdns_service getdns_service_sync getdns_snprint_json_dict @@ -124,5 +129,7 @@ getdns_str2rr_dict getdns_strerror getdns_validate_dnssec getdns_wire2rr_dict +getdns_wire2rr_dict_buf +getdns_wire2rr_dict_scan plain_mem_funcs_user_arg priv_getdns_context_mf diff --git a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.c b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.c index 614284b4..c497256e 100644 --- a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.c +++ b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.c @@ -20,6 +20,13 @@ void print_dict(getdns_dict *rr_dict) free(str); } +void print_list(getdns_list *rr_list) +{ + char *str = getdns_pretty_print_list(rr_list); + printf("%s\n", str); + free(str); +} + void print_wire(uint8_t *wire, size_t wire_len) { size_t pos, i; @@ -48,7 +55,7 @@ void print_wire(uint8_t *wire, size_t wire_len) } -int main() +int main(int argc, char const * const argv[]) { getdns_return_t r; getdns_dict *rr_dict; @@ -56,11 +63,16 @@ int main() getdns_bindata address = { 4, "\xb9\x31\x8d\x25" }; getdns_bindata fourth = { 11, "last string" }; size_t length; - getdns_list *list; char *str; uint8_t *wire; size_t wire_len; - + getdns_list *rr_list; + FILE *in; + uint8_t wire_buf[7800]; + size_t i; + ssize_t available; + char str_buf[10000]; + ssize_t str_len = sizeof(str_buf); /* Convert string to rr_dict */ @@ -232,6 +244,65 @@ int main() free(str); getdns_dict_destroy(rr_dict); + if (!(in = fopen(argv[1], "r"))) + FAIL("Could not fopen %s\n", argv[1]); + + if ((r = getdns_fp2rr_list(in, &rr_list, NULL, 0))) + FAIL_r("getdns_fp2rr_list"); + + fclose(in); + + print_list(rr_list); + + + /* Fill the wire_buf with wireformat RR's in rr_list + * wire_buf is too small for last two rr's. + */ + wire = wire_buf; + available = sizeof(wire_buf); + + for (i = 0; !(r = getdns_list_get_dict(rr_list, i, &rr_dict)); i++) { + if ((r = getdns_rr_dict2wire_scan(rr_dict, &wire, &available))) { + if (r == GETDNS_RETURN_NEED_MORE_SPACE) { + printf("record %.3zu, available buffer space: " + "%zi\n", i, available); + break; + } + else + FAIL_r("getdns_rr_dict2wire_scan"); + } + printf("record %3zu, available buffer space: " + "%zi\n", i, available); + } + if (r == GETDNS_RETURN_NO_SUCH_LIST_ITEM) + r = GETDNS_RETURN_GOOD; + + getdns_list_destroy(rr_list); + + /* Now scan over the wireformat buffer and convert to rr_dicts again. + * Then fill a string buffer with those rr_dicts. + */ + wire = wire_buf; + available = sizeof(wire_buf); + + str = str_buf; + str_len = sizeof(str_buf); + + while (available > 0 && str_len > 0) { + rr_dict = NULL; + if ((r = getdns_wire2rr_dict_scan( + (const uint8_t **)&wire, &available, &rr_dict))) + FAIL_r("getdns_wire2rr_dict_scan"); + + if ((r = getdns_rr_dict2str_scan(rr_dict, &str, &str_len))) + FAIL_r("getdns_rr_dict2str_scan"); + + getdns_dict_destroy(rr_dict); + } + *str = 0; + + /* Print the entire buffer */ + printf("%s", str_buf); exit(EXIT_SUCCESS); } diff --git a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.good b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.good index 6742cb86..8a1b184c 100644 --- a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.good +++ b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.good @@ -100,3 +100,1749 @@ hip0.nlnetlabs.nl. 3600 IN HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSu "type": GETDNS_RRTYPE_APL } apl.net-dns.org. 3600 IN APL 1:192.168.42.0/26 1:192.168.42.64/26 !1:192.168.42.128/25 1:224.0.0.0/4 2:ff00:0000:0000:0000:0000:0000:0000:0000/8 +[ + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "expire": 345600, + "minimum": 300, + "mname": , + "rdata_raw": , + "refresh": 450, + "retry": 600, + "rname": , + "serial": 2015081800 + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_SOA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "nsdname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_NS + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "nsdname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_NS + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "nsdname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_NS + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "nsdname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_NS + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv6_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_AAAA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "exchange": , + "preference": 10, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_MX + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "exchange": , + "preference": 20, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_MX + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "certificate_association_data": , + "certificate_usage": 3, + "matching_type": 1, + "rdata_raw": , + "selector": 1 + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TLSA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "certificate_association_data": , + "certificate_usage": 3, + "matching_type": 1, + "rdata_raw": , + "selector": 1 + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TLSA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + , + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "exchange": , + "preference": 10, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_MX + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "exchange": , + "preference": 10, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_MX + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "exchange": , + "preference": 15, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_MX + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + , + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + , + , + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + , + , + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + , + , + , + , + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv6_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_AAAA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "cname": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_CNAME + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv4_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_A + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "ipv6_address": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_AAAA + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "apitems": + [ + { + "address_family": 1, + "afdpart": , + "n": 0, + "prefix": 26 + }, + { + "address_family": 1, + "afdpart": , + "n": 0, + "prefix": 26 + }, + { + "address_family": 1, + "afdpart": , + "n": 1, + "prefix": 25 + }, + { + "address_family": 1, + "afdpart": , + "n": 0, + "prefix": 4 + }, + { + "address_family": 2, + "afdpart": , + "n": 0, + "prefix": 8 + } + ], + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_APL + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway_type": 0, + "precedence": 2, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 1, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 2, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 3, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway_type": 0, + "precedence": 2, + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 1, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 2, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "algorithm": 10, + "gateway": , + "gateway_type": 3, + "precedence": 2, + "public_key": , + "rdata_raw": + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_IPSECKEY + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + }, + { + "class": GETDNS_RRCLASS_IN, + "name": , + "rdata": + { + "rdata_raw": , + "txt_strings": + [ + + ] + }, + "ttl": 3600, + "type": GETDNS_RRTYPE_TXT + } +] +record 0, available buffer space: 7717 +record 1, available buffer space: 7689 +record 2, available buffer space: 7663 +record 3, available buffer space: 7636 +record 4, available buffer space: 7602 +record 5, available buffer space: 7587 +record 6, available buffer space: 7560 +record 7, available buffer space: 7527 +record 8, available buffer space: 7498 +record 9, available buffer space: 7470 +record 10, available buffer space: 7402 +record 11, available buffer space: 7330 +record 12, available buffer space: 7283 +record 13, available buffer space: 7250 +record 14, available buffer space: 7213 +record 15, available buffer space: 7118 +record 16, available buffer space: 7032 +record 17, available buffer space: 6946 +record 18, available buffer space: 6860 +record 19, available buffer space: 6774 +record 20, available buffer space: 6688 +record 21, available buffer space: 6602 +record 22, available buffer space: 6516 +record 23, available buffer space: 6430 +record 24, available buffer space: 6343 +record 25, available buffer space: 6256 +record 26, available buffer space: 6169 +record 27, available buffer space: 6082 +record 28, available buffer space: 5995 +record 29, available buffer space: 5908 +record 30, available buffer space: 5821 +record 31, available buffer space: 5734 +record 32, available buffer space: 5647 +record 33, available buffer space: 5560 +record 34, available buffer space: 5473 +record 35, available buffer space: 5386 +record 36, available buffer space: 5299 +record 37, available buffer space: 5212 +record 38, available buffer space: 5125 +record 39, available buffer space: 5038 +record 40, available buffer space: 4951 +record 41, available buffer space: 4864 +record 42, available buffer space: 4777 +record 43, available buffer space: 4690 +record 44, available buffer space: 4603 +record 45, available buffer space: 4516 +record 46, available buffer space: 4429 +record 47, available buffer space: 4342 +record 48, available buffer space: 4255 +record 49, available buffer space: 4168 +record 50, available buffer space: 4081 +record 51, available buffer space: 3994 +record 52, available buffer space: 3907 +record 53, available buffer space: 3820 +record 54, available buffer space: 3733 +record 55, available buffer space: 3646 +record 56, available buffer space: 3559 +record 57, available buffer space: 3472 +record 58, available buffer space: 3385 +record 59, available buffer space: 3298 +record 60, available buffer space: 3211 +record 61, available buffer space: 3124 +record 62, available buffer space: 3037 +record 63, available buffer space: 2950 +record 64, available buffer space: 2863 +record 65, available buffer space: 2776 +record 66, available buffer space: 2689 +record 67, available buffer space: 2602 +record 68, available buffer space: 2515 +record 69, available buffer space: 2428 +record 70, available buffer space: 2341 +record 71, available buffer space: 2254 +record 72, available buffer space: 2167 +record 73, available buffer space: 2080 +record 74, available buffer space: 1992 +record 75, available buffer space: 1899 +record 76, available buffer space: 1824 +record 77, available buffer space: 1793 +record 78, available buffer space: 1761 +record 79, available buffer space: 1713 +record 80, available buffer space: 1666 +record 81, available buffer space: 1618 +record 82, available buffer space: 1573 +record 83, available buffer space: 1536 +record 84, available buffer space: 1445 +record 85, available buffer space: 1381 +record 86, available buffer space: 1314 +record 87, available buffer space: 1243 +record 88, available buffer space: 1166 +record 89, available buffer space: 1137 +record 90, available buffer space: 1096 +record 91, available buffer space: 1044 +record 92, available buffer space: 990 +record 93, available buffer space: 937 +record 94, available buffer space: 884 +record 95, available buffer space: 819 +record 96, available buffer space: 749 +record 97, available buffer space: 718 +record 98, available buffer space: 675 +record 99, available buffer space: 615 +record 100, available buffer space: 545 +record 101, available buffer space: 471 +record 102, available buffer space: 385 +record 103, available buffer space: 292 +record 104, available buffer space: 223 +record 105, available buffer space: 159 +record 106, available buffer space: 83 +record 107, available buffer space: 0 +record 108, available buffer space: -296 +net-dns.org. 3600 IN SOA ns.nlnetlabs.nl. sysadmin.nlnetlabs.nl. 2015081800 450 600 345600 300 +. 3600 IN NS ns.nlnetlabs.nl. +. 3600 IN NS ns.hactrn.net. +. 3600 IN NS mcvax.nlnet.nl. +. 3600 IN NS sec2.authdns.ripe.net. +. 3600 IN A 185.49.140.22 +. 3600 IN AAAA 2a04:b900::2:0:0:22 +. 3600 IN MX 10 dicht.nlnetlabs.nl. +. 3600 IN MX 20 mcvax.nlnet.nl. +. 3600 IN TXT "Net::DNS domain" +_443._tcp.net-dns.org. 3600 IN TLSA 3 1 1 274C6F96C9885C8050E8A05AD1C3162C1D51752C35B6196474E3F05AD31CD923 +_443._tcp.www.net-dns.org. 3600 IN TLSA 3 1 1 274C6F96C9885C8050E8A05AD1C3162C1D51752C35B6196474E3F05AD31CD923 +dynup.net-dns.org. 3600 IN TXT "fooFoo2" "Bla ; Foo" +lists.net-dns.org. 3600 IN A 63.209.15.196 +localhost.net-dns.org. 3600 IN A 127.0.0.1 +overflow.net-dns.org. 3600 IN TXT "And line 1 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 2 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 3 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 4 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 5 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 6 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 7 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 8 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 9 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 10 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 11 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 12 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 13 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 14 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 15 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 16 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 17 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 18 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 19 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 20 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 21 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 22 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 23 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 25 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 26 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 27 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 28 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 29 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 30 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 31 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 32 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 33 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 34 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 35 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 36 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 37 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 38 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 39 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 40 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 41 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 42 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 43 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 44 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 45 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 46 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 47 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 48 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 49 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 50 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 51 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 52 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 53 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 54 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 55 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 56 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 57 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 58 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 59 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 60 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "And line 224 of al sorts of crap that will just fill the packet " +net-dns.org. 3600 IN TXT "An increadibly large answer section that will lead to packet overflow" +t.net-dns.org. 3600 IN TXT "The names within this domain are used for testing" +a.t.net-dns.org. 3600 IN A 10.0.1.128 +a2.t.net-dns.org. 3600 IN A 10.0.1.129 +cname.t.net-dns.org. 3600 IN CNAME a.t.net-dns.org. +mx.t.net-dns.org. 3600 IN MX 10 a.t.net-dns.org. +mx2.t.net-dns.org. 3600 IN MX 10 a.t.net-dns.org. +t.net-dns.org. 3600 IN MX 15 a2.t.net-dns.org. +txt.t.net-dns.org. 3600 IN TXT "Net-DNS" +txt2.t.net-dns.org. 3600 IN TXT "Net-DNS; complicated $tuff" "sort of \" text; and binary \000 data" +connection-test.t.net-dns.org. 3600 IN TXT "connection-test succes" +txt-utf8.t.net-dns.org. 3600 IN TXT "\229\143\164\230\177\160\227\130\132" "\232\155\153\233\163\155\232\190\188\227\130\128" "\230\176\180\227\129\174\233\159\179" +txt-utf8-bin.t.net-dns.org. 3600 IN TXT "\229\143\164\230\177\160\227\130\132" "\232\155\153\233\163\155\232\190\188\227\130\128" "\230\176\180\227\129\174\233\159\179" +a.few.empty.non.terminals.t.net-dns.org. 3600 IN TXT "a" "few" "empty" "non" "terminals" +t.net-dns.org. 3600 IN A 185.49.140.22 +t.net-dns.org. 3600 IN AAAA 2a04:b900::2:0:0:22 +yx1.cname.t.net-dns.org. 3600 IN CNAME -.t.net-dns.org. +yx2.cname.t.net-dns.org. 3600 IN CNAME a-a.t.net-dns.org. +yx3.cname.t.net-dns.org. 3600 IN CNAME a\..t.net-dns.org. +yx4.cname.t.net-dns.org. 3600 IN CNAME a\000.t.net-dns.org. +nx1.cname.t.net-dns.org. 3600 IN CNAME does.not.exist.t.net-dns.org. +nx2.cname.t.net-dns.org. 3600 IN CNAME empty.non.terminals.t.net-dns.org. +www.net-dns.org. 3600 IN A 185.49.140.22 +www.net-dns.org. 3600 IN AAAA 2a04:b900::2:0:0:22 +apl.net-dns.org. 3600 IN APL 1:192.168.42.0/26 1:192.168.42.64/26 !1:192.168.42.128/25 1:224.0.0.0/4 2:ff00:0000:0000:0000:0000:0000:0000:0000/8 +ipseckey0.net-dns.org. 3600 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey1.net-dns.org. 3600 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey2.net-dns.org. 3600 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey3.net-dns.org. 3600 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey.net-dns.org. 3600 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +net-dns.org. 3600 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +net-dns.org. 3600 IN IPSECKEY 10 2 2 2001:db8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +net-dns.org. 3600 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== diff --git a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.net-dns.org b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.net-dns.org new file mode 100644 index 00000000..9eb59930 --- /dev/null +++ b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.net-dns.org @@ -0,0 +1,133 @@ +$ORIGIN . +$TTL 30 ; 30 seconds + +net-dns.org IN SOA ns.nlnetlabs.nl. sysadmin.nlnetlabs.nl. ( + 2015081800 ; serial + 450 ; refresh (7 minutes 30 seconds) + 600 ; retry (10 minutes) + 345600 ; expire (4 days) + 300 ; minimum (5 minutes) + ) + NS ns.nlnetlabs.nl + NS ns.hactrn.net. + NS mcvax.nlnet.nl. + NS sec2.authdns.ripe.net. + + A 185.49.140.22 + AAAA 2a04:b900::2:0:0:22 + + MX 10 dicht.nlnetlabs.nl. + MX 20 mcvax.nlnet.nl. + TXT "Net::DNS domain" +$ORIGIN net-dns.org. +_443._tcp TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923 +_443._tcp.www TLSA 3 1 1 274c6f96c9885c8050e8a05ad1c3162c1d51752c35b6196474e3f05ad31cd923 + +dynup TXT "fooFoo2" "Bla \; Foo" +lists A 63.209.15.196 +localhost A 127.0.0.1 + +overflow TXT "And line 1 of al sorts of crap that will just fill the packet " + TXT "And line 2 of al sorts of crap that will just fill the packet " + TXT "And line 3 of al sorts of crap that will just fill the packet " + TXT "And line 4 of al sorts of crap that will just fill the packet " + TXT "And line 5 of al sorts of crap that will just fill the packet " + TXT "And line 6 of al sorts of crap that will just fill the packet " + TXT "And line 7 of al sorts of crap that will just fill the packet " + TXT "And line 8 of al sorts of crap that will just fill the packet " + TXT "And line 9 of al sorts of crap that will just fill the packet " + TXT "And line 10 of al sorts of crap that will just fill the packet " + TXT "And line 11 of al sorts of crap that will just fill the packet " + TXT "And line 12 of al sorts of crap that will just fill the packet " + TXT "And line 13 of al sorts of crap that will just fill the packet " + TXT "And line 14 of al sorts of crap that will just fill the packet " + TXT "And line 15 of al sorts of crap that will just fill the packet " + TXT "And line 16 of al sorts of crap that will just fill the packet " + TXT "And line 17 of al sorts of crap that will just fill the packet " + TXT "And line 18 of al sorts of crap that will just fill the packet " + TXT "And line 19 of al sorts of crap that will just fill the packet " + TXT "And line 20 of al sorts of crap that will just fill the packet " + TXT "And line 21 of al sorts of crap that will just fill the packet " + TXT "And line 22 of al sorts of crap that will just fill the packet " + TXT "And line 23 of al sorts of crap that will just fill the packet " + TXT "And line 25 of al sorts of crap that will just fill the packet " + TXT "And line 26 of al sorts of crap that will just fill the packet " + TXT "And line 27 of al sorts of crap that will just fill the packet " + TXT "And line 28 of al sorts of crap that will just fill the packet " + TXT "And line 29 of al sorts of crap that will just fill the packet " + TXT "And line 30 of al sorts of crap that will just fill the packet " + TXT "And line 31 of al sorts of crap that will just fill the packet " + TXT "And line 32 of al sorts of crap that will just fill the packet " + TXT "And line 33 of al sorts of crap that will just fill the packet " + TXT "And line 34 of al sorts of crap that will just fill the packet " + TXT "And line 35 of al sorts of crap that will just fill the packet " + TXT "And line 36 of al sorts of crap that will just fill the packet " + TXT "And line 37 of al sorts of crap that will just fill the packet " + TXT "And line 38 of al sorts of crap that will just fill the packet " + TXT "And line 39 of al sorts of crap that will just fill the packet " + TXT "And line 40 of al sorts of crap that will just fill the packet " + TXT "And line 41 of al sorts of crap that will just fill the packet " + TXT "And line 42 of al sorts of crap that will just fill the packet " + TXT "And line 43 of al sorts of crap that will just fill the packet " + TXT "And line 44 of al sorts of crap that will just fill the packet " + TXT "And line 45 of al sorts of crap that will just fill the packet " + TXT "And line 46 of al sorts of crap that will just fill the packet " + TXT "And line 47 of al sorts of crap that will just fill the packet " + TXT "And line 48 of al sorts of crap that will just fill the packet " + TXT "And line 49 of al sorts of crap that will just fill the packet " + TXT "And line 50 of al sorts of crap that will just fill the packet " + TXT "And line 51 of al sorts of crap that will just fill the packet " + TXT "And line 52 of al sorts of crap that will just fill the packet " + TXT "And line 53 of al sorts of crap that will just fill the packet " + TXT "And line 54 of al sorts of crap that will just fill the packet " + TXT "And line 55 of al sorts of crap that will just fill the packet " + TXT "And line 56 of al sorts of crap that will just fill the packet " + TXT "And line 57 of al sorts of crap that will just fill the packet " + TXT "And line 58 of al sorts of crap that will just fill the packet " + TXT "And line 59 of al sorts of crap that will just fill the packet " + TXT "And line 60 of al sorts of crap that will just fill the packet " + TXT "And line 224 of al sorts of crap that will just fill the packet " + TXT "An increadibly large answer section that will lead to packet overflow" +t TXT "The names within this domain are used for testing" +$ORIGIN t.net-dns.org. +a A 10.0.1.128 +a2 A 10.0.1.129 +cname CNAME a +mx MX 10 a +mx2 MX 10 a + MX 15 a2 +txt TXT "Net-DNS" +txt2 TXT "Net-DNS\; complicated $tuff" "sort of \" text\; and binary \000 data" +connection-test TXT "connection-test succes" +txt-utf8 TXT \# 33 09E58FA4E6B1A0E382840CE89B99E9A39BE8BEBCE3828009E6B0B4E381AEE99FB3 +txt-utf8-bin TXT "古池や" "蛙飛込む" "水の音" +a.few.empty.non.terminals TXT a few empty non terminals + A 185.49.140.22 + AAAA 2a04:b900::2:0:0:22 +yx1.cname CNAME - +yx2.cname CNAME a-a +yx3.cname CNAME a\. +yx4.cname CNAME a\000 +nx1.cname CNAME does.not.exist +nx2.cname CNAME empty.non.terminals + +$ORIGIN net-dns.org. + +www A 185.49.140.22 +www AAAA 2a04:b900::2:0:0:22 + +apl APL 1:192.168.42.0/26 1:192.168.42.64/26 !1:192.168.42.128/25 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8 + +ipseckey0 IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey1 IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey2 IPSECKEY 10 2 2 2001:0DB8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey3 IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== +ipseckey IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== + IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== + IPSECKEY 10 2 2 2001:0DB8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== + IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ== + +default._domainkey IN TXT "v=DKIM1; r=postmaster; g=*; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDVG/lfF5GtPlMOcSGnfbp5u+EWM+OOg/f6QmbDXOW/zKQkRIRIZ+BtfSYchP8MeFPfMvUZtdRPzCWg1G7OdD7qaTUqc6kV84on6/8kPVMgdDLyLl2DeU/Lts9hfVHVDSpWuChwDAFXnbnW8jpp54zuof9OIbWSWIxZqLL8flgOsQIDAQAB" ; ----- DKIM default for example.com + +2.3.3.updates.spamassassin TXT "1418219 " +mirrors.updates.spamassassin TXT "http://anonymous@spamassassin.apache.org/updates/MIRRORED.BY" diff --git a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.test b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.test index b840c1dc..91f6787a 100644 --- a/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.test +++ b/src/test/tpkg/260-conversion-functions.tpkg/260-conversion-functions.test @@ -4,4 +4,12 @@ # use .tpkg.var.test for in test variable passing [ -f .tpkg.var.test ] && source .tpkg.var.test -make && "./${TPKG_NAME}" | tee out && diff out "${TPKG_NAME}.good" +if ! make +then + exit 1 +elif ! ( "./${TPKG_NAME}" "${TPKG_NAME}.net-dns.org" | tee out ) +then + exit 1 +else + diff out "${TPKG_NAME}.good" +fi