soa_6.c revision 3d17a3ba61a303d5c4d9867068d0fbe9f24d2988
54db0529dcab47d08996454a076c5e4a0d75e5d2Mark Andrews * Copyright (C) 2004, 2007, 2009 Internet Systems Consortium, Inc. ("ISC")
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * Copyright (C) 1998-2002 Internet Software Consortium.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * 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.
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
05f90cac85760b4edef2962209df49ea019c180fMark Andrews/* $Id: soa_6.c,v 1.64 2009/12/04 21:09:34 marka Exp $ */
854d0238dbc2908490197984b3b9d558008a53dfMark Andrews/* Reviewed: Thu Mar 16 15:18:32 PST 2000 by explorer */
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews#define RRTYPE_SOA_ATTRIBUTES (DNS_RDATATYPEATTR_SINGLETON)
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews origin = (origin != NULL) ? origin : dns_rootname;
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews for (i = 0; i < 2; i++) {
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews buffer_fromregion(&buffer, &token.value.as_region);
deaaf94332abbfdb3aff53675546acfed16e5eb6Mark Andrews RETTOK(dns_name_fromtext(&name, &buffer, origin,
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson if ((options & DNS_RDATA_CHECKNAMES) != 0)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews switch (i) {
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson if (!ok && (options & DNS_RDATA_CHECKNAMESFAIL) != 0)
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RETERR(uint32_tobuffer(token.value.as_ulong, target));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews for (i = 0; i < 4; i++) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RETTOK(dns_counter_fromtext(&token.value.as_textregion, &n));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews "serial", "refresh", "retry", "expire", "minimum"
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews multiline = ISC_TF((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson comment = ISC_TF((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson isc_region_consume(&dregion, name_length(&mname));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson isc_region_consume(&dregion, name_length(&rname));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson sub = name_prefix(&mname, tctx->origin, &prefix);
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson RETERR(dns_name_totext(&prefix, sub, target));
5fc7ba3e1ac5d72239e9971e0f469dd5796738f9Andreas Gustafsson sub = name_prefix(&rname, tctx->origin, &prefix);
0e8cf9a887c70f96ac448b06c069d90b830215ccMark Andrews for (i = 0; i < 5; i++) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews unsigned long num;
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews sprintf(buf, comment ? "%-10lu ; " : "%lu", num);
d981ca645597116d227a48bf37cc5edc061c854dBob Halley /* Print times in week/day/hour/minute/second form */
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews if (i >= 1) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews } else if (i < 4) {
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews dns_decompress_setmethods(dctx, DNS_COMPRESS_GLOBAL14);
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews RETERR(dns_name_fromwire(&mname, source, dctx, options, target));
52637f592f705ca93fadc218e403fd55e8ce4aeaMark Andrews RETERR(dns_name_fromwire(&rname, source, dctx, options, target));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews 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));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrewsstatic inline int
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(®ion1, name_length(&name1));
5d51e67c3b4f35c1be742574aacc1d88fe6ed444Mark Andrews isc_region_consume(®ion2, name_length(&name2));
f7b99290c31abeb20c55fc55391510450ce60423Mark Andrews isc_region_consume(®ion1, name_length(&name1));
d981ca645597116d227a48bf37cc5edc061c854dBob Halley isc_region_consume(®ion2, name_length(&name2));
94a3bcd132e515b4baa0884ba9dd0f361d2e17bcMark Andrews return (isc_region_compare(®ion1, ®ion2));
05f90cac85760b4edef2962209df49ea019c180fMark Andrews RETERR(isc_buffer_copyregion(target, ®ion));
05f90cac85760b4edef2962209df49ea019c180fMark Andrews RETERR(isc_buffer_copyregion(target, ®ion));
a560a0bfb2fd48ddd1900f61a655397a5c4f7343Mark Andrews return (uint32_tobuffer(soa->minimum, target));
d981ca645597116d227a48bf37cc5edc061c854dBob Halley RETERR(name_duporclone(&name, mctx, &soa->origin));
d981ca645597116d227a48bf37cc5edc061c854dBob Halley result = name_duporclone(&name, mctx, &soa->contact);
e27a69f8bd9538e08f775265167ba6cc5f47c587Bob Halleystatic inline void
static inline isc_result_t
return (ISC_R_SUCCESS);
static inline isc_result_t
isc_region_t r;
static inline isc_boolean_t
return (ISC_TRUE);
static inline isc_boolean_t
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_TRUE);