2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

3062. [func] Made several changes to enhance human readability

of DNSSEC data in dig output and in generated
			zone files:
			 - DNSKEY record comments are more verbose, no
			   longer used in multiline mode only
			 - multiline RRSIG records reformatted
			 - multiline output mode for NSEC3PARAM records
			 - "dig +norrcomments" suppresses DNSKEY comments
			 - "dig +split=X" breaks hex/base64 records into
			   fields of width X; "dig +nosplit" disables this.
			[RT #22820]
This commit is contained in:
Evan Hunt
2011-03-05 19:39:07 +00:00
parent 59563d2a5d
commit 9a859983d7
28 changed files with 367 additions and 129 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rdata.c,v 1.211 2011/03/03 14:10:27 fdupont Exp $ */
/* $Id: rdata.c,v 1.212 2011/03/05 19:39:06 each Exp $ */
/*! \file */
@@ -726,7 +726,13 @@ rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
result = str_totext(" ( ", target);
else
result = str_totext(" ", target);
if (result == ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS)
return (result);
if (tctx->width == 0) /* No splitting */
result = isc_hex_totext(&sr, 0, "", target);
else
result = isc_hex_totext(&sr, tctx->width - 2,
tctx->linebreak,
target);
@@ -759,7 +765,8 @@ dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin, isc_buffer_t *target)
isc_result_t
dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin,
unsigned int flags, unsigned int width,
const char *linebreak, isc_buffer_t *target)
unsigned int split_width, const char *linebreak,
isc_buffer_t *target)
{
dns_rdata_textctx_t tctx;
@@ -770,11 +777,16 @@ dns_rdata_tofmttext(dns_rdata_t *rdata, dns_name_t *origin,
*/
tctx.origin = origin;
tctx.flags = flags;
if ((flags & DNS_STYLEFLAG_MULTILINE) != 0) {
if (split_width == 0xffffffff)
tctx.width = width;
else
tctx.width = split_width;
if ((flags & DNS_STYLEFLAG_MULTILINE) != 0)
tctx.linebreak = linebreak;
} else {
tctx.width = 60; /* Used for hex word length only. */
else {
if (split_width == 0xffffffff)
tctx.width = 60; /* Used for hex word length only. */
tctx.linebreak = " ";
}
return (rdata_totext(rdata, &tctx, target));