diff --git a/lib/dns/include/dns/masterdump.h b/lib/dns/include/dns/masterdump.h index 42521b3359..e036c83171 100644 --- a/lib/dns/include/dns/masterdump.h +++ b/lib/dns/include/dns/masterdump.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.h,v 1.42 2008/09/24 02:46:23 marka Exp $ */ +/* $Id: masterdump.h,v 1.42.524.1 2011/05/27 04:40:09 marka Exp $ */ #ifndef DNS_MASTERDUMP_H #define DNS_MASTERDUMP_H 1 @@ -332,9 +332,6 @@ dns_master_stylecreate(dns_master_style_t **style, unsigned int flags, void dns_master_styledestroy(dns_master_style_t **style, isc_mem_t *mctx); -const char * -dns_trust_totext(dns_trust_t trust); - ISC_LANG_ENDDECLS #endif /* DNS_MASTERDUMP_H */ diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h index d4b4ebfc30..209c7a892c 100644 --- a/lib/dns/include/dns/rdataset.h +++ b/lib/dns/include/dns/rdataset.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.h,v 1.69 2010/02/25 05:08:01 tbox Exp $ */ +/* $Id: rdataset.h,v 1.69.148.1 2011/05/27 04:40:09 marka Exp $ */ #ifndef DNS_RDATASET_H #define DNS_RDATASET_H 1 @@ -650,6 +650,12 @@ dns_rdataset_expire(dns_rdataset_t *rdataset); * Mark the rdataset to be expired in the backing database. */ +const char * +dns_trust_totext(dns_trust_t trust); +/* + * Display trust in textual form. + */ + ISC_LANG_ENDDECLS #endif /* DNS_RDATASET_H */ diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 682c8061bc..67dd8c35b6 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.99.258.5 2011/03/18 09:05:28 fdupont Exp $ */ +/* $Id: masterdump.c,v 1.99.258.6 2011/05/27 04:40:08 marka Exp $ */ /*! \file */ @@ -835,26 +835,6 @@ dump_order_compare(const void *a, const void *b) { #define MAXSORT 64 -static const char *trustnames[] = { - "none", - "pending-additional", - "pending-answer", - "additional", - "glue", - "answer", - "authauthority", - "authanswer", - "secure", - "local" /* aka ultimate */ -}; - -const char * -dns_trust_totext(dns_trust_t trust) { - if (trust >= sizeof(trustnames)/sizeof(*trustnames)) - return ("bad"); - return (trustnames[trust]); -} - static isc_result_t dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name, dns_rdatasetiter_t *rdsiter, dns_totext_ctx_t *ctx, @@ -893,12 +873,8 @@ dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name, for (i = 0; i < n; i++) { dns_rdataset_t *rds = sorted[i]; - if (ctx->style.flags & DNS_STYLEFLAG_TRUST) { - unsigned int trust = rds->trust; - INSIST(trust < (sizeof(trustnames) / - sizeof(trustnames[0]))); - fprintf(f, "; %s\n", trustnames[trust]); - } + if (ctx->style.flags & DNS_STYLEFLAG_TRUST) + fprintf(f, "; %s\n", dns_trust_totext(rds->trust)); if (rds->type == 0 && (ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0) { /* Omit negative cache entries */ diff --git a/lib/dns/rdataset.c b/lib/dns/rdataset.c index 38f30a878e..c072f07066 100644 --- a/lib/dns/rdataset.c +++ b/lib/dns/rdataset.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdataset.c,v 1.86.148.2 2011/03/12 04:59:17 tbox Exp $ */ +/* $Id: rdataset.c,v 1.86.148.3 2011/05/27 04:40:08 marka Exp $ */ /*! \file */ @@ -34,6 +34,26 @@ #include #include +static const char *trustnames[] = { + "none", + "pending-additional", + "pending-answer", + "additional", + "glue", + "answer", + "authauthority", + "authanswer", + "secure", + "local" /* aka ultimate */ +}; + +const char * +dns_trust_totext(dns_trust_t trust) { + if (trust >= sizeof(trustnames)/sizeof(*trustnames)) + return ("bad"); + return (trustnames[trust]); +} + void dns_rdataset_init(dns_rdataset_t *rdataset) {