Commit 7e16a5a5 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[1651] Merge branch 'master' into trac1651

Conflicts:
	ChangeLog
	doc/guide/bind10-guide.html
	src/bin/dhcp4/main.cc
	src/lib/dhcp/tests/iface_mgr_unittest.cc
parents 30306192 031bfc28
*.gcda
*.gcno
*.gcov
*.la
*.lo
*.o
......@@ -28,4 +31,7 @@ TAGS
/py-compile
/stamp-h1
/all.info
/coverage-cpp-html
/dns++.pc
/report.info
Chen Zhengzhang
Dmitriy Volodin
Evan Hunt
Haidong Wang
Haikuo Zhang
Han Feng
Jelte Jansen
Jeremy C. Reed
Xie Jiagui
Jin Jian
JINMEI Tatuya
Kazunori Fujiwara
Michael Graff
Michal Vaner
Mukund Sivaraman
Naoki Kambe
Shane Kerr
Shen Tingting
Stephen Morris
Yoshitaka Aharen
Zhang Likun
4XX. [func]* tomek
450. [func]* tomek
b10-dhcp4: DHCPv4 server component is now integrated into
BIND10 framework. It can be started from BIND10 (using bindctl)
and can receive commands. The only supported command for now
is 'Dhcp4 shutdown'.
bind10-devel-20120621 released on June 21. 2012
449. [bug] muks
b10-xfin: fixed a bug where xfrin sent the wrong notification
message to zonemgr on successful zone transfer. This also
solves other reported problems such as too frequent attempts
of zone refreshing (see Trac #1786 and #1834).
(Trac #2023, git b5fbf8a408a047a2552e89ef435a609f5df58d8c)
448. [func] team
b10-ddns is now functional and handles dynamic update requests
per RFC 2136. See BIND 10 guide for configuration and operation
details.
(Multiple Trac tickets)
447. [bug] jinmei
Fixed a bug in b10-xfrout where a helper thread could fall into
an infinite loop if b10-auth stops while the thread is waiting for
forwarded requests from b10-auth.
(Trac #988 and #1833, git 95a03bbefb559615f3f6e529d408b749964d390a)
446. [bug] muks
A number of warnings reported by Python about unclosed file and
socket objects were fixed. Some related code was also made safer.
(Trac #1828, git 464682a2180c672f1ed12d8a56fd0a5ab3eb96ed)
445. [bug]* jinmei
The pre-install check for older SQLite3 DB now refers to the DB
file with the prefix of DESTDIR. This ensures that 'make install'
with specific DESTDIR works regardless of the version of the DB
file installed in the default path.
(Trac #1982, git 380b3e8ec02ef45555c0113ee19329fe80539f71)
444. [bug] jinmei
libdatasrc: fixed ZoneFinder for database-based data sources so
that it handles type DS query correctly, i.e., treating it as
authoritative data even on a delegation point.
(Trac #1912, git 7130da883f823ce837c10cbf6e216a15e1996e5d)
443. [func]* muks
The logger now uses a lockfile named `logger_lockfile' that is
created in the local state directory to mutually separate
individual logging operations from various processes. This is
done so that log messages from different processes don't mix
together in the middle of lines. The `logger_lockfile` is created
with file permission mode 0660. BIND 10's local state directory
should be writable and perhaps have g+s mode bit so that the
`logger_lockfile` can be opened by a group of processes.
(Trac #1704, git ad8d445dd0ba208107eb239405166c5c2070bd8b)
442. [func] tomek
b10-dhcp4, b10-dhcp6: Both DHCP servers now accept -p parameter
that can be used to specify listening port number. This capability
is useful only for testing purposes.
(Trac #1503, git e60af9fa16a6094d2204f27c40a648fae313bdae)
441. [func] tomek
libdhcp++: Stub interface detection (support for interfaces.txt
file) was removed.
(Trac #1281, git 900fc8b420789a8c636bcf20fdaffc60bc1041e0)
bind10-devel-20120517 released on May 17. 2012
440. [func] muks
bindctl: improved some error messages so they will be more
helpful. Those include the one when the zone name is unspecified
or the name is invalid in the b10-auth configuration.
(Trac #1627, git 1a4d0ae65b2c1012611f4c15c5e7a29d65339104)
439. [func] team
The in-memory data source can now load zones from the
sqlite3 data source, so that zones stored in the database
(and updated for example by xfrin) can be served from memory.
(Trac #1789,#1790,#1792,#1793,#1911,
git 93f11d2a96ce4dba9308889bdb9be6be4a765b27)
438. [bug] naokikambe
b10-stats-httpd now sends the system a notification that
it is shutting down if it encounters a fatal error during
startup.
(Trac #1852, git a475ef271d4606f791e5ed88d9b8eb8ed8c90ce6)
437. [build] jinmei
Building BIND 10 may fail on MacOS if Python has been
installed via Homebrew unless --without-werror is specified.
The configure script now includes a URL that explains this
issue when it detects failure that is possibly because of
this problem.
(Trac #1907, git 0d03b06138e080cc0391fb912a5a5e75f0f97cec)
436. [bug] jelte
The --config-file option now works correctly with relative paths if
--data-path is not given.
(Trac #1889, git ce7d1aef2ca88084e4dacef97132337dd3e50d6c)
435. [func] team
The in-memory datasource now supports NSEC-signed zones.
(Trac #1802-#1810, git 2f9aa4a553a05aa1d9eac06f1140d78f0c99408b)
434. [func] tomek
libdhcp++: Linux interface detection refactored. The code is
now cleaner. Tests better support certain versions of ifconfig.
......@@ -37,8 +136,8 @@
(Trac #1843, git 551657702a4197ef302c567b5c0eaf2fded3e121)
428. [bug] marcin
perfdhcp: bind to local address to allow reception of replies from IPv6
DHCP servers.
perfdhcp: bind to local address to allow reception of
replies from IPv6 DHCP servers.
(Trac #1908, git 597e059afaa4a89e767f8f10d2a4d78223af3940)
427. [bug] jinmei
......@@ -48,10 +147,11 @@
now manipulates them in the separate table for the NSEC3 namespace.
As a result b10-xfrin now correctly updates NSEC3-signed zones by
inbound zone transfers.
(Trac #1891, git 672f129700dae33b701bb02069cf276238d66be3)
(Trac #1781,#1788,#1891, git 672f129700dae33b701bb02069cf276238d66be3)
426. [bug] vorner
The NSEC3 records are now included when transferring a signed zone out.
The NSEC3 records are now included when transferring a
signed zone out.
(Trac #1782, git 36efa7d10ecc4efd39d2ce4dfffa0cbdeffa74b0)
425. [func]* muks
......@@ -202,7 +302,7 @@ bind10-devel-20120329 released on March 29, 2012
providing result for random instance.
(Trac #1751, git 3285353a660e881ec2b645e1bc10d94e5020f357)
403. [build]* jelte
403. [build]* jelte
The configure option for botan (--with-botan=PATH) is replaced by
--with-botan-config=PATH, which takes a full path to a botan-config
script, instead of the botan 'install' directory. Also, if not
......
......@@ -16,6 +16,26 @@ DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
# Use same --with-gtest flag if set
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GTEST_CONFIGURE_FLAG)
dist_doc_DATA = AUTHORS COPYING ChangeLog README
.PHONY: check-valgrind check-valgrind-suppress
check-valgrind:
if HAVE_VALGRIND
@VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after=" \
make -C $(abs_top_builddir) check
else
@echo "*** Valgrind is required for check-valgrind ***"; exit 1;
endif
check-valgrind-suppress:
if HAVE_VALGRIND
@VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --error-exitcode=1 --suppressions=$(abs_top_srcdir)/src/valgrind-suppressions --suppressions=$(abs_top_srcdir)/src/valgrind-suppressions.revisit --num-callers=48 --leak-check=full --fullpath-after=" \
make -C $(abs_top_builddir) check
else
@echo "*** Valgrind is required for check-valgrind-suppress ***"; exit 1;
endif
clean-cpp-coverage:
@if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --directory . --zerocounters; \
......@@ -405,3 +425,5 @@ EXTRA_DIST += ext/coroutine/coroutine.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dns++.pc
CLEANFILES = $(abs_top_builddir)/logger_lockfile
......@@ -2,17 +2,14 @@
This is the source for the development version of BIND 10.
BIND is the popular implementation of a DNS server, developer
interfaces, and DNS tools. BIND 10 is a rewrite of BIND 9. BIND 10
is written in C++ and Python and provides a modular environment
for serving, maintaining, and developing DNS.
interfaces, and DNS tools. BIND 10 is a rewrite of BIND 9 and ISC
DHCP. BIND 10 is written in C++ and Python and provides a modular
environment for serving, maintaining, and developing DNS and DHCP.
BIND10-devel is new development leading up to the production
BIND 10 release. It contains prototype code and experimental
interfaces. Nevertheless it is ready to use now for testing the
new BIND 10 infrastructure ideas. The Year 3 goals of the five
year plan are described here:
http://bind10.isc.org/wiki/Year3Goals
new BIND 10 infrastructure ideas.
This release includes the bind10 master process, b10-msgq message
bus, b10-auth authoritative DNS server (with SQLite3 and in-memory
......
# We're going to abuse install-data-local for a pre-install check.
# This is to be considered a short term hack and is expected to be removed
# in a near future version.
# We're going to abuse install-data-local for a pre-install check. This may
# not be the cleanest way to do this type of job, but that's the least ugly
# one we've found.
#
# Note also that if any test needs to examine some file that has possibly
# been installed before (e.g., older DB or configuration file), it should be
# referenced with the prefix of DESTDIR. Otherwise
# 'make DESTDIR=/somewhere install' may not work.
install-data-local:
if test -e $(localstatedir)/$(PACKAGE)/zone.sqlite3; then \
if test -e $(DESTDIR)$(localstatedir)/$(PACKAGE)/zone.sqlite3; then \
$(SHELL) $(top_builddir)/src/bin/dbutil/run_dbutil.sh --check \
$(localstatedir)/$(PACKAGE)/zone.sqlite3 || \
$(DESTDIR)$(localstatedir)/$(PACKAGE)/zone.sqlite3 || \
(echo "\nSQLite3 DB file schema version is old. " \
"Please run: " \
"$(abs_top_builddir)/src/bin/dbutil/run_dbutil.sh --upgrade " \
"$(localstatedir)/$(PACKAGE)/zone.sqlite3"; exit 1) \
"$(DESTDIR)$(localstatedir)/$(PACKAGE)/zone.sqlite3"; exit 1) \
fi
......@@ -362,7 +362,7 @@ if test $werror_ok = 1; then
PYTHON_CXXFLAGS="${PYTHON_CXXFLAGS} -Wno-unused-parameter"
AC_SUBST(PYTHON_CXXFLAGS)
],
[AC_MSG_ERROR([Can't compile against Python.h])]
[AC_MSG_ERROR([Can't compile against Python.h. If you're using MacOS X and have installed Python with Homebrew, see http://bind10.isc.org/wiki/SystemNotesMacOSX])]
)
]
)
......@@ -407,9 +407,9 @@ case $system in
OS_TYPE="BSD"
CPPFLAGS="$CPPFLAGS -DOS_BSD"
;;
Solaris)
SunOS)
OS_TYPE="Solaris"
CPPFLAGS="$CPPFLAGS -DOS_SOLARIS"
CPPFLAGS="$CPPFLAGS -DOS_SUN"
;;
*)
OS_TYPE="Unknown"
......@@ -982,6 +982,15 @@ AC_ARG_ENABLE(logger-checks, [AC_HELP_STRING([--enable-logger-checks],
AM_CONDITIONAL(ENABLE_LOGGER_CHECKS, test x$enable_logger_checks != xno)
AM_COND_IF([ENABLE_LOGGER_CHECKS], [AC_DEFINE([ENABLE_LOGGER_CHECKS], [1], [Check logger messages?])])
# Check for valgrind
AC_PATH_PROG(VALGRIND, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test "x$VALGRIND" != "xno")
found_valgrind="not found"
if test "x$VALGRIND" != "xno"; then
found_valgrind="found"
fi
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/guide/Makefile
......@@ -1067,6 +1076,8 @@ AC_CONFIG_FILES([Makefile
src/lib/python/isc/testutils/Makefile
src/lib/python/isc/bind10/Makefile
src/lib/python/isc/bind10/tests/Makefile
src/lib/python/isc/ddns/Makefile
src/lib/python/isc/ddns/tests/Makefile
src/lib/python/isc/xfrin/Makefile
src/lib/python/isc/xfrin/tests/Makefile
src/lib/python/isc/server_common/Makefile
......@@ -1120,6 +1131,7 @@ AC_CONFIG_FILES([Makefile
tests/tools/badpacket/Makefile
tests/tools/badpacket/tests/Makefile
tests/tools/perfdhcp/Makefile
tests/tools/perfdhcp/tests/Makefile
dns++.pc
])
AC_OUTPUT([doc/version.ent
......@@ -1184,6 +1196,7 @@ AC_OUTPUT([doc/version.ent
src/lib/log/tests/destination_test.sh
src/lib/log/tests/init_logger_test.sh
src/lib/log/tests/local_file_test.sh
src/lib/log/tests/logger_lock_test.sh
src/lib/log/tests/severity_test.sh
src/lib/log/tests/tempdir.h
src/lib/util/python/mkpywrapper.py
......@@ -1232,6 +1245,7 @@ AC_OUTPUT([doc/version.ent
chmod +x src/lib/log/tests/destination_test.sh
chmod +x src/lib/log/tests/init_logger_test.sh
chmod +x src/lib/log/tests/local_file_test.sh
chmod +x src/lib/log/tests/logger_lock_test.sh
chmod +x src/lib/log/tests/severity_test.sh
chmod +x src/lib/util/python/mkpywrapper.py
chmod +x src/lib/util/python/gen_wiredata.py
......@@ -1287,8 +1301,10 @@ Features:
Developer:
Google Tests: $gtest_path
Valgrind: $found_valgrind
C++ Code Coverage: $USE_LCOV
Python Code Coverage: $USE_PYCOVERAGE
Logger checks: $enable_logger_checks
Generate Manuals: $enable_man
END
......
......@@ -579,7 +579,7 @@ INPUT = ../src/lib/exceptions ../src/lib/cc \
../src/lib/testutils ../src/lib/cache ../src/lib/server_common/ \
../src/bin/sockcreator/ ../src/lib/util/ ../src/lib/util/io/ \
../src/lib/resolve ../src/lib/acl ../src/bin/dhcp6 ../src/lib/dhcp \
../src/bin/dhcp4 devel
../src/bin/dhcp4 ../tests/tools/perfdhcp devel
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
......
EXTRA_DIST = bind10-guide.css
EXTRA_DIST += bind10-guide.xml bind10-guide.html bind10-guide.txt
EXTRA_DIST += bind10-messages.xml bind10-messages.html
dist_doc_DATA = bind10-guide.txt
dist_html_DATA = bind10-guide.css bind10-guide.html bind10-messages.html
EXTRA_DIST = bind10-guide.xml bind10-messages.xml
# This is not a "man" manual, but reuse this for now for docbook.
if ENABLE_MAN
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
SUBDIRS = lib bin
EXTRA_DIST = \
cppcheck-suppress.lst \
valgrind-suppressions \
valgrind-suppressions.revisit
......@@ -51,9 +51,9 @@ b10_auth_SOURCES += statistics.cc statistics.h
b10_auth_SOURCES += main.cc
# This is a temporary workaround for #1206, where the InMemoryClient has been
# moved to an ldopened library. We could add that library to LDADD, but that
# is nonportable. When #1207 is done this becomes moot anyway, and the
# specific workaround is not needed anymore, so we can then remove this
# line again.
# is nonportable. This should've been moot after #1207, but there is still
# one dependency; the in-memory-specific zone loader call is still in
# auth.
b10_auth_SOURCES += ${top_srcdir}/src/lib/datasrc/memory_datasrc.cc
nodist_b10_auth_SOURCES = auth_messages.h auth_messages.cc
......@@ -62,6 +62,7 @@ EXTRA_DIST += auth_messages.mes
b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/libdatasrc.la
b10_auth_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
b10_auth_LDADD += $(top_builddir)/src/lib/util/libutil.la
b10_auth_LDADD += $(top_builddir)/src/lib/util/io/libutil_io.la
b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.la
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.la
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
......
......@@ -43,22 +43,19 @@ using namespace isc::datasrc;
using namespace isc::server_common::portconfig;
namespace {
// Forward declaration
AuthConfigParser*
createAuthConfigParser(AuthSrv& server, const std::string& config_id,
bool internal);
/// A derived \c AuthConfigParser class for the "datasources" configuration
/// identifier.
class DatasourcesConfig : public AuthConfigParser {
public:
DatasourcesConfig(AuthSrv& server) : server_(server) {}
DatasourcesConfig(AuthSrv& server) : server_(server)
{}
virtual void build(ConstElementPtr config_value);
virtual void commit();
private:
AuthSrv& server_;
vector<boost::shared_ptr<AuthConfigParser> > datasources_;
set<string> configured_sources_;
vector<pair<RRClass, DataSourceClientContainerPtr> > clients_;
};
/// A derived \c AuthConfigParser for the version value
......@@ -86,137 +83,60 @@ DatasourcesConfig::build(ConstElementPtr config_value) {
isc_throw(AuthConfigError, "Data source type '" <<
datasrc_type->stringValue() << "' already configured");
}
boost::shared_ptr<AuthConfigParser> datasrc_config =
boost::shared_ptr<AuthConfigParser>(
createAuthConfigParser(server_, string("datasources/") +
datasrc_type->stringValue(),
true));
datasrc_config->build(datasrc_elem);
datasources_.push_back(datasrc_config);
configured_sources_.insert(datasrc_type->stringValue());
}
}
// Apart from that it's not really easy to get at the default
// class value for the class here, it should probably really
// be a property of the instantiated data source. For now
// use hardcoded default IN.
const RRClass rrclass =
datasrc_elem->contains("class") ?
RRClass(datasrc_elem->get("class")->stringValue()) : RRClass::IN();
// Right now, we only support the in-memory data source for the
// RR class of IN. We reject other cases explicitly by hardcoded
// checks. This will soon be generalized, at which point these
// checks will also have to be cleaned up.
if (rrclass != RRClass::IN()) {
isc_throw(isc::InvalidParameter, "Unsupported data source class: "
<< rrclass);
}
if (datasrc_type->stringValue() != "memory") {
isc_throw(AuthConfigError, "Unsupported data source type: "
<< datasrc_type->stringValue());
}
void
DatasourcesConfig::commit() {
// XXX a short term workaround: clear all data sources and then reset
// to new ones so that we can remove data sources that don't exist in
// the new configuration and have been used in the server.
// This could be inefficient and requires knowledge about
// server implementation details, and isn't scalable wrt the number of
// data source types, and should eventually be improved.
// Currently memory data source for class IN is the only possibility.
server_.setInMemoryClient(RRClass::IN(), AuthSrv::InMemoryClientPtr());
// Create a new client for the specified data source and store it
// in the local vector. For now, we always build a new client
// from the scratch, and replace any existing ones with the new ones.
// We might eventually want to optimize building zones (in case of
// reloading) by selectively loading fresh zones for data source
// where zone loading is expensive (such as in-memory).
clients_.push_back(
pair<RRClass, DataSourceClientContainerPtr>(
rrclass,
DataSourceClientContainerPtr(new DataSourceClientContainer(
datasrc_type->stringValue(),
datasrc_elem))));
BOOST_FOREACH(boost::shared_ptr<AuthConfigParser> datasrc_config,
datasources_) {
datasrc_config->commit();
configured_sources_.insert(datasrc_type->stringValue());
}
}
/// A derived \c AuthConfigParser class for the memory type datasource
/// configuration. It does not correspond to the configuration syntax;
/// it's instantiated for internal use.
class MemoryDatasourceConfig : public AuthConfigParser {
public:
MemoryDatasourceConfig(AuthSrv& server) :
server_(server),
rrclass_(0) // XXX: dummy initial value
{}
virtual void build(ConstElementPtr config_value);
virtual void commit() {
server_.setInMemoryClient(rrclass_, memory_client_);
}
private:
AuthSrv& server_;
RRClass rrclass_;
AuthSrv::InMemoryClientPtr memory_client_;
};
void
MemoryDatasourceConfig::build(ConstElementPtr config_value) {
// XXX: apparently we cannot retrieve the default RR class from the
// module spec. As a temporary workaround we hardcode the default value.
ConstElementPtr rrclass_elem = config_value->get("class");
rrclass_ = RRClass(rrclass_elem ? rrclass_elem->stringValue() : "IN");
// We'd eventually optimize building zones (in case of reloading) by
// selectively loading fresh zones. Right now we simply check the
// RR class is supported by the server implementation.
server_.getInMemoryClient(rrclass_);
memory_client_ = AuthSrv::InMemoryClientPtr(new InMemoryClient());
ConstElementPtr zones_config = config_value->get("zones");
if (!zones_config) {
// XXX: Like the RR class, we cannot retrieve the default value here,
// so we assume an empty zone list in this case.
return;
}
BOOST_FOREACH(ConstElementPtr zone_config, zones_config->listValue()) {
ConstElementPtr origin = zone_config->get("origin");
const string origin_txt = origin ? origin->stringValue() : "";
if (origin_txt.empty()) {
isc_throw(AuthConfigError, "Missing zone origin");
}
ConstElementPtr file = zone_config->get("file");
const string file_txt = file ? file->stringValue() : "";
if (file_txt.empty()) {
isc_throw(AuthConfigError, "Missing zone file for zone: "
<< origin_txt);
}
// We support the traditional text type and SQLite3 backend. For the
// latter we create a client for the underlying SQLite3 data source,
// and build the in-memory zone using an iterator of the underlying
// zone.
ConstElementPtr filetype = zone_config->get("filetype");
const string filetype_txt = filetype ? filetype->stringValue() :
"text";
boost::scoped_ptr<DataSourceClientContainer> container;
if (filetype_txt == "sqlite3") {
container.reset(new DataSourceClientContainer(
"sqlite3",
Element::fromJSON("{\"database_file\": \"" +
file_txt + "\"}")));
} else if (filetype_txt != "text") {
isc_throw(AuthConfigError, "Invalid filetype for zone "
<< origin_txt << ": " << filetype_txt);
}
// Note: we don't want to have such small try-catch blocks for each
// specific error. We may eventually want to introduce some unified
// error handling framework as we have more configuration parameters.
// See bug #1627 for the relevant discussion.
InMemoryZoneFinder* imzf = NULL;
try {
imzf = new InMemoryZoneFinder(rrclass_, Name(origin_txt));
} catch (const isc::dns::NameParserException& ex) {
isc_throw(AuthConfigError, "unable to parse zone's origin: " <<
ex.what());
}
boost::shared_ptr<InMemoryZoneFinder> zone_finder(imzf);
const result::Result result = memory_client_->addZone(zone_finder);
if (result == result::EXIST) {
isc_throw(AuthConfigError, "zone "<< origin->str()
<< " already exists");
}
/*
* TODO: Once we have better reloading of configuration (something
* else than throwing everything away and loading it again), we will
* need the load method to be split into some kind of build and
* commit/abort parts.
*/
if (filetype_txt == "text") {
zone_finder->load(file_txt);
} else {
zone_finder->load(*container->getInstance().getIterator(
Name(origin_txt)));
}
DatasourcesConfig::commit() {
// As noted in build(), the current implementation only supports the
// in-memory data source for class IN, and build() should have ensured
// it. So, depending on the vector is empty or not, we either clear
// or install an in-memory data source for the server.
//
// When we generalize it, we'll somehow install all data source clients
// built in the vector, clearing deleted ones from the server.
if (clients_.empty()) {
server_.setInMemoryClient(RRClass::IN(),
DataSourceClientContainerPtr());
} else {
server_.setInMemoryClient(clients_.front().first,
clients_.front().second);
}
}
......@@ -314,13 +234,10 @@ private:
*/
AddrListPtr rollbackAddresses_;
};
} // end of unnamed namespace
// This is a generalized version of create function that can create
// an AuthConfigParser object for "internal" use.
AuthConfigParser*
createAuthConfigParser(AuthSrv& server, const std::string& config_id,
bool internal)
{
createAuthConfigParser(AuthSrv& server, const std::string& config_id) {
// For the initial implementation we use a naive if-else blocks for
// simplicity. In future we'll probably generalize it using map-like
// data structure, and may even provide external register interface so
......@@ -329,8 +246,6 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id,
return (new DatasourcesConfig(server));
} else if (config_id == "statistics-interval") {
return (new StatisticsIntervalConfig(server));
} else if (internal && config_id == "datasources/memory") {
return (new MemoryDatasourceConfig(server));
} else if (config_id == "listen_on") {
return (new ListenAddressConfig(server));
} else if (config_id == "_commit_throw") {
......@@ -351,12 +266,6 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id,
config_id);
}
}
} // end of unnamed namespace
AuthConfigParser*