View | Details | Raw Unified | Return to bug 1217
Collapse All | Expand All

(-)b/daemon/remote.c (+10 lines)
 Lines 798-803   print_stats(SSL* ssl, const char* nm, struct stats_info* s) Link Here 
798
		(unsigned long)s->svr.zero_ttl_responses)) return 0;
798
		(unsigned long)s->svr.zero_ttl_responses)) return 0;
799
	if(!ssl_printf(ssl, "%s.num.recursivereplies"SQ"%lu\n", nm, 
799
	if(!ssl_printf(ssl, "%s.num.recursivereplies"SQ"%lu\n", nm, 
800
		(unsigned long)s->mesh_replies_sent)) return 0;
800
		(unsigned long)s->mesh_replies_sent)) return 0;
801
#ifdef USE_DNSCRYPT
802
    if(!ssl_printf(ssl, "%s.num.dnscrypt.crypted"SQ"%lu\n", nm,
803
        (unsigned long)s->svr.num_query_dnscrypt_crypted)) return 0;
804
    if(!ssl_printf(ssl, "%s.num.dnscrypt.cert"SQ"%lu\n", nm,
805
        (unsigned long)s->svr.num_query_dnscrypt_cert)) return 0;
806
    if(!ssl_printf(ssl, "%s.num.dnscrypt.cleartext"SQ"%lu\n", nm,
807
        (unsigned long)s->svr.num_query_dnscrypt_cleartext)) return 0;
808
    if(!ssl_printf(ssl, "%s.num.dnscrypt.malformed"SQ"%lu\n", nm,
809
        (unsigned long)s->svr.num_query_dnscrypt_crypted_malformed)) return 0;
810
#endif
801
	if(!ssl_printf(ssl, "%s.requestlist.avg"SQ"%g\n", nm,
811
	if(!ssl_printf(ssl, "%s.requestlist.avg"SQ"%g\n", nm,
802
		(s->svr.num_queries_missed_cache+s->svr.num_queries_prefetch)?
812
		(s->svr.num_queries_missed_cache+s->svr.num_queries_prefetch)?
803
			(double)s->svr.sum_query_list_size/
813
			(double)s->svr.sum_query_list_size/
(-)b/daemon/stats.c (+8 lines)
 Lines 232-237   void server_stats_add(struct stats_info* total, struct stats_info* a) Link Here 
232
	total->svr.num_queries_missed_cache += a->svr.num_queries_missed_cache;
232
	total->svr.num_queries_missed_cache += a->svr.num_queries_missed_cache;
233
	total->svr.num_queries_prefetch += a->svr.num_queries_prefetch;
233
	total->svr.num_queries_prefetch += a->svr.num_queries_prefetch;
234
	total->svr.sum_query_list_size += a->svr.sum_query_list_size;
234
	total->svr.sum_query_list_size += a->svr.sum_query_list_size;
235
#ifdef USE_DNSCRYPT
236
    total->svr.num_query_dnscrypt_crypted += a->svr.num_query_dnscrypt_crypted;
237
    total->svr.num_query_dnscrypt_cert += a->svr.num_query_dnscrypt_cert;
238
    total->svr.num_query_dnscrypt_cleartext += \
239
        a->svr.num_query_dnscrypt_cleartext;
240
    total->svr.num_query_dnscrypt_crypted_malformed += \
241
        a->svr.num_query_dnscrypt_crypted_malformed;
242
#endif
235
	/* the max size reached is upped to higher of both */
243
	/* the max size reached is upped to higher of both */
236
	if(a->svr.max_query_list_size > total->svr.max_query_list_size)
244
	if(a->svr.max_query_list_size > total->svr.max_query_list_size)
237
		total->svr.max_query_list_size = a->svr.max_query_list_size;
245
		total->svr.max_query_list_size = a->svr.max_query_list_size;
(-)b/daemon/stats.h (+11 lines)
 Lines 43-48    Link Here 
43
#ifndef DAEMON_STATS_H
43
#ifndef DAEMON_STATS_H
44
#define DAEMON_STATS_H
44
#define DAEMON_STATS_H
45
#include "util/timehist.h"
45
#include "util/timehist.h"
46
#include "dnscrypt/dnscrypt_config.h"
46
struct worker;
47
struct worker;
47
struct config_file;
48
struct config_file;
48
struct comm_point;
49
struct comm_point;
 Lines 149-154   struct server_stats { Link Here 
149
	size_t infra_cache_count;
150
	size_t infra_cache_count;
150
	/** number of key cache entries */
151
	/** number of key cache entries */
151
	size_t key_cache_count;
152
	size_t key_cache_count;
153
#ifdef USE_DNSCRYPT
154
    /** number of queries that used dnscrypt */
155
    size_t num_query_dnscrypt_crypted;
156
    /** number of queries that queried dnscrypt certificates */
157
    size_t num_query_dnscrypt_cert;
158
    /** number of queries in clear text and not asking for the certificates */
159
    size_t num_query_dnscrypt_cleartext;
160
    /** number of malformed encrypted queries */
161
    size_t num_query_dnscrypt_crypted_malformed;
162
#endif
152
};
163
};
153
164
154
/** 
165
/** 
(-)b/daemon/worker.c (+5 lines)
 Lines 977-982   worker_handle_request(struct comm_point* c, void* arg, int error, Link Here 
977
#ifdef USE_DNSCRYPT
977
#ifdef USE_DNSCRYPT
978
    repinfo->max_udp_size = worker->daemon->cfg->max_udp_size;
978
    repinfo->max_udp_size = worker->daemon->cfg->max_udp_size;
979
    if(!dnsc_handle_curved_request(worker->daemon->dnscenv, repinfo)) {
979
    if(!dnsc_handle_curved_request(worker->daemon->dnscenv, repinfo)) {
980
        worker->stats.num_query_dnscrypt_crypted_malformed++;
980
        return 0;
981
        return 0;
981
    }
982
    }
982
    if(c->dnscrypt && !repinfo->is_dnscrypted) {
983
    if(c->dnscrypt && !repinfo->is_dnscrypted) {
 Lines 1003-1011   worker_handle_request(struct comm_point* c, void* arg, int error, Link Here 
1003
                    sldns_rr_descript(qinfo.qtype)->_name,
1004
                    sldns_rr_descript(qinfo.qtype)->_name,
1004
                    buf);
1005
                    buf);
1005
            comm_point_drop_reply(repinfo);
1006
            comm_point_drop_reply(repinfo);
1007
            worker->stats.num_query_dnscrypt_cleartext++;
1006
            return 0;
1008
            return 0;
1007
        }
1009
        }
1010
        worker->stats.num_query_dnscrypt_cert++;
1008
        sldns_buffer_rewind(c->buffer);
1011
        sldns_buffer_rewind(c->buffer);
1012
    } else if(c->dnscrypt && repinfo->is_dnscrypted) {
1013
        worker->stats.num_query_dnscrypt_crypted++;
1009
    }
1014
    }
1010
#endif
1015
#endif
1011
#ifdef USE_DNSTAP
1016
#ifdef USE_DNSTAP
(-)b/dnscrypt/dnscrypt.c (-1 lines)
 Lines 464-470   dnsc_handle_curved_request(struct dnsc_env* dnscenv, Link Here 
464
                                   repinfo->client_nonce,
464
                                   repinfo->client_nonce,
465
                                   repinfo->nmkey,
465
                                   repinfo->nmkey,
466
                                   c->buffer) != 0){
466
                                   c->buffer) != 0){
467
            // TODO: Bump counter!
468
            verbose(VERB_ALGO, "dnscrypt: Failed to uncurve");
467
            verbose(VERB_ALGO, "dnscrypt: Failed to uncurve");
469
            comm_point_drop_reply(repinfo);
468
            comm_point_drop_reply(repinfo);
470
            return 0;
469
            return 0;
(-)b/smallapp/unbound-control.c (+7 lines)
 Lines 199-204   static void pr_stats(const char* nm, struct stats_info* s) Link Here 
199
	PR_UL_NM("num.prefetch", s->svr.num_queries_prefetch);
199
	PR_UL_NM("num.prefetch", s->svr.num_queries_prefetch);
200
	PR_UL_NM("num.zero_ttl", s->svr.zero_ttl_responses);
200
	PR_UL_NM("num.zero_ttl", s->svr.zero_ttl_responses);
201
	PR_UL_NM("num.recursivereplies", s->mesh_replies_sent);
201
	PR_UL_NM("num.recursivereplies", s->mesh_replies_sent);
202
#ifdef USE_DNSCRYPT
203
    PR_UL_NM("num.dnscrypt.crypted", s->svr.num_query_dnscrypt_crypted);
204
    PR_UL_NM("num.dnscrypt.cert", s->svr.num_query_dnscrypt_cert);
205
    PR_UL_NM("num.dnscrypt.cleartext", s->svr.num_query_dnscrypt_cleartext);
206
    PR_UL_NM("num.dnscrypt.malformed",
207
             s->svr.num_query_dnscrypt_crypted_malformed);
208
#endif
202
	printf("%s.requestlist.avg"SQ"%g\n", nm,
209
	printf("%s.requestlist.avg"SQ"%g\n", nm,
203
		(s->svr.num_queries_missed_cache+s->svr.num_queries_prefetch)?
210
		(s->svr.num_queries_missed_cache+s->svr.num_queries_prefetch)?
204
			(double)s->svr.sum_query_list_size/
211
			(double)s->svr.sum_query_list_size/

Return to bug 1217