From: Wouter Wijngaards Date: Fri, 14 Aug 2009 08:35:46 +0000 (+0000) Subject: report RTT X-Git-Tag: release-1.4.0rc1~142 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed67590f7468e448c8347abac264a2ec2ffdb195;p=thirdparty%2Funbound.git report RTT git-svn-id: file:///svn/unbound/trunk@1761 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/cachedump.c b/daemon/cachedump.c index 045353521..01db2f933 100644 --- a/daemon/cachedump.c +++ b/daemon/cachedump.c @@ -45,6 +45,7 @@ #include "daemon/worker.h" #include "services/cache/rrset.h" #include "services/cache/dns.h" +#include "services/cache/infra.h" #include "util/data/msgreply.h" #include "util/regional.h" #include "util/net_help.h" @@ -779,6 +780,54 @@ load_cache(SSL* ssl, struct worker* worker) return read_fixed(ssl, worker->env.scratch_buffer, "EOF"); } +/** print details on a delegation point */ +static void +print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp) +{ + char buf[257]; + struct delegpt_addr* a; + int lame, dlame, rlame, rtt, edns_vs, to; + uint8_t edns_lame_known; + for(a = dp->target_list; a; a = a->next_target) { + addr_to_str(&a->addr, a->addrlen, buf, sizeof(buf)); + if(!ssl_printf(ssl, "%-16s\t", buf)) + return; + if(a->bogus) { + if(!ssl_printf(ssl, "Address is BOGUS. ")) + return; + } + /* lookup in infra cache */ + /* uses type_A because most often looked up, but other + * lameness won't be reported then */ + if(!infra_get_lame_rtt(worker->env.infra_cache, + &a->addr, a->addrlen, dp->name, dp->namelen, + LDNS_RR_TYPE_A, &lame, &dlame, &rlame, &rtt, + *worker->env.now)) { + if(!ssl_printf(ssl, "not in infra cache.\n")) + return; + continue; /* skip stuff not in infra cache */ + } + if(!ssl_printf(ssl, "%s%s%srtt %d msec. ", + lame?"LAME ":"", dlame?"NoDNSSEC ":"", + rlame?"NoAuthButRecursive ":"", rtt)) + return; + if(infra_host(worker->env.infra_cache, &a->addr, a->addrlen, + *worker->env.now, &edns_vs, &edns_lame_known, &to)) { + if(edns_vs == -1) { + if(!ssl_printf(ssl, "noEDNS%s.", + edns_lame_known?" probed":"")) + return; + } else { + if(!ssl_printf(ssl, "EDNS %d%s.", + edns_vs, edns_lame_known?" probed":"")) + return; + } + } + if(!ssl_printf(ssl, "\n")) + return; + } +} + int print_deleg_lookup(SSL* ssl, struct worker* worker, uint8_t* nm, size_t nmlen, int ATTR_UNUSED(nmlabs)) { @@ -824,11 +873,13 @@ int print_deleg_lookup(SSL* ssl, struct worker* worker, uint8_t* nm, delegpt_count_addr(dp, &n_addr, &n_res, &n_avail); /* since dp has not been used by iterator, all are available*/ if(!ssl_printf(ssl, "Delegation with %d names, of which %d " - "have no addresses in cache.\n" - "It provides %d IP addresses. %s\n", - (int)n_ns, (int)n_miss, (int)n_addr, - (dp->bogus?"It is BOGUS":"") )) + "can be examined to query further addresses.\n" + "%sIt provides %d IP addresses.\n", + (int)n_ns, (int)n_miss, (dp->bogus?"It is BOGUS. ":""), + (int)n_addr)) return 0; + /* print more dp info */ + print_dp_details(ssl, worker, dp); /* go up? */ if(iter_dp_is_useless(&qinfo, BIT_RD, dp)) { if(!ssl_printf(ssl, "cache delegation was " diff --git a/doc/Changelog b/doc/Changelog index 793e530c9..f160b348d 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +14 August 2009: Wouter + - unbound-control lookup prints out infra cache information, like RTT. + 13 August 2009: Wouter - autotrust read anchor files. locked trust anchors. diff --git a/validator/autotrust.c b/validator/autotrust.c index 4cd463333..fc2dc3431 100644 --- a/validator/autotrust.c +++ b/validator/autotrust.c @@ -331,7 +331,7 @@ find_add_tp(struct val_anchors* anchors, ldns_rr* rr) return tp; } -/** Add trust anchor from RR. */ +/** Add trust anchor from RR */ static struct autr_ta* add_trustanchor_frm_rr(struct val_anchors* anchors, ldns_rr* rr, struct trust_anchor** tp)