Print the key id when DNS_STYLEFLAG_COMMENT is passed to _totext()

This commit is contained in:
Brian Wellington
2000-07-31 19:47:21 +00:00
parent f4811a903a
commit 0e93f65e10
+12 -4
View File
@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: key_25.c,v 1.27 2000/07/27 09:49:04 tale Exp $ */
/* $Id: key_25.c,v 1.28 2000/07/31 19:47:21 bwelling Exp $ */
/*
* Reviewed: Wed Mar 15 16:47:10 PST 2000 by halley.
@@ -26,6 +26,8 @@
#ifndef RDATA_GENERIC_KEY_25_C
#define RDATA_GENERIC_KEY_25_C
#include <dst/dst.h>
#define RRTYPE_KEY_ATTRIBUTES (DNS_RDATATYPEATTR_DNSSEC)
static inline isc_result_t
@@ -69,8 +71,6 @@ totext_key(ARGS_TOTEXT) {
char buf[sizeof "64000"];
unsigned int flags;
UNUSED(tctx);
REQUIRE(rdata->type == 25);
dns_rdata_toregion(rdata, &sr);
@@ -106,7 +106,15 @@ totext_key(ARGS_TOTEXT) {
if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0)
RETERR(str_totext(" )", target));
return ISC_R_SUCCESS;
if ((tctx->flags & DNS_STYLEFLAG_COMMENT) != 0) {
isc_region_t tmpr;
RETERR(str_totext(" ; key id = ", target));
dns_rdata_toregion(rdata, &tmpr);
sprintf(buf, "%u", dst_region_computeid(&tmpr));
RETERR(str_totext(buf, target));
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t