mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 01:42:07 -04:00
4214. [protocol] Add support for TALINK. [RT #40544]
This commit is contained in:
parent
9e86fc48e0
commit
e0a30050c8
40 changed files with 391 additions and 35 deletions
2
CHANGES
2
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]
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ TLSA
|
|||
HIP
|
||||
NINFO
|
||||
RKEY
|
||||
TALINK
|
||||
CDS
|
||||
CDNSKEY
|
||||
OPENPGPKEY
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -452,7 +452,8 @@
|
|||
</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>
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
269
lib/dns/rdata/generic/talink_58.c
Normal file
269
lib/dns/rdata/generic/talink_58.c
Normal file
|
|
@ -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, ®ion1);
|
||||
dns_rdata_toregion(rdata2, ®ion2);
|
||||
return (isc_region_compare(®ion1, ®ion2));
|
||||
}
|
||||
|
||||
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, ®ion);
|
||||
RETERR(isc_buffer_copyregion(target, ®ion));
|
||||
dns_name_toregion(&talink->next, ®ion);
|
||||
return(isc_buffer_copyregion(target, ®ion));
|
||||
}
|
||||
|
||||
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, ®ion);
|
||||
|
||||
dns_name_init(&name, NULL);
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
isc_region_consume(®ion, name_length(&name));
|
||||
dns_name_init(&talink->prev, NULL);
|
||||
RETERR(name_duporclone(&name, mctx, &talink->prev));
|
||||
|
||||
dns_name_fromregion(&name, ®ion);
|
||||
isc_region_consume(®ion, 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 */
|
||||
29
lib/dns/rdata/generic/talink_58.h
Normal file
29
lib/dns/rdata/generic/talink_58.h
Normal file
|
|
@ -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 */
|
||||
|
|
@ -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));
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue