Commit a5bd8c03 authored by chenzhengzhang's avatar chenzhengzhang Committed by Michal 'vorner' Vaner
Browse files

merge #502 : iterate over RRs

parents 1133c5a5 748885cd
159. [func] smann
The resolver now has a configurable set of root servers to start
resolving at (called root_addresses). By default these are not
(yet) filled in. If empty, a hardcoded address for f-root will be
used right now.
(Trac #483, git a07e078b4feeb01949133fc88c9939254c38aa7c)
158. [func] jelte
The Resolver module will now do (very limited) resolving, if not
set to forwarding mode (i.e. if the configuration option
forward_addresses is left empty). It only supports referrals that
contain glue addresses at this point, and does no other processing
of authoritative answers.
(Trac #484, git 7b84de4c0e11f4a070e038ca4f093486e55622af)
157. [bug] vorner
One frozen process no longer freezes the whole b10-msgq. It caused the
whole system to stop working.
(Trac #420, git 93697f58e4d912fa87bc7f9a591c1febc9e0d139)
156. [func] stephen
Added ResponseClassifier class to examine response from
a server and classify it into one of several categories.
(Trac #487, git 18491370576e7438c7893f8551bbb8647001be9c)
bind10-devel-20110120 released on January 20, 2011
155. [doc] jreed
Miscellaneous documentation improvements for man pages and
the guide, including auth, resolver, stats, xfrout, and
zonemgr. (git c14c4741b754a1eb226d3bdc3a7abbc4c5d727c0)
154. [bug] jinmei
b10-xfrin/b10-zonemgr: Fixed a bug where these programs didn't
receive command responses from CC sessions. Eventually the
receive buffer became full, and many other components that rely
on CC channels would stall (as noted in #420 and #513). This is
an urgent care fix due to the severity of the problem; we'll need
to revisit it for cleaner fix later. (Trac #516, git 62c72fc)
153. [bug] jelte
b10-cfgmgr: Fixed a bug where configuration updates sometimes
lost previous settings in the configuration manager.
(Trac #427, git 2df894155657754151e0860e2ca9cdbed7317c70)
152. [func]* jinmei
b10-auth: Added new configuration variable "statistics-interval"
to allow the user to change the timer interval for periodic
statistics updates. The update can also be disabled by setting
the value to 0. Disabling statistics updates will also work as
a temporary workaround of a known issue that b10-auth can block in
sending statistics and stop responding to queries as a result.
(Trac #513, git 285c5ee)
151. [bug] smann
lib/log/dummylog.h:
lib/log/dummylog.cc: Modify dlog so that it takes an optional 2nd
argument of type bool (true or false). This flag, if set, will cause
the message to be printed whether or not -v is chosen.
(trac #432, git 880220478c3e8702d56d761b1e0b21b77d08ee5a)
150. [bug] jelte
b10-cfgmgr: No longer save the configuration on exit. Configuration
is already saved if it is changed succesfully, so writing it on
is already saved if it is changed successfully, so writing it on
exit (and hence, when nothing has changed too) is unnecessary and
may even cause problems.
(Trac #435, git fd7baa38c08d54d5b5f84930c1684c436d2776dc)
......@@ -256,7 +311,7 @@ bind10-devel-20101201 released on December 01, 2010
112. [func] zhang likun
Add one mixin class to override the naive serve_forever() provided
in python library socketserver. Instead of polling for shutdwon
in python library socketserver. Instead of polling for shutdown
every poll_interval seconds, one socketpair is used to wake up
the waiting server. (Trac #352, svn r3366)
......
SUBDIRS = src
SUBDIRS = doc src
USE_LCOV=@USE_LCOV@
LCOV=@LCOV@
GENHTML=@GENHTML@
......@@ -282,9 +282,3 @@ EXTRA_DIST += ext/asio/asio/is_write_buffered.hpp
EXTRA_DIST += ext/asio/asio/buffered_read_stream_fwd.hpp
EXTRA_DIST += ext/asio/asio/socket_acceptor_service.hpp
EXTRA_DIST += ext/asio/asio.hpp
## include the guide in tarball, later will include the other parts there
## but they cleanup.
EXTRA_DIST += doc/guide/bind10-guide.css
EXTRA_DIST += doc/guide/bind10-guide.html
EXTRA_DIST += doc/guide/bind10-guide.xml
......@@ -48,7 +48,7 @@ Simple build instructions:
./configure
make
If building from Subversion repository, run:
If building from Git repository, run:
autoreconf --install
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT(bind10-devel, 20101201, bind10-dev@isc.org)
AC_INIT(bind10-devel, 20110120, bind10-dev@isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
......@@ -83,7 +83,7 @@ case "$host" in
CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
;;
*-apple-darwin*)
# libtool doesn't work pefectly with Darwin: libtool embeds the
# libtool doesn't work perfectly with Darwin: libtool embeds the
# final install path in dynamic libraries and our loadable python
# modules always refer to that path even if it's loaded within the
# source tree. This prevents pre-install tests from working.
......@@ -202,7 +202,7 @@ fi
# 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 specifc AM_CXXFLAGS:
# 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
......@@ -555,7 +555,7 @@ fi
# So, for the moment, we simply disable the use of /dev/poll. Unless we
# implement recursive DNS server with randomized ports, we don't need the
# scalability that /dev/poll can provide, so this decision wouldn't affect
# run time performance. Hpefully we can find a better solution or the ASIO
# run time performance. Hopefully we can find a better solution or the ASIO
# code will be updated by the time we really need it.
AC_CHECK_HEADERS(sys/devpoll.h, ac_cv_have_devpoll=yes, ac_cv_have_devpoll=no)
if test "X$ac_cv_have_devpoll" = "Xyes" -a "X$GXX" = "Xyes"; then
......@@ -574,6 +574,8 @@ AC_ARG_ENABLE(install-configurations,
AM_CONDITIONAL(INSTALL_CONFIGURATIONS, test x$install_configurations = xyes || test x$install_configurations = xtrue)
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/guide/Makefile
src/Makefile
src/bin/Makefile
src/bin/bind10/Makefile
......@@ -655,7 +657,8 @@ AC_CONFIG_FILES([Makefile
src/lib/nsas/Makefile
src/lib/nsas/tests/Makefile
])
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
AC_OUTPUT([doc/version.ent
src/bin/cfgmgr/b10-cfgmgr.py
src/bin/cfgmgr/tests/b10-cfgmgr_test.py
src/bin/cmdctl/cmdctl.py
src/bin/cmdctl/run_b10-cmdctl.sh
......@@ -712,7 +715,6 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
chmod +x src/bin/cmdctl/run_b10-cmdctl.sh
chmod +x src/bin/xfrin/run_b10-xfrin.sh
chmod +x src/bin/xfrout/run_b10-xfrout.sh
chmod +x src/bin/resolver/run_b10-resolver.sh
chmod +x src/bin/zonemgr/run_b10-zonemgr.sh
chmod +x src/bin/stats/tests/stats_test
chmod +x src/bin/stats/run_b10-stats.sh
......
......@@ -568,7 +568,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = ../src/lib/cc ../src/lib/config ../src/lib/dns ../src/lib/exceptions ../src/lib/datasrc ../src/bin/auth ../src/lib/bench ../src/lib/log ../src/lib/asiolink/ ../src/lib/nsas
INPUT = ../src/lib/cc ../src/lib/config ../src/lib/dns ../src/lib/exceptions ../src/lib/datasrc ../src/bin/auth ../src/bin/resolver ../src/lib/bench ../src/lib/log ../src/lib/asiolink/ ../src/lib/nsas ../src/lib/testutils
# 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
......
SUBDIRS = guide
EXTRA_DIST = version.ent.in
#
# Quick and dirty makefile
#
EXTRA_DIST = bind10-guide.css
EXTRA_DIST += bind10-guide.html
EXTRA_DIST += bind10-guide.xml
# This is not a "man" manual, but reuse this for now for docbook.
if ENABLE_MAN
bind10-guide.html: bind10-guide.xml
xsltproc --novalid --xinclude --nonet \
-o bind10-guide.html \
--stringparam html.stylesheet bind10-guide.css \
--path $(top_builddir)/doc \
-o $@ \
--stringparam html.stylesheet $(srcdir)/bind10-guide.css \
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
bind10-guide.xml
$(srcdir)/bind10-guide.xml
clean:
rm -f bind10-guide.html
endif
This diff is collapsed.
......@@ -2,6 +2,8 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY mdash "&#x2014;" >
<!ENTITY % version SYSTEM "version.ent">
%version;
]>
<book>
<?xml-stylesheet href="bind10-guide.css" type="text/css"?>
......@@ -15,13 +17,20 @@
</copyright>
<abstract>
<para>This is the reference guide for BIND 10.</para>
<para>
The most up-to-date version of this document, along with other documents
for BIND 10, can be found at
<ulink url="http://bind10.isc.org/docs"/>.
<para>BIND 10 is a Domain Name System (DNS) suite managed by
Internet Systems Consortium (ISC). It includes DNS libraries
and modular components for controlling authoritative and
recursive DNS servers.
</para>
</abstract>
<para>
This is the reference guide for BIND 10 version &__VERSION__;.
The most up-to-date version of this document, along with
other documents for BIND 10, can be found at <ulink
url="http://bind10.isc.org/docs"/>. </para> </abstract>
<releaseinfo>This is the reference guide for BIND 10 version
&__VERSION__;.</releaseinfo>
</bookinfo>
<chapter id="intro">
......@@ -35,8 +44,8 @@
<note>
<para>
This guide covers the experimental prototype version of
BIND 10.
This guide covers the experimental prototype of
BIND 10 version &__VERSION__;.
</para>
</note>
......@@ -51,7 +60,7 @@
<title>Supported Platforms</title>
<para>
BIND 10 builds have been tested on Debian GNU/Linux 5,
Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7, and CentOS
Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7 and 8, and CentOS
Linux 5.3.
It has been tested on Sparc, i386, and amd64 hardware
......@@ -115,6 +124,7 @@
<para>
<itemizedlist>
<listitem>
<simpara>
<command>b10-msgq</command> &mdash;
......@@ -123,6 +133,7 @@
BIND 10 processes.
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-auth</command> &mdash;
......@@ -130,6 +141,7 @@
This process serves DNS requests.
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-cfgmgr</command> &mdash;
......@@ -137,6 +149,7 @@
This process maintains all of the configuration for BIND 10.
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-cmdctl</command> &mdash;
......@@ -145,6 +158,23 @@
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-resolver</command> &mdash;
Recursive name server.
This process handles incoming queries.
<!-- TODO: -->
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-stats</command> &mdash;
Statistics collection daemon.
This process collects and reports statistics data.
</simpara>
</listitem>
<listitem>
<simpara>
<command>b10-xfrin</command> &mdash;
......@@ -393,7 +423,7 @@ var/
<para>
BIND 10 is open source software written in C++ and Python.
It is freely available in source code form from ISC via
the Subversion code revision control system or as a downloadable
the Git code revision control system or as a downloadable
tar file. It may also be available in pre-compiled ready-to-use
packages from operating system vendors.
</para>
......@@ -414,7 +444,7 @@ var/
</section>
<section>
<title>Retrieve from Subversion</title>
<title>Retrieve from Git</title>
<para>
Downloading this "bleeding edge" code is recommended only for
developers or advanced users. Using development code in a production
......@@ -423,7 +453,7 @@ var/
<note>
<para>
When using source code retrieved via Subversion additional
When using source code retrieved via Git additional
software will be required: automake (v1.11 or newer),
libtoolize, and autoconf (2.59 or newer).
These may need to be installed.
......@@ -433,14 +463,16 @@ var/
<para>
The latest development code, including temporary experiments
and un-reviewed code, is available via the BIND 10 code revision
control system. This is powered by Subversion and all the BIND 10
control system. This is powered by Git and all the BIND 10
development is public.
The leading development is done in the <quote>trunk</quote>.
The leading development is done in the <quote>master</quote>.
</para>
<para>
The code can be checked out from <filename>svn://bind10.isc.org/svn/bind10</filename>; for example to check out the trunk:
The code can be checked out from
<filename>git://bind10.isc.org/bind10</filename>;
for example:
<screen>$ <userinput>svn co svn://bind10.isc.org/svn/bind10/trunk</userinput></screen>
<screen>$ <userinput>git clone git://bind10.isc.org/bind10</userinput></screen>
</para>
<para>
......@@ -657,7 +689,9 @@ var/
about other modules.
The <command>bind10</command> master process will also start up
<command>b10-cmdctl</command> for admins to communicate with the
system, <command>b10-auth</command> for Authoritative DNS service,
system, <command>b10-auth</command> for authoritative DNS service or
<command>b10-resolver</command> for recursive name service,
<command>b10-stats</command> for statistics collection,
<command>b10-xfrin</command> for inbound DNS zone transfers,
<command>b10-xfrout</command> for outbound DNS zone transfers,
and <command>b10-zonemgr</command> for secondary service.
......@@ -1261,6 +1295,118 @@ what is XfroutClient xfr_client??
</chapter>
<chapter id="resolverserver">
<title>Recursive Name Server</title>
<para>
The <command>b10-resolver</command> process is started by
<command>bind10</command>.
<!-- TODO
It provides a resolver so DNS clients can ask it to do recursion
and it will return answers.
-->
</para>
<note><simpara>
The current version only provides a forwarding DNS server.
It does not cache and does not iterate to find answers.
It simply forwards the query on to another full resolver.
</simpara></note>
<para>
The main <command>bind10</command> process can be configured
to select to run either the authoritative or resolver.
By default, it starts the authoritative service.
<!-- TODO: later both -->
You may change this using <command>bindctl</command>, for example:
<screen>
&gt; <userinput>config set Boss/start_auth false</userinput>
&gt; <userinput>config set Boss/start_resolver true</userinput>
&gt; <userinput>config commit</userinput>
</screen>
</para>
<!-- TODO: -->
<note><simpara>
In the current version, the master <command>bind10</command>
process must be stopped and restarted to start up the resolver.
</simpara></note>
<para>
Then the upstream address and port must be configured to
forward queries to, such as:
<screen>
&gt; <userinput>config set Resolver/forward_addresses [{ "address": "<replaceable>192.168.1.1</replaceable>", "port": 53 }]</userinput>
&gt; <userinput>config commit</userinput>
</screen>
(Replace <replaceable>192.168.1.1</replaceable> to point to your
full resolver.)
</para>
<para>
The resolver also needs to be configured to listen on an address
and port:
<screen>
&gt; <userinput>config set Resolver/listen_on [{ "address": "127.0.0.1", "port": 53 }]</userinput>
&gt; <userinput>config commit</userinput>
</screen>
</para>
<!-- TODO: later the above will have some defaults -->
<!-- TODO: later try this
> config set Resolver/forward_addresses[0]/address "192.168.8.8"
> config set Resolver/forward_addresses[0]/port 53
then change those defaults with config set Resolver/forward_addresses[0]/address "1.2.3.4"
> config set Resolver/forward_addresses[0]/address "1.2.3.4"
-->
</chapter>
<chapter id="statistics">
<title>Statistics</title>
<para>
The <command>b10-stats</command> process is started by
<command>bind10</command>.
It periodically collects statistics data from various modules
and aggregates it.
<!-- TODO -->
</para>
<para>
This stats daemon provides commands to identify if it is running,
show specified or all statistics data, set values, remove data,
and reset data.
For example, using <command>bindctl</command>:
<screen>
&gt; <userinput>Stats show</userinput>
{
"auth.queries.tcp": 1749,
"auth.queries.udp": 867868,
"bind10.boot_time": "2011-01-20T16:59:03Z",
"report_time": "2011-01-20T17:04:06Z",
"stats.boot_time": "2011-01-20T16:59:05Z",
"stats.last_update_time": "2011-01-20T17:04:05Z",
"stats.lname": "4d3869d9_a@jreed.example.net",
"stats.start_time": "2011-01-20T16:59:05Z",
"stats.timestamp": 1295543046.823504
}
</screen>
</para>
</chapter>
<!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
<!-- <index> <title>Index</title> </index> -->
......
<!ENTITY __VERSION__ "@PACKAGE_VERSION@">
......@@ -52,6 +52,11 @@
}
]
}
},
{ "item_name": "statistics-interval",
"item_type": "integer",
"item_optional": true,
"item_default": 60
}
],
"commands": [
......
......@@ -12,8 +12,6 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
#include <config.h>
#include <netinet/in.h>
......@@ -23,6 +21,8 @@
#include <iostream>
#include <vector>
#include <boost/bind.hpp>
#include <asiolink/asiolink.h>
#include <config/ccsession.h>
......@@ -87,6 +87,8 @@ public:
bool processNotify(const IOMessage& io_message, MessagePtr message,
OutputBufferPtr buffer);
IOService io_service_;
/// Currently non-configurable, but will be.
static const uint16_t DEFAULT_LOCAL_UDPSIZE = 4096;
......@@ -102,6 +104,9 @@ public:
/// Hot spot cache
isc::datasrc::HotCache cache_;
/// Interval timer for periodic submission of statistics counters.
IntervalTimer statistics_timer_;
/// Query counters for statistics
AuthCounters counters_;
private:
......@@ -125,6 +130,7 @@ AuthSrvImpl::AuthSrvImpl(const bool use_cache,
config_session_(NULL), verbose_mode_(false),
xfrin_session_(NULL),
memory_datasrc_class_(RRClass::IN()),
statistics_timer_(io_service_),
counters_(verbose_mode_),
xfrout_connected_(false),
xfrout_client_(xfrout_client)
......@@ -153,9 +159,13 @@ AuthSrvImpl::~AuthSrvImpl() {
class MessageLookup : public DNSLookup {
public:
MessageLookup(AuthSrv* srv) : server_(srv) {}
virtual void operator()(const IOMessage& io_message, MessagePtr message,
OutputBufferPtr buffer, DNSServer* server) const
virtual void operator()(const IOMessage& io_message,
MessagePtr message,
MessagePtr answer_message,
OutputBufferPtr buffer,
DNSServer* server) const
{
(void) answer_message;
server_->processMessage(io_message, message, buffer, server);
}
private:
......@@ -174,7 +184,7 @@ class MessageAnswer : public DNSAnswer {
public:
MessageAnswer(AuthSrv*) {}
virtual void operator()(const IOMessage&, MessagePtr,
OutputBufferPtr) const
MessagePtr, OutputBufferPtr) const
{}
};
......@@ -195,7 +205,6 @@ private:
AuthSrv::AuthSrv(const bool use_cache, AbstractXfroutClient& xfrout_client) :
impl_(new AuthSrvImpl(use_cache, xfrout_client)),
io_service_(NULL),
checkin_(new ConfigChecker(this)),
dns_lookup_(new MessageLookup(this)),
dns_answer_(new MessageAnswer(this))
......@@ -203,10 +212,7 @@ AuthSrv::AuthSrv(const bool use_cache, AbstractXfroutClient& xfrout_client) :
void
AuthSrv::stop() {
if (io_service_ == NULL) {
throw FatalError("Assumption failure; server is stopped before start");
}
io_service_->stop();
impl_->io_service_.stop();
}
AuthSrv::~AuthSrv() {
......@@ -278,6 +284,11 @@ AuthSrv::getVerbose() const {
return (impl_->verbose_mode_);
}
IOService&
AuthSrv::getIOService() {
return (impl_->io_service_);
}
void
AuthSrv::setCacheSlots(const size_t slots) {
impl_->cache_.setSlots(slots);
......@@ -341,6 +352,32 @@ AuthSrv::setMemoryDataSrc(const isc::dns::RRClass& rrclass,
impl_->memory_datasrc_ = memory_datasrc;
}
uint32_t
AuthSrv::getStatisticsTimerInterval() const {
return (impl_->statistics_timer_.getInterval());
}
void
AuthSrv::setStatisticsTimerInterval(uint32_t interval) {
if (interval == impl_->statistics_timer_.getInterval()) {
return;
}
if (interval == 0) {
impl_->statistics_timer_.cancel();
} else {
impl_->statistics_timer_.setupTimer(
boost::bind(&AuthSrv::submitStatistics, this), interval);
}
if (impl_->verbose_mode_) {
if (interval == 0) {
cerr << "[b10-auth] Disabled statistics timer" << endl;
} else {
cerr << "[b10-auth] Set statistics timer to " << interval
<< " seconds" << endl;
}
}
}
void
AuthSrv::processMessage(const IOMessage& io_message, MessagePtr message,
OutputBufferPtr buffer, DNSServer* server)
......
......@@ -12,8 +12,6 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
#ifndef __AUTH_SRV_H
#define __AUTH_SRV_H 1
......@@ -91,9 +89,8 @@ public:
///
/// It stops the internal event loop of the server and subsequently