Commit ee0950bc authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

Merge branch 'master' into trac2108_3

Conflicts fixed:
	src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc
	src/lib/datasrc/memory/treenode_rrset.cc
	src/lib/datasrc/memory/treenode_rrset.h
parents 70f25f4a 68ebb928
474. [func] stephen
DHCP servers now use the BIND 10 logging system for messages.
(Trac #1545, git de69a92613b36bd3944cb061e1b7c611c3c85506)
473. [bug] jelte
TCP connections now time out in b10-auth if no (or not all) query
data is sent by the client. The timeout value defaults to 5000
milliseconds, but is configurable in Auth/tcp_recv_timeout.
(Trac #357, git cdf3f04442f8f131542bd1d4a2228a9d0bed12ff)
472. [build] jreed
All generated documentation is removed from the git repository.
The ./configure --enable-man option is removed. A new option
-enable-generate-docs is added; it checks for required
documentation building dependencies. Dummy documentation is
built and installed if not used. Distributed tarballs will
contain the generated documentation.
(Trac #1687, git 2d4063b1a354f5048ca9dfb195e8e169650f43d0)
471. [bug] vorner
Fixed a problem when b10-loadzone tried to tread semicolon
in string data as start of comment, which caused invalid
data being loaded.
(Trac #2188, git 12efec3477feb62d7cbe36bdcfbfc7aa28a36f57)
470. [func] naokikambe
The stats module now supports partial statistics updates. Each
module can return only statistics data which have been updated since
......
......@@ -113,8 +113,12 @@ systest:
cd tests/system; \
sh $(abs_srcdir)/tests/system/runall.sh
### include tool to generate documentation from log message specifications
### in the distributed tarball:
EXTRA_DIST = tools/system_messages.py
#### include external sources in the distributed tarball:
EXTRA_DIST = ext/asio/README
EXTRA_DIST += ext/asio/README
EXTRA_DIST += ext/asio/README
EXTRA_DIST += ext/asio/asio.hpp
EXTRA_DIST += ext/asio/asio/basic_socket.hpp
......
......@@ -1027,10 +1027,32 @@ AC_SUBST(PERL)
AC_PATH_PROGS(AWK, gawk awk)
AC_SUBST(AWK)
AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
[regenerate man pages [default=no]])], enable_man=$enableval, enable_man=no)
AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
[regenerate documentation using Docbook [default=no]])],
enable_generate_docs=$enableval, enable_generate_docs=no)
# Check for xsltproc
if test "x$enable_generate_docs" != xno ; then
AC_PATH_PROG([XSLTPROC], [xsltproc])
if test -z "$XSLTPROC"; then
AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
else
AC_MSG_CHECKING([if $XSLTPROC works])
# run xsltproc to see if works
$XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
if test $? -ne 0 ; then
AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
fi
$XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
if test $? -ne 0 ; then
AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
fi
AC_MSG_RESULT(yes)
fi
fi
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
AC_ARG_ENABLE(install-configurations,
[AC_HELP_STRING([--disable-install-configurations],
......@@ -1202,6 +1224,7 @@ AC_CONFIG_FILES([Makefile
tests/tools/badpacket/tests/Makefile
tests/tools/perfdhcp/Makefile
tests/tools/perfdhcp/tests/Makefile
tests/tools/perfdhcp/templates/Makefile
dns++.pc
])
AC_OUTPUT([doc/version.ent
......@@ -1377,7 +1400,7 @@ Developer:
C++ Code Coverage: $USE_LCOV
Python Code Coverage: $USE_PYCOVERAGE
Logger checks: $enable_logger_checks
Generate Manuals: $enable_man
Generate Documentation: $enable_generate_docs
END
......
/bind10-guide.html
/bind10-guide.txt
/bind10-messages.html
dist_doc_DATA = bind10-guide.txt
dist_html_DATA = bind10-guide.css bind10-guide.html bind10-messages.html
# generated documentation
HTMLDOCS = bind10-guide.html bind10-messages.html
DOCS = bind10-guide.txt
EXTRA_DIST = bind10-guide.xml bind10-messages.xml
dist_doc_DATA = $(DOCS)
dist_html_DATA = $(HTMLDOCS) bind10-guide.css
# This is not a "man" manual, but reuse this for now for docbook.
if ENABLE_MAN
EXTRA_DIST = bind10-guide.xml
DISTCLEANFILES = $(HTMLDOCS) $(DOCS) bind10-messages.xml
.PHONY: bind10-messages.xml
# This is not a "man" manual, but reuse this for now for docbook.
if GENERATE_DOCS
bind10-guide.html: bind10-guide.xml
xsltproc --novalid --xinclude --nonet \
@XSLTPROC@ --novalid --xinclude --nonet \
--path $(top_builddir)/doc \
-o $@ \
--stringparam section.autolabel 1 \
......@@ -21,18 +24,23 @@ bind10-guide.html: bind10-guide.xml
HTML2TXT = elinks -dump -no-numbering -no-references
bind10-guide.txt: bind10-guide.html
$(HTML2TXT) $(srcdir)/bind10-guide.html > $@
$(HTML2TXT) bind10-guide.html > $@
bind10-messages.html: bind10-messages.xml
xsltproc --novalid --xinclude --nonet \
@XSLTPROC@ --novalid --xinclude --nonet \
--path $(top_builddir)/doc \
-o $@ \
--stringparam html.stylesheet $(srcdir)/bind10-guide.css \
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
$(srcdir)/bind10-messages.xml
bind10-messages.xml
# So many dependencies that it's easiest just to regenerate it every time
bind10-messages.xml:
$(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir)
else
$(HTMLDOCS) $(DOCS):
@echo Doc generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it.
@echo Doc generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
endif
This diff is collapsed.
This diff is collapsed.
......@@ -785,7 +785,7 @@ as a dependency earlier -->
</chapter>
<chapter id="bind10">
<title>Starting BIND10 with <command>bind10</command></title>
<title>Starting BIND 10 with <command>bind10</command></title>
<para>
BIND 10 provides the <command>bind10</command> command which
starts up the required processes.
......@@ -1633,6 +1633,17 @@ can use various data source backends.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>tcp_recv_timeout</term>
<listitem>
<simpara>
<varname>tcp_recv_timeout</varname> is the timeout used on
incoming TCP connections, in milliseconds. If the query
is not sent within this time, the connection is closed.
Setting this to 0 will disable TCP timeouts completely.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......@@ -1735,7 +1746,7 @@ can use various data source backends.
<para>
Each data source has several options. The first one is
<varname>type</varname>, which specifies the type of data source to
use. Valid types include the ones listed below, but bind10 uses
use. Valid types include the ones listed below, but BIND 10 uses
dynamically loaded modules for them, so there may be more in your
case. This option is mandatory.
</para>
......@@ -1754,8 +1765,14 @@ can use various data source backends.
answering up. The first option is <varname>cache-enable</varname>,
a boolean value turning the cache on and off (off is the default).
The second one, <varname>cache-zones</varname>, is a list of zone
origins to load into in-memory. Remember that zones in the data source
not listed here will not be loaded and will not be available at all.
origins to load into in-memory.
<!-- NOT YET: http://bind10.isc.org/ticket/2240
Once the cache is enabled,
the zones in the data source not listed in
<varname>cache-zones</varname> will not be loaded and will
not be available at all.
-->
</para>
<section id='datasource-types'>
......@@ -1764,7 +1781,7 @@ can use various data source backends.
As mentioned, the type used by default is <quote>sqlite3</quote>.
It has single configuration option inside <varname>params</varname>
&mdash; <varname>database_file</varname>, which contains the path
to the sqlite3 file containing the data.
to the SQLite3 file containing the data.
</para>
<para>
......@@ -1781,7 +1798,7 @@ can use various data source backends.
<section id='datasrc-examples'>
<title>Examples</title>
<para>
As this is one of the more complex configurations of Bind10,
As this is one of the more complex configurations of BIND 10,
we show some examples. They all assume they start with default
configuration.
</para>
......@@ -1807,7 +1824,7 @@ can use various data source backends.
&gt; <userinput>config commit</userinput></screen>
Now every time the zone in the data source is changed by the
operator, Bind10 needs to be told to reload it, by
operator, the authoritative server needs to be told to reload it, by
<screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
You don't need to do this when the zone is modified by
XfrIn, it does so automatically.
......@@ -1815,7 +1832,7 @@ can use various data source backends.
<para>
Now, the last example is when there are master files we want to
serve in addition to whatever is inside the sqlite3 database.
serve in addition to whatever is inside the SQLite3 database.
<screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
&gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
......@@ -1844,7 +1861,7 @@ can use various data source backends.
<note>
<para>
There's also <varname>Auth/database_file</varname> configuration
variable, pointing to a sqlite3 database file. This is no longer
variable, pointing to a SQLite3 database file. This is no longer
used by <command>b10-auth</command>, but it is left in place for
now, since other modules use it. Once <command>b10-xfrin</command>,
<command>b10-xfrout</command> and <command>b10-ddns</command>
......@@ -2589,18 +2606,18 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
be deployed that facilitate communication between servers and
clients. Even though principles of both DHCPv4 and DHCPv6 are
somewhat similar, these are two radically different
protocols. BIND10 offers server implementations for both DHCPv4
protocols. BIND 10 offers server implementations for both DHCPv4
and DHCPv6. This chapter is about DHCP for IPv4. For a description
of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
<para>The DHCPv4 server component is currently under intense
development. You may want to check out <ulink
url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
and recent posts on <ulink
url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
developers mailing list</ulink>.</para>
<para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
<para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
internally code named <quote>Kea</quote>.</para>
<note>
......@@ -2618,7 +2635,7 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
<section id="dhcp4-usage">
<title>DHCPv4 Server Usage</title>
<para>BIND10 provides the DHCPv4 server component since December
<para>BIND 10 provides the DHCPv4 server component since December
2011. It is a skeleton server and can be described as an early
prototype that is not fully functional yet. It is mature enough
to conduct first tests in lab environment, but it has
......@@ -2627,9 +2644,9 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
</para>
<para>
<command>b10-dhcp4</command> is a BIND10 component and is being
run under BIND10 framework. To add a DHCPv4 process to the set of running
BIND10 services, you can use following commands in <command>bindctl</command>:
<command>b10-dhcp4</command> is a BIND 10 component and is being
run under BIND 10 framework. To add a DHCPv4 process to the set of running
BIND 10 services, you can use following commands in <command>bindctl</command>:
<screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
&gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
&gt; <userinput>config commit</userinput></screen></para>
......@@ -2779,19 +2796,19 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
<chapter id="dhcp6">
<title>DHCPv6 Server</title>
<para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
specified in RFC3315. BIND10 provides DHCPv6 server implementation
specified in RFC3315. BIND 10 provides DHCPv6 server implementation
that is described in this chapter. For a description of the DHCPv4
server implementation, see <xref linkend="dhcp4"/>.
</para>
<para>The DHCPv6 server component is currently under intense
development. You may want to check out <ulink
url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
and recent posts on <ulink
url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
developers mailing list</ulink>.</para>
<para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
<para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
internally code named <quote>Kea</quote>.</para>
<note>
......@@ -2810,7 +2827,7 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
<section id="dhcp6-usage">
<title>DHCPv6 Server Usage</title>
<para>
BIND10 provides the DHCPv6 server component since September
BIND 10 provides the DHCPv6 server component since September
2011. It is a skeleton server and can be described as an early
prototype that is not fully functional yet. It is mature
enough to conduct first tests in lab environment, but it has
......@@ -2819,9 +2836,9 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
</para>
<para>
<command>b10-dhcp6</command> is a BIND10 component and is being
run under BIND10 framework. To add a DHCPv6 process to the set of running
BIND10 services, you can use following commands in <command>bindctl</command>:
<command>b10-dhcp6</command> is a BIND 10 component and is being
run under BIND 10 framework. To add a DHCPv6 process to the set of running
BIND 10 services, you can use following commands in <command>bindctl</command>:
<screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput>
&gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput>
&gt; <userinput>config commit</userinput></screen>
......@@ -2988,7 +3005,7 @@ const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</screen>
<para>For non-Linux systems, there is currently stub
implementation provided. Interface manager detects loopback
interfaces only as their name (lo or lo0) can be easily predicted.
Please contact BIND10 development team if you are interested
Please contact the BIND 10 development team if you are interested
in running DHCP components on systems other than Linux.</para>
</section>
......
This diff is collapsed.
This diff is collapsed.
......@@ -5,3 +5,4 @@
/b10-auth
/spec_config.h
/spec_config.h.pre
/b10-auth.8
......@@ -20,12 +20,19 @@ CLEANFILES = *.gcno *.gcda auth.spec spec_config.h
CLEANFILES += auth_messages.h auth_messages.cc
man_MANS = b10-auth.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-auth.xml
if ENABLE_MAN
if GENERATE_DOCS
b10-auth.8: b10-auth.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml
@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml
else
$(man_MANS):
@echo Man generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it.
@echo Man generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
endif
......
......@@ -90,6 +90,11 @@
}
]
}
},
{ "item_name": "tcp_recv_timeout",
"item_type": "integer",
"item_optional": false,
"item_default": 5000
}
],
"commands": [
......
......@@ -116,6 +116,29 @@ private:
*/
AddrListPtr rollbackAddresses_;
};
/// \brief Configuration for TCP receive timeouts
class TCPRecvTimeoutConfig : public AuthConfigParser {
public:
TCPRecvTimeoutConfig(AuthSrv& server) : server_(server), timeout_(0)
{}
virtual void build(ConstElementPtr config) {
if (config->intValue() >= 0) {
timeout_ = config->intValue();
} else {
isc_throw(AuthConfigError, "tcp_recv_timeout must be 0 or higher");
}
}
virtual void commit() {
server_.setTCPRecvTimeout(timeout_);
}
private:
AuthSrv& server_;
size_t timeout_;
};
} // end of unnamed namespace
AuthConfigParser*
......@@ -147,6 +170,8 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id) {
// We need to return something. The VersionConfig is empty now,
// so we may abuse that one, as it is a short-term solution only.
return (new VersionConfig());
} else if (config_id == "tcp_recv_timeout") {
return (new TCPRecvTimeoutConfig(server));
} else {
isc_throw(AuthConfigError, "Unknown configuration identifier: " <<
config_id);
......
......@@ -114,6 +114,18 @@ private:
MessageRenderer& renderer_;
};
// Similar to Renderer holder, this is a very basic RAII-style class
// that calls clear(Message::PARSE) on the given Message upon destruction
class MessageHolder {
public:
MessageHolder(Message& message) : message_(message) {}
~MessageHolder() {
message_.clear(Message::PARSE);
}
private:
Message& message_;
};
// A helper container of socket session forwarder.
//
// This class provides a simple wrapper interface to SocketSessionForwarder
......@@ -344,6 +356,11 @@ public:
OutputBufferPtr buffer,
DNSServer* server) const
{
// Keep a holder on the message, so that it is automatically
// cleared if processMessage() is done
// This is not done in processMessage itself (which would be
// equivalent), to allow tests to inspect the message handling.
MessageHolder message_holder(*message);
server_->processMessage(io_message, *message, *buffer, server);
}
private:
......@@ -927,3 +944,8 @@ AuthSrv::getClientListClasses() const {
}
return (result);
}
void
AuthSrv::setTCPRecvTimeout(size_t timeout) {
dnss_->setTCPRecvTimeout(timeout);
}
......@@ -319,6 +319,16 @@ public:
/// has been set by setClientList.
std::vector<isc::dns::RRClass> getClientListClasses() const;
/// \brief Sets the timeout for incoming TCP connections
///
/// Incoming TCP connections that have not sent their data
/// withing this time are dropped.
///
/// \param timeout The timeout (in milliseconds). If se to
/// zero, no timeouts are used, and the connection will remain
/// open forever.
void setTCPRecvTimeout(size_t timeout);
private:
AuthSrvImpl* impl_;
isc::asiolink::SimpleCallback* checkin_;
......
'\" t
.\" Title: b10-auth
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: June 20, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-AUTH" "8" "June 20, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
b10-auth \- Authoritative DNS server
.SH "SYNOPSIS"
.HP \w'\fBb10\-auth\fR\ 'u
\fBb10\-auth\fR [\fB\-v\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-auth\fR
daemon provides the BIND 10 authoritative DNS server\&. Normally it is started by the
\fBbind10\fR(8)
boss process\&.
.PP
This daemon communicates with other BIND 10 components over a
\fBb10-msgq\fR(8)
C\-Channel connection\&. If this connection is not established,
\fBb10\-auth\fR
will exit\&.
It receives its configurations from
\fBb10-cfgmgr\fR(8)\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-v\fR
.RS 4
Enable verbose logging mode\&. This enables logging of diagnostic messages at the maximum debug level\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable settings are:
.PP
\fIdatabase_file\fR
defines the path to the SQLite3 zone file when using the sqlite datasource\&. The default is
/usr/local/var/bind10\-devel/zone\&.sqlite3\&.
.PP
\fIdatasources\fR
configures data sources\&. The list items include:
\fItype\fR
to define the required data source type (such as
\(lqmemory\(rq);
\fIclass\fR
to optionally select the class (it defaults to
\(lqIN\(rq); and
\fIzones\fR
to define the
\fIfile\fR
path name,
\fIorigin\fR
(default domain), and optional
\fIfiletype\fR\&. By default,
\fIzones\fR
is empty\&. For the in\-memory data source (i\&.e\&., the
\fItype\fR
is
\(lqmemory\(rq), the optional
\fIfiletype\fR
configuration item for
\fIzones\fR
can be specified so the in\-memory zone data can be built from another data source that is based on a database backend (in practice with current implementation, it would be an SQLite3 database file for the SQLite3 data source)\&. See the
BIND 10 Guide
for configuration details\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
Only the IN class is supported at this time\&. By default, the memory data source is disabled\&. Also, currently the zone file must be canonical such as generated by \fBnamed\-compilezone \-D\fR\&.
.sp .5v
.RE
.PP
\fIlisten_on\fR
is a list of addresses and ports for
\fBb10\-auth\fR
to listen on\&. The list items are the
\fIaddress\fR
string and
\fIport\fR
number\&. By default,
\fBb10\-auth\fR
listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&.
.PP
\fIstatistics\-interval\fR
is the timer interval in seconds for
\fBb10\-auth\fR
to share its statistics information to
\fBb10-stats\fR(8)\&. Statistics updates can be disabled by setting this to 0\&. The default is 60\&.
.PP
The configuration commands are:
.PP
\fBloadzone\fR
tells
\fBb10\-auth\fR
to load or reload a zone file\&. The arguments include:
\fIclass\fR
which optionally defines the class (it defaults to
\(lqIN\(rq);
\fIorigin\fR
is the domain name of the zone; and
\fIdatasrc\fR
optionally defines the type of datasource (it defaults to
\(lqmemory\(rq)\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp