From fbab100426f99db5f7fd1f4fbac43676a6802fe1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 25 Oct 2018 15:27:06 +1100 Subject: [PATCH] Add support for EID and NIMLOC --- CHANGES | 2 + bin/tests/system/genzone.sh | 11 +- bin/tests/system/xfer/dig1.good | 2 + bin/tests/system/xfer/dig2.good | 2 + lib/dns/gen.c | 2 - lib/dns/rdata/in_1/eid_31.c | 218 ++++++++++++++++++++++++++++++++ lib/dns/rdata/in_1/eid_31.h | 27 ++++ lib/dns/rdata/in_1/nimloc_32.c | 218 ++++++++++++++++++++++++++++++++ lib/dns/rdata/in_1/nimloc_32.h | 27 ++++ lib/dns/tests/rdata_test.c | 84 ++++++++++++ util/copyrights | 4 + 11 files changed, 591 insertions(+), 6 deletions(-) create mode 100644 lib/dns/rdata/in_1/eid_31.c create mode 100644 lib/dns/rdata/in_1/eid_31.h create mode 100644 lib/dns/rdata/in_1/nimloc_32.c create mode 100644 lib/dns/rdata/in_1/nimloc_32.h diff --git a/CHANGES b/CHANGES index 0c30e46b98..892a2107a0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +5061. [protocol] Add support for EID and NIMLOC. [GL #626] + 5060. [bug] GID, UID and UINFO could not be loaded using unknown record format. [GL #627] diff --git a/bin/tests/system/genzone.sh b/bin/tests/system/genzone.sh index cdd09a5623..062778063e 100644 --- a/bin/tests/system/genzone.sh +++ b/bin/tests/system/genzone.sh @@ -186,12 +186,15 @@ loc02 LOC 60 09 00.000 N 24 39 00.000 E 10.00m 20.00m ( ;nxt03 NXT . 1 ;nxt04 NXT . 127 -; type 31 (EID - not implemented by BIND) -; type 32 (NIMLOC - not implemented by BIND) +; type 31 +eid01 EID 12 89 AB + +; type 32 +nimloc01 NIMLOC 12 89 AB ; type 33 -srv01 SRV 0 0 0 . -srv02 SRV 65535 65535 65535 old-slow-box +srv01 SRV 0 0 0 . +srv02 SRV 65535 65535 65535 old-slow-box ; type 34 atma01 ATMA +61200000000 diff --git a/bin/tests/system/xfer/dig1.good b/bin/tests/system/xfer/dig1.good index 2ac04d3e36..26d2ca25c9 100644 --- a/bin/tests/system/xfer/dig1.good +++ b/bin/tests/system/xfer/dig1.good @@ -41,6 +41,7 @@ ds01.example. 3600 IN NS ns42.example. ds01.example. 3600 IN DS 12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAFD0DDB31A85C7 19277C13 ds02.example. 3600 IN NS ns43.example. ds02.example. 3600 IN DS 12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390 +eid01.example. 3600 IN EID 1289AB eui48.example. 3600 IN EUI48 01-23-45-67-89-ab eui64.example. 3600 IN EUI64 01-23-45-67-89-ab-cd-ef gid01.example. 3600 IN GID \# 1 03 @@ -83,6 +84,7 @@ mx01.example. 3600 IN MX 10 mail.example. mx02.example. 3600 IN MX 10 . naptr01.example. 3600 IN NAPTR 0 0 "" "" "" . naptr02.example. 3600 IN NAPTR 65535 65535 "blurgh" "blorf" "blllbb" foo. +nimloc01.example. 3600 IN NIMLOC 1289AB ninfo01.example. 3600 IN NINFO "foo" ninfo02.example. 3600 IN NINFO "foo" "bar" ninfo03.example. 3600 IN NINFO "foo" diff --git a/bin/tests/system/xfer/dig2.good b/bin/tests/system/xfer/dig2.good index 2a3856bbbe..759267d7d7 100644 --- a/bin/tests/system/xfer/dig2.good +++ b/bin/tests/system/xfer/dig2.good @@ -41,6 +41,7 @@ ds01.example. 3600 IN NS ns42.example. ds01.example. 3600 IN DS 12892 5 2 26584835CA80C81C91999F31CFAF2A0E89D4FF1C8FAFD0DDB31A85C7 19277C13 ds02.example. 3600 IN NS ns43.example. ds02.example. 3600 IN DS 12892 5 1 7AA4A3F416C2F2391FB7AB0D434F762CD62D1390 +eid01.example. 3600 IN EID 1289AB eui48.example. 3600 IN EUI48 01-23-45-67-89-ab eui64.example. 3600 IN EUI64 01-23-45-67-89-ab-cd-ef gid01.example. 3600 IN GID \# 1 03 @@ -83,6 +84,7 @@ mx01.example. 3600 IN MX 10 mail.example. mx02.example. 3600 IN MX 10 . naptr01.example. 3600 IN NAPTR 0 0 "" "" "" . naptr02.example. 3600 IN NAPTR 65535 65535 "blurgh" "blorf" "blllbb" foo. +nimloc01.example. 3600 IN NIMLOC 1289AB ninfo01.example. 3600 IN NINFO "foo" ninfo02.example. 3600 IN NINFO "foo" "bar" ninfo03.example. 3600 IN NINFO "foo" diff --git a/lib/dns/gen.c b/lib/dns/gen.c index 248d13e180..3a73c8d2d2 100644 --- a/lib/dns/gen.c +++ b/lib/dns/gen.c @@ -697,8 +697,6 @@ main(int argc, char **argv) { * sort them without special cases. */ insert_into_typenames(0, "reserved0", RESERVED); - insert_into_typenames(31, "eid", RESERVED); - insert_into_typenames(32, "nimloc", RESERVED); insert_into_typenames(100, "uinfo", RESERVEDNAME); insert_into_typenames(101, "uid", RESERVEDNAME); insert_into_typenames(102, "gid", RESERVEDNAME); diff --git a/lib/dns/rdata/in_1/eid_31.c b/lib/dns/rdata/in_1/eid_31.c new file mode 100644 index 0000000000..f705961261 --- /dev/null +++ b/lib/dns/rdata/in_1/eid_31.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/* http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt */ + +#ifndef RDATA_IN_1_EID_31_C +#define RDATA_IN_1_EID_31_C + +#define RRTYPE_EID_ATTRIBUTES (0) + +static inline isc_result_t +fromtext_in_eid(ARGS_FROMTEXT) { + + REQUIRE(type == dns_rdatatype_eid); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(type); + UNUSED(origin); + UNUSED(options); + UNUSED(rdclass); + UNUSED(callbacks); + + return (isc_hex_tobuffer(lexer, target, -1)); +} + +static inline isc_result_t +totext_in_eid(ARGS_TOTEXT) { + isc_region_t region; + + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(rdata->length != 0); + + dns_rdata_toregion(rdata, ®ion); + + if (tctx->width == 0) { + return (isc_hex_totext(®ion, 60, "", target)); + } else { + return (isc_hex_totext(®ion, tctx->width - 2, + tctx->linebreak, target)); + } +} + +static inline isc_result_t +fromwire_in_eid(ARGS_FROMWIRE) { + isc_region_t region; + + REQUIRE(type == dns_rdatatype_eid); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(type); + UNUSED(dctx); + UNUSED(options); + UNUSED(rdclass); + + isc_buffer_activeregion(source, ®ion); + if (region.length < 1) { + return (ISC_R_UNEXPECTEDEND); + } + + RETERR(mem_tobuffer(target, region.base, region.length)); + isc_buffer_forward(source, region.length); + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +towire_in_eid(ARGS_TOWIRE) { + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(rdata->length != 0); + + UNUSED(cctx); + + return (mem_tobuffer(target, rdata->data, rdata->length)); +} + +static inline int +compare_in_eid(ARGS_COMPARE) { + isc_region_t r1; + isc_region_t r2; + + REQUIRE(rdata1->type == rdata2->type); + REQUIRE(rdata1->rdclass == rdata2->rdclass); + REQUIRE(rdata1->type == dns_rdatatype_eid); + REQUIRE(rdata1->rdclass == dns_rdataclass_in); + REQUIRE(rdata1->length != 0); + REQUIRE(rdata2->length != 0); + + dns_rdata_toregion(rdata1, &r1); + dns_rdata_toregion(rdata2, &r2); + return (isc_region_compare(&r1, &r2)); +} + +static inline isc_result_t +fromstruct_in_eid(ARGS_FROMSTRUCT) { + dns_rdata_in_eid_t *eid = source; + + REQUIRE(type == dns_rdatatype_eid); + REQUIRE(rdclass == dns_rdataclass_in); + REQUIRE(source != NULL); + REQUIRE(eid->common.rdtype == type); + REQUIRE(eid->common.rdclass == rdclass); + REQUIRE(eid->eid != NULL || eid->eid_len == 0); + + UNUSED(type); + UNUSED(rdclass); + + return (mem_tobuffer(target, eid->eid, eid->eid_len)); +} + +static inline isc_result_t +tostruct_in_eid(ARGS_TOSTRUCT) { + dns_rdata_in_eid_t *eid = target; + isc_region_t r; + + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(target != NULL); + REQUIRE(rdata->length != 0); + + eid->common.rdclass = rdata->rdclass; + eid->common.rdtype = rdata->type; + ISC_LINK_INIT(&eid->common, link); + + dns_rdata_toregion(rdata, &r); + eid->eid_len = r.length; + eid->eid = mem_maybedup(mctx, r.base, r.length); + if (eid->eid == NULL) { + return (ISC_R_NOMEMORY); + } + + eid->mctx = mctx; + return (ISC_R_SUCCESS); +} + +static inline void +freestruct_in_eid(ARGS_FREESTRUCT) { + dns_rdata_in_eid_t *eid = source; + + REQUIRE(source != NULL); + REQUIRE(eid->common.rdclass == dns_rdataclass_in); + REQUIRE(eid->common.rdtype == dns_rdatatype_eid); + + if (eid->mctx == NULL) { + return; + } + + if (eid->eid != NULL) { + isc_mem_free(eid->mctx, eid->eid); + } + eid->mctx = NULL; +} + +static inline isc_result_t +additionaldata_in_eid(ARGS_ADDLDATA) { + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + UNUSED(rdata); + UNUSED(add); + UNUSED(arg); + + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +digest_in_eid(ARGS_DIGEST) { + isc_region_t r; + + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + dns_rdata_toregion(rdata, &r); + + return ((digest)(arg, &r)); +} + +static inline bool +checkowner_in_eid(ARGS_CHECKOWNER) { + + REQUIRE(type == dns_rdatatype_eid); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(name); + UNUSED(type); + UNUSED(rdclass); + UNUSED(wildcard); + + return (true); +} + +static inline bool +checknames_in_eid(ARGS_CHECKNAMES) { + + REQUIRE(rdata->type == dns_rdatatype_eid); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + UNUSED(rdata); + UNUSED(owner); + UNUSED(bad); + + return (true); +} + +static inline int +casecompare_in_eid(ARGS_COMPARE) { + return (compare_in_eid(rdata1, rdata2)); +} + +#endif /* RDATA_IN_1_EID_31_C */ diff --git a/lib/dns/rdata/in_1/eid_31.h b/lib/dns/rdata/in_1/eid_31.h new file mode 100644 index 0000000000..55d414b19b --- /dev/null +++ b/lib/dns/rdata/in_1/eid_31.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#ifndef IN_1_EID_31_H +#define IN_1_EID_31_H 1 + + +/*! + * \brief http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt + */ + +typedef struct dns_rdata_in_eid { + dns_rdatacommon_t common; + isc_mem_t *mctx; + unsigned char *eid; + uint16_t eid_len; +} dns_rdata_in_eid_t; + +#endif /* IN_1_EID_31_H */ diff --git a/lib/dns/rdata/in_1/nimloc_32.c b/lib/dns/rdata/in_1/nimloc_32.c new file mode 100644 index 0000000000..10db1cfea4 --- /dev/null +++ b/lib/dns/rdata/in_1/nimloc_32.c @@ -0,0 +1,218 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +/* http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt */ + +#ifndef RDATA_IN_1_NIMLOC_32_C +#define RDATA_IN_1_NIMLOC_32_C + +#define RRTYPE_NIMLOC_ATTRIBUTES (0) + +static inline isc_result_t +fromtext_in_nimloc(ARGS_FROMTEXT) { + + REQUIRE(type == dns_rdatatype_nimloc); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(type); + UNUSED(origin); + UNUSED(options); + UNUSED(rdclass); + UNUSED(callbacks); + + return (isc_hex_tobuffer(lexer, target, -1)); +} + +static inline isc_result_t +totext_in_nimloc(ARGS_TOTEXT) { + isc_region_t region; + + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(rdata->length != 0); + + dns_rdata_toregion(rdata, ®ion); + + if (tctx->width == 0) { + return (isc_hex_totext(®ion, 60, "", target)); + } else { + return (isc_hex_totext(®ion, tctx->width - 2, + tctx->linebreak, target)); + } +} + +static inline isc_result_t +fromwire_in_nimloc(ARGS_FROMWIRE) { + isc_region_t region; + + REQUIRE(type == dns_rdatatype_nimloc); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(type); + UNUSED(dctx); + UNUSED(options); + UNUSED(rdclass); + + isc_buffer_activeregion(source, ®ion); + if (region.length < 1) { + return (ISC_R_UNEXPECTEDEND); + } + + RETERR(mem_tobuffer(target, region.base, region.length)); + isc_buffer_forward(source, region.length); + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +towire_in_nimloc(ARGS_TOWIRE) { + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(rdata->length != 0); + + UNUSED(cctx); + + return (mem_tobuffer(target, rdata->data, rdata->length)); +} + +static inline int +compare_in_nimloc(ARGS_COMPARE) { + isc_region_t r1; + isc_region_t r2; + + REQUIRE(rdata1->type == rdata2->type); + REQUIRE(rdata1->rdclass == rdata2->rdclass); + REQUIRE(rdata1->type == dns_rdatatype_nimloc); + REQUIRE(rdata1->rdclass == dns_rdataclass_in); + REQUIRE(rdata1->length != 0); + REQUIRE(rdata2->length != 0); + + dns_rdata_toregion(rdata1, &r1); + dns_rdata_toregion(rdata2, &r2); + return (isc_region_compare(&r1, &r2)); +} + +static inline isc_result_t +fromstruct_in_nimloc(ARGS_FROMSTRUCT) { + dns_rdata_in_nimloc_t *nimloc = source; + + REQUIRE(type == dns_rdatatype_nimloc); + REQUIRE(rdclass == dns_rdataclass_in); + REQUIRE(source != NULL); + REQUIRE(nimloc->common.rdtype == type); + REQUIRE(nimloc->common.rdclass == rdclass); + REQUIRE(nimloc->nimloc != NULL || nimloc->nimloc_len == 0); + + UNUSED(type); + UNUSED(rdclass); + + return (mem_tobuffer(target, nimloc->nimloc, nimloc->nimloc_len)); +} + +static inline isc_result_t +tostruct_in_nimloc(ARGS_TOSTRUCT) { + dns_rdata_in_nimloc_t *nimloc = target; + isc_region_t r; + + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + REQUIRE(target != NULL); + REQUIRE(rdata->length != 0); + + nimloc->common.rdclass = rdata->rdclass; + nimloc->common.rdtype = rdata->type; + ISC_LINK_INIT(&nimloc->common, link); + + dns_rdata_toregion(rdata, &r); + nimloc->nimloc_len = r.length; + nimloc->nimloc = mem_maybedup(mctx, r.base, r.length); + if (nimloc->nimloc == NULL) { + return (ISC_R_NOMEMORY); + } + + nimloc->mctx = mctx; + return (ISC_R_SUCCESS); +} + +static inline void +freestruct_in_nimloc(ARGS_FREESTRUCT) { + dns_rdata_in_nimloc_t *nimloc = source; + + REQUIRE(source != NULL); + REQUIRE(nimloc->common.rdclass == dns_rdataclass_in); + REQUIRE(nimloc->common.rdtype == dns_rdatatype_nimloc); + + if (nimloc->mctx == NULL) { + return; + } + + if (nimloc->nimloc != NULL) { + isc_mem_free(nimloc->mctx, nimloc->nimloc); + } + nimloc->mctx = NULL; +} + +static inline isc_result_t +additionaldata_in_nimloc(ARGS_ADDLDATA) { + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + UNUSED(rdata); + UNUSED(add); + UNUSED(arg); + + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +digest_in_nimloc(ARGS_DIGEST) { + isc_region_t r; + + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + dns_rdata_toregion(rdata, &r); + + return ((digest)(arg, &r)); +} + +static inline bool +checkowner_in_nimloc(ARGS_CHECKOWNER) { + + REQUIRE(type == dns_rdatatype_nimloc); + REQUIRE(rdclass == dns_rdataclass_in); + + UNUSED(name); + UNUSED(type); + UNUSED(rdclass); + UNUSED(wildcard); + + return (true); +} + +static inline bool +checknames_in_nimloc(ARGS_CHECKNAMES) { + + REQUIRE(rdata->type == dns_rdatatype_nimloc); + REQUIRE(rdata->rdclass == dns_rdataclass_in); + + UNUSED(rdata); + UNUSED(owner); + UNUSED(bad); + + return (true); +} + +static inline int +casecompare_in_nimloc(ARGS_COMPARE) { + return (compare_in_nimloc(rdata1, rdata2)); +} + +#endif /* RDATA_IN_1_NIMLOC_32_C */ diff --git a/lib/dns/rdata/in_1/nimloc_32.h b/lib/dns/rdata/in_1/nimloc_32.h new file mode 100644 index 0000000000..ea2b3c7d4e --- /dev/null +++ b/lib/dns/rdata/in_1/nimloc_32.h @@ -0,0 +1,27 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +#ifndef IN_1_NIMLOC_32_H +#define IN_1_NIMLOC_32_H 1 + + +/*! + * \brief http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt + */ + +typedef struct dns_rdata_in_nimloc { + dns_rdatacommon_t common; + isc_mem_t *mctx; + unsigned char *nimloc; + uint16_t nimloc_len; +} dns_rdata_in_nimloc_t; + +#endif /* IN_1_NIMLOC_32_H */ diff --git a/lib/dns/tests/rdata_test.c b/lib/dns/tests/rdata_test.c index 506a35f7c2..19ac114f28 100644 --- a/lib/dns/tests/rdata_test.c +++ b/lib/dns/tests/rdata_test.c @@ -936,6 +936,47 @@ ATF_TC_BODY(edns_client_subnet, tc) { dns_rdatatype_opt, sizeof(dns_rdata_opt_t)); } +/* + * http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt + * + * The RDATA portion of both the NIMLOC and EID records contains + * uninterpreted binary data. The representation in the text master file + * is an even number of hex characters (0 to 9, a to f), case is not + * significant. For readability, whitespace may be included in the value + * field and should be ignored when reading a master file. + */ +ATF_TC(eid); +ATF_TC_HEAD(eid, tc) { + atf_tc_set_md_var(tc, "descr", "EID RDATA manipulations"); +} +ATF_TC_BODY(eid, tc) { + text_ok_t text_ok[] = { + TEXT_VALID("AABBCC"), + TEXT_VALID_CHANGED("AA bb cc", "AABBCC"), + TEXT_INVALID("aab"), + /* + * Sentinel. + */ + TEXT_SENTINEL() + }; + wire_ok_t wire_ok[] = { + /* + * Too short. + */ + WIRE_INVALID(), + WIRE_VALID(0x00), + /* + * Sentinel. + */ + WIRE_SENTINEL() + }; + + UNUSED(tc); + + check_rdata(text_ok, wire_ok, false, dns_rdataclass_in, + dns_rdatatype_eid, sizeof(dns_rdata_in_eid_t)); +} + /* * Successful load test. */ @@ -1078,6 +1119,47 @@ ATF_TC_BODY(isdn, tc) { dns_rdatatype_isdn, sizeof(dns_rdata_isdn_t)); } +/* + * http://ana-3.lcs.mit.edu/~jnc/nimrod/dns.txt + * + * The RDATA portion of both the NIMLOC and EID records contains + * uninterpreted binary data. The representation in the text master file + * is an even number of hex characters (0 to 9, a to f), case is not + * significant. For readability, whitespace may be included in the value + * field and should be ignored when reading a master file. + */ +ATF_TC(nimloc); +ATF_TC_HEAD(nimloc, tc) { + atf_tc_set_md_var(tc, "descr", "NIMLOC RDATA manipulations"); +} +ATF_TC_BODY(nimloc, tc) { + text_ok_t text_ok[] = { + TEXT_VALID("AABBCC"), + TEXT_VALID_CHANGED("AA bb cc", "AABBCC"), + TEXT_INVALID("aab"), + /* + * Sentinel. + */ + TEXT_SENTINEL() + }; + wire_ok_t wire_ok[] = { + /* + * Too short. + */ + WIRE_INVALID(), + WIRE_VALID(0x00), + /* + * Sentinel. + */ + WIRE_SENTINEL() + }; + + UNUSED(tc); + + check_rdata(text_ok, wire_ok, false, dns_rdataclass_in, + dns_rdatatype_nimloc, sizeof(dns_rdata_in_nimloc_t)); +} + /* * NSEC tests. * @@ -1293,9 +1375,11 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, atma); ATF_TP_ADD_TC(tp, csync); ATF_TP_ADD_TC(tp, doa); + ATF_TP_ADD_TC(tp, eid); ATF_TP_ADD_TC(tp, edns_client_subnet); ATF_TP_ADD_TC(tp, hip); ATF_TP_ADD_TC(tp, isdn); + ATF_TP_ADD_TC(tp, nimloc); ATF_TP_ADD_TC(tp, nsec); ATF_TP_ADD_TC(tp, nsec3); ATF_TP_ADD_TC(tp, wks); diff --git a/util/copyrights b/util/copyrights index 7ab89582cf..40708bb8ff 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3136,8 +3136,12 @@ ./lib/dns/rdata/in_1/atma_34.h C 2018 ./lib/dns/rdata/in_1/dhcid_49.c C 2006,2007,2009,2011,2012,2015,2016,2017,2018 ./lib/dns/rdata/in_1/dhcid_49.h C 2006,2007,2016,2018 +./lib/dns/rdata/in_1/eid_31.c C 2018 +./lib/dns/rdata/in_1/eid_31.h C 2018 ./lib/dns/rdata/in_1/kx_36.c C 1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 ./lib/dns/rdata/in_1/kx_36.h C 1999,2000,2001,2004,2005,2007,2016,2018 +./lib/dns/rdata/in_1/nimloc_32.c C 2018 +./lib/dns/rdata/in_1/nimloc_32.h C 2018 ./lib/dns/rdata/in_1/nsap-ptr_23.c C 1999,2000,2001,2004,2005,2007,2009,2015,2016,2018 ./lib/dns/rdata/in_1/nsap-ptr_23.h C 1999,2000,2001,2004,2005,2007,2016,2018 ./lib/dns/rdata/in_1/nsap_22.c C 1999,2000,2001,2002,2004,2005,2007,2009,2013,2015,2016,2017,2018