From: Bert Hubert Date: Sun, 23 Mar 2008 20:06:30 +0000 (+0000) Subject: implement floating speedup instead of integer, plus register types properly X-Git-Tag: rec-3.1.7.1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=520d87b9ebb9b287494dfe1b3e101f766a980aef;p=thirdparty%2Fpdns.git implement floating speedup instead of integer, plus register types properly git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1172 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/dnsreplay.cc b/pdns/dnsreplay.cc index 7553403600..6791b36974 100644 --- a/pdns/dnsreplay.cc +++ b/pdns/dnsreplay.cc @@ -45,6 +45,7 @@ What to do with timeouts. We keep around at most 65536 outstanding answers. #include "sstuff.hh" #include "anadns.hh" #include +#include "dnsrecords.hh" // this is needed because boost multi_index also uses 'L', as do we (which is sad enough) #undef L @@ -70,7 +71,7 @@ namespace po = boost::program_options; po::variables_map g_vm; -const struct timeval operator*(int fact, const struct timeval& rhs) +const struct timeval operator*(float fact, const struct timeval& rhs) { // cout<<"In: "<::const_iterator i=canonicOrig.begin(); i!=canonicOrig.end(); ++i) cout<<"\t"<d_label<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; - cout<<"new:\n"; + cout<<"new: rcode="<::const_iterator i=canonicNew.begin(); i!=canonicNew.end(); ++i) - cout<<"\t"<d_label<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; + cout<<"\t"<d_label<<"\t"<d_type)<<"\t'" << (i->d_content ? i->d_content->getZoneRepresentation() : "") <<"'\n"; cout<<"\n"; + cout<<"-\n"; + } } @@ -563,7 +566,7 @@ try ("packet-limit", po::value()->default_value(0), "stop after this many packets") ("quiet", po::value()->default_value(true), "don't be too noisy") ("recursive", po::value()->default_value(true), "look at recursion desired packets, or not (defaults true)") - ("speedup", po::value()->default_value(1), "replay at this speedup"); + ("speedup", po::value()->default_value(1), "replay at this speedup"); po::options_description alloptions; po::options_description hidden("hidden options"); @@ -583,6 +586,8 @@ try po::notify(g_vm); + reportAllTypes(); + if (g_vm.count("help")) { cerr << "Usage: dnsreplay [--options] filename [ip-address] [port]"<(); g_quiet = g_vm["quiet"].as(); - uint16_t speedup=g_vm["speedup"].as(); + float speedup=g_vm["speedup"].as(); PcapPacketReader pr(g_vm["pcap-source"].as()); s_socket= new Socket(InterNetwork, Datagram);