[-]
[+]
|
Changed |
pdns-3.3.tar.gz/codedocs/Makefile
|
@@ -144,10 +144,10 @@
PACKAGE = pdns
PACKAGE_BUGREPORT =
PACKAGE_NAME = pdns
-PACKAGE_STRING = pdns 3.3-rc2
+PACKAGE_STRING = pdns 3.3
PACKAGE_TARNAME = pdns
PACKAGE_URL =
-PACKAGE_VERSION = 3.3-rc2
+PACKAGE_VERSION = 3.3
PATH_SEPARATOR = :
PGSQL_incdir = /usr/include/postgresql
PGSQL_lib =
@@ -165,7 +165,7 @@
THREADFLAGS = -pthread
UNIXODBC_incdir =
UNIXODBC_lib =
-VERSION = 3.3-rc2
+VERSION = 3.3
YACC = bison -y
YFLAGS =
abs_builddir = /var/lib/jenkins/jobs/auth-git/workspace/codedocs
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/config.h
^
|
@@ -171,7 +171,7 @@
#define PACKAGE_NAME "pdns"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "pdns 3.3-rc2"
+#define PACKAGE_STRING "pdns 3.3"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "pdns"
@@ -180,7 +180,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.3-rc2"
+#define PACKAGE_VERSION "3.3"
/* If we want HTTP connector */
#define REMOTEBACKEND_HTTP 1
@@ -201,7 +201,7 @@
/* #undef VERBOSELOG */
/* Version number of package */
-#define VERSION "3.3-rc2"
+#define VERSION "3.3"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/configure
^
|
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for pdns 3.3-rc2.
+# Generated by GNU Autoconf 2.67 for pdns 3.3.
#
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -698,8 +698,8 @@
# Identity of this package.
PACKAGE_NAME='pdns'
PACKAGE_TARNAME='pdns'
-PACKAGE_VERSION='3.3-rc2'
-PACKAGE_STRING='pdns 3.3-rc2'
+PACKAGE_VERSION='3.3'
+PACKAGE_STRING='pdns 3.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1550,7 +1550,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pdns 3.3-rc2 to adapt to many kinds of systems.
+\`configure' configures pdns 3.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1620,7 +1620,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pdns 3.3-rc2:";;
+ short | recursive ) echo "Configuration of pdns 3.3:";;
esac
cat <<\_ACEOF
@@ -1798,7 +1798,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pdns configure 3.3-rc2
+pdns configure 3.3
generated by GNU Autoconf 2.67
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -2447,7 +2447,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pdns $as_me 3.3-rc2, which was
+It was created by pdns $as_me 3.3, which was
generated by GNU Autoconf 2.67. Invocation command line was
$ $0 $@
@@ -3265,7 +3265,7 @@
# Define the identity of the package.
PACKAGE='pdns'
- VERSION='3.3-rc2'
+ VERSION='3.3'
cat >>confdefs.h <<_ACEOF
@@ -20694,7 +20694,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pdns $as_me 3.3-rc2, which was
+This file was extended by pdns $as_me 3.3, which was
generated by GNU Autoconf 2.67. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20760,7 +20760,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pdns config.status 3.3-rc2
+pdns config.status 3.3
configured by $0, generated by GNU Autoconf 2.67,
with options \\"\$ac_cs_config\\"
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/configure.ac
^
|
@@ -1,6 +1,6 @@
dnl intro
dnl The following lines may be patched by set-version-auth.
-AC_INIT([pdns], [3.3-rc2])
+AC_INIT([pdns], [3.3])
AC_SUBST([DIST_HOST], [jenkins@autotest.powerdns.com])
dnl End patch area.
AC_CONFIG_SRCDIR([pdns/receiver.cc])
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/debian-pdns/changelog
^
|
@@ -1,4 +1,4 @@
-pdns (3.3-rc2-1) unstable; urgency=medium
+pdns (3.3-1) unstable; urgency=medium
* fill in the blanks
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/modules/remotebackend/remotebackend.cc
^
|
@@ -25,17 +25,17 @@
if (!value.HasMember("result")) {
return false;
}
- if (!value["result"].IsObject() && (value["result"].IsBool() && value["result"].GetBool() == false)) {
+ if (!value["result"].IsObject() && getBool(value["result"]) == false) {
rv = false;
}
if (value.HasMember("log")) {
- const rapidjson::Value& messages = value["log"];
+ rapidjson::Value& messages = value["log"];
if (messages.IsArray()) {
// log em all
- for (rapidjson::Value::ConstValueIterator iter = messages.Begin(); iter != messages.End(); ++iter)
- L<<Logger::Info<<"[remotebackend]:"<< iter->GetString() <<std::endl;
- } else if (messages.IsString()) { // could be just a string, too
- L<<Logger::Info<<"[remotebackend]:"<< messages.GetString() <<std::endl;
+ for (rapidjson::Value::ValueIterator iter = messages.Begin(); iter != messages.End(); ++iter)
+ L<<Logger::Info<<"[remotebackend]:"<< getString(*iter) <<std::endl;
+ } else if (messages.IsNull() == false) { // could be just a value
+ L<<Logger::Info<<"[remotebackend]:"<< getString(messages) <<std::endl;
}
}
return rv;
@@ -204,21 +204,21 @@
rapidjson::Value value;
value = "";
- rr.qtype = JSON_GET((*d_result)["result"][d_index], "qtype", value).GetString();
- rr.qname = JSON_GET((*d_result)["result"][d_index], "qname", value).GetString();
+ rr.qtype = getString(JSON_GET((*d_result)["result"][d_index], "qtype", value));
+ rr.qname = getString(JSON_GET((*d_result)["result"][d_index], "qname", value));
rr.qclass = QClass::IN;
- rr.content = JSON_GET((*d_result)["result"][d_index], "content",value).GetString();
+ rr.content = getString(JSON_GET((*d_result)["result"][d_index], "content",value));
value = -1;
- rr.ttl = JSON_GET((*d_result)["result"][d_index], "ttl",value).GetInt();
- rr.domain_id = JSON_GET((*d_result)["result"][d_index],"domain_id",value).GetInt();
- rr.priority = JSON_GET((*d_result)["result"][d_index],"priority",value).GetInt();
+ rr.ttl = getInt(JSON_GET((*d_result)["result"][d_index], "ttl",value));
+ rr.domain_id = getInt(JSON_GET((*d_result)["result"][d_index],"domain_id",value));
+ rr.priority = getInt(JSON_GET((*d_result)["result"][d_index],"priority",value));
value = 1;
if (d_dnssec)
- rr.auth = JSON_GET((*d_result)["result"][d_index],"auth", value).GetInt();
+ rr.auth = getInt(JSON_GET((*d_result)["result"][d_index],"auth", value));
else
rr.auth = 1;
value = 0;
- rr.scopeMask = JSON_GET((*d_result)["result"][d_index],"scopeMask", value).GetInt();
+ rr.scopeMask = getInt(JSON_GET((*d_result)["result"][d_index],"scopeMask", value));
d_index++;
@@ -248,9 +248,9 @@
if (connector->send(query) == false || connector->recv(answer) == false)
return false;
- unhashed = answer["result"]["unhashed"].GetString();
- before = answer["result"]["before"].GetString();
- after = answer["result"]["after"].GetString();
+ unhashed = getString(answer["result"]["unhashed"]);
+ before = getString(answer["result"]["before"]);
+ after = getString(answer["result"]["after"]);
return true;
}
@@ -277,7 +277,7 @@
if (answer["result"].IsArray()) {
for(rapidjson::Value::ValueIterator iter = answer["result"].Begin(); iter != answer["result"].End(); iter++) {
- meta.push_back(iter->GetString());
+ meta.push_back(getString(*iter));
}
} else if (answer["result"].IsString()) {
meta.push_back(answer["result"].GetString());
@@ -304,9 +304,7 @@
if (connector->send(query) == false || connector->recv(answer) == false)
return false;
- if (answer["result"].IsBool())
- return answer["result"].GetBool();
- return false;
+ return getBool(answer["result"]);
}
@@ -330,13 +328,10 @@
for(rapidjson::Value::ValueIterator iter = answer["result"].Begin(); iter != answer["result"].End(); iter++) {
DNSBackend::KeyData key;
- key.id = (*iter)["id"].GetUint();
- key.flags = (*iter)["flags"].GetUint();
- if ((*iter)["active"].IsBool())
- key.active = (*iter)["active"].GetBool();
- else
- key.active = ((*iter)["active"].GetInt() != 0 ? true : false ); // case where it's returned as non-boolean
- key.content = (*iter)["content"].GetString();
+ key.id = getUInt((*iter)["id"]);
+ key.flags = getUInt((*iter)["flags"]);
+ key.active = getBool((*iter)["active"]);
+ key.content = getString((*iter)["content"]);
keys.push_back(key);
}
@@ -382,7 +377,7 @@
if (connector->send(query) == false || connector->recv(answer) == false)
return false;
- return answer["result"].GetInt();
+ return getInt(answer["result"]);
}
bool RemoteBackend::activateDomainKey(const string& name, unsigned int id) {
@@ -445,9 +440,9 @@
return false;
if (algorithm != NULL)
- algorithm->assign(answer["result"]["algorithm"].GetString());
+ algorithm->assign(getString(answer["result"]["algorithm"]));
if (content != NULL)
- content->assign(answer["result"]["content"].GetString());
+ content->assign(getString(answer["result"]["content"]));
return true;
}
@@ -474,20 +469,21 @@
}
value = -1;
// parse return value. we need at least zone,serial,kind
- di.id = JSON_GET(answer["result"],"id",value).GetInt();
- di.zone = answer["result"]["zone"].GetString();
+ di.id = getInt(JSON_GET(answer["result"],"id",value));
+ di.zone = getString(answer["result"]["zone"]);
+
if (answer["result"].HasMember("masters") && answer["result"]["masters"].IsArray()) {
rapidjson::Value& value = answer["result"]["masters"];
for(rapidjson::Value::ValueIterator i = value.Begin(); i != value.End(); i++) {
- di.masters.push_back(i->GetString());
+ di.masters.push_back(getString(*i));
}
}
- di.notified_serial = JSON_GET(answer["result"], "notified_serial", value).GetInt();
+ di.notified_serial = getInt(JSON_GET(answer["result"], "notified_serial", value));
value = 0;
- di.serial = JSON_GET(answer["result"],"serial", value).GetInt();
- di.last_check = JSON_GET(answer["result"],"last_check", value).GetInt();
+ di.serial = getInt(JSON_GET(answer["result"],"serial", value));
+ di.last_check = getInt(JSON_GET(answer["result"],"last_check", value));
value = "native";
- kind = JSON_GET(answer["result"], "kind", value).GetString();
+ kind = getString(JSON_GET(answer["result"], "kind", value));
if (kind == "master") {
di.kind = DomainInfo::Master;
} else if (kind == "slave") {
@@ -553,7 +549,7 @@
// we allow simple true as well...
if (answer["result"].IsObject() && answer["result"].HasMember("account"))
- *account = answer["result"]["account"].GetString();
+ *account = getString(answer["result"]["account"]);
return true;
}
@@ -766,13 +762,106 @@
if (connector->send(query) == false || connector->recv(answer) == false)
return false;
- if (answer["result"].IsInt64() == false)
- return false;
+ serial = getInt64(answer["result"]);
+ return true;
+}
+
+// some rapidjson helpers
+bool RemoteBackend::getBool(rapidjson::Value &value) {
+ if (value.IsNull()) return false;
+ if (value.IsBool()) return value.GetBool();
+ if (value.IsInt()) return value.GetInt() != 0; // 0 = false, non-zero true
+ if (value.IsDouble()) return value.GetDouble() != 0; // 0 = false, non-zero true
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ if (boost::iequals(tmp, "1") || boost::iequals(tmp, "true")) return true;
+ if (boost::iequals(tmp, "0") || boost::iequals(tmp, "false")) return false;
+ }
+ std::cerr << value.GetType() << endl;
+ throw new AhuException("Cannot convert rapidjson value into boolean");
+}
+
+bool Connector::getBool(rapidjson::Value &value) {
+ if (value.IsNull()) return false;
+ if (value.IsBool()) return value.GetBool();
+ if (value.IsInt()) return value.GetInt() != 0; // 0 = false, non-zero true
+ if (value.IsDouble()) return value.GetDouble() != 0; // 0 = false, non-zero true
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ if (boost::iequals(tmp, "1") || boost::iequals(tmp, "true")) return true;
+ if (boost::iequals(tmp, "0") || boost::iequals(tmp, "false")) return false;
+ }
- serial = answer["result"].GetInt64();
+ // this is specific for Connector!
return true;
}
+std::string Connector::getString(rapidjson::Value &value) {
+ if (value.IsString()) return value.GetString();
+ if (value.IsBool()) return (value.GetBool() ? "true" : "false");
+ if (value.IsInt64()) return boost::lexical_cast<std::string>(value.GetInt64());
+ if (value.IsInt()) return boost::lexical_cast<std::string>(value.GetInt());
+ if (value.IsDouble()) return boost::lexical_cast<std::string>(value.GetDouble());
+ return "(unpresentable value)"; // cannot convert into presentation format
+}
+
+int RemoteBackend::getInt(rapidjson::Value &value) {
+ if (value.IsInt()) return value.GetInt();
+ if (value.IsBool()) return (value.GetBool() ? 1 : 0);
+ if (value.IsUint()) return static_cast<int>(value.GetUint());
+ if (value.IsDouble()) return static_cast<int>(value.GetDouble());
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ return boost::lexical_cast<int>(tmp);
+ }
+ throw new AhuException("Cannot convert rapidjson value into integer");
+}
+
+unsigned int RemoteBackend::getUInt(rapidjson::Value &value) {
+ if (value.IsUint()) return value.GetUint();
+ if (value.IsBool()) return (value.GetBool() ? 1 : 0);
+ if (value.IsInt()) return static_cast<unsigned int>(value.GetInt());
+ if (value.IsDouble()) return static_cast<unsigned int>(value.GetDouble());
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ return boost::lexical_cast<unsigned int>(tmp);
+ }
+ throw new AhuException("Cannot convert rapidjson value into integer");
+}
+
+int64_t RemoteBackend::getInt64(rapidjson::Value &value) {
+ if (value.IsInt64()) return value.GetInt64();
+ if (value.IsBool()) return (value.GetBool() ? 1 : 0);
+ if (value.IsInt()) return value.GetInt();
+ if (value.IsDouble()) return static_cast<int64_t>(value.GetDouble());
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ return boost::lexical_cast<int64_t>(tmp);
+ }
+ throw new AhuException("Cannot convert rapidjson value into integer");
+}
+
+std::string RemoteBackend::getString(rapidjson::Value &value) {
+ if (value.IsString()) return value.GetString();
+ if (value.IsBool()) return (value.GetBool() ? "true" : "false");
+ if (value.IsInt64()) return boost::lexical_cast<std::string>(value.GetInt64());
+ if (value.IsInt()) return boost::lexical_cast<std::string>(value.GetInt());
+ if (value.IsDouble()) return boost::lexical_cast<std::string>(value.GetDouble());
+ throw new AhuException("Cannot convert rapidjson value into std::string");
+}
+
+double RemoteBackend::getDouble(rapidjson::Value &value) {
+ if (value.IsDouble()) return value.GetDouble();
+ if (value.IsBool()) return (value.GetBool() ? 1.0L : 0.0L);
+ if (value.IsInt64()) return static_cast<double>(value.GetInt64());
+ if (value.IsInt()) return static_cast<double>(value.GetInt());
+ if (value.IsString()) { // accepts 0, 1, false, true
+ std::string tmp = value.GetString();
+ return boost::lexical_cast<double>(tmp);
+ }
+ throw new AhuException("Cannot convert rapidjson value into double");
+}
+
DNSBackend *RemoteBackend::maker()
{
try {
@@ -803,15 +892,17 @@
class RemoteLoader
{
- public:
- RemoteLoader()
- {
+public:
+ RemoteLoader();
+};
+
+
+RemoteLoader::RemoteLoader() {
#ifdef REMOTEBACKEND_HTTP
- curl_global_init(CURL_GLOBAL_ALL);
+ curl_global_init(CURL_GLOBAL_ALL);
#endif
- BackendMakers().report(new RemoteBackendFactory);
- L<<Logger::Notice<<kBackendId<<" This is the remotebackend version "VERSION" ("__DATE__", "__TIME__") reporting"<<endl;
- }
-};
+ BackendMakers().report(new RemoteBackendFactory);
+ L<<Logger::Notice<<kBackendId<<" This is the remotebackend version "VERSION" ("__DATE__", "__TIME__") reporting"<<endl;
+}
static RemoteLoader remoteloader;
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/modules/remotebackend/remotebackend.hh
^
|
@@ -30,6 +30,9 @@
bool recv(rapidjson::Document &value);
virtual int send_message(const rapidjson::Document &input) = 0;
virtual int recv_message(rapidjson::Document &output) = 0;
+ protected:
+ bool getBool(rapidjson::Value &value);
+ std::string getString(rapidjson::Value &value);
};
// fwd declarations
@@ -136,5 +139,12 @@
rapidjson::Document *d_result;
int d_index;
int64_t d_trxid;
+
+ bool getBool(rapidjson::Value &value);
+ int getInt(rapidjson::Value &value);
+ unsigned int getUInt(rapidjson::Value &value);
+ int64_t getInt64(rapidjson::Value &value);
+ std::string getString(rapidjson::Value &value);
+ double getDouble(rapidjson::Value &value);
};
#endif
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns.spec
^
|
@@ -1,6 +1,6 @@
BuildRoot: /tmp/pdns
Name: pdns-static
-Version: 3.3rc2
+Version: 3.3
Release: 1
Summary: extremely powerful and versatile nameserver
License: GPL
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/dnsbulktest.cc
^
|
@@ -1,7 +1,6 @@
#include <boost/accumulators/accumulators.hpp>
#include <boost/array.hpp>
#include <boost/accumulators/statistics.hpp>
-#include <boost/accumulators/statistics/p_square_cumulative_distribution.hpp>
#include <boost/program_options.hpp>
#include "inflighter.cc"
#include <deque>
@@ -295,7 +294,6 @@
cerr<<"\n";
cerr<< "Mean response time: "<<mean(*sr.d_acc) << " msec"<<", median: "<<median(*sr.d_acc)<< " msec\n";
- typedef boost::iterator_range<std::vector<std::pair<double, double> >::iterator > histogram_type;
boost::format statfmt("Time < %6.03f msec %|30t|%6.03f%% cumulative\n");
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/dnspcap.hh
^
|
@@ -87,7 +87,7 @@
const struct tcphdr *d_tcp;
const struct udphdr *d_udp;
const uint8_t* d_payload;
- int d_len;
+ unsigned int d_len;
struct pdns_pcap_pkthdr d_pheader;
pdns_pcap_file_header d_pfh;
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/dnsscan.cc
^
|
@@ -51,7 +51,7 @@
if(mdp.d_qtype < 256)
counts[mdp.d_qtype]++;
- for(int i=0; i < mdp.d_qname.length(); ++i)
+ for(unsigned int i=0; i < mdp.d_qname.length(); ++i)
if(!isalnum(mdp.d_qname[i]) && mdp.d_qname[i]!='.' && mdp.d_qname[i]!='-' && mdp.d_qname[i]!='_') {
// cout<<mdp.d_qname<<"|"<<mdp.d_qtype<<"|"<<mdp.d_qclass<<"\n";
// sock.sendTo(string(pr.d_payload, pr.d_payload + pr.d_len), remote);
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/dnstcpbench.cc
^
|
@@ -15,6 +15,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <boost/accumulators/statistics/median.hpp>
+#include <boost/accumulators/statistics/mean.hpp>
+#include <boost/accumulators/accumulators.hpp>
+
+#include <boost/accumulators/statistics.hpp>
+
#include "dnsparser.hh"
#include "sstuff.hh"
#include "misc.hh"
@@ -24,9 +30,11 @@
#include <netinet/tcp.h>
#include <boost/array.hpp>
#include <boost/program_options.hpp>
+#include <boost/foreach.hpp>
StatBag S;
namespace po = boost::program_options;
+
po::variables_map g_vm;
bool g_verbose;
bool g_onlyTCP;
@@ -35,19 +43,24 @@
AtomicCounter g_networkErrors, g_otherErrors, g_OK, g_truncates, g_authAnswers, g_timeOuts;
ComboAddress g_dest;
+unsigned int makeUsec(const struct timeval& tv)
+{
+ return 1000000*tv.tv_sec + tv.tv_usec;
+}
+
/* On Linux, run echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
to prevent running out of free TCP ports */
struct BenchQuery
{
- BenchQuery(const std::string& qname_, uint16_t qtype_) : qname(qname_), qtype(qtype_), udpMsec(0), tcpMsec(0) {}
+ BenchQuery(const std::string& qname_, uint16_t qtype_) : qname(qname_), qtype(qtype_), udpUsec(0), tcpUsec(0), answerSecond(0) {}
BenchQuery(){}
std::string qname;
uint16_t qtype;
- uint16_t udpMsec, tcpMsec;
+ uint32_t udpUsec, tcpUsec;
+ time_t answerSecond;
};
-
void doQuery(BenchQuery* q)
try
{
@@ -56,6 +69,9 @@
int res;
string reply;
+ struct timeval tv, now;
+ gettimeofday(&tv, 0);
+
if(!g_onlyTCP) {
Socket udpsock((AddressFamily)g_dest.sin4.sin_family, Datagram);
@@ -70,6 +86,11 @@
}
udpsock.recvFrom(reply, origin);
+
+ gettimeofday(&now, 0);
+ q->udpUsec = makeUsec(now - tv);
+ tv=now;
+
MOADNSParser mdp(reply);
if(!mdp.d_header.tc)
return;
@@ -116,6 +137,10 @@
reply=string(creply, len);
delete[] creply;
+ gettimeofday(&now, 0);
+ q->tcpUsec = makeUsec(now - tv);
+ q->answerSecond = now.tv_sec;
+
MOADNSParser mdp(reply);
// cout<<"Had correct TCP/IP response, "<<mdp.d_answers.size()<<" answers, aabit="<<mdp.d_header.aa<<endl;
if(mdp.d_header.aa)
@@ -140,7 +165,6 @@
vector<BenchQuery> g_queries;
-
static void* worker(void*)
{
for(;;) {
@@ -161,6 +185,7 @@
("help,h", "produce help message")
("verbose,v", "be verbose")
("udp-first,u", "try UDP first")
+ ("file,f", po::value<string>(), "source file - if not specified, defaults to stdin")
("tcp-no-delay", po::value<bool>()->default_value(true), "use TCP_NODELAY socket option")
("timeout-msec", po::value<int>()->default_value(10), "wait for this amount of milliseconds for an answer")
("workers", po::value<int>()->default_value(100), "number of parallel workers");
@@ -210,7 +235,14 @@
pthread_t workers[numworkers];
- FILE* fp=fdopen(0, "r");
+ FILE* fp;
+ if(!g_vm.count("file"))
+ fp=fdopen(0, "r");
+ else {
+ fp=fopen(g_vm["file"].as<string>().c_str(), "r");
+ if(!fp)
+ unixDie("Unable to open "+g_vm["file"].as<string>()+" for input");
+ }
pair<string, string> q;
string line;
while(stringfgets(fp, line)) {
@@ -227,6 +259,34 @@
void* status;
pthread_join(workers[n], &status);
}
+
+ using namespace boost::accumulators;
+ typedef accumulator_set<
+ unsigned int
+ , stats<boost::accumulators::tag::median(with_p_square_quantile),
+ boost::accumulators::tag::mean(immediate)
+ >
+ > acc_t;
+
+ acc_t udpspeeds, tcpspeeds, qps;
+
+ typedef map<time_t, uint32_t> counts_t;
+ counts_t counts;
+
+ BOOST_FOREACH(const BenchQuery& bq, g_queries) {
+ counts[bq.answerSecond]++;
+ udpspeeds(bq.udpUsec);
+ tcpspeeds(bq.tcpUsec);
+ }
+
+ BOOST_FOREACH(const counts_t::value_type& val, counts) {
+ qps(val.second);
+ }
+
+ cout<<"Average qps: "<<mean(qps)<<", median qps: "<<median(qps)<<endl;
+ cout<<"Average UDP latency: "<<mean(udpspeeds)<<"usec, median: "<<median(udpspeeds)<<"usec"<<endl;
+ cout<<"Average TCP latency: "<<mean(tcpspeeds)<<"usec, median: "<<median(tcpspeeds)<<"usec"<<endl;
+
cout<<"OK: "<<g_OK<<", network errors: "<<g_networkErrors<<", other errors: "<<g_otherErrors<<endl;
cout<<"Timeouts: "<<g_timeOuts<<endl;
cout<<"Truncateds: "<<g_truncates<<", auth answers: "<<g_authAnswers<<endl;
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/dnswasher.cc
^
|
@@ -55,7 +55,7 @@
IPObfuscator ipo;
while(pr.getUDPPacket()) {
- if(ntohs(pr.d_udp->uh_dport)==53 || ntohs(pr.d_udp->uh_sport)==53 && pr.d_len > sizeof(dnsheader)) {
+ if(ntohs(pr.d_udp->uh_dport)==53 || (ntohs(pr.d_udp->uh_sport)==53 && pr.d_len > sizeof(dnsheader))) {
dnsheader* dh=(dnsheader*)pr.d_payload;
uint32_t *src=(uint32_t*)&pr.d_ip->ip_src;
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/docs/dnstcpbench.1
^
|
@@ -2,12 +2,12 @@
.\" Title: dnstcpbench
.\" Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: 06/27/2013
+.\" Date: 07/05/2013
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DNSTCPBENCH" "1" "06/27/2013" "\ \&" "\ \&"
+.TH "DNSTCPBENCH" "1" "07/05/2013" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -31,10 +31,10 @@
dnstcpbench \- tool to perform TCP benchmarking of nameservers
.SH "SYNOPSIS"
.sp
-\fIdnstcpbench\fR [\-\-help] [\-\-verbose] [\-\-udp\-first, \-u] [\-\-workers] [\-\-timeout\-msec] remote\-ip\-address [remote\-port]
+\fIdnstcpbench\fR [\-\-help] [\-\-file=filename] [\-\-verbose] [\-\-udp\-first, \-u] [\-\-workers] [\-\-timeout\-msec] remote\-ip\-address [remote\-port]
.SH "DESCRIPTION"
.sp
-dnstcpbench reads DNS queries from standard input and sends them out in parallel to a remote nameserver\&. By default TCP/IP is used, but optionally, UDP is tried first, which allows for the benchmarking of TCP/IP fallback\&.
+dnstcpbench reads DNS queries (by default from standard input) and sends them out in parallel to a remote nameserver\&. By default TCP/IP is used, but optionally, UDP is tried first, which allows for the benchmarking of TCP/IP fallback\&.
.sp
The input format is one query per line: qname single\-space qtype\&. An example: www\&.powerdns\&.com ANY powerdns\&.com MX
.sp
@@ -53,35 +53,45 @@
The equivalent for IPv6 is not known\&.
.SH "OPTIONS"
.PP
-\-\-verbose
+\-f,\-\-file
.RS 4
-Be wordy on what the program is doing
+Filename from which to read queries\&. Defaults to standard input if unspecified\&.
.RE
.PP
-\-\-udp\-first, \-u
+\-h,\-\-help
.RS 4
-Attempt resolution via UDP first, only do TCP if truncated answer is received
+Provide a helpful message
.RE
.PP
-\-\-workers
+\-\-timeout\-msec
.RS 4
-Number of parallel worker threads to use\&.
+Number of milliseconds to wait for an answer
.RE
.PP
-\-\-timeout\-msec
+\-\-udp\-first, \-u
.RS 4
-Number of milliseconds to wait for an answer
+Attempt resolution via UDP first, only do TCP if truncated answer is received
.RE
.PP
-\-\-help
+\-v,\-\-verbose
.RS 4
-Provide a helpful message
+Be wordy on what the program is doing
+.RE
+.PP
+\-\-workers
+.RS 4
+Number of parallel worker threads to use\&.
.RE
.sp
Remote IP address can be IPv4 or IPv6\&. Remote port defaults to 53\&.
+.SH "STATISTICAL OUTPUT"
+.sp
+The program reports both mean and median numbers for queries per second and UDP and TCP latency\&. Each query only counts once, even if it is tried over UDP first\&. This effectively means that passing \fI\-u\fR can lower query rates if many queries get shunted to TCP\&.
.SH "BUGS"
.sp
Currently the timeout code does not actually perform non\-blocking connects or writes\&. So a slow connect or slow writes will still cause low performance and delays\&.
+.sp
+Median queries per second statistics are reported as 0 for sub\-second runs\&.
.SH "AUTHOR"
.sp
Written by PowerDNS\&.COM BV, bert hubert, <\m[blue]\fBbert\&.hubert@netherlabs\&.nl\fR\m[]\&\s-2\u[1]\d\s+2>
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/docs/pdns_server.8
^
|
@@ -22,6 +22,9 @@
.TP
.B \-\-loglevel=\fI<level>\fR
Set the logging level.
+.TP
+.B \-\-help
+To view more options that are available use this option.
.SH FILES
.TP
.I <socket>
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/no-dnssec.schema.mysql.sql
^
|
@@ -23,7 +23,6 @@
primary key(id)
) Engine=InnoDB;
-CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/packethandler.cc
^
|
@@ -286,20 +286,23 @@
/** Determines if we are authoritative for a zone, and at what level */
bool PacketHandler::getAuth(DNSPacket *p, SOAData *sd, const string &target, int *zoneId)
{
+ bool found=false;
string subdomain(target);
do {
if( B.getSOA( subdomain, *sd, p ) ) {
- if(p->qtype.getCode() == QType::DS && pdns_iequals(subdomain, target))
- continue; // A DS question is never answered from the apex, go one zone upwards
-
sd->qname = subdomain;
if(zoneId)
*zoneId = sd->domain_id;
- return true;
+
+ if(p->qtype.getCode() == QType::DS && pdns_iequals(subdomain, target)) {
+ // Found authoritative zone but look for parent zone with 'DS' record.
+ found=true;
+ } else
+ return true;
}
}
while( chopOff( subdomain ) ); // 'www.powerdns.org' -> 'powerdns.org' -> 'org' -> ''
- return false;
+ return found;
}
vector<DNSResourceRecord> PacketHandler::getBestReferralNS(DNSPacket *p, SOAData& sd, const string &target)
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/pdnssec.cc
^
|
@@ -165,6 +165,11 @@
// I think this has to do with interlocking transactions between B and DK, but unsure.
bool rectifyZone(DNSSECKeeper& dk, const std::string& zone)
{
+ if(dk.isPresigned(zone)){
+ cerr<<"Rectify presigned zone '"<<zone<<"' is not allowed/necessary."<<endl;
+ return false;
+ }
+
UeberBackend B("default");
bool doTransaction=true; // but see above
SOAData sd;
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/sillyrecords.cc
^
|
@@ -76,7 +76,7 @@
while (isspace(*cp))
cp++;
- if (!(isdigit(*cp)))
+ if (*cp && !(isdigit(*cp)))
goto fndhemi;
while (isdigit(*cp))
@@ -95,7 +95,7 @@
}
}
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (*cp && !isspace(*cp)) /* if any trailing garbage */
cp++;
while (isspace(*cp))
@@ -136,7 +136,7 @@
cp++; /* skip the hemisphere */
- while (!isspace(*cp)) /* if any trailing garbage */
+ while (*cp && !isspace(*cp)) /* if any trailing garbage */
cp++;
while (isspace(*cp)) /* move to next field */
@@ -219,7 +219,7 @@
}
break;
default: /* we didn't get one of each */
- return;
+ throw MOADNSException("Error decoding LOC content");
}
/* altitude */
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/slavecommunicator.cc
^
|
@@ -155,6 +155,7 @@
bool gotOptOutFlag = false;
unsigned int soa_serial = 0;
vector<DNSResourceRecord> rrs;
+ set<string> secured;
while(retriever.getChunk(recs)) {
if(first) {
L<<Logger::Error<<"AXFR started for '"<<domain<<"'"<<endl;
@@ -177,7 +178,10 @@
continue;
} else if (i->qtype.getCode() == QType::NSEC3) {
dnssecZone = gotPresigned = true;
- gotOptOutFlag = NSEC3RecordContent(i->content).d_flags & 1;
+ NSEC3RecordContent ns3rc(i->content);
+ gotOptOutFlag = ns3rc.d_flags & 1;
+ if (ns3rc.d_set.count(QType::NS) && !pdns_iequals(i->qname, domain))
+ secured.insert(toLower(makeRelative(i->qname, domain)));
continue;
} else if (i->qtype.getCode() == QType::NSEC) {
dnssecZone = gotPresigned = true;
@@ -210,6 +214,7 @@
}
}
+
BOOST_FOREACH(const DNSResourceRecord& rr, rrs) {
if(rr.qtype.getCode() == QType::NS && !pdns_iequals(rr.qname, domain))
nsset.insert(rr.qname);
@@ -276,8 +281,8 @@
if (dnssecZone && rr.qtype.getCode() != QType::RRSIG) {
if (haveNSEC3) {
// NSEC3
- if(!narrow && (rr.auth || (rr.qtype.getCode() == QType::NS && !gotOptOutFlag))) {
- ordername=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname)));
+ ordername=toLower(toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname)));
+ if(!narrow && (rr.auth || (rr.qtype.getCode() == QType::NS && (!gotOptOutFlag || secured.count(ordername))))) {
di.backend->feedRecord(rr, &ordername);
} else
di.backend->feedRecord(rr);
|
[-]
[+]
|
Changed |
pdns-3.3.tar.gz/pdns/tcpreceiver.cc
^
|
@@ -492,6 +492,8 @@
DNSSECKeeper dk;
dk.clearCaches(target);
bool securedZone = dk.isSecuredZone(target);
+ bool presignedZone = dk.isPresigned(target);
+
if(dk.getNSEC3PARAM(target, &ns3pr, &narrow)) {
NSEC3Zone=true;
if(narrow) {
@@ -642,12 +644,17 @@
/* now write all other records */
string keyname;
+ set<string> ns3rrs;
DTime dt;
dt.set();
int records=0;
while(sd.db->get(rr)) {
- if (rr.qtype.getCode() == QType::RRSIG)
+ if (rr.qtype.getCode() == QType::RRSIG) {
+ RRSIGRecordContent rrc(rr.content);
+ if(presignedZone && rrc.d_type == QType::NSEC3)
+ ns3rrs.insert(fromBase32Hex(makeRelative(rr.qname, target)));
continue;
+ }
// only skip the DNSKEY if direct-dnskey is enabled, to avoid changing behaviour
// when it is not enabled.
@@ -660,7 +667,7 @@
keyname = NSEC3Zone ? hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rr.qname) : labelReverse(rr.qname);
NSECXEntry& ne = nsecxrepo[keyname];
ne.d_ttl = sd.default_ttl;
- ne.d_auth = (ne.d_auth || rr.auth || (NSEC3Zone && !ns3pr.d_flags));
+ ne.d_auth = (ne.d_auth || rr.auth || (NSEC3Zone && (!ns3pr.d_flags || (presignedZone && ns3pr.d_flags))));
if (rr.qtype.getCode()) {
ne.d_set.insert(rr.qtype.getCode());
}
@@ -697,7 +704,7 @@
if(securedZone) {
if(NSEC3Zone) {
for(nsecxrepo_t::const_iterator iter = nsecxrepo.begin(); iter != nsecxrepo.end(); ++iter) {
- if(iter->second.d_auth) {
+ if(iter->second.d_auth && (!presignedZone || !ns3pr.d_flags || ns3rrs.count(iter->first))) {
NSEC3RecordContent n3rc;
n3rc.d_set = iter->second.d_set;
if (n3rc.d_set.size() && (n3rc.d_set.size() != 1 || !n3rc.d_set.count(QType::NS)))
@@ -710,7 +717,7 @@
inext++;
if(inext == nsecxrepo.end())
inext = nsecxrepo.begin();
- while(!(inext->second.d_auth) && inext != iter)
+ while((!inext->second.d_auth || (presignedZone && ns3pr.d_flags && !ns3rrs.count(inext->first))) && inext != iter)
{
inext++;
if(inext == nsecxrepo.end())
|