Commit 102df777 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

deleted unnecessary bits of code


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac221@2204 e5f2f494-b856-4b98-b285-d166d9295462
parent b93a8014

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
Copyright (C) 2009 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.
2. [func] jinmei
lib/dns: added a separate signature for Name::split() as a
convenient wrapper for common usage. (Trac #49, svn r1903)
1. [bug] jinmei
lib/dns: parameter validation of Name::split() was not sufficient,
and invalid parameters could cause integer overflow and make the
library crash. (Trac #177, svn r1806)
LEGEND
[bug] general bug fix. This is generally a backward compatible change,
unless it's deemed to be impossible or very hard to keep
compatibility to fix the bug.
[doc] update to documentation. This shouldn't change run time behavior.
[func] new feature. In some cases this may be a backward incompatible
change, which would require a bump of major version.
[security] security hole fix. This is no different than a general bug fix
except that it will be handled as confidential and will cause
security patch releases.
To build "configure" file:
autoreconf
To then build from source:
./configure
make
We recommend using the Boost libraries as it provides a safer TCP
implementation in BIND 10.
SUBDIRS = src
USE_LCOV=@USE_LCOV@
LCOV=@LCOV@
GENHTML=@GENHTML@
DISTCLEANFILES = config.report
# When running distcheck target, do not install the configurations
DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
clean-coverage:
@if [ $(USE_LCOV) = yes ] ; then \
$(LCOV) --directory . --zerocounters; \
rm -rf coverage/; \
else \
echo "Code coverage not enabled at configuration time"; \
exit 1; \
fi
perform-coverage: check
report-coverage:
$(LCOV) --capture --directory . --output-file all.info
$(LCOV) --remove all.info \
c++/4.4\*/\* \
c++/4.4\*/backward/\* \
c++/4.4\*/bits/\* \
c++/4.4\*/ext/\* \
c++/4.4\*/\*-\*/bits/\* \
boost/\* \
gtest/\* \
usr/include/\* \
tests/\* \
unittests/\* \
\*_unittests.cc \
\*_unittest.cc \
\*_unittests.h \
--output report.info
$(GENHTML) -o coverage report.info
coverage: clean-coverage perform-coverage report-coverage
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 and maintaining DNS.
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 1 (Y1) deliverable of
the five year plan is described here:
http://bind10.isc.org/wiki/Year1Deliverable
This release includes the bind10 master process, msgq message bus,
b10-auth authoritative DNS server, b10-cmdctl remote control daemon,
b10-cfgmgr configuration manager, and a new libdns library.
Documentation is included and also available via the BIND 10
website at http://bind10.isc.org/
The latest released source may be downloaded from:
ftp://ftp.isc.org/isc/bind10/
Users and developers are encouraged to participate on the BIND 10
mailing lists:
https://lists.isc.org/mailman/listinfo/bind10-users
https://lists.isc.org/mailman/listinfo/bind10-dev
Bugs may be reported as tickets via the developers website:
http://bind10.isc.org/
See the Guide for detailed installation directions.
BUILDING
We recommend using the Boost libraries as it provides a safer TCP
implementation in BIND 10.
Simple build instructions:
./configure
make
If building from Subversion repository, run:
autoreconf --install
before running ./configure
Requires autoconf 2.59 or newer.
Use automake-1.11 or better for working Python 3.1 tests.
Alternatively, you could manually specify an absolute path to python
executable by the --with-pythonpath option of the configure script,
e.g.,
% ./configure --with-pythonpath=/usr/local/bin/python3.1
Operating-System specific tips:
- FreeBSD
You may need to install a python binding for sqlite3 by hand. A
sample procedure is as follows:
- add the following to /etc/make.conf
PYTHON_VERSION=3.1
- build and install the python binding from ports, assuming the top
directory of the ports system is /usr/ports
% cd /usr/ports/databases/py-sqlite3/
% make
% sudo make install
INSTALLATION
Install with:
make install
TESTS
The tests use the googletests framework for C++. It is available
from http://code.google.com/p/googletest/. To enable the tests,
configure BIND 10 with:
./configure --with-gtest
Then run "make check" to run these tests.
TEST COVERAGE
The code coverage report for the C++ tests uses LCOV. It is available
from http://ltp.sourceforge.net/. To generate your own HTML report,
first configure BIND 10 with:
./configure --with-lcov
Doing code coverage tests:
make coverage
Does the following:
make clean-coverage
Zeroes the lcov code coverage counters and removes the coverage HTML.
make perform-coverage
Runs the C++ tests (using googletests framework).
make report-coverage
Generates the coverage HTML, excluding some unrelated headers.
The HTML reports are placed in a directory called coverage/.
DEVELOPERS
The generated run_*.sh scripts available in the src/bin directories
are for running the code using the source tree.
RUNNING
You can start the BIND 10 processes by running bind10 which is
installed to the sbin directory under the installation prefix.
The default location is:
/usr/local/sbin/bind10
For development work, you can also run the bind10 services from the
source tree:
./src/bin/bind10/run_bind10.sh
(Which will use the modules and configurations also from the source
tree.)
The server will listen on port 5300 for DNS requests.
CONFIGURATION
Commands can be given through the bindctl tool.
The server must be running for bindctl to work.
The following configuration commands are available
help: show the different command modules
<module> help: show the commands for module
<module> <command> help: show info for the command
config show [identifier]: Show the currently set values. If no identifier is
given, the current location is used. If a config
option is a list or a map, the value is not
shown directly, but must be requested separately.
config go [identifier]: Go to the given location within the configuration.
config set [identifier] <value>: Set a configuration value.
config unset [identifier]: Remove a value (reverts to default if the option
is mandatory).
config add [identifier] <value>: add a value to a list
config remove [identifier] <value>: remove a value from a list
config revert: Revert all changes that have not been committed
config commit: Commit all changes
config diff: Show the changes that have not been committed yet
EXAMPLE SESSION
~> bindctl
["login success "] login as root
> help
BindCtl, verstion 0.1
usage: <module name> <command name> [param1 = value1 [, param2 = value2]]
Type Tab character to get the hint of module/command/paramters.
Type "help(? h)" for help on bindctl.
Type "<module_name> help" for help on the specific module.
Type "<module_name> <command_name> help" for help on the specific command.
Available module names:
help Get help for bindctl
config Configuration commands
Xfrin same here
Auth same here
Boss same here
> config help
Module config Configuration commands
Available commands:
help (Get help for module)
show (Show configuration)
add (Add entry to configuration list)
remove (Remove entry from configuration list)
set (Set a configuration value)
unset (Unset a configuration value)
diff (Show all local changes)
revert (Revert all local changes)
commit (Commit all local changes)
go (Go to a specific configuration part)
> config show
Xfrin/ module
Auth/ module
Boss/ module
> config show Xfrin
transfers_in: 10 integer
> config go Auth
/Auth> config show
database_file: None string
/Auth> config set database_file /tmp/bind10_zones.db
/Auth> config commit
/Auth> config go /
> config show Auth/
database_file: /tmp/bind10_zones.db string
> config diff
{}
> config set Auth/foobar
Error: missing identifier or value
> config set Auth/database_file foobar
> config diff
{'Auth': {'database_file': 'foobar'}}
> config revert
> config diff
{}
> quit
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20100318, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
# Use C++ language
AC_LANG_CPLUSPLUS
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
AC_ARG_WITH([pythonpath],
AC_HELP_STRING([--with-pythonpath=PATH],
[specify an absolute path to python executable when automatic version check (incorrectly) fails]),
[python_path="$withval"], [python_path="auto"])
if test "$python_path" = auto; then
AM_PATH_PYTHON([3.1])
else
# Older versions of automake can't handle python3 well. This is an
# in-house workaround for them.
PYTHON=$python_path
AC_SUBST(PYTHON)
PYTHON_PREFIX='${prefix}'
AC_SUBST(PYTHON_PREFIX)
PYTHON_EXEC_PREFIX='$(exec_prefix)'
AC_SUBST(PYTHON_EXEC_PREFIX)
PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
fi
AC_SUBST(PYTHON_VERSION)
PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
AC_SUBST(PYTHON_PLATFORM)
pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
AC_SUBST(pythondir)
pkgpythondir='${pythondir}/'$PACKAGE
AC_SUBST(pkgpythondir)
pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
AC_SUBST(pyexecdir)
pkgpyexecdir='${pyexecdir}/'$PACKAGE
AC_SUBST(pkgpyexecdir)
fi
# Check for python development environments
if test -x ${PYTHON}-config; then
PYTHON_INCLUDES=`${PYTHON}-config --includes`
for flag in `${PYTHON}-config --ldflags`; do
# add any '-L..." flags to PYTHON_LDFLAGS
flag=`echo $flag | sed -ne 's/^\(\-L.*\)$/\1/p'`
if test "X${flag}" != X; then
PYTHON_LDFLAGS="$PYTHON_LDFLAGS ${flag}"
fi
done
# on some platforms, ${PYTHON}-config --ldflags doesn't provide a -L
# option while having the library under a non trivial directory.
# as a workaround we try the "lib" sub directory under the common
# prefix for this python.
if test -z "${PYTHON_LDFLAGS}"; then
PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib"
fi
else
if test "X$PYTHON_INCLUDES" = X -o "X$PYTHON_LDFLAGS" = X; then
AC_MSG_WARN([${PYTHON}-config does not exist or is not executable, so we could not detect python development environment. Your system may require an additional package (e.g. "python3-dev"). Alternatively, if you are sure you have python headers and libraries, define PYTHON_INCLUDES and PYTHON_LDFLAGS and run this script.])
fi
fi
AC_SUBST(PYTHON_INCLUDES)
AC_SUBST(PYTHON_LDFLAGS)
# Check for python library (not absolutely mandatory, but needed for
# Boost.Python when we use it. See below.)
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
python_bin="python${PYTHON_VERSION}"
AC_CHECK_LIB($python_bin, main, python_lib=$python_bin, python_lib=no)
if test $python_lib != "no"; then
PYTHON_LIB="-l$python_lib"
fi
AC_SUBST(PYTHON_LIB)
# TODO: check for _sqlite3.py module
# default compiler warning settings
if test "X$GCC" = "Xyes"; then
CXXFLAGS="$CXXFLAGS -g -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare"
UNUSED_PARAM_ATTRIBUTE='__attribute__((unused))'
# 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.
werror_ok=0
CXXFLAGS_SAVED="$CXXFLAGS"
CXXFLAGS="$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],
[AC_MSG_RESULT(yes)])
CXXFLAGS="$CXXFLAGS_SAVED"
fi
AC_DEFINE_UNQUOTED(UNUSED_PARAM, $UNUSED_PARAM_ATTRIBUTE, Define to compiler keyword indicating a function argument is intentionally unused)
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$GCC" = "Xyes"; then
CXXFLAGS="$CXXFLAGS -fPIC"
fi
# Checks for libraries.
AC_SEARCH_LIBS(inet_pton, [nsl])
AC_SEARCH_LIBS(recvfrom, [socket])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
AC_MSG_CHECKING(for sa_len in struct sockaddr)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>],
[struct sockaddr sa; sa.sa_len = 0; return (0);],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_SIN_LEN, 1, Define to 1 if sockaddr_in has a sin_len member)],
AC_MSG_RESULT(no))
AC_ARG_WITH(lcov,
[ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="no")
AC_ARG_WITH(gtest,
[ --with-gtest=PATH specify a path to gtest header files (PATH/include) and library (PATH/lib)],
gtest_path="$withval", gtest_path="no")
USE_LCOV="no"
if test "$lcov" != "no"; then
# force gtest if not set
if test "$gtest_path" = "no"; then
# AC_MSG_ERROR("lcov needs gtest for test coverage report")
AC_MSG_NOTICE([gtest support is now enabled, because used by coverage tests])
gtest_path="yes"
fi
if test "$lcov" != "yes"; then
LCOV=$lcov
else
AC_PATH_PROG([LCOV], [lcov])
fi
if test -x "${LCOV}"; then
USE_LCOV="yes"
else
AC_MSG_ERROR([Cannot find lcov.])
fi
# is genhtml always in the same directory?
GENHTML=`echo "$LCOV" | sed s/lcov$/genhtml/`
if test ! -x $GENHTML; then
AC_MSG_ERROR([genhtml not found, needed for lcov])
fi
# GCC specific?
CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage"
LIBS=" $LIBS -lgcov"
AC_SUBST(CPPFLAGS)
AC_SUBST(LIBS)
AC_SUBST(LCOV)
AC_SUBST(GENHTML)
fi
AC_SUBST(USE_LCOV)
AC_ARG_WITH([boost-include],
AC_HELP_STRING([--with-boost-include=PATH],
[specify exact directory for Boost headers]),
[boost_include_path="$withval"])
if test "${boost_include_path}" ; then
BOOST_INCLUDES="-I${boost_include_path}"
CPPFLAGS="$CPPFLAGS $BOOST_INCLUDES"
fi
AC_SUBST(BOOST_INCLUDES)
AC_ARG_WITH([boost-lib],
AC_HELP_STRING([--with-boost-lib=PATH],
[specify exact directory for Boost libraries]),
[if test "$withval" != "yes" -a "$withval" != "no"; then
BOOST_LDFLAGS="-L$withval"
fi])
AC_SUBST(BOOST_LDFLAGS)
# Check availability of the Boost System library
AC_MSG_CHECKING([for boost::system library])
AC_ARG_WITH([boost-system],
AC_HELP_STRING([--with-boost-system],
[specify whether to use the boost system library]),
[with_boost_system="$withval"], [with_boost_system="auto"])
if test "$with_boost_system" != "no"; then
LDFLAGS_SAVED="$LDFLAGS"
LIBS_SAVED="$LIBS"
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -Iext"
for BOOST_TRY_LIB in boost_system boost_system-mt; do
LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS}"
LIBS="$LIBS_SAVED -l${BOOST_TRY_LIB}"
AC_TRY_LINK([#include <boost/system/error_code.hpp>],
[ boost::system::error_code error_code;
std::string message(error_code.message());
return 0; ],
[ AC_MSG_RESULT(yes)
BOOST_SYSTEM_LIB="-l${BOOST_TRY_LIB}"
],[])
if test "X${BOOST_SYSTEM_LIB}" != X; then
break
fi
done
LDFLAGS="$LDFLAGS_SAVED"
CPPFLAGS="$CPPFLAGS_SAVED"
LIBS="$LIBS_SAVED"
fi
if test "X${BOOST_SYSTEM_LIB}" = X; then
AC_MSG_RESULT(no)
if test "$with_boost_system" = "yes"; then
AC_MSG_ERROR([boost system library is requested but not found])
fi
else
AC_DEFINE(HAVE_BOOST_SYSTEM, 1, Define to 1 if boost system library is available)
fi
AM_CONDITIONAL(HAVE_BOOST_SYSTEM, test "X${BOOST_SYSTEM_LIB}" != X)
AC_SUBST(BOOST_SYSTEM_LIB)
# Check availability of the Boost Python library
AC_MSG_CHECKING([for boost::python library])
AC_ARG_WITH([boost-python],
AC_HELP_STRING([--with-boost-python],
[specify whether to use the boost python library]),
[with_boost_python="$withval"], [with_boost_python="auto"])
if test "$with_boost_python" != "no"; then
if test "$with_boost_python" != "auto" -a "X$PYTHON_LIB" = X; then
AC_MSG_ERROR([Boost.Python requested but python library is not available])
fi
LDFLAGS_SAVED="$LDFLAGS"
LIBS_SAVED="$LIBS"
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
for BOOST_TRY_LIB in boost_python boost_python-mt; do
LDFLAGS="$LDFLAGS_SAVED ${BOOST_LDFLAGS} ${PYTHON_LDFLAGS}"
LIBS="$LIBS_SAVED -l${BOOST_TRY_LIB} ${PYTHON_LIB}"
AC_TRY_LINK([#include <boost/python/module.hpp>
using namespace boost::python;
BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }],
[ return 0; ],
[ AC_MSG_RESULT(yes)
BOOST_PYTHON_LIB="-l${BOOST_TRY_LIB}"
],[])
if test "X${BOOST_PYTHON_LIB}" != X; then
break
fi
done
LDFLAGS="$LDFLAGS_SAVED"
CPPFLAGS="$CPPFLAGS_SAVED"
LIBS="$LIBS_SAVED"
fi
if test "X${BOOST_PYTHON_LIB}" = X; then
AC_MSG_RESULT(no)
if test "$with_boost_python" = "yes"; then
AC_MSG_ERROR([boost python library is requested but not found])
fi
else
AC_DEFINE(HAVE_BOOST_PYTHON, 1, Define to 1 if boost python library is available)
fi
AM_CONDITIONAL(HAVE_BOOST_PYTHON, test "X${BOOST_PYTHON_LIB}" != X)
AC_SUBST(BOOST_PYTHON_LIB)
#
# Check availability of gtest, which will be used for unit tests.
#
if test "$gtest_path" != "no"
then
if test "$gtest_path" != "yes"; then
GTEST_PATHS=$gtest_path
if test -x "${gtest_path}/bin/gtest-config" ; then
GTEST_CONFIG="${gtest_path}/bin/gtest-config"
fi
else
AC_PATH_PROG([GTEST_CONFIG], [gtest-config])
fi
if test -x "${GTEST_CONFIG}" ; then :
# using cppflags instead of cxxflags
GTEST_INCLUDES=`${GTEST_CONFIG} --cppflags`
GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
GTEST_LDADD=`${GTEST_CONFIG} --libs`
GTEST_FOUND="true"
else
AC_MSG_WARN([Unable to locate Google Test gtest-config.])
if test -z "${GTEST_PATHS}" ; then
GTEST_PATHS="/usr /usr/local"
fi
GTEST_FOUND="false"
fi
if test "${GTEST_FOUND}" != "true"; then
GTEST_FOUND="false"
for dir in $GTEST_PATHS; do
if test -f "$dir/include/gtest/gtest.h"; then
GTEST_INCLUDES="-I$dir/include"
GTEST_LDFLAGS="-L$dir/lib"
GTEST_LDADD="-lgtest"
GTEST_FOUND="true"
break
fi
done
fi
if test "${GTEST_FOUND}" != "true"; then
AC_MSG_ERROR([Cannot find gtest in: $GTEST_PATHS])
fi
else
GTEST_INCLUDES=
GTEST_LDFLAGS=
GTEST_LDADD=
fi