ptr_12.c revision e0a30050c8516a3d54a4f8dcdd88435704a8a3ed
503ffdad3bc62e6458e4b60e329aa448ce1803a1Tinderbox User * Copyright (C) 2004, 2007, 2009, 2015 Internet Systems Consortium, Inc. ("ISC")
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 1998-2001 Internet Software Consortium.
ec5347e2c775f027573ce5648b910361aa926c01Automatic Updater * Permission to use, copy, modify, and/or distribute this software for any
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * purpose with or without fee is hereby granted, provided that the above
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * copyright notice and this permission notice appear in all copies.
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
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 };
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_int_data[] = "\003IP6\003INT";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char ip6_int_offsets[] = { 0, 4, 8 };
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char in_addr_arpa_data[] = "\007IN-ADDR\004ARPA";
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrewsstatic unsigned char in_addr_arpa_offsets[] = { 0, 8, 13 };
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews if (dns_name_issubdomain(owner, &in_addr_arpa) ||
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsstatic inline int
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews#endif /* RDATA_GENERIC_PTR_12_C */