2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

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
This commit is contained in:
Mukund Sivaraman
2012-09-17 17:47:13 +05:30
179 changed files with 7855 additions and 18460 deletions

View File

@@ -1,3 +1,28 @@
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 470. [func] naokikambe
The stats module now supports partial statistics updates. Each The stats module now supports partial statistics updates. Each
module can return only statistics data which have been updated since module can return only statistics data which have been updated since

View File

@@ -113,8 +113,12 @@ systest:
cd tests/system; \ cd tests/system; \
sh $(abs_srcdir)/tests/system/runall.sh 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: #### 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/README
EXTRA_DIST += ext/asio/asio.hpp EXTRA_DIST += ext/asio/asio.hpp
EXTRA_DIST += ext/asio/asio/basic_socket.hpp EXTRA_DIST += ext/asio/asio/basic_socket.hpp

View File

@@ -1027,10 +1027,32 @@ AC_SUBST(PERL)
AC_PATH_PROGS(AWK, gawk awk) AC_PATH_PROGS(AWK, gawk awk)
AC_SUBST(AWK) AC_SUBST(AWK)
AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man], AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
[regenerate man pages [default=no]])], enable_man=$enableval, enable_man=no) [regenerate documentation using Docbook [default=no]])],
enable_generate_docs=$enableval, enable_generate_docs=no)
AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno) # 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(GENERATE_DOCS, test x$enable_generate_docs != xno)
AC_ARG_ENABLE(install-configurations, AC_ARG_ENABLE(install-configurations,
[AC_HELP_STRING([--disable-install-configurations], [AC_HELP_STRING([--disable-install-configurations],
@@ -1202,6 +1224,7 @@ AC_CONFIG_FILES([Makefile
tests/tools/badpacket/tests/Makefile tests/tools/badpacket/tests/Makefile
tests/tools/perfdhcp/Makefile tests/tools/perfdhcp/Makefile
tests/tools/perfdhcp/tests/Makefile tests/tools/perfdhcp/tests/Makefile
tests/tools/perfdhcp/templates/Makefile
dns++.pc dns++.pc
]) ])
AC_OUTPUT([doc/version.ent AC_OUTPUT([doc/version.ent
@@ -1377,7 +1400,7 @@ Developer:
C++ Code Coverage: $USE_LCOV C++ Code Coverage: $USE_LCOV
Python Code Coverage: $USE_PYCOVERAGE Python Code Coverage: $USE_PYCOVERAGE
Logger checks: $enable_logger_checks Logger checks: $enable_logger_checks
Generate Manuals: $enable_man Generate Documentation: $enable_generate_docs
END END

3
doc/guide/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
/bind10-guide.html
/bind10-guide.txt
/bind10-messages.html

View File

@@ -1,15 +1,18 @@
dist_doc_DATA = bind10-guide.txt # generated documentation
dist_html_DATA = bind10-guide.css bind10-guide.html bind10-messages.html 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
EXTRA_DIST = bind10-guide.xml
DISTCLEANFILES = $(HTMLDOCS) $(DOCS) bind10-messages.xml
# This is not a "man" manual, but reuse this for now for docbook. # This is not a "man" manual, but reuse this for now for docbook.
if ENABLE_MAN if GENERATE_DOCS
.PHONY: bind10-messages.xml
bind10-guide.html: bind10-guide.xml bind10-guide.html: bind10-guide.xml
xsltproc --novalid --xinclude --nonet \ @XSLTPROC@ --novalid --xinclude --nonet \
--path $(top_builddir)/doc \ --path $(top_builddir)/doc \
-o $@ \ -o $@ \
--stringparam section.autolabel 1 \ --stringparam section.autolabel 1 \
@@ -21,18 +24,23 @@ bind10-guide.html: bind10-guide.xml
HTML2TXT = elinks -dump -no-numbering -no-references HTML2TXT = elinks -dump -no-numbering -no-references
bind10-guide.txt: bind10-guide.html bind10-guide.txt: bind10-guide.html
$(HTML2TXT) $(srcdir)/bind10-guide.html > $@ $(HTML2TXT) bind10-guide.html > $@
bind10-messages.html: bind10-messages.xml bind10-messages.html: bind10-messages.xml
xsltproc --novalid --xinclude --nonet \ @XSLTPROC@ --novalid --xinclude --nonet \
--path $(top_builddir)/doc \ --path $(top_builddir)/doc \
-o $@ \ -o $@ \
--stringparam html.stylesheet $(srcdir)/bind10-guide.css \ --stringparam html.stylesheet $(srcdir)/bind10-guide.css \
http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \ 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: bind10-messages.xml:
$(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir) $(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 endif

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -785,7 +785,7 @@ as a dependency earlier -->
</chapter> </chapter>
<chapter id="bind10"> <chapter id="bind10">
<title>Starting BIND10 with <command>bind10</command></title> <title>Starting BIND 10 with <command>bind10</command></title>
<para> <para>
BIND 10 provides the <command>bind10</command> command which BIND 10 provides the <command>bind10</command> command which
starts up the required processes. starts up the required processes.
@@ -1633,6 +1633,17 @@ can use various data source backends.
</simpara> </simpara>
</listitem> </listitem>
</varlistentry> </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> </variablelist>
</para> </para>
@@ -1735,7 +1746,7 @@ can use various data source backends.
<para> <para>
Each data source has several options. The first one is Each data source has several options. The first one is
<varname>type</varname>, which specifies the type of data source to <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 dynamically loaded modules for them, so there may be more in your
case. This option is mandatory. case. This option is mandatory.
</para> </para>
@@ -1754,8 +1765,14 @@ can use various data source backends.
answering up. The first option is <varname>cache-enable</varname>, answering up. The first option is <varname>cache-enable</varname>,
a boolean value turning the cache on and off (off is the default). 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 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 origins to load into in-memory.
not listed here will not be loaded and will not be available at all.
<!-- 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> </para>
<section id='datasource-types'> <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>. As mentioned, the type used by default is <quote>sqlite3</quote>.
It has single configuration option inside <varname>params</varname> It has single configuration option inside <varname>params</varname>
&mdash; <varname>database_file</varname>, which contains the path &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>
<para> <para>
@@ -1781,7 +1798,7 @@ can use various data source backends.
<section id='datasrc-examples'> <section id='datasrc-examples'>
<title>Examples</title> <title>Examples</title>
<para> <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 we show some examples. They all assume they start with default
configuration. configuration.
</para> </para>
@@ -1807,7 +1824,7 @@ can use various data source backends.
&gt; <userinput>config commit</userinput></screen> &gt; <userinput>config commit</userinput></screen>
Now every time the zone in the data source is changed by the 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> <screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
You don't need to do this when the zone is modified by You don't need to do this when the zone is modified by
XfrIn, it does so automatically. XfrIn, it does so automatically.
@@ -1815,7 +1832,7 @@ can use various data source backends.
<para> <para>
Now, the last example is when there are master files we want to 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> <screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
&gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput> &gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
@@ -1844,7 +1861,7 @@ can use various data source backends.
<note> <note>
<para> <para>
There's also <varname>Auth/database_file</varname> configuration 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 used by <command>b10-auth</command>, but it is left in place for
now, since other modules use it. Once <command>b10-xfrin</command>, now, since other modules use it. Once <command>b10-xfrin</command>,
<command>b10-xfrout</command> and <command>b10-ddns</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 be deployed that facilitate communication between servers and
clients. Even though principles of both DHCPv4 and DHCPv6 are clients. Even though principles of both DHCPv4 and DHCPv6 are
somewhat similar, these are two radically different 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 and DHCPv6. This chapter is about DHCP for IPv4. For a description
of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para> of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
<para>The DHCPv4 server component is currently under intense <para>The DHCPv4 server component is currently under intense
development. You may want to check out <ulink 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 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> 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> internally code named <quote>Kea</quote>.</para>
<note> <note>
@@ -2618,7 +2635,7 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
<section id="dhcp4-usage"> <section id="dhcp4-usage">
<title>DHCPv4 Server Usage</title> <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 2011. It is a skeleton server and can be described as an early
prototype that is not fully functional yet. It is mature enough prototype that is not fully functional yet. It is mature enough
to conduct first tests in lab environment, but it has 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>
<para> <para>
<command>b10-dhcp4</command> is a BIND10 component and is being <command>b10-dhcp4</command> is a BIND 10 component and is being
run under BIND10 framework. To add a DHCPv4 process to the set of running run under BIND 10 framework. To add a DHCPv4 process to the set of running
BIND10 services, you can use following commands in <command>bindctl</command>: BIND 10 services, you can use following commands in <command>bindctl</command>:
<screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput> <screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
&gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput> &gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
&gt; <userinput>config commit</userinput></screen></para> &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"> <chapter id="dhcp6">
<title>DHCPv6 Server</title> <title>DHCPv6 Server</title>
<para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is <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 that is described in this chapter. For a description of the DHCPv4
server implementation, see <xref linkend="dhcp4"/>. server implementation, see <xref linkend="dhcp4"/>.
</para> </para>
<para>The DHCPv6 server component is currently under intense <para>The DHCPv6 server component is currently under intense
development. You may want to check out <ulink 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 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> 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> internally code named <quote>Kea</quote>.</para>
<note> <note>
@@ -2810,7 +2827,7 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
<section id="dhcp6-usage"> <section id="dhcp6-usage">
<title>DHCPv6 Server Usage</title> <title>DHCPv6 Server Usage</title>
<para> <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 2011. It is a skeleton server and can be described as an early
prototype that is not fully functional yet. It is mature prototype that is not fully functional yet. It is mature
enough to conduct first tests in lab environment, but it has 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>
<para> <para>
<command>b10-dhcp6</command> is a BIND10 component and is being <command>b10-dhcp6</command> is a BIND 10 component and is being
run under BIND10 framework. To add a DHCPv6 process to the set of running run under BIND 10 framework. To add a DHCPv6 process to the set of running
BIND10 services, you can use following commands in <command>bindctl</command>: BIND 10 services, you can use following commands in <command>bindctl</command>:
<screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput> <screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput>
&gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput> &gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput>
&gt; <userinput>config commit</userinput></screen> &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 <para>For non-Linux systems, there is currently stub
implementation provided. Interface manager detects loopback implementation provided. Interface manager detects loopback
interfaces only as their name (lo or lo0) can be easily predicted. 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> in running DHCP components on systems other than Linux.</para>
</section> </section>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,3 +5,4 @@
/b10-auth /b10-auth
/spec_config.h /spec_config.h
/spec_config.h.pre /spec_config.h.pre
/b10-auth.8

View File

@@ -20,12 +20,19 @@ CLEANFILES = *.gcno *.gcda auth.spec spec_config.h
CLEANFILES += auth_messages.h auth_messages.cc CLEANFILES += auth_messages.h auth_messages.cc
man_MANS = b10-auth.8 man_MANS = b10-auth.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-auth.xml EXTRA_DIST = $(man_MANS) b10-auth.xml
if ENABLE_MAN if GENERATE_DOCS
b10-auth.8: b10-auth.xml 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 endif

View File

@@ -90,6 +90,11 @@
} }
] ]
} }
},
{ "item_name": "tcp_recv_timeout",
"item_type": "integer",
"item_optional": false,
"item_default": 5000
} }
], ],
"commands": [ "commands": [

View File

@@ -116,6 +116,29 @@ private:
*/ */
AddrListPtr rollbackAddresses_; 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 } // end of unnamed namespace
AuthConfigParser* AuthConfigParser*
@@ -147,6 +170,8 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id) {
// We need to return something. The VersionConfig is empty now, // We need to return something. The VersionConfig is empty now,
// so we may abuse that one, as it is a short-term solution only. // so we may abuse that one, as it is a short-term solution only.
return (new VersionConfig()); return (new VersionConfig());
} else if (config_id == "tcp_recv_timeout") {
return (new TCPRecvTimeoutConfig(server));
} else { } else {
isc_throw(AuthConfigError, "Unknown configuration identifier: " << isc_throw(AuthConfigError, "Unknown configuration identifier: " <<
config_id); config_id);

View File

@@ -114,6 +114,18 @@ private:
MessageRenderer& renderer_; 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. // A helper container of socket session forwarder.
// //
// This class provides a simple wrapper interface to SocketSessionForwarder // This class provides a simple wrapper interface to SocketSessionForwarder
@@ -344,6 +356,11 @@ public:
OutputBufferPtr buffer, OutputBufferPtr buffer,
DNSServer* server) const 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); server_->processMessage(io_message, *message, *buffer, server);
} }
private: private:
@@ -927,3 +944,8 @@ AuthSrv::getClientListClasses() const {
} }
return (result); return (result);
} }
void
AuthSrv::setTCPRecvTimeout(size_t timeout) {
dnss_->setTCPRecvTimeout(timeout);
}

View File

@@ -319,6 +319,16 @@ public:
/// has been set by setClientList. /// has been set by setClientList.
std::vector<isc::dns::RRClass> getClientListClasses() const; 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: private:
AuthSrvImpl* impl_; AuthSrvImpl* impl_;
isc::asiolink::SimpleCallback* checkin_; isc::asiolink::SimpleCallback* checkin_;

View File

@@ -1,213 +0,0 @@
'\" 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
In this development version, currently this only supports the IN class and the memory data source\&.
.sp .5v
.RE
.PP
\fBsendstats\fR
tells
\fBb10\-auth\fR
to send its statistics data to
\fBb10-stats\fR(8)
immediately\&.
.PP
\fBshutdown\fR
exits
\fBb10\-auth\fR\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.SH "STATISTICS DATA"
.PP
The statistics data collected by the
\fBb10\-stats\fR
daemon for
\(lqAuth\(rq
include:
.PP
queries\&.tcp
.RS 4
Total count of queries received by the
\fBb10\-auth\fR
server over TCP since startup\&.
.RE
.PP
queries\&.udp
.RS 4
Total count of queries received by the
\fBb10\-auth\fR
server over UDP since startup\&.
.RE
.SH "FILES"
.PP
/usr/local/var/bind10\-devel/zone\&.sqlite3
\(em Location for the SQLite3 zone database when
\fIdatabase_file\fR
configuration is not defined\&.
.SH "SEE ALSO"
.PP
\fBb10-cfgmgr\fR(8),
\fBb10-loadzone\fR(8),
\fBb10-msgq\fR(8),
\fBb10-stats\fR(8),
\fBb10-zonemgr\fR(8),
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-auth\fR
daemon was first coded in October 2009\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -152,6 +152,13 @@
The default is 60. The default is 60.
</para> </para>
<para>
<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.
</para>
<!-- TODO: formating --> <!-- TODO: formating -->
<para> <para>
The configuration commands are: The configuration commands are:

View File

@@ -210,7 +210,7 @@ public:
case ConfigurableClientList::ZONE_NOT_CACHED: case ConfigurableClientList::ZONE_NOT_CACHED:
isc_throw(AuthCommandError, "Zone " << origin << "/" << isc_throw(AuthCommandError, "Zone " << origin << "/" <<
zone_class << " is not served from memory, but " zone_class << " is not served from memory, but "
"direcly from the data source. It is not possible " "directly from the data source. It is not possible "
"to reload it into memory. Configure it to be cached " "to reload it into memory. Configure it to be cached "
"first."); "first.");
case ConfigurableClientList::CACHE_DISABLED: case ConfigurableClientList::CACHE_DISABLED:

View File

@@ -562,8 +562,7 @@ Query::reset() {
bool bool
Query::processDSAtChild() { Query::processDSAtChild() {
const ClientList::FindResult zresult = const ClientList::FindResult zresult = client_list_->find(*qname_, true);
client_list_->find(*qname_, true);
if (zresult.dsrc_client_ == NULL) { if (zresult.dsrc_client_ == NULL) {
return (false); return (false);

View File

@@ -104,10 +104,6 @@ protected:
} }
~AuthSrvTest() { ~AuthSrvTest() {
// Clear the message now; depending on the RTTI implementation,
// type information may be lost if the message is cleared
// automatically later, so as a precaution we do it now.
parse_message->clear(Message::PARSE);
server.destroyDDNSForwarder(); server.destroyDDNSForwarder();
} }
@@ -833,6 +829,9 @@ TEST_F(AuthSrvTest, builtInQueryViaDNSServer) {
response_obuffer->getData(), response_obuffer->getData(),
response_obuffer->getLength(), response_obuffer->getLength(),
&response_data[0], response_data.size()); &response_data[0], response_data.size());
// After it has been run, the message should be cleared
EXPECT_EQ(0, parse_message->getRRCount(Message::SECTION_QUESTION));
} }
// In the following tests we confirm the response data is rendered in // In the following tests we confirm the response data is rendered in

View File

@@ -36,7 +36,8 @@ TEST_F(AuthConfigSyntaxTest, inmemoryDefaultFileType) {
EXPECT_TRUE( EXPECT_TRUE(
mspec_.validateConfig( mspec_.validateConfig(
Element::fromJSON( Element::fromJSON(
"{\"listen_on\": [], \"datasources\": " "{\"tcp_recv_timeout\": 1000,"
" \"listen_on\": [], \"datasources\": "
" [{\"type\": \"memory\", \"class\": \"IN\", " " [{\"type\": \"memory\", \"class\": \"IN\", "
" \"zones\": [{\"origin\": \"example.com\"," " \"zones\": [{\"origin\": \"example.com\","
" \"file\": \"" " \"file\": \""
@@ -48,7 +49,8 @@ TEST_F(AuthConfigSyntaxTest, inmemorySQLite3Backend) {
EXPECT_TRUE( EXPECT_TRUE(
mspec_.validateConfig( mspec_.validateConfig(
Element::fromJSON( Element::fromJSON(
"{\"datasources\": " "{\"tcp_recv_timeout\": 1000,"
" \"datasources\": "
" [{\"type\": \"memory\"," " [{\"type\": \"memory\","
" \"zones\": [{\"origin\": \"example.com\"," " \"zones\": [{\"origin\": \"example.com\","
" \"file\": \"" " \"file\": \""
@@ -58,14 +60,30 @@ TEST_F(AuthConfigSyntaxTest, inmemorySQLite3Backend) {
TEST_F(AuthConfigSyntaxTest, badInmemoryFileType) { TEST_F(AuthConfigSyntaxTest, badInmemoryFileType) {
// filetype must be a string // filetype must be a string
EXPECT_FALSE( ASSERT_FALSE(
mspec_.validateConfig( mspec_.validateConfig(
Element::fromJSON( Element::fromJSON(
"{\"datasources\": " "{\"tcp_recv_timeout\": 1000,"
" \"datasources\": "
" [{\"type\": \"memory\"," " [{\"type\": \"memory\","
" \"zones\": [{\"origin\": \"example.com\"," " \"zones\": [{\"origin\": \"example.com\","
" \"file\": \"" " \"file\": \""
TEST_DATA_DIR "/example.zone\"," TEST_DATA_DIR "/example.zone\","
" \"filetype\": 42}]}]}"), false)); " \"filetype\": 42}]}]}"), false));
} }
TEST_F(AuthConfigSyntaxTest, badTCPRecvTimeout) {
// tcp_recv_timeout must be int
EXPECT_FALSE(
mspec_.validateConfig(
Element::fromJSON(
"{\"tcp_recv_timeout\": \"foo\","
" \"datasources\": "
" [{\"type\": \"memory\","
" \"zones\": [{\"origin\": \"example.com\","
" \"file\": \""
TEST_DATA_DIR "/example.zone\","
" \"filetype\": \"sqlite3\"}]}]}"), false));
}
} }

View File

@@ -143,4 +143,17 @@ TEST_F(AuthConfigTest, listenAddressConfig) {
EXPECT_EQ(DNSService::SERVER_SYNC_OK, dnss_.getUDPFdParams().at(1).options); EXPECT_EQ(DNSService::SERVER_SYNC_OK, dnss_.getUDPFdParams().at(1).options);
} }
// Try setting tcp receive timeout through config
TEST_F(AuthConfigTest, tcpRecvTimeoutConfig) {
configureAuthServer(server, Element::fromJSON(
"{ \"tcp_recv_timeout\": 123 }"));
EXPECT_EQ(123, dnss_.getTCPRecvTimeout());
configureAuthServer(server, Element::fromJSON(
"{ \"tcp_recv_timeout\": 2000 }"));
EXPECT_EQ(2000, dnss_.getTCPRecvTimeout());
EXPECT_THROW(configureAuthServer(server, Element::fromJSON(
"{ \"tcp_recv_timeout\": -123 }")),
AuthConfigError);
}
} }

View File

@@ -1,3 +1,4 @@
/bind10 /bind10
/bind10_src.py /bind10_src.py
/run_bind10.sh /run_bind10.sh
/bind10.8

View File

@@ -17,12 +17,26 @@ bind10_DATA = bob.spec
EXTRA_DIST = bob.spec EXTRA_DIST = bob.spec
man_MANS = bind10.8 man_MANS = bind10.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST += $(man_MANS) bind10.xml bind10_messages.mes EXTRA_DIST += $(man_MANS) bind10.xml bind10_messages.mes
if ENABLE_MAN if GENERATE_DOCS
bind10.8: bind10.xml bind10.8: bind10.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml
#dist-local-check-mans-enabled:
# @if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi
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 > $@
#dist-local-check-mans-enabled:
# @echo "*** --enable-generate-docs must be used in order to make dist"
# @false
endif endif

View File

@@ -1,288 +0,0 @@
'\" t
.\" Title: bind10
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: April 12, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "BIND10" "8" "April 12, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
bind10 \- BIND 10 boss process
.SH "SYNOPSIS"
.HP \w'\fBbind10\fR\ 'u
\fBbind10\fR [\fB\-c\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-i\fR] [\fB\-m\ \fR\fB\fIfile\fR\fR] [\fB\-p\ \fR\fB\fIdata_path\fR\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-v\fR] [\fB\-w\ \fR\fB\fIwait_time\fR\fR] [\fB\-\-clear\-config\fR] [\fB\-\-cmdctl\-port\fR\ \fIport\fR] [\fB\-\-config\-file\fR\ \fIconfig\-filename\fR] [\fB\-\-data\-path\fR\ \fIdirectory\fR] [\fB\-\-msgq\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-no\-kill\fR] [\fB\-\-pid\-file\fR\ \fIfilename\fR] [\fB\-\-pretty\-name\ \fR\fB\fIname\fR\fR] [\fB\-\-user\ \fR\fB\fIuser\fR\fR] [\fB\-\-verbose\fR] [\fB\-\-wait\ \fR\fB\fIwait_time\fR\fR]
.SH "DESCRIPTION"
.PP
The
\fBbind10\fR
daemon starts up other BIND 10 required daemons\&. It handles restarting of exiting programs and also the shutdown of all managed daemons\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-c\fR \fIconfig\-filename\fR, \fB\-\-config\-file\fR \fIconfig\-filename\fR
.RS 4
The configuration filename to use\&. Can be either absolute or relative to data path\&. In case it is absolute, value of data path is not considered\&. Defaults to
b10\-config\&.db\&.
.RE
.PP
\fB\-\-clear\-config\fR
.RS 4
This will create a backup of the existing configuration file, remove it and start
b10\-cfgmgr(8)
with the default configuration\&. The name of the backup file can be found in the logs (\fICFGMGR_BACKED_UP_CONFIG_FILE\fR)\&. (It will append a number to the backup filename if a previous backup file exists\&.)
.RE
.PP
\fB\-\-cmdctl\-port\fR \fIport\fR
.RS 4
The
\fBb10\-cmdctl\fR
daemon will listen on this port\&. (See
b10\-cmdctl(8)
for the default\&.)
.RE
.PP
\fB\-p\fR \fIdirectory\fR, \fB\-\-data\-path\fR \fIdirectory\fR
.RS 4
The path where BIND 10 programs look for various data files\&. Currently only
\fBb10-cfgmgr\fR(8)
uses it to locate the configuration file, but the usage might be extended for other programs and other types of files\&.
.RE
.PP
\fB\-m\fR \fIfile\fR, \fB\-\-msgq\-socket\-file\fR \fIfile\fR
.RS 4
The UNIX domain socket file for the
\fBb10-msgq\fR(8)
daemon to use\&. The default is
/usr/local/var/bind10\-devel/msg_socket\&.
.RE
.PP
\fB\-i\fR, \fB\-\-no\-kill\fR
.RS 4
When this option is passed,
\fBbind10\fR
does not send SIGTERM and SIGKILL signals to modules during shutdown\&. (This option was introduced for use during testing\&.)
.RE
.PP
\fB\-u\fR \fIuser\fR, \fB\-\-user\fR \fIname\fR
.RS 4
The username for
\fBbind10\fR
to run as\&.
\fBbind10\fR
must be initially ran as the root user to use this option\&. The default is to run as the current user\&.
.RE
.PP
\fB\-\-pid\-file\fR \fIfilename\fR
.RS 4
If defined, the PID of the
\fBbind10\fR
is stored in this file\&.
.RE
.PP
\fB\-\-pretty\-name \fR\fB\fIname\fR\fR
.RS 4
The name this process should have in tools like
\fBps\fR
or
\fBtop\fR\&. This is handy if you have multiple versions/installations of
\fBbind10\fR\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Display more about what is going on for
\fBbind10\fR
and its child processes\&.
.RE
.PP
\fB\-w\fR \fIwait_time\fR, \fB\-\-wait\fR \fIwait_time\fR
.RS 4
Sets the amount of time that BIND 10 will wait for the configuration manager (a key component of BIND 10) to initialize itself before abandoning the start up and terminating with an error\&. The
\fIwait_time\fR
is specified in seconds and has a default value of 10\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configuration provides settings for components for
\fBbind10\fR
to manage under
\fI/Boss/components/\fR\&. The default elements are:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fI/Boss/components/b10\-cmdctl\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fI/Boss/components/b10\-stats\fR
.RE
.PP
(Note that the startup of
\fBb10\-sockcreator\fR,
\fBb10\-cfgmgr\fR, and
\fBb10\-msgq\fR
is not configurable\&. They are hardcoded and
\fBbind10\fR
will not run without them\&.)
.PP
The named sets for components contain the following settings:
.PP
\fIaddress\fR
.RS 4
The name used for communicating to it on the message bus\&.
.RE
.PP
\fIkind\fR
.RS 4
This defines how required a component is\&. The possible settings for
\fIkind\fR
are:
\fIcore\fR
(system won\*(Aqt start if it won\*(Aqt start and
\fBbind10\fR
will shutdown if a
\(lqcore\(rq
component crashes),
\fIdispensable\fR
(\fBbind10\fR
will restart failing component), and
\fIneeded\fR
(\fBbind10\fR
will shutdown if component won\*(Aqt initially start, but if crashes later, it will attempt to restart)\&. This setting is required\&.
.RE
.PP
\fIpriority\fR
.RS 4
This is an integer\&.
\fBbind10\fR
will start the components with largest priority numbers first\&.
.RE
.PP
\fIprocess\fR
.RS 4
This is the filename of the executable to be started\&. If not defined, then
\fBbind10\fR
will use the component name instead\&.
.RE
.PP
\fIspecial\fR
.RS 4
This defines if the component is started a special, hardcoded way\&.
.RE
.PP
The
\fIBoss\fR
configuration commands are:
.PP
\fBgetstats\fR
tells
\fBbind10\fR
to send its statistics data to the
\fBb10\-stats\fR
daemon\&. This is an internal command and not exposed to the administrator\&.
.PP
\fBping\fR
is used to check the connection with the
\fBbind10\fR
daemon\&. It returns the text
\(lqpong\(rq\&.
.PP
\fBshow_processes\fR
lists the current processes managed by
\fBbind10\fR\&. The output is an array in JSON format containing the process ID, the name for each and the address name used on each message bus\&.
.PP
\fBshutdown\fR
tells
\fBbind10\fR
to shutdown the BIND 10 servers\&. It will tell each process it manages to shutdown and, when complete,
\fBbind10\fR
will exit\&.
.SH "STATISTICS DATA"
.PP
The statistics data collected by the
\fBb10\-stats\fR
daemon for
\(lqBoss\(rq
include:
.PP
boot_time
.RS 4
The date and time that the
\fBbind10\fR
process started\&. This is represented in ISO 8601 format\&.
.RE
.SH "FILES"
.PP
sockcreator\-XXXXXX/sockcreator
\(em the Unix Domain socket located in a temporary file directory for
\fBb10\-sockcreator\fR
communication\&.
.SH "SEE ALSO"
.PP
\fBbindctl\fR(1),
\fBb10-auth\fR(8),
\fBb10-cfgmgr\fR(8),
\fBb10-cmdctl\fR(8),
\fBb10-msgq\fR(8),
\fBb10-xfrin\fR(8),
\fBb10-xfrout\fR(8),
\fBb10-zonemgr\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The development of
\fBbind10\fR
was started in October 2009\&.
.SH "AUTHORS"
.PP
The
\fBbind10\fR
daemon was initially designed by Shane Kerr of ISC\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/bindctl /bindctl
/bindctl_main.py /bindctl_main.py
/run_bindctl.sh /run_bindctl.sh
/bindctl.1

View File

@@ -14,11 +14,18 @@ pythondir = $(pyexecdir)/bindctl
bindctldir = $(pkgdatadir) bindctldir = $(pkgdatadir)
CLEANFILES = bindctl bindctl_main.pyc CLEANFILES = bindctl bindctl_main.pyc
DISTCLEANFILES = $(man_MANS)
if ENABLE_MAN if GENERATE_DOCS
bindctl.1: bindctl.xml bindctl.1: bindctl.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.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 endif

View File

@@ -1,157 +0,0 @@
'\" t
.\" Title: bindctl
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: June 20, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "BINDCTL" "1" "June 20, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
bindctl \- control and configure BIND 10
.SH "SYNOPSIS"
.HP \w'\fBbindctl\fR\ 'u
\fBbindctl\fR [\fB\-a\ \fR\fB\fIaddress\fR\fR] [\fB\-h\fR] [\fB\-c\ \fR\fB\fIfile\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-\-address\ \fR\fB\fIaddress\fR\fR] [\fB\-\-help\fR] [\fB\-\-certificate\-chain\ \fR\fB\fIfile\fR\fR] [\fB\-\-csv\-file\-dir\fR\fB\fIfile\fR\fR] [\fB\-\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-version\fR]
.SH "DESCRIPTION"
.PP
The
\fBbindctl\fR
tool is a user interface to the BIND 10 services\&. The program can be used to control the components and configure the BIND 10 options\&. The options may be specified
via its interactive command interpreter\&.
.PP
\fBbindctl\fR
communicates over a HTTPS REST\-ful interface provided by
\fBb10-cmdctl\fR(8)\&. The
\fBb10-cfgmgr\fR(8)
daemon stores the configurations\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-a\fR \fIaddress\fR, \fB\-\-address\fR \fIaddress\fR
.RS 4
The IPv4 or IPv6 address to use to connect to the running
\fBb10-cmdctl\fR(8)
daemon\&. The default is 127\&.0\&.0\&.1\&.
.RE
.PP
\fB\-c\fR \fIfile\fR, \fB\-\-certificate\-chain\fR \fIfile\fR
.RS 4
The PEM formatted server certificate validation chain file\&.
.RE
.PP
\fB\-\-csv\-file\-dir\fR\fIfile\fR
.RS 4
The directory name in which the user/password CSV file is stored (see AUTHENTICATION)\&. By default this option doesn\*(Aqt have any value, in which case the "\&.bind10" directory under the user\*(Aqs home directory will be used\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Display command usage\&.
.RE
.PP
\fB\-p\fR \fInumber\fR, \fB\-\-port\fR \fInumber\fR
.RS 4
The port number to use to connect to the running
\fBb10-cmdctl\fR(8)
daemon\&. The default is 8080\&.
.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
This default port number may change\&.
.sp .5v
.RE
.RE
.PP
\fB\-\-version\fR
.RS 4
Display the version number and exit\&.
.RE
.SH "AUTHENTICATION"
.PP
The tool will authenticate using a username and password\&. On the first successful login, it will save the details to a comma\-separated\-value (CSV) file which will be used for later uses of
\fBbindctl\fR\&. The file name is "default_user\&.csv" located under the directory specified by the
\fB\-\-csv\-file\-dir\fR
option\&.
.SH "USAGE"
.PP
The
\fBbindctl\fR
prompt shows
\(lq> \(rq\&. The prompt will also display the location if changed\&. The options are based on the module in use\&. The usage is:
\fBmodule\fR
\fBcommand\fR
\fIparam1 = value1 , \fR\fI\fIparam2 = value2\fR\fR
.PP
\fBbindctl\fR\*(Aqs interactive interface provides command\-line completion and hints\&. Press the Tab key to get a hint for the module, command, and/or parameters\&.
The arrow keys and Emacs\-style editing keys may be used to edit and recall previous lines\&.
.PP
You can use the
\fBhelp\fR
keyword to receive usage assistance for a module or a module\*(Aqs command\&.
.PP
The
\fBquit\fR
command is used to exit
\fBbindctl\fR\&. (It doesn\*(Aqt stop the BIND 10 services\&.)
.PP
The following module is available by default:
\fBconfig\fR
for Configuration commands\&.
Additional modules may be available, such as
\fBBoss\fR,
\fBXfrin\fR, and
\fBAuth\fR\&.
.SH "SEE ALSO"
.PP
\fBb10-auth\fR(8),
\fBb10-cfgmgr\fR(8),
\fBb10-cmdctl\fR(8),
\fBb10-xfrin\fR(8),
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "AUTHORS"
.PP
The
\fBbindctl\fR
tool and library were initially coded by Zhang Likun of CNNIC for the BIND 10 project\&. The initial manual page was written by Jeremy C\&. Reed of ISC\&.
.SH "HISTORY"
.PP
The initial version (with internal name of
\fBBigTool\fR) was started in October 2009\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,2 +1,3 @@
/b10-cfgmgr /b10-cfgmgr
/b10-cfgmgr.py /b10-cfgmgr.py
/b10-cfgmgr.8

View File

@@ -10,12 +10,19 @@ b10_cfgmgrdir = @localstatedir@/@PACKAGE@
#B10_cfgmgr_DATA = #B10_cfgmgr_DATA =
man_MANS = b10-cfgmgr.8 man_MANS = b10-cfgmgr.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-cfgmgr.xml EXTRA_DIST = $(man_MANS) b10-cfgmgr.xml
if ENABLE_MAN if GENERATE_DOCS
b10-cfgmgr.8: b10-cfgmgr.xml b10-cfgmgr.8: b10-cfgmgr.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.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 endif

View File

@@ -1,82 +0,0 @@
'\" t
.\" Title: b10-cfgmgr
.\" 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\-CFGMGR" "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-cfgmgr \- Configuration manager
.SH "SYNOPSIS"
.HP \w'\fBb10\-cfgmgr\fR\ 'u
\fBb10\-cfgmgr\fR [\fB\-c\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-p\ \fR\fB\fIdata_path\fR\fR] [\fB\-\-clear\-config\fR] [\fB\-\-config\-filename\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-\-data\-path\ \fR\fB\fIdata_path\fR\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-cfgmgr\fR
daemon handles all BIND 10 system configuration\&. It provides persistent storage for configuration, and notifies running BIND 10 modules of configuration changes\&.
.PP
The
\fBbindctl\fR
can be used to talk to this configuration manager via a
\fBb10\-cmdctl\fR
connection\&.
.PP
This daemon communicates over a
\fBb10\-msgq\fR
C\-Channel connection\&. If this connection is not established,
\fBb10\-cfgmgr\fR
will exit\&.
.PP
The daemon may be cleanly stopped by sending the SIGTERM signal to the process\&. This shutdown does not notify the subscribers\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-\-clear\-config\fR
.RS 4
This will create a backup of the existing configuration file, remove it, and
b10\-cfgmgr(8)
will use the default configurations\&. The name of the backup file can be found in the logs (\fICFGMGR_BACKED_UP_CONFIG_FILE\fR)\&. (It will append a number to the backup filename if a previous backup file exists\&.)
.RE
.PP
\fB\-c\fR \fIconfig\-filename\fR, \fB\-\-config\-filename\fR \fIconfig\-filename\fR
.RS 4
The configuration database filename to use\&. Can be either absolute or relative to data path\&. It defaults to "b10\-config\&.db"\&.
.RE
.PP
\fB\-p\fR \fIdata\-path\fR, \fB\-\-data\-path\fR \fIdata\-path\fR
.RS 4
The path where BIND 10 looks for files\&. The configuration file is looked for here, if it is relative\&. If it is absolute, the path is ignored\&.
.RE
.SH "FILES"
.PP
/usr/local/var/bind10\-devel/b10\-config\&.db
\(em Configuration storage file\&.
.SH "SEE ALSO"
.PP
\fBbind10\fR(8),
\fBmsgq\fR(8)\&.
.SH "HISTORY"
.PP
The
\fBb10\-cfgmgr\fR
daemon and configuration specification were initially designed by Jelte Jansen of ISC\&. Its development began in October 2009\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -3,3 +3,4 @@
/cmdctl.spec /cmdctl.spec
/cmdctl.spec.pre /cmdctl.spec.pre
/run_b10-cmdctl.sh /run_b10-cmdctl.sh
/b10-cmdctl.8

View File

@@ -26,12 +26,19 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.py
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.pyc
man_MANS = b10-cmdctl.8 man_MANS = b10-cmdctl.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST += $(man_MANS) b10-cmdctl.xml cmdctl_messages.mes EXTRA_DIST += $(man_MANS) b10-cmdctl.xml cmdctl_messages.mes
if ENABLE_MAN if GENERATE_DOCS
b10-cmdctl.8: b10-cmdctl.xml b10-cmdctl.8: b10-cmdctl.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.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 endif

View File

@@ -1,133 +0,0 @@
'\" t
.\" Title: b10-cmdctl
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: February 28, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-CMDCTL" "8" "February 28, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
b10-cmdctl \- BIND 10 remote control daemon
.SH "SYNOPSIS"
.HP \w'\fBb10\-cmdctl\fR\ 'u
\fBb10\-cmdctl\fR [\fB\-a\ \fR\fB\fIstring\fR\fR] [\fB\-h\fR] [\fB\-i\ \fR\fB\fInumber\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR] [\fB\-\-address\ \fR\fB\fIstring\fR\fR] [\fB\-\-help\fR] [\fB\-\-idle\-timeout\ \fR\fB\fInumber\fR\fR] [\fB\-\-port\ \fR\fB\fInumber\fR\fR] [\fB\-\-verbose\fR] [\fB\-\-version\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-cmdctl\fR
daemon provides an entry for commands sent to the BIND 10 services\&. For example, the
\fBbindctl\fR
user interface communicates via
\fBb10\-cmdctl\fR\&.
.PP
It is a lightweight HTTPS server with HTTP Digest Authentication (username and password validation)\&. It offers a RESTful style interface\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-a \fR\fB\fIstring\fR\fR, \fB\-\-address \fR\fB\fIstring\fR\fR
.RS 4
The IP address that
\fBb10\-cmdctl\fR
will listen on\&. The default is 127\&.0\&.0\&.1\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Display command usage\&.
.RE
.PP
\fB\-i \fR\fB\fInumber\fR\fR, \fB\-\-idle\-timeout \fR\fB\fInumber\fR\fR
.RS 4
The socket idle timeout for the HTTPS connection in seconds\&. The default is 1200 seconds\&.
.RE
.PP
\fB\-p \fR\fB\fInumber\fR\fR, \fB\-\-port \fR\fB\fInumber\fR\fR
.RS 4
The port number
\fBb10\-cmdctl\fR
will listen on\&. The default is 8080\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Enable verbose mode\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Display the version number and exit\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable settings are:
.PP
\fIaccounts_file\fR
defines the path to the user accounts database\&. The default is
/usr/local/etc/bind10\-devel/cmdctl\-accounts\&.csv\&.
.PP
\fIcert_file\fR
defines the path to the PEM certificate file\&. The default is
/usr/local/etc/bind10\-devel/cmdctl\-certfile\&.pem\&.
.PP
\fIkey_file\fR
defines the path to the PEM private key file\&. The default is
/usr/local/etc/bind10\-devel/cmdctl\-keyfile\&.pem\&.
.PP
The configuration command is:
.PP
\fBshutdown\fR
exits
\fBb10\-cmdctl\fR\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.SH "FILES"
.PP
/usr/local/etc/bind10\-devel/cmdctl\-accounts\&.csv
\(em account database containing the name, hashed password, and the salt\&.
.PP
/usr/local/etc/bind10\-devel/cmdctl\-keyfile\&.pem
\(em contains the Private key\&.
.PP
/usr/local/etc/bind10\-devel/cmdctl\-certfile\&.pem
\(em contains the Certificate\&.
.SH "SEE ALSO"
.PP
\fBb10-cfgmgr\fR(8),
\fBbind10\fR(8),
\fBbindctl\fR(1)\&.
.SH "AUTHORS"
.PP
The
\fBb10\-cmdctl\fR
daemon was initially designed and coded by Zhang Likun of CNNIC\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/b10-dbutil /b10-dbutil
/dbutil.py /dbutil.py
/run_dbutil.sh /run_dbutil.sh
/b10-dbutil.8

View File

@@ -14,11 +14,18 @@ CLEANFILES = b10-dbutil b10-dbutil.pyc
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.py CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.py
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyc
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyo CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyo
DISTCLEANFILES = $(man_MANS)
if ENABLE_MAN if GENERATE_DOCS
b10-dbutil.8: b10-dbutil.xml b10-dbutil.8: b10-dbutil.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.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 endif

View File

@@ -1,89 +0,0 @@
'\" t
.\" Title: b10-dbutil
.\" 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\-DBUTIL" "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-dbutil \- Zone Database Maintenance Utility
.SH "SYNOPSIS"
.HP \w'\fBb10\-dbutil\ \-\-check\fR\ 'u
\fBb10\-dbutil \-\-check\fR [\-\-verbose] [\-\-quiet] [\fIdbfile\fR]
.HP \w'\fBb10\-dbutil\ \-\-upgrade\fR\ 'u
\fBb10\-dbutil \-\-upgrade\fR [\-\-noconfirm] [\-\-verbose] [\-\-quiet] [\fIdbfile\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-dbutil\fR
utility is a general administration utility for SQL databases for BIND 10\&. (Currently only SQLite is supported by BIND 10\&.) It can report the current verion of the schema, and upgrade an existing database to the latest version of the schema\&.
.PP
\fBb10\-dbutil\fR
operates in one of two modesr: check mode or upgrade mode\&.
.PP
In check mode (\fBb10\-dbutil \-\-check\fR), the utility reads the version of the database schema from the database and prints it\&. It will tell you whether the schema is at the latest version supported by BIND 10\&. Exit status is 0 if the schema is at the correct version, 1 if the schema is at an older version, or 2 if the schema is at a version not yet supported by this version of
\fBb10\-dbutil\fR\&. Any higher value indicates an error during command\-line parsing or execution\&.
.PP
When the upgrade function is selected (\fBb10\-dbutil \-\-upgrade\fR), the utility takes a copy of the database, then upgrades it to the latest version of the schema\&. The contents of the database remain intact\&. (The backup file is a file in the same directory as the database file\&. It has the same name, with "\&.backup" appended to it\&. If a file of that name already exists, the file will have the suffix "\&.backup\-1"\&. If that exists, the file will be suffixed "\&.backup\-2", and so on)\&. Exit status is 0 if the upgrade is either succesful or aborted by the user, and non\-zero if there is an error\&.
.PP
When upgrading the database, it is
\fIstrongly\fR
recommended that BIND 10 not be running while the upgrade is in progress\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-\-check\fR
.RS 4
Selects the version check function, which reports the current version of the database\&. This is mutually exclusive with the
\fB\-\-upgrade\fR
option\&.
.RE
.PP
\fB\-\-noconfirm\fR
.RS 4
Only valid with
\fB\-\-upgrade\fR, this disables the prompt\&. Normally the utility will print a warning that an upgrade is about to take place and request that you type "Yes" to continue\&. If this switch is given on the command line, no prompt will be issued and the utility will just perform the upgrade\&.
.RE
.PP
\fB\-\-upgrade\fR
.RS 4
Selects the upgrade function, which upgrades the database to the latest version of the schema\&. This is mutually exclusive with the
\fB\-\-check\fR
option\&.
.sp
The upgrade function will upgrade a BIND 10 database \(em no matter how old the schema \(em preserving all data\&. A backup file is created before the upgrade (with the same name as the database, but with "\&.backup" suffixed to it)\&. If the upgrade fails, this file can be copied back to restore the original database\&.
.RE
.PP
\fB\-\-verbose\fR
.RS 4
Enable verbose mode\&. Each SQL command issued by the utility will be printed to STDERR before it is executed\&.
.RE
.PP
\fB\-\-quiet\fR
.RS 4
Enable quiet mode\&. No output is printed, except errors during command\-line argument parsing, or the user confirmation dialog\&.
.RE
.PP
\fB\fIdbfile\fR\fR
.RS 4
Name of the database file to check or upgrade\&.
.RE
.SH "COPYRIGHT"
.br
Copyright \(co 2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,2 +1,3 @@
/b10-ddns /b10-ddns
/ddns.py /ddns.py
/b10-ddns.8

View File

@@ -15,13 +15,21 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.py
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.pyc
EXTRA_DIST = ddns_messages.mes ddns.spec EXTRA_DIST = ddns_messages.mes ddns.spec
man_MANS = b10-ddns.8 man_MANS = b10-ddns.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST += $(man_MANS) b10-ddns.xml EXTRA_DIST += $(man_MANS) b10-ddns.xml
if ENABLE_MAN if GENERATE_DOCS
b10-ddns.8: b10-ddns.xml b10-ddns.8: b10-ddns.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.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 endif

View File

@@ -1,115 +0,0 @@
'\" t
.\" Title: b10-ddns
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: June 18, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-DDNS" "8" "June 18, 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-ddns \- Dynamic DNS update service
.SH "SYNOPSIS"
.HP \w'\fBb10\-ddns\fR\ 'u
\fBb10\-ddns\fR [\fB\-v\fR | \fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-ddns\fR
daemon provides the BIND 10 Dynamic Update (DDNS) service, as specified in RFC 2136\&. Normally it is started by the
\fBbind10\fR(8)
boss process\&.
.PP
When the
\fBb10\-auth\fR
authoritative DNS server receives an UPDATE request, it internally forwards the request to
\fBb10\-ddns\fR, which handles the rest of the request processing\&. When the processing is completed
\fBb10\-ddns\fR
will send a response to the client with the RCODE set to the value as specified in RFC 2136\&. If the zone has been changed as a result, it will internally notify
\fBb10\-auth\fR
and
\fBb10\-xfrout\fR
so the new version of the zone will be served, and other secondary servers will be notified via the DNS notify protocol\&.
.PP
This daemon communicates with BIND 10 over a
\fBb10-msgq\fR(8)
C\-Channel connection\&. If this connection is not established,
\fBb10\-ddns\fR
will exit\&. The
\fBb10\-ddns\fR
daemon also depends on some other BIND 10 components (either directly or indirectly):
\fBb10-auth\fR(8),
\fBb10-xfrout\fR(8), and
\fBb10-zonemgr\fR(8)\&.
.PP
\fBb10\-ddns\fR
receives its configurations from
\fBb10-cfgmgr\fR(8)\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print the command line arguments and exit\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
This value is ignored at this moment, but is provided for compatibility with the
\fBbind10\fR
Boss process\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable settings are:
.PP
\fIzones\fR
The zones option is a list of configuration items for specific zones that can be updated with DDNS\&. Each entry is a map that can contain the following items:
\fIorigin\fR
is a textual domain name of the zone;
\fIclass\fR
(text) is the RR class of the zone; and
\fIupdate_acl\fR
is an ACL that controls permission for updates\&. See the BIND 10 Guide for configuration details\&. Note that not listing a zone in this list does not directly mean update requests for the zone are rejected, but the end result is the same because the default ACL for updates is to deny all requests\&.
.PP
The module commands are:
.PP
\fBshutdown\fR
exits
\fBb10\-ddns\fR\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.SH "SEE ALSO"
.PP
\fBb10-auth\fR(8),
\fBb10-cfgmgr\fR(8),
\fBb10-msgq\fR(8),
\fBb10-xfrout\fR(8),
\fBb10-zonemgr\fR(8),
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-ddns\fR
daemon was first implemented in December 2011 for the ISC BIND 10 project\&. The first functional version was released in June 2012\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2011-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/b10-dhcp4 /b10-dhcp4
/spec_config.h /spec_config.h
/spec_config.h.pre /spec_config.h.pre
/b10-dhcp4.8

View File

@@ -12,26 +12,43 @@ endif
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@
CLEANFILES = spec_config.h CLEANFILES = *.gcno *.gcda spec_config.h dhcp4_messages.h dhcp4_messages.cc
man_MANS = b10-dhcp4.8 man_MANS = b10-dhcp4.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-dhcp4.xml dhcp4.spec EXTRA_DIST = $(man_MANS) b10-dhcp4.xml dhcp4.spec
if ENABLE_MAN if GENERATE_DOCS
b10-dhcp4.8: b10-dhcp4.xml b10-dhcp4.8: b10-dhcp4.xml
xsltproc --novalid --xinclude --nonet -o $@ \ @XSLTPROC@ --novalid --xinclude --nonet -o $@ \
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \
$(srcdir)/b10-dhcp4.xml $(srcdir)/b10-dhcp4.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 endif
spec_config.h: spec_config.h.pre spec_config.h: spec_config.h.pre
$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@
BUILT_SOURCES = spec_config.h dhcp4_messages.h dhcp4_messages.cc: dhcp4_messages.mes
$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp4/dhcp4_messages.mes
BUILT_SOURCES = spec_config.h dhcp4_messages.h dhcp4_messages.cc
pkglibexec_PROGRAMS = b10-dhcp4 pkglibexec_PROGRAMS = b10-dhcp4
b10_dhcp4_SOURCES = main.cc dhcp4_srv.cc dhcp4_srv.h b10_dhcp4_SOURCES = main.cc
b10_dhcp4_SOURCES += ctrl_dhcp4_srv.cc ctrl_dhcp4_srv.h b10_dhcp4_SOURCES += ctrl_dhcp4_srv.cc ctrl_dhcp4_srv.h
b10_dhcp4_SOURCES += dhcp4_log.cc dhcp4_log.h
b10_dhcp4_SOURCES += dhcp4_srv.cc dhcp4_srv.h
nodist_b10_dhcp4_SOURCES = dhcp4_messages.h dhcp4_messages.cc
EXTRA_DIST += dhcp4_messages.mes
if USE_CLANGPP if USE_CLANGPP
# Disable unused parameter warning caused by some of the # Disable unused parameter warning caused by some of the
@@ -39,7 +56,7 @@ if USE_CLANGPP
b10_dhcp4_CXXFLAGS = -Wno-unused-parameter b10_dhcp4_CXXFLAGS = -Wno-unused-parameter
endif endif
b10_dhcp4_LDADD = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la b10_dhcp4_LDADD = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
b10_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
b10_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libb10-log.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libb10-log.la

View File

@@ -1,60 +0,0 @@
'\" t
.\" Title: b10-dhcp4
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: October 27, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-DHCP4" "8" "October 27, 2011" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
b10-dhcp4 \- DHCPv4 server in BIND 10 architecture
.SH "SYNOPSIS"
.HP \w'\fBb10\-dhcp4\fR\ 'u
\fBb10\-dhcp4\fR [\fB\-v\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-dhcp4\fR
daemon will provide the DHCPv4 server implementation when it becomes functional\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-v\fR
.RS 4
Enable verbose mode\&.
.RE
.SH "SEE ALSO"
.PP
\fBbind10\fR(8)\&.
.SH "HISTORY"
.PP
The
\fBb10\-dhcp4\fR
daemon was first coded in November 2011 by Tomek Mrugalski\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -13,28 +13,30 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <cc/session.h> #include <asiolink/asiolink.h>
#include <cc/data.h> #include <cc/data.h>
#include <exceptions/exceptions.h> #include <cc/session.h>
#include <cc/session.h> #include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <util/buffer.h>
#include <dhcp4/spec_config.h>
#include <dhcp4/ctrl_dhcp4_srv.h> #include <dhcp4/ctrl_dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h>
#include <dhcp4/spec_config.h>
#include <dhcp/iface_mgr.h> #include <dhcp/iface_mgr.h>
#include <asiolink/asiolink.h> #include <exceptions/exceptions.h>
#include <util/buffer.h>
using namespace std; using namespace isc::asiolink;
using namespace isc::util;
using namespace isc::dhcp;
using namespace isc::util;
using namespace isc::data;
using namespace isc::cc; using namespace isc::cc;
using namespace isc::config; using namespace isc::config;
using namespace isc::asiolink; using namespace isc::data;
using namespace isc::dhcp;
using namespace isc::log;
using namespace isc::util;
using namespace std;
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
@@ -43,7 +45,8 @@ ControlledDhcpv4Srv* ControlledDhcpv4Srv::server_ = NULL;
ConstElementPtr ConstElementPtr
ControlledDhcpv4Srv::dhcp4ConfigHandler(ConstElementPtr new_config) { ControlledDhcpv4Srv::dhcp4ConfigHandler(ConstElementPtr new_config) {
cout << "b10-dhcp4: Received new config:" << new_config->str() << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_CONFIG_UPDATE)
.arg(new_config->str());
ConstElementPtr answer = isc::config::createAnswer(0, ConstElementPtr answer = isc::config::createAnswer(0,
"Thank you for sending config."); "Thank you for sending config.");
return (answer); return (answer);
@@ -51,13 +54,14 @@ ControlledDhcpv4Srv::dhcp4ConfigHandler(ConstElementPtr new_config) {
ConstElementPtr ConstElementPtr
ControlledDhcpv4Srv::dhcp4CommandHandler(const string& command, ConstElementPtr args) { ControlledDhcpv4Srv::dhcp4CommandHandler(const string& command, ConstElementPtr args) {
cout << "b10-dhcp4: Received new command: [" << command << "], args=" LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_COMMAND_RECEIVED)
<< args->str() << endl; .arg(command).arg(args->str());
if (command == "shutdown") { if (command == "shutdown") {
if (ControlledDhcpv4Srv::server_) { if (ControlledDhcpv4Srv::server_) {
ControlledDhcpv4Srv::server_->shutdown(); ControlledDhcpv4Srv::server_->shutdown();
} else { } else {
cout << "Server not initialized yet or already shut down." << endl; LOG_WARN(dhcp4_logger, DHCP4_NOT_RUNNING);
ConstElementPtr answer = isc::config::createAnswer(1, ConstElementPtr answer = isc::config::createAnswer(1,
"Shutdown failure."); "Shutdown failure.");
return (answer); return (answer);
@@ -93,10 +97,9 @@ void ControlledDhcpv4Srv::establishSession() {
/// @todo: Check if session is not established already. Throw, if it is. /// @todo: Check if session is not established already. Throw, if it is.
cout << "b10-dhcp4: my specfile is " << specfile << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_CCSESSION_STARTING)
.arg(specfile);
cc_session_ = new Session(io_service_.get_io_service()); cc_session_ = new Session(io_service_.get_io_service());
config_session_ = new ModuleCCSession(specfile, *cc_session_, config_session_ = new ModuleCCSession(specfile, *cc_session_,
dhcp4ConfigHandler, dhcp4ConfigHandler,
dhcp4CommandHandler, false); dhcp4CommandHandler, false);
@@ -106,8 +109,8 @@ void ControlledDhcpv4Srv::establishSession() {
/// control with the "select" model of the DHCP server. This is /// control with the "select" model of the DHCP server. This is
/// fully explained in \ref dhcpv4Session. /// fully explained in \ref dhcpv4Session.
int ctrl_socket = cc_session_->getSocketDesc(); int ctrl_socket = cc_session_->getSocketDesc();
cout << "b10-dhcp4: Control session started, socket=" LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_CCSESSION_STARTED)
<< ctrl_socket << endl; .arg(ctrl_socket);
IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader); IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader);
} }

View File

@@ -0,0 +1,26 @@
// 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.
/// Defines the logger used by the top-level component of b10-dhcp4.
#include "dhcp4_log.h"
namespace isc {
namespace dhcp {
isc::log::Logger dhcp4_logger("dhcp4");
} // namespace dhcp
} // namespace isc

59
src/bin/dhcp4/dhcp4_log.h Normal file
View File

@@ -0,0 +1,59 @@
// 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.
#ifndef __DHCP4_LOG__H
#define __DHCP4_LOG__H
#include <log/macros.h>
#include <log/logger_support.h>
#include <dhcp4/dhcp4_messages.h>
namespace isc {
namespace dhcp {
/// \brief DHCP4 Logging
///
/// Defines the levels used to output debug messages in the non-library part of
/// the b10-dhcp4 program. Higher numbers equate to more verbose (and detailed)
/// output.
// Debug levels used to log information during startup and shutdown.
const int DBG_DHCP4_START = DBGLVL_START_SHUT;
const int DBG_DHCP4_SHUT = DBGLVL_START_SHUT;
// Debug level used to log setting information (such as configuration changes).
const int DBG_DHCP4_COMMAND = DBGLVL_COMMAND;
// Trace basic operations within the code.
const int DBG_DHCP4_BASIC = DBGLVL_TRACE_BASIC;
// Trace detailed operations, including errors raised when processing invalid
// packets. (These are not logged at severities of WARN or higher for fear
// that a set of deliberately invalid packets set to the server could overwhelm
// the logging.)
const int DBG_DHCP4_DETAIL = DBGLVL_TRACE_DETAIL;
// This level is used to log the contents of packets received and sent.
const int DBG_DHCP4_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
/// Define the logger for the "dhcp4" module part of b10-dhcp4. We could define
/// a logger in each file, but we would want to define a common name to avoid
/// spelling mistakes, so it is just one small step from there to define a
/// module-common logger.
extern isc::log::Logger dhcp4_logger;
} // namespace dhcp4
} // namespace isc
#endif // __DHCP4_LOG__H

View File

@@ -0,0 +1,98 @@
# 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.
$NAMESPACE isc::dhcp
% DHCP4_CCSESSION_STARTED control channel session started on socket %1
A debug message issued during startup after the IPv4 DHCP server has
successfully established a session with the BIND 10 control channel.
% DHCP4_CCSESSION_STARTING starting control channel session, specfile: %1
This debug message is issued just before the IPv4 DHCP server attempts
to establish a session with the BIND 10 control channel.
% DHCP4_COMMAND_RECEIVED received command %1, arguments: %2
A debug message listing the command (and possible arguments) received
from the BIND 10 control system by the IPv4 DHCP server.
% DHCP4_CONFIG_UPDATE updated configuration received: %1
A debug message indicating that the IPv4 DHCP server has received an
updated configuration from the BIND 10 configuration system.
% DHCP4_NOT_RUNNING IPv4 DHCP server is not running
A warning message is issued when an attempt is made to shut down the
IPv4 DHCP server but it is not running.
% DHCP4_OPEN_SOCKET opening sockets on port %1
A debug message issued during startup, this indicates that the IPv4 DHCP
server is about to open sockets on the specified port.
% DHCP4_PACKET_PARSE_FAIL failed to parse incoming packet: %1
The IPv4 DHCP server has received a packet that it is unable to
interpret. The reason why the packet is invalid is included in the message.
% DHCP4_PACKET_RECEIVED %1 (type %2) packet received on interface %3
A debug message noting that the server has received the specified type of
packet on the specified interface. Note that a packet marked as UNKNOWN
may well be a valid DHCP packet, just a type not expected by the server
(e.g. it will report a received OFFER packet as UNKNOWN).
% DHCP4_PACK_FAIL failed to assemble response correctly
This error is output if the server failed to assemble the data to be
returned to the client into a valid packet. The cause is most likely
to be a programming error: please raise a bug report.
% DHCP4_QUERY_DATA received packet type %1, data is <%2>
A debug message listing the data received from the client.
% DHCP4_RESPONSE_DATA responding with packet type %1, data is <%2>
A debug message listing the data returned to the client.
% DHCP4_SERVER_FAILED server failed: %1
The IPv4 DHCP server has encountered a fatal error and is terminating.
The reason for the failure is included in the message.
% DHCP4_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone
The server has failed to establish communication with the rest of BIND
10 and is running in stand-alone mode. (This behavior will change once
the IPv4 DHCP server is properly integrated with the rest of BIND 10.)
% DHCP4_SHUTDOWN server shutdown
The IPv4 DHCP server has terminated normally.
% DHCP4_SHUTDOWN_REQUEST shutdown of server requested
This debug message indicates that a shutdown of the IPv4 server has
been requested via a call to the 'shutdown' method of the core Dhcpv4Srv
object.
% DHCP4_SRV_CONSTRUCT_ERROR error creating Dhcpv4Srv object, reason: %1
This error message indicates that during startup, the construction of a
core component within the IPv4 DHCP server (the Dhcpv4 server object)
has failed. As a result, the server will exit. The reason for the
failure is given within the message.
% DHCP4_STANDALONE skipping message queue, running standalone
This is a debug message indicating that the IPv4 server is running in
standalone mode, not connected to the message queue. Standalone mode
is only useful during program development, and should not be used in a
production environment.
% DHCP4_STARTING server starting
This informational message indicates that the IPv4 DHCP server has
processed any command-line switches and is starting.
% DHCP4_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4
This is a debug message issued during the IPv4 DHCP server startup.
It lists some information about the parameters with which the server
is running.

View File

@@ -16,13 +16,15 @@
#include <dhcp/pkt4.h> #include <dhcp/pkt4.h>
#include <dhcp/iface_mgr.h> #include <dhcp/iface_mgr.h>
#include <dhcp4/dhcp4_srv.h> #include <dhcp4/dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h>
#include <asiolink/io_address.h> #include <asiolink/io_address.h>
#include <dhcp/option4_addrlst.h> #include <dhcp/option4_addrlst.h>
using namespace std;
using namespace isc; using namespace isc;
using namespace isc::dhcp;
using namespace isc::asiolink; using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::log;
using namespace std;
// These are hardcoded parameters. Currently this is a skeleton server that only // These are hardcoded parameters. Currently this is a skeleton server that only
// grants those options and a single, fixed, hardcoded lease. // grants those options and a single, fixed, hardcoded lease.
@@ -35,20 +37,19 @@ const std::string HARDCODED_DOMAIN_NAME = "isc.example.com";
const std::string HARDCODED_SERVER_ID = "192.0.2.1"; const std::string HARDCODED_SERVER_ID = "192.0.2.1";
Dhcpv4Srv::Dhcpv4Srv(uint16_t port) { Dhcpv4Srv::Dhcpv4Srv(uint16_t port) {
cout << "Initialization: opening sockets on port " << port << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_OPEN_SOCKET).arg(port);
try { try {
// first call to instance() will create IfaceMgr (it's a singleton) // First call to instance() will create IfaceMgr (it's a singleton)
// it may throw something if things go wrong // it may throw something if things go wrong
IfaceMgr::instance(); IfaceMgr::instance();
/// @todo: instantiate LeaseMgr here once it is imlpemented. /// @todo: instantiate LeaseMgr here once it is imlpemented.
IfaceMgr::instance().openSockets4(port); IfaceMgr::instance().openSockets4(port);
setServerID(); setServerID();
} catch (const std::exception &e) { } catch (const std::exception &e) {
cerr << "Error during DHCPv4 server startup: " << e.what() << endl; LOG_ERROR(dhcp4_logger, DHCP4_SRV_CONSTRUCT_ERROR).arg(e.what());
shutdown_ = true; shutdown_ = true;
return; return;
} }
@@ -57,12 +58,11 @@ Dhcpv4Srv::Dhcpv4Srv(uint16_t port) {
} }
Dhcpv4Srv::~Dhcpv4Srv() { Dhcpv4Srv::~Dhcpv4Srv() {
cout << "b10-dhcp4: DHCPv4 server terminating." << endl;
IfaceMgr::instance().closeSockets(); IfaceMgr::instance().closeSockets();
} }
void Dhcpv4Srv::shutdown() { void Dhcpv4Srv::shutdown() {
cout << "b10-dhcp4: DHCPv4 server shutdown." << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_BASIC, DHCP4_SHUTDOWN_REQUEST);
shutdown_ = true; shutdown_ = true;
} }
@@ -79,39 +79,48 @@ Dhcpv4Srv::run() {
if (query) { if (query) {
try { try {
query->unpack(); query->unpack();
} catch (const std::exception& e) { } catch (const std::exception& e) {
/// TODO: Printout reasons of failed parsing // Failed to parse the packet.
cout << "Failed to parse incoming packet " << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL,
DHCP4_PACKET_PARSE_FAIL).arg(e.what());
continue; continue;
} }
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL, DHCP4_PACKET_RECEIVED)
.arg(serverReceivedPacketName(query->getType()))
.arg(query->getType())
.arg(query->getIface());
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_QUERY_DATA)
.arg(query->toText());
switch (query->getType()) { switch (query->getType()) {
case DHCPDISCOVER: case DHCPDISCOVER:
rsp = processDiscover(query); rsp = processDiscover(query);
break; break;
case DHCPREQUEST: case DHCPREQUEST:
rsp = processRequest(query); rsp = processRequest(query);
break; break;
case DHCPRELEASE: case DHCPRELEASE:
processRelease(query); processRelease(query);
break; break;
case DHCPDECLINE: case DHCPDECLINE:
processDecline(query); processDecline(query);
break; break;
case DHCPINFORM: case DHCPINFORM:
processInform(query); processInform(query);
break; break;
default: default:
cout << "Unknown pkt type received:" // Only action is to output a message if debug is enabled,
<< query->getType() << endl; // and that will be covered by the debug statement before
// the "switch" statement.
;
} }
cout << "Received message type " << int(query->getType()) << endl;
// TODO: print out received packets only if verbose (or debug)
// mode is enabled
cout << query->toText();
if (rsp) { if (rsp) {
if (rsp->getRemoteAddr().toText() == "0.0.0.0") { if (rsp->getRemoteAddr().toText() == "0.0.0.0") {
rsp->setRemoteAddr(query->getRemoteAddr()); rsp->setRemoteAddr(query->getRemoteAddr());
@@ -127,14 +136,15 @@ Dhcpv4Srv::run() {
rsp->setIface(query->getIface()); rsp->setIface(query->getIface());
rsp->setIndex(query->getIndex()); rsp->setIndex(query->getIndex());
cout << "Replying with message type " LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA,
<< static_cast<int>(rsp->getType()) << ":" << endl; DHCP4_RESPONSE_DATA)
cout << rsp->toText(); .arg(rsp->getType()).arg(rsp->toText());
cout << "----" << endl;
if (rsp->pack()) { if (rsp->pack()) {
cout << "Packet assembled correctly." << endl; IfaceMgr::instance().send(rsp);
} else {
LOG_ERROR(dhcp4_logger, DHCP4_PACK_FAIL);
} }
IfaceMgr::instance().send(rsp);
} }
} }
@@ -266,15 +276,44 @@ Pkt4Ptr Dhcpv4Srv::processRequest(Pkt4Ptr& request) {
void Dhcpv4Srv::processRelease(Pkt4Ptr& release) { void Dhcpv4Srv::processRelease(Pkt4Ptr& release) {
/// TODO: Implement this. /// TODO: Implement this.
cout << "Received RELEASE on " << release->getIface() << " interface." << endl;
} }
void Dhcpv4Srv::processDecline(Pkt4Ptr& decline) { void Dhcpv4Srv::processDecline(Pkt4Ptr& decline) {
/// TODO: Implement this. /// TODO: Implement this.
cout << "Received DECLINE on " << decline->getIface() << " interface." << endl;
} }
Pkt4Ptr Dhcpv4Srv::processInform(Pkt4Ptr& inform) { Pkt4Ptr Dhcpv4Srv::processInform(Pkt4Ptr& inform) {
/// TODO: Currently implemented echo mode. Implement this for real /// TODO: Currently implemented echo mode. Implement this for real
return (inform); return (inform);
} }
const char*
Dhcpv4Srv::serverReceivedPacketName(uint8_t type) {
static const char* DISCOVER = "DISCOVER";
static const char* REQUEST = "REQUEST";
static const char* RELEASE = "RELEASE";
static const char* DECLINE = "DECLINE";
static const char* INFORM = "INFORM";
static const char* UNKNOWN = "UNKNOWN";
switch (type) {
case DHCPDISCOVER:
return (DISCOVER);
case DHCPREQUEST:
return (REQUEST);
case DHCPRELEASE:
return (RELEASE);
case DHCPDECLINE:
return (DECLINE);
case DHCPINFORM:
return (INFORM);
default:
;
}
return (UNKNOWN);
}

View File

@@ -44,7 +44,7 @@ class Dhcpv4Srv : public boost::noncopyable {
public: public:
/// @brief Default constructor. /// @brief Default constructor.
/// ///
/// Instantiates necessary services, required to run DHCPv6 server. /// Instantiates necessary services, required to run DHCPv4 server.
/// In particular, creates IfaceMgr that will be responsible for /// In particular, creates IfaceMgr that will be responsible for
/// network interaction. Will instantiate lease manager, and load /// network interaction. Will instantiate lease manager, and load
/// old or create new DUID. It is possible to specify alternate /// old or create new DUID. It is possible to specify alternate
@@ -54,7 +54,7 @@ class Dhcpv4Srv : public boost::noncopyable {
/// @param port specifies port number to listen on /// @param port specifies port number to listen on
Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT); Dhcpv4Srv(uint16_t port = DHCP4_SERVER_PORT);
/// @brief Destructor. Used during DHCPv6 service shutdown. /// @brief Destructor. Used during DHCPv4 service shutdown.
~Dhcpv4Srv(); ~Dhcpv4Srv();
/// @brief Main server processing loop. /// @brief Main server processing loop.
@@ -70,6 +70,23 @@ class Dhcpv4Srv : public boost::noncopyable {
/// @brief Instructs the server to shut down. /// @brief Instructs the server to shut down.
void shutdown(); void shutdown();
/// @brief Return textual type of packet received by server
///
/// Returns the name of valid packet received by the server (e.g. DISCOVER).
/// If the packet is unknown - or if it is a valid DHCP packet but not one
/// expected to be received by the server (such as an OFFER), the string
/// "UNKNOWN" is returned. This method is used in debug messages.
///
/// As the operation of the method does not depend on any server state, it
/// is declared static.
///
/// @param type DHCPv4 packet type
///
/// @return Pointer to "const" string containing the packet name.
/// Note that this string is statically allocated and MUST NOT
/// be freed by the caller.
static const char* serverReceivedPacketName(uint8_t type);
protected: protected:
/// @brief Processes incoming DISCOVER and returns response. /// @brief Processes incoming DISCOVER and returns response.
/// ///
@@ -89,11 +106,11 @@ protected:
/// is valid, not expired, not reserved, not used by other client and /// is valid, not expired, not reserved, not used by other client and
/// that requesting client is allowed to use it. /// that requesting client is allowed to use it.
/// ///
/// Returns ACK message, NACK message, or NULL /// Returns ACK message, NAK message, or NULL
/// ///
/// @param request a message received from client /// @param request a message received from client
/// ///
/// @return ACK or NACK message /// @return ACK or NAK message
Pkt4Ptr processRequest(Pkt4Ptr& request); Pkt4Ptr processRequest(Pkt4Ptr& request);
/// @brief Stub function that will handle incoming RELEASE messages. /// @brief Stub function that will handle incoming RELEASE messages.

View File

@@ -14,13 +14,15 @@
#include <config.h> #include <config.h>
#include <iostream> #include <iostream>
#include <log/dummylog.h>
#include <log/logger_support.h>
#include <dhcp4/ctrl_dhcp4_srv.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
using namespace std; #include <dhcp4/ctrl_dhcp4_srv.h>
#include <dhcp4/dhcp4_log.h>
#include <log/logger_support.h>
using namespace isc::dhcp; using namespace isc::dhcp;
using namespace std;
/// This file contains entry point (main() function) for standard DHCPv4 server /// This file contains entry point (main() function) for standard DHCPv4 server
/// component for BIND10 framework. It parses command-line arguments and /// component for BIND10 framework. It parses command-line arguments and
@@ -37,11 +39,10 @@ const char* const DHCP4_NAME = "b10-dhcp4";
void void
usage() { usage() {
cerr << "Usage: b10-dhcp4 [-v]" cerr << "Usage: " << DHCP4_NAME << " [-v] [-s] [-p number]" << endl;
<< endl; cerr << " -v: verbose output" << endl;
cerr << "\t-v: verbose output" << endl; cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl;
cerr << "\t-s: stand-alone mode (don't connect to BIND10)" << endl; cerr << " -p number: specify non-standard port number 1-65535 "
cerr << "\t-p number: specify non-standard port number 1-65535 "
<< "(useful for testing only)" << endl; << "(useful for testing only)" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -50,20 +51,21 @@ usage() {
int int
main(int argc, char* argv[]) { main(int argc, char* argv[]) {
int ch; int ch;
bool verbose_mode = false; // should server be verbose?
int port_number = DHCP4_SERVER_PORT; // The default. any other values are int port_number = DHCP4_SERVER_PORT; // The default. any other values are
// useful for testing only. // useful for testing only.
bool stand_alone = false; // should be connect to BIND10 msgq? bool stand_alone = false; // Should be connect to BIND10 msgq?
bool verbose_mode = false; // Should server be verbose?
while ((ch = getopt(argc, argv, "vsp:")) != -1) { while ((ch = getopt(argc, argv, "vsp:")) != -1) {
switch (ch) { switch (ch) {
case 'v': case 'v':
verbose_mode = true; verbose_mode = true;
isc::log::denabled = true;
break; break;
case 's': case 's':
stand_alone = true; stand_alone = true;
break; break;
case 'p': case 'p':
try { try {
port_number = boost::lexical_cast<int>(optarg); port_number = boost::lexical_cast<int>(optarg);
@@ -78,50 +80,46 @@ main(int argc, char* argv[]) {
usage(); usage();
} }
break; break;
case ':':
default: default:
usage(); usage();
} }
} }
// Check for extraneous parameters.
if (argc > optind) {
usage();
}
// Initialize logging. If verbose, we'll use maximum verbosity. // Initialize logging. If verbose, we'll use maximum verbosity.
isc::log::initLogger(DHCP4_NAME, isc::log::initLogger(DHCP4_NAME,
(verbose_mode ? isc::log::DEBUG : isc::log::INFO), (verbose_mode ? isc::log::DEBUG : isc::log::INFO),
isc::log::MAX_DEBUG_LEVEL, NULL); isc::log::MAX_DEBUG_LEVEL, NULL);
LOG_INFO(dhcp4_logger, DHCP4_STARTING);
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_START_INFO)
.arg(getpid()).arg(port_number).arg(verbose_mode ? "yes" : "no")
.arg(stand_alone ? "yes" : "no" );
cout << "b10-dhcp4: My pid=" << getpid() << ", binding to port "
<< port_number << ", verbose " << (verbose_mode?"yes":"no")
<< ", stand-alone=" << (stand_alone?"yes":"no") << endl;
if (argc - optind > 0) {
usage();
}
int ret = EXIT_SUCCESS; int ret = EXIT_SUCCESS;
try { try {
cout << "[b10-dhcp4] Initiating DHCPv4 server operation." << endl;
/// @todo: pass verbose to the actul server once logging is implemented
ControlledDhcpv4Srv server(port_number); ControlledDhcpv4Srv server(port_number);
if (!stand_alone) { if (!stand_alone) {
try { try {
server.establishSession(); server.establishSession();
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
cerr << "Failed to establish BIND10 session. " LOG_ERROR(dhcp4_logger, DHCP4_SESSION_FAIL).arg(ex.what());
"Running in stand-alone mode:" << ex.what() << endl;
// Let's continue. It is useful to have the ability to run // Let's continue. It is useful to have the ability to run
// DHCP server in stand-alone mode, e.g. for testing // DHCP server in stand-alone mode, e.g. for testing
} }
} else { } else {
cout << "Skipping connection to the BIND10 msgq." << endl; LOG_DEBUG(dhcp4_logger, DBG_DHCP4_START, DHCP4_STANDALONE);
} }
server.run(); server.run();
LOG_INFO(dhcp4_logger, DHCP4_SHUTDOWN);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
cerr << "[b10-dhcp4] Server failed: " << ex.what() << endl; LOG_FATAL(dhcp4_logger, DHCP4_SERVER_FAILED).arg(ex.what());
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
} }

View File

@@ -47,6 +47,8 @@ if HAVE_GTEST
TESTS += dhcp4_unittests TESTS += dhcp4_unittests
dhcp4_unittests_SOURCES = ../dhcp4_srv.h ../dhcp4_srv.cc ../ctrl_dhcp4_srv.cc dhcp4_unittests_SOURCES = ../dhcp4_srv.h ../dhcp4_srv.cc ../ctrl_dhcp4_srv.cc
dhcp4_unittests_SOURCES += ../dhcp4_log.h ../dhcp4_log.cc
dhcp4_unittests_SOURCES += ../dhcp4_messages.h ../dhcp4_messages.cc
dhcp4_unittests_SOURCES += dhcp4_unittests.cc dhcp4_unittests_SOURCES += dhcp4_unittests.cc
dhcp4_unittests_SOURCES += dhcp4_srv_unittest.cc dhcp4_unittests_SOURCES += dhcp4_srv_unittest.cc
dhcp4_unittests_SOURCES += ctrl_dhcp4_srv_unittest.cc dhcp4_unittests_SOURCES += ctrl_dhcp4_srv_unittest.cc

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
// //
// Permission to use, copy, modify, and/or distribute this software for any // Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above // purpose with or without fee is hereby granted, provided that the above
@@ -271,4 +271,36 @@ TEST_F(Dhcpv4SrvTest, processInform) {
delete srv; delete srv;
} }
TEST_F(Dhcpv4SrvTest, serverReceivedPacketName) {
// Check all possible packet types
for (int itype = 0; itype < 256; ++itype) {
uint8_t type = itype;
switch (type) {
case DHCPDECLINE:
EXPECT_STREQ("DECLINE", Dhcpv4Srv::serverReceivedPacketName(type));
break;
case DHCPDISCOVER:
EXPECT_STREQ("DISCOVER", Dhcpv4Srv::serverReceivedPacketName(type));
break;
case DHCPINFORM:
EXPECT_STREQ("INFORM", Dhcpv4Srv::serverReceivedPacketName(type));
break;
case DHCPRELEASE:
EXPECT_STREQ("RELEASE", Dhcpv4Srv::serverReceivedPacketName(type));
break;
case DHCPREQUEST:
EXPECT_STREQ("REQUEST", Dhcpv4Srv::serverReceivedPacketName(type));
break;
default:
EXPECT_STREQ("UNKNOWN", Dhcpv4Srv::serverReceivedPacketName(type));
}
}
}
} // end of anonymous namespace } // end of anonymous namespace

View File

@@ -27,16 +27,27 @@ import fcntl
class TestDhcpv4Daemon(unittest.TestCase): class TestDhcpv4Daemon(unittest.TestCase):
def setUp(self): def setUp(self):
# don't redirect stdout/stderr here as we want to print out things # Don't redirect stdout/stderr here as we want to print out things
# during the test # during the test
pass #
# However, we do want to set the logging lock directory to somewhere
# to which we can write - use the current working directory. We then
# set the appropriate environment variable. os.putenv() may be not
# supported on some platforms as suggested in
# http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ:
# "If the platform supports the putenv() function...". It was checked
# that it does not work on Ubuntu. To overcome this problem we access
# os.environ directly.
lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
if lockdir_envvar not in os.environ:
os.environ[lockdir_envvar] = os.getcwd()
def tearDown(self): def tearDown(self):
pass pass
def runCommand(self, params, wait=1): def runCommand(self, params, wait=1):
""" """
This method runs dhcp4 and returns a touple: (returncode, stdout, stderr) This method runs dhcp4 and returns a tuple: (returncode, stdout, stderr)
""" """
## @todo: Convert this into generic method and reuse it in dhcp6 ## @todo: Convert this into generic method and reuse it in dhcp6
@@ -79,9 +90,9 @@ class TestDhcpv4Daemon(unittest.TestCase):
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
# There's potential problem if b10-dhcp4 prints out more # There's potential problem if b10-dhcp4 prints out more
# than 4k of text # than 16kB of text
try: try:
output = os.read(self.stdout_pipes[0], 4096) output = os.read(self.stdout_pipes[0], 16384)
except OSError: except OSError:
print("No data available from stdout") print("No data available from stdout")
output = "" output = ""
@@ -91,7 +102,7 @@ class TestDhcpv4Daemon(unittest.TestCase):
output = "" output = ""
try: try:
error = os.read(self.stderr_pipes[0], 4096) error = os.read(self.stderr_pipes[0], 16384)
except OSError: except OSError:
print("No data available on stderr") print("No data available on stderr")
error = "" error = ""
@@ -128,13 +139,13 @@ class TestDhcpv4Daemon(unittest.TestCase):
print(" not that is can bind sockets correctly. Please ignore binding errors.") print(" not that is can bind sockets correctly. Please ignore binding errors.")
(returncode, output, error) = self.runCommand(["../b10-dhcp4", "-v"]) (returncode, output, error) = self.runCommand(["../b10-dhcp4", "-v"])
output_text = str(output) + str(error)
self.assertEqual( str(output).count("[b10-dhcp4] Initiating DHCPv4 server operation."), 1) self.assertEqual(output_text.count("DHCP4_STARTING"), 1)
def test_portnumber_0(self): def test_portnumber_0(self):
print("Check that specifying port number 0 is not allowed.") print("Check that specifying port number 0 is not allowed.")
(returncode, output, error) = self.runCommand(['../b10-dhcp4', '-p', '0']) (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-p', '0'])
# When invalid port number is specified, return code must not be success # When invalid port number is specified, return code must not be success
self.assertTrue(returncode != 0) self.assertTrue(returncode != 0)
@@ -178,28 +189,19 @@ class TestDhcpv4Daemon(unittest.TestCase):
def test_portnumber_nonroot(self): def test_portnumber_nonroot(self):
print("Check that specifying unprivileged port number will work.") print("Check that specifying unprivileged port number will work.")
(returncode, output, error) = self.runCommand(['../b10-dhcp4', '-s', '-p', '10057']) # Check that there is a message about running with an unprivileged port
(returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-s', '-p', '10057'])
# When invalid port number is specified, return code must not be success output_text = str(output) + str(error)
# TODO: Temporarily commented out as socket binding on systems that do not have self.assertEqual(output_text.count("DHCP4_OPEN_SOCKET opening sockets on port 10057"), 1)
# interface detection implemented currently fails.
# self.assertTrue(returncode == 0)
# Check that there is an error message about invalid port number printed on stderr
self.assertEqual( str(output).count("opening sockets on port 10057"), 1)
def test_skip_msgq(self): def test_skip_msgq(self):
print("Check that connection to BIND10 msgq can be disabled.") print("Check that connection to BIND10 msgq can be disabled.")
(returncode, output, error) = self.runCommand(['../b10-dhcp4', '-s', '-p', '10057']) # Check that the system outputs a message on one of its streams about running
# standalone.
# When invalid port number is specified, return code must not be success (returncode, output, error) = self.runCommand(['../b10-dhcp4', '-v', '-s', '-p', '10057'])
# TODO: Temporarily commented out as socket binding on systems that do not have output_text = str(output) + str(error)
# interface detection implemented currently fails. self.assertEqual(output_text.count("DHCP4_STANDALONE"), 1)
# self.assertTrue(returncode == 0)
# Check that there is an error message about invalid port number printed on stderr
self.assertEqual( str(output).count("Skipping connection to the BIND10 msgq."), 1)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@@ -8,3 +8,4 @@ b10-dhcp6
spec_config.h spec_config.h
spec_config.h.pre spec_config.h.pre
tests/dhcp6_unittests tests/dhcp6_unittests
/b10-dhcp6.8

View File

@@ -13,27 +13,44 @@ endif
pkglibexecdir = $(libexecdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@
CLEANFILES = spec_config.h CLEANFILES = spec_config.h dhcp6_messages.h dhcp6_messages.cc
man_MANS = b10-dhcp6.8 man_MANS = b10-dhcp6.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-dhcp6.xml dhcp6.spec EXTRA_DIST = $(man_MANS) b10-dhcp6.xml dhcp6.spec
if ENABLE_MAN if GENERATE_DOCS
b10-dhcp6.8: b10-dhcp6.xml b10-dhcp6.8: b10-dhcp6.xml
xsltproc --novalid --xinclude --nonet -o $@ \ @XSLTPROC@ --novalid --xinclude --nonet -o $@ \
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \
$(srcdir)/b10-dhcp6.xml $(srcdir)/b10-dhcp6.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 endif
spec_config.h: spec_config.h.pre spec_config.h: spec_config.h.pre
$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@
BUILT_SOURCES = spec_config.h dhcp6_messages.h dhcp6_messages.cc: dhcp6_messages.mes
$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp6/dhcp6_messages.mes
BUILT_SOURCES = spec_config.h dhcp6_messages.h dhcp6_messages.cc
pkglibexec_PROGRAMS = b10-dhcp6 pkglibexec_PROGRAMS = b10-dhcp6
b10_dhcp6_SOURCES = main.cc dhcp6_srv.cc dhcp6_srv.h b10_dhcp6_SOURCES = main.cc
b10_dhcp6_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h b10_dhcp6_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h
b10_dhcp6_SOURCES += dhcp6_log.cc dhcp6_log.h
b10_dhcp6_SOURCES += dhcp6_srv.cc dhcp6_srv.h
nodist_b10_dhcp6_SOURCES = dhcp6_messages.h dhcp6_messages.cc
EXTRA_DIST += dhcp6_messages.mes
if USE_CLANGPP if USE_CLANGPP
# Disable unused parameter warning caused by some of the # Disable unused parameter warning caused by some of the
@@ -41,7 +58,7 @@ if USE_CLANGPP
b10_dhcp6_CXXFLAGS = -Wno-unused-parameter b10_dhcp6_CXXFLAGS = -Wno-unused-parameter
endif endif
b10_dhcp6_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la b10_dhcp6_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
b10_dhcp6_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libb10-log.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la

View File

@@ -1,51 +0,0 @@
'\" t
.\" Title: b10-dhcp6
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: October 27, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-DHCP6" "8" "October 27, 2011" "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-dhcp6 \- DHCPv6 server in BIND 10 architecture
.SH "SYNOPSIS"
.HP \w'\fBb10\-dhcp6\fR\ 'u
\fBb10\-dhcp6\fR [\fB\-v\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-dhcp6\fR
daemon will provide the DHCPv6 server implementation when it becomes functional\&.
.SH "ARGUMENTS"
.PP
The arguments are as follows:
.PP
\fB\-v\fR
.RS 4
Enable verbose mode\&.
.RE
.SH "SEE ALSO"
.PP
\fBbind10\fR(8)\&.
.SH "HISTORY"
.PP
The
\fBb10\-dhcp6\fR
daemon was first coded in June 2011 by Tomek Mrugalski\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -13,28 +13,30 @@
// PERFORMANCE OF THIS SOFTWARE. // PERFORMANCE OF THIS SOFTWARE.
#include <config.h> #include <config.h>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
#include <cc/session.h> #include <asiolink/asiolink.h>
#include <cc/data.h> #include <cc/data.h>
#include <exceptions/exceptions.h> #include <cc/session.h>
#include <cc/session.h> #include <cc/session.h>
#include <config/ccsession.h> #include <config/ccsession.h>
#include <util/buffer.h>
#include <dhcp6/spec_config.h>
#include <dhcp6/ctrl_dhcp6_srv.h> #include <dhcp6/ctrl_dhcp6_srv.h>
#include <dhcp6/dhcp6_log.h>
#include <dhcp6/spec_config.h>
#include <dhcp/iface_mgr.h> #include <dhcp/iface_mgr.h>
#include <asiolink/asiolink.h> #include <exceptions/exceptions.h>
#include <util/buffer.h>
using namespace std; using namespace isc::asiolink;
using namespace isc::util;
using namespace isc::dhcp;
using namespace isc::util;
using namespace isc::data;
using namespace isc::cc; using namespace isc::cc;
using namespace isc::config; using namespace isc::config;
using namespace isc::asiolink; using namespace isc::data;
using namespace isc::dhcp;
using namespace isc::log;
using namespace isc::util;
using namespace std;
namespace isc { namespace isc {
namespace dhcp { namespace dhcp {
@@ -43,7 +45,8 @@ ControlledDhcpv6Srv* ControlledDhcpv6Srv::server_ = NULL;
ConstElementPtr ConstElementPtr
ControlledDhcpv6Srv::dhcp6ConfigHandler(ConstElementPtr new_config) { ControlledDhcpv6Srv::dhcp6ConfigHandler(ConstElementPtr new_config) {
cout << "b10-dhcp6: Received new config:" << new_config->str() << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_CONFIG_UPDATE)
.arg(new_config->str());
ConstElementPtr answer = isc::config::createAnswer(0, ConstElementPtr answer = isc::config::createAnswer(0,
"Thank you for sending config."); "Thank you for sending config.");
return (answer); return (answer);
@@ -51,13 +54,14 @@ ControlledDhcpv6Srv::dhcp6ConfigHandler(ConstElementPtr new_config) {
ConstElementPtr ConstElementPtr
ControlledDhcpv6Srv::dhcp6CommandHandler(const string& command, ConstElementPtr args) { ControlledDhcpv6Srv::dhcp6CommandHandler(const string& command, ConstElementPtr args) {
cout << "b10-dhcp6: Received new command: [" << command << "], args=" LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_COMMAND_RECEIVED)
<< args->str() << endl; .arg(command).arg(args->str());
if (command == "shutdown") { if (command == "shutdown") {
if (ControlledDhcpv6Srv::server_) { if (ControlledDhcpv6Srv::server_) {
ControlledDhcpv6Srv::server_->shutdown(); ControlledDhcpv6Srv::server_->shutdown();
} else { } else {
cout << "Server not initialized yet or already shut down." << endl; LOG_WARN(dhcp6_logger, DHCP6_NOT_RUNNING);
ConstElementPtr answer = isc::config::createAnswer(1, ConstElementPtr answer = isc::config::createAnswer(1,
"Shutdown failure."); "Shutdown failure.");
return (answer); return (answer);
@@ -93,10 +97,9 @@ void ControlledDhcpv6Srv::establishSession() {
/// @todo: Check if session is not established already. Throw, if it is. /// @todo: Check if session is not established already. Throw, if it is.
cout << "b10-dhcp6: my specfile is " << specfile << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_CCSESSION_STARTING)
.arg(specfile);
cc_session_ = new Session(io_service_.get_io_service()); cc_session_ = new Session(io_service_.get_io_service());
config_session_ = new ModuleCCSession(specfile, *cc_session_, config_session_ = new ModuleCCSession(specfile, *cc_session_,
dhcp6ConfigHandler, dhcp6ConfigHandler,
dhcp6CommandHandler, false); dhcp6CommandHandler, false);
@@ -106,8 +109,8 @@ void ControlledDhcpv6Srv::establishSession() {
/// control with the "select" model of the DHCP server. This is /// control with the "select" model of the DHCP server. This is
/// fully explained in \ref dhcpv6Session. /// fully explained in \ref dhcpv6Session.
int ctrl_socket = cc_session_->getSocketDesc(); int ctrl_socket = cc_session_->getSocketDesc();
cout << "b10-dhcp6: Control session started, socket=" LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_CCSESSION_STARTED)
<< ctrl_socket << endl; .arg(ctrl_socket);
IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader); IfaceMgr::instance().set_session_socket(ctrl_socket, sessionReader);
} }

View File

@@ -0,0 +1,26 @@
// 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.
/// Defines the logger used by the top-level component of b10-dhcp6.
#include "dhcp6_log.h"
namespace isc {
namespace dhcp {
isc::log::Logger dhcp6_logger("dhcp6");
} // namespace dhcp
} // namespace isc

59
src/bin/dhcp6/dhcp6_log.h Normal file
View File

@@ -0,0 +1,59 @@
// 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.
#ifndef __DHCP6_LOG__H
#define __DHCP6_LOG__H
#include <log/macros.h>
#include <log/logger_support.h>
#include <dhcp6/dhcp6_messages.h>
namespace isc {
namespace dhcp {
/// \brief DHCP6 Logging
///
/// Defines the levels used to output debug messages in the non-library part of
/// the b10-dhcp6 program. Higher numbers equate to more verbose (and detailed)
/// output.
// Debug levels used to log information during startup and shutdown.
const int DBG_DHCP6_START = DBGLVL_START_SHUT;
const int DBG_DHCP6_SHUT = DBGLVL_START_SHUT;
// Debug level used to log setting information (such as configuration changes).
const int DBG_DHCP6_COMMAND = DBGLVL_COMMAND;
// Trace basic operations within the code.
const int DBG_DHCP6_BASIC = DBGLVL_TRACE_BASIC;
// Trace detailed operations, including errors raised when processing invalid
// packets. (These are not logged at severities of WARN or higher for fear
// that a set of deliberately invalid packets set to the server could overwhelm
// the logging.)
const int DBG_DHCP6_DETAIL = DBGLVL_TRACE_DETAIL;
// This level is used to log the contents of packets received and sent.
const int DBG_DHCP6_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
/// Define the logger for the "dhcp6" module part of b10-dhcp6. We could define
/// a logger in each file, but we would want to define a common name to avoid
/// spelling mistakes, so it is just one small step from there to define a
/// module-common logger.
extern isc::log::Logger dhcp6_logger;
} // namespace dhcp6
} // namespace isc
#endif // __DHCP6_LOG__H

View File

@@ -0,0 +1,101 @@
# 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.
$NAMESPACE isc::dhcp
% DHCP6_CCSESSION_STARTED control channel session started on socket %1
A debug message issued during startup after the IPv6 DHCP server has
successfully established a session with the BIND 10 control channel.
% DHCP6_CCSESSION_STARTING starting control channel session, specfile: %1
This debug message is issued just before the IPv6 DHCP server attempts
to establish a session with the BIND 10 control channel.
% DHCP6_COMMAND_RECEIVED received command %1, arguments: %2
A debug message listing the command (and possible arguments) received
from the BIND 10 control system by the IPv6 DHCP server.
% DHCP6_CONFIG_UPDATE updated configuration received: %1
A debug message indicating that the IPv6 DHCP server has received an
updated configuration from the BIND 10 configuration system.
% DHCP6_NOT_RUNNING IPv6 DHCP server is not running
A warning message is issued when an attempt is made to shut down the
IPv6 DHCP server but it is not running.
% DHCP6_NO_INTERFACES failed to detect any network interfaces
During startup the IPv6 DHCP server failed to detect any network
interfaces and is therefore shutting down.
% DHCP6_OPEN_SOCKET opening sockets on port %1
A debug message issued during startup, this indicates that the IPv6 DHCP
server is about to open sockets on the specified port.
% DHCP6_PACKET_PARSE_FAIL failed to parse incoming packet
The IPv6 DHCP server has received a packet that it is unable to interpret.
% DHCP6_PACKET_RECEIVED %1 (type %2) packet received
A debug message noting that the server has received the specified type
of packet. Note that a packet marked as UNKNOWN may well be a valid
DHCP packet, just a type not expected by the server (e.g. it will report
a received OFFER packet as UNKNOWN).
% DHCP6_PACK_FAIL failed to assemble response correctly
This error is output if the server failed to assemble the data to be
returned to the client into a valid packet. The reason is most likely
to be to a programming error: please raise a bug report.
% DHCP6_QUERY_DATA received packet length %1, data length %2, data is <%3>
A debug message listing the data received from the client or relay.
% DHCP6_RESPONSE_DATA responding with packet type %1 data is <%2>
A debug message listing the data returned to the client.
% DHCP6_SERVER_FAILED server failed: %1
The IPv6 DHCP server has encountered a fatal error and is terminating.
The reason for the failure is included in the message.
% DHCP6_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone
The server has failed to establish communication with the rest of BIND
10 and is running in stand-alone mode. (This behavior will change once
the IPv6 DHCP server is properly integrated with the rest of BIND 10.)
% DHCP6_SHUTDOWN server shutdown
The IPv6 DHCP server has terminated normally.
% DHCP6_SHUTDOWN_REQUEST shutdown of server requested
This debug message indicates that a shutdown of the IPv6 server has
been requested via a call to the 'shutdown' method of the core Dhcpv6Srv
object.
% DHCP6_SRV_CONSTRUCT_ERROR error creating Dhcpv6Srv object, reason: %1
This error message indicates that during startup, the construction of a
core component within the IPv6 DHCP server (the Dhcpv6 server object)
has failed. As a result, the server will exit. The reason for the
failure is given within the message.
% DHCP6_STANDALONE skipping message queue, running standalone
This is a debug message indicating that the IPv6 server is running in
standalone mode, not connected to the message queue. Standalone mode
is only useful during program development, and should not be used in a
production environment.
% DHCP6_STARTING server starting
This informational message indicates that the IPv6 DHCP server has
processed any command-line switches and is starting.
% DHCP6_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4
This is a debug message issued during the IPv6 DHCP server startup.
It lists some information about the parameters with which the server
is running.

View File

@@ -14,23 +14,25 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <dhcp/dhcp6.h>
#include <dhcp/pkt6.h>
#include <dhcp/iface_mgr.h>
#include <dhcp6/dhcp6_srv.h>
#include <dhcp/option6_ia.h>
#include <dhcp/option6_iaaddr.h>
#include <dhcp/option6_addrlst.h>
#include <asiolink/io_address.h> #include <asiolink/io_address.h>
#include <dhcp6/dhcp6_log.h>
#include <dhcp6/dhcp6_srv.h>
#include <dhcp/dhcp6.h>
#include <dhcp/iface_mgr.h>
#include <dhcp/option6_addrlst.h>
#include <dhcp/option6_iaaddr.h>
#include <dhcp/option6_ia.h>
#include <dhcp/pkt6.h>
#include <exceptions/exceptions.h> #include <exceptions/exceptions.h>
#include <util/io_utilities.h> #include <util/io_utilities.h>
#include <util/range_utilities.h> #include <util/range_utilities.h>
using namespace std;
using namespace isc; using namespace isc;
using namespace isc::dhcp;
using namespace isc::asiolink; using namespace isc::asiolink;
using namespace isc::dhcp;
using namespace isc::util; using namespace isc::util;
using namespace std;
const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd"; const std::string HARDCODED_LEASE = "2001:db8:1::1234:abcd";
const uint32_t HARDCODED_T1 = 1500; // in seconds const uint32_t HARDCODED_T1 = 1500; // in seconds
@@ -40,14 +42,14 @@ const uint32_t HARDCODED_VALID_LIFETIME = 7200; // in seconds
const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1"; const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";
Dhcpv6Srv::Dhcpv6Srv(uint16_t port) { Dhcpv6Srv::Dhcpv6Srv(uint16_t port) {
cout << "Initialization: opening sockets on port " << port << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_OPEN_SOCKET).arg(port);
// first call to instance() will create IfaceMgr (it's a singleton) // First call to instance() will create IfaceMgr (it's a singleton)
// it may throw something if things go wrong // it may throw something if things go wrong
try { try {
if (IfaceMgr::instance().countIfaces() == 0) { if (IfaceMgr::instance().countIfaces() == 0) {
cout << "Failed to detect any network interfaces. Aborting." << endl; LOG_ERROR(dhcp6_logger, DHCP6_NO_INTERFACES);
shutdown_ = true; shutdown_ = true;
return; return;
} }
@@ -59,7 +61,7 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) {
/// @todo: instantiate LeaseMgr here once it is imlpemented. /// @todo: instantiate LeaseMgr here once it is imlpemented.
} catch (const std::exception &e) { } catch (const std::exception &e) {
cerr << "Error during DHCPv4 server startup: " << e.what() << endl; LOG_ERROR(dhcp6_logger, DHCP6_SRV_CONSTRUCT_ERROR).arg(e.what());
shutdown_ = true; shutdown_ = true;
return; return;
} }
@@ -68,13 +70,11 @@ Dhcpv6Srv::Dhcpv6Srv(uint16_t port) {
} }
Dhcpv6Srv::~Dhcpv6Srv() { Dhcpv6Srv::~Dhcpv6Srv() {
cout << "DHCPv6 Srv shutdown." << endl;
IfaceMgr::instance().closeSockets(); IfaceMgr::instance().closeSockets();
} }
void Dhcpv6Srv::shutdown() { void Dhcpv6Srv::shutdown() {
cout << "b10-dhcp6: DHCPv6 server shutdown." << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_BASIC, DHCP6_SHUTDOWN_REQUEST);
shutdown_ = true; shutdown_ = true;
} }
@@ -89,42 +89,58 @@ bool Dhcpv6Srv::run() {
if (query) { if (query) {
if (!query->unpack()) { if (!query->unpack()) {
cout << "Failed to parse incoming packet" << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL,
DHCP6_PACKET_PARSE_FAIL);
continue; continue;
} }
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL, DHCP6_PACKET_RECEIVED)
.arg(serverReceivedPacketName(query->getType()))
.arg(query->getType());
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA, DHCP6_QUERY_DATA)
.arg(query->getType())
.arg(query->getBuffer().getLength())
.arg(query->toText());
switch (query->getType()) { switch (query->getType()) {
case DHCPV6_SOLICIT: case DHCPV6_SOLICIT:
rsp = processSolicit(query); rsp = processSolicit(query);
break; break;
case DHCPV6_REQUEST: case DHCPV6_REQUEST:
rsp = processRequest(query); rsp = processRequest(query);
break; break;
case DHCPV6_RENEW: case DHCPV6_RENEW:
rsp = processRenew(query); rsp = processRenew(query);
break; break;
case DHCPV6_REBIND: case DHCPV6_REBIND:
rsp = processRebind(query); rsp = processRebind(query);
break; break;
case DHCPV6_CONFIRM: case DHCPV6_CONFIRM:
rsp = processConfirm(query); rsp = processConfirm(query);
break; break;
case DHCPV6_RELEASE: case DHCPV6_RELEASE:
rsp = processRelease(query); rsp = processRelease(query);
break; break;
case DHCPV6_DECLINE: case DHCPV6_DECLINE:
rsp = processDecline(query); rsp = processDecline(query);
break; break;
case DHCPV6_INFORMATION_REQUEST: case DHCPV6_INFORMATION_REQUEST:
rsp = processInfRequest(query); rsp = processInfRequest(query);
break; break;
default: default:
cout << "Unknown pkt type received:" // Only action is to output a message if debug is enabled,
<< query->getType() << endl; // and that will be covered by the debug statement before
// the "switch" statement.
;
} }
cout << "Received " << query->getBuffer().getLength() << " bytes packet type="
<< query->getType() << endl;
cout << query->toText();
if (rsp) { if (rsp) {
rsp->setRemoteAddr(query->getRemoteAddr()); rsp->setRemoteAddr(query->getRemoteAddr());
rsp->setLocalAddr(query->getLocalAddr()); rsp->setLocalAddr(query->getLocalAddr());
@@ -132,14 +148,16 @@ bool Dhcpv6Srv::run() {
rsp->setLocalPort(DHCP6_SERVER_PORT); rsp->setLocalPort(DHCP6_SERVER_PORT);
rsp->setIndex(query->getIndex()); rsp->setIndex(query->getIndex());
rsp->setIface(query->getIface()); rsp->setIface(query->getIface());
cout << "Replying with:" << rsp->getType() << endl;
cout << rsp->toText(); LOG_DEBUG(dhcp6_logger, DBG_DHCP6_DETAIL_DATA,
cout << "----" << endl; DHCP6_RESPONSE_DATA)
if (!rsp->pack()) { .arg(rsp->getType()).arg(rsp->toText());
cout << "Failed to assemble response packet." << endl;
continue; if (rsp->pack()) {
IfaceMgr::instance().send(rsp);
} else {
LOG_ERROR(dhcp6_logger, DHCP6_PACK_FAIL);
} }
IfaceMgr::instance().send(rsp);
} }
} }
@@ -350,3 +368,46 @@ Pkt6Ptr Dhcpv6Srv::processInfRequest(const Pkt6Ptr& infRequest) {
Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, infRequest->getTransid())); Pkt6Ptr reply(new Pkt6(DHCPV6_REPLY, infRequest->getTransid()));
return reply; return reply;
} }
const char*
Dhcpv6Srv::serverReceivedPacketName(uint8_t type) {
static const char* CONFIRM = "CONFIRM";
static const char* DECLINE = "DECLINE";
static const char* INFORMATION_REQUEST = "INFORMATION_REQUEST";
static const char* REBIND = "REBIND";
static const char* RELEASE = "RELEASE";
static const char* RENEW = "RENEW";
static const char* REQUEST = "REQUEST";
static const char* SOLICIT = "SOLICIT";
static const char* UNKNOWN = "UNKNOWN";
switch (type) {
case DHCPV6_CONFIRM:
return (CONFIRM);
case DHCPV6_DECLINE:
return (DECLINE);
case DHCPV6_INFORMATION_REQUEST:
return (INFORMATION_REQUEST);
case DHCPV6_REBIND:
return (REBIND);
case DHCPV6_RELEASE:
return (RELEASE);
case DHCPV6_RENEW:
return (RENEW);
case DHCPV6_REQUEST:
return (REQUEST);
case DHCPV6_SOLICIT:
return (SOLICIT);
default:
;
}
return (UNKNOWN);
}

View File

@@ -69,6 +69,24 @@ public:
/// @brief Instructs the server to shut down. /// @brief Instructs the server to shut down.
void shutdown(); void shutdown();
/// @brief Return textual type of packet received by server
///
/// Returns the name of valid packet received by the server (e.g. SOLICIT).
/// If the packet is unknown - or if it is a valid DHCP packet but not one
/// expected to be received by the server (such as an ADVERTISE), the string
/// "UNKNOWN" is returned. This method is used in debug messages.
///
/// As the operation of the method does not depend on any server state, it
/// is declared static.
///
/// @param type DHCPv4 packet type
///
/// @return Pointer to "const" string containing the packet name.
/// Note that this string is statically allocated and MUST NOT
/// be freed by the caller.
static const char* serverReceivedPacketName(uint8_t type);
protected: protected:
/// @brief Processes incoming SOLICIT and returns response. /// @brief Processes incoming SOLICIT and returns response.
/// ///

View File

@@ -14,13 +14,15 @@
#include <config.h> #include <config.h>
#include <iostream> #include <iostream>
#include <log/dummylog.h>
#include <log/logger_support.h>
#include <dhcp6/ctrl_dhcp6_srv.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
using namespace std; #include <dhcp6/ctrl_dhcp6_srv.h>
#include <dhcp6/dhcp6_log.h>
#include <log/logger_support.h>
using namespace isc::dhcp; using namespace isc::dhcp;
using namespace std;
/// This file contains entry point (main() function) for standard DHCPv6 server /// This file contains entry point (main() function) for standard DHCPv6 server
/// component for BIND10 framework. It parses command-line arguments and /// component for BIND10 framework. It parses command-line arguments and
@@ -37,11 +39,10 @@ const char* const DHCP6_NAME = "b10-dhcp6";
void void
usage() { usage() {
cerr << "Usage: b10-dhcp6 [-v]" cerr << "Usage: " << DHCP6_NAME << " [-v] [-s] [-p number]" << endl;
<< endl; cerr << " -v: verbose output" << endl;
cerr << "\t-v: verbose output" << endl; cerr << " -s: stand-alone mode (don't connect to BIND10)" << endl;
cerr << "\t-s: stand-alone mode (don't connect to BIND10)" << endl; cerr << " -p number: specify non-standard port number 1-65535 "
cerr << "\t-p number: specify non-standard port number 1-65535 "
<< "(useful for testing only)" << endl; << "(useful for testing only)" << endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@@ -52,18 +53,19 @@ main(int argc, char* argv[]) {
int ch; int ch;
int port_number = DHCP6_SERVER_PORT; // The default. Any other values are int port_number = DHCP6_SERVER_PORT; // The default. Any other values are
// useful for testing only. // useful for testing only.
bool stand_alone = false; // Should be connect to BIND10 msgq?
bool verbose_mode = false; // Should server be verbose? bool verbose_mode = false; // Should server be verbose?
bool stand_alone = false; // should be connect to BIND10 msgq?
while ((ch = getopt(argc, argv, "vsp:")) != -1) { while ((ch = getopt(argc, argv, "vsp:")) != -1) {
switch (ch) { switch (ch) {
case 'v': case 'v':
verbose_mode = true; verbose_mode = true;
isc::log::denabled = true;
break; break;
case 's': case 's':
stand_alone = true; stand_alone = true;
break; break;
case 'p': case 'p':
try { try {
port_number = boost::lexical_cast<int>(optarg); port_number = boost::lexical_cast<int>(optarg);
@@ -78,51 +80,45 @@ main(int argc, char* argv[]) {
usage(); usage();
} }
break; break;
case ':':
default: default:
usage(); usage();
} }
} }
// Check for extraneous parameters.
if (argc > optind) {
usage();
}
// Initialize logging. If verbose, we'll use maximum verbosity. // Initialize logging. If verbose, we'll use maximum verbosity.
isc::log::initLogger(DHCP6_NAME, isc::log::initLogger(DHCP6_NAME,
(verbose_mode ? isc::log::DEBUG : isc::log::INFO), (verbose_mode ? isc::log::DEBUG : isc::log::INFO),
isc::log::MAX_DEBUG_LEVEL, NULL); isc::log::MAX_DEBUG_LEVEL, NULL);
LOG_INFO(dhcp6_logger, DHCP6_STARTING);
cout << "b10-dhcp6: My pid=" << getpid() << ", binding to port " LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_START_INFO)
<< port_number << ", verbose " << (verbose_mode?"yes":"no") .arg(getpid()).arg(port_number).arg(verbose_mode ? "yes" : "no")
<< ", stand-alone=" << (stand_alone?"yes":"no") << endl; .arg(stand_alone ? "yes" : "no" );
if (argc - optind > 0) {
usage();
}
int ret = EXIT_SUCCESS; int ret = EXIT_SUCCESS;
try { try {
cout << "b10-dhcp6: Initiating DHCPv6 server operation." << endl;
/// @todo: pass verbose to the actual server once logging is implemented
ControlledDhcpv6Srv server(port_number); ControlledDhcpv6Srv server(port_number);
if (!stand_alone) { if (!stand_alone) {
try { try {
server.establishSession(); server.establishSession();
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
cerr << "Failed to establish BIND10 session. " LOG_ERROR(dhcp6_logger, DHCP6_SESSION_FAIL).arg(ex.what());
"Running in stand-alone mode:" << ex.what() << endl;
// Let's continue. It is useful to have the ability to run // Let's continue. It is useful to have the ability to run
// DHCP server in stand-alone mode, e.g. for testing // DHCP server in stand-alone mode, e.g. for testing
} }
} else { } else {
cout << "Skipping connection to the BIND10 msgq." << endl; LOG_DEBUG(dhcp6_logger, DBG_DHCP6_START, DHCP6_STANDALONE);
} }
server.run(); server.run();
LOG_INFO(dhcp6_logger, DHCP6_SHUTDOWN);
} catch (const std::exception& ex) { } catch (const std::exception& ex) {
cerr << "[b10-dhcp6] Server failed: " << ex.what() << endl; LOG_FATAL(dhcp6_logger, DHCP6_SERVER_FAILED).arg(ex.what());
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
} }

View File

@@ -42,10 +42,13 @@ if HAVE_GTEST
TESTS += dhcp6_unittests TESTS += dhcp6_unittests
dhcp6_unittests_SOURCES = ../dhcp6_srv.h ../dhcp6_srv.cc ../ctrl_dhcp6_srv.cc dhcp6_unittests_SOURCES = dhcp6_unittests.cc
dhcp6_unittests_SOURCES += dhcp6_unittests.cc
dhcp6_unittests_SOURCES += dhcp6_srv_unittest.cc dhcp6_unittests_SOURCES += dhcp6_srv_unittest.cc
dhcp6_unittests_SOURCES += ctrl_dhcp6_srv_unittest.cc dhcp6_unittests_SOURCES += ctrl_dhcp6_srv_unittest.cc
dhcp6_unittests_SOURCES += ../dhcp6_srv.h ../dhcp6_srv.cc
dhcp6_unittests_SOURCES += ../dhcp6_log.h ../dhcp6_log.cc
dhcp6_unittests_SOURCES += ../dhcp6_messages.h ../dhcp6_messages.cc
dhcp6_unittests_SOURCES += ../ctrl_dhcp6_srv.cc
if USE_CLANGPP if USE_CLANGPP
# Disable unused parameter warning caused by some of the # Disable unused parameter warning caused by some of the

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
// //
// Permission to use, copy, modify, and/or distribute this software for any // Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above // purpose with or without fee is hereby granted, provided that the above
@@ -223,4 +223,49 @@ TEST_F(Dhcpv6SrvTest, Solicit_basic) {
// more checks to be implemented // more checks to be implemented
} }
TEST_F(Dhcpv6SrvTest, serverReceivedPacketName) {
// Check all possible packet types
for (int itype = 0; itype < 256; ++itype) {
uint8_t type = itype;
switch (type) {
case DHCPV6_CONFIRM:
EXPECT_STREQ("CONFIRM", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_DECLINE:
EXPECT_STREQ("DECLINE", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_INFORMATION_REQUEST:
EXPECT_STREQ("INFORMATION_REQUEST",
Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_REBIND:
EXPECT_STREQ("REBIND", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_RELEASE:
EXPECT_STREQ("RELEASE", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_RENEW:
EXPECT_STREQ("RENEW", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_REQUEST:
EXPECT_STREQ("REQUEST", Dhcpv6Srv::serverReceivedPacketName(type));
break;
case DHCPV6_SOLICIT:
EXPECT_STREQ("SOLICIT", Dhcpv6Srv::serverReceivedPacketName(type));
break;
default:
EXPECT_STREQ("UNKNOWN", Dhcpv6Srv::serverReceivedPacketName(type));
}
}
} }
} // end of anonymous namespace

View File

@@ -27,16 +27,27 @@ import fcntl
class TestDhcpv6Daemon(unittest.TestCase): class TestDhcpv6Daemon(unittest.TestCase):
def setUp(self): def setUp(self):
# don't redirect stdout/stderr here as we want to print out things # Don't redirect stdout/stderr here as we want to print out things
# during the test # during the test
pass #
# However, we do want to set the logging lock directory to somewhere
# to which we can write - use the current working directory. We then
# set the appropriate environment variable. os.putenv() may be not
# supported on some platforms as suggested in
# http://docs.python.org/release/3.2/library/os.html?highlight=putenv#os.environ:
# "If the platform supports the putenv() function...". It was checked
# that it does not work on Ubuntu. To overcome this problem we access
# os.environ directly.
lockdir_envvar = "B10_LOCKFILE_DIR_FROM_BUILD"
if lockdir_envvar not in os.environ:
os.environ[lockdir_envvar] = os.getcwd()
def tearDown(self): def tearDown(self):
pass pass
def runCommand(self, params, wait=1): def runCommand(self, params, wait=1):
""" """
This method runs a command and returns a touple: (returncode, stdout, stderr) This method runs a command and returns a tuple: (returncode, stdout, stderr)
""" """
## @todo: Convert this into generic method and reuse it in dhcp4 and dhcp6 ## @todo: Convert this into generic method and reuse it in dhcp4 and dhcp6
@@ -79,9 +90,9 @@ class TestDhcpv6Daemon(unittest.TestCase):
fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
# There's potential problem if b10-dhcp4 prints out more # There's potential problem if b10-dhcp4 prints out more
# than 4k of text # than 16k of text
try: try:
output = os.read(self.stdout_pipes[0], 4096) output = os.read(self.stdout_pipes[0], 16384)
except OSError: except OSError:
print("No data available from stdout") print("No data available from stdout")
output = "" output = ""
@@ -91,7 +102,7 @@ class TestDhcpv6Daemon(unittest.TestCase):
output = "" output = ""
try: try:
error = os.read(self.stderr_pipes[0], 4096) error = os.read(self.stderr_pipes[0], 16384)
except OSError: except OSError:
print("No data available on stderr") print("No data available on stderr")
error = "" error = ""
@@ -130,8 +141,8 @@ class TestDhcpv6Daemon(unittest.TestCase):
print("Note: Purpose of some of the tests is to check if DHCPv6 server can be started,") print("Note: Purpose of some of the tests is to check if DHCPv6 server can be started,")
print(" not that is can bind sockets correctly. Please ignore binding errors.") print(" not that is can bind sockets correctly. Please ignore binding errors.")
(returncode, output, error) = self.runCommand(["../b10-dhcp6", "-v"]) (returncode, output, error) = self.runCommand(["../b10-dhcp6", "-v"])
output_text = str(output) + str(error)
self.assertEqual( str(output).count("b10-dhcp6: Initiating DHCPv6 server operation."), 1) self.assertEqual(output_text.count("DHCP6_STARTING"), 1)
def test_portnumber_0(self): def test_portnumber_0(self):
print("Check that specifying port number 0 is not allowed.") print("Check that specifying port number 0 is not allowed.")
@@ -180,27 +191,19 @@ class TestDhcpv6Daemon(unittest.TestCase):
def test_portnumber_nonroot(self): def test_portnumber_nonroot(self):
print("Check that specifying unprivileged port number will work.") print("Check that specifying unprivileged port number will work.")
(returncode, output, error) = self.runCommand(['../b10-dhcp6', '-s', '-p', '10547']) # Check that there is a message about running with an unprivileged port
(returncode, output, error) = self.runCommand(['../b10-dhcp6', '-v', '-s', '-p', '10547'])
# When invalid port number is specified, return code must not be success output_text = str(output) + str(error)
# TODO: Temporarily commented out as socket binding on systems that do not have self.assertEqual(output_text.count("DHCP6_OPEN_SOCKET opening sockets on port 10547"), 1)
# interface detection implemented currently fails.
# self.assertTrue(returncode == 0)
self.assertEqual( str(output).count("opening sockets on port 10547"), 1)
def test_skip_msgq(self): def test_skip_msgq(self):
print("Check that connection to BIND10 msgq can be disabled.") print("Check that connection to BIND10 msgq can be disabled.")
(returncode, output, error) = self.runCommand(['../b10-dhcp6', '-s', '-p', '10547']) # Check that the system outputs a message on one of its streams about running
# standalone.
# When invalid port number is specified, return code must not be success (returncode, output, error) = self.runCommand(['../b10-dhcp6', '-v', '-s', '-p', '10547'])
# TODO: Temporarily commented out as socket binding on systems that do not have output_text = str(output) + str(error)
# interface detection implemented currently fails. self.assertEqual(output_text.count("DHCP6_STANDALONE"), 1)
# self.assertTrue(returncode == 0)
self.assertEqual( str(output).count("Skipping connection to the BIND10 msgq."), 1)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()

View File

@@ -1 +1,2 @@
/b10-host /b10-host
/b10-host.1

View File

@@ -17,14 +17,21 @@ b10_host_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
b10_host_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la b10_host_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
man_MANS = b10-host.1 man_MANS = b10-host.1
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-host.xml EXTRA_DIST = $(man_MANS) b10-host.xml
.PHONY: man .PHONY: man
if ENABLE_MAN if GENERATE_DOCS
man: b10-host.1 man: b10-host.1
b10-host.1: b10-host.xml b10-host.1: b10-host.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.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 endif

View File

@@ -1,118 +0,0 @@
'\" t
.\" Title: b10-host
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: May 4, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-HOST" "1" "May 4, 2011" "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-host \- DNS lookup utility
.SH "SYNOPSIS"
.HP \w'\fBb10\-host\fR\ 'u
\fBb10\-host\fR [\fB\-a\fR] [\fB\-c\ \fR\fB\fIclass\fR\fR] [\fB\-d\fR] [\fB\-p\ \fR\fB\fIport\fR\fR] [\fB\-r\fR] [\fB\-t\ \fR\fB\fItype\fR\fR] [\fB\-v\fR] [\fIname\fR] [\fB\fIserver\fR\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-host\fR
utility does DNS lookups\&. Its initial goal is to be a
\fBhost\fR(1)
clone, but also add a few features useful for BIND 10 development testing\&.
.PP
By default, it looks up the A, AAAA, and MX record sets for the
\fIname\fR\&. Optionally, you may select a name server to query against by adding the
\fIserver\fR
argument\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-a\fR
.RS 4
Enable verbose mode and do a query for type ANY\&. (If the
\fB\-t\fR
option is also set, then the ANY query is not done, but it still uses verbose mode\&.)
.RE
.PP
\fB\-c \fR\fB\fIclass\fR\fR
.RS 4
Define the class for the query\&. The default is IN (Internet)\&.
.RE
.PP
\fB\-d\fR
.RS 4
Enable verbose output mode, including elapsed time in milliseconds\&. Verbose mode shows the header, question, answer, authority, and additional sections (if provided)\&. (Same as
\fB\-v\fR\&.)
.RE
.PP
\fB\-p \fR\fB\fIport\fR\fR
.RS 4
Select an alternative port for the query\&. This may be a number or a service name\&. The default is 53 (domain)\&. This is not a standard feature of
\fBhost\fR(1)\&.
.RE
.PP
\fB\-r\fR
.RS 4
Disable recursive processing by not setting the Recursion Desired flag in the query\&.
.RE
.PP
\fB\-t \fR\fB\fItype\fR\fR
.RS 4
Select a specific resource record type for the query\&. By default, it looks up the A, AAAA, and MX record sets\&.
(This overrides the
\fB\-a\fR
option\&.)
.RE
.PP
\fB\-v\fR
.RS 4
Same as
\fB\-d\fR
option\&.
.RE
.SH "COMPATIBILITY / BUGS"
.PP
\fBb10\-host\fR
does not do reverse lookups by default yet (by detecting if name is a IPv4 or IPv6 address)\&.
.PP
Unknown
\fB\-c\fR
class or
\fB\-t\fR
type causes
\fBb10\-host\fR
to Abort\&.
.PP
Not all types are supported yet for formatting\&. Not all switches are supported yet\&.
.PP
It doesn\'t use
/etc/resolv\&.conf
at this time\&. The default name server used is 127\&.0\&.0\&.1\&.
.PP
\fB\-p\fR
is not a standard feature\&.
.SH "HISTORY"
.PP
The C++ version of
\fBb10\-host\fR
was started in October 2009 by Jeremy C\&. Reed of ISC\&. Its usage and output were based on the standard
\fBhost\fR
command\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2011 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/b10-loadzone /b10-loadzone
/b10-loadzone.py /b10-loadzone.py
/run_loadzone.sh /run_loadzone.sh
/b10-loadzone.8

View File

@@ -5,12 +5,19 @@ noinst_SCRIPTS = run_loadzone.sh
CLEANFILES = b10-loadzone CLEANFILES = b10-loadzone
man_MANS = b10-loadzone.8 man_MANS = b10-loadzone.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-loadzone.xml EXTRA_DIST = $(man_MANS) b10-loadzone.xml
if ENABLE_MAN if GENERATE_DOCS
b10-loadzone.8: b10-loadzone.xml b10-loadzone.8: b10-loadzone.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.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 endif

View File

@@ -1,80 +0,0 @@
'\" t
.\" Title: b10-loadzone
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: March 26, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-LOADZONE" "8" "March 26, 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-loadzone \- Load DNS Zone File
.SH "SYNOPSIS"
.HP \w'\fBb10\-loadzone\fR\ 'u
\fBb10\-loadzone\fR [\fB\-d\ \fR\fB\fIdatabase\fR\fR] [\fB\-o\ \fR\fB\fIorigin\fR\fR] {filename}
.SH "DESCRIPTION"
.PP
The
\fBb10\-loadzone\fR
utility loads a RFC 1035 style DNS master zone file and stores it in a BIND 10 ready data source format\&. Master files are text files that contain DNS Resource Records in text form\&.
.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
Currently only the SQLITE3 data source is supported\&.
.sp .5v
.RE
.PP
Some control entries (aka directives) are supported\&. $ORIGIN is followed by a domain name, and sets the the origin that will be used for relative domain names in subsequent records\&. $INCLUDE is followed by a filename to load\&.
The previous origin is restored after the file is included\&.
$TTL is followed by a time\-to\-live value which is used by any following records that don\'t specify a TTL\&.
.PP
When re\-loading an existing zone, the prior version is completely removed\&. While the new version of the zone is being loaded, the old version remains accessible to queries\&. After the new version is completely loaded, the old version is swapped out and replaced with the new one in a single operation\&.
.SH "ARGUMENTS"
.PP
\-d \fIdatabase\fR
.RS 4
Defines the filename for the database\&. The default is
/usr/local/var/bind10\-devel/zone\&.sqlite3\&.
.RE
.PP
\-o \fIorigin\fR
.RS 4
Defines the default origin for the zone file records\&.
.RE
.SH "FILES"
.PP
.SH "SEE ALSO"
.PP
\fBb10-auth\fR(8),
\fBbind10\fR(8)\&.
.SH "AUTHORS"
.PP
The
\fBb10\-loadzone\fR
tool was initial written by Evan Hunt of ISC\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -12,6 +12,7 @@ EXTRA_DIST += ttl1.db
EXTRA_DIST += ttl2.db EXTRA_DIST += ttl2.db
EXTRA_DIST += ttlext.db EXTRA_DIST += ttlext.db
EXTRA_DIST += example.db EXTRA_DIST += example.db
EXTRA_DIST += comment.db
noinst_SCRIPTS = correct_test.sh noinst_SCRIPTS = correct_test.sh

View File

@@ -0,0 +1,8 @@
; Test removal of comments and not removal from strings.
; We had a bug - see #2188.
comment.example.com. 60 IN SOA ns1.example.com. hostmaster.example.com. 1 43200 900 1814400 7200
comment.example.com. 60 IN NS ns1.example.com.
comment.example.com. 60 IN TXT "Simple text"
comment.example.com. 60 IN TXT "; No comment"
comment.example.com. 60 IN TXT "Also no comment here" ; But here it is a comment
comment.example.com. 60 IN TXT "A combination ; see?" ; This is a "comment

View File

@@ -48,6 +48,9 @@ ${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 ttlext.db >> /
echo "loadzone example.com. from example.db" echo "loadzone example.com. from example.db"
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 example.db >> /dev/null ${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 example.db >> /dev/null
echo "loadzone comment.example.com. from comment.db"
${LOADZONE_PATH}/b10-loadzone -d ${TEST_OUTPUT_PATH}/zone.sqlite3 comment.db >> /dev/null
echo "I:test master file \$INCLUDE semantics" echo "I:test master file \$INCLUDE semantics"
echo "I:test master file BIND 8 compatibility TTL and \$TTL semantics" echo "I:test master file BIND 8 compatibility TTL and \$TTL semantics"
echo "I:test master file RFC1035 TTL and \$TTL semantics" echo "I:test master file RFC1035 TTL and \$TTL semantics"
@@ -55,6 +58,7 @@ echo "I:test master file BIND8 compatibility and mixed \$INCLUDE with \$TTL sema
echo "I:test master file RFC1035 TTL and mixed \$INCLUDE with \$TTL semantics" echo "I:test master file RFC1035 TTL and mixed \$INCLUDE with \$TTL semantics"
echo "I:test master file BIND9 extenstion of TTL" echo "I:test master file BIND9 extenstion of TTL"
echo "I:test master file RFC1035 missing CLASS, TTL, NAME semantics" echo "I:test master file RFC1035 missing CLASS, TTL, NAME semantics"
echo "I:test master file comments"
${PYTHON_EXEC} ${TEST_FILE_PATH}/get_zonedatas.py ${TEST_OUTPUT_PATH}/zone.sqlite3 > ${TEST_OUTPUT_PATH}/test.out ${PYTHON_EXEC} ${TEST_FILE_PATH}/get_zonedatas.py ${TEST_OUTPUT_PATH}/zone.sqlite3 > ${TEST_OUTPUT_PATH}/test.out
echo "Compare test results." echo "Compare test results."

View File

@@ -1,7 +1,7 @@
from isc.datasrc import sqlite3_ds from isc.datasrc import sqlite3_ds
import sys import sys
ZONE_FILE = sys.argv[1] ZONE_FILE = sys.argv[1]
zonename_set = ["include.", "ttl1.", "ttl2.", "mix1.", "mix2.", "ttlext.", "example.com."] zonename_set = ["include.", "ttl1.", "ttl2.", "mix1.", "mix2.", "ttlext.", "example.com.", "comment.example.com."]
for zone_name in zonename_set: for zone_name in zonename_set:
for rr_data in sqlite3_ds.get_zone_datas(zone_name, ZONE_FILE): for rr_data in sqlite3_ds.get_zone_datas(zone_name, ZONE_FILE):
data_len = len(rr_data[2]) data_len = len(rr_data[2])

View File

@@ -77,3 +77,9 @@ ns2.example.com. 80 IN A 1.1.1.1
ns3.example.com. 60 IN A 2.2.2.2 ns3.example.com. 60 IN A 2.2.2.2
ns4.example.com. 60 IN A 3.3.3.3 ns4.example.com. 60 IN A 3.3.3.3
ns5.example.com. 90 IN A 4.4.4.4 ns5.example.com. 90 IN A 4.4.4.4
comment.example.com. 60 IN SOA ns1.example.com. hostmaster.example.com. 1 43200 900 1814400 7200
comment.example.com. 60 IN NS ns1.example.com.
comment.example.com. 60 IN TXT "Simple text"
comment.example.com. 60 IN TXT "; No comment"
comment.example.com. 60 IN TXT "Also no comment here"
comment.example.com. 60 IN TXT "A combination ; see?"

View File

@@ -1,3 +1,4 @@
/b10-msgq /b10-msgq
/msgq.py /msgq.py
/run_msgq.sh /run_msgq.sh
/b10-msgq.8

View File

@@ -7,12 +7,19 @@ pkglibexec_SCRIPTS = b10-msgq
CLEANFILES = b10-msgq msgq.pyc CLEANFILES = b10-msgq msgq.pyc
man_MANS = b10-msgq.8 man_MANS = b10-msgq.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) msgq.xml EXTRA_DIST = $(man_MANS) msgq.xml
if ENABLE_MAN if GENERATE_DOCS
b10-msgq.8: msgq.xml b10-msgq.8: msgq.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.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 endif

View File

@@ -1,125 +0,0 @@
'\" t
.\" Title: b10-msgq
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: June 25, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-MSGQ" "8" "June 25, 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-msgq \- message routing daemon for the Command Channel
.SH "SYNOPSIS"
.HP \w'\fBb10\-msgq\fR\ 'u
\fBb10\-msgq\fR [\fB\-s\ \fR\fB\fIfile\fR\fR] [\fB\-v\fR] [\fB\-\-socket\-file\ \fR\fB\fIfile\fR\fR] [\fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-msgq\fR
daemon provides message routing for the Command Channel\&.
.PP
The Command Channel is a message bus and subscription manager\&. Programs may subscribe to certain groups to receive messages for that group\&. Every new connection to
\fBb10\-msgq\fR
is assigned a unique identifier \-\- this is the local name\&. The commands it handles are:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBgetlname\fR
\(em receive local name\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBsend\fR
\(em send a message to defined subscribers\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBsubscribe\fR
\(em add a subscription\&. This means it is a listener for messages for a specific group\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\fBunsubscribe\fR
\(em remove a subscription\&.
.RE
.sp
.RE
.PP
The
\fBb10\-msgq\fR
daemon may be cleanly stopped by sending the SIGTERM signal to the process\&. This shutdown does not notify the subscribers\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-s \fR\fB\fIfile\fR\fR, \fB\-\-socket\-file \fR\fB\fIfile\fR\fR
.RS 4
The UNIX domain socket file this daemon will use\&. The default is
/usr/local/var/bind10\-devel/msg_socket\&.
.RE
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
Enabled verbose mode\&. This enables diagnostic messages to STDERR\&. Displays more about what
\fBb10\-msgq\fR
is doing\&.
.RE
.SH "SEE ALSO"
.PP
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "AUTHORS"
.PP
The
\fBb10\-msgq\fR
daemon and Control Channel specification were initially designed by Michael Graff of ISC\&.
.SH "HISTORY"
.PP
The python version was first coded in December 2009\&. The C version with now deprecated wire format was coded in September 2009\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -5,3 +5,4 @@
/resolver_messages.h /resolver_messages.h
/spec_config.h /spec_config.h
/spec_config.h.pre /spec_config.h.pre
/b10-resolver.8

View File

@@ -23,12 +23,19 @@ CLEANFILES += resolver.spec spec_config.h
CLEANFILES += resolver_messages.cc resolver_messages.h CLEANFILES += resolver_messages.cc resolver_messages.h
man_MANS = b10-resolver.8 man_MANS = b10-resolver.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-resolver.xml resolver_messages.mes EXTRA_DIST = $(man_MANS) b10-resolver.xml resolver_messages.mes
if ENABLE_MAN if GENERATE_DOCS
b10-resolver.8: b10-resolver.xml b10-resolver.8: b10-resolver.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.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 endif

View File

@@ -1,149 +0,0 @@
'\" t
.\" Title: b10-resolver
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: February 28, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-RESOLVER" "8" "February 28, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
b10-resolver \- Recursive DNS server
.SH "SYNOPSIS"
.HP \w'\fBb10\-resolver\fR\ 'u
\fBb10\-resolver\fR [\fB\-v\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-resolver\fR
daemon provides the BIND 10 recursive 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\-resolver\fR
will exit\&.
.PP
It also receives its configurations from
\fBb10-cfgmgr\fR(8)\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-v\fR
.RS 4
Enable verbose mode\&. This sets logging to the maximum debugging level\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable settings are:
.PP
\fIforward_addresses\fR
defines the list of addresses and ports that
\fBb10\-resolver\fR
should forward queries to\&. Defining this enables forwarding\&.
.PP
\fIlisten_on\fR
is a list of addresses and ports for
\fBb10\-resolver\fR
to listen on\&. The list items are the
\fIaddress\fR
string and
\fIport\fR
number\&. The defaults are address ::1 port 53 and address 127\&.0\&.0\&.1 port 53\&.
.PP
\fIquery_acl\fR
is a list of query access control rules\&. The list items are the
\fIaction\fR
string and the
\fIfrom\fR
or
\fIkey\fR
strings\&. The possible actions are ACCEPT, REJECT and DROP\&. The
\fIfrom\fR
is a remote (source) IPv4 or IPv6 address or special keyword\&. The
\fIkey\fR
is a TSIG key name\&. The default configuration accepts queries from 127\&.0\&.0\&.1 and ::1\&.
.PP
\fIretries\fR
is the number of times to retry (resend query) after a query timeout (\fItimeout_query\fR)\&. The default is 3\&.
.PP
\fIroot_addresses\fR
is a list of addresses and ports for
\fBb10\-resolver\fR
to use directly as root servers to start resolving\&. The list items are the
\fIaddress\fR
string and
\fIport\fR
number\&. By default, a hardcoded address for l\&.root\-servers\&.net (199\&.7\&.83\&.42 or 2001:500:3::42) is used\&.
.PP
\fItimeout_client\fR
is the number of milliseconds to wait before timing out the incoming client query\&. If set to \-1, this timeout is disabled\&. The default is 4000\&. After this timeout, a SERVFAIL is sent back to the client asking the question\&. (The lookup may continue after the timeout, but a later answer is not returned for the now\-past query\&.)
.PP
\fItimeout_lookup\fR
is the number of milliseconds before it stops trying the query\&. If set to \-1, this timeout is disabled\&. The default is 30000\&.
.PP
\fItimeout_query\fR
is the number of milliseconds to wait before it retries a query\&. If set to \-1, this timeout is disabled\&. The default is 2000\&.
.PP
The configuration command is:
.PP
\fBshutdown\fR
exits
\fBb10\-resolver\fR\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.SH "SEE ALSO"
.PP
\fBb10-cfgmgr\fR(8),
\fBb10-cmdctl\fR(8),
\fBb10-msgq\fR(8),
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-resolver\fR
daemon was first coded in September 2010\&. The initial implementation only provided forwarding\&. Iteration was introduced in January 2011\&. Caching was implemented in February 2011\&. Access control was introduced in June 2011\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1 +1,2 @@
/b10-sockcreator /b10-sockcreator
/b10-sockcreator.8

View File

@@ -12,6 +12,23 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
CLEANFILES = *.gcno *.gcda CLEANFILES = *.gcno *.gcda
man_MANS = b10-sockcreator.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-sockcreator.xml
if GENERATE_DOCS
b10-sockcreator.8: b10-sockcreator.xml
@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-sockcreator.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
pkglibexec_PROGRAMS = b10-sockcreator pkglibexec_PROGRAMS = b10-sockcreator
b10_sockcreator_SOURCES = sockcreator.cc sockcreator.h main.cc b10_sockcreator_SOURCES = sockcreator.cc sockcreator.h main.cc

View File

@@ -0,0 +1,96 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- 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.
-->
<refentry>
<refentryinfo>
<date>February 28, 2012</date>
</refentryinfo>
<refmeta>
<refentrytitle>b10-sockcreator</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND10</refmiscinfo>
</refmeta>
<refnamediv>
<refname>b10-sockcreator</refname>
<refpurpose>socket creation daemon</refpurpose>
</refnamediv>
<docinfo>
<copyright>
<year>2012</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
<refsynopsisdiv>
<cmdsynopsis>
<command>b10-sockcreator</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>
The <command>b10-sockcreator</command> daemon's entire job
is to create sockets and assign names to them.
It is started by
<citerefentry><refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum></citerefentry>
and communicates with it.
The new socket is sent over a file descriptor.
</para>
<!-- TODO: integrate README here -->
<para>
The <command>b10-sockcreator</command> daemon will exit
if there is an unrecoverable error or unknown command.
</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>
<citerefentry>
<refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 10 Guide</citetitle>.
</para>
<!-- TODO: point to developer docs -->
</refsect1>
<refsect1>
<title>AUTHORS</title>
<para>
The <command>b10-sockcreator</command> daemon
was initially designed by Michal Vaner of CZNIC.
</para>
</refsect1>
</refentry><!--
- Local variables:
- mode: sgml
- End:
-->

View File

@@ -2,3 +2,5 @@
/b10-stats-httpd /b10-stats-httpd
/stats.py /stats.py
/stats_httpd.py /stats_httpd.py
/b10-stats-httpd.8
/b10-stats.8

View File

@@ -20,18 +20,25 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.py
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.pyc
man_MANS = b10-stats.8 b10-stats-httpd.8 man_MANS = b10-stats.8 b10-stats-httpd.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-stats.xml b10-stats-httpd.xml EXTRA_DIST = $(man_MANS) b10-stats.xml b10-stats-httpd.xml
EXTRA_DIST += stats.spec stats-httpd.spec EXTRA_DIST += stats.spec stats-httpd.spec
EXTRA_DIST += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl EXTRA_DIST += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl
EXTRA_DIST += stats_messages.mes stats_httpd_messages.mes EXTRA_DIST += stats_messages.mes stats_httpd_messages.mes
if ENABLE_MAN if GENERATE_DOCS
b10-stats.8: b10-stats.xml b10-stats.8: b10-stats.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml
b10-stats-httpd.8: b10-stats-httpd.xml b10-stats-httpd.8: b10-stats-httpd.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.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 endif

View File

@@ -1,126 +0,0 @@
'\" t
.\" Title: b10-stats-httpd
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: February 28, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-STATS\-HTTPD" "8" "February 28, 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-stats-httpd \- BIND 10 HTTP server for HTTP/XML interface of statistics
.SH "SYNOPSIS"
.HP \w'\fBb10\-stats\-httpd\fR\ 'u
\fBb10\-stats\-httpd\fR [\fB\-v\fR]| [\fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
\fBb10\-stats\-httpd\fR
is a standalone HTTP server\&. It is intended for HTTP/XML interface for statistics module\&. This server process runs as a process separated from the process of the BIND 10 Stats daemon (\fBb10\-stats\fR)\&. The server is initially executed by the BIND 10 boss process (\fBbind10\fR) and eventually exited by it\&. The server is intended to serve requests by HTTP clients like web browsers and third\-party modules\&. When the server is asked, it requests BIND 10 statistics data or its schema from
\fBb10\-stats\fR
which sends the data back in Python dictionary format, and the server converts it into XML format\&. The server sends it to the HTTP client\&. The server can send three types of documents, which are XML (Extensible Markup Language), XSD (XML Schema definition) and XSL (Extensible Stylesheet Language)\&. The XML document is the statistics data of BIND 10, the XSD document is the data schema of it, and the XSL document is the style sheet to be showed for the web browsers\&. There is different URL for each document\&. But please note that you would be redirected to the URL of XML document if you request the URL of the root document\&. For example, you would be redirected to http://127\&.0\&.0\&.1:8000/bind10/statistics/xml if you request http://127\&.0\&.0\&.1:8000/\&. Please see the manual and the spec file of
\fBb10\-stats\fR
for more details about the items of BIND 10 statistics\&. The server uses CC session in communication with
\fBb10\-stats\fR\&. CC session is provided by
\fBb10\-msgq\fR
which is started by
\fBbind10\fR
in advance\&. The server is implemented by HTTP\-server libraries included in Python 3\&. The server obtains the configuration from the config manager (\fBb10\-cfgmgr\fR) in runtime\&. Please see below for more details about this spec file and configuration of the server\&.
.SH "OPTIONS"
.PP
The argument is as follow:
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
\fBb10\-stats\-httpd\fR
switches to verbose mode and sends verbose messages to STDOUT\&.
.RE
.SH "FILES"
.PP
/usr/local/share/bind10\-devel/stats\-httpd\&.spec
\(em the spec file of
\fBb10\-stats\-httpd\fR\&. This file contains configurable settings of
\fBb10\-stats\-httpd\fR\&. This setting can be configured in runtime via
bindctl(1)\&. Please see the manual of
bindctl(1)
about how to configure the settings\&.
.PP
/usr/local/share/bind10\-devel/stats\-httpd\-xml\&.tpl
\(em the template file of XML document\&.
.PP
/usr/local/share/bind10\-devel/stats\-httpd\-xsd\&.tpl
\(em the template file of XSD document\&.
.PP
/usr/local/share/bind10\-devel/stats\-httpd\-xsl\&.tpl
\(em the template file of XSL document\&.
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable setting in
stats\-httpd\&.spec
is:
.PP
\fIlisten_on\fR
.RS 4
a list of pairs of address and port for
\fBb10\-stats\-httpd\fR
to listen HTTP requests on\&. The pair consists of the
\fIaddress\fR
string and
\fIport\fR
number\&. The default setting is the list of address 127\&.0\&.0\&.1 port 8000\&. If the server is started by the default setting being left, for example, the URL for XML document is http://127\&.0\&.0\&.1:8000/bind10/statistics/xml\&. And also IPv6 addresses can be configured and they works in the runtime environment for dual stack\&. You can change the settings through
bindctl(8)\&.
.RE
.PP
The commands in
stats\-httpd\&.spec
are:
.PP
\fBstatus\fR
.RS 4
shows the status of
\fBb10\-stats\-httpd\fR
with its PID\&.
.RE
.PP
\fBshutdown\fR
.RS 4
exits the
\fBb10\-stats\-httpd\fR
process\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.RE
.SH "SEE ALSO"
.PP
\fBb10-stats\fR(8),
\fBb10-msgq\fR(8),
\fBb10-cfgmgr\fR(8),
\fBbind10\fR(8),
\fBbindctl\fR(1),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
\fBb10\-stats\-httpd\fR
was designed and implemented by Naoki Kambe of JPRS in March 2011\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2011-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,170 +0,0 @@
'\" t
.\" Title: b10-stats
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
.\" Date: June 20, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-STATS" "8" "June 20, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
b10-stats \- BIND 10 statistics module
.SH "SYNOPSIS"
.HP \w'\fBb10\-stats\fR\ 'u
\fBb10\-stats\fR [\fB\-v\fR] [\fB\-\-verbose\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-stats\fR
daemon collects statistics data from each BIND 10 module\&. Its statistics information may be reported via
\fBbindctl\fR
or
\fBb10\-stats\-httpd\fR\&. It is started by
\fBbind10\fR
and communicates by using the Command Channel by
\fBb10\-msgq\fR
with other modules like
\fBbind10\fR,
\fBb10\-auth\fR
and so on\&.
\fBb10\-stats\fR
periodically requests statistics data to each module and receives\&. The interval time can be configured via
\fBbindctl\fR\&.
\fBb10\-stats\fR
cannot accept any command from other modules for updating statistics data\&. The stats module collects data and aggregates it\&.
\fBb10\-stats\fR
invokes an internal command for
\fBbind10\fR
after its initial starting to make sure it collects statistics data from
\fBbind10\fR\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-v\fR, \fB\-\-verbose\fR
.RS 4
This enables maximum debug logging\&.
.RE
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable setting in
stats\&.spec
is:
.PP
\fIpoll\-interval\fR
.RS 4
is a timer interval in seconds for
\fBb10\-stats\fR
to polling each module for its statistics data\&. The default is 60 second\&. Polling can be disabled by setting to 0\&. The type of the value should be an unsigned integer\&. Setting to a negative integer is ignored\&.
.RE
.PP
The configuration commands are:
.PP
\fBshow\fR
will send the statistics data in JSON format\&. By default, it outputs all the statistics data it has collected\&. An optional item name may be specified to receive individual output\&.
.PP
\fBshowschema\fR
will send the schema of the statistics data in JSON format\&. The output is equivalent to the statistics part of
stats\&.spec\&.
.PP
\fBshutdown\fR
will shutdown the
\fBb10\-stats\fR
process\&. This has an optional
\fIpid\fR
argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
.PP
\fBstatus\fR
simply indicates that the daemon is running\&.
.SH "STATISTICS DATA"
.PP
The
\fBb10\-stats\fR
daemon contains these
\(lqStats\(rq
statistics:
.PP
boot_time
.RS 4
The date and time when this daemon was started in ISO 8601 format\&. This is a constant which can\*(Aqt be reset except by restarting
\fBb10\-stats\fR\&.
.RE
.PP
last_update_time
.RS 4
The date and time (in ISO 8601 format) when this daemon last received data from another component\&.
.RE
.PP
lname
.RS 4
This is the name used for the
\fBb10\-msgq\fR
command\-control channel\&. (This is a constant which can\*(Aqt be reset except by restarting
\fBb10\-stats\fR\&.)
.RE
.PP
report_time
.RS 4
The latest report date and time in ISO 8601 format\&.
.RE
.PP
start_time
.RS 4
This is the date and time (in ISO 8601 format) when this daemon started collecting data\&.
.RE
.PP
timestamp
.RS 4
The current date and time represented in seconds since UNIX epoch (1970\-01\-01T00:00:00Z) with precision (delimited with a period) up to one hundred thousandth of second\&.
.RE
.PP
See other manual pages for explanations for their statistics that are kept track by
\fBb10\-stats\fR\&.
.SH "FILES"
.PP
/usr/local/share/bind10\-devel/stats\&.spec
\(em This is a spec file for
\fBb10\-stats\fR\&. It contains commands for
\fBb10\-stats\fR\&. They can be invoked via
bindctl(1)\&.
.SH "SEE ALSO"
.PP
\fBb10-stats-httpd\fR(8),
\fBbind10\fR(8),
\fBbindctl\fR(1),
\fBb10-auth\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-stats\fR
daemon was initially designed and implemented by Naoki Kambe of JPRS in October 2010\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,2 +1,3 @@
/isc-sysinfo /isc-sysinfo
/sysinfo.py /sysinfo.py
/isc-sysinfo.1

View File

@@ -12,11 +12,18 @@ MAN1_FILES = \
man_MANS = \ man_MANS = \
$(MAN1_FILES:.xml=.1) $(MAN1_FILES:.xml=.1)
DISTCLEANFILES = $(man_MANS)
if ENABLE_MAN if GENERATE_DOCS
.xml.1: .xml.1:
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
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 endif

View File

@@ -1,66 +0,0 @@
'\" t
.\" Title: isc-sysinfo
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: June 26, 2012
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "ISC\-SYSINFO" "1" "June 26, 2012" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
isc-sysinfo \- BIND 10 system information display tool
.SH "SYNOPSIS"
.HP \w'\fBisc\-sysinfo\fR\ 'u
\fBisc\-sysinfo\fR
.SH "DESCRIPTION"
.PP
The
\fBisc\-sysinfo\fR
program collects and outputs a variety of information about the system that BIND 10 is running on\&. This information can be useful to people involved in debugging and technical support\&.
.SH "ARGUMENTS"
.PP
\-h
.RS 4
Displays usage instructions\&.
.RE
.PP
\-o \fIoutput\-file\fR
.RS 4
If an output file is specified, the output of
\fBisc\-sysinfo\fR
is written to this file\&. By default, the output is written to standard output\&.
.RE
.SH "SEE ALSO"
.PP
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBisc\-sysinfo\fR
daemon was initially implemented by ISC staff in June, 2012\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2012 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/b10-cmdctl-usermgr /b10-cmdctl-usermgr
/b10-cmdctl-usermgr.py /b10-cmdctl-usermgr.py
/run_b10-cmdctl-usermgr.sh /run_b10-cmdctl-usermgr.sh
/b10-cmdctl-usermgr.8

View File

@@ -5,12 +5,19 @@ b10_cmdctl_usermgrdir = $(pkgdatadir)
CLEANFILES= b10-cmdctl-usermgr CLEANFILES= b10-cmdctl-usermgr
man_MANS = b10-cmdctl-usermgr.8 man_MANS = b10-cmdctl-usermgr.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-cmdctl-usermgr.xml EXTRA_DIST = $(man_MANS) b10-cmdctl-usermgr.xml
if ENABLE_MAN if GENERATE_DOCS
b10-cmdctl-usermgr.8: b10-cmdctl-usermgr.xml b10-cmdctl-usermgr.8: b10-cmdctl-usermgr.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.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 endif

View File

@@ -1,74 +0,0 @@
'\" t
.\" Title: b10-cmdctl-usermgr
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: March 17, 2010
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-CMDCTL\-USERMGR" "8" "March 17, 2010" "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-cmdctl-usermgr \- cmdctl user maintenance tool
.SH "SYNOPSIS"
.HP \w'\fBb10\-cmdctl\-usermgr\fR\ 'u
\fBb10\-cmdctl\-usermgr\fR [\fB\-f\ \fR\fB\fIfilename\fR\fR] [\fB\-h\fR] [\fB\-v\fR] [\fB\-\-file\ \fR\fB\fIfilename\fR\fR] [\fB\-\-help\fR] [\fB\-\-version\fR]
.SH "DESCRIPTION"
.PP
The
\fBb10\-cmdctl\-usermgr\fR
tool may be used to add accounts with passwords for the
\fBb10-cmdctl\fR(8)
daemon\&.
.PP
By default, the accounts are saved in the
cmdctl\-accounts\&.csv
file in the current directory, unless the
\fB\-\-filename\fR
switch is used\&. The entry is appended to the file\&.
.PP
The tool can\'t remove or replace existing entries\&.
.SH "OPTIONS"
.PP
The arguments are as follows:
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Report the usage statement and exit\&.
.RE
.PP
\fB\-f \fR\fB\fIfilename\fR\fR, \fB\-\-file \fR\fB\fIfilename\fR\fR
.RS 4
Define the filename to append the account to\&. The default is
cmdctl\-accounts\&.csv
in the current directory\&.
.RE
.PP
\fB\-v\fR, \fB\-\-version\fR
.RS 4
Report the version and exit\&.
.RE
.SH "SEE ALSO"
.PP
\fBb10-cmdctl\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-cmdctl\-usermgr\fR
tool was implemented in January 2010 by Zhang Likun of CNNIC for the ISC BIND 10 project\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
.br

View File

@@ -1,3 +1,4 @@
/b10-xfrin /b10-xfrin
/run_b10-xfrin.sh /run_b10-xfrin.sh
/xfrin.py /xfrin.py
/b10-xfrin.8

View File

@@ -15,13 +15,20 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.py
CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.pyc CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.pyc
man_MANS = b10-xfrin.8 man_MANS = b10-xfrin.8
DISTCLEANFILES = $(man_MANS)
EXTRA_DIST = $(man_MANS) b10-xfrin.xml EXTRA_DIST = $(man_MANS) b10-xfrin.xml
EXTRA_DIST += xfrin.spec xfrin_messages.mes EXTRA_DIST += xfrin.spec xfrin_messages.mes
if ENABLE_MAN if GENERATE_DOCS
b10-xfrin.8: b10-xfrin.xml b10-xfrin.8: b10-xfrin.xml
xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.xml @XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.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 endif

View File

@@ -1,161 +0,0 @@
'\" t
.\" Title: b10-xfrin
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: October 12, 2011
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
.TH "B10\-XFRIN" "8" "October 12, 2011" "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-xfrin \- Incoming DNS zone transfer service
.SH "SYNOPSIS"
.HP \w'\fBb10\-xfrin\fR\ 'u
\fBb10\-xfrin\fR
.SH "DESCRIPTION"
.PP
The
\fBb10\-xfrin\fR
daemon provides the BIND 10 incoming DNS zone transfer service\&. Normally it is started by the
\fBbind10\fR(8)
boss process\&. When triggered it can request and receive a zone transfer and store the zone in a BIND 10 zone data source\&.
.PP
The
\fBb10\-xfrin\fR
daemon supports both AXFR and IXFR\&. Due to some implementation limitations of the current development release, however, it only tries AXFR by default, and care should be taken to enable IXFR\&. See the BIND 10 Guide for more details\&.
.PP
This daemon communicates with BIND 10 over a
\fBb10-msgq\fR(8)
C\-Channel connection\&. If this connection is not established,
\fBb10\-xfrin\fR
will exit\&.
.PP
\fBb10\-xfrin\fR
receives its configurations from
\fBb10-cfgmgr\fR(8)\&.
.SH "CONFIGURATION AND COMMANDS"
.PP
The configurable settings are:
.PP
\fItransfers_in\fR
defines the maximum number of inbound zone transfers that can run concurrently\&. The default is 10\&.
.PP
\fIzones\fR
is a list of zones known to the
\fBb10\-xfrin\fR
daemon\&. The list items are:
\fIname\fR
(the zone name),
\fIclass\fR
(defaults to
\(lqIN\(rq),
\fImaster_addr\fR
(the zone master to transfer from),
\fImaster_port\fR
(defaults to 53),
\fIuse_ixfr\fR
(defaults to false), and
\fItsig_key\fR
(optional TSIG key to use)\&. The
\fItsig_key\fR
is specified using a full string colon\-delimited name:key:algorithm representation (e\&.g\&.
\(lqfoo\&.example\&.org:EvABsfU2h7uofnmqaRCrhHunGsd=:hmac\-sha1\(rq)\&.
.PP
(The site\-wide
\fImaster_addr\fR
and
\fImaster_port\fR
configurations are deprecated; use the
\fIzones\fR
list configuration instead\&.)
.PP
The configuration commands are:
.PP
\fBnotify\fR
is sent by
\fBb10-zonemgr\fR(8)
when a DNS NOTIFY message is received to initiate a zone transfer\&.
This is an internal command and not exposed to the administrator\&.
.PP
\fBrefresh\fR
triggers the transfer in for a single zone\&. It is the same as
\fBretransfer\fR
except it checks the SOA serial first\&.
This is an internal command and not exposed to the administrator\&.
.PP
\fBrefresh_from_zonemgr\fR
is sent by
\fBb10-zonemgr\fR(8)
according to the SOA\'s REFRESH time to tell
\fBb10\-xfrin\fR
that the zone needs to do a zone refresh\&. This is an internal command and not exposed to the administrator\&.
.PP
\fBretransfer\fR
triggers the transfer in for a single zone without checking the zone\'s serial number\&. It has the following arguments:
\fIzone_name\fR
to define the zone to request,
\fIzone_class\fR
to define the class (defaults to
\(lqIN\(rq),
\fImaster\fR
to define the IP address of the authoritative server to transfer from, and
\fIport\fR
to define the port number on the authoritative server (defaults to 53)\&. If the address or port is not specified, it will use the value previously defined in the
\fIzones\fR
configuration\&.
.PP
\fBshutdown\fR
stops all incoming zone transfers and exits
\fBb10\-xfrin\fR\&. (Note that the BIND 10 boss process will restart this service\&.)
.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
.PP
This prototype version uses SQLite3 as its data source backend\&. Future versions will be configurable, supporting multiple data storage types\&.
.sp .5v
.RE
.SH "SEE ALSO"
.PP
\fBb10-cfgmgr\fR(8),
\fBb10-msgq\fR(8),
\fBb10-zonemgr\fR(8),
\fBbind10\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
The
\fBb10\-xfrin\fR
daemon was implemented in March 2010 by Zhang Likun of CNNIC for the ISC BIND 10 project\&.
.SH "COPYRIGHT"
.br
Copyright \(co 2010-2011 Internet Systems Consortium, Inc. ("ISC")
.br

Some files were not shown because too many files have changed in this diff Show More