e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley/*
9a006fe9a05abc03c0e81977802194dab8737206Tinderbox User * Copyright (C) 2002, 2004, 2005, 2007-2009, 2014-2016 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence *
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/.
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley */
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
28a8f5b0de57d269cf2845c69cb6abe18cbd3b3aMark Andrews/* $Id: apl_42.c,v 1.16 2009/12/04 22:06:37 tbox Exp $ */
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley/* RFC3123 */
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉#ifndef RDATA_IN_1_APL_42_C
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt#define RDATA_IN_1_APL_42_C
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt#define RRTYPE_APL_ATTRIBUTES (0)
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt
64ecc88345766e124e1fb053dbf4e36550471f83Evan Huntstatic inline isc_result_t
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉fromtext_in_apl(ARGS_FROMTEXT) {
78576fe0db75332cd956b037d90dad0c7e09b005Tatuya JINMEI 神明達哉 isc_token_t token;
cfb605168d7403d3c967eec1b761519712e11ce3Mark Andrews unsigned char addr[16];
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 unsigned long afi;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_uint8_t prefix;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_uint8_t len;
d8c1e4eccf5bf88a3b4f8dc4a24391b5712bb3a3Mark Andrews isc_boolean_t neg;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley char *cp, *ap, *slash;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington int n;
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley REQUIRE(type == dns_rdatatype_apl);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt REQUIRE(rdclass == dns_rdataclass_in);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews UNUSED(type);
1a69a1a78cfaa86f3b68bbc965232b7876d4da2aDavid Lawrence UNUSED(rdclass);
364a82f7c25b62967678027043425201a5e5171aBob Halley UNUSED(origin);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley UNUSED(options);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt UNUSED(callbacks);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt do {
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt RETERR(isc_lex_getmastertoken(lexer, &token,
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 isc_tokentype_string, ISC_TRUE));
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (token.type != isc_tokentype_string)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 break;
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 cp = DNS_AS_STR(token);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 neg = ISC_TF(*cp == '!');
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (neg)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 cp++;
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 afi = strtoul(cp, &ap, 10);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (*ap++ != ':' || cp == ap)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(DNS_R_SYNTAX);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (afi > 0xffffU)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(ISC_R_RANGE);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 slash = strchr(ap, '/');
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (slash == NULL || slash == ap)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(DNS_R_SYNTAX);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(isc_parse_uint8(&prefix, slash + 1, 10));
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt switch (afi) {
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt case 1:
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 *slash = '\0';
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 n = inet_pton(AF_INET, ap, addr);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 *slash = '/';
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt if (n != 1)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(DNS_R_BADDOTTEDQUAD);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt if (prefix > 32)
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt RETTOK(ISC_R_RANGE);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt for (len = 4; len > 0; len--)
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt if (addr[len - 1] != 0)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 break;
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 break;
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 case 2:
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 *slash = '\0';
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 n = inet_pton(AF_INET6, ap, addr);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt *slash = '/';
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt if (n != 1)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETTOK(DNS_R_BADAAAA);
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (prefix > 128)
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt RETTOK(ISC_R_RANGE);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt for (len = 16; len > 0; len--)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 if (addr[len - 1] != 0)
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 break;
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt break;
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt default:
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt RETTOK(ISC_R_NOTIMPLEMENTED);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt }
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt RETERR(uint16_tobuffer(afi, target));
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt RETERR(uint8_tobuffer(prefix, target));
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETERR(uint8_tobuffer(len | ((neg) ? 0x80 : 0), target));
386d3a99c190bad55edf44d076e6bd087e230ab8Tatuya JINMEI 神明達哉 RETERR(mem_tobuffer(target, addr, len));
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt } while (1);
64ecc88345766e124e1fb053dbf4e36550471f83Evan Hunt
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt /*
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt * Let upper layer handle eol/eof.
435532822dc571a904207d8176e063cc8731eef5Bob Halley */
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt isc_lex_ungettoken(lexer, &token);
785d1541b6ec7c6939ec8ebf409db367943bab5fAndreas Gustafsson
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt return (ISC_R_SUCCESS);
9d99e3fda11eb8549a2bc7d5af31b7630ed68162Mark Andrews}
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt
435532822dc571a904207d8176e063cc8731eef5Bob Halleystatic inline isc_result_t
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunttotext_in_apl(ARGS_TOTEXT) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_region_t sr;
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt isc_region_t ir;
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn isc_uint16_t afi;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews isc_uint8_t prefix;
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn isc_uint8_t len;
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn isc_boolean_t neg;
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt unsigned char buf[16];
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt char txt[sizeof(" !64000:")];
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn const char *sep = "";
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn int n;
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn REQUIRE(rdata->type == dns_rdatatype_apl);
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn REQUIRE(rdata->rdclass == dns_rdataclass_in);
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn UNUSED(tctx);
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt dns_rdata_toregion(rdata, &sr);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt ir.base = buf;
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt ir.length = sizeof(buf);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley while (sr.length > 0) {
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews INSIST(sr.length >= 4);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews afi = uint16_fromregion(&sr);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews isc_region_consume(&sr, 2);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt prefix = *sr.base;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_consume(&sr, 1);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley len = (*sr.base & 0x7f);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley neg = ISC_TF((*sr.base & 0x80) != 0);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_consume(&sr, 1);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington INSIST(len <= sr.length);
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews n = snprintf(txt, sizeof(txt), "%s%s%u:", sep,
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley neg ? "!" : "", afi);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley INSIST(n < (int)sizeof(txt));
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley RETERR(str_totext(txt, target));
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley switch (afi) {
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley case 1:
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley INSIST(len <= 4);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley INSIST(prefix <= 32);
cb9345c996de9d9c990009f14fc83fbbe9c5e3e6Mark Andrews memset(buf, 0, sizeof(buf));
cb9345c996de9d9c990009f14fc83fbbe9c5e3e6Mark Andrews memmove(buf, sr.base, len);
cb9345c996de9d9c990009f14fc83fbbe9c5e3e6Mark Andrews RETERR(inet_totext(AF_INET, &ir, target));
dcf8825fd74f3f83b1882af4793270083b125ee5David Lawrence break;
dcf8825fd74f3f83b1882af4793270083b125ee5David Lawrence
dcf8825fd74f3f83b1882af4793270083b125ee5David Lawrence case 2:
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley INSIST(len <= 16);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley INSIST(prefix <= 128);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley memset(buf, 0, sizeof(buf));
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley memmove(buf, sr.base, len);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley RETERR(inet_totext(AF_INET6, &ir, target));
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews break;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence default:
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence return (ISC_R_NOTIMPLEMENTED);
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence }
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence n = snprintf(txt, sizeof(txt), "/%u", prefix);
9cd6d409b78a6f833b681c13a68fbdc7c024fe66David Lawrence INSIST(n < (int)sizeof(txt));
4b87939256ede703385e9cab92d3c58d03c31098Mark Andrews RETERR(str_totext(txt, target));
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_consume(&sr, len);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley sep = " ";
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley }
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley return (ISC_R_SUCCESS);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington}
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellingtonstatic inline isc_result_t
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellingtonfromwire_in_apl(ARGS_FROMWIRE) {
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_region_t sr, sr2;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_region_t tr;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_uint16_t afi;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_uint8_t prefix;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_uint8_t len;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington
70c91849c3a3d808125d690a46af5fd225a4c291Andreas Gustafsson REQUIRE(type == dns_rdatatype_apl);
2d67fbd786284ed570031fa82fc9807b0413aa3fBrian Wellington REQUIRE(rdclass == dns_rdataclass_in);
2d67fbd786284ed570031fa82fc9807b0413aa3fBrian Wellington
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington UNUSED(type);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington UNUSED(dctx);
9efa0d2ae311157ed1cce3c16129579111b1e3b0Andreas Gustafsson UNUSED(rdclass);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington UNUSED(options);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_buffer_activeregion(source, &sr);
0ffaee887ff5674b8c3bb0435ae838f641981706Mark Andrews isc_buffer_availableregion(target, &tr);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (sr.length > tr.length)
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington return (ISC_R_NOSPACE);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington sr2 = sr;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington /* Zero or more items */
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington while (sr.length > 0) {
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (sr.length < 4)
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington return (ISC_R_UNEXPECTEDEND);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington afi = uint16_fromregion(&sr);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_region_consume(&sr, 2);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington prefix = *sr.base;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_region_consume(&sr, 1);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington len = (*sr.base & 0x7f);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington isc_region_consume(&sr, 1);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (len > sr.length)
0ffaee887ff5674b8c3bb0435ae838f641981706Mark Andrews return (ISC_R_UNEXPECTEDEND);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington switch (afi) {
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington case 1:
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (prefix > 32 || len > 4)
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington return (ISC_R_RANGE);
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington break;
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington case 2:
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (prefix > 128 || len > 16)
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington return (ISC_R_RANGE);
1f1d36a87b65186d9f89aac7f456ab1fd2a39ef6Andreas Gustafsson }
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington if (len > 0 && sr.base[len - 1] == 0)
64a84169d7eed05486b10be90afea58f4af146f9Brian Wellington return (DNS_R_FORMERR);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_consume(&sr, len);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley }
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_buffer_forward(source, sr2.length);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley return (mem_tobuffer(target, sr2.base, sr2.length));
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley}
eb2c85b103e3fccebddf59619216ba26af98bcd1Bob Halley
f3f22040a8c4835227e1a3abc54454556d4c47abBrian Wellingtonstatic inline isc_result_t
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Grafftowire_in_apl(ARGS_TOWIRE) {
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley UNUSED(cctx);
ece3d6c35693f9e2145434b0bf14e8b752cdeee8Michael Graff
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley REQUIRE(rdata->type == dns_rdatatype_apl);
f3f22040a8c4835227e1a3abc54454556d4c47abBrian Wellington REQUIRE(rdata->rdclass == dns_rdataclass_in);
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews return (mem_tobuffer(target, rdata->data, rdata->length));
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews}
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halleystatic inline int
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halleycompare_in_apl(ARGS_COMPARE) {
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_t r1;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley isc_region_t r2;
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley REQUIRE(rdata1->type == rdata2->type);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley REQUIRE(rdata1->rdclass == rdata2->rdclass);
2f3cfa8c0212e47f92f6c45459d9ee0ba8aa0045Bob Halley REQUIRE(rdata1->type == dns_rdatatype_apl);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley REQUIRE(rdata1->rdclass == dns_rdataclass_in);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley dns_rdata_toregion(rdata1, &r1);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley dns_rdata_toregion(rdata2, &r2);
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley return (isc_region_compare(&r1, &r2));
2f3cfa8c0212e47f92f6c45459d9ee0ba8aa0045Bob Halley}
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halley
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halleystatic inline isc_result_t
e08daafffce8fb74ffca8ecf5772e334299ccf76Bob Halleyfromstruct_in_apl(ARGS_FROMSTRUCT) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews dns_rdata_in_apl_t *apl = source;
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews isc_buffer_t b;
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews REQUIRE(type == dns_rdatatype_apl);
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews REQUIRE(rdclass == dns_rdataclass_in);
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews REQUIRE(source != NULL);
4423c99613db1399dbb5c51e86ef0d351a1418c2Mark Andrews REQUIRE(apl->common.rdtype == type);
602274b30f17281b8af0608016eadd0816d3eca6Mark Andrews REQUIRE(apl->common.rdclass == rdclass);
602274b30f17281b8af0608016eadd0816d3eca6Mark Andrews REQUIRE(apl->apl != NULL || apl->apl_len == 0);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_buffer_init(&b, apl->apl, apl->apl_len);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_buffer_add(&b, apl->apl_len);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_buffer_setactive(&b, apl->apl_len);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return(fromwire_in_apl(rdclass, type, &b, NULL, ISC_FALSE, target));
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsstatic inline isc_result_t
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewstostruct_in_apl(ARGS_TOSTRUCT) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews dns_rdata_in_apl_t *apl = target;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_region_t r;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(rdata->type == dns_rdatatype_apl);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(rdata->rdclass == dns_rdataclass_in);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->common.rdclass = rdata->rdclass;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->common.rdtype = rdata->type;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews ISC_LINK_INIT(&apl->common, link);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews dns_rdata_toregion(rdata, &r);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->apl_len = r.length;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->apl = mem_maybedup(mctx, r.base, r.length);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews if (apl->apl == NULL)
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (ISC_R_NOMEMORY);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->offset = 0;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->mctx = mctx;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (ISC_R_SUCCESS);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsstatic inline void
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsfreestruct_in_apl(ARGS_FREESTRUCT) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews dns_rdata_in_apl_t *apl = source;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(source != NULL);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->common.rdclass == dns_rdataclass_in);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews if (apl->mctx == NULL)
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews if (apl->apl != NULL)
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_mem_free(apl->mctx, apl->apl);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews apl->mctx = NULL;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsisc_result_t
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsdns_rdata_apl_first(dns_rdata_in_apl_t *apl) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_uint32_t length;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl != NULL);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->common.rdclass == dns_rdataclass_in);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->apl != NULL || apl->apl_len == 0);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews /*
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews * If no APL return ISC_R_NOMORE.
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews */
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews if (apl->apl == NULL)
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (ISC_R_NOMORE);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews /*
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews * Sanity check data.
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews */
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews INSIST(apl->apl_len > 3U);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews length = apl->apl[apl->offset + 3] & 0x7f;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews INSIST(4 + length <= apl->apl_len);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews apl->offset = 0;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (ISC_R_SUCCESS);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsisc_result_t
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsdns_rdata_apl_next(dns_rdata_in_apl_t *apl) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews isc_uint32_t length;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt REQUIRE(apl != NULL);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
4f082b58b17ce39087930d5affc2ada90ef386e6Mark Andrews REQUIRE(apl->common.rdclass == dns_rdataclass_in);
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews REQUIRE(apl->apl != NULL || apl->apl_len == 0);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews /*
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * No APL or have already reached the end return ISC_R_NOMORE.
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews */
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews if (apl->apl == NULL || apl->offset == apl->apl_len)
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews return (ISC_R_NOMORE);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews /*
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * Sanity check data.
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews */
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(apl->offset < apl->apl_len);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(apl->apl_len > 3U);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(apl->offset <= apl->apl_len - 4U);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews length = apl->apl[apl->offset + 3] & 0x7f;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews /*
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * 16 to 32 bits promotion as 'length' is 32 bits so there is
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * no overflow problems.
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews */
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(4 + length + apl->offset <= apl->apl_len);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews apl->offset += 4 + length;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews return ((apl->offset < apl->apl_len) ? ISC_R_SUCCESS : ISC_R_NOMORE);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews}
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrewsisc_result_t
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrewsdns_rdata_apl_current(dns_rdata_in_apl_t *apl, dns_rdata_apl_ent_t *ent) {
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews isc_uint32_t length;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(apl != NULL);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(apl->common.rdtype == dns_rdatatype_apl);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(apl->common.rdclass == dns_rdataclass_in);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(ent != NULL);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews REQUIRE(apl->apl != NULL || apl->apl_len == 0);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(apl->offset <= apl->apl_len);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews if (apl->offset == apl->apl_len)
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews return (ISC_R_NOMORE);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews /*
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * Sanity check data.
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews */
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(apl->apl_len > 3U);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(apl->offset <= apl->apl_len - 4U);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews length = (apl->apl[apl->offset + 3] & 0x7f);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews /*
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * 16 to 32 bits promotion as 'length' is 32 bits so there is
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews * no overflow problems.
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews */
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews INSIST(4 + length + apl->offset <= apl->apl_len);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews ent->family = (apl->apl[apl->offset] << 8) + apl->apl[apl->offset + 1];
d8f2dd46cba3a16c2433e85657a5b15543013ca6Mark Andrews ent->prefix = apl->apl[apl->offset + 2];
4f082b58b17ce39087930d5affc2ada90ef386e6Mark Andrews ent->length = length;
7de2c6e6d51f38daeb2d346f3f21dc01ccece6daEvan Hunt ent->negative = ISC_TF((apl->apl[apl->offset + 3] & 0x80) != 0);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews if (ent->length != 0)
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews ent->data = &apl->apl[apl->offset + 4];
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews else
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews ent->data = NULL;
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (ISC_R_SUCCESS);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsunsigned int
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrewsdns_rdata_apl_count(const dns_rdata_in_apl_t *apl) {
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews return (apl->apl_len);
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews}
aa39170da817cae7b4c6c735cc832e05ec3d2351Mark Andrews
0ffaee887ff5674b8c3bb0435ae838f641981706Mark Andrewsstatic inline isc_result_t
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrewsadditionaldata_in_apl(ARGS_ADDLDATA) {
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(rdata->type == dns_rdatatype_apl);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews REQUIRE(rdata->rdclass == dns_rdataclass_in);
4f082b58b17ce39087930d5affc2ada90ef386e6Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews (void)add;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews (void)arg;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews return (ISC_R_SUCCESS);
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews}
4f082b58b17ce39087930d5affc2ada90ef386e6Mark Andrews
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrewsstatic inline isc_result_t
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrewsdigest_in_apl(ARGS_DIGEST) {
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews isc_region_t r;
cc32d38366fa680fc29f9fb17bd3ebe515835445Mark Andrews
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn REQUIRE(rdata->type == dns_rdatatype_apl);
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn REQUIRE(rdata->rdclass == dns_rdataclass_in);
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt dns_rdata_toregion(rdata, &r);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt return ((digest)(arg, &r));
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User}
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox Userstatic inline isc_boolean_t
67adc03ef81fb610f8df093b17f55275ee816754Evan Huntcheckowner_in_apl(ARGS_CHECKOWNER) {
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User REQUIRE(type == dns_rdatatype_apl);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User REQUIRE(rdclass == dns_rdataclass_in);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User UNUSED(name);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User UNUSED(type);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt UNUSED(rdclass);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt UNUSED(wildcard);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt return (ISC_TRUE);
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt}
67adc03ef81fb610f8df093b17f55275ee816754Evan Hunt
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
67adc03ef81fb610f8df093b17f55275ee816754Evan Huntstatic inline isc_boolean_t
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox Userchecknames_in_apl(ARGS_CHECKNAMES) {
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User REQUIRE(rdata->type == dns_rdatatype_apl);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User REQUIRE(rdata->rdclass == dns_rdataclass_in);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User UNUSED(rdata);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User UNUSED(owner);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User UNUSED(bad);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User return (ISC_TRUE);
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User}
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox Userstatic inline int
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox Usercasecompare_in_apl(ARGS_COMPARE) {
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User return (compare_in_apl(rdata1, rdata2));
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User}
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User#endif /* RDATA_IN_1_APL_42_C */
313b0ea9f258edd8530f4454c69e6ba194280162Tinderbox User