/** @internal Print a debug message related to resolution. */
#define QRVERBOSE(query, cls, fmt, ...) WITH_VERBOSE { \
unsigned _ind = 0; \
- for (struct kr_query *q = (query); q; q = q->parent, _ind += 2); \
- kr_log_verbose("[%s] %*s" fmt, cls, _ind, "", ## __VA_ARGS__); \
+ struct kr_query *q = (struct kr_query *)(query); \
+ uint16_t _id = q ? q->id : 0; \
+ for (; q; q = q->parent, _ind += 2); \
+ kr_log_verbose("[%5hu][%s] %*s" fmt, _id, cls, _ind, "", ## __VA_ARGS__); \
}
#else
#define QRVERBOSE(query, cls, fmt, ...)
#include "lib/dnssec/ta.h"
#define VERBOSE_MSG(fmt...) QRVERBOSE(req->current_query, "iter", fmt)
+#define QVERBOSE_MSG(qry, fmt...) QRVERBOSE(qry, "iter", fmt)
/* Iterator often walks through packet section, this is an abstraction. */
typedef int (*rr_callback_t)(const knot_rrset_t *, unsigned, struct kr_request *);
continue;
}
/* Process records matching current SNAME */
- unsigned hint = 0;
- if(knot_dname_is_equal(cname, knot_pkt_qname(req->answer))) {
- hint = KNOT_COMPR_HINT_QNAME;
- }
int state = KR_STATE_FAIL;
bool to_wire = false;
if (is_final) {
query->id = kr_rand_uint(UINT16_MAX);
knot_wire_set_id(pkt->wire, query->id);
pkt->parsed = pkt->size;
+ WITH_VERBOSE {
+ char name_str[KNOT_DNAME_MAXLEN], type_str[16];
+ knot_dname_to_str(name_str, query->sname, sizeof(name_str));
+ knot_rrtype_to_string(query->stype, type_str, sizeof(type_str));
+ QVERBOSE_MSG(query, "'%s' type '%s' id was assigned, parent id %hu\n",
+ name_str, type_str, query->parent ? query->parent->id : 0);
+ }
return kr_ok();
}