Commit 532ac3d0 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

Merge branch 'master' into trac2266

parents 9a9260c2 e2d1490e
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 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)
485. [bug] jelte
Several bugs have been fixed in bindctl; tab-completion now works
within configuration lists, the problem where sometimes the
......
......@@ -4,7 +4,7 @@
AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20120817, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])dnl be backward compatible
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4macros])
......@@ -132,7 +132,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]),
......@@ -1099,7 +1099,6 @@ AC_CONFIG_FILES([Makefile
src/bin/dbutil/Makefile
src/bin/dbutil/tests/Makefile
src/bin/dbutil/tests/testdata/Makefile
src/bin/host/Makefile
src/bin/loadzone/Makefile
src/bin/loadzone/tests/correct/Makefile
src/bin/loadzone/tests/error/Makefile
......
Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
If using git (not the tarball), build the "configure" file:
autoreconf --install
To then build from source:
./configure
make
You may have to specify the location of BIND 10 header files and
library objects. See configure options by ./configure --help.
SUBDIRS = host
# Make sure macros under m4 will be included
ACLOCAL_AMFLAGS = -I m4
This is the top directory for sample programs that can be developed
using public BIND 10 libraries outside of the BIND 10 project. It's
intended to be built with installed BIND 10 header files and library
objects, so it's not a target of the main build tree, and does not
refer to any other part of the BIND 10 source tree that contains
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 availability and
location of BIND 10 header files and library objects.
You can use the configure.ac and Makefile.am files with macros under
the "m4" subdirectory as a template for your own project. The key is
to call the AX_ISC_BIND10 function (as the sample configure.ac does)
from your configure.ac. Then it will check the availability of
necessary stuff and set some corresponding AC variables. You can then
use the resulting variables in your Makefile.in or Makefile.ac.
If you use automake, don't forget adding the following line to the top
level Makefile.am:
ACLOCAL_AMFLAGS = -I m4
This is necessary to incorporate the helper macro definitions.
If you don't use automake but autoconf, make sure to add the following
to the configure.ac file:
sinclude(m4/ax_boost_include.m4)
sinclude(m4/ax_isc_bind10.m4)
(and same for other m4 files as they are added under m4/)
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind10-examples, 20120817, bind10-dev@isc.org)
AC_CONFIG_SRCDIR([README])
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_LANG([C++])
# Checks for BIND 10 headers and libraries
AX_ISC_BIND10
# For the example host program, we require the BIND 10 DNS library
if test "x$BIND10_DNS_LIB" = "x"; then
AC_MSG_ERROR([unable to find BIND 10 DNS library needed to build 'host'])
fi
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_CONFIG_FILES([Makefile
host/Makefile])
AC_OUTPUT
AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(BIND10_CPPFLAGS)
bin_PROGRAMS = b10-host
b10_host_SOURCES = host.cc
b10_host_LDFLAGS = ${BIND10_LDFLAGS}
b10_host_LDADD = ${BIND10_DNS_LIB}
dnl @synopsis AX_BOOST_INCLUDE
dnl
dnl Test for the Boost C++ header files
dnl
dnl If no path to the installed boost header files is given via the
dnl --with-boost-include option, the macro searchs under
dnl /usr/local /usr/pkg /opt /opt/local directories.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BOOST_CPPFLAGS)
dnl
AC_DEFUN([AX_BOOST_INCLUDE], [
AC_LANG_SAVE
AC_LANG([C++])
#
# Configure Boost header path
#
# If explicitly specified, use it.
AC_ARG_WITH([boost-include],
AS_HELP_STRING([--with-boost-include=PATH],
[specify exact directory for Boost headers]),
[boost_include_path="$withval"])
# If not specified, try some common paths.
if test -z "$with_boost_include"; then
boostdirs="/usr/local /usr/pkg /opt /opt/local"
for d in $boostdirs
do
if test -f $d/include/boost/shared_ptr.hpp; then
boost_include_path=$d/include
break
fi
done
fi
CPPFLAGS_SAVES="$CPPFLAGS"
if test "${boost_include_path}" ; then
BOOST_CPPFLAGS="-I${boost_include_path}"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
fi
# Make sure some commonly used headers are available
AC_CHECK_HEADERS([boost/shared_ptr.hpp boost/bind.hpp boost/function.hpp],,
AC_MSG_ERROR([Missing required Boost header files.]))
# Detect whether Boost tries to use threads by default, and, if not,
# make it sure explicitly. In some systems the automatic detection
# may depend on preceding header files, and if inconsistency happens
# it could lead to a critical disruption.
AC_MSG_CHECKING([whether Boost tries to use threads])
AC_TRY_COMPILE([
#include <boost/config.hpp>
#ifdef BOOST_HAS_THREADS
#error "boost will use threads"
#endif],,
[AC_MSG_RESULT(no)
CPPFLAGS_BOOST_THREADCONF="-DBOOST_DISABLE_THREADS=1"],
[AC_MSG_RESULT(yes)])
CPPFLAGS="$CPPFLAGS_SAVES $CPPFLAGS_BOOST_THREADCONF"
AC_SUBST(BOOST_CPPFLAGS)
AC_LANG_RESTORE
])dnl AX_BOOST_INCLUDE
dnl @synopsis AX_BIND10
dnl
dnl @summary figure out how to build C++ programs using ISC BIND 10 libraries
dnl
dnl If no path to the installed BIND 10 header files or libraries is given
dnl via the --with-bind10-include or --with-bind10-lib option, the macro
dnl searchs under /usr/local/{include, lib}, /usr/pkg/{include, lib},
dnl /opt/{include, lib}, /opt/local/{include, lib} directories, respectively.
dnl
dnl This macro calls:
dnl
dnl AC_SUBST(BIND10_CPPFLAGS)
dnl AC_SUBST(BIND10_LDFLAGS)
dnl AC_SUBST(BIND10_COMMON_LIB)
dnl AC_SUBST(BIND10_DNS_LIB)
dnl
dnl If this macro finds CPPFLAGS, LDFLAGS or COMMON_LIB unavailable, it treats
dnl that as a fatal error.
dnl Checks for other BIND 10 module libraries are option, as not all
dnl applications need all libraries. The main configure.ac can handle any
dnl missing library as fatal by checking whether the corresponding
dnl BIND10_xxx_LIB is defined.
AC_DEFUN([AX_ISC_BIND10], [
AC_REQUIRE([AX_BOOST_INCLUDE])
AC_LANG_SAVE
AC_LANG([C++])
# Check for BIND10 common headers
AC_ARG_WITH(bind10-include,
AS_HELP_STRING([--with-bind10-include=PATH],
[specify a path to BIND 10 header files]),
bind10_inc_path="$withval", bind10_inc_path="no")
# If not specified, try some common paths.
if test "$bind10_inc_path" = "no"; then
for d in /usr/local /usr/pkg /opt /opt/local
do
if test -f $d/include/util/buffer.h; then
bind10_inc_path=$d
break
fi
done
fi
CPPFLAGS_SAVES="$CPPFLAGS"
if test "${bind10_inc_path}" != "no"; then
BIND10_CPPFLAGS="-I${bind10_inc_path}"
CPPFLAGS="$CPPFLAGS $BIND10_CPPFLAGS"
fi
AC_CHECK_HEADERS([util/buffer.h],,
AC_MSG_ERROR([Missing a commonly used BIND 10 header files]))
CPPFLAGS="$CPPFLAGS_SAVES"
AC_SUBST(BIND10_CPPFLAGS)
# Check for BIND10 libraries
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BIND10_CPPFLAGS"
AC_ARG_WITH(bind10-lib,
AS_HELP_STRING([--with-bind10-lib=PATH],
[specify a path to BIND 10 library files]),
bind10_lib_path="$withval", bind10_lib_path="no")
if test $bind10_lib_path != "no"; then
bind10_lib_dirs=$bind10_lib_path
else
# If not specified, try some common paths.
bind10_lib_dirs="/usr/local/lib /usr/pkg/lib /opt/lib /opt/local/lib"
fi
# make sure we have buildable libraries
AC_MSG_CHECKING([for BIND 10 common library])
BIND10_COMMON_LIB="-lb10-util -lb10-exceptions"
LDFLAGS="$LDFLAGS $BIND10_LDFLAGS"
LIBS="$LIBS $BIND10_COMMON_LIB"
for d in $bind10_lib_dirs
do
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$d"
AC_TRY_LINK([
#include <util/buffer.h>
],[
isc::util::OutputBuffer buffer(0);
], [BIND10_LDFLAGS="-L${d}"])
if test "x$BIND10_LDFLAGS" != "x"; then
break
fi
LDFLAGS="$LDFLAGS_SAVED"
done
if test "x$BIND10_LDFLAGS" != "x"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([unable to find required BIND 10 libraries])
fi
# restore LIBS once at this point
LIBS="$LIBS_SAVES"
AC_SUBST(BIND10_LDFLAGS)
AC_SUBST(BIND10_COMMON_LIB)
# Check per-module BIND 10 libraries
# DNS library
AC_MSG_CHECKING([for BIND 10 DNS library])
LIBS="$LIBS $BIND10_COMMON_LIB -lb10-dns++"
AC_TRY_LINK([
#include <dns/rrtype.h>
],[
isc::dns::RRType rrtype(1);
], [BIND10_DNS_LIB="-lb10-dns++"
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
LIBS="$LIBS_SAVES"
AC_SUBST(BIND10_DNS_LIB)
# Restore other flags
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVES"
AC_LANG_RESTORE
])dnl AX_ISC_BIND10
SUBDIRS = bind10 bindctl cfgmgr ddns loadzone msgq host cmdctl auth xfrin \
SUBDIRS = bind10 bindctl cfgmgr ddns loadzone msgq cmdctl auth xfrin \
xfrout usermgr zonemgr stats tests resolver sockcreator dhcp4 dhcp6 \
dbutil sysinfo
......
......@@ -55,7 +55,7 @@ b10_auth_SOURCES += auth_config.cc auth_config.h
b10_auth_SOURCES += command.cc command.h
b10_auth_SOURCES += common.h common.cc
b10_auth_SOURCES += statistics.cc statistics.h
b10_auth_SOURCES += datasrc_configurator.h
b10_auth_SOURCES += datasrc_config.h datasrc_config.cc
b10_auth_SOURCES += main.cc
nodist_b10_auth_SOURCES = auth_messages.h auth_messages.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<TSIGKeyRing>* keyring_;
const shared_ptr<TSIGKeyRing>* keyring_;
/// The client list
std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >
client_lists_;
/// The data source client list
AuthSrv::DataSrcClientListsPtr datasrc_client_lists_;
boost::shared_ptr<ConfigurableClientList> getClientList(const RRClass&
rrclass)
shared_ptr<ConfigurableClientList> getDataSrcClientList(
const RRClass& rrclass)
{
// TODO: Debug-build only check
if (!mutex_.locked()) {
isc_throw(isc::Unexpected, "Not locked!");
}
const std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >::
const_iterator it(client_lists_.find(rrclass));
if (it == client_lists_.end()) {
return (boost::shared_ptr<ConfigurableClientList>());
const std::map<RRClass, shared_ptr<ConfigurableClientList> >::
const_iterator it(datasrc_client_lists_->find(rrclass));
if (it == datasrc_client_lists_->end()) {
return (shared_ptr<ConfigurableClientList>());
} 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<RRClass,
shared_ptr<ConfigurableClientList> >()),
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<datasrc::ClientList>
list(getClientList(question->getClass()));
const shared_ptr<datasrc::ClientList>
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<TSIGKeyRing>* keyring) {
AuthSrv::setTSIGKeyRing(const shared_ptr<TSIGKeyRing>* keyring) {
impl_->keyring_ = keyring;
}
......@@ -930,43 +933,23 @@ AuthSrv::destroyDDNSForwarder() {
}
}
void
AuthSrv::setClientList(const RRClass& rrclass,
const boost::shared_ptr<ConfigurableClientList>& list) {
AuthSrv::DataSrcClientListsPtr
AuthSrv::swapDataSrcClientLists(DataSrcClientListsPtr new_lists) {
// TODO: Debug-build only check
if (!impl_->mutex_.locked()) {
isc_throw(isc::Unexpected, "Not locked");
}
if (list) {
impl_->client_lists_[rrclass] = list;
} else {
impl_->client_lists_.erase(rrclass);
isc_throw(isc::Unexpected, "Not locked!");
}
}
boost::shared_ptr<ConfigurableClientList>
AuthSrv::getClientList(const RRClass& rrclass) {
return (impl_->getClientList(rrclass));
std::swap(new_lists, impl_->datasrc_client_lists_);
return (new_lists);
}
vector<RRClass>
AuthSrv::getClientListClasses() const {
// TODO: Debug-build only check
if (!impl_->mutex_.locked()) {
isc_throw(isc::Unexpected, "Not locked");
}
vector<RRClass> result;
for (std::map<RRClass, boost::shared_ptr<ConfigurableClientList> >::
const_iterator it(impl_->client_lists_.begin());
it != impl_->client_lists_.end(); ++it) {
result.push_back(it->first);
}
return (result);
shared_ptr<ConfigurableClientList>
AuthSrv::getDataSrcClientList(const RRClass& rrclass) {
return (impl_->getDataSrcClientList(rrclass));
}
util::thread::Mutex&
AuthSrv::getClientListMutex() const {
AuthSrv::getDataSrcClientListMutex() const {
return (impl_->mutex_);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment