]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Print the key id when DNS_STYLEFLAG_COMMENT is passed to _totext()
authorBrian Wellington <source@isc.org>
Mon, 31 Jul 2000 19:47:21 +0000 (19:47 +0000)
committerBrian Wellington <source@isc.org>
Mon, 31 Jul 2000 19:47:21 +0000 (19:47 +0000)
lib/dns/rdata/generic/key_25.c

index 28a4f250d959861e765260c242a1463f1ae1d02f..035dc1bb4f3b3c7728438d56c86afb0dc581de5f 100644 (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