mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 07:35:26 +00:00
add a test method to print QP keys
add a method qp_test_printkey() to print the name encoded in a QP key.
This commit is contained in:
@@ -84,3 +84,9 @@ qp_test_dumptrie(dns_qpreadable_t qp);
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
qp_test_dumpdot(dns_qp_t *qp);
|
qp_test_dumpdot(dns_qp_t *qp);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print the name encoded in a QP key.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
qp_test_printkey(const dns_qpkey_t key, size_t keylen);
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include <isc/urcu.h>
|
#include <isc/urcu.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
|
|
||||||
|
#include <dns/fixedname.h>
|
||||||
#include <dns/name.h>
|
#include <dns/name.h>
|
||||||
#include <dns/qp.h>
|
#include <dns/qp.h>
|
||||||
#include <dns/types.h>
|
#include <dns/types.h>
|
||||||
@@ -338,4 +339,15 @@ qp_test_dumpdot(dns_qp_t *qp) {
|
|||||||
printf("}\n");
|
printf("}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
qp_test_printkey(const dns_qpkey_t key, size_t keylen) {
|
||||||
|
dns_fixedname_t fn;
|
||||||
|
dns_name_t *n = dns_fixedname_initname(&fn);
|
||||||
|
char txt[DNS_NAME_FORMATSIZE];
|
||||||
|
|
||||||
|
dns_qpkey_toname(key, keylen, n);
|
||||||
|
dns_name_format(n, txt, sizeof(txt));
|
||||||
|
printf("%s%s\n", txt, dns_name_isabsolute(n) ? "." : "");
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
Reference in New Issue
Block a user