a134177ed9f82189504191d90f3ed9e97c2b47cbTinderbox User * Copyright (C) 1998-2002, 2004, 2007, 2009, 2011, 2012, 2014-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/.
f31f0b63cbe841720f154c570bcdede9d79e64b8Michael Graff/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
6324997211a5e2d82528dcde98e8981190a35faeMichael Graff#define RRTYPE_SOA_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON)
f1b68725503ff3e46001eee5a1751e29a43a09d1Andreas Gustafsson for (i = 0; i < 2; i++) {
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token,
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence buffer_fromregion(&buffer, &token.value.as_region);
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews RETTOK(dns_name_fromtext(&name, &buffer, origin,
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews switch (i) {
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews RETERR(uint32_tobuffer(token.value.as_ulong, target));
90880946803188d7c6b3ca7dea69761eb21241c2Mark Andrews for (i = 0; i < 4; i++) {
add4043305ca411202ed9cf1929a4179016515ceBrian Wellington RETERR(isc_lex_getmastertoken(lexer, &token,
9ac7076ebad044afb15e9e2687e3696868778538Mark Andrews RETTOK(dns_counter_fromtext(&token.value.as_textregion, &n));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson "serial", "refresh", "retry", "expire", "minimum"
9f139761ca06977d1db8051842efc620c15b8199Andreas Gustafsson multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0);
af669cb4fd7ecfb67ed145b176e5e764b249573bMark Andrews comm = ISC_TF((tctx->flags & DNS_STYLEFLAG_RRCOMMENT) != 0);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(&dregion, name_length(&mname));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(&dregion, name_length(&rname));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson sub = name_prefix(&mname, tctx->origin, &prefix);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson sub = name_prefix(&rname, tctx->origin, &prefix);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson RETERR(str_totext(tctx->linebreak, target));
f1b68725503ff3e46001eee5a1751e29a43a09d1Andreas Gustafsson for (i = 0; i < 5; i++) {
ad1317338af79edad878c9c3e4361798503310baMark Andrews snprintf(buf, sizeof(buf), comm ? "%-10lu ; " : "%lu", num);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson RETERR(str_totext(soa_fieldnames[i], target));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson /* Print times in week/day/hour/minute/second form */
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson RETERR(dns_ttl_totext(num, ISC_TRUE, target));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson RETERR(str_totext(tctx->linebreak, target));
9ce72fc748cc7c2b738147f9736e00a96474be1bBrian Wellington } else if (i < 4) {
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
bf33eb0b522801792a6663b0360bc94b9e9b77c2Automatic Updater RETERR(dns_name_fromwire(&mname, source, dctx, options, target));
bf33eb0b522801792a6663b0360bc94b9e9b77c2Automatic Updater RETERR(dns_name_fromwire(&rname, source, dctx, options, target));
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence isc_buffer_availableregion(target, &tregion);
94a08e09db3dc844b6ee4841c368a2d7074a9c3fAndreas Gustafsson dns_compress_setmethods(cctx, DNS_COMPRESS_GLOBAL14);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(&sregion, name_length(&mname));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(&sregion, name_length(&rname));
6e49e91bd08778d7eae45a2229dcf41ed97cc636David Lawrence isc_buffer_availableregion(target, &tregion);
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline int
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(rdata1->type == dns_rdatatype_soa);
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson order = dns_name_rdatacompare(&name1, &name2);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews isc_region_consume(®ion1, name_length(&name1));
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews isc_region_consume(®ion2, name_length(&name2));
e6c22f37d8df55a9f66b479a22717e179bcf79a3Andreas Gustafsson order = dns_name_rdatacompare(&name1, &name2);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews isc_region_consume(®ion1, name_length(&name1));
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews isc_region_consume(®ion2, name_length(&name2));
90e303b114e56db5809fdd19805243457fa43cd9Olafur Gudmundsson return (isc_region_compare(®ion1, ®ion2));
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews RETERR(isc_buffer_copyregion(target, ®ion));
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews RETERR(isc_buffer_copyregion(target, ®ion));
373ce67419680a398ba3dc51a14a486caaf0afb0Mark Andrews return (uint32_tobuffer(soa->minimum, target));
05f90cac85760b4edef2962209df49ea019c180fMark Andrews isc_region_consume(®ion, name_length(&name));
9281e7aa775026dc47c01745fdcc438645146877Mark Andrews RETERR(name_duporclone(&name, mctx, &soa->origin));
05f90cac85760b4edef2962209df49ea019c180fMark Andrews isc_region_consume(®ion, name_length(&name));
c38b92000c0f1a95daaad5468777e165b8047de9Mark Andrews result = name_duporclone(&name, mctx, &soa->contact);
4529cdaedaf1a0a5f8ff89aeca510b7a4475446cBob Halleystatic inline void
b0ba1a6059b6d6c4b3aa77d8bc84cc443b981e01Mukund Sivaraman REQUIRE(soa->common.rdtype == dns_rdatatype_soa);
2047977ce2dfcfe3a0fa2d638c3242841310fad3Mark Andrews isc_region_consume(®ion, name_length(&name));
3d17a3ba61a303d5c4d9867068d0fbe9f24d2988Mark Andrewsstatic inline int
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews#endif /* RDATA_GENERIC_SOA_6_C */