e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews/*
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Copyright (C) 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews *
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * file, You can obtain one at http://mozilla.org/MPL/2.0/.
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews */
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews#ifndef RDATA_GENERIC_TALINK_58_C
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews#define RDATA_GENERIC_TALINK_58_C
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews#define RRTYPE_TALINK_ATTRIBUTES 0
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsfromtext_talink(ARGS_FROMTEXT) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_token_t token;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t name;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_buffer_t buffer;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews int i;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(callbacks);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews if (origin == NULL)
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews origin = dns_rootname;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews for (i = 0; i < 2; i++) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(isc_lex_getmastertoken(lexer, &token,
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_tokentype_string,
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews ISC_FALSE));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&name, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews buffer_fromregion(&buffer, &token.value.as_region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETTOK(dns_name_fromtext(&name, &buffer, origin,
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews options, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews }
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_R_SUCCESS);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewstotext_talink(ARGS_TOTEXT) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t dregion;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t prev;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t next;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t prefix;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_boolean_t sub;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->length != 0);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&prev, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&next, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&prefix, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata, &dregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&prev, &dregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&dregion, name_length(&prev));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&next, &dregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&dregion, name_length(&next));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews sub = name_prefix(&prev, tctx->origin, &prefix);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(dns_name_totext(&prefix, sub, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(str_totext(" ", target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews sub = name_prefix(&next, tctx->origin, &prefix);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return(dns_name_totext(&prefix, sub, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsfromwire_talink(ARGS_FROMWIRE) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t prev;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t next;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_decompress_setmethods(dctx, DNS_COMPRESS_NONE);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&prev, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&next, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(dns_name_fromwire(&prev, source, dctx, options, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return(dns_name_fromwire(&next, source, dctx, options, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewstowire_talink(ARGS_TOWIRE) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t sregion;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t prev;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t next;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_offsets_t moffsets;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_offsets_t roffsets;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->length != 0);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_compress_setmethods(cctx, DNS_COMPRESS_NONE);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&prev, moffsets);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&next, roffsets);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata, &sregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&prev, &sregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&sregion, name_length(&prev));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(dns_name_towire(&prev, cctx, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&next, &sregion);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&sregion, name_length(&next));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return(dns_name_towire(&next, cctx, target));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline int
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewscompare_talink(ARGS_COMPARE) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t region1;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t region2;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata1->type == rdata2->type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata1->rdclass == rdata2->rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata1->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata1->length != 0);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata2->length != 0);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata1, &region1);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata2, &region2);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (isc_region_compare(&region1, &region2));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsfromstruct_talink(ARGS_FROMSTRUCT) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_talink_t *talink = source;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t region;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(source != NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(talink->common.rdtype == type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(talink->common.rdclass == rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_toregion(&talink->prev, &region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(isc_buffer_copyregion(target, &region));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_toregion(&talink->next, &region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return(isc_buffer_copyregion(target, &region));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewstostruct_talink(ARGS_TOSTRUCT) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t region;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_talink_t *talink = target;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_t name;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_result_t result;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(target != NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->length != 0);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews talink->common.rdclass = rdata->rdclass;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews talink->common.rdtype = rdata->type;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews ISC_LINK_INIT(&talink->common, link);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata, &region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&name, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&name, &region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&region, name_length(&name));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&talink->prev, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews RETERR(name_duporclone(&name, mctx, &talink->prev));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_fromregion(&name, &region);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_consume(&region, name_length(&name));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_init(&talink->next, NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews result = name_duporclone(&name, mctx, &talink->next);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews if (result != ISC_R_SUCCESS)
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews goto cleanup;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews talink->mctx = mctx;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_R_SUCCESS);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews cleanup:
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews if (mctx != NULL)
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_free(&talink->prev, mctx);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_R_NOMEMORY);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline void
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsfreestruct_talink(ARGS_FREESTRUCT) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_talink_t *talink = source;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(source != NULL);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(talink->common.rdtype == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews if (talink->mctx == NULL)
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_free(&talink->prev, talink->mctx);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_name_free(&talink->next, talink->mctx);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews talink->mctx = NULL;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsadditionaldata_talink(ARGS_ADDLDATA) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(rdata);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(add);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(arg);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_R_SUCCESS);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_result_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsdigest_talink(ARGS_DIGEST) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews isc_region_t r;
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews dns_rdata_toregion(rdata, &r);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return ((digest)(arg, &r));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_boolean_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewscheckowner_talink(ARGS_CHECKOWNER) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(name);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(type);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(rdclass);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(wildcard);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_TRUE);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline isc_boolean_t
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewschecknames_talink(ARGS_CHECKNAMES) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews REQUIRE(rdata->type == dns_rdatatype_talink);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(bad);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews UNUSED(owner);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (ISC_TRUE);
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewsstatic inline int
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrewscasecompare_talink(ARGS_COMPARE) {
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews return (compare_talink(rdata1, rdata2));
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews}
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews
e0a30050c8516a3d54a4f8dcdd88435704a8a3edMark Andrews#endif /* RDATA_GENERIC_TALINK_58_C */