X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=pdns%2Fdnsbulktest.cc;h=27a288173be8e29c02576c3c2b853d09eaef1d91;hb=876dd46192156ebb5c8d34d007d73479ad2a7802;hp=6636dc90de155c1194a8aace8775c56302c1780c;hpb=28bf86b078dc8abbf28872ce06b8669e00fa7344;p=thirdparty%2Fpdns.git diff --git a/pdns/dnsbulktest.cc b/pdns/dnsbulktest.cc index 6636dc90de..27a288173b 100644 --- a/pdns/dnsbulktest.cc +++ b/pdns/dnsbulktest.cc @@ -1,3 +1,24 @@ +/* + * This file is part of PowerDNS or dnsdist. + * Copyright -- PowerDNS.COM B.V. and its contributors + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * In addition, for the avoidance of any doubt, permission is granted to + * link this program with OpenSSL and to (re)distribute the binaries + * produced as the result of such linking. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -56,10 +77,8 @@ struct SendReceive boost::array d_probs; - SendReceive(const std::string& remoteAddr, uint16_t port) + SendReceive(const std::string& remoteAddr, uint16_t port) : d_probs({{0.001,0.01, 0.025, 0.1, 0.25,0.5,0.75,0.9,0.975, 0.99,0.9999}}) { - boost::array tmp ={{0.001,0.01, 0.025, 0.1, 0.25,0.5,0.75,0.9,0.975, 0.99,0.9999}}; - d_probs = tmp; d_acc = new acc_t(boost::accumulators::tag::extended_p_square::probabilities=d_probs); // //d_acc = acc_t @@ -121,9 +140,9 @@ struct SendReceive } // parse packet, set 'id', fill out 'ip' - MOADNSParser mdp(string(buf, len)); + MOADNSParser mdp(false, string(buf, len)); if(!g_quiet) { - cout<<"Reply to question for qname='"<first.d_place-1<<"\t"<first.d_name.toString()<<"\tIN\t"<first.d_type); + cout<first.d_place-1<<"\t"<first.d_name<<"\tIN\t"<first.d_type); cout<<"\t"<first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n"; } } @@ -203,6 +222,7 @@ try ("type,t", po::value()->default_value("A"), "What type to query for") ("envoutput,e", "write report in shell environment format") ("version", "show the version number") + ("www", po::value()->default_value("true"), "duplicate all queries with an additional 'www.' in front") ; po::options_description alloptions; @@ -237,6 +257,7 @@ try return EXIT_FAILURE; } + bool doWww = g_vm["www"].as(); g_quiet = g_vm.count("quiet") > 0; g_envoutput = g_vm.count("envoutput") > 0; uint16_t qtype; @@ -282,7 +303,8 @@ try continue; // this was an IP address } domains.push_back(TypedQuery(split.second, qtype)); - domains.push_back(TypedQuery("www."+split.second, qtype)); + if(doWww) + domains.push_back(TypedQuery("www."+split.second, qtype)); } cerr<<"Read "<