]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4199. [protocol] Add support for NINFO, RKEY, SINK, TA.
authorMark Andrews <marka@isc.org>
Fri, 11 Sep 2015 07:35:01 +0000 (17:35 +1000)
committerMark Andrews <marka@isc.org>
Fri, 11 Sep 2015 07:35:01 +0000 (17:35 +1000)
                        [RT #40545] [RT #40547] [RT #40561] [RT #40563]

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/generic/sink_40.c [new file with mode: 0644]
lib/dns/rdata/generic/sink_40.h [new file with mode: 0644]

diff --git a/CHANGES b/CHANGES
index fbfa004a2c502dccd8ddb05646eb222f7e87bfd6..5a7cfd88d5af43133a7ffffb185a0fd639eef3a7 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -11,8 +11,8 @@
 4200.  [cleanup]       win32: update BINDinstall to be BIND release
                        independent. [RT #38915]
 
-4199.  [protocol]      Add support for NINFO, RKEY, TA.
-                       [RT #40545] [RT #40547] [RT #40563]
+4199.  [protocol]      Add support for NINFO, RKEY, SINK, TA.
+                       [RT #40545] [RT #40547] [RT #40561] [RT #40563]
 
 4198.  [placeholder]
 
index ba7d26d0caa0e923bf897fbe298d8d1bfc9c240c..8067e9537d83331802596d889bfa78c2d803afdb 100644 (file)
@@ -219,6 +219,10 @@ dname01                    DNAME   dname-target.
 dname02                        DNAME   dname-target
 dname03                        DNAME   .
 
+; type 40
+sink01                 SINK    1 0 0
+sink02                 SINK    8 0 2 l4ik
+
 ; type 41
 ; OPT is a meta-type and should never occur in master files.
 
index 0bbb0cb57bbfe350226caf1e5300a2650fe5b03f..88a411b1f0178c6894f0c3d04c706241005aa9fd 100644 (file)
@@ -37,6 +37,7 @@ KX
 CERT
 A6
 DNAME
+SINK
 APL
 DS
 SSHFP
index 9b1ff5a2c2ccc4a1a6a5217061d440573a166831..97b344ed33f9f55a879ce413650229750b684a13 100644 (file)
@@ -93,6 +93,8 @@ rp02.example.         3600    IN      RP      . .
 rt01.example.          3600    IN      RT      0 intermediate-host.example.
 rt02.example.          3600    IN      RT      65535 .
 rrsig01.example.               3600    IN      RRSIG   NSEC 1 3 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY=
+sink01.example.                3600    IN      SINK    1 0 0
+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
index c85d7656250435433d6408d3457096d223426e83..141460623d449a1210dcbebec1d327a817779a02 100644 (file)
@@ -93,6 +93,8 @@ rp02.example.         3600    IN      RP      . .
 rt01.example.          3600    IN      RT      0 intermediate-host.example.
 rt02.example.          3600    IN      RT      65535 .
 rrsig01.example.       3600    IN      RRSIG   NSEC 1 3 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY=
+sink01.example.                3600    IN      SINK    1 0 0
+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
index 574fadc1da14952387538d30f009e96bbd12b263..ae9ba4451bd5802611aa54b76b4aa5c5d8f79dad 100644 (file)
@@ -14250,6 +14250,18 @@ view external {
                      </para>
                    </entry>
                  </row>
+                 <row rowsep="0">
+                   <entry colname="1">
+                     <para>
+                       SINK
+                     </para>
+                   </entry>
+                   <entry colname="2">
+                     <para>
+                       The kitchen sink record.
+                     </para>
+                   </entry>
+                 </row>
                  <row rowsep="0">
                    <entry colname="1">
                      <para>
index c8c21606f76663d0f0570e4c2eb4f461f54256b8..1ba230160c0d50e4cef083f8f6a2ec5bc7430401 100644 (file)
       </listitem>
       <listitem>
        <para>
-         The following types have been implemented: NINFO, RKEY, TA.
+         The following types have been implemented: NINFO, RKEY, SINK, TA.
        </para>
       </listitem>
     </itemizedlist>
diff --git a/lib/dns/rdata/generic/sink_40.c b/lib/dns/rdata/generic/sink_40.c
new file mode 100644 (file)
index 0000000..dafa94b
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+ * 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_SINK_40_C
+#define RDATA_GENERIC_SINK_40_C
+
+#include <dst/dst.h>
+
+#define RRTYPE_SINK_ATTRIBUTES (0)
+
+static inline isc_result_t
+fromtext_sink(ARGS_FROMTEXT) {
+       isc_token_t token;
+
+       REQUIRE(type == dns_rdatatype_sink);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+       UNUSED(origin);
+       UNUSED(options);
+       UNUSED(callbacks);
+
+       /* meaning */
+       RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+                                     ISC_FALSE));
+       if (token.value.as_ulong > 0xffU)
+               RETTOK(ISC_R_RANGE);
+       RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+       /* coding */
+       RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+                                     ISC_FALSE));
+       if (token.value.as_ulong > 0xffU)
+               RETTOK(ISC_R_RANGE);
+       RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+       /* subcoding */
+       RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+                                     ISC_FALSE));
+       if (token.value.as_ulong > 0xffU)
+               RETTOK(ISC_R_RANGE);
+       RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+       return(isc_base64_tobuffer(lexer, target, -1));
+}
+
+static inline isc_result_t
+totext_sink(ARGS_TOTEXT) {
+       isc_region_t sr;
+       char buf[sizeof("255 255 255")];
+       isc_uint8_t meaning, coding, subcoding;
+
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+       REQUIRE(rdata->length >= 3);
+
+       dns_rdata_toregion(rdata, &sr);
+
+       /* Meaning, Coding and Subcoding */
+       meaning = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+       coding = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+       subcoding = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+       sprintf(buf, "%u %u %u", meaning, coding, subcoding);
+       RETERR(str_totext(buf, target));
+
+       if (sr.length == 0U)
+               return (ISC_R_SUCCESS);
+
+       /* data */
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
+               RETERR(str_totext(" (", target));
+
+       RETERR(str_totext(tctx->linebreak, target));
+
+       if (tctx->width == 0)   /* No splitting */
+               RETERR(isc_base64_totext(&sr, 60, "", target));
+       else
+               RETERR(isc_base64_totext(&sr, tctx->width - 2,
+                                        tctx->linebreak, target));
+
+       if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
+               RETERR(str_totext(" )", target));
+
+       return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+fromwire_sink(ARGS_FROMWIRE) {
+       isc_region_t sr;
+
+       REQUIRE(type == dns_rdatatype_sink);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+       UNUSED(dctx);
+       UNUSED(options);
+
+       isc_buffer_activeregion(source, &sr);
+       if (sr.length < 3)
+               return (ISC_R_UNEXPECTEDEND);
+
+       RETERR(mem_tobuffer(target, sr.base, sr.length));
+       isc_buffer_forward(source, sr.length);
+       return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+towire_sink(ARGS_TOWIRE) {
+
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+       REQUIRE(rdata->length >= 3);
+
+       UNUSED(cctx);
+
+       return (mem_tobuffer(target, rdata->data, rdata->length));
+}
+
+static inline int
+compare_sink(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_sink);
+       REQUIRE(rdata1->length >= 3);
+       REQUIRE(rdata2->length >= 3);
+
+       dns_rdata_toregion(rdata1, &r1);
+       dns_rdata_toregion(rdata2, &r2);
+       return (isc_region_compare(&r1, &r2));
+}
+
+static inline isc_result_t
+fromstruct_sink(ARGS_FROMSTRUCT) {
+       dns_rdata_sink_t *sink = source;
+
+       REQUIRE(type == dns_rdatatype_sink);
+       REQUIRE(source != NULL);
+       REQUIRE(sink->common.rdtype == type);
+       REQUIRE(sink->common.rdclass == rdclass);
+
+       UNUSED(type);
+       UNUSED(rdclass);
+
+       /* Meaning */
+       RETERR(uint8_tobuffer(sink->meaning, target));
+
+       /* Coding */
+       RETERR(uint8_tobuffer(sink->coding, target));
+
+       /* Subcoding */
+       RETERR(uint8_tobuffer(sink->subcoding, target));
+
+       /* Data */
+       return (mem_tobuffer(target, sink->data, sink->datalen));
+}
+
+static inline isc_result_t
+tostruct_sink(ARGS_TOSTRUCT) {
+       dns_rdata_sink_t *sink = target;
+       isc_region_t sr;
+
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+       REQUIRE(target != NULL);
+       REQUIRE(rdata->length >= 3);
+
+       sink->common.rdclass = rdata->rdclass;
+       sink->common.rdtype = rdata->type;
+       ISC_LINK_INIT(&sink->common, link);
+
+       dns_rdata_toregion(rdata, &sr);
+
+       /* Meaning */
+       if (sr.length < 1)
+               return (ISC_R_UNEXPECTEDEND);
+       sink->meaning = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+
+       /* Coding */
+       if (sr.length < 1)
+               return (ISC_R_UNEXPECTEDEND);
+       sink->coding = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+
+       /* Subcoding */
+       if (sr.length < 1)
+               return (ISC_R_UNEXPECTEDEND);
+       sink->subcoding = uint8_fromregion(&sr);
+       isc_region_consume(&sr, 1);
+
+       /* Data */
+       sink->datalen = sr.length;
+       sink->data = mem_maybedup(mctx, sr.base, sink->datalen);
+       if (sink->data == NULL)
+               return (ISC_R_NOMEMORY);
+
+       sink->mctx = mctx;
+       return (ISC_R_SUCCESS);
+}
+
+static inline void
+freestruct_sink(ARGS_FREESTRUCT) {
+       dns_rdata_sink_t *sink = (dns_rdata_sink_t *) source;
+
+       REQUIRE(source != NULL);
+       REQUIRE(sink->common.rdtype == dns_rdatatype_sink);
+
+       if (sink->mctx == NULL)
+               return;
+
+       if (sink->data != NULL)
+               isc_mem_free(sink->mctx, sink->data);
+       sink->mctx = NULL;
+}
+
+static inline isc_result_t
+additionaldata_sink(ARGS_ADDLDATA) {
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+
+       UNUSED(rdata);
+       UNUSED(add);
+       UNUSED(arg);
+
+       return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+digest_sink(ARGS_DIGEST) {
+       isc_region_t r;
+
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+
+       dns_rdata_toregion(rdata, &r);
+
+       return ((digest)(arg, &r));
+}
+
+static inline isc_boolean_t
+checkowner_sink(ARGS_CHECKOWNER) {
+
+       REQUIRE(type == dns_rdatatype_sink);
+
+       UNUSED(name);
+       UNUSED(type);
+       UNUSED(rdclass);
+       UNUSED(wildcard);
+
+       return (ISC_TRUE);
+}
+
+static inline isc_boolean_t
+checknames_sink(ARGS_CHECKNAMES) {
+
+       REQUIRE(rdata->type == dns_rdatatype_sink);
+
+       UNUSED(rdata);
+       UNUSED(owner);
+       UNUSED(bad);
+
+       return (ISC_TRUE);
+}
+
+static inline int
+casecompare_sink(ARGS_COMPARE) {
+       return (compare_sink(rdata1, rdata2));
+}
+#endif /* RDATA_GENERIC_SINK_40_C */
diff --git a/lib/dns/rdata/generic/sink_40.h b/lib/dns/rdata/generic/sink_40.h
new file mode 100644 (file)
index 0000000..e6a2400
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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 GENERIC_SINK_40_H
+#define GENERIC_SINK_40_H 1
+
+typedef struct dns_rdata_sink_t {
+       dns_rdatacommon_t       common;
+       isc_mem_t *             mctx;
+       isc_uint8_t             meaning;
+       isc_uint8_t             coding;
+       isc_uint8_t             subcoding;
+       isc_uint16_t            datalen;
+       unsigned char *         data;
+} dns_rdata_sink_t;
+
+#endif /* GENERIC_SINK_40_H */