Commit 2cc500af authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

Merge branch 'master' into trac1011

parents c46b0bc2 779e145d
277. [func] jerry
Implement the SRV rrtype according to RFC2782.
(Trac #1128, git 5fd94aa027828c50e63ae1073d9d6708e0a9c223)
276. [func] stephen
Although the top-level loggers are named after the program (e.g.
b10-auth, b10-resolver), allow the logger configuration to omit the
"b10-" prefix and use just the module name.
(Trac #1003, git a01cd4ac5a68a1749593600c0f338620511cae2d)
275. [func] jinmei 275. [func] jinmei
Added support for TSIG key matching in ACLs. The xfrout ACL can Added support for TSIG key matching in ACLs. The xfrout ACL can
now refer to TSIG key names using the "key" attribute. For now refer to TSIG key names using the "key" attribute. For
......
...@@ -8,10 +8,10 @@ for serving, maintaining, and developing DNS. ...@@ -8,10 +8,10 @@ for serving, maintaining, and developing DNS.
BIND10-devel is new development leading up to the production BIND10-devel is new development leading up to the production
BIND 10 release. It contains prototype code and experimental BIND 10 release. It contains prototype code and experimental
interfaces. Nevertheless it is ready to use now for testing the interfaces. Nevertheless it is ready to use now for testing the
new BIND 10 infrastructure ideas. The Year 2 milestones of the new BIND 10 infrastructure ideas. The Year 3 goals of the five
five year plan are described here: year plan are described here:
https://bind10.isc.org/wiki/Year2Milestones http://bind10.isc.org/wiki/Year3Goals
This release includes the bind10 master process, b10-msgq message This release includes the bind10 master process, b10-msgq message
bus, b10-auth authoritative DNS server (with SQLite3 and in-memory bus, b10-auth authoritative DNS server (with SQLite3 and in-memory
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59]) AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20110519, bind10-dev@isc.org) AC_INIT(bind10-devel, 20110809, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README) AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
...@@ -839,6 +839,8 @@ AC_CONFIG_FILES([Makefile ...@@ -839,6 +839,8 @@ AC_CONFIG_FILES([Makefile
src/lib/python/isc/notify/Makefile src/lib/python/isc/notify/Makefile
src/lib/python/isc/notify/tests/Makefile src/lib/python/isc/notify/tests/Makefile
src/lib/python/isc/testutils/Makefile src/lib/python/isc/testutils/Makefile
src/lib/python/isc/bind10/Makefile
src/lib/python/isc/bind10/tests/Makefile
src/lib/config/Makefile src/lib/config/Makefile
src/lib/config/tests/Makefile src/lib/config/tests/Makefile
src/lib/config/tests/testdata/Makefile src/lib/config/tests/testdata/Makefile
...@@ -871,6 +873,7 @@ AC_CONFIG_FILES([Makefile ...@@ -871,6 +873,7 @@ AC_CONFIG_FILES([Makefile
src/lib/util/Makefile src/lib/util/Makefile
src/lib/util/io/Makefile src/lib/util/io/Makefile
src/lib/util/unittests/Makefile src/lib/util/unittests/Makefile
src/lib/util/python/Makefile
src/lib/util/pyunittests/Makefile src/lib/util/pyunittests/Makefile
src/lib/util/tests/Makefile src/lib/util/tests/Makefile
src/lib/acl/Makefile src/lib/acl/Makefile
...@@ -907,7 +910,6 @@ AC_OUTPUT([doc/version.ent ...@@ -907,7 +910,6 @@ AC_OUTPUT([doc/version.ent
src/bin/bind10/bind10_src.py src/bin/bind10/bind10_src.py
src/bin/bind10/run_bind10.sh src/bin/bind10/run_bind10.sh
src/bin/bind10/tests/bind10_test.py src/bin/bind10/tests/bind10_test.py
src/bin/bind10/tests/sockcreator_test.py
src/bin/bindctl/run_bindctl.sh src/bin/bindctl/run_bindctl.sh
src/bin/bindctl/bindctl_main.py src/bin/bindctl/bindctl_main.py
src/bin/bindctl/tests/bindctl_test src/bin/bindctl/tests/bindctl_test
...@@ -931,7 +933,6 @@ AC_OUTPUT([doc/version.ent ...@@ -931,7 +933,6 @@ AC_OUTPUT([doc/version.ent
src/lib/python/isc/log/tests/log_console.py src/lib/python/isc/log/tests/log_console.py
src/lib/dns/gen-rdatacode.py src/lib/dns/gen-rdatacode.py
src/lib/python/bind10_config.py src/lib/python/bind10_config.py
src/lib/dns/tests/testdata/gen-wiredata.py
src/lib/cc/session_config.h.pre src/lib/cc/session_config.h.pre
src/lib/cc/tests/session_unittests_config.h src/lib/cc/tests/session_unittests_config.h
src/lib/log/tests/console_test.sh src/lib/log/tests/console_test.sh
...@@ -941,6 +942,7 @@ AC_OUTPUT([doc/version.ent ...@@ -941,6 +942,7 @@ AC_OUTPUT([doc/version.ent
src/lib/log/tests/severity_test.sh src/lib/log/tests/severity_test.sh
src/lib/log/tests/tempdir.h src/lib/log/tests/tempdir.h
src/lib/util/python/mkpywrapper.py src/lib/util/python/mkpywrapper.py
src/lib/util/python/gen_wiredata.py
src/lib/server_common/tests/data_path.h src/lib/server_common/tests/data_path.h
tests/system/conf.sh tests/system/conf.sh
tests/system/glue/setup.sh tests/system/glue/setup.sh
...@@ -965,13 +967,13 @@ AC_OUTPUT([doc/version.ent ...@@ -965,13 +967,13 @@ AC_OUTPUT([doc/version.ent
chmod +x src/bin/msgq/run_msgq.sh chmod +x src/bin/msgq/run_msgq.sh
chmod +x src/bin/msgq/tests/msgq_test chmod +x src/bin/msgq/tests/msgq_test
chmod +x src/lib/dns/gen-rdatacode.py chmod +x src/lib/dns/gen-rdatacode.py
chmod +x src/lib/dns/tests/testdata/gen-wiredata.py
chmod +x src/lib/log/tests/console_test.sh chmod +x src/lib/log/tests/console_test.sh
chmod +x src/lib/log/tests/destination_test.sh 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/init_logger_test.sh
chmod +x src/lib/log/tests/local_file_test.sh chmod +x src/lib/log/tests/local_file_test.sh
chmod +x src/lib/log/tests/severity_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/mkpywrapper.py
chmod +x src/lib/util/python/gen_wiredata.py
chmod +x src/lib/python/isc/log/tests/log_console.py chmod +x src/lib/python/isc/log/tests/log_console.py
chmod +x tests/system/conf.sh chmod +x tests/system/conf.sh
]) ])
......
...@@ -742,6 +742,16 @@ Debian and Ubuntu: ...@@ -742,6 +742,16 @@ Debian and Ubuntu:
get additional debugging or diagnostic output. get additional debugging or diagnostic output.
</para> </para>
<!-- TODO: note it doesn't go into background --> <!-- TODO: note it doesn't go into background -->
<note>
<para>
If the setproctitle Python module is detected at start up,
the process names for the Python-based daemons will be renamed
to better identify them instead of just <quote>python</quote>.
This is not needed on some operating systems.
</para>
</note>
</section> </section>
</chapter> </chapter>
......
...@@ -56,6 +56,7 @@ EXTRA_DIST += auth_messages.mes ...@@ -56,6 +56,7 @@ EXTRA_DIST += auth_messages.mes
b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/libdatasrc.la 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/dns/libdns++.la
b10_auth_LDADD += $(top_builddir)/src/lib/util/libutil.la
b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.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/cc/libcc.la
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
......
...@@ -107,7 +107,7 @@ DatasourcesConfig::commit() { ...@@ -107,7 +107,7 @@ DatasourcesConfig::commit() {
// server implementation details, and isn't scalable wrt the number of // server implementation details, and isn't scalable wrt the number of
// data source types, and should eventually be improved. // data source types, and should eventually be improved.
// Currently memory data source for class IN is the only possibility. // Currently memory data source for class IN is the only possibility.
server_.setMemoryDataSrc(RRClass::IN(), AuthSrv::MemoryDataSrcPtr()); server_.setInMemoryClient(RRClass::IN(), AuthSrv::InMemoryClientPtr());
BOOST_FOREACH(shared_ptr<AuthConfigParser> datasrc_config, datasources_) { BOOST_FOREACH(shared_ptr<AuthConfigParser> datasrc_config, datasources_) {
datasrc_config->commit(); datasrc_config->commit();
...@@ -125,12 +125,12 @@ public: ...@@ -125,12 +125,12 @@ public:
{} {}
virtual void build(ConstElementPtr config_value); virtual void build(ConstElementPtr config_value);
virtual void commit() { virtual void commit() {
server_.setMemoryDataSrc(rrclass_, memory_datasrc_); server_.setInMemoryClient(rrclass_, memory_client_);
} }
private: private:
AuthSrv& server_; AuthSrv& server_;
RRClass rrclass_; RRClass rrclass_;
AuthSrv::MemoryDataSrcPtr memory_datasrc_; AuthSrv::InMemoryClientPtr memory_client_;
}; };
void void
...@@ -143,8 +143,8 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) { ...@@ -143,8 +143,8 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
// We'd eventually optimize building zones (in case of reloading) by // We'd eventually optimize building zones (in case of reloading) by
// selectively loading fresh zones. Right now we simply check the // selectively loading fresh zones. Right now we simply check the
// RR class is supported by the server implementation. // RR class is supported by the server implementation.
server_.getMemoryDataSrc(rrclass_); server_.getInMemoryClient(rrclass_);
memory_datasrc_ = AuthSrv::MemoryDataSrcPtr(new MemoryDataSrc()); memory_client_ = AuthSrv::InMemoryClientPtr(new InMemoryClient());
ConstElementPtr zones_config = config_value->get("zones"); ConstElementPtr zones_config = config_value->get("zones");
if (!zones_config) { if (!zones_config) {
...@@ -163,9 +163,10 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) { ...@@ -163,9 +163,10 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
isc_throw(AuthConfigError, "Missing zone file for zone: " isc_throw(AuthConfigError, "Missing zone file for zone: "
<< origin->str()); << origin->str());
} }
shared_ptr<MemoryZone> new_zone(new MemoryZone(rrclass_, shared_ptr<InMemoryZoneFinder> zone_finder(new
InMemoryZoneFinder(rrclass_,
Name(origin->stringValue()))); Name(origin->stringValue())));
const result::Result result = memory_datasrc_->addZone(new_zone); const result::Result result = memory_client_->addZone(zone_finder);
if (result == result::EXIST) { if (result == result::EXIST) {
isc_throw(AuthConfigError, "zone "<< origin->str() isc_throw(AuthConfigError, "zone "<< origin->str()
<< " already exists"); << " already exists");
...@@ -177,7 +178,7 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) { ...@@ -177,7 +178,7 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
* need the load method to be split into some kind of build and * need the load method to be split into some kind of build and
* commit/abort parts. * commit/abort parts.
*/ */
new_zone->load(file->stringValue()); zone_finder->load(file->stringValue());
} }
} }
......
...@@ -63,7 +63,7 @@ datebase data source, listing the file that is being accessed. ...@@ -63,7 +63,7 @@ datebase data source, listing the file that is being accessed.
% AUTH_DNS_SERVICES_CREATED DNS services created % AUTH_DNS_SERVICES_CREATED DNS services created
This is a debug message indicating that the component that will handling This is a debug message indicating that the component that will handling
incoming queries for the authoritiative server (DNSServices) has been incoming queries for the authoritative server (DNSServices) has been
successfully created. It is issued during server startup is an indication successfully created. It is issued during server startup is an indication
that the initialization is proceeding normally. that the initialization is proceeding normally.
...@@ -74,7 +74,7 @@ reason for the failure is given in the message.) The server will drop the ...@@ -74,7 +74,7 @@ reason for the failure is given in the message.) The server will drop the
packet. packet.
% AUTH_LOAD_TSIG loading TSIG keys % AUTH_LOAD_TSIG loading TSIG keys
This is a debug message indicating that the authoritiative server This is a debug message indicating that the authoritative server
has requested the keyring holding TSIG keys from the configuration has requested the keyring holding TSIG keys from the configuration
database. It is issued during server startup is an indication that the database. It is issued during server startup is an indication that the
initialization is proceeding normally. initialization is proceeding normally.
...@@ -141,8 +141,8 @@ encountered an internal error whilst processing a received packet: ...@@ -141,8 +141,8 @@ encountered an internal error whilst processing a received packet:
the cause of the error is included in the message. the cause of the error is included in the message.
The server will return a SERVFAIL error code to the sender of the packet. The server will return a SERVFAIL error code to the sender of the packet.
However, this message indicates a potential error in the server. This message indicates a potential error in the server. Please open a
Please open a bug ticket for this issue. bug ticket for this issue.
% AUTH_RECEIVED_COMMAND command '%1' received % AUTH_RECEIVED_COMMAND command '%1' received
This is a debug message issued when the authoritative server has received This is a debug message issued when the authoritative server has received
...@@ -209,7 +209,7 @@ channel. It is issued during server startup is an indication that the ...@@ -209,7 +209,7 @@ channel. It is issued during server startup is an indication that the
initialization is proceeding normally. initialization is proceeding normally.
% AUTH_STATS_COMMS communication error in sending statistics data: %1 % AUTH_STATS_COMMS communication error in sending statistics data: %1
An error was encountered when the authoritiative server tried to send data An error was encountered when the authoritative server tried to send data
to the statistics daemon. The message includes additional information to the statistics daemon. The message includes additional information
describing the reason for the failure. describing the reason for the failure.
......
...@@ -108,8 +108,8 @@ public: ...@@ -108,8 +108,8 @@ public:
AbstractSession* xfrin_session_; AbstractSession* xfrin_session_;
/// In-memory data source. Currently class IN only for simplicity. /// In-memory data source. Currently class IN only for simplicity.
const RRClass memory_datasrc_class_; const RRClass memory_client_class_;
AuthSrv::MemoryDataSrcPtr memory_datasrc_; AuthSrv::InMemoryClientPtr memory_client_;
/// Hot spot cache /// Hot spot cache
isc::datasrc::HotCache cache_; isc::datasrc::HotCache cache_;
...@@ -145,7 +145,7 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache, ...@@ -145,7 +145,7 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache,
AbstractXfroutClient& xfrout_client) : AbstractXfroutClient& xfrout_client) :
config_session_(NULL), config_session_(NULL),
xfrin_session_(NULL), xfrin_session_(NULL),
memory_datasrc_class_(RRClass::IN()), memory_client_class_(RRClass::IN()),
statistics_timer_(io_service_), statistics_timer_(io_service_),
counters_(), counters_(),
keyring_(NULL), keyring_(NULL),
...@@ -329,34 +329,34 @@ AuthSrv::getConfigSession() const { ...@@ -329,34 +329,34 @@ AuthSrv::getConfigSession() const {
return (impl_->config_session_); return (impl_->config_session_);
} }
AuthSrv::MemoryDataSrcPtr AuthSrv::InMemoryClientPtr
AuthSrv::getMemoryDataSrc(const RRClass& rrclass) { AuthSrv::getInMemoryClient(const RRClass& rrclass) {
// XXX: for simplicity, we only support the IN class right now. // XXX: for simplicity, we only support the IN class right now.
if (rrclass != impl_->memory_datasrc_class_) { if (rrclass != impl_->memory_client_class_) {
isc_throw(InvalidParameter, isc_throw(InvalidParameter,
"Memory data source is not supported for RR class " "Memory data source is not supported for RR class "
<< rrclass); << rrclass);
} }
return (impl_->memory_datasrc_); return (impl_->memory_client_);
} }
void void
AuthSrv::setMemoryDataSrc(const isc::dns::RRClass& rrclass, AuthSrv::setInMemoryClient(const isc::dns::RRClass& rrclass,
MemoryDataSrcPtr memory_datasrc) InMemoryClientPtr memory_client)
{ {
// XXX: see above // XXX: see above
if (rrclass != impl_->memory_datasrc_class_) { if (rrclass != impl_->memory_client_class_) {
isc_throw(InvalidParameter, isc_throw(InvalidParameter,
"Memory data source is not supported for RR class " "Memory data source is not supported for RR class "
<< rrclass); << rrclass);
} else if (!impl_->memory_datasrc_ && memory_datasrc) { } else if (!impl_->memory_client_ && memory_client) {
LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_MEM_DATASRC_ENABLED) LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_MEM_DATASRC_ENABLED)
.arg(rrclass); .arg(rrclass);
} else if (impl_->memory_datasrc_ && !memory_datasrc) { } else if (impl_->memory_client_ && !memory_client) {
LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_MEM_DATASRC_DISABLED) LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_MEM_DATASRC_DISABLED)
.arg(rrclass); .arg(rrclass);
} }
impl_->memory_datasrc_ = memory_datasrc; impl_->memory_client_ = memory_client;
} }
uint32_t uint32_t
...@@ -505,10 +505,10 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, MessagePtr message, ...@@ -505,10 +505,10 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, MessagePtr message,
// If a memory data source is configured call the separate // If a memory data source is configured call the separate
// Query::process() // Query::process()
const ConstQuestionPtr question = *message->beginQuestion(); const ConstQuestionPtr question = *message->beginQuestion();
if (memory_datasrc_ && memory_datasrc_class_ == question->getClass()) { if (memory_client_ && memory_client_class_ == question->getClass()) {
const RRType& qtype = question->getType(); const RRType& qtype = question->getType();
const Name& qname = question->getName(); const Name& qname = question->getName();
auth::Query(*memory_datasrc_, qname, qtype, *message).process(); auth::Query(*memory_client_, qname, qtype, *message).process();
} else { } else {
datasrc::Query query(*message, cache_, dnssec_ok); datasrc::Query query(*message, cache_, dnssec_ok);
data_sources_.doQuery(query); data_sources_.doQuery(query);
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <string> #include <string>
// For MemoryDataSrcPtr below. This should be a temporary definition until // For InMemoryClientPtr below. This should be a temporary definition until
// we reorganize the data source framework. // we reorganize the data source framework.
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
namespace isc { namespace isc {
namespace datasrc { namespace datasrc {
class MemoryDataSrc; class InMemoryClient;
} }
namespace xfr { namespace xfr {
class AbstractXfroutClient; class AbstractXfroutClient;
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
/// If there is a data source installed, it will be replaced with the /// If there is a data source installed, it will be replaced with the
/// new one. /// new one.
/// ///
/// In the current implementation, the SQLite data source and MemoryDataSrc /// In the current implementation, the SQLite data source and InMemoryClient
/// are assumed. /// are assumed.
/// We can enable memory data source and get the path of SQLite database by /// We can enable memory data source and get the path of SQLite database by
/// the \c config parameter. If we disabled memory data source, the SQLite /// the \c config parameter. If we disabled memory data source, the SQLite
...@@ -233,16 +233,16 @@ public: ...@@ -233,16 +233,16 @@ public:
/// ///
void setXfrinSession(isc::cc::AbstractSession* xfrin_session); void setXfrinSession(isc::cc::AbstractSession* xfrin_session);
/// A shared pointer type for \c MemoryDataSrc. /// A shared pointer type for \c InMemoryClient.
/// ///
/// This is defined inside the \c AuthSrv class as it's supposed to be /// This is defined inside the \c AuthSrv class as it's supposed to be
/// a short term interface until we integrate the in-memory and other /// a short term interface until we integrate the in-memory and other
/// data source frameworks. /// data source frameworks.
typedef boost::shared_ptr<isc::datasrc::MemoryDataSrc> MemoryDataSrcPtr; typedef boost::shared_ptr<isc::datasrc::InMemoryClient> InMemoryClientPtr;
/// An immutable shared pointer type for \c MemoryDataSrc. /// An immutable shared pointer type for \c InMemoryClient.
typedef boost::shared_ptr<const isc::datasrc::MemoryDataSrc> typedef boost::shared_ptr<const isc::datasrc::InMemoryClient>
ConstMemoryDataSrcPtr; ConstInMemoryClientPtr;
/// Returns the in-memory data source configured for the \c AuthSrv, /// Returns the in-memory data source configured for the \c AuthSrv,
/// if any. /// if any.
...@@ -260,11 +260,11 @@ public: ...@@ -260,11 +260,11 @@ public:
/// \param rrclass The RR class of the requested in-memory data source. /// \param rrclass The RR class of the requested in-memory data source.
/// \return A pointer to the in-memory data source, if configured; /// \return A pointer to the in-memory data source, if configured;
/// otherwise NULL. /// otherwise NULL.
MemoryDataSrcPtr getMemoryDataSrc(const isc::dns::RRClass& rrclass); InMemoryClientPtr getInMemoryClient(const isc::dns::RRClass& rrclass);
/// Sets or replaces the in-memory data source of the specified RR class. /// Sets or replaces the in-memory data source of the specified RR class.
/// ///
/// As noted in \c getMemoryDataSrc(), some RR classes may not be /// As noted in \c getInMemoryClient(), some RR classes may not be
/// supported, in which case an exception of class \c InvalidParameter /// supported, in which case an exception of class \c InvalidParameter
/// will be thrown. /// will be thrown.
/// This method never throws an exception otherwise. /// This method never throws an exception otherwise.
...@@ -275,9 +275,9 @@ public: ...@@ -275,9 +275,9 @@ public:
/// in-memory data source. /// in-memory data source.
/// ///
/// \param rrclass The RR class of the in-memory data source to be set. /// \param rrclass The RR class of the in-memory data source to be set.
/// \param memory_datasrc A (shared) pointer to \c MemoryDataSrc to be set. /// \param memory_datasrc A (shared) pointer to \c InMemoryClient to be set.
void setMemoryDataSrc(const isc::dns::RRClass& rrclass, void setInMemoryClient(const isc::dns::RRClass& rrclass,
MemoryDataSrcPtr memory_datasrc); InMemoryClientPtr memory_client);
/// \brief Set the communication session with Statistics. /// \brief Set the communication session with Statistics.
/// ///
......
...@@ -17,6 +17,7 @@ query_bench_SOURCES += ../auth_log.h ../auth_log.cc ...@@ -17,6 +17,7 @@ query_bench_SOURCES += ../auth_log.h ../auth_log.cc
nodist_query_bench_SOURCES = ../auth_messages.h ../auth_messages.cc nodist_query_bench_SOURCES = ../auth_messages.h ../auth_messages.cc
query_bench_LDADD = $(top_builddir)/src/lib/dns/libdns++.la query_bench_LDADD = $(top_builddir)/src/lib/dns/libdns++.la
query_bench_LDADD += $(top_builddir)/src/lib/util/libutil.la
query_bench_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la query_bench_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
query_bench_LDADD += $(top_builddir)/src/lib/bench/libbench.la query_bench_LDADD += $(top_builddir)/src/lib/bench/libbench.la
query_bench_LDADD += $(top_builddir)/src/lib/datasrc/libdatasrc.la query_bench_LDADD += $(top_builddir)/src/lib/datasrc/libdatasrc.la
......
...@@ -136,19 +136,21 @@ public: ...@@ -136,19 +136,21 @@ public:
// that doesn't block other server operations. // that doesn't block other server operations.
// TODO: we may (should?) want to check the "last load time" and // TODO: we may (should?) want to check the "last load time" and
// the timestamp of the file and skip loading if the file isn't newer. // the timestamp of the file and skip loading if the file isn't newer.
shared_ptr<MemoryZone> newzone(new MemoryZone(oldzone->getClass(), shared_ptr<InMemoryZoneFinder> zone_finder(
oldzone->getOrigin())); new InMemoryZoneFinder(old_zone_finder->getClass(),
newzone->load(oldzone->getFileName()); old_zone_finder->getOrigin()));
oldzone->swap(*newzone); zone_finder->load(old_zone_finder->getFileName());
old_zone_finder->swap(*zone_finder);
LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_LOAD_ZONE) LOG_DEBUG(auth_logger, DBG_AUTH_OPS, AUTH_LOAD_ZONE)
.arg(newzone->getOrigin()).arg(newzone->getClass()); .arg(zone_finder->getOrigin()).arg(zone_finder->getClass());
} }
private: private:
shared_ptr<MemoryZone> oldzone; // zone to be updated with the new file. // zone finder to be updated with the new file.
shared_ptr<InMemoryZoneFinder> old_zone_finder;
// A helper private method to parse and validate command parameters. // A helper private method to parse and validate command parameters.
// On success, it sets 'oldzone' to the zone to be updated. // On success, it sets 'old_zone_finder' to the zone to be updated.
// It returns true if everything is okay; and false if the command is // It returns true if everything is okay; and false if the command is
// valid but there's no need for further process. // valid but there's no need for further process.
bool validate(AuthSrv& server, isc::data::ConstElementPtr args) { bool validate(AuthSrv& server, isc::data::ConstElementPtr args) {
...@@ -176,7 +178,7 @@ private: ...@@ -176,7 +178,7 @@ private:
const RRClass zone_class = class_elem ? const RRClass zone_class = class_elem ?
RRClass(class_elem->stringValue()) : RRClass::IN(); RRClass(class_elem->stringValue()) : RRClass::IN();
AuthSrv::MemoryDataSrcPtr datasrc(server.getMemoryDataSrc(zone_class)); AuthSrv::InMemoryClientPtr datasrc(server.getInMemoryClient(zone_class));
if (datasrc == NULL) { if (datasrc == NULL) {
isc_throw(AuthCommandError, "Memory data source is disabled"); isc_throw(AuthCommandError, "Memory data source is disabled");
} }
...@@ -188,13 +190,14 @@ private: ...@@ -188,13 +190,14 @@ private:
const Name origin(origin_elem->stringValue()); const Name origin(origin_elem->stringValue());
// Get the current zone // Get the current zone
const MemoryDataSrc::FindResult result = datasrc->findZone(origin); const InMemoryClient::FindResult result = datasrc->findZone(origin);
if (result.code != result::SUCCESS) { if (result.code != result::SUCCESS) {
isc_throw(AuthCommandError, "Zone " << origin << isc_throw(AuthCommandError, "Zone " << origin <<
" is not found in data source"); " is not found in data source");
} }
oldzone = boost::dynamic_pointer_cast<MemoryZone>(result.zone); old_zone_finder = boost::dynamic_pointer_cast<InMemoryZoneFinder>(
result.zone_finder);
return (true); return (true);
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <dns/rcode.h> #include <dns/rcode.h>
#include <dns/rdataclass.h> #include <dns/rdataclass.h><