diff --git a/ChangeLog b/ChangeLog
index b5c2cf4cbb..9e76a18744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,80 @@
+494. [bug] jinmei
+ Fixed a problem that shutting down BIND 10 kept some of the
+ processes alive. It was two-fold: when the main bind10 process
+ started as a root, started b10-sockcreator with the privilege, and
+ then dropped the privilege, the bind10 process cannot kill the
+ sockcreator via signal any more (when it has to), but it kept
+ sending the signal and didn't stop. Also, when running on Python
+ 3.1 (or older), the sockcreator had some additional file
+ descriptor open, which prevented it from exiting even after the
+ bind10 process terminated. Now the bind10 process simply gives up
+ killing a subprocess if it fails due to lack of permission, and it
+ makes sure the socket creator is spawned without any unnecessary
+ FDs open.
+ (Trac #1858, git 405d85c8a0042ba807a3a123611ff383c4081ee1)
+
+493. [build] jinmei
+ Fixed build failure with newer versions of clang++. These
+ versions are stricter regarding "unused variable" and "unused
+ (driver) arguments" warnings, and cause fatal build error
+ with -Werror. The affected versions of clang++ include Apple's
+ customized version 4.1 included in Xcode 4.5.1. So this fix
+ will solve build errors for Mac OS X that uses newer versions of
+ Xcode.
+ (Trac #2340, git 55be177fc4f7537143ab6ef5a728bd44bdf9d783,
+ 3e2a372012e633d017a97029d13894e743199741 and commits before it
+ with [2340] in the commit log)
+
+492. [func] tomek
+ libdhcpsrv: The DHCP Configuration Manager is now able to store
+ information about IPv4 subnets and pools. It is still not possible
+ to configure that information. Such capability will be implemented
+ in a near future.
+ (Trac #2237, git a78e560343b41f0f692c7903c938b2b2b24bf56b)
+
+491. [func] tomek
+ b10-dhcp6: Configuration for DHCPv6 has been implemented.
+ Currently it is possible to configure IPv6 subnets and pools
+ within those subnets, global and per subnet values of renew,
+ rebind, preferred and valid lifetimes. Configured parameters
+ are accepted, but are not used yet by the allocation engine yet.
+ (Trac #2269, git 028bed9014b15facf1a29d3d4a822c9d14fc6411)
+
+490. [func] tomek
+ libdhcpsrv: An abstract API for lease database has been
+ implemented. It offers a common interface to all concrete
+ database backends.
+ (Trac #2140, git df196f7609757253c4f2f918cd91012bb3af1163)
+
+489. [func] muks
+ The isc::dns::RRsetList class has been removed. It was now unused
+ inside the BIND 10 codebase, and the interface was considered
+ prone to misuse.
+ (Trac #2266, git 532ac3d0054f6a11b91ee369964f3a84dabc6040)
+
+488. [build] jinmei
+ On configure, changed the search order for Python executable.
+ It first ties more specific file names such as "python3.2" before
+ more generic "python3". This will prevent configure failure on
+ Mac OS X that installs Python3 via recent versions of Homebrew.
+ (Trac #2339, git 88db890d8d1c64de49be87f03c24a2021bcf63da)
+
+487. [bug] jinmei
+ The bind10 process now terminates a component (subprocess) by the
+ "config remove Boss/components" bindctl command even if the
+ process crashes immediately before the command is sent to bind10.
+ Previously this led to an inconsistent state between the
+ configuration and an internal component list of bind10, and bind10
+ kept trying to restart the component. A known specific case of
+ this problem is that b10-ddns could keep failing (due to lack of
+ dependency modules) and the administrator couldn't stop the
+ restart via bindctl.
+ (Trac #2244, git 7565788d06f216ab254008ffdfae16678bcd00e5)
+
486. [bug]* jinmei
All public header files for libb10-dns++ are now installed.
Template configure.ac and utility AC macros for external projects
- using the library is provided under the "examples" directory.
+ using the library are provided under the "examples" directory.
The src/bin/host was moved as part of the examples (and not
installed with other BIND 10 programs any more).
(Trac #1870, git 4973e638d354d8b56dcadf71123ef23c15662021)
diff --git a/configure.ac b/configure.ac
index 9177d21660..72c7be2619 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,106 @@ AC_TRY_LINK([],[],
])
LDFLAGS=$LDFLAGS_SAVED
+# Compiler dependent settings: define some mandatory CXXFLAGS here.
+# We also use a separate variable B10_CXXFLAGS. This will (and should) be
+# used as the default value for each specific AM_CXXFLAGS:
+# AM_CXXFLAGS = $(B10_CXXFLAGS)
+# AM_CXXFLAGS += ... # add module specific flags
+# We need this so that we can disable some specific compiler warnings per
+# module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
+# gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
+# specify the default warning flags in CXXFLAGS and let specific modules
+# "override" the default.
+
+# This may be used to try linker flags.
+AC_DEFUN([BIND10_CXX_TRY_FLAG], [
+ AC_MSG_CHECKING([whether $CXX supports $1])
+
+ bind10_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $1"
+
+ AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;}])],
+ [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
+ CXXFLAGS="$bind10_save_CXXFLAGS"
+
+ if test "x$bind10_cxx_flag" = "xyes"; then
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , :, [$3])
+ fi
+
+ AC_MSG_RESULT([$bind10_cxx_flag])
+])
+
+# SunStudio compiler requires special compiler options for boost
+# (http://blogs.sun.com/sga/entry/boost_mini_howto)
+if test "$SUNCXX" = "yes"; then
+CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
+MULTITHREADING_FLAG="-mt"
+fi
+
+# Newer versions of clang++ promotes "unused driver arguments" warnings to
+# a fatal error with -Werror, causing build failure. Since we use multiple
+# compilers on multiple systems, this can easily happen due to settings for
+# non clang++ environments that could be just ignored otherwise. It can also
+# happen if clang++ is used via ccache. So, although probably suboptimal,
+# we suppress this particular warning. Note that it doesn't weaken checks
+# on the source code.
+if test "$CLANGPP" = "yes"; then
+ B10_CXXFLAGS="$B10_CXXFLAGS -Qunused-arguments"
+fi
+
+BIND10_CXX_TRY_FLAG([-Wno-missing-field-initializers],
+ [WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
+AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
+
+# gcc specific settings:
+if test "X$GXX" = "Xyes"; then
+B10_CXXFLAGS="$B10_CXXFLAGS -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
+case "$host" in
+*-solaris*)
+ MULTITHREADING_FLAG=-pthreads
+ # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
+ B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
+ ;;
+*)
+ MULTITHREADING_FLAG=-pthread
+ ;;
+esac
+
+# Don't use -Werror if configured not to
+AC_ARG_WITH(werror,
+ AC_HELP_STRING([--with-werror], [Compile using -Werror (default=yes)]),
+ [
+ case "${withval}" in
+ yes) with_werror=1 ;;
+ no) with_werror=0 ;;
+ *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
+ esac],
+ [with_werror=1])
+
+werror_ok=0
+
+# Certain versions of gcc (g++) have a bug that incorrectly warns about
+# the use of anonymous name spaces even if they're closed in a single
+# translation unit. For these versions we have to disable -Werror.
+if test $with_werror = 1; then
+ CXXFLAGS_SAVED="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
+ AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
+ AC_TRY_COMPILE([namespace { class Foo {}; }
+ namespace isc {class Bar {Foo foo_;};} ],,
+ [AC_MSG_RESULT(no)
+ werror_ok=1
+ B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
+ [AC_MSG_RESULT(yes)])
+ CXXFLAGS="$CXXFLAGS_SAVED"
+fi
+
+fi dnl GXX = yes
+
+AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
+
# allow building programs with static link. we need to make it selective
# because loadable modules cannot be statically linked.
AC_ARG_ENABLE([static-link],
@@ -132,7 +232,7 @@ AM_CONDITIONAL(SET_ENV_LIBRARY_PATH, test $SET_ENV_LIBRARY_PATH = yes)
AC_SUBST(SET_ENV_LIBRARY_PATH)
AC_SUBST(ENV_LIBRARY_PATH)
-m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1 python3.2])
+m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3.2 python3.1 python3])
AC_ARG_WITH([pythonpath],
AC_HELP_STRING([--with-pythonpath=PATH],
[specify an absolute path to python executable when automatic version check (incorrectly) fails]),
@@ -256,95 +356,11 @@ fi
# TODO: check for _sqlite3.py module
-# Compiler dependent settings: define some mandatory CXXFLAGS here.
-# We also use a separate variable B10_CXXFLAGS. This will (and should) be
-# used as the default value for each specific AM_CXXFLAGS:
-# AM_CXXFLAGS = $(B10_CXXFLAGS)
-# AM_CXXFLAGS += ... # add module specific flags
-# We need this so that we can disable some specific compiler warnings per
-# module basis; since AM_CXXFLAGS are placed before CXXFLAGS, and since
-# gcc's -Wno-XXX option must be specified after -Wall or -Wextra, we cannot
-# specify the default warning flags in CXXFLAGS and let specific modules
-# "override" the default.
-
-# This may be used to try linker flags.
-AC_DEFUN([BIND10_CXX_TRY_FLAG], [
- AC_MSG_CHECKING([whether $CXX supports $1])
-
- bind10_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $1"
-
- AC_LINK_IFELSE([AC_LANG_SOURCE([int main(void){ return 0;}])],
- [bind10_cxx_flag=yes], [bind10_cxx_flag=no])
- CXXFLAGS="$bind10_save_CXXFLAGS"
-
- if test "x$bind10_cxx_flag" = "xyes"; then
- ifelse([$2], , :, [$2])
- else
- ifelse([$3], , :, [$3])
- fi
-
- AC_MSG_RESULT([$bind10_cxx_flag])
-])
-
-# SunStudio compiler requires special compiler options for boost
-# (http://blogs.sun.com/sga/entry/boost_mini_howto)
-if test "$SUNCXX" = "yes"; then
-CXXFLAGS="$CXXFLAGS -library=stlport4 -features=tmplife -features=tmplrefstatic"
-MULTITHREADING_FLAG="-mt"
-fi
-
-BIND10_CXX_TRY_FLAG([-Wno-missing-field-initializers],
- [WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG="-Wno-missing-field-initializers"])
-AC_SUBST(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
-
-# gcc specific settings:
-if test "X$GXX" = "Xyes"; then
-B10_CXXFLAGS="-Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
-case "$host" in
-*-solaris*)
- MULTITHREADING_FLAG=-pthreads
- # In Solaris, IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT need -Wno-missing-braces
- B10_CXXFLAGS="$B10_CXXFLAGS -Wno-missing-braces"
- ;;
-*)
- MULTITHREADING_FLAG=-pthread
- ;;
-esac
-
-# Don't use -Werror if configured not to
-AC_ARG_WITH(werror,
- AC_HELP_STRING([--with-werror], [Compile using -Werror (default=yes)]),
- [
- case "${withval}" in
- yes) with_werror=1 ;;
- no) with_werror=0 ;;
- *) AC_MSG_ERROR(bad value ${withval} for --with-werror) ;;
- esac],
- [with_werror=1])
-
-werror_ok=0
-
-# Certain versions of gcc (g++) have a bug that incorrectly warns about
-# the use of anonymous name spaces even if they're closed in a single
-# translation unit. For these versions we have to disable -Werror.
-if test $with_werror = 1; then
- CXXFLAGS_SAVED="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $B10_CXXFLAGS -Werror"
- AC_MSG_CHECKING(for in-TU anonymous namespace breakage)
- AC_TRY_COMPILE([namespace { class Foo {}; }
- namespace isc {class Bar {Foo foo_;};} ],,
- [AC_MSG_RESULT(no)
- werror_ok=1
- B10_CXXFLAGS="$B10_CXXFLAGS -Werror"],
- [AC_MSG_RESULT(yes)])
- CXXFLAGS="$CXXFLAGS_SAVED"
-fi
-
+# (g++ only check)
# Python 3.2 has an unused parameter in one of its headers. This
# has been reported, but not fixed as of yet, so we check if we need
# to set -Wno-unused-parameter.
-if test $werror_ok = 1; then
+if test "X$GXX" = "Xyes" -a $werror_ok = 1; then
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS=${PYTHON_INCLUDES}
CXXFLAGS_SAVED="$CXXFLAGS"
@@ -370,10 +386,6 @@ if test $werror_ok = 1; then
CPPFLAGS="$CPPFLAGS_SAVED"
fi
-fi dnl GXX = yes
-
-AM_CONDITIONAL(GCC_WERROR_OK, test $werror_ok = 1)
-
# produce PIC unless we disable shared libraries. need this for python bindings.
if test $enable_shared != "no" -a "X$GXX" = "Xyes"; then
B10_CXXFLAGS="$B10_CXXFLAGS -fPIC"
diff --git a/doc/devel/02-dhcp.dox b/doc/devel/02-dhcp.dox
index 5217f73971..a4bbff9955 100644
--- a/doc/devel/02-dhcp.dox
+++ b/doc/devel/02-dhcp.dox
@@ -57,29 +57,6 @@
* that does not support msgq. That is useful for embedded environments.
* It may also be useful in validation.
*
- * @page dhcpv6 DHCPv6 Server Component
- *
- * BIND10 offers DHCPv6 server implementation. It is implemented as
- * b10-dhcp6 component. Its primary code is located in
- * isc::dhcp::Dhcpv6Srv class. It uses \ref libdhcp extensively,
- * especially lib::dhcp::Pkt6, isc::dhcp::Option and
- * isc::dhcp::IfaceMgr classes. Currently this code offers skeleton
- * functionality, i.e. it is able to receive and process incoming
- * requests and trasmit responses. However, it does not have database
- * management, so it returns only one, hardcoded lease to whoever asks
- * for it.
- *
- * DHCPv6 server component does not support relayed traffic yet, as
- * support for relay decapsulation is not implemented yet.
- *
- * DHCPv6 server component does not use BIND10 logging yet.
- *
- * @section dhcpv6Session BIND10 message queue integration
- *
- * DHCPv4 server component is now integrated with BIND10 message queue.
- * It follows the same principle as DHCPv4. See \ref dhcpv4Session for
- * details.
- *
* @page libdhcp libdhcp++
*
* @section libdhcpIntro Libdhcp++ Library Introduction
diff --git a/doc/devel/mainpage.dox b/doc/devel/mainpage.dox
index ca9d8815fa..0da52875bb 100644
--- a/doc/devel/mainpage.dox
+++ b/doc/devel/mainpage.dox
@@ -15,12 +15,17 @@
* BIND10 webpage (http://bind10.isc.org)
*
* @section DNS
+ * - Authoritative DNS (todo)
+ * - Recursive resolver (todo)
* - @subpage DataScrubbing
*
* @section DHCP
* - @subpage dhcpv4
* - @subpage dhcpv4Session
* - @subpage dhcpv6
+ * - @subpage dhcpv6-session
+ * - @subpage dhcpv6-config-parser
+ * - @subpage dhcpv6-config-inherit
* - @subpage libdhcp
* - @subpage libdhcpIntro
* - @subpage libdhcpIfaceMgr
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index 2e66ad517e..6065616018 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -2751,13 +2751,13 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
DHCPv4 Server Configuration
The DHCPv4 server does not have a lease database implemented yet
- nor any support for configuration, so every time the same set
+ nor any support for configuration, so the same set
of configuration options (including the same fixed address)
will be assigned every time.
At this stage of development, the only way to alter the server
- configuration is to tweak its source code. To do so, please
+ configuration is to modify its source code. To do so, please
edit src/bin/dhcp4/dhcp4_srv.cc file and modify following
parameters and recompile:
@@ -2944,16 +2944,95 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";
DHCPv6 Server Configuration
- The DHCPv6 server does not have lease database implemented yet
- or any support for configuration, so every time the same set
- of configuration options (including the same fixed address)
- will be assigned every time.
+ Once the server is started, it can be configured. To view the
+ current configuration, use the following command in bindctl:
+
+ > config show Dhcp6
+ When starting Dhcp6 daemon for the first time, the default configuration
+ will be available. It will look similar to this:
+
+> config show Dhcp6
+Dhcp6/interface "eth0" string (default)
+Dhcp6/renew-timer 1000 integer (default)
+Dhcp6/rebind-timer 2000 integer (default)
+Dhcp6/preferred-lifetime 3000 integer (default)
+Dhcp6/valid-lifetime 4000 integer (default)
+Dhcp6/subnet6 [] list (default)
+
+
+
+ To change one of the parameters, simply follow
+ the usual bindctl procedure. For example, to make the
+ leases longer, change their valid-lifetime parameter:
+
+> config set Dhcp6/valid-lifetime 7200
+> config commit
+ Please note that most Dhcp6 parameters are of global scope
+ and apply to all defined subnets, unless they are overridden on a
+ per-subnet basis.
+
+
+
+ The essential role of DHCPv6 server is address assignment. The server
+ has to be configured with at least one subnet and one pool of dynamic
+ addresses to be managed. For example, assume that the server
+ is connected to a network segment that uses the 2001:db8:1::/64
+ prefix. The Administrator of that network has decided that addresses from range
+ 2001:db8:1::1 to 2001:db8:1::ffff are going to be managed by the Dhcp6
+ server. Such a configuration can be achieved in the following way:
+
+> config add Dhcp6/subnet6
+> config set Dhcp6/subnet6[0]/subnet "2001:db8:1::/64"
+> config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::0 - 2001:db8:1::ffff" ]
+> config commit
+ Note that subnet is defined as a simple string, but the pool parameter
+ is actually a list of pools: for this reason, the pool definition is
+ enclosed in square brackets, even though only one range of addresses
+ is specified.
+ It is possible to define more than one pool in a
+ subnet: continuing the previous example, further assume that
+ 2001:db8:1:0:5::/80 should be also be managed by the server. It could be written as
+ 2001:db8:1:0:5:: to 2001:db8:1::5:ffff:ffff:ffff, but typing so many 'f's
+ is cumbersome. It can be expressed more simply as 2001:db8:1:0:5::/80. Both
+ formats are supported by Dhcp6 and can be mixed in the pool list.
+ For example, one could define the following pools:
+
+> config set Dhcp6/subnet6[0]/pool [ "2001:db8:1::1 - 2001:db8:1::ffff", "2001:db8:1:0:5::/80" ]
+> config commit
+ The number of pools is not limited, but for performance reasons it is recommended to
+ use as few as possible.
- At this stage of development, the only way to alter server
- configuration is to tweak its source code. To do so, please
- edit src/bin/dhcp6/dhcp6_srv.cc file, modify the following
- parameters and recompile:
+ The server may be configured to serve more than one subnet. To add a second subnet,
+ use a command similar to the following:
+
+> config add Dhcp6/subnet6
+> config set Dhcp6/subnet6[1]/subnet "2001:db8:beef::/48"
+> config set Dhcp6/subnet6[1]/pool [ "2001:db8:beef::/48" ]
+> config commit
+ Arrays are counted from 0. subnet[0] refers to the subnet defined in the
+ previous example. The config add Dhcp6/subnet6 adds
+ another (second) subnet. It can be referred to as
+ Dhcp6/subnet6[1]. In this example, we allow server to
+ dynamically assign all addresses available in the whole subnet. Although
+ very wasteful, it is certainly a valid configuration to dedicate the
+ whole /48 subnet for that purpose.
+
+
+ When configuring a DHCPv6 server using prefix/length notation, please pay
+ attention to the boundary values. When specifying that the server should use
+ a given pool, it will be able to allocate also first (typically network
+ address) address from that pool. For example for pool 2001:db8::/64 the
+ 2001:db8:: address may be assigned as well. If you want to avoid this,
+ please use min-max notation.
+
+
+
+ Note: Although configuration is now accepted, it is not internally used
+ by they server yet. At this stage of development, the only way to alter
+ server configuration is to modify its source code. To do so, please edit
+ src/bin/dhcp6/dhcp6_srv.cc file, modify the following parameters and
+ recompile:
const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
const uint32_t HARDCODED_T1 = 1500; // in seconds
diff --git a/examples/README b/examples/README
index 12dbbbaaff..65f777b693 100644
--- a/examples/README
+++ b/examples/README
@@ -7,7 +7,7 @@ this directory.
On the top (sub) directory (where this README file is stored), we
provide a sample configure.ac and Makefile.am files for GNU automake
-environments with helper autoconf macros to detect the available and
+environments with helper autoconf macros to detect the availability and
location of BIND 10 header files and library objects.
You can use the configure.ac and Makefile.am files with macros under
diff --git a/src/bin/auth/auth_config.h b/src/bin/auth/auth_config.h
index 6f18810f7f..8e816a3fb4 100644
--- a/src/bin/auth/auth_config.h
+++ b/src/bin/auth/auth_config.h
@@ -93,7 +93,7 @@ public:
/// that corresponds to this derived class and prepares a new value to
/// apply to the server.
/// In the above example, the derived class for the identifier "param1"
- /// would be passed an data \c Element storing an integer whose value
+ /// would be passed a data \c Element storing an integer whose value
/// is 10, and would record that value internally;
/// the derived class for the identifier "param2" would be passed a
/// map element and (after parsing) convert it into some internal
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index b870ae2cb9..e73eb528db 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -69,6 +69,8 @@
using namespace std;
+using boost::shared_ptr;
+
using namespace isc;
using namespace isc::cc;
using namespace isc::datasrc;
@@ -264,23 +266,22 @@ public:
AddressList listen_addresses_;
/// The TSIG keyring
- const boost::shared_ptr* keyring_;
+ const shared_ptr* keyring_;
- /// The client list
- std::map >
- client_lists_;
+ /// The data source client list
+ AuthSrv::DataSrcClientListsPtr datasrc_client_lists_;
- boost::shared_ptr getClientList(const RRClass&
- rrclass)
+ shared_ptr getDataSrcClientList(
+ const RRClass& rrclass)
{
// TODO: Debug-build only check
if (!mutex_.locked()) {
isc_throw(isc::Unexpected, "Not locked!");
}
- const std::map >::
- const_iterator it(client_lists_.find(rrclass));
- if (it == client_lists_.end()) {
- return (boost::shared_ptr());
+ const std::map >::
+ const_iterator it(datasrc_client_lists_->find(rrclass));
+ if (it == datasrc_client_lists_->end()) {
+ return (shared_ptr());
} else {
return (it->second);
}
@@ -335,6 +336,8 @@ AuthSrvImpl::AuthSrvImpl(AbstractXfroutClient& xfrout_client,
xfrin_session_(NULL),
counters_(),
keyring_(NULL),
+ datasrc_client_lists_(new std::map >()),
ddns_base_forwarder_(ddns_forwarder),
ddns_forwarder_(NULL),
xfrout_connected_(false),
@@ -645,13 +648,13 @@ AuthSrvImpl::processNormalQuery(const IOMessage& io_message, Message& message,
}
// Lock the client lists and keep them under the lock until the processing
// and rendering is done (this is the same mutex as from
- // AuthSrv::getClientListMutex()).
+ // AuthSrv::getDataSrcClientListMutex()).
isc::util::thread::Mutex::Locker locker(mutex_);
try {
const ConstQuestionPtr question = *message.beginQuestion();
- const boost::shared_ptr
- list(getClientList(question->getClass()));
+ const shared_ptr
+ list(getDataSrcClientList(question->getClass()));
if (list) {
const RRType& qtype = question->getType();
const Name& qname = question->getName();
@@ -911,7 +914,7 @@ AuthSrv::setDNSService(isc::asiodns::DNSServiceBase& dnss) {
}
void
-AuthSrv::setTSIGKeyRing(const boost::shared_ptr* keyring) {
+AuthSrv::setTSIGKeyRing(const shared_ptr* keyring) {
impl_->keyring_ = keyring;
}
@@ -930,43 +933,23 @@ AuthSrv::destroyDDNSForwarder() {
}
}
-void
-AuthSrv::setClientList(const RRClass& rrclass,
- const boost::shared_ptr& list) {
+AuthSrv::DataSrcClientListsPtr
+AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
// TODO: Debug-build only check
if (!impl_->mutex_.locked()) {
- isc_throw(isc::Unexpected, "Not locked");
+ isc_throw(isc::Unexpected, "Not locked!");
}
-
- if (list) {
- impl_->client_lists_[rrclass] = list;
- } else {
- impl_->client_lists_.erase(rrclass);
- }
-}
-boost::shared_ptr
-AuthSrv::getClientList(const RRClass& rrclass) {
- return (impl_->getClientList(rrclass));
+ std::swap(new_lists, impl_->datasrc_client_lists_);
+ return (new_lists);
}
-vector
-AuthSrv::getClientListClasses() const {
- // TODO: Debug-build only check
- if (!impl_->mutex_.locked()) {
- isc_throw(isc::Unexpected, "Not locked");
- }
-
- vector result;
- for (std::map >::
- const_iterator it(impl_->client_lists_.begin());
- it != impl_->client_lists_.end(); ++it) {
- result.push_back(it->first);
- }
- return (result);
+shared_ptr
+AuthSrv::getDataSrcClientList(const RRClass& rrclass) {
+ return (impl_->getDataSrcClientList(rrclass));
}
util::thread::Mutex&
-AuthSrv::getClientListMutex() const {
+AuthSrv::getDataSrcClientListMutex() const {
return (impl_->mutex_);
}
diff --git a/src/bin/auth/auth_srv.h b/src/bin/auth/auth_srv.h
index ee7bd52bb2..0849bdd1d0 100644
--- a/src/bin/auth/auth_srv.h
+++ b/src/bin/auth/auth_srv.h
@@ -15,10 +15,11 @@
#ifndef __AUTH_SRV_H
#define __AUTH_SRV_H 1
-#include
-
#include
+
#include
+#include
+
#include
#include
#include
@@ -35,6 +36,11 @@
#include
#include
+#include
+
+#include