From: Pieter Lexis Date: Tue, 23 May 2017 12:07:52 +0000 (+0100) Subject: calidns: add --increment and --want-recursion flags X-Git-Tag: rec-4.1.0-alpha1~95^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fe989016271b83113b385590fd06dc60af5c91c;p=pdns calidns: add --increment and --want-recursion flags --- diff --git a/docs/manpages/calidns.1.md b/docs/manpages/calidns.1.md index ee434e42b..bf7f3d879 100644 --- a/docs/manpages/calidns.1.md +++ b/docs/manpages/calidns.1.md @@ -6,7 +6,7 @@ **calidns** - A DNS recursor testing tool # SYNOPSIS -**calidns** *QUERY_FILE* *DESTINATION* *INITIAL_QPS* *HITRATE* +**calidns** [*OPTIONS*] *QUERY_FILE* *DESTINATION* *INITIAL_QPS* *HITRATE* # DESCRIPTION **calidns** reads queries from *QUERY_FILE* and sends them as a recursive query to @@ -28,4 +28,9 @@ google.com A This is similar to Alexa top 1 million list. # OPTIONS -None +--increment *NUM* +: On every subsequent run, multiply the number of queries per second by *NUM*. + By default, this is 1.1. + +--want-recursion +: Set this flag to send queries with the Recursion Desired flag set. diff --git a/pdns/calidns.cc b/pdns/calidns.cc index 9cdd58be8..d3fa8f53b 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -149,7 +149,12 @@ void sendPackets(const vector* sockets, const vector* > } void usage() { - cerr<<"Syntax: calidns QUERY_FILE DESTINATION INITIAL_QPS HITRATE"< 1 && argc <5)) { - for(int i = 1; i > > unknown, known; @@ -217,7 +242,7 @@ try boost::trim(line); auto p = splitField(line, ' '); DNSPacketWriter pw(packet, DNSName(p.first), DNSRecordContent::TypeToNumber(p.second)); - pw.getHeader()->rd=0; + pw.getHeader()->rd=wantRecursion; pw.getHeader()->id=random(); if(pw.getHeader()->id % 2) { pw.addOpt(1500, 0, EDNSOpts::DNSSECOK); @@ -229,7 +254,7 @@ try cout<<"Generated "< sockets; - ComboAddress dest(argv[2], 53); + ComboAddress dest(argv[arg_i+1], 53); for(int i=0; i < 24; ++i) { Socket *sock = new Socket(dest.sin4.sin_family, SOCK_DGRAM); // sock->connect(dest); @@ -241,7 +266,7 @@ try int qps; ofstream plot("plot"); - for(qps=qpsstart;;qps *= 1.1) { + for(qps=qpsstart;;qps *= increment) { double seconds=1; cout<<"Aiming at "<