2004-03-10 02:19:58 +00:00
|
|
|
/*
|
2018-02-23 09:53:12 +01:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2004-03-10 02:19:58 +00:00
|
|
|
*
|
2021-06-03 08:37:05 +02:00
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*
|
2016-06-27 14:56:38 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
*
|
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
|
|
* information regarding copyright ownership.
|
2004-03-10 02:19:58 +00:00
|
|
|
*/
|
|
|
|
|
2012-10-03 12:38:43 +10:00
|
|
|
/* RFC3658 */
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2006-02-17 01:04:14 +00:00
|
|
|
#ifndef RDATA_GENERIC_DLV_32769_C
|
|
|
|
#define RDATA_GENERIC_DLV_32769_C
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
#define RRTYPE_DLV_ATTRIBUTES 0
|
|
|
|
|
2007-02-26 01:20:44 +00:00
|
|
|
#include <dns/ds.h>
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
fromtext_dlv(ARGS_FROMTEXT) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2020-07-17 12:23:19 +10:00
|
|
|
return (generic_fromtext_ds(CALL_FROMTEXT));
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
totext_dlv(ARGS_TOTEXT) {
|
2020-07-17 12:23:19 +10:00
|
|
|
REQUIRE(rdata != NULL);
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2020-07-17 12:23:19 +10:00
|
|
|
return (generic_totext_ds(CALL_TOTEXT));
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
fromwire_dlv(ARGS_FROMWIRE) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2020-07-17 12:23:19 +10:00
|
|
|
return (generic_fromwire_ds(CALL_FROMWIRE));
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
towire_dlv(ARGS_TOWIRE) {
|
2004-03-10 02:19:58 +00:00
|
|
|
isc_region_t sr;
|
|
|
|
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
REQUIRE(rdata->length != 0);
|
|
|
|
|
|
|
|
UNUSED(cctx);
|
|
|
|
|
|
|
|
dns_rdata_toregion(rdata, &sr);
|
|
|
|
return (mem_tobuffer(target, sr.base, sr.length));
|
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static int
|
2020-02-13 14:44:37 -08:00
|
|
|
compare_dlv(ARGS_COMPARE) {
|
2004-03-10 02:19:58 +00:00
|
|
|
isc_region_t r1;
|
|
|
|
isc_region_t r2;
|
|
|
|
|
|
|
|
REQUIRE(rdata1->type == rdata2->type);
|
|
|
|
REQUIRE(rdata1->rdclass == rdata2->rdclass);
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata1->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
REQUIRE(rdata1->length != 0);
|
|
|
|
REQUIRE(rdata2->length != 0);
|
|
|
|
|
|
|
|
dns_rdata_toregion(rdata1, &r1);
|
|
|
|
dns_rdata_toregion(rdata2, &r2);
|
|
|
|
return (isc_region_compare(&r1, &r2));
|
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
fromstruct_dlv(ARGS_FROMSTRUCT) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(type == dns_rdatatype_dlv);
|
2015-09-10 17:58:29 +10:00
|
|
|
|
2020-07-17 12:23:19 +10:00
|
|
|
return (generic_fromstruct_ds(CALL_FROMSTRUCT));
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
tostruct_dlv(ARGS_TOSTRUCT) {
|
2004-03-10 02:19:58 +00:00
|
|
|
dns_rdata_dlv_t *dlv = target;
|
|
|
|
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2019-09-27 10:40:51 +02:00
|
|
|
REQUIRE(dlv != NULL);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
dlv->common.rdclass = rdata->rdclass;
|
|
|
|
dlv->common.rdtype = rdata->type;
|
|
|
|
ISC_LINK_INIT(&dlv->common, link);
|
|
|
|
|
2020-07-17 12:23:19 +10:00
|
|
|
return (generic_tostruct_ds(CALL_TOSTRUCT));
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static void
|
2020-02-13 14:44:37 -08:00
|
|
|
freestruct_dlv(ARGS_FREESTRUCT) {
|
2004-03-10 02:19:58 +00:00
|
|
|
dns_rdata_dlv_t *dlv = source;
|
|
|
|
|
|
|
|
REQUIRE(dlv != NULL);
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(dlv->common.rdtype == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2020-02-13 21:48:23 +01:00
|
|
|
if (dlv->mctx == NULL) {
|
2004-03-10 02:19:58 +00:00
|
|
|
return;
|
2020-02-13 21:48:23 +01:00
|
|
|
}
|
2004-03-10 02:19:58 +00:00
|
|
|
|
2020-02-13 21:48:23 +01:00
|
|
|
if (dlv->digest != NULL) {
|
2004-03-10 02:19:58 +00:00
|
|
|
isc_mem_free(dlv->mctx, dlv->digest);
|
2020-02-13 21:48:23 +01:00
|
|
|
}
|
2004-03-10 02:19:58 +00:00
|
|
|
dlv->mctx = NULL;
|
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
additionaldata_dlv(ARGS_ADDLDATA) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
UNUSED(rdata);
|
2019-07-05 16:20:20 +10:00
|
|
|
UNUSED(owner);
|
2004-03-10 02:19:58 +00:00
|
|
|
UNUSED(add);
|
|
|
|
UNUSED(arg);
|
|
|
|
|
|
|
|
return (ISC_R_SUCCESS);
|
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static isc_result_t
|
2020-02-13 14:44:37 -08:00
|
|
|
digest_dlv(ARGS_DIGEST) {
|
2004-03-10 02:19:58 +00:00
|
|
|
isc_region_t r;
|
|
|
|
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
dns_rdata_toregion(rdata, &r);
|
|
|
|
|
|
|
|
return ((digest)(arg, &r));
|
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static bool
|
2020-02-13 14:44:37 -08:00
|
|
|
checkowner_dlv(ARGS_CHECKOWNER) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
UNUSED(name);
|
|
|
|
UNUSED(type);
|
|
|
|
UNUSED(rdclass);
|
|
|
|
UNUSED(wildcard);
|
|
|
|
|
2018-04-17 08:29:14 -07:00
|
|
|
return (true);
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static bool
|
2020-02-13 14:44:37 -08:00
|
|
|
checknames_dlv(ARGS_CHECKNAMES) {
|
2015-08-17 12:23:35 +05:30
|
|
|
REQUIRE(rdata->type == dns_rdatatype_dlv);
|
2004-03-10 02:19:58 +00:00
|
|
|
|
|
|
|
UNUSED(rdata);
|
|
|
|
UNUSED(owner);
|
|
|
|
UNUSED(bad);
|
|
|
|
|
2018-04-17 08:29:14 -07:00
|
|
|
return (true);
|
2004-03-10 02:19:58 +00:00
|
|
|
}
|
|
|
|
|
2021-10-11 13:43:12 +02:00
|
|
|
static int
|
2020-02-13 14:44:37 -08:00
|
|
|
casecompare_dlv(ARGS_COMPARE) {
|
2009-12-04 21:09:34 +00:00
|
|
|
return (compare_dlv(rdata1, rdata2));
|
|
|
|
}
|
|
|
|
|
2020-02-12 13:59:18 +01:00
|
|
|
#endif /* RDATA_GENERIC_DLV_32769_C */
|