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

So trunk is now a copy of branches/parkinglot as of revision 736.

This is not a merge.
I will provide a list of code that must be reviewed using
our review procedure (other than it is in trunk now).
No commits to trunk from now on, unless they have followed
our review policy.
If code now in trunk is not reviewed, it will be removed from trunk.
An email will be sent with details.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@738 e5f2f494-b856-4b98-b285-d166d9295462
parents f56313db 7cb3db70

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
To build "configure" file:
autoreconf
To then build from source:
./configure
make
SUBDIRS = src
USE_LCOV=@USE_LCOV@
LCOV=@LCOV@
GENHTML=@GENHTML@
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/\* \
--output report.info
$(GENHTML) -o coverage report.info
coverage: clean-coverage perform-coverage report-coverage
pyshared:
mkdir pyshared
mkdir pyshared/isc
cat src/lib/config/python/isc/__init__.py src/lib/cc/python/isc/__init__.py > pyshared/isc/__init__.py
ln -s ${abs_top_srcdir}/src/lib/config/python/isc/config pyshared/isc/config
ln -s ${abs_top_srcdir}/src/lib/cc/python/isc/cc pyshared/isc/cc
ln -s ${abs_top_srcdir}/src/lib/cc/python/isc/Util pyshared/isc/Util
include:
mkdir include
ln -s ${abs_top_srcdir}/src/lib/auth/cpp include/auth
ln -s ${abs_top_srcdir}/src/lib/cc/cpp include/cc
ln -s ${abs_top_srcdir}/src/lib/config/cpp include/config
ln -s ${abs_top_srcdir}/src/lib/dns/cpp include/dns
ln -s ${abs_top_srcdir}/src/lib/exceptions/cpp include/exceptions
stree_symlinks: pyshared include
.PHONY: stree_symlinks
all: stree_symlinks
clean-local:
@if [ -d pyshared/isc ] ; then \
rm -f pyshared/isc/*; \
rmdir pyshared/isc; \
fi
@if [ -d pyshared ]; then \
rmdir pyshared; \
fi
@if [ -d include ]; then \
rm -f include/*; \
rmdir include; \
fi
This is the source for the BIND 10 testing branch known as
the parkinglot. This is a simple authoritative server used
to provide identical records for many zones, such as in
a DNS parking service.
BUILDING
Simple build instructions:
autoreconf
./configure
make
Requires autoconf 2.59 or newer.
Use automake-1.11 or better for working Python 3.1 tests.
TEST COVERAGE
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/.
RUNNING
At the moment there is no install yet, you can run the bind10 parkinglot
server from the source tree:
./src/bin/bind10/bind10
The server will listen on port 5300 for DNS requests.
CONFIGURATION
Commands can be given through the tool bindctl;
cd src/bin/bindctl
sh bindctl
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
EXAMPLE SESSION
~> sh bindctl
> config show
ParkingLot/ module
> config show ParkingLot/
port: 5300 integer (default)
zones/ list
a_records/ list (default)
aaaa_records/ list (default)
ns_records/ list (default)
> config go ParkingLot/
/ParkingLot> config show
port: 5300 integer (default)
zones/ list
a_records/ list (default)
aaaa_records/ list (default)
ns_records/ list (default)
/ParkingLot> config show zones
/ParkingLot> config add zone tjeb.nl
Error: /ParkingLot/zone not found
/ParkingLot> config add zones tjeb.nl
/ParkingLot> config show zones
zone_name: tjeb.nl string
/ParkingLot> config show
port: 5300 integer (default)
zones/ list (modified)
a_records/ list (default)
aaaa_records/ list (default)
ns_records/ list (default)
/ParkingLot> config go /
> config show ParkingLot/port
port: 5300 integer (default)
> config go ParkingLot/a_records/
/ParkingLot/a_records> config show
address: 127.0.0.1 string
/ParkingLot/a_records> config add "127.0.0.2"
/ParkingLot/a_records> config show
address: 127.0.0.2 string
/ParkingLot/a_records>
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind, 10.0.0, bind10-bugs@isc.org)
AC_INIT(bind10, 10.0.0, bind10-bugs@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
......@@ -10,18 +10,12 @@ AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AM_CONDITIONAL(GCC, test "$GCC" = yes)
AC_PROG_RANLIB
AC_PROG_LIBTOOL
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T
m4_define([_AM_PYTHON_INTERPRETER_LIST], [python python3 python3.1])
AM_PATH_PYTHON([3.1])
# default compiler warning settings
if test "X$GCC" = "Xyes"; then
......@@ -33,72 +27,48 @@ if test $enable_shared != "no" -a "X$GCC" = "Xyes"; then
CXXFLAGS="$CXXFLAGS -fPIC"
fi
#
# Check availablity of boost:
#
AC_ARG_WITH(boost,
[ --with-boost=PATH specify a path to the boost if it's not automatically found],
boost_path="$withval", boost_path="no")
if test "$boost_path" != "no"
then
BOOST_INCLUDES="-I$boost_path/include"
else
BOOST_INCLUDES=
fi
# Checks for libraries.
AC_SUBST(BOOST_INCLUDES)
# 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")
#
# Check availablity of gtest, which will be used for unit tests.
#
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")
if test "$gtest_path" != "no"
then
if test "$gtest_path" != "yes"
then
GTEST_INCLUDES="-I${gtest_path}/include"
GTEST_LDFLAGS="-L${gtest_path}/lib"
GTEST_LDADD="-lgtest"
else
# todo: check for default paths (/usr and /usr/local?)
GTEST_INCLUDE="-I/usr/include"
GTEST_LDFLAGS="-L/usr/lib"
GTEST_LDADD="-lgtest"
fi
else
GTEST_INCLUDES=
GTEST_LDFLAGS=
GTEST_LDADD=
fi
AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
AC_SUBST(GTEST_INCLUDES)
AC_SUBST(GTEST_LDFLAGS)
AC_SUBST(GTEST_LDADD)
AC_ARG_WITH(lcov,
[ --with-lcov[=PROGRAM] enable gtest and coverage target using the specified lcov], lcov="$withval", lcov="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_PATHS=$lcov
LCOV=$lcov
else
LCOV_PATHS="/usr/bin/lcov /usr/local/bin/lcov"
AC_PATH_PROG([LCOV], [lcov])
fi
for f in $LCOV_PATHS; do
if test -x "$f"; then
USE_LCOV="yes"
LCOV=$f
fi
done
if test $USE_LCOV != "yes"; then
AC_MSG_ERROR([Cannot find lcov in: $LCOV_PATHS])
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/`
......@@ -108,16 +78,120 @@ if test "$lcov" != "no"; then
# 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_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
#
# 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
AM_CONDITIONAL(HAVE_GTEST, test $gtest_path != "no")
AC_SUBST(GTEST_INCLUDES)
AC_SUBST(GTEST_LDFLAGS)
AC_SUBST(GTEST_LDADD)
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/Makefile
src/bin/Makefile
src/bin/bind10/Makefile
src/bin/cmdctl/Makefile
src/bin/bindctl/Makefile
src/bin/cfgmgr/Makefile
src/bin/host/Makefile
src/bin/msgq/Makefile
src/bin/auth/Makefile
src/bin/parkinglot/Makefile
src/lib/Makefile
src/lib/cc/Makefile
src/lib/cc/cpp/Makefile
src/lib/cc/python/Makefile
src/lib/cc/python/isc/Makefile
src/lib/cc/python/isc/cc/Makefile
src/lib/cc/python/isc/Util/Makefile
src/lib/config/Makefile
src/lib/config/cpp/Makefile
src/lib/config/python/Makefile
src/lib/config/python/isc/Makefile
src/lib/config/python/isc/config/Makefile
src/lib/dns/Makefile
src/lib/dns/cpp/Makefile])
src/lib/dns/cpp/Makefile
src/lib/exceptions/cpp/Makefile
src/lib/exceptions/Makefile
src/lib/auth/Makefile
src/lib/auth/cpp/Makefile
])
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cfgmgr/run_b10-cfgmgr.sh
src/bin/cmdctl/b10-cmdctl.py
src/bin/cmdctl/run_b10-cmdctl.sh
src/bin/bind10/bind10.py
src/bin/bind10/bind10_test
src/bin/bind10/run_bind10.sh
src/bin/bindctl/bindctl
src/bin/bindctl/unittest/bindctl_test
src/bin/msgq/msgq.py
src/bin/msgq/msgq_test
src/bin/msgq/run_msgq.sh
src/bin/auth/config.h
src/bin/parkinglot/config.h
src/lib/config/cpp/data_def_unittests_config.h
src/lib/config/python/isc/config/config_test
src/lib/dns/cpp/gen-rdatacode.py
], [
chmod +x src/bin/cfgmgr/run_b10-cfgmgr.sh
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/bind10/run_bind10.sh
chmod +x src/bin/bindctl/bindctl
chmod +x src/bin/msgq/run_msgq.sh
chmod +x src/bin/msgq/msgq_test
chmod +x src/lib/dns/cpp/gen-rdatacode.py
])
AC_OUTPUT
......@@ -568,7 +568,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/lib/dns/cpp
INPUT = ../src/lib/cc/cpp
# 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
......
This document will cover rules and suggestions for writing
and editing the BIND 10 users guide.
Use alphabetical order for options and configuration syntax
sorting unless you have a specific reason no too.
TODO: list the docbook tags to be used for specific things here
// (C) Copyright Herve Bronnimann 2004.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/*
Revision history:
1 July 2004
Split the code into two headers to lessen dependence on
Boost.tuple. (Herve)
26 June 2004
Added the code for the boost minmax library. (Herve)
*/
#ifndef BOOST_ALGORITHM_MINMAX_HPP
#define BOOST_ALGORITHM_MINMAX_HPP
/* PROPOSED STANDARD EXTENSIONS:
*
* minmax(a, b)
* Effect: (b<a) ? std::make_pair(b,a) : std::make_pair(a,b);
*
* minmax(a, b, comp)
* Effect: comp(b,a) ? std::make_pair(b,a) : std::make_pair(a,b);
*
*/
#include <boost/tuple/tuple.hpp> // for using pairs with boost::cref
#include <boost/ref.hpp>
namespace boost {
template <typename T>
tuple< T const&, T const& >
minmax(T const& a, T const& b) {
return (b<a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
}
template <typename T, class BinaryPredicate>
tuple< T const&, T const& >
minmax(T const& a, T const& b, BinaryPredicate comp) {
return comp(b,a) ? make_tuple(cref(b),cref(a)) : make_tuple(cref(a),cref(b));
}
} // namespace boost
#endif // BOOST_ALGORITHM_MINMAX_HPP
// (C) Copyright Herve Bronnimann 2004.
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
/*
Revision history:
1 July 2004
Split the code into two headers to lessen dependence on
Boost.tuple. (Herve)
26 June 2004
Added the code for the boost minmax library. (Herve)
*/
#ifndef BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
#define BOOST_ALGORITHM_MINMAX_ELEMENT_HPP
/* PROPOSED STANDARD EXTENSIONS:
*
* minmax_element(first, last)
* Effect: std::make_pair( std::min_element(first, last),
* std::max_element(first, last) );
*
* minmax_element(first, last, comp)
* Effect: std::make_pair( std::min_element(first, last, comp),
* std::max_element(first, last, comp) );
*/
#include <utility> // for std::pair and std::make_pair
namespace boost {
namespace detail { // for obtaining a uniform version of minmax_element
// that compiles with VC++ 6.0 -- avoid the iterator_traits by
// having comparison object over iterator, not over dereferenced value
template <typename Iterator>
struct less_over_iter {
bool operator()(Iterator const& it1,
Iterator const& it2) const { return *it1 < *it2; }
};
template <typename Iterator, class BinaryPredicate>
struct binary_pred_over_iter {
explicit binary_pred_over_iter(BinaryPredicate const& p ) : m_p( p ) {}
bool operator()(Iterator const& it1,
Iterator const& it2) const { return m_p(*it1, *it2); }
private:
BinaryPredicate m_p;
};
// common base for the two minmax_element overloads
template <typename ForwardIter, class Compare >
std::pair<ForwardIter,ForwardIter>
basic_minmax_element(ForwardIter first, ForwardIter last, Compare comp)
{
if (first == last)
return std::make_pair(last,last);
ForwardIter min_result = first;
ForwardIter max_result = first;
// if only one element
ForwardIter second = first; ++second;
if (second == last)
return std::make_pair(min_result, max_result);
// treat first pair separately (only one comparison for first two elements)
ForwardIter potential_min_result = last;
if (comp(first, second))
max_result = second;
else {
min_result = second;
potential_min_result = first;
}
// then each element by pairs, with at most 3 comparisons per pair
first = ++second; if (first != last) ++second;
while (second != last) {
if (comp(first, second)) {
if (comp(first, min_result)) {
min_result = first;
potential_min_result = last;
}
if (comp(max_result, second))
max_result = second;
} else {
if (comp(second, min_result)) {
min_result = second;
potential_min_result = first;
}
if (comp(max_result, first))
max_result = first;
}
first = ++second;
if (first != last) ++second;
}
// if odd number of elements, treat last element
if (first != last) { // odd number of elements
if (comp(first, min_result))
min_result = first, potential_min_result = last;
else if (comp(max_result, first))
max_result = first;
}
// resolve min_result being incorrect with one extra comparison
// (in which case potential_min_result is necessarily the correct result)
if (potential_min_result != last
&& !comp(min_result, potential_min_result))
min_result = potential_min_result;