67a1122d50d24747976844db61a2c994a9b8b1e4Tinderbox User * Copyright (C) 1998-2001, 2004, 2007, 2009, 2015-2017 Internet Systems Consortium, Inc. ("ISC")
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/.
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater/* $Id: ptr_12.c,v 1.45 2009/12/04 22:06:37 tbox Exp $ */
940e4ef72b64a8a82a1038fdf08b324eec6e43a9Michael Graff/* Reviewed: Thu Mar 16 14:05:12 PST 2000 by explorer */
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence buffer_fromregion(&buffer, &token.value.as_region);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews RETTOK(dns_name_fromtext(&name, &buffer, origin, options, target));
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson sub = name_prefix(&name, tctx->origin, &prefix);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews return (dns_name_totext(&prefix, sub, target));
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
4b6dc226f78862286daa69fba761eac9fd5da16aAutomatic Updater return (dns_name_fromwire(&name, source, dctx, options, target));
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline int
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata1->type == dns_rdatatype_ptr);
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews return (dns_name_rdatacompare(&name1, &name2));
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews return (isc_buffer_copyregion(target, ®ion));
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews RETERR(name_duporclone(&name, mctx, &ptr->ptr));
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline void
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(ptr->common.rdtype == dns_rdatatype_ptr);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_arpa_data[] = "\003IP6\004ARPA";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_arpa_offsets[] = { 0, 4, 9 };
ce37f22724353fb80d6b60da530b95b8c29da35cMark Andrews DNS_NAME_INITABSOLUTE(ip6_arpa_data, ip6_arpa_offsets);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_int_data[] = "\003IP6\003INT";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_int_offsets[] = { 0, 4, 8 };
ce37f22724353fb80d6b60da530b95b8c29da35cMark Andrews DNS_NAME_INITABSOLUTE(ip6_int_data, ip6_int_offsets);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 };
ce37f22724353fb80d6b60da530b95b8c29da35cMark Andrews DNS_NAME_INITABSOLUTE(in_addr_arpa_data, in_addr_arpa_offsets);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews if (dns_name_issubdomain(owner, &in_addr_arpa) ||
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsstatic inline int
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews#endif /* RDATA_GENERIC_PTR_12_C */