From: Wouter Wijngaards Date: Thu, 28 Jun 2018 08:15:47 +0000 (+0000) Subject: - num.queries.tls counter for queries over TLS. X-Git-Tag: release-1.8.0rc1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=755233c7207351aa803880ef673a452895c9f881;p=thirdparty%2Funbound.git - num.queries.tls counter for queries over TLS. git-svn-id: file:///svn/unbound/trunk@4759 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/remote.c b/daemon/remote.c index 22589d829..fa620a47f 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -966,6 +966,8 @@ print_ext(RES* ssl, struct ub_stats_info* s) (unsigned long)s->svr.qtcp)) return 0; if(!ssl_printf(ssl, "num.query.tcpout"SQ"%lu\n", (unsigned long)s->svr.qtcp_outgoing)) return 0; + if(!ssl_printf(ssl, "num.query.tls"SQ"%lu\n", + (unsigned long)s->svr.qtls)) return 0; if(!ssl_printf(ssl, "num.query.ipv6"SQ"%lu\n", (unsigned long)s->svr.qipv6)) return 0; /* flags */ diff --git a/daemon/stats.c b/daemon/stats.c index 6f4feaaad..d9e769426 100644 --- a/daemon/stats.c +++ b/daemon/stats.c @@ -374,6 +374,7 @@ void server_stats_add(struct ub_stats_info* total, struct ub_stats_info* a) total->svr.qclass_big += a->svr.qclass_big; total->svr.qtcp += a->svr.qtcp; total->svr.qtcp_outgoing += a->svr.qtcp_outgoing; + total->svr.qtls += a->svr.qtls; total->svr.qipv6 += a->svr.qipv6; total->svr.qbit_QR += a->svr.qbit_QR; total->svr.qbit_AA += a->svr.qbit_AA; @@ -428,8 +429,11 @@ void server_stats_insquery(struct ub_server_stats* stats, struct comm_point* c, stats->qclass[qclass]++; else stats->qclass_big++; stats->qopcode[ LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) ]++; - if(c->type != comm_udp) + if(c->type != comm_udp) { stats->qtcp++; + if(c->ssl != NULL) + stats->qtls++; + } if(repinfo && addr_is_ip6(&repinfo->addr, repinfo->addrlen)) stats->qipv6++; if( (flags&BIT_QR) ) diff --git a/doc/Changelog b/doc/Changelog index 2a06c776e..338907834 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +28 June 2018: Wouter + - num.queries.tls counter for queries over TLS. + 27 June 2018: Wouter - #4109: Fix that package config depends on python unconditionally. - Patch, do not export python from pkg-config, from Petr Menšík. diff --git a/doc/unbound-control.8.in b/doc/unbound-control.8.in index 6f9567f04..7586e3ac5 100644 --- a/doc/unbound-control.8.in +++ b/doc/unbound-control.8.in @@ -527,6 +527,9 @@ Number of queries that were made using TCP towards the unbound server. Number of queries that the unbound server made using TCP outgoing towards other servers. .TP +.I num.query.tls +Number of queries that were made using TLS towards the unbound server. +.TP .I num.query.ipv6 Number of queries that were made using IPv6 towards the unbound server. .TP diff --git a/libunbound/unbound.h b/libunbound/unbound.h index fbd69cab0..66b40ca73 100644 --- a/libunbound/unbound.h +++ b/libunbound/unbound.h @@ -674,6 +674,8 @@ struct ub_server_stats { long long qtcp; /** number of outgoing queries over TCP */ long long qtcp_outgoing; + /** number of queries over (DNS over) TLS */ + long long qtls; /** number of queries over IPv6 */ long long qipv6; /** number of queries with QR bit */ diff --git a/smallapp/unbound-control.c b/smallapp/unbound-control.c index 36a7a4812..ddaa05742 100644 --- a/smallapp/unbound-control.c +++ b/smallapp/unbound-control.c @@ -321,6 +321,7 @@ static void print_extended(struct ub_stats_info* s) /* transport */ PR_UL("num.query.tcp", s->svr.qtcp); PR_UL("num.query.tcpout", s->svr.qtcp_outgoing); + PR_UL("num.query.tls", s->svr.qtls); PR_UL("num.query.ipv6", s->svr.qipv6); /* flags */