]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4214. [protocol] Add support for TALINK. [RT #40544]
authorMark Andrews <marka@isc.org>
Thu, 17 Sep 2015 21:43:43 +0000 (07:43 +1000)
committerMark Andrews <marka@isc.org>
Thu, 17 Sep 2015 21:43:43 +0000 (07:43 +1000)
40 files changed:
CHANGES
bin/tests/system/genzone.sh
bin/tests/system/rrchecker/typelist.good
bin/tests/system/xfer/dig1.good
bin/tests/system/xfer/dig2.good
doc/arm/Bv9ARM-book.xml
doc/arm/notes.xml
lib/dns/rdata/any_255/tsig_250.c
lib/dns/rdata/ch_3/a_1.c
lib/dns/rdata/generic/afsdb_18.c
lib/dns/rdata/generic/cname_5.c
lib/dns/rdata/generic/dname_39.c
lib/dns/rdata/generic/hip_55.c
lib/dns/rdata/generic/ipseckey_45.c
lib/dns/rdata/generic/lp_107.c
lib/dns/rdata/generic/mb_7.c
lib/dns/rdata/generic/md_3.c
lib/dns/rdata/generic/mf_4.c
lib/dns/rdata/generic/mg_8.c
lib/dns/rdata/generic/minfo_14.c
lib/dns/rdata/generic/mr_9.c
lib/dns/rdata/generic/mx_15.c
lib/dns/rdata/generic/naptr_35.c
lib/dns/rdata/generic/ns_2.c
lib/dns/rdata/generic/nsec_47.c
lib/dns/rdata/generic/nxt_30.c
lib/dns/rdata/generic/ptr_12.c
lib/dns/rdata/generic/rp_17.c
lib/dns/rdata/generic/rrsig_46.c
lib/dns/rdata/generic/rt_21.c
lib/dns/rdata/generic/sig_24.c
lib/dns/rdata/generic/soa_6.c
lib/dns/rdata/generic/talink_58.c [new file with mode: 0644]
lib/dns/rdata/generic/talink_58.h [new file with mode: 0644]
lib/dns/rdata/generic/tkey_249.c
lib/dns/rdata/in_1/a6_38.c
lib/dns/rdata/in_1/kx_36.c
lib/dns/rdata/in_1/nsap-ptr_23.c
lib/dns/rdata/in_1/px_26.c
lib/dns/rdata/in_1/srv_33.c

diff --git a/CHANGES b/CHANGES
index 22870258719352472f54ff6b25d8305b8af4a119..a0c557deea571071b220f8cbb29f6a1d29316cfd 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+4214.  [protocol]      Add support for TALINK.  [RT #40544]
+
 4213.  [bug]           Don't reuse a cache across multiple classes.
                        [RT #40205]
 
index 8067e9537d83331802596d889bfa78c2d803afdb..cdf9447443dcf17fc3404d920cb5977563859655 100644 (file)
@@ -15,8 +15,6 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: genzone.sh,v 1.13 2011/03/03 23:47:31 tbox Exp $
-
 #
 # Set up a test zone
 #
@@ -268,6 +266,11 @@ rkey01                     RKEY    512 ( 255 1 AQMFD5raczCJHViKtLYhWGz8hMY
                                sENW91IOW4vqudngPZsY3GvQ/xVA8/7pyFj6b7Esg
                                a60zyGW6LFe9r8n6paHrlG5ojqf0BaqHT+8= )
 
+; type 58
+talink0                        TALINK  . talink1
+talink1                        TALINK  talink0 talink2
+talink2                        TALINK  talink2 .
+
 ; type 59
 cds01                  CDS     30795 1 1 (
                                        310D27F4D82C1FC2400704EA9939FE6E1CEA
index 88a411b1f0178c6894f0c3d04c706241005aa9fd..8ba154c73cd21714ce9e33865d24efc24754b3c3 100644 (file)
@@ -52,6 +52,7 @@ TLSA
 HIP
 NINFO
 RKEY
+TALINK
 CDS
 CDNSKEY
 OPENPGPKEY
index 97b344ed33f9f55a879ce413650229750b684a13..85fbe5c5ebf47534630dd8bdfa4a8574ed3b74a2 100644 (file)
@@ -98,6 +98,9 @@ sink02.example.               3600    IN      SINK    8 0 2 l4ik
 srv01.example.         3600    IN      SRV     0 0 0 .
 srv02.example.         3600    IN      SRV     65535 65535 65535 old-slow-box.example.
 ta.example.            3600    IN      TA      30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
+talink0.example.       3600    IN      TALINK  . talink1.example.
+talink1.example.       3600    IN      TALINK  talink0.example. talink2.example.
+talink2.example.       3600    IN      TALINK  talink2.example. .
 tlsa.example.          3600    IN      TLSA    1 1 2 92003BA34942DC74152E2F2C408D29ECA5A520E7F2E06BB944F4DCA3 46BAF63C1B177615D466F6C4B71C216A50292BD58C9EBDD2F74E38FE 51FFD48C43326CBC
 txt01.example.         3600    IN      TXT     "foo"
 txt02.example.         3600    IN      TXT     "foo" "bar"
index 141460623d449a1210dcbebec1d327a817779a02..57633c995678cdcaf9c9881916b125fb4ec4f701 100644 (file)
@@ -98,6 +98,9 @@ sink02.example.               3600    IN      SINK    8 0 2 l4ik
 srv01.example.         3600    IN      SRV     0 0 0 .
 srv02.example.         3600    IN      SRV     65535 65535 65535 old-slow-box.example.
 ta.example.            3600    IN      TA      30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
+talink0.example.       3600    IN      TALINK  . talink1.example.
+talink1.example.       3600    IN      TALINK  talink0.example. talink2.example.
+talink2.example.       3600    IN      TALINK  talink2.example. .
 tlsa.example.          3600    IN      TLSA    1 1 2 92003BA34942DC74152E2F2C408D29ECA5A520E7F2E06BB944F4DCA3 46BAF63C1B177615D466F6C4B71C216A50292BD58C9EBDD2F74E38FE 51FFD48C43326CBC
 txt01.example.         3600    IN      TXT     "foo"
 txt02.example.         3600    IN      TXT     "foo" "bar"
index 0f84bbe3abf2455a3d0a6272cb0cb0d3407b36dd..89b159edc4767a2de8ad7fc3c7a867bc23c07319 100644 (file)
@@ -14373,6 +14373,18 @@ view external {
                      </para>
                    </entry>
                  </row>
+                 <row rowsep="0">
+                   <entry colname="1">
+                     <para>
+                       TALINK
+                     </para>
+                   </entry>
+                   <entry colname="2">
+                     <para>
+                       Trust Anchor Link.  Experimental.
+                     </para>
+                   </entry>
+                 </row>
                  <row rowsep="0">
                    <entry colname="1">
                      <para>
index 1ba230160c0d50e4cef083f8f6a2ec5bc7430401..bb556a10cee70d0e7e000156e6c59082258dd14b 100644 (file)
       </listitem>
       <listitem>
        <para>
-         The following types have been implemented: NINFO, RKEY, SINK, TA.
+         The following types have been implemented: NINFO, RKEY, SINK, TA,
+         TALINK.
        </para>
       </listitem>
     </itemizedlist>
index 65ceb84152c973230a68a41f66b0643dc6d7bfa8..abdf3203ebf32523853582e8d5b413996fe47756 100644 (file)
@@ -49,7 +49,8 @@ fromtext_any_tsig(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        /*
index 34a059b343741f8e21d9d09a04735165cb27da87..5250bd5a9498c13ac82b5da4555d09a08ffe05cc 100644 (file)
@@ -44,7 +44,8 @@ fromtext_ch_a(ARGS_FROMTEXT) {
        /* get domain name */
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        if ((options & DNS_RDATA_CHECKNAMES) != 0 &&
            (options & DNS_RDATA_CHECKREVERSE) != 0) {
index 75f644f2c7ab7558b4adc16fd2e3510b4a66569a..88564a15026a5ff5724708e80a7c673db48823bc 100644 (file)
@@ -55,7 +55,8 @@ fromtext_afsdb(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)
index 3f8a69b28dbfdd4933af0d28a080203dd0f88f2d..fc7356189014a1160263a3e9784956c638678e47 100644 (file)
@@ -42,7 +42,8 @@ fromtext_cname(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index d181a6cd10c724425064d2738027bedf4fe84f8f..e061161f79c541864c551aaf7d22e808fa8d457b 100644 (file)
@@ -43,7 +43,8 @@ fromtext_dname(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 7c51d1f72a54b7facc9317db376ecbdc712b7dd3..8e7002298c3d31376eb2dffebc6d4d9e25c9fa9f 100644 (file)
@@ -94,6 +94,9 @@ fromtext_hip(ARGS_FROMTEXT) {
                RETTOK(ISC_R_RANGE);
        RETERR(uint16_tobuffer((isc_uint32_t)len, &key_len));
 
+       if (origin == NULL)
+               origin = dns_rootname;
+
        /*
         * Rendezvous Servers.
         */
@@ -105,7 +108,6 @@ fromtext_hip(ARGS_FROMTEXT) {
                if (token.type != isc_tokentype_string)
                        break;
                buffer_fromregion(&buffer, &token.value.as_region);
-               origin = (origin != NULL) ? origin : dns_rootname;
                RETTOK(dns_name_fromtext(&name, &buffer, origin, options,
                                         target));
        } while (1);
index c5462c1a69a84e1c7403d0a39fd841bb7804b382..cc6fb6d402d4ccfe7029046bd1f9947345ca9902 100644 (file)
@@ -104,7 +104,8 @@ fromtext_ipseckey(ARGS_FROMTEXT) {
        case 3:
                dns_name_init(&name, NULL);
                buffer_fromregion(&buffer, &token.value.as_region);
-               origin = (origin != NULL) ? origin : dns_rootname;
+               if (origin == NULL)
+                       origin = dns_rootname;
                RETTOK(dns_name_fromtext(&name, &buffer, origin,
                                         options, target));
                break;
index 08d6b17635935b58b078b93f9eff7d634c88ca44..b9e2f039f824239f0d2abb6cdcd9e4ea82a3223c 100644 (file)
@@ -46,7 +46,8 @@ fromtext_lp(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        return (dns_name_fromtext(&name, &buffer, origin, options, target));
 }
 
index 47c7308ebb03b0593006bc17533a3696b1a0dba8..cd92af512040d16f82886e88a0d68b9ca343df9e 100644 (file)
@@ -41,7 +41,8 @@ fromtext_mb(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 7485d1e4901680ede378b728c8a68fd85a207a1b..9738878aad4ec6247ba2bea064b51b5cdedc80aa 100644 (file)
@@ -41,7 +41,8 @@ fromtext_md(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 97402a9dc6dbc0c5a3e2c8602fed85c56b0eae4c..f7513fdbec57adf52ac0f5bc376a2d56a0ba9183 100644 (file)
@@ -41,7 +41,8 @@ fromtext_mf(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 6c3b7e2b2d4131f2765eb72f8bde5a1294793eba..3f50a9ed3447ed31ec4d01f39be05eaafe836119 100644 (file)
@@ -41,7 +41,8 @@ fromtext_mg(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 2a868f857f8f38f66ed666891a2895d420a0e7b4..173567ef6b353a902e17385a7116f48b398b41a2 100644 (file)
@@ -38,13 +38,15 @@ fromtext_minfo(ARGS_FROMTEXT) {
        UNUSED(rdclass);
        UNUSED(callbacks);
 
+       if (origin == NULL)
+               origin = dns_rootname;
+
        for (i = 0; i < 2; i++) {
                RETERR(isc_lex_getmastertoken(lexer, &token,
                                              isc_tokentype_string,
                                              ISC_FALSE));
                dns_name_init(&name, NULL);
                buffer_fromregion(&buffer, &token.value.as_region);
-               origin = (origin != NULL) ? origin : dns_rootname;
                RETTOK(dns_name_fromtext(&name, &buffer, origin,
                                         options, target));
                ok = ISC_TRUE;
index 7e69cf1cfe8537337eae7481fb0327c5bf7a129e..c82ad218868ae8ebdc852fbb6e6ebc4c645e4580 100644 (file)
@@ -41,7 +41,8 @@ fromtext_mr(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 7364b4ac1fd8f96b19fe799d19178bf86063907e..37fd7e6e5ba8c0cebcbdf1bdc7fa3bb39af9fce2 100644 (file)
@@ -77,7 +77,8 @@ fromtext_mx(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)
index e8cbda87b74ec746989b8ecb0cfbc2228790e2a2..418a9d25f1430376c56e5640d5f736c15176aecf 100644 (file)
@@ -181,7 +181,8 @@ fromtext_naptr(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index d7e095b09bf201d31e7bfba967fd98f0e130a660..eaac08c289d3a2cd6bf57ddee8870842991b98db 100644 (file)
@@ -42,7 +42,8 @@ fromtext_ns(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)
index 64bd757fd33a679a022f120381f545e66dfb1c8f..a020fba0a3f062b53f2b639ab27ac24e7c1774d7 100644 (file)
@@ -53,7 +53,8 @@ fromtext_nsec(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        memset(bm, 0, sizeof(bm));
index fbb34e9818ee24d67fa4e711971a94e0d97dbf39..b654611570ea44f3d9f7c5c565fefbb6e1699b3e 100644 (file)
@@ -55,7 +55,8 @@ fromtext_nxt(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        memset(bm, 0, sizeof(bm));
index e3f65cf28561a86c2ba3b50c687b880d99bd98a0..b81bf1f2a8e07f2b86840efd3c5b76961ed366ae 100644 (file)
@@ -41,7 +41,8 @@ fromtext_ptr(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        if (rdclass == dns_rdataclass_in &&
            (options & DNS_RDATA_CHECKNAMES) != 0 &&
index e67c25ec7a1ebce6ceb48ccc8dd46f785ccda266..440a75a140a2f756a4dd0781985688f1fcb8ecef 100644 (file)
@@ -38,7 +38,8 @@ fromtext_rp(ARGS_FROMTEXT) {
        UNUSED(rdclass);
        UNUSED(callbacks);
 
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
 
        for (i = 0; i < 2; i++) {
                RETERR(isc_lex_getmastertoken(lexer, &token,
index 1277e9d194f38393557b5238f353128c241d38b9..42b7ba04c3aca818eed4fb37d3d9e394e660c4e0 100644 (file)
@@ -141,7 +141,8 @@ fromtext_rrsig(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        /*
index a9a89b268f352f08e031e3f3629aff793ca3317e..ce6e99a0bbff58af74b6a4e0b49fe2a744625ed8 100644 (file)
@@ -50,7 +50,8 @@ fromtext_rt(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)
index af9c7daaa49845cea27fa0730c439e6e7fdb7244..0dff80af618e7fb78a650b2bd51e11c447a60dcd 100644 (file)
@@ -115,7 +115,8 @@ fromtext_sig(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        /*
index b407813811a4399bcaae72c1c62ebfddeec08c13..ec26a3d5f5eb6bc5adef35805cc1ab55ba530bc6 100644 (file)
@@ -39,7 +39,8 @@ fromtext_soa(ARGS_FROMTEXT) {
        UNUSED(rdclass);
        UNUSED(callbacks);
 
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
 
        for (i = 0; i < 2; i++) {
                RETERR(isc_lex_getmastertoken(lexer, &token,
diff --git a/lib/dns/rdata/generic/talink_58.c b/lib/dns/rdata/generic/talink_58.c
new file mode 100644 (file)
index 0000000..db46624
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (C) 2015  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef RDATA_GENERIC_TALINK_58_C
+#define RDATA_GENERIC_TALINK_58_C
+
+#define RRTYPE_TALINK_ATTRIBUTES 0
+
+static inline isc_result_t
+fromtext_talink(ARGS_FROMTEXT) {
+       isc_token_t token;
+       dns_name_t name;
+       isc_buffer_t buffer;
+       int i;
+
+       REQUIRE(type == dns_rdatatype_talink);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+       UNUSED(callbacks);
+
+       if (origin == NULL)
+               origin = dns_rootname;
+
+       for (i = 0; i < 2; i++) {
+               RETERR(isc_lex_getmastertoken(lexer, &token,
+                                             isc_tokentype_string,
+                                             ISC_FALSE));
+
+               dns_name_init(&name, NULL);
+               buffer_fromregion(&buffer, &token.value.as_region);
+               RETTOK(dns_name_fromtext(&name, &buffer, origin,
+                                        options, target));
+       }
+
+       return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+totext_talink(ARGS_TOTEXT) {
+       isc_region_t dregion;
+       dns_name_t prev;
+       dns_name_t next;
+       dns_name_t prefix;
+       isc_boolean_t sub;
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+       REQUIRE(rdata->length != 0);
+
+       dns_name_init(&prev, NULL);
+       dns_name_init(&next, NULL);
+       dns_name_init(&prefix, NULL);
+
+       dns_rdata_toregion(rdata, &dregion);
+
+       dns_name_fromregion(&prev, &dregion);
+       isc_region_consume(&dregion, name_length(&prev));
+
+       dns_name_fromregion(&next, &dregion);
+       isc_region_consume(&dregion, name_length(&next));
+
+       sub = name_prefix(&prev, tctx->origin, &prefix);
+       RETERR(dns_name_totext(&prefix, sub, target));
+
+       RETERR(str_totext(" ", target));
+
+       sub = name_prefix(&next, tctx->origin, &prefix);
+       return(dns_name_totext(&prefix, sub, target));
+}
+
+static inline isc_result_t
+fromwire_talink(ARGS_FROMWIRE) {
+       dns_name_t prev;
+       dns_name_t next;
+
+       REQUIRE(type == dns_rdatatype_talink);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+
+       dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
+
+       dns_name_init(&prev, NULL);
+       dns_name_init(&next, NULL);
+
+       RETERR(dns_name_fromwire(&prev, source, dctx, options, target));
+       return(dns_name_fromwire(&next, source, dctx, options, target));
+}
+
+static inline isc_result_t
+towire_talink(ARGS_TOWIRE) {
+       isc_region_t sregion;
+       dns_name_t prev;
+       dns_name_t next;
+       dns_offsets_t moffsets;
+       dns_offsets_t roffsets;
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+       REQUIRE(rdata->length != 0);
+
+       dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
+
+       dns_name_init(&prev, moffsets);
+       dns_name_init(&next, roffsets);
+
+       dns_rdata_toregion(rdata, &sregion);
+
+       dns_name_fromregion(&prev, &sregion);
+       isc_region_consume(&sregion, name_length(&prev));
+       RETERR(dns_name_towire(&prev, cctx, target));
+
+       dns_name_fromregion(&next, &sregion);
+       isc_region_consume(&sregion, name_length(&next));
+       return(dns_name_towire(&next, cctx, target));
+}
+
+static inline int
+compare_talink(ARGS_COMPARE) {
+       isc_region_t region1;
+       isc_region_t region2;
+
+       REQUIRE(rdata1->type == rdata2->type);
+       REQUIRE(rdata1->rdclass == rdata2->rdclass);
+       REQUIRE(rdata1->type == dns_rdatatype_talink);
+       REQUIRE(rdata1->length != 0);
+       REQUIRE(rdata2->length != 0);
+
+       dns_rdata_toregion(rdata1, &region1);
+       dns_rdata_toregion(rdata2, &region2);
+       return (isc_region_compare(&region1, &region2));
+}
+
+static inline isc_result_t
+fromstruct_talink(ARGS_FROMSTRUCT) {
+       dns_rdata_talink_t *talink = source;
+       isc_region_t region;
+
+       REQUIRE(type == dns_rdatatype_talink);
+       REQUIRE(source != NULL);
+       REQUIRE(talink->common.rdtype == type);
+       REQUIRE(talink->common.rdclass == rdclass);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+
+       dns_name_toregion(&talink->prev, &region);
+       RETERR(isc_buffer_copyregion(target, &region));
+       dns_name_toregion(&talink->next, &region);
+       return(isc_buffer_copyregion(target, &region));
+}
+
+static inline isc_result_t
+tostruct_talink(ARGS_TOSTRUCT) {
+       isc_region_t region;
+       dns_rdata_talink_t *talink = target;
+       dns_name_t name;
+       isc_result_t result;
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+       REQUIRE(target != NULL);
+       REQUIRE(rdata->length != 0);
+
+       talink->common.rdclass = rdata->rdclass;
+       talink->common.rdtype = rdata->type;
+       ISC_LINK_INIT(&talink->common, link);
+
+       dns_rdata_toregion(rdata, &region);
+
+       dns_name_init(&name, NULL);
+       dns_name_fromregion(&name, &region);
+       isc_region_consume(&region, name_length(&name));
+       dns_name_init(&talink->prev, NULL);
+       RETERR(name_duporclone(&name, mctx, &talink->prev));
+
+       dns_name_fromregion(&name, &region);
+       isc_region_consume(&region, name_length(&name));
+       dns_name_init(&talink->next, NULL);
+       result = name_duporclone(&name, mctx, &talink->next);
+       if (result != ISC_R_SUCCESS)
+               goto cleanup;
+
+       talink->mctx = mctx;
+       return (ISC_R_SUCCESS);
+
+ cleanup:
+       if (mctx != NULL)
+               dns_name_free(&talink->prev, mctx);
+       return (ISC_R_NOMEMORY);
+}
+
+static inline void
+freestruct_talink(ARGS_FREESTRUCT) {
+       dns_rdata_talink_t *talink = source;
+
+       REQUIRE(source != NULL);
+       REQUIRE(talink->common.rdtype == dns_rdatatype_talink);
+
+       if (talink->mctx == NULL)
+               return;
+
+       dns_name_free(&talink->prev, talink->mctx);
+       dns_name_free(&talink->next, talink->mctx);
+       talink->mctx = NULL;
+}
+
+static inline isc_result_t
+additionaldata_talink(ARGS_ADDLDATA) {
+       UNUSED(rdata);
+       UNUSED(add);
+       UNUSED(arg);
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+
+       return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+digest_talink(ARGS_DIGEST) {
+       isc_region_t r;
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+
+       dns_rdata_toregion(rdata, &r);
+       return ((digest)(arg, &r));
+}
+
+static inline isc_boolean_t
+checkowner_talink(ARGS_CHECKOWNER) {
+
+       REQUIRE(type == dns_rdatatype_talink);
+
+       UNUSED(name);
+       UNUSED(type);
+       UNUSED(rdclass);
+       UNUSED(wildcard);
+
+       return (ISC_TRUE);
+}
+
+static inline isc_boolean_t
+checknames_talink(ARGS_CHECKNAMES) {
+
+       REQUIRE(rdata->type == dns_rdatatype_talink);
+
+       UNUSED(bad);
+       UNUSED(owner);
+
+       return (ISC_TRUE);
+}
+
+static inline int
+casecompare_talink(ARGS_COMPARE) {
+       return (compare_talink(rdata1, rdata2));
+}
+
+#endif /* RDATA_GENERIC_TALINK_58_C */
diff --git a/lib/dns/rdata/generic/talink_58.h b/lib/dns/rdata/generic/talink_58.h
new file mode 100644 (file)
index 0000000..6e52d38
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2015  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* http://www.iana.org/assignments/dns-parameters/TALINK/talink-completed-template */
+
+#ifndef GENERIC_TALINK_58_H
+#define GENERIC_TALINK_58_H 1
+
+typedef struct dns_rdata_talink {
+       dns_rdatacommon_t       common;
+       isc_mem_t               *mctx;
+       dns_name_t              prev;
+       dns_name_t              next;
+} dns_rdata_talink_t;
+
+#endif /* GENERIC_TALINK_58_H */
index e87b88065c978c7c6b6663b8a22893ac0888014c..3cf702383f2ff91a56a7275f3dce62430027e07b 100644 (file)
@@ -50,7 +50,8 @@ fromtext_tkey(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
 
index 05a21ade89d2bca65a03b93d04051d0a3567fada..d8b76e54b6841649875a0b65df8fe28361463858 100644 (file)
@@ -83,7 +83,8 @@ fromtext_in_a6(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)
index 8b911eb07c2a9326e0c4215f26476e4d7d8e57f9..9a4130571da2ea74ad2581ee55a056a81d3fb8f0 100644 (file)
@@ -49,7 +49,8 @@ fromtext_in_kx(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index d8b43f2edca4fc089129c2aefeaf262854a578a0..764a85c091a940da85e725cd5e23397b31ad64bd 100644 (file)
@@ -44,7 +44,8 @@ fromtext_in_nsap_ptr(ARGS_FROMTEXT) {
 
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index 4cf0ae418ac052fafd407516ad46bd8e95a912ef..11d145ae2a861eefaf77850b368afca11df6743f 100644 (file)
@@ -39,6 +39,9 @@ fromtext_in_px(ARGS_FROMTEXT) {
        UNUSED(rdclass);
        UNUSED(callbacks);
 
+       if (origin == NULL)
+               origin = dns_rootname;
+
        /*
         * Preference.
         */
@@ -55,7 +58,6 @@ fromtext_in_px(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
 
        /*
@@ -65,7 +67,6 @@ fromtext_in_px(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        return (ISC_R_SUCCESS);
 }
index b97d410272f6a4f9cbd6e7fd0e0140d89ffb1d26..15b29d544e8ff94d46c6e6ae960b945fc676e148 100644 (file)
@@ -74,7 +74,8 @@ fromtext_in_srv(ARGS_FROMTEXT) {
                                      ISC_FALSE));
        dns_name_init(&name, NULL);
        buffer_fromregion(&buffer, &token.value.as_region);
-       origin = (origin != NULL) ? origin : dns_rootname;
+       if (origin == NULL)
+               origin = dns_rootname;
        RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
        ok = ISC_TRUE;
        if ((options & DNS_RDATA_CHECKNAMES) != 0)