a134177ed9f82189504191d90f3ed9e97c2b47cbTinderbox User * Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2012, 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: mx_15.c,v 1.58 2009/12/04 22:06:37 tbox Exp $ */
96805adfc95a9e0c5b800869dd4afe55b5616f12James Brister/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews char tmp[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:123.123.123.123.")];
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews if (strlcpy(tmp, DNS_AS_STR(*token), sizeof(tmp)) >= sizeof(tmp))
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews RETERR(uint16_tobuffer(token.value.as_ulong, target));
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_string,
c5223c9cb7c22620d5ee6611228673e95b48a270Mark Andrews if (!ok && (options & DNS_RDATA_CHECKMXFAIL) != 0)
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);
96805adfc95a9e0c5b800869dd4afe55b5616f12James Brister return (dns_name_totext(&prefix, sub, target));
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
62c1de9d9485003ea5af13061f1d30f081442ee9Michael Graff RETERR(mem_tobuffer(target, sregion.base, 2));
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews return (dns_name_fromwire(&name, source, dctx, options, target));
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline int
41aad56b6cc458cbf7b8483576d990a77ae9bac2Andreas Gustafsson order = memcmp(rdata1->data, rdata2->data, 2);
7c0539bea56022274da04263eb41fbb5b8835c38Mark Andrews return (dns_name_rdatacompare(&name1, &name2));
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews return (isc_buffer_copyregion(target, ®ion));
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline void
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(mx->common.rdtype == dns_rdatatype_mx);
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrewsstatic unsigned char port25_offset[] = { 0, 3 };
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrewsstatic unsigned char port25_ndata[] = "\003_25\004_tcp";
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews DNS_NAME_INITNONABSOLUTE(port25_ndata, port25_offset);
bc09fd1365d1a48972fa99cd6ed2aa788a28ef33Mark Andrews return ((add)(arg, dns_fixedname_name(&fixed), dns_rdatatype_tlsa));
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsstatic inline int
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews#endif /* RDATA_GENERIC_MX_15_C */