1999-01-18 21:20:26 -05:00
|
|
|
/*
|
2009-12-04 17:06:37 -05:00
|
|
|
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
1999-09-15 19:03:43 -04:00
|
|
|
*
|
1999-01-18 21:20:26 -05:00
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
2021-06-03 02:37:05 -04:00
|
|
|
*
|
1999-01-18 21:20:26 -05: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
|
|
|
|
|
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 03:53:12 -05:00
|
|
|
*
|
1999-01-18 21:20:26 -05:00
|
|
|
* See the COPYRIGHT file distributed with this work for additional
|
|
|
|
|
* information regarding copyright ownership.
|
|
|
|
|
*/
|
|
|
|
|
|
1999-05-04 20:19:04 -04:00
|
|
|
#ifndef RDATA_GENERIC_ #_ #_C
|
|
|
|
|
#define RDATA_GENERIC_ #_ #_C
|
1999-01-19 01:49:33 -05:00
|
|
|
|
1999-05-04 20:19:04 -04:00
|
|
|
#define RRTYPE_ #_ATTRIBUTES(0)
|
1999-01-19 00:38:36 -05:00
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t fromtext_ #(ARGS_FROMTEXT) {
|
1999-01-22 00:02:49 -05:00
|
|
|
isc_token_t token;
|
1999-01-18 21:20:26 -05:00
|
|
|
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdclass == #);
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2000-11-07 20:56:15 -05:00
|
|
|
RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
|
2018-04-17 11:29:14 -04:00
|
|
|
false));
|
1999-01-22 00:02:49 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t totext_ #(ARGS_TOTEXT) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
2000-10-25 01:44:10 -04:00
|
|
|
REQUIRE(rdata->length != 0); /* XXX */
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t fromwire_ #(ARGS_FROMWIRE) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdclass == #);
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2022-05-05 09:52:44 -04:00
|
|
|
/* see RFC 3597 */
|
2022-05-05 11:36:52 -04:00
|
|
|
dctx = dns_decompress_setpermitted(dctx, false);
|
1999-02-24 01:31:35 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t towire_ #(ARGS_TOWIRE) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
2000-10-25 01:44:10 -04:00
|
|
|
REQUIRE(rdata->length != 0); /* XXX */
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2022-05-05 09:52:44 -04:00
|
|
|
/* see RFC 3597 */
|
|
|
|
|
dns_compress_setpermitted(cctx, false);
|
1999-02-22 02:24:05 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static int compare_ #(ARGS_COMPARE) {
|
1999-01-22 00:02:49 -05:00
|
|
|
isc_region_t r1;
|
|
|
|
|
isc_region_t r2;
|
1999-01-18 21:20:26 -05:00
|
|
|
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata1->type == dns_rdatatype_proforma.crdata2->type);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata1->rdclass == rdata2->rdclass);
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata1->type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata1->rdclass == #);
|
2000-10-25 01:44:10 -04:00
|
|
|
REQUIRE(rdata1->length != 0); /* XXX */
|
|
|
|
|
REQUIRE(rdata2->length != 0); /* XXX */
|
1999-01-19 01:49:33 -05:00
|
|
|
|
1999-01-22 00:02:49 -05:00
|
|
|
dns_rdata_toregion(rdata1, &r1);
|
|
|
|
|
dns_rdata_toregion(rdata2, &r2);
|
2002-01-05 02:05:28 -05:00
|
|
|
return isc_region_compare(&r1, &r2);
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t fromstruct_ #(ARGS_FROMSTRUCT) {
|
2000-05-22 08:38:12 -04:00
|
|
|
dns_rdata_ #_t *# = source;
|
1999-01-18 21:20:26 -05:00
|
|
|
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdclass == #);
|
2019-09-27 04:40:51 -04:00
|
|
|
REQUIRE(# != NULL);
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(#->common.rdtype == dns_rdatatype_proforma.ctype);
|
2000-05-22 08:38:12 -04:00
|
|
|
REQUIRE(#->common.rdclass == rdclass);
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t tostruct_ #(ARGS_TOSTRUCT) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
2000-10-25 01:44:10 -04:00
|
|
|
REQUIRE(rdata->length != 0); /* XXX */
|
1999-01-19 01:49:33 -05:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_NOTIMPLEMENTED;
|
1999-01-18 21:20:26 -05:00
|
|
|
}
|
1999-05-06 23:24:15 -04:00
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static void freestruct_ #(ARGS_FREESTRUCT) {
|
1999-05-06 23:24:15 -04:00
|
|
|
dns_rdata_ #_t *# = source;
|
|
|
|
|
|
2019-09-27 04:40:51 -04:00
|
|
|
REQUIRE(# != NULL);
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(#->common.rdtype == dns_rdatatype_proforma.c #);
|
1999-05-06 23:24:15 -04:00
|
|
|
REQUIRE(#->common.rdclass == #);
|
|
|
|
|
}
|
1999-08-02 18:18:31 -04:00
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t additionaldata_ #(ARGS_ADDLDATA) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
1999-08-02 18:18:31 -04:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
|
|
|
|
|
2019-07-05 02:20:20 -04:00
|
|
|
UNUSED(owner);
|
|
|
|
|
UNUSED(add);
|
|
|
|
|
UNUSED(arg);
|
1999-08-02 18:18:31 -04:00
|
|
|
|
2000-04-06 18:03:35 -04:00
|
|
|
return ISC_R_SUCCESS;
|
1999-08-02 18:18:31 -04:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static isc_result_t digest_ #(ARGS_DIGEST) {
|
1999-08-31 18:05:55 -04:00
|
|
|
isc_region_t r;
|
|
|
|
|
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
1999-08-31 18:05:55 -04:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
|
|
|
|
|
|
|
|
|
dns_rdata_toregion(rdata, &r);
|
|
|
|
|
|
|
|
|
|
return (digest)(arg, &r);
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static bool checkowner_ #(ARGS_CHECKOWNER) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(type == dns_rdatatype_proforma.c #);
|
2004-02-27 15:41:51 -05:00
|
|
|
REQUIRE(rdclass == #);
|
|
|
|
|
|
|
|
|
|
UNUSED(name);
|
|
|
|
|
UNUSED(type);
|
|
|
|
|
UNUSED(rdclass);
|
|
|
|
|
UNUSED(wildcard);
|
|
|
|
|
|
2018-04-17 11:29:14 -04:00
|
|
|
return true;
|
2004-02-27 15:41:51 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static bool checknames_ #(ARGS_CHECKNAMES) {
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata->type == dns_rdatatype_proforma.c #);
|
2004-02-27 15:41:51 -05:00
|
|
|
REQUIRE(rdata->rdclass == #);
|
|
|
|
|
|
|
|
|
|
UNUSED(rdata);
|
|
|
|
|
UNUSED(owner);
|
|
|
|
|
UNUSED(bad);
|
|
|
|
|
|
2018-04-17 11:29:14 -04:00
|
|
|
return true;
|
2004-02-27 15:41:51 -05:00
|
|
|
}
|
|
|
|
|
|
2021-10-11 07:43:12 -04:00
|
|
|
static int casecompare_ #(ARGS_COMPARE) {
|
2009-12-04 16:09:34 -05:00
|
|
|
isc_region_t r1;
|
|
|
|
|
isc_region_t r2;
|
|
|
|
|
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata1->type == dns_rdatatype_proforma.crdata2->type);
|
2009-12-04 16:09:34 -05:00
|
|
|
REQUIRE(rdata1->rdclass == rdata2->rdclass);
|
2015-08-17 02:53:35 -04:00
|
|
|
REQUIRE(rdata1->type == dns_rdatatype_proforma.c #);
|
2009-12-04 16:09:34 -05:00
|
|
|
REQUIRE(rdata1->rdclass == #);
|
|
|
|
|
REQUIRE(rdata1->length != 0); /* XXX */
|
|
|
|
|
REQUIRE(rdata2->length != 0); /* XXX */
|
|
|
|
|
|
|
|
|
|
dns_rdata_toregion(rdata1, &r1);
|
|
|
|
|
dns_rdata_toregion(rdata2, &r2);
|
|
|
|
|
return isc_region_compare(&r1, &r2);
|
|
|
|
|
}
|
|
|
|
|
|
1999-05-04 20:19:04 -04:00
|
|
|
#endif /* RDATA_GENERIC_#_#_C */
|