]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
ipv6 counter in extended statistics.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Dec 2008 14:50:03 +0000 (14:50 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 17 Dec 2008 14:50:03 +0000 (14:50 +0000)
git-svn-id: file:///svn/unbound/trunk@1397 be551aaa-1e26-0410-a405-d3ace91eadb9

contrib/unbound_munin_
daemon/remote.c
daemon/stats.c
daemon/stats.h
daemon/worker.c
doc/Changelog
doc/TODO
doc/unbound-control.8.in

index 341f5071bec8b2762b34ee707882c3f1300561a7..82ce8982c2c3b4761b43c561e6ebc99e080c38cc 100755 (executable)
@@ -226,6 +226,7 @@ if test "$1" = "config" ; then
                p_config "total.num.queries" "total queries from clients"
                p_config "total.num.cachehits" "cache hits"
                p_config "num.query.tcp" "TCP queries"
+               p_config "num.query.ipv6" "IPv6 queries"
                p_config "unwanted.queries" "queries that failed acl"
                p_config "unwanted.replies" "unwanted or unsolicited replies"
                echo "u_replies.warning $warn"
@@ -412,8 +413,8 @@ hits)
        for x in thread0.num.queries thread1.num.queries thread2.num.queries \
                thread3.num.queries thread4.num.queries thread5.num.queries \
                thread6.num.queries thread7.num.queries total.num.queries \
-               total.num.cachehits num.query.tcp unwanted.queries \
-               unwanted.replies; do
+               total.num.cachehits num.query.tcp num.query.ipv6 \
+               unwanted.queries unwanted.replies; do
                if grep "^"$x"=" $state >/dev/null 2>&1; then
                        print_qps $x
                fi
index df222c520f287a517f6941986fdef1f57729ecd8..d82c1b4d80be970c9a12b390b12459ce2d7635dc 100644 (file)
@@ -773,6 +773,8 @@ print_ext(SSL* ssl, struct stats_info* s)
        /* transport */
        if(!ssl_printf(ssl, "num.query.tcp"SQ"%u\n", 
                (unsigned)s->svr.qtcp)) return 0;
+       if(!ssl_printf(ssl, "num.query.ipv6"SQ"%u\n", 
+               (unsigned)s->svr.qipv6)) return 0;
        /* flags */
        if(!ssl_printf(ssl, "num.query.flags.QR"SQ"%u\n", 
                (unsigned)s->svr.qbit_QR)) return 0;
index 6f67b46a7c8fe3237c87534d7189f27cac6ff711..5d88ec9fc6479b8bab7cdb4ee0796b495a9cf1b4 100644 (file)
@@ -197,6 +197,7 @@ void server_stats_add(struct stats_info* total, struct stats_info* a)
                total->svr.qtype_big += a->svr.qtype_big;
                total->svr.qclass_big += a->svr.qclass_big;
                total->svr.qtcp += a->svr.qtcp;
+               total->svr.qipv6 += a->svr.qipv6;
                total->svr.qbit_QR += a->svr.qbit_QR;
                total->svr.qbit_AA += a->svr.qbit_AA;
                total->svr.qbit_TC += a->svr.qbit_TC;
@@ -238,7 +239,8 @@ void server_stats_add(struct stats_info* total, struct stats_info* a)
 }
 
 void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
-       uint16_t qtype, uint16_t qclass, struct edns_data* edns)
+       uint16_t qtype, uint16_t qclass, struct edns_data* edns,
+       struct comm_reply* repinfo)
 {
        uint16_t flags = ldns_buffer_read_u16_at(c->buffer, 2);
        if(qtype < STATS_QTYPE_NUM)
@@ -250,6 +252,8 @@ void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
        stats->qopcode[ LDNS_OPCODE_WIRE(ldns_buffer_begin(c->buffer)) ]++;
        if(c->type != comm_udp)
                stats->qtcp++;
+       if(repinfo && addr_is_ip6(&repinfo->addr, repinfo->addrlen))
+               stats->qipv6++;
        if( (flags&BIT_QR) )
                stats->qbit_QR++;
        if( (flags&BIT_AA) )
index d894e029291c85d402b4f24ea4fccc0be2074f6f..0e339c3fd5e4492cab7bbe713eb8d959beb59357 100644 (file)
@@ -46,6 +46,7 @@
 struct worker;
 struct config_file;
 struct comm_point;
+struct comm_reply;
 struct edns_data;
 
 /** number of qtype that is stored for in array */
@@ -87,6 +88,8 @@ struct server_stats {
        size_t qopcode[STATS_OPCODE_NUM];
        /** number of queries over TCP */
        size_t qtcp;
+       /** number of queries over IPv6 */
+       size_t qipv6;
        /** number of queries with QR bit */
        size_t qbit_QR;
        /** number of queries with AA bit */
@@ -113,7 +116,7 @@ struct server_stats {
        size_t ans_rcode_nodata;
        /** answers that were secure (AD) */
        size_t ans_secure;
-       /** answers with bogus content */
+       /** answers that were bogus (withheld as SERVFAIL) */
        size_t ans_bogus;
        /** rrsets marked bogus by validator */
        size_t rrset_bogus;
@@ -204,9 +207,11 @@ void server_stats_add(struct stats_info* total, struct stats_info* a);
  * @param qtype: query type
  * @param qclass: query class
  * @param edns: edns record
+ * @param repinfo: reply info with remote address
  */
 void server_stats_insquery(struct server_stats* stats, struct comm_point* c,
-       uint16_t qtype, uint16_t qclass, struct edns_data* edns);
+       uint16_t qtype, uint16_t qclass, struct edns_data* edns, 
+       struct comm_reply* repinfo);
 
 /**
  * Add rcode for this query.
index 911ad193e7c8453c9570e50055d32aad4e01c73f..2fe4f127e6bc35fd5fddd557752ab69a711ae1a0 100644 (file)
@@ -816,7 +816,7 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
        }
        if(worker->stats.extended)
                server_stats_insquery(&worker->stats, c, qinfo.qtype,
-                       qinfo.qclass, &edns);
+                       qinfo.qclass, &edns, repinfo);
        if(c->type != comm_udp)
                edns.udp_size = 65535; /* max size for TCP replies */
        if(qinfo.qclass == LDNS_RR_CLASS_CH && answer_chaos(worker, &qinfo,
index 103aadb4c9fb79f7e342eb3a3b875bab8b8ce6e1..f6d4548832a4928c3a0322db61fb7395f702b23f 100644 (file)
@@ -1,6 +1,8 @@
 17 December 2008: Wouter
        - follows ldns makedist.sh. -rc option. autom4te dir removed.
        - unbound-control status command.
+       - extended statistics has a number of ipv6 queries counter.
+         contrib/unbound_munin_ was updated to draw ipv6 in the hits graph.
 
 16 December 2008: Wouter
        - follow makedist improvements from ldns, for maintainers prereleases.
index 41eaadc13f8937915bb6d4ef481228ec2216dc9f..53413582f12c726fff78c2d0a245cc884481efde 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -58,5 +58,4 @@ o local-zone directive with authority service, full authority server
   is a non-goal.
 o configure option to force use of builtin ldns tarball.
 o include /etc/pki/dnssec-keys/production/*.conf with wildcard support.
-o add extended stat counter for num queries over ipv6, ipv6 usage.
 o make so revoke bit keys cannot verify signatures
index 068abfb4a1c4999f42caecfd061cf0d117a0196f..ede6de3465cda5c04c794b11da715695fa4cd6fd 100644 (file)
@@ -259,6 +259,9 @@ Also printed for other opcodes, UPDATE, ...
 .I num.query.tcp
 Number of queries that were made using TCP towards the unbound server.
 .TP
+.I num.query.ipv6
+Number of queries that were made using IPv6 towards the unbound server.
+.TP
 .I num.query.flags.RD
 The number of queries that had the RD flag set in the header.
 Also printed for flags QR, AA, TC, RA, Z, AD, CD.