[svn] commit: r1814 - in /experiments/python-binding: ./ doc/guide/ src/bin/auth/ src/bin/auth/tests/ src/bin/bind10/ src/bin/bind10/tests/ src/bin/bindctl/ src/bin/bindctl/tests/ src/bin/cfgmgr/ src/bin/cmdctl/ src/bin/cmdctl/tests/ src/bin/host/ src/bin/loadzone/ src/bin/msgq/ src/bin/msgq/tests/ src/bin/usermgr/ src/bin/xfrin/ src/bin/xfrin/tests/ src/bin/xfrout/ src/bin/xfrout/tests/ src/lib/ src/lib/auth/ src/lib/cc/ src/lib/config/tests/ src/lib/datasrc/ src/lib/dns/ src/lib/dns/rdata/ src/lib/dns/rdata/ch_3/ src/lib/dns/rdata/generic/ src/lib/dns/rdata/hs_4/ src/lib/dns/rdata/in_1/ src/lib/dns/tests/ src/lib/dns/tests/testdata/ src/lib/python/isc/ src/lib/python/isc/auth/ src/lib/python/isc/cc/ src/lib/python/isc/cc/tests/ src/lib/python/isc/config/ src/lib/python/isc/config/tests/ src/lib/python/isc/datasrc/ src/lib/xfr/
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed May 12 14:23:19 UTC 2010
Author: jelte
Date: Wed May 12 14:23:18 2010
New Revision: 1814
Log:
update merge; merge trunk rev. 1670 - 1813 into this branch
Added:
experiments/python-binding/src/bin/bind10/tests/Makefile.am
- copied unchanged from r1813, trunk/src/bin/bind10/tests/Makefile.am
experiments/python-binding/src/bin/bindctl/tests/Makefile.am
- copied unchanged from r1813, trunk/src/bin/bindctl/tests/Makefile.am
experiments/python-binding/src/bin/cmdctl/tests/Makefile.am
- copied unchanged from r1813, trunk/src/bin/cmdctl/tests/Makefile.am
experiments/python-binding/src/bin/msgq/b10-msgq.8
- copied unchanged from r1813, trunk/src/bin/msgq/b10-msgq.8
experiments/python-binding/src/bin/msgq/tests/
- copied from r1813, trunk/src/bin/msgq/tests/
experiments/python-binding/src/bin/xfrin/tests/Makefile.am
- copied unchanged from r1813, trunk/src/bin/xfrin/tests/Makefile.am
experiments/python-binding/src/bin/xfrout/b10-xfrout.8
- copied unchanged from r1813, trunk/src/bin/xfrout/b10-xfrout.8
experiments/python-binding/src/bin/xfrout/b10-xfrout.xml
- copied unchanged from r1813, trunk/src/bin/xfrout/b10-xfrout.xml
experiments/python-binding/src/bin/xfrout/tests/Makefile.am
- copied unchanged from r1813, trunk/src/bin/xfrout/tests/Makefile.am
experiments/python-binding/src/lib/datasrc/
- copied from r1813, trunk/src/lib/datasrc/
experiments/python-binding/src/lib/dns/tests/testdata/name_toWire5
- copied unchanged from r1813, trunk/src/lib/dns/tests/testdata/name_toWire5
experiments/python-binding/src/lib/dns/tests/testdata/name_toWire5.spec
- copied unchanged from r1813, trunk/src/lib/dns/tests/testdata/name_toWire5.spec
experiments/python-binding/src/lib/dns/tests/testdata/name_toWire6
- copied unchanged from r1813, trunk/src/lib/dns/tests/testdata/name_toWire6
experiments/python-binding/src/lib/dns/tests/testdata/name_toWire6.spec
- copied unchanged from r1813, trunk/src/lib/dns/tests/testdata/name_toWire6.spec
experiments/python-binding/src/lib/python/isc/cc/tests/Makefile.am
- copied unchanged from r1813, trunk/src/lib/python/isc/cc/tests/Makefile.am
experiments/python-binding/src/lib/python/isc/config/tests/Makefile.am
- copied unchanged from r1813, trunk/src/lib/python/isc/config/tests/Makefile.am
experiments/python-binding/src/lib/python/isc/datasrc/
- copied from r1813, trunk/src/lib/python/isc/datasrc/
Removed:
experiments/python-binding/src/bin/msgq/msgq.8
experiments/python-binding/src/bin/msgq/msgq_test.in
experiments/python-binding/src/bin/msgq/msgq_test.py
experiments/python-binding/src/lib/auth/
experiments/python-binding/src/lib/python/isc/auth/
Modified:
experiments/python-binding/ (props changed)
experiments/python-binding/ChangeLog
experiments/python-binding/configure.ac
experiments/python-binding/doc/guide/bind10-guide.html
experiments/python-binding/doc/guide/bind10-guide.xml
experiments/python-binding/src/bin/auth/Makefile.am
experiments/python-binding/src/bin/auth/auth_srv.cc
experiments/python-binding/src/bin/auth/b10-auth.8
experiments/python-binding/src/bin/auth/b10-auth.xml
experiments/python-binding/src/bin/auth/main.cc
experiments/python-binding/src/bin/auth/spec_config.h.in
experiments/python-binding/src/bin/auth/tests/Makefile.am
experiments/python-binding/src/bin/auth/tests/auth_srv_unittest.cc
experiments/python-binding/src/bin/auth/tests/run_unittests.cc
experiments/python-binding/src/bin/bind10/Makefile.am
experiments/python-binding/src/bin/bind10/TODO
experiments/python-binding/src/bin/bind10/bind10.8
experiments/python-binding/src/bin/bind10/bind10.py.in
experiments/python-binding/src/bin/bind10/bind10.xml
experiments/python-binding/src/bin/bind10/run_bind10.sh.in
experiments/python-binding/src/bin/bind10/tests/bind10_test.in
experiments/python-binding/src/bin/bindctl/Makefile.am
experiments/python-binding/src/bin/bindctl/bindctl.1
experiments/python-binding/src/bin/bindctl/bindctl.xml
experiments/python-binding/src/bin/bindctl/exception.py
experiments/python-binding/src/bin/bindctl/run_bindctl.sh.in
experiments/python-binding/src/bin/bindctl/tests/bindctl_test.in
experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.8
experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.py.in
experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.xml
experiments/python-binding/src/bin/cmdctl/Makefile.am
experiments/python-binding/src/bin/cmdctl/run_b10-cmdctl.sh.in
experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.in
experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.py
experiments/python-binding/src/bin/host/host.cc
experiments/python-binding/src/bin/loadzone/b10-loadzone.py.in
experiments/python-binding/src/bin/loadzone/run_loadzone.sh.in
experiments/python-binding/src/bin/msgq/Makefile.am
experiments/python-binding/src/bin/msgq/msgq.py.in
experiments/python-binding/src/bin/msgq/msgq.xml
experiments/python-binding/src/bin/msgq/run_msgq.sh.in
experiments/python-binding/src/bin/usermgr/run_b10-cmdctl-usermgr.sh.in
experiments/python-binding/src/bin/xfrin/Makefile.am
experiments/python-binding/src/bin/xfrin/b10-xfrin.8
experiments/python-binding/src/bin/xfrin/b10-xfrin.xml
experiments/python-binding/src/bin/xfrin/run_b10-xfrin.sh.in
experiments/python-binding/src/bin/xfrin/tests/xfrin_test.in
experiments/python-binding/src/bin/xfrin/tests/xfrin_test.py
experiments/python-binding/src/bin/xfrin/xfrin.py.in (contents, props changed)
experiments/python-binding/src/bin/xfrin/xfrin.spec.pre.in
experiments/python-binding/src/bin/xfrout/Makefile.am
experiments/python-binding/src/bin/xfrout/run_b10-xfrout.sh.in
experiments/python-binding/src/bin/xfrout/tests/xfrout_test.in
experiments/python-binding/src/bin/xfrout/xfrout.py.in
experiments/python-binding/src/lib/Makefile.am
experiments/python-binding/src/lib/cc/ (props changed)
experiments/python-binding/src/lib/cc/data.cc
experiments/python-binding/src/lib/cc/data.h
experiments/python-binding/src/lib/config/tests/data_def_unittests_config.h.in
experiments/python-binding/src/lib/dns/ (props changed)
experiments/python-binding/src/lib/dns/base32.cc
experiments/python-binding/src/lib/dns/base64.cc
experiments/python-binding/src/lib/dns/dnssectime.cc
experiments/python-binding/src/lib/dns/exceptions.cc
experiments/python-binding/src/lib/dns/hex.cc
experiments/python-binding/src/lib/dns/message.cc
experiments/python-binding/src/lib/dns/message.h
experiments/python-binding/src/lib/dns/messagerenderer.cc
experiments/python-binding/src/lib/dns/messagerenderer.h
experiments/python-binding/src/lib/dns/name.cc
experiments/python-binding/src/lib/dns/name.h
experiments/python-binding/src/lib/dns/python_dns.cc
experiments/python-binding/src/lib/dns/question.cc
experiments/python-binding/src/lib/dns/question.h
experiments/python-binding/src/lib/dns/rdata.cc
experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.cc
experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.h
experiments/python-binding/src/lib/dns/rdata/generic/cname_5.cc
experiments/python-binding/src/lib/dns/rdata/generic/cname_5.h
experiments/python-binding/src/lib/dns/rdata/generic/dname_39.cc
experiments/python-binding/src/lib/dns/rdata/generic/dname_39.h
experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.cc
experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.h
experiments/python-binding/src/lib/dns/rdata/generic/ds_43.cc
experiments/python-binding/src/lib/dns/rdata/generic/ds_43.h
experiments/python-binding/src/lib/dns/rdata/generic/mx_15.cc
experiments/python-binding/src/lib/dns/rdata/generic/mx_15.h
experiments/python-binding/src/lib/dns/rdata/generic/ns_2.cc
experiments/python-binding/src/lib/dns/rdata/generic/ns_2.h
experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.cc
experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.h
experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.cc
experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.h
experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.cc
experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.h
experiments/python-binding/src/lib/dns/rdata/generic/opt_41.cc
experiments/python-binding/src/lib/dns/rdata/generic/opt_41.h
experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.cc
experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.h
experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.cc (contents, props changed)
experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.h
experiments/python-binding/src/lib/dns/rdata/generic/soa_6.cc
experiments/python-binding/src/lib/dns/rdata/generic/soa_6.h
experiments/python-binding/src/lib/dns/rdata/generic/txt_16.cc
experiments/python-binding/src/lib/dns/rdata/generic/txt_16.h
experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.cc
experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.h
experiments/python-binding/src/lib/dns/rdata/in_1/a_1.cc
experiments/python-binding/src/lib/dns/rdata/in_1/a_1.h
experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.cc
experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.h
experiments/python-binding/src/lib/dns/rdata/template.cc
experiments/python-binding/src/lib/dns/rdata/template.h
experiments/python-binding/src/lib/dns/rrclass.cc
experiments/python-binding/src/lib/dns/rrparamregistry-placeholder.cc
experiments/python-binding/src/lib/dns/rrparamregistry.h
experiments/python-binding/src/lib/dns/rrset.cc
experiments/python-binding/src/lib/dns/rrset.h
experiments/python-binding/src/lib/dns/rrsetlist.cc
experiments/python-binding/src/lib/dns/rrsetlist.h
experiments/python-binding/src/lib/dns/rrttl.cc
experiments/python-binding/src/lib/dns/rrtype.cc
experiments/python-binding/src/lib/dns/sha1.cc
experiments/python-binding/src/lib/dns/tests/ (props changed)
experiments/python-binding/src/lib/dns/tests/Makefile.am
experiments/python-binding/src/lib/dns/tests/message_unittest.cc
experiments/python-binding/src/lib/dns/tests/messagerenderer_unittest.cc
experiments/python-binding/src/lib/dns/tests/name_unittest.cc
experiments/python-binding/src/lib/dns/tests/question_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_cname_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_dname_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_dnskey_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_ds_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_in_a_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_in_aaaa_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_mx_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_ns_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_nsec3_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_nsec3param_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_nsec_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_opt_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_ptr_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_rrsig_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_soa_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_txt_unittest.cc
experiments/python-binding/src/lib/dns/tests/rdata_unittest.cc
experiments/python-binding/src/lib/dns/tests/rrclass_unittest.cc
experiments/python-binding/src/lib/dns/tests/rrset_unittest.cc
experiments/python-binding/src/lib/dns/tests/rrttl_unittest.cc
experiments/python-binding/src/lib/dns/tests/rrtype_unittest.cc
experiments/python-binding/src/lib/dns/tests/run_unittests.cc
experiments/python-binding/src/lib/dns/tests/testdata/gen-wiredata.py.in
experiments/python-binding/src/lib/dns/tests/unittest_util.cc
experiments/python-binding/src/lib/dns/tests/unittest_util.h
experiments/python-binding/src/lib/dns/tsig.cc
experiments/python-binding/src/lib/dns/tsig.h
experiments/python-binding/src/lib/python/isc/Makefile.am
experiments/python-binding/src/lib/python/isc/__init__.py
experiments/python-binding/src/lib/python/isc/cc/Makefile.am
experiments/python-binding/src/lib/python/isc/cc/message.py
experiments/python-binding/src/lib/python/isc/cc/tests/cc_test.in
experiments/python-binding/src/lib/python/isc/cc/tests/data_test.py
experiments/python-binding/src/lib/python/isc/cc/tests/test.py
experiments/python-binding/src/lib/python/isc/config/Makefile.am
experiments/python-binding/src/lib/python/isc/config/tests/config_test.in
experiments/python-binding/src/lib/xfr/Makefile.am
experiments/python-binding/src/lib/xfr/fd_share.cc (contents, props changed)
experiments/python-binding/src/lib/xfr/fd_share.h (contents, props changed)
experiments/python-binding/src/lib/xfr/python_xfr.cc (contents, props changed)
experiments/python-binding/src/lib/xfr/xfrout_client.cc (contents, props changed)
experiments/python-binding/src/lib/xfr/xfrout_client.h (contents, props changed)
Modified: experiments/python-binding/ChangeLog
==============================================================================
--- experiments/python-binding/ChangeLog (original)
+++ experiments/python-binding/ChangeLog Wed May 12 14:23:18 2010
@@ -1,0 +1,15 @@
+ 1. [bug] jinmei
+ lib/dns: parameter validation of Name::split() was not sufficient,
+ and invalid parameters could cause integer overflow and make the
+ library crash. (Trac #177, svn r1806)
+
+LEGEND
+[bug] general bug fix. This is generally a backward compatible change,
+ unless it's deemed to be impossible or very hard to keep
+ compatibility to fix the bug.
+[doc] update to documentation. This shouldn't change run time behavior.
+[func] new feature. In some cases this may be a backward incompatible
+ change, which would require a bump of major version.
+[security] security hole fix. This is no different than a general bug fix
+ except that it will be handled as confidential and will cause
+ security patch releases.
Modified: experiments/python-binding/configure.ac
==============================================================================
--- experiments/python-binding/configure.ac (original)
+++ experiments/python-binding/configure.ac Wed May 12 14:23:18 2010
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
-AC_INIT(bind10-devel, 20100318, bind10-bugs at isc.org)
+AC_INIT(bind10-devel, 20100318, bind10-dev at isc.org)
AC_CONFIG_SRCDIR(README)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])
@@ -48,15 +48,30 @@
AC_SUBST(pkgpyexecdir)
fi
-if test ! -x ${PYTHON}-config; then
- AC_MSG_ERROR([${PYTHON}-config not found])
-fi
-
-PYTHON_INCLUDES=`${PYTHON}-config --includes`
+# Check for python development environments
+if test -x ${PYTHON}-config; then
+ PYTHON_INCLUDES=`${PYTHON}-config --includes`
+
+ for flag in `${PYTHON}-config --ldflags`; do
+ # add any '-L..." flags to PYTHON_LDFLAGS
+ flag=`echo $flag | sed -ne 's/^\(\-L.*\)$/\1/p'`
+ if test "X${flag}" != X; then
+ PYTHON_LDFLAGS="$PYTHON_LDFLAGS ${flag}"
+ fi
+ done
+ # on some platforms, ${PYTHON}-config --ldflags doesn't provide a -L
+ # option while having the library under a non trivial directory.
+ # as a workaround we try the "lib" sub directory under the common
+ # prefix for this python.
+ if test -z "${PYTHON_LDFLAGS}"; then
+ PYTHON_LDFLAGS="-L`${PYTHON}-config --prefix`/lib"
+ fi
+else
+ if test "X$PYTHON_INCLUDES" = X -o "X$PYTHON_LDFLAGS" = X; then
+ AC_MSG_WARN([${PYTHON}-config does not exist or is not executable, so we could not detect python development environment. Your system may require an additional package (e.g. "python3-dev"). Alternatively, if you are sure you have python headers and libraries, define PYTHON_INCLUDES and PYTHON_LDFLAGS and run this script.])
+ fi
+fi
AC_SUBST(PYTHON_INCLUDES)
-for flag in `${PYTHON}-config --ldflags`; do
- PYTHON_LDFLAGS="$PYTHON_LDFLAGS `echo $flag | sed -ne 's/^\(\-L.*\)$/\1/p'`"
-done
AC_SUBST(PYTHON_LDFLAGS)
CPPFLAGS_SAVED="$CPPFLAGS"
@@ -361,24 +376,32 @@
src/Makefile
src/bin/Makefile
src/bin/bind10/Makefile
+ src/bin/bind10/tests/Makefile
src/bin/cmdctl/Makefile
+ src/bin/cmdctl/tests/Makefile
src/bin/bindctl/Makefile
+ src/bin/bindctl/tests/Makefile
src/bin/cfgmgr/Makefile
src/bin/host/Makefile
src/bin/loadzone/Makefile
src/bin/msgq/Makefile
+ src/bin/msgq/tests/Makefile
src/bin/auth/Makefile
src/bin/auth/tests/Makefile
src/bin/xfrin/Makefile
+ src/bin/xfrin/tests/Makefile
src/bin/xfrout/Makefile
+ src/bin/xfrout/tests/Makefile
src/bin/usermgr/Makefile
src/lib/Makefile
src/lib/cc/Makefile
src/lib/python/Makefile
src/lib/python/isc/Makefile
- src/lib/python/isc/auth/Makefile
+ src/lib/python/isc/datasrc/Makefile
src/lib/python/isc/cc/Makefile
+ src/lib/python/isc/cc/tests/Makefile
src/lib/python/isc/config/Makefile
+ src/lib/python/isc/config/tests/Makefile
src/lib/config/Makefile
src/lib/config/tests/Makefile
src/lib/dns/Makefile
@@ -386,8 +409,8 @@
src/lib/dns/python/Makefile
src/lib/dns-python/Makefile
src/lib/exceptions/Makefile
- src/lib/auth/Makefile
- src/lib/auth/tests/Makefile
+ src/lib/datasrc/Makefile
+ src/lib/datasrc/tests/Makefile
src/lib/xfr/Makefile
])
AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py
@@ -413,7 +436,7 @@
src/bin/usermgr/run_b10-cmdctl-usermgr.sh
src/bin/usermgr/b10-cmdctl-usermgr.py
src/bin/msgq/msgq.py
- src/bin/msgq/msgq_test
+ src/bin/msgq/tests/msgq_test
src/bin/msgq/run_msgq.sh
src/bin/auth/auth.spec.pre
src/bin/auth/spec_config.h
@@ -436,7 +459,7 @@
chmod +x src/bin/loadzone/run_loadzone.sh
chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh
chmod +x src/bin/msgq/run_msgq.sh
- chmod +x src/bin/msgq/msgq_test
+ chmod +x src/bin/msgq/tests/msgq_test
chmod +x src/lib/dns/gen-rdatacode.py
chmod +x src/lib/dns/tests/testdata/gen-wiredata.py
chmod +x src/lib/dns/python/tests/libdns_python_test
Modified: experiments/python-binding/doc/guide/bind10-guide.html
==============================================================================
--- experiments/python-binding/doc/guide/bind10-guide.html (original)
+++ experiments/python-binding/doc/guide/bind10-guide.html Wed May 12 14:23:18 2010
@@ -1,8 +1,8 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BIND 10 Guide</title><link rel="stylesheet" href="bind10-guide.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><meta name="description" content="This is the reference guide for BIND 10. The most up-to-date version of this document, along with other documents for BIND 10, can be found at ."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="BIND 10 Guide"><div class="titlepage"><div><div><h1 class="title"><a name="id36094478"></a>BIND 10 Guide</h1></div><div><h2 class="subtitle">Administrator Reference for BIND 10</h2></div><div><p class="copyright">Copyright © 2010 Internet Systems Consortium, Inc.</p></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p>This is the reference guide for BIND 10.</p><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>BIND 10 Guide</title><link rel="stylesheet" href="bind10-guide.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><meta name="description" content="This is the reference guide for BIND 10. The most up-to-date version of this document, along with other documents for BIND 10, can be found at ."></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" title="BIND 10 Guide"><div class="titlepage"><div><div><h1 class="title"><a name="id1168230342594"></a>BIND 10 Guide</h1></div><div><h2 class="subtitle">Administrator Reference for BIND 10</h2></div><div><p class="copyright">Copyright © 2010 Internet Systems Consortium, Inc.</p></div><div><div class="abstract" title="Abstract"><p class="title"><b>Abstract</b></p><p>This is the reference guide for BIND 10.</p><p>
The most up-to-date version of this document, along with other documents
for BIND 10, can be found at
<a class="ulink" href="http://bind10.isc.org/docs" target="_top">http://bind10.isc.org/docs</a>.
- </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id36094549">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id36094562">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#id36094777">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id36094987">Download Tar File</a></span></dt><dt><span class="section">
<a href="#id36095008">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id36095083">Configure before the build</a></span></dt><dt><span class="section"><a href="#id36095204">Build</a></span></dt><dt><span class="section"><a href="#id36095221">Install</a></span></dt><dt><span class="section"><a href="#id36095246">Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specification for b10-cmdctl</a></span></dt></dl></d
d><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id36095910">Server Configurations</a></span></dt><dt><span class="section"><a href="#id36095980">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id36096013">Loading Master Zones Files</a></span></dt></dl></dd></dl></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id36094549">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id36094562">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="se
ction"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></div><p>
+ </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230342718">Supported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#installation">2. Installation</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328120">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328382">Download Tar File</a></span></dt><dt><s
pan class="section"><a href="#id1168230328403">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328464">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328600">Build</a></span></dt><dt><span class="section"><a href="#id1168230328615">Install</a></span></dt><dt><span class="section"><a href="#id1168230328645">Install Hierarchy</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#bind10">3. Starting BIND10 with <span class="command"><strong>bind10</strong></span></a></span></dt><dd><dl><dt><span class="section"><a href="#start">Starting BIND 10</a></span></dt></dl></dd><dt><span class="chapter"><a href="#msgq">4. Command channel</a></span></dt><dt><span class="chapter"><a href="#cfgmgr">5. Configuration manager</a></span></dt><dt><span class="chapter"><a href="#cmdctl">6. Remote control daemon</a></span></dt><dd><dl><dt><span class="section"><a href="#cmdctl.spec">Configuration specifi
cation for b10-cmdctl</a></span></dt></dl></dd><dt><span class="chapter"><a href="#bindctl">7. Control and configure user interface</a></span></dt><dt><span class="chapter"><a href="#authserver">8. Authoritative Server</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230329212">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329277">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329307">Loading Master Zones Files</a></span></dt></dl></dd><dt><span class="chapter"><a href="#xfrin">9. Incoming Zone Transfers</a></span></dt><dt><span class="chapter"><a href="#xfrout">10. Outbound Zone Transfers</a></span></dt></dl></div><div class="chapter" title="Chapter 1. Introduction"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. Introduction</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230342718">S
upported Platforms</a></span></dt><dt><span class="section"><a href="#id1168230342746">Required Software</a></span></dt><dt><span class="section"><a href="#starting_stopping">Starting and Stopping the Server</a></span></dt><dt><span class="section"><a href="#managing_once_running">Managing BIND 10</a></span></dt></dl></div><p>
BIND is the popular implementation of a DNS server, developer
interfaces, and DNS tools.
BIND 10 is a rewrite of BIND 9. BIND 10 is written in C++ and Python
@@ -14,7 +14,7 @@
BIND 10, at this time, does not provide an recursive
DNS server. It does provide a EDNS0- and DNSSEC-capable
authoritative DNS server.
- </p></div><div class="section" title="Supported Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36094549"></a>Supported Platforms</h2></div></div></div><p>
+ </p></div><div class="section" title="Supported Platforms"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230342718"></a>Supported Platforms</h2></div></div></div><p>
BIND 10 builds have been tested on Debian GNU/Linux 5,
Ubuntu 9.10, NetBSD 5, Solaris 10, FreeBSD 7, and CentOS
Linux 5.3.
@@ -24,15 +24,16 @@
It is planned for BIND 10 to build, install and run on
Windows and standard Unix-type platforms.
- </p></div><div class="section" title="Required Software"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36094562"></a>Required Software</h2></div></div></div><p>
+ </p></div><div class="section" title="Required Software"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230342746"></a>Required Software</h2></div></div></div><p>
BIND 10 requires Python 3.1. Later versions may work, but Python
3.1 is the minimum version which will work.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- For the Y1 prototype release, the only supported data source
- backend is SQLite3. The authoritative server requires
- SQLite 3.3.9 or newer,
- and the <span class="command"><strong>b10-xfrin</strong></span> module requires the
- Python _sqlite3.so module.
+ For this development prototype release, the only supported
+ data source backend is SQLite3. The authoritative server
+ requires SQLite 3.3.9 or newer.
+ The <span class="command"><strong>b10-xfrin</strong></span> and <span class="command"><strong>b10-xfrout</strong></span>
+ modules require the libboost library, libpython3 library,
+ and the Python _sqlite3.so module.
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some operating systems do not provide these dependencies
in their default installation nor standard packages
@@ -46,9 +47,8 @@
</p><p>
At first, running many different processes may seem confusing. However,
these processes are started, stopped, and maintained by a single command,
- <span class="command"><strong>bind10</strong></span>. Additionally, most processes started by
- the <span class="command"><strong>bind10</strong></span> command have names starting with "b10-",
- with one exception, <span class="command"><strong>msgq</strong></span>.
+ <span class="command"><strong>bind10</strong></span>. Additionally, the processes started by
+ the <span class="command"><strong>bind10</strong></span> command have names starting with "b10-".
</p><p>
Starting and stopping the server is performed by a single command,
<span class="command"><strong>bind10</strong></span>. This command starts a master process
@@ -58,7 +58,7 @@
<span class="command"><strong>bind10</strong></span> and should not be run manually.
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- <span class="command"><strong>msgq</strong></span> —
+ <span class="command"><strong>b10-msgq</strong></span> —
message bus daemon.
This process coordinates communication between all of the other
BIND 10 processes.
@@ -77,12 +77,18 @@
</li><li class="listitem">
<span class="command"><strong>b10-xfrin</strong></span> —
Incoming zone transfer service.
- This process is started as needed to transfer a new copy
+ This process is used to transfer a new copy
of a zone into BIND 10, when acting as a secondary server.
+ </li><li class="listitem">
+ <span class="command"><strong>b10-xfrout</strong></span> —
+ Outgoing zone transfer service.
+ This process is used to handle transfer requests to
+ send a local zone to a remote secondary server,
+ when acting as a master server.
</li></ul></div><p>
</p></div><div class="section" title="Managing BIND 10"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="managing_once_running"></a>Managing BIND 10</h2></div></div></div><p>
- Once BIND 10 is running, two commands are used to interact directly with
- the system:
+ Once BIND 10 is running, a few commands are used to interact
+ directly with the system:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<span class="command"><strong>bindctl</strong></span> —
interactive administration interface.
@@ -109,7 +115,7 @@
and, of course, DNS. These include detailed developer
documentation and code examples.
- </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id36094777">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id36094987">Download Tar File</a></span></dt><dt><span class="section"><a href="#id36095008">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id36095083">Configure before the build</a></span></dt><dt><span class="section"><a href="#id36095204">Build</a></span></dt><dt><span class="section"><a href="#id36095221">Install</a></span></dt><dt><span class="section"><a href="#id36095246">Install Hierarchy</a></span></dt></dl></dd
></dl></div><div class="section" title="Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36094777"></a>Building Requirements</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ </p></div><div class="chapter" title="Chapter 2. Installation"><div class="titlepage"><div><div><h2 class="title"><a name="installation"></a>Chapter 2. Installation</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230328120">Building Requirements</a></span></dt><dt><span class="section"><a href="#quickstart">Quick start</a></span></dt><dt><span class="section"><a href="#install">Installation from source</a></span></dt><dd><dl><dt><span class="section"><a href="#id1168230328382">Download Tar File</a></span></dt><dt><span class="section"><a href="#id1168230328403">Retrieve from Subversion</a></span></dt><dt><span class="section"><a href="#id1168230328464">Configure before the build</a></span></dt><dt><span class="section"><a href="#id1168230328600">Build</a></span></dt><dt><span class="section"><a href="#id1168230328615">Install</a></span></dt><dt><span class="section"><a href="#id1168230328645">Install
Hierarchy</a></span></dt></dl></dd></dl></div><div class="section" title="Building Requirements"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230328120"></a>Building Requirements</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
Some operating systems have split their distribution packages into
a run-time and a development package. You will need to install
the development package versions, which include header files and
@@ -120,6 +126,13 @@
</p><p>
+ The Boost Library, Boost Python library, Python Library,
+ and Python _sqlite3 module are required to enable the
+ Xfrout and Xfrin support.
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ The Python related libraries and modules need to be built
+ for Python 3.1.
+ </p></div><p>
If the Boost System Library is detected at configure time,
BIND 10 will be built using an alternative method for
networking I/O using Boost ASIO support. This provides
@@ -136,14 +149,14 @@
Building BIND 10 also requires a C++ compiler and
standard development headers.
BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
- 4.2.1, 4.3.2, and 4.4.1.
+ 4.1.3, 4.2.1, 4.3.2, and 4.4.1.
</p></div><div class="section" title="Quick start"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="quickstart"></a>Quick start</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
This quickly covers the standard steps for installing
and deploying BIND 10 as an authoritative name server using
its defaults. For troubleshooting, full customizations and further
details, see the respective chapters in the BIND 10 guide.
</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- The Y1 prototype of the b10-auth server listens on
+ The development prototype of the b10-auth server listens on
0.0.0.0 (all interfaces) port 5300. (This is not the standard
domain service port.)
</p></div><p>
@@ -176,14 +189,14 @@
the Subversion code revision control system or as a downloadable
tar file. It may also be available in pre-compiled ready-to-use
packages from operating system vendors.
- </p><div class="section" title="Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id36094987"></a>Download Tar File</h3></div></div></div><p>
+ </p><div class="section" title="Download Tar File"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328382"></a>Download Tar File</h3></div></div></div><p>
Downloading a release tar file is the recommended method to
obtain the source code.
</p><p>
The BIND 10 releases are available as tar file downloads from
<a class="ulink" href="ftp://ftp.isc.org/isc/bind10/" target="_top">ftp://ftp.isc.org/isc/bind10/</a>.
Periodic development snapshots may also be available.
- </p></div><div class="section" title="Retrieve from Subversion"><div class="titlepage"><div><div><h3 class="title"><a name="id36095008"></a>Retrieve from Subversion</h3></div></div></div><p>
+ </p></div><div class="section" title="Retrieve from Subversion"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328403"></a>Retrieve from Subversion</h3></div></div></div><p>
Downloading this "bleeding edge" code is recommended only for
developers or advanced users. Using development code in a production
environment is not recommended.
@@ -197,9 +210,7 @@
and un-reviewed code, is available via the BIND 10 code revision
control system. This is powered by Subversion and all the BIND 10
development is public.
- The leading development is done in the <span class="quote">“<span class="quote">trunk</span>”</span>
- and the first year prototype containing reviewed code is in
- <code class="filename">branches/Y1</code>.
+ The leading development is done in the <span class="quote">“<span class="quote">trunk</span>”</span>.
</p><p>
The code can be checked out from <code class="filename">svn://bind10.isc.org/svn/bind10</code>; for example to check out the trunk:
@@ -217,7 +228,7 @@
<span class="command"><strong>autoheader</strong></span>,
<span class="command"><strong>automake</strong></span>,
and related commands.
- </p></div><div class="section" title="Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id36095083"></a>Configure before the build</h3></div></div></div><p>
+ </p></div><div class="section" title="Configure before the build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328464"></a>Configure before the build</h3></div></div></div><p>
BIND 10 uses the GNU Build System to discover build environment
details.
To generate the makefiles using the defaults, simply run:
@@ -226,12 +237,17 @@
Run <span class="command"><strong>./configure</strong></span> with the <code class="option">--help</code>
switch to view the different options. The commonly-used options are:
- </p><div class="variablelist"><dl><dt><span class="term">--with-boostlib</span></dt><dd>Define the path to find the Boost system library.
- </dd><dt><span class="term">--without-boostlib, </span><span class="term">--with-boostlib=no</span></dt><dd>Disable the Boost ASIO support.</dd><dt><span class="term">--with-pythonpath</span></dt><dd>Define the path to Python 3.1 if it is not in the
+ </p><div class="variablelist"><dl><dt><span class="term">--prefix</span></dt><dd>Define the the installation location (the
+ default is <code class="filename">/usr/local/</code>).
+ </dd><dt><span class="term">--with-boost-include</span></dt><dd>Define the path to find the Boost headers.
+ </dd><dt><span class="term">--with-boost-lib</span></dt><dd>Define the path to find the Boost library.
+ </dd><dt><span class="term">--with-boost-python</span></dt><dd>Define to use the Boost Python library.
+ </dd><dt><span class="term">--with-boost-system</span></dt><dd>Define to use the Boost System library.
+ </dd><dt><span class="term">--with-pythonpath</span></dt><dd>Define the path to Python 3.1 if it is not in the
standard execution path.
- </dd><dt><span class="term">--with-boost-include</span></dt><dd>Define the path to find the Boost headers.
- </dd><dt><span class="term">--prefix</span></dt><dd>Define the the installation location (the
- default is <code class="filename">/usr/local/</code>).
+ </dd><dt><span class="term">--with-gtest</span></dt><dd>Enable building the C++ Unit Tests using the
+ Google Tests framework. Optionally this can define the
+ path to the gtest header files and library.
</dd></dl></div><p>
</p><p>
@@ -239,23 +255,30 @@
with BOOST ASIO support, find the Boost headers, find the
Python interpreter, and sets the installation location:
- </p><pre class="screen">$ <strong class="userinput"><code>./configure --with-boostlib=/usr/pkg/lib \
+ </p><pre class="screen">$ <strong class="userinput"><code>./configure --with-boost-lib=/usr/pkg/lib \
--with-boost-include=/usr/pkg/include \
+ --with-boost-python \
+ --with-boost-system \
--with-pythonpath=/usr/pkg/bin/python3.1 \
--prefix=/opt/bind10</code></strong></pre><p>
</p><p>
If the configure fails, it may be due to missing or old
dependencies.
- </p></div><div class="section" title="Build"><div class="titlepage"><div><div><h3 class="title"><a name="id36095204"></a>Build</h3></div></div></div><p>
+ </p></div><div class="section" title="Build"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328600"></a>Build</h3></div></div></div><p>
After the configure step is complete, to build the executables
from the C++ code and prepare the Python scripts, run:
</p><pre class="screen">$ <strong class="userinput"><code>make</code></strong></pre><p>
- </p></div><div class="section" title="Install"><div class="titlepage"><div><div><h3 class="title"><a name="id36095221"></a>Install</h3></div></div></div><p>
+ </p></div><div class="section" title="Install"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328615"></a>Install</h3></div></div></div><p>
To install the BIND 10 executables, support files,
and documentation, run:
</p><pre class="screen">$ <strong class="userinput"><code>make install</code></strong></pre><p>
- </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div></div><div class="section" title="Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id36095246"></a>Install Hierarchy</h3></div></div></div><p>
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>The install step may require superuser privileges.</p></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ Depending on your system and the location of your Boost
+ Python and Python shared libraries, you may need to
+ configure your run-time linker to find them (such as
+ setting LD_LIBRARY_PATH).
+ </p></div></div><div class="section" title="Install Hierarchy"><div class="titlepage"><div><div><h3 class="title"><a name="id1168230328645"></a>Install Hierarchy</h3></div></div></div><p>
The following is the layout of the complete BIND 10 installation:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
<code class="filename">bin/</code> —
@@ -292,13 +315,13 @@
will also restart processes that exit unexpectedly.
This is the only command needed to start the BIND 10 system.
</p><p>
- After starting the <span class="command"><strong>msgq</strong></span> communications channel,
+ After starting the <span class="command"><strong>b10-msgq</strong></span> communications channel,
<span class="command"><strong>bind10</strong></span> connects to it,
runs the configuration manager, and reads its own configuration.
Then it starts the other modules.
</p><p>
- The <span class="command"><strong>msgq</strong></span> and <span class="command"><strong>b10-cfgmgr</strong></span>
- services make up the core. The <span class="command"><strong>msgq</strong></span> daemon
+ The <span class="command"><strong>b10-msgq</strong></span> and <span class="command"><strong>b10-cfgmgr</strong></span>
+ services make up the core. The <span class="command"><strong>b10-msgq</strong></span> daemon
provides the communication channel between every part of the system.
The <span class="command"><strong>b10-cfgmgr</strong></span> daemon is always needed by every
module, if only to send information about themselves somewhere,
@@ -307,15 +330,16 @@
The <span class="command"><strong>bind10</strong></span> master process will also start up
<span class="command"><strong>b10-cmdctl</strong></span> for admins to communicate with the
system, <span class="command"><strong>b10-auth</strong></span> for Authoritative DNS service,
- and <span class="command"><strong>b10-xfrin</strong></span> for inbound DNS zone transfers.
+ <span class="command"><strong>b10-xfrin</strong></span> for inbound DNS zone transfers.
+ and <span class="command"><strong>b10-xfrout</strong></span> for outbound DNS zone transfers.
</p><div class="section" title="Starting BIND 10"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="start"></a>Starting BIND 10</h2></div></div></div><p>
To start the BIND 10 service, simply run <span class="command"><strong>bind10</strong></span>.
Run it with the <code class="option">--verbose</code> switch to
get additional debugging or diagnostic output.
</p></div></div><div class="chapter" title="Chapter 4. Command channel"><div class="titlepage"><div><div><h2 class="title"><a name="msgq"></a>Chapter 4. Command channel</h2></div></div></div><p>
- The BIND 10 components use the <span class="command"><strong>msgq</strong></span>
+ The BIND 10 components use the <span class="command"><strong>b10-msgq</strong></span>
message routing daemon to communicate with other BIND 10 components.
- The <span class="command"><strong>msgq</strong></span> implements what is called the
+ The <span class="command"><strong>b10-msgq</strong></span> implements what is called the
<span class="quote">“<span class="quote">Command Channel</span>”</span>.
Processes intercommunicate by sending messages on the command
channel.
@@ -325,14 +349,10 @@
It is used only to control and monitor the BIND 10 system.
</p><p>
Administrators do not communicate directly with the
- <span class="command"><strong>msgq</strong></span> daemon.
+ <span class="command"><strong>b10-msgq</strong></span> daemon.
By default, BIND 10 uses port 9912 for the
- <span class="command"><strong>msgq</strong></span> service.
+ <span class="command"><strong>b10-msgq</strong></span> service.
It listens on 127.0.0.1.
- </p><p>
- To select an alternate port for the <span class="command"><strong>msgq</strong></span> to
- use, run <span class="command"><strong>bind10</strong></span> specifying the option:
- </p><pre class="screen"> $ <strong class="userinput"><code>bind10 --msgq-port 9912</code></strong></pre><p>
</p></div><div class="chapter" title="Chapter 5. Configuration manager"><div class="titlepage"><div><div><h2 class="title"><a name="cfgmgr"></a>Chapter 5. Configuration manager</h2></div></div></div><p>
The configuration manager, <span class="command"><strong>b10-cfgmgr</strong></span>,
handles all BIND 10 system configuration. It provides
@@ -341,14 +361,14 @@
</p><p>
The <span class="command"><strong>b10-auth</strong></span> and <span class="command"><strong>b10-xfrin</strong></span>
daemons and other components receive their configurations
- from the configuration manager over the <span class="command"><strong>msgq</strong></span>
+ from the configuration manager over the <span class="command"><strong>b10-msgq</strong></span>
command channel.
</p><p>The administrator doesn't connect to it directly, but
uses a user interface to communicate with the configuration
manager via <span class="command"><strong>b10-cmdctl</strong></span>'s REST-ful interface.
<span class="command"><strong>b10-cmdctl</strong></span> is covered in <a class="xref" href="#cmdctl" title="Chapter 6. Remote control daemon">Chapter 6, <i>Remote control daemon</i></a>.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- The Y1 prototype release only provides the
+ The development prototype release only provides the
<span class="command"><strong>bindctl</strong></span> as a user interface to
<span class="command"><strong>b10-cmdctl</strong></span>.
Upcoming releases will provide another interactive command-line
@@ -387,7 +407,7 @@
When <span class="command"><strong>b10-cmdctl</strong></span> starts, it firsts
asks <span class="command"><strong>b10-cfgmgr</strong></span> about what modules are
running and what their configuration is (over the
- <span class="command"><strong>msgq</strong></span> channel). Then it will start listening
+ <span class="command"><strong>b10-msgq</strong></span> channel). Then it will start listening
on HTTPS for clients — the user interface — such
as <span class="command"><strong>bindctl</strong></span>.
</p><p>
@@ -413,7 +433,7 @@
The <span class="command"><strong>b10-cmdctl</strong></span> daemon does not provide a
public service. If any client wants to control BIND 10, then
- a certificate needs to be first recieved from the BIND 10
+ a certificate needs to be first received from the BIND 10
administrator.
The BIND 10 installation provides a sample PEM bundle that matches
the sample key and certificate.
@@ -448,7 +468,7 @@
print_settings
shutdown
</p></div></div><div class="chapter" title="Chapter 7. Control and configure user interface"><div class="titlepage"><div><div><h2 class="title"><a name="bindctl"></a>Chapter 7. Control and configure user interface</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- For the Y1 prototype release, <span class="command"><strong>bindctl</strong></span>
+ For this development prototype release, <span class="command"><strong>bindctl</strong></span>
is the only user interface. It is expected that upcoming
releases will provide another interactive command-line
interface and a web-based interface for controlling and
@@ -465,20 +485,20 @@
<span class="command"><strong>b10-cfgmgr</strong></span>. So when <span class="command"><strong>bindctl</strong></span>
sends a configuration, it is sent to <span class="command"><strong>b10-cmdctl</strong></span>
(over a HTTPS connection); then <span class="command"><strong>b10-cmdctl</strong></span>
- sends the command (over a <span class="command"><strong>msgq</strong></span> command
+ sends the command (over a <span class="command"><strong>b10-msgq</strong></span> command
channel) to <span class="command"><strong>b10-cfgmgr</strong></span> which then stores
- the details and relays (over a <span class="command"><strong>msgq</strong></span> command
+ the details and relays (over a <span class="command"><strong>b10-msgq</strong></span> command
channel) the configuration on to the specified module.
</p><p>
- </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id36095910">Server Configurations</a></span></dt><dt><span class="section"><a href="#id36095980">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id36096013">Loading Master Zones Files</a></span></dt></dl></div><p>
+ </p></div><div class="chapter" title="Chapter 8. Authoritative Server"><div class="titlepage"><div><div><h2 class="title"><a name="authserver"></a>Chapter 8. Authoritative Server</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id1168230329212">Server Configurations</a></span></dt><dt><span class="section"><a href="#id1168230329277">Data Source Backends</a></span></dt><dt><span class="section"><a href="#id1168230329307">Loading Master Zones Files</a></span></dt></dl></div><p>
The <span class="command"><strong>b10-auth</strong></span> is the authoritative DNS server.
It supports EDNS0 and DNSSEC. It supports IPv6.
Normally it is started by the <span class="command"><strong>bind10</strong></span> master
process.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- The Y1 prototype release listens on all interfaces and the non-standard
- port 5300.
- </p></div><div class="section" title="Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36095910"></a>Server Configurations</h2></div></div></div><p>
+ This development prototype release listens on all interfaces
+ and the non-standard port 5300.
+ </p></div><div class="section" title="Server Configurations"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329212"></a>Server Configurations</h2></div></div></div><p>
<span class="command"><strong>b10-auth</strong></span> is configured via the
<span class="command"><strong>b10-cfgmgr</strong></span> configuration manager.
The module name is <span class="quote">“<span class="quote">Auth</span>”</span>.
@@ -498,8 +518,8 @@
</p><div class="variablelist"><dl><dt><span class="term">shutdown</span></dt><dd>Stop the authoritative DNS server.
</dd></dl></div><p>
- </p></div><div class="section" title="Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36095980"></a>Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- For the Y1 prototype release, <span class="command"><strong>b10-auth</strong></span>
+ </p></div><div class="section" title="Data Source Backends"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329277"></a>Data Source Backends</h2></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ For the development prototype release, <span class="command"><strong>b10-auth</strong></span>
only supports the SQLite3 data source backend.
Upcoming versions will be able to use multiple different
data sources, such as MySQL, Berkeley DB, or in-memory DB.
@@ -511,7 +531,7 @@
The default is <code class="filename">/usr/local/var/</code>.)
This data file location may be changed by defining the
<span class="quote">“<span class="quote">database_file</span>”</span> configuration.
- </p></div><div class="section" title="Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id36096013"></a>Loading Master Zones Files</h2></div></div></div><p>
+ </p></div><div class="section" title="Loading Master Zones Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id1168230329307"></a>Loading Master Zones Files</h2></div></div></div><p>
RFC 1035 style DNS master zone files may imported
into a BIND 10 data source by using the
<span class="command"><strong>b10-loadzone</strong></span> utility.
@@ -529,7 +549,8 @@
The <code class="option">-o</code> argument may be used to define the
default origin for loaded zone file records.
</p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
- In the Y1 prototype release, only the SQLite3 back end is used.
+ In the development prototype release, only the SQLite3 back
+ end is used.
By default, it stores the zone data in
<code class="filename">/usr/local/var/bind10-devel/zone.sqlite3</code>
unless the <code class="option">-d</code> switch is used to set the
@@ -537,6 +558,38 @@
Multiple zones are stored in a single SQLite3 zone database.
</p></div><p>
If you reload a zone already existing in the database,
- all records from that prior zone disappear and a while new set
+ all records from that prior zone disappear and a whole new set
appears.
- </p></div></div></div></body></html>
+ </p></div></div><div class="chapter" title="Chapter 9. Incoming Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrin"></a>Chapter 9. Incoming Zone Transfers</h2></div></div></div><p>
+ The <span class="command"><strong>b10-xfrin</strong></span> process is started by
+ <span class="command"><strong>bind10</strong></span>.
+ It can be manually triggered to request an AXFR zone
+ transfer. When received, it is stored in the BIND 10
+ data store, and its records can be served by
+ <span class="command"><strong>b10-auth</strong></span>.
+ This allows the BIND 10 server to provide
+ <span class="quote">“<span class="quote">secondary</span>”</span> service.
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ The current development release of BIND 10 only supports
+ AXFR. (IXFR is not supported.)
+ It also does not yet support automated SOA checks.
+ </p></div><p>
+ To manually trigger a zone transfer to retrieve a remote zone,
+ you may use the <span class="command"><strong>bindctl</strong></span> utility.
+ For example, at the <span class="command"><strong>bindctl</strong></span> prompt run:
+
+ </p><pre class="screen">> <strong class="userinput"><code>Xfrin retransfer zone_name="<code class="option">foo.example.org</code>" master=<code class="option">192.0.2.99</code></code></strong></pre><p>
+ </p></div><div class="chapter" title="Chapter 10. Outbound Zone Transfers"><div class="titlepage"><div><div><h2 class="title"><a name="xfrout"></a>Chapter 10. Outbound Zone Transfers</h2></div></div></div><p>
+ The <span class="command"><strong>b10-xfrout</strong></span> process is started by
+ <span class="command"><strong>bind10</strong></span>.
+ When the <span class="command"><strong>b10-auth</strong></span> authoritative DNS server
+ receives an AXFR request, <span class="command"><strong>b10-xfrout</strong></span>
+ sends the zone.
+ This is used to provide master DNS service to share zones
+ to secondary name servers.
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
+ The current development release of BIND 10 only supports
+ AXFR. (IXFR is not supported.)
+ It also does not yet support NOTIFY.
+ Access control is not yet provided.
+ </p></div></div></div></body></html>
Modified: experiments/python-binding/doc/guide/bind10-guide.xml
==============================================================================
--- experiments/python-binding/doc/guide/bind10-guide.xml (original)
+++ experiments/python-binding/doc/guide/bind10-guide.xml Wed May 12 14:23:18 2010
@@ -71,11 +71,12 @@
</para>
<note><para>
- For the Y1 prototype release, the only supported data source
- backend is SQLite3. The authoritative server requires
- SQLite 3.3.9 or newer,
- and the <command>b10-xfrin</command> module requires the
- Python _sqlite3.so module.
+ For this development prototype release, the only supported
+ data source backend is SQLite3. The authoritative server
+ requires SQLite 3.3.9 or newer.
+ The <command>b10-xfrin</command> and <command>b10-xfrout</command>
+ modules require the libboost library, libpython3 library,
+ and the Python _sqlite3.so module.
</para></note>
<!-- TODO: this will change ... -->
@@ -104,9 +105,8 @@
<para>
At first, running many different processes may seem confusing. However,
these processes are started, stopped, and maintained by a single command,
- <command>bind10</command>. Additionally, most processes started by
- the <command>bind10</command> command have names starting with "b10-",
- with one exception, <command>msgq</command>.
+ <command>bind10</command>. Additionally, the processes started by
+ the <command>bind10</command> command have names starting with "b10-".
</para>
<para>
@@ -122,7 +122,7 @@
<itemizedlist>
<listitem>
<simpara>
- <command>msgq</command> —
+ <command>b10-msgq</command> —
message bus daemon.
This process coordinates communication between all of the other
BIND 10 processes.
@@ -154,8 +154,18 @@
<simpara>
<command>b10-xfrin</command> —
Incoming zone transfer service.
- This process is started as needed to transfer a new copy
+ This process is used to transfer a new copy
of a zone into BIND 10, when acting as a secondary server.
+ </simpara>
+ </listitem>
+
+ <listitem>
+ <simpara>
+ <command>b10-xfrout</command> —
+ Outgoing zone transfer service.
+ This process is used to handle transfer requests to
+ send a local zone to a remote secondary server,
+ when acting as a master server.
</simpara>
</listitem>
@@ -259,6 +269,17 @@
</para>
<para>
+ The Boost Library, Boost Python library, Python Library,
+ and Python _sqlite3 module are required to enable the
+ Xfrout and Xfrin support.
+ </para>
+
+ <note><simpara>
+ The Python related libraries and modules need to be built
+ for Python 3.1.
+ </simpara></note>
+
+ <para>
If the Boost System Library is detected at configure time,
BIND 10 will be built using an alternative method for
networking I/O using Boost ASIO support. This provides
@@ -279,7 +300,7 @@
Building BIND 10 also requires a C++ compiler and
standard development headers.
BIND 10 builds have been tested with GCC g++ 3.4.3, 4.1.2,
- 4.2.1, 4.3.2, and 4.4.1.
+ 4.1.3, 4.2.1, 4.3.2, and 4.4.1.
</para>
</section>
@@ -296,7 +317,7 @@
<note>
<simpara>
- The Y1 prototype of the b10-auth server listens on
+ The development prototype of the b10-auth server listens on
0.0.0.0 (all interfaces) port 5300. (This is not the standard
domain service port.)
</simpara>
@@ -422,9 +443,7 @@
and un-reviewed code, is available via the BIND 10 code revision
control system. This is powered by Subversion and all the BIND 10
development is public.
- The leading development is done in the <quote>trunk</quote>
- and the reviewed code is in
- <filename>branches/REVIEWED</filename>.
+ The leading development is done in the <quote>trunk</quote>.
</para>
<para>
The code can be checked out from <filename>svn://bind10.isc.org/svn/bind10</filename>; for example to check out the trunk:
@@ -465,18 +484,43 @@
<variablelist>
<varlistentry>
- <term>--with-boostlib</term>
- <listitem>
- <simpara>Define the path to find the Boost system library.
+ <term>--prefix</term>
+ <listitem>
+ <simpara>Define the the installation location (the
+ default is <filename>/usr/local/</filename>).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
- <term>--without-boostlib</term> or
- <term>--with-boostlib=no</term>
+ <term>--with-boost-include</term>
<listitem>
- <simpara>Disable the Boost ASIO support.</simpara>
+ <simpara>Define the path to find the Boost headers.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--with-boost-lib</term>
+ <listitem>
+ <simpara>Define the path to find the Boost library.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--with-boost-python</term>
+ <listitem>
+ <simpara>Define to use the Boost Python library.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>--with-boost-system</term>
+ <listitem>
+ <simpara>Define to use the Boost System library.
+ </simpara>
</listitem>
</varlistentry>
@@ -490,34 +534,29 @@
</varlistentry>
<varlistentry>
- <term>--with-boost-include</term>
+ <term>--with-gtest</term>
<listitem>
- <simpara>Define the path to find the Boost headers.
+ <simpara>Enable building the C++ Unit Tests using the
+ Google Tests framework. Optionally this can define the
+ path to the gtest header files and library.
</simpara>
</listitem>
</varlistentry>
- <varlistentry>
- <term>--prefix</term>
- <listitem>
- <simpara>Define the the installation location (the
- default is <filename>/usr/local/</filename>).
- </simpara>
- </listitem>
- </varlistentry>
-
</variablelist>
</para>
- <!-- TODO: gtest, lcov -->
+ <!-- TODO: lcov -->
<para>
For example, the following configures it to build
with BOOST ASIO support, find the Boost headers, find the
Python interpreter, and sets the installation location:
- <screen>$ <userinput>./configure --with-boostlib=/usr/pkg/lib \
+ <screen>$ <userinput>./configure --with-boost-lib=/usr/pkg/lib \
--with-boost-include=/usr/pkg/include \
+ --with-boost-python \
+ --with-boost-system \
--with-pythonpath=/usr/pkg/bin/python3.1 \
--prefix=/opt/bind10</userinput></screen>
</para>
@@ -549,6 +588,14 @@
<note>
<para>The install step may require superuser privileges.</para>
</note>
+
+<!-- Trac #148 -->
+ <note><simpara>
+ Depending on your system and the location of your Boost
+ Python and Python shared libraries, you may need to
+ configure your run-time linker to find them (such as
+ setting LD_LIBRARY_PATH).
+ </simpara></note>
</section>
@@ -636,15 +683,15 @@
</para>
<para>
- After starting the <command>msgq</command> communications channel,
+ After starting the <command>b10-msgq</command> communications channel,
<command>bind10</command> connects to it,
runs the configuration manager, and reads its own configuration.
Then it starts the other modules.
</para>
<para>
- The <command>msgq</command> and <command>b10-cfgmgr</command>
- services make up the core. The <command>msgq</command> daemon
+ The <command>b10-msgq</command> and <command>b10-cfgmgr</command>
+ services make up the core. The <command>b10-msgq</command> daemon
provides the communication channel between every part of the system.
The <command>b10-cfgmgr</command> daemon is always needed by every
module, if only to send information about themselves somewhere,
@@ -653,7 +700,8 @@
The <command>bind10</command> master process will also start up
<command>b10-cmdctl</command> for admins to communicate with the
system, <command>b10-auth</command> for Authoritative DNS service,
- and <command>b10-xfrin</command> for inbound DNS zone transfers.
+ <command>b10-xfrin</command> for inbound DNS zone transfers.
+ and <command>b10-xfrout</command> for outbound DNS zone transfers.
</para>
<section id="start">
@@ -672,9 +720,9 @@
<title>Command channel</title>
<para>
- The BIND 10 components use the <command>msgq</command>
+ The BIND 10 components use the <command>b10-msgq</command>
message routing daemon to communicate with other BIND 10 components.
- The <command>msgq</command> implements what is called the
+ The <command>b10-msgq</command> implements what is called the
<quote>Command Channel</quote>.
Processes intercommunicate by sending messages on the command
channel.
@@ -686,17 +734,19 @@
<para>
Administrators do not communicate directly with the
- <command>msgq</command> daemon.
+ <command>b10-msgq</command> daemon.
By default, BIND 10 uses port 9912 for the
- <command>msgq</command> service.
+ <command>b10-msgq</command> service.
It listens on 127.0.0.1.
</para>
- <para>
- To select an alternate port for the <command>msgq</command> to
+<!-- TODO: this is broken, see Trac #111
+ <para>
+ To select an alternate port for the <command>b10-msgq</command> to
use, run <command>bind10</command> specifying the option:
- <screen> $ <userinput>bind10 --msgq-port 9912</userinput></screen>
- </para>
+ <screen> $ <userinput>bind10 -TODO-msgq-port 9912</userinput></screen>
+ </para>
+-->
<!-- TODO: upcoming plans:
Unix domain sockets
@@ -717,7 +767,7 @@
<para>
The <command>b10-auth</command> and <command>b10-xfrin</command>
daemons and other components receive their configurations
- from the configuration manager over the <command>msgq</command>
+ from the configuration manager over the <command>b10-msgq</command>
command channel.
</para>
@@ -730,7 +780,7 @@
<!-- TODO -->
<note>
<para>
- The Y1 prototype release only provides the
+ The development prototype release only provides the
<command>bindctl</command> as a user interface to
<command>b10-cmdctl</command>.
Upcoming releases will provide another interactive command-line
@@ -826,7 +876,7 @@
When <command>b10-cmdctl</command> starts, it firsts
asks <command>b10-cfgmgr</command> about what modules are
running and what their configuration is (over the
- <command>msgq</command> channel). Then it will start listening
+ <command>b10-msgq</command> channel). Then it will start listening
on HTTPS for clients — the user interface — such
as <command>bindctl</command>.
</para>
@@ -956,7 +1006,7 @@
<title>Control and configure user interface</title>
<note><para>
- For the Y1 prototype release, <command>bindctl</command>
+ For this development prototype release, <command>bindctl</command>
is the only user interface. It is expected that upcoming
releases will provide another interactive command-line
interface and a web-based interface for controlling and
@@ -979,9 +1029,9 @@
<command>b10-cfgmgr</command>. So when <command>bindctl</command>
sends a configuration, it is sent to <command>b10-cmdctl</command>
(over a HTTPS connection); then <command>b10-cmdctl</command>
- sends the command (over a <command>msgq</command> command
+ sends the command (over a <command>b10-msgq</command> command
channel) to <command>b10-cfgmgr</command> which then stores
- the details and relays (over a <command>msgq</command> command
+ the details and relays (over a <command>b10-msgq</command> command
channel) the configuration on to the specified module.
</para>
@@ -1001,8 +1051,8 @@
</para>
<note><simpara>
- The Y1 prototype release listens on all interfaces and the non-standard
- port 5300.
+ This development prototype release listens on all interfaces
+ and the non-standard port 5300.
</simpara></note>
<section>
@@ -1062,7 +1112,7 @@
<title>Data Source Backends</title>
<note><para>
- For the Y1 prototype release, <command>b10-auth</command>
+ For the development prototype release, <command>b10-auth</command>
only supports the SQLite3 data source backend.
Upcoming versions will be able to use multiple different
data sources, such as MySQL, Berkeley DB, or in-memory DB.
@@ -1132,7 +1182,8 @@
<note>
<para>
- In the Y1 prototype release, only the SQLite3 back end is used.
+ In the development prototype release, only the SQLite3 back
+ end is used.
By default, it stores the zone data in
<filename>/usr/local/var/bind10-devel/zone.sqlite3</filename>
unless the <option>-d</option> switch is used to set the
@@ -1162,6 +1213,69 @@
</chapter>
+ <chapter id="xfrin">
+ <title>Incoming Zone Transfers</title>
+
+ <para>
+ The <command>b10-xfrin</command> process is started by
+ <command>bind10</command>.
+ It can be manually triggered to request an AXFR zone
+ transfer. When received, it is stored in the BIND 10
+ data store, and its records can be served by
+ <command>b10-auth</command>.
+ This allows the BIND 10 server to provide
+ <quote>secondary</quote> service.
+ </para>
+
+ <note><simpara>
+ The current development release of BIND 10 only supports
+ AXFR. (IXFR is not supported.)
+ It also does not yet support automated SOA checks.
+ </simpara></note>
+
+ <para>
+ To manually trigger a zone transfer to retrieve a remote zone,
+ you may use the <command>bindctl</command> utility.
+ For example, at the <command>bindctl</command> prompt run:
+
+ <screen>> <userinput>Xfrin retransfer zone_name="<option>foo.example.org</option>" master=<option>192.0.2.99</option></userinput></screen>
+ </para>
+
+ </chapter>
+
+ <chapter id="xfrout">
+ <title>Outbound Zone Transfers</title>
+
+ <para>
+ The <command>b10-xfrout</command> process is started by
+ <command>bind10</command>.
+ When the <command>b10-auth</command> authoritative DNS server
+ receives an AXFR request, <command>b10-xfrout</command>
+ sends the zone.
+ This is used to provide master DNS service to share zones
+ to secondary name servers.
+ </para>
+
+ <note><simpara>
+ The current development release of BIND 10 only supports
+ AXFR. (IXFR is not supported.)
+ It also does not yet support NOTIFY.
+ Access control is not yet provided.
+ </simpara></note>
+
+
+<!--
+TODO:
+xfrout section:
+auth servers checks for AXFR query
+sends the XFR query to the xfrout module
+uses /tmp/auth_xfrout_conn which is a socket
+what is XfroutClient xfr_client??
+/tmp/auth_xfrout_conn is not removed
+-->
+
+ </chapter>
+
<!-- TODO: how to help: run unit tests, join lists, review trac tickets -->
<!-- <index> <title>Index</title> </index> -->
Modified: experiments/python-binding/src/bin/auth/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/auth/Makefile.am (original)
+++ experiments/python-binding/src/bin/auth/Makefile.am Wed May 12 14:23:18 2010
@@ -27,8 +27,8 @@
b10_auth_SOURCES = auth_srv.cc auth_srv.h
b10_auth_SOURCES += common.h
b10_auth_SOURCES += main.cc
-b10_auth_LDADD = $(top_builddir)/src/lib/auth/.libs/libauth.a
-b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
+b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
+b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
b10_auth_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.a
b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a
Modified: experiments/python-binding/src/bin/auth/auth_srv.cc
==============================================================================
--- experiments/python-binding/src/bin/auth/auth_srv.cc (original)
+++ experiments/python-binding/src/bin/auth/auth_srv.cc Wed May 12 14:23:18 2010
@@ -33,10 +33,10 @@
#include <cc/data.h>
#include <exceptions/exceptions.h>
-#include <auth/query.h>
-#include <auth/data_source.h>
-#include <auth/static_datasrc.h>
-#include <auth/sqlite3_datasrc.h>
+#include <datasrc/query.h>
+#include <datasrc/data_source.h>
+#include <datasrc/static_datasrc.h>
+#include <datasrc/sqlite3_datasrc.h>
#include <cc/data.h>
@@ -48,7 +48,7 @@
using namespace std;
using namespace isc;
-using namespace isc::auth;
+using namespace isc::datasrc;
using namespace isc::dns;
using namespace isc::dns::rdata;
using namespace isc::data;
Modified: experiments/python-binding/src/bin/auth/b10-auth.8
==============================================================================
--- experiments/python-binding/src/bin/auth/b10-auth.8 (original)
+++ experiments/python-binding/src/bin/auth/b10-auth.8 Wed May 12 14:23:18 2010
@@ -29,19 +29,16 @@
\fBb10\-auth\fR
daemon provides the BIND 10 authoritative DNS server\&. Normally it is started by the
\fBbind10\fR(8)
-master process\&.
+boss process\&.
.PP
This daemon communicates with other BIND 10 components over a
-\fBmsgq\fR(8)
+\fBb10-msgq\fR(8)
C\-Channel connection\&. If this connection is not established,
\fBb10\-auth\fR
will exit\&.
.PP
It also receives its configurations from
-\fBb10-cfgmgr\fR(8)
-(via the
-\fBmsgq\fR(8)
-command channel)\&. It will honor the
+\fBb10-cfgmgr\fR(8)\&. It will honor the
\fIdatabase_file\fR
configuration to point to the SQLite3 zone file\&.
.if n \{\
@@ -113,8 +110,8 @@
\fBb10-cfgmgr\fR(8),
\fBb10-cmdctl\fR(8),
\fBb10-loadzone\fR(8),
+\fBb10-msgq\fR(8),
\fBbind10\fR(8),
-\fBmsgq\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
Modified: experiments/python-binding/src/bin/auth/b10-auth.xml
==============================================================================
--- experiments/python-binding/src/bin/auth/b10-auth.xml (original)
+++ experiments/python-binding/src/bin/auth/b10-auth.xml Wed May 12 14:23:18 2010
@@ -58,12 +58,12 @@
authoritative DNS server.
Normally it is started by the
<citerefentry><refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- master process.
+ boss process.
</para>
<para>
This daemon communicates with other BIND 10 components over a
- <citerefentry><refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
C-Channel connection. If this connection is not established,
<command>b10-auth</command> will exit.
<!-- TODO what if msgq connection closes later, will b10-auth exit? -->
@@ -71,10 +71,7 @@
<para>
It also receives its configurations from
-<citerefentry><refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- (via the
- <citerefentry><refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- command channel).
+<citerefentry><refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
It will honor the <emphasis>database_file</emphasis> configuration
to point to the SQLite3 zone file.
@@ -158,10 +155,10 @@
<refentrytitle>b10-loadzone</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
- <refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
+ <refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
- <refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum>
+ <refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 10 Guide</citetitle>.
</para>
Modified: experiments/python-binding/src/bin/auth/main.cc
==============================================================================
--- experiments/python-binding/src/bin/auth/main.cc (original)
+++ experiments/python-binding/src/bin/auth/main.cc Wed May 12 14:23:18 2010
@@ -130,7 +130,7 @@
static void
dispatch_axfr_query(int tcp_sock, char axfr_query[], uint16_t query_len)
{
- std::string path = "/tmp/auth_xfrout_conn";
+ std::string path = string(UNIX_SOCKET_FILE);
XfroutClient xfr_client(path);
try {
xfr_client.connect();
Modified: experiments/python-binding/src/bin/auth/spec_config.h.in
==============================================================================
--- experiments/python-binding/src/bin/auth/spec_config.h.in (original)
+++ experiments/python-binding/src/bin/auth/spec_config.h.in Wed May 12 14:23:18 2010
@@ -1,1 +1,16 @@
+// Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
#define AUTH_SPECFILE_LOCATION "@prefix@/share/@PACKAGE@/auth.spec"
+#define UNIX_SOCKET_FILE "@prefix@/var/auth_xfrout_conn"
Modified: experiments/python-binding/src/bin/auth/tests/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/auth/tests/Makefile.am (original)
+++ experiments/python-binding/src/bin/auth/tests/Makefile.am Wed May 12 14:23:18 2010
@@ -1,5 +1,6 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/lib/dns -I$(top_srcdir)/src/bin
+AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
CLEANFILES = *.gcno *.gcda
@@ -15,7 +16,7 @@
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS)
-run_unittests_LDADD += $(top_builddir)/src/lib/auth/.libs/libauth.a
+run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/.libs/libdatasrc.a
run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a
run_unittests_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a
run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a
Modified: experiments/python-binding/src/bin/auth/tests/auth_srv_unittest.cc
==============================================================================
--- experiments/python-binding/src/bin/auth/tests/auth_srv_unittest.cc (original)
+++ experiments/python-binding/src/bin/auth/tests/auth_srv_unittest.cc Wed May 12 14:23:18 2010
@@ -35,11 +35,12 @@
using namespace isc::data;
namespace {
-const char* CONFIG_TESTDB = "{\"database_file\": \"testdata/example.sqlite3\"}";
+const char* CONFIG_TESTDB =
+ "{\"database_file\": \"" TEST_DATA_DIR "/example.sqlite3\"}";
// The following file must be non existent and must be non"creatable" (see
// the sqlite3 test).
const char* BADCONFIG_TESTDB =
- "{ \"database_file\": \"testdata/nodir/notexist\"}";
+ "{ \"database_file\": \"" TEST_DATA_DIR "/nodir/notexist\"}";
class AuthSrvTest : public ::testing::Test {
protected:
@@ -117,7 +118,7 @@
for (unsigned int i = 1; i < 16; ++i) {
// set Opcode to 'i', which iterators over all possible codes except
// the standard query (0)
- createDataFromFile("testdata/simplequery_fromWire");
+ createDataFromFile("simplequery_fromWire");
data[2] = ((i << 3) & 0xff);
parse_message.clear(Message::PARSE);
@@ -139,7 +140,7 @@
// Multiple questions. Should result in FORMERR.
TEST_F(AuthSrvTest, multiQuestion) {
- createDataFromFile("testdata/multiquestion_fromWire");
+ createDataFromFile("multiquestion_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
headerCheck(parse_message, default_qid, Rcode::FORMERR(), opcode.getCode(),
@@ -160,7 +161,7 @@
// Incoming data doesn't even contain the complete header. Must be silently
// dropped.
TEST_F(AuthSrvTest, shortMessage) {
- createDataFromFile("testdata/shortmessage_fromWire");
+ createDataFromFile("shortmessage_fromWire");
EXPECT_EQ(false, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
}
@@ -169,25 +170,25 @@
// or malformed or could otherwise cause a protocol error.
TEST_F(AuthSrvTest, response) {
// A valid (although unusual) response
- createDataFromFile("testdata/simpleresponse_fromWire");
+ createDataFromFile("simpleresponse_fromWire");
EXPECT_EQ(false, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
// A response with a broken question section. must be dropped rather than
// returning FORMERR.
- createDataFromFile("testdata/shortresponse_fromWire");
+ createDataFromFile("shortresponse_fromWire");
EXPECT_EQ(false, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
// A response to iquery. must be dropped rather than returning NOTIMP.
- createDataFromFile("testdata/iqueryresponse_fromWire");
+ createDataFromFile("iqueryresponse_fromWire");
EXPECT_EQ(false, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
}
// Query with a broken question
TEST_F(AuthSrvTest, shortQuestion) {
- createDataFromFile("testdata/shortquestion_fromWire");
+ createDataFromFile("shortquestion_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
// Since the query's question is broken, the question section of the
@@ -198,7 +199,7 @@
// Query with a broken answer section
TEST_F(AuthSrvTest, shortAnswer) {
- createDataFromFile("testdata/shortanswer_fromWire");
+ createDataFromFile("shortanswer_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
@@ -217,7 +218,7 @@
// Query with unsupported version of EDNS.
TEST_F(AuthSrvTest, ednsBadVers) {
- createDataFromFile("testdata/queryBadEDNS_fromWire");
+ createDataFromFile("queryBadEDNS_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
@@ -251,7 +252,7 @@
// query for existent data in the installed data source. The resulting
// response should have the AA flag on, and have an RR in each answer
// and authority section.
- createDataFromFile("testdata/examplequery_fromWire");
+ createDataFromFile("examplequery_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
@@ -265,7 +266,7 @@
// tool and the data source itself naively accept it). This will result
// in a SERVFAIL response, and the answer and authority sections should
// be empty.
- createDataFromFile("testdata/badExampleQuery_fromWire");
+ createDataFromFile("badExampleQuery_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
headerCheck(parse_message, default_qid, Rcode::SERVFAIL(), opcode.getCode(),
@@ -280,7 +281,7 @@
updateConfig(&server, BADCONFIG_TESTDB, false);
// The original data source should still exist.
- createDataFromFile("testdata/examplequery_fromWire");
+ createDataFromFile("examplequery_fromWire");
EXPECT_EQ(true, server.processMessage(*ibuffer, parse_message,
response_renderer, true));
headerCheck(parse_message, default_qid, Rcode::NOERROR(), opcode.getCode(),
Modified: experiments/python-binding/src/bin/auth/tests/run_unittests.cc
==============================================================================
--- experiments/python-binding/src/bin/auth/tests/run_unittests.cc (original)
+++ experiments/python-binding/src/bin/auth/tests/run_unittests.cc Wed May 12 14:23:18 2010
@@ -16,9 +16,13 @@
#include <gtest/gtest.h>
+#include <dns/tests/unittest_util.h>
+
int
main(int argc, char* argv[])
{
::testing::InitGoogleTest(&argc, argv);
+ isc::UnitTestUtil::addDataPath(TEST_DATA_DIR);
+
return (RUN_ALL_TESTS());
}
Modified: experiments/python-binding/src/bin/bind10/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/bind10/Makefile.am (original)
+++ experiments/python-binding/src/bin/bind10/Makefile.am Wed May 12 14:23:18 2010
@@ -1,5 +1,7 @@
+SUBDIRS = tests
+
sbin_SCRIPTS = bind10
-CLEANFILES = bind10
+CLEANFILES = bind10 bind10.pyc
pkglibexecdir = $(libexecdir)/@PACKAGE@
@@ -8,7 +10,7 @@
EXTRA_DIST = bob.spec
man_MANS = bind10.8
-EXTRA_DIST += $(man_MANS) bind10.xml tests/bind10_test.py
+EXTRA_DIST += $(man_MANS) bind10.xml
if ENABLE_MAN
Modified: experiments/python-binding/src/bin/bind10/TODO
==============================================================================
--- experiments/python-binding/src/bin/bind10/TODO (original)
+++ experiments/python-binding/src/bin/bind10/TODO Wed May 12 14:23:18 2010
@@ -14,3 +14,6 @@
- Rename "c-channel" stuff to msgq for clarity
- Use logger
- Reply to shutdown message?
+- Some sort of group creation so termination signals can be sent to
+ children of children processes (if any)
+
Modified: experiments/python-binding/src/bin/bind10/bind10.8
==============================================================================
--- experiments/python-binding/src/bin/bind10/bind10.8 (original)
+++ experiments/python-binding/src/bin/bind10/bind10.8 Wed May 12 14:23:18 2010
@@ -2,12 +2,12 @@
.\" Title: bind10
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\" Date: March 18, 2010
+.\" Date: April 19, 2010
.\" Manual: BIND10
.\" Source: BIND10
.\" Language: English
.\"
-.TH "BIND10" "8" "March 18, 2010" "BIND10" "BIND10"
+.TH "BIND10" "8" "April 19, 2010" "BIND10" "BIND10"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -19,7 +19,7 @@
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
-bind10 \- BIND 10 master process
+bind10 \- BIND 10 boss process
.SH "SYNOPSIS"
.HP \w'\fBbind10\fR\ 'u
\fBbind10\fR [\fB\-m\ \fR\fB\fInumber\fR\fR] [\fB\-p\ \fR\fB\fInumber\fR\fR] [\fB\-v\fR] [\fB\-msgq\-port\ \fR\fB\fInumber\fR\fR] [\fB\-port\ \fR\fB\fInumber\fR\fR] [\fB\-verbose\fR]
@@ -35,7 +35,7 @@
\fB\-m\fR \fInumber\fR, \fB\-\-msgq\-port\fR \fInumber\fR
.RS 4
The port number for the
-\fBmsgq\fR(8)
+\fBb10-msgq\fR(8)
daemon to listen on\&. The default is 9912\&.
.RE
.PP
@@ -74,8 +74,8 @@
\fBb10-auth\fR(8),
\fBb10-cfgmgr\fR(8),
\fBb10-cmdctl\fR(8),
+\fBb10-msgq\fR(8),
\fBb10-xfrin\fR(8),
-\fBmsgq\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
Modified: experiments/python-binding/src/bin/bind10/bind10.py.in
==============================================================================
--- experiments/python-binding/src/bin/bind10/bind10.py.in (original)
+++ experiments/python-binding/src/bin/bind10/bind10.py.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#!@PYTHON@
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
"""\
This file implements the Boss of Bind (BoB, or bob) program.
@@ -108,30 +123,33 @@
spawn_stdout = self.dev_null
else:
spawn_stdout = None
- spawn_env = self.env
- spawn_env['PATH'] = os.environ['PATH']
- if 'B10_FROM_SOURCE' in os.environ:
- spawn_env['B10_FROM_SOURCE'] = os.environ['B10_FROM_SOURCE']
- else:
+ if self.dev_null_stderr:
+ spawn_stderr = self.dev_null
+ else:
+ spawn_stderr = None
+ # Environment variables for the child process will be a copy of those
+ # of the boss process with any additional specific variables given
+ # on construction (self.env).
+ spawn_env = os.environ
+ spawn_env.update(self.env)
+ if not 'B10_FROM_SOURCE' in os.environ:
spawn_env['PATH'] = "@@LIBEXECDIR@@:" + spawn_env['PATH']
- if 'PYTHON_EXEC' in os.environ:
- spawn_env['PYTHON_EXEC'] = os.environ['PYTHON_EXEC']
- if 'PYTHONPATH' in os.environ:
- spawn_env['PYTHONPATH'] = os.environ['PYTHONPATH']
self.process = subprocess.Popen(self.args,
stdin=subprocess.PIPE,
stdout=spawn_stdout,
- stderr=spawn_stdout,
+ stderr=spawn_stderr,
close_fds=True,
env=spawn_env,)
self.pid = self.process.pid
self.restart_schedule.set_run_start_time()
- def __init__(self, name, args, env={}, dev_null_stdout=False):
+ def __init__(self, name, args, env={}, dev_null_stdout=False,
+ dev_null_stderr=False):
self.name = name
self.args = args
self.env = env
self.dev_null_stdout = dev_null_stdout
+ self.dev_null_stderr = dev_null_stderr
self.restart_schedule = RestartSchedule()
self._spawn()
@@ -161,7 +179,7 @@
def config_handler(self, new_config):
if self.verbose:
- print("[XX] handling new config:")
+ print("[bind10] handling new config:")
print(new_config)
answer = isc.config.ccsession.create_answer(0)
return answer
@@ -169,15 +187,15 @@
def command_handler(self, command, args):
if self.verbose:
- print("[XX] Boss got command:")
+ print("[bind10] Boss got command:")
print(command)
- answer = [ 1, "Command not implemented" ]
+ answer = isc.config.ccsession.create_answer(1, "command not implemented")
if type(command) != str:
answer = isc.config.ccsession.create_answer(1, "bad command")
else:
cmd = command
if cmd == "shutdown":
- print("[XX] got shutdown command")
+ print("[bind10] got shutdown command")
self.runnable = False
answer = isc.config.ccsession.create_answer(0)
elif cmd == "print_message":
@@ -185,7 +203,7 @@
print(args)
answer = isc.config.ccsession.create_answer(0, args)
elif cmd == "print_settings":
- print("Full Config:")
+ print("[bind10] Full Config:")
full_config = self.ccs.get_full_config()
for item in full_config:
print(item + ": " + str(full_config[item]))
@@ -204,25 +222,26 @@
# to see if it is already running
c_channel_env = { "ISC_MSGQ_PORT": str(self.c_channel_port), }
if self.verbose:
- sys.stdout.write("Checking for already running msgq\n")
+ sys.stdout.write("Checking for already running b10-msgq\n")
# try to connect, and if we can't wait a short while
try:
self.cc_session = isc.cc.Session(self.c_channel_port)
- return "msgq already running, cannot start"
+ return "b10-msgq already running, cannot start"
except isc.cc.session.SessionError:
pass
# start the c-channel daemon
if self.verbose:
- sys.stdout.write("Starting msgq using port %d\n" %
+ sys.stdout.write("Starting b10-msgq using port %d\n" %
self.c_channel_port)
try:
- c_channel = ProcessInfo("msgq", ["msgq"], c_channel_env, True)
+ c_channel = ProcessInfo("b10-msgq", ["b10-msgq"], c_channel_env,
+ True, not self.verbose)
except Exception as e:
- return "Unable to start msgq; " + str(e)
+ return "Unable to start b10-msgq; " + str(e)
self.processes[c_channel.pid] = c_channel
if self.verbose:
- sys.stdout.write("Started msgq (PID %d)\n" % c_channel.pid)
+ sys.stdout.write("Started b10-msgq (PID %d)\n" % c_channel.pid)
# now connect to the c-channel
cc_connect_start = time.time()
@@ -240,7 +259,7 @@
# start the configuration manager
if self.verbose:
- sys.stdout.write("Starting b10-cfgmgr\n")
+ sys.stdout.write("[bind10] Starting b10-cfgmgr\n")
try:
bind_cfgd = ProcessInfo("b10-cfgmgr", ["b10-cfgmgr"],
{ 'ISC_MSGQ_PORT': str(self.c_channel_port)})
@@ -249,7 +268,7 @@
return "Unable to start b10-cfgmgr; " + str(e)
self.processes[bind_cfgd.pid] = bind_cfgd
if self.verbose:
- sys.stdout.write("Started b10-cfgmgr (PID %d)\n" % bind_cfgd.pid)
+ sys.stdout.write("[bind10] Started b10-cfgmgr (PID %d)\n" % bind_cfgd.pid)
# TODO: once this interface is done, replace self.cc_session
# by this one
@@ -259,11 +278,11 @@
# message
time.sleep(1)
if self.verbose:
- print("[XX] starting ccsession")
+ print("[bind10] starting ccsession")
self.ccs = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
self.ccs.start()
if self.verbose:
- print("[XX] ccsession started")
+ print("[bind10] ccsession started")
# start the xfrout before auth-server, to make sure every xfr-query can be
# processed properly.
@@ -271,7 +290,7 @@
sys.stdout.write("Starting b10-xfrout\n")
try:
xfrout = ProcessInfo("b10-xfrout", ["b10-xfrout"],
- { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
+ { 'ISC_MSGQ_PORT': str(self.c_channel_port)})
except Exception as e:
c_channel.process.kill()
bind_cfgd.process.kill()
@@ -299,7 +318,7 @@
if self.verbose:
sys.stdout.write("Started b10-auth (PID %d)\n" % auth.pid)
- # start the b10-xfrin
+ # start b10-xfrin
if self.verbose:
sys.stdout.write("Starting b10-xfrin\n")
try:
@@ -343,6 +362,8 @@
self.cc_session.group_sendmsg(cmd, 'Boss', 'Cmd-Ctrld')
self.cc_session.group_sendmsg(cmd, "Boss", "ConfigManager")
self.cc_session.group_sendmsg(cmd, "Boss", "Auth")
+ self.cc_session.group_sendmsg(cmd, "Boss", "Xfrout")
+ self.cc_session.group_sendmsg(cmd, "Boss", "Xfrin")
def stop_process(self, process):
"""Stop the given process, friendly-like."""
@@ -359,11 +380,10 @@
except:
pass
# XXX: some delay probably useful... how much is uncertain
- time.sleep(0.1)
+ time.sleep(0.5)
self.reap_children()
# next try sending a SIGTERM
processes_to_stop = list(self.processes.values())
- unstopped_processes = []
for proc_info in processes_to_stop:
if self.verbose:
sys.stdout.write("Sending SIGTERM to %s (PID %d).\n" %
@@ -374,21 +394,22 @@
# ignore these (usually ESRCH because the child
# finally exited)
pass
- # XXX: some delay probably useful... how much is uncertain
- time.sleep(0.1)
- self.reap_children()
- # finally, send a SIGKILL (unmaskable termination)
- processes_to_stop = unstopped_processes
- for proc_info in processes_to_stop:
- if self.verbose:
- sys.stdout.write("Sending SIGKILL to %s (PID %d).\n" %
- (proc_info.name, proc_info.pid))
- try:
- proc_info.process.kill()
- except OSError:
- # ignore these (usually ESRCH because the child
- # finally exited)
- pass
+ # finally, send SIGKILL (unmaskable termination) until everybody dies
+ while self.processes:
+ # XXX: some delay probably useful... how much is uncertain
+ time.sleep(0.1)
+ self.reap_children()
+ processes_to_stop = list(self.processes.values())
+ for proc_info in processes_to_stop:
+ if self.verbose:
+ sys.stdout.write("Sending SIGKILL to %s (PID %d).\n" %
+ (proc_info.name, proc_info.pid))
+ try:
+ proc_info.process.kill()
+ except OSError:
+ # ignore these (usually ESRCH because the child
+ # finally exited)
+ pass
if self.verbose:
sys.stdout.write("All processes ended, server done.\n")
@@ -411,10 +432,10 @@
if self.verbose:
sys.stdout.write("Process %s (PID %d) died.\n" %
(proc_info.name, proc_info.pid))
- if proc_info.name == "msgq":
+ if proc_info.name == "b10-msgq":
if self.verbose and self.runnable:
sys.stdout.write(
- "The msgq process died, shutting down.\n")
+ "The b10-msgq process died, shutting down.\n")
self.runnable = False
else:
sys.stdout.write("Unknown child pid %d exited.\n" % pid)
@@ -495,13 +516,13 @@
still_dead[proc_info.pid] = proc_info
else:
if self.verbose:
- sys.stdout.write("Resurrecting dead %s process...\n" %
+ sys.stdout.write("[bind10] Resurrecting dead %s process...\n" %
proc_info.name)
try:
proc_info.respawn()
self.processes[proc_info.pid] = proc_info
if self.verbose:
- sys.stdout.write("Resurrected %s (PID %d)\n" %
+ sys.stdout.write("[bind10] Resurrected %s (PID %d)\n" %
(proc_info.name, proc_info.pid))
except:
still_dead[proc_info.pid] = proc_info
@@ -535,7 +556,7 @@
global options
global boss_of_bind
if options.verbose:
- sys.stdout.write("Received %s.\n" % get_signame(signal_number))
+ sys.stdout.write("[bind10] Received %s.\n" % get_signame(signal_number))
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
boss_of_bind.runnable = False
@@ -563,7 +584,7 @@
help="port the b10-auth daemon will use (default 5300)")
parser.add_option("-m", "--msgq-port", dest="msgq_port", type="string",
action="callback", callback=check_port, default="9912",
- help="port the msgq daemon will use (default 9912)")
+ help="port the b10-msgq daemon will use (default 9912)")
(options, args) = parser.parse_args()
# Announce startup.
@@ -586,7 +607,7 @@
signal.signal(signal.SIGTERM, fatal_signal)
# Go bob!
- boss_of_bind = BoB(int(options.msgq_port), int(options.auth_port), \
+ boss_of_bind = BoB(int(options.msgq_port), int(options.auth_port),
options.verbose)
startup_result = boss_of_bind.startup()
if startup_result:
Modified: experiments/python-binding/src/bin/bind10/bind10.xml
==============================================================================
--- experiments/python-binding/src/bin/bind10/bind10.xml (original)
+++ experiments/python-binding/src/bin/bind10/bind10.xml Wed May 12 14:23:18 2010
@@ -21,7 +21,7 @@
<refentry>
<refentryinfo>
- <date>March 18, 2010</date>
+ <date>April 19, 2010</date>
</refentryinfo>
<refmeta>
@@ -32,7 +32,7 @@
<refnamediv>
<refname>bind10</refname>
- <refpurpose>BIND 10 master process</refpurpose>
+ <refpurpose>BIND 10 boss process</refpurpose>
</refnamediv>
<docinfo>
@@ -84,7 +84,7 @@
<listitem>
<para>The port number for the
- <citerefentry><refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ <citerefentry><refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
daemon to listen on.
The default is 9912.</para>
</listitem>
@@ -139,10 +139,10 @@
<refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
- <refentrytitle>b10-xfrin</refentrytitle><manvolnum>8</manvolnum>
+ <refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
- <refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum>
+ <refentrytitle>b10-xfrin</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citetitle>BIND 10 Guide</citetitle>.
</para>
Modified: experiments/python-binding/src/bin/bind10/run_bind10.sh.in
==============================================================================
--- experiments/python-binding/src/bin/bind10/run_bind10.sh.in (original)
+++ experiments/python-binding/src/bin/bind10/run_bind10.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/bind10/tests/bind10_test.in
==============================================================================
--- experiments/python-binding/src/bin/bind10/tests/bind10_test.in (original)
+++ experiments/python-binding/src/bin/bind10/tests/bind10_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/bindctl/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/bindctl/Makefile.am (original)
+++ experiments/python-binding/src/bin/bindctl/Makefile.am Wed May 12 14:23:18 2010
@@ -1,3 +1,5 @@
+SUBDIRS = tests
+
bin_SCRIPTS = bindctl
man_MANS = bindctl.1
@@ -9,7 +11,6 @@
bindctldir = $(DESTDIR)$(pkgdatadir)
bindctl_DATA = bindctl.pem
EXTRA_DIST += bindctl.pem
-EXTRA_DIST += tests/bindctl_test.py
CLEANFILES = bindctl
Modified: experiments/python-binding/src/bin/bindctl/bindctl.1
==============================================================================
--- experiments/python-binding/src/bin/bindctl/bindctl.1 (original)
+++ experiments/python-binding/src/bin/bindctl/bindctl.1 Wed May 12 14:23:18 2010
@@ -79,7 +79,6 @@
\fBb10-cmdctl\fR(8),
\fBb10-xfrin\fR(8),
\fBbind10\fR(8),
-\fBmsgq\fR(8),
BIND 10 Guide\&.
.SH "AUTHORS"
.PP
Modified: experiments/python-binding/src/bin/bindctl/bindctl.xml
==============================================================================
--- experiments/python-binding/src/bin/bindctl/bindctl.xml (original)
+++ experiments/python-binding/src/bin/bindctl/bindctl.xml Wed May 12 14:23:18 2010
@@ -215,9 +215,6 @@
<citerefentry>
<refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
- <citerefentry>
- <refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum>
- </citerefentry>,
<citetitle>BIND 10 Guide</citetitle>.
</para>
<!-- TODO: point to developer docs -->
Modified: experiments/python-binding/src/bin/bindctl/exception.py
==============================================================================
--- experiments/python-binding/src/bin/bindctl/exception.py (original)
+++ experiments/python-binding/src/bin/bindctl/exception.py Wed May 12 14:23:18 2010
@@ -31,7 +31,7 @@
"""module name format error"""
def __str__(self):
- return "Module name format error: the charater of name can only be '0-9a-zA-Z_'"
+ return "Module name format error: the character of name can only be '0-9a-zA-Z_'"
class CmdCommandNameFormatError(CmdFormatError):
@@ -41,7 +41,7 @@
self.module = module
def __str__(self):
- return "Command name format error: the charater of name can only be '0-9a-zA-Z_'"
+ return "Command name format error: the character of name can only be '0-9a-zA-Z_'"
class CmdMissCommandNameFormatError(CmdFormatError):
Modified: experiments/python-binding/src/bin/bindctl/run_bindctl.sh.in
==============================================================================
--- experiments/python-binding/src/bin/bindctl/run_bindctl.sh.in (original)
+++ experiments/python-binding/src/bin/bindctl/run_bindctl.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/bindctl/tests/bindctl_test.in
==============================================================================
--- experiments/python-binding/src/bin/bindctl/tests/bindctl_test.in (original)
+++ experiments/python-binding/src/bin/bindctl/tests/bindctl_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.8
==============================================================================
--- experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.8 (original)
+++ experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.8 Wed May 12 14:23:18 2010
@@ -33,7 +33,7 @@
connection\&.
.PP
This daemon communicates over a
-\fBmsgq\fR
+\fBb10\-msgq\fR
C\-Channel connection\&. If this connection is not established,
\fBb10\-cfgmgr\fR
will exit\&.
Modified: experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.py.in
==============================================================================
--- experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.py.in (original)
+++ experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.py.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#!@PYTHON@
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
import sys; sys.path.append ('@@PYTHONPATH@@')
Modified: experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.xml
==============================================================================
--- experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.xml (original)
+++ experiments/python-binding/src/bin/cfgmgr/b10-cfgmgr.xml Wed May 12 14:23:18 2010
@@ -69,7 +69,7 @@
<!-- TODO: briefly explain why both msqg channel and cmdctl communication -->
<para>
- This daemon communicates over a <command>msgq</command> C-Channel
+ This daemon communicates over a <command>b10-msgq</command> C-Channel
connection. If this connection is not established,
<command>b10-cfgmgr</command> will exit.
</para>
Modified: experiments/python-binding/src/bin/cmdctl/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/cmdctl/Makefile.am (original)
+++ experiments/python-binding/src/bin/cmdctl/Makefile.am Wed May 12 14:23:18 2010
@@ -1,3 +1,5 @@
+SUBDIRS = tests
+
pkglibexecdir = $(libexecdir)/@PACKAGE@
pkglibexec_SCRIPTS = b10-cmdctl
@@ -16,9 +18,8 @@
EXTRA_DIST = $(CMDCTL_CONFIGURATIONS)
EXTRA_DIST += cmdctl.spec
-EXTRA_DIST += tests/cmdctl_test.py
-CLEANFILES= b10-cmdctl
+CLEANFILES= b10-cmdctl cmdctl.pyc
man_MANS = b10-cmdctl.8
EXTRA_DIST += $(man_MANS) b10-cmdctl.xml
Modified: experiments/python-binding/src/bin/cmdctl/run_b10-cmdctl.sh.in
==============================================================================
--- experiments/python-binding/src/bin/cmdctl/run_b10-cmdctl.sh.in (original)
+++ experiments/python-binding/src/bin/cmdctl/run_b10-cmdctl.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.in
==============================================================================
--- experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.in (original)
+++ experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.py
==============================================================================
--- experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.py (original)
+++ experiments/python-binding/src/bin/cmdctl/tests/cmdctl_test.py Wed May 12 14:23:18 2010
@@ -47,6 +47,7 @@
self.user_sessions = {}
self.idle_timeout = 1200
self.cmdctrl = MyCommandControl()
+ self._verbose = False
class MyCommandControl(CommandControl):
def __init__(self):
Modified: experiments/python-binding/src/bin/host/host.cc
==============================================================================
--- experiments/python-binding/src/bin/host/host.cc (original)
+++ experiments/python-binding/src/bin/host/host.cc Wed May 12 14:23:18 2010
@@ -1,3 +1,17 @@
+// Copyright (C) 2010 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.
+
// host rewritten in C++ using BIND 10 DNS library
#include <arpa/inet.h>
Modified: experiments/python-binding/src/bin/loadzone/b10-loadzone.py.in
==============================================================================
--- experiments/python-binding/src/bin/loadzone/b10-loadzone.py.in (original)
+++ experiments/python-binding/src/bin/loadzone/b10-loadzone.py.in Wed May 12 14:23:18 2010
@@ -1,4 +1,5 @@
#!@PYTHON@
+
# Copyright (C) 2010 Internet Systems Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
@@ -16,8 +17,8 @@
import sys; sys.path.append ('@@PYTHONPATH@@')
import re, getopt
-import isc.auth
-from isc.auth.master import MasterFile
+import isc.datasrc
+from isc.datasrc.master import MasterFile
#########################################################################
# usage: print usage note and exit
@@ -70,10 +71,10 @@
exit(1)
try:
- isc.auth.sqlite3_ds.load(dbfile, zone, master.zonedata)
+ isc.datasrc.sqlite3_ds.load(dbfile, zone, master.zonedata)
except Exception as e:
print("Error loading database: " + str(e))
exit(1)
if __name__ == "__main__":
- main()
+ main(datasrc
Modified: experiments/python-binding/src/bin/loadzone/run_loadzone.sh.in
==============================================================================
--- experiments/python-binding/src/bin/loadzone/run_loadzone.sh.in (original)
+++ experiments/python-binding/src/bin/loadzone/run_loadzone.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/msgq/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/msgq/Makefile.am (original)
+++ experiments/python-binding/src/bin/msgq/Makefile.am Wed May 12 14:23:18 2010
@@ -1,21 +1,23 @@
+SUBDIRS = tests
+
pkglibexecdir = $(libexecdir)/@PACKAGE@
-pkglibexec_SCRIPTS = msgq
+pkglibexec_SCRIPTS = b10-msgq
-CLEANFILES = msgq
+CLEANFILES = b10-msgq msgq.pyc
-man_MANS = msgq.8
-EXTRA_DIST = $(man_MANS) msgq.xml msgq_test.py
+man_MANS = b10-msgq.8
+EXTRA_DIST = $(man_MANS) msgq.xml
if ENABLE_MAN
-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
endif
# TODO: does this need $$(DESTDIR) also?
# this is done here since configure.ac AC_OUTPUT doesn't expand exec_prefix
-msgq: msgq.py
+b10-msgq: msgq.py
$(SED) "s|@@PYTHONPATH@@|@pyexecdir@|" msgq.py >$@
chmod a+x $@
Modified: experiments/python-binding/src/bin/msgq/msgq.py.in
==============================================================================
--- experiments/python-binding/src/bin/msgq/msgq.py.in (original)
+++ experiments/python-binding/src/bin/msgq/msgq.py.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#!@PYTHON@
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
import sys; sys.path.append ('@@PYTHONPATH@@')
Modified: experiments/python-binding/src/bin/msgq/msgq.xml
==============================================================================
--- experiments/python-binding/src/bin/msgq/msgq.xml (original)
+++ experiments/python-binding/src/bin/msgq/msgq.xml Wed May 12 14:23:18 2010
@@ -21,17 +21,17 @@
<refentry>
<refentryinfo>
- <date>January 21, 2010</date>
+ <date>April 19, 2010</date>
</refentryinfo>
<refmeta>
- <refentrytitle>msgq</refentrytitle>
+ <refentrytitle>b10-msgq</refentrytitle>
<manvolnum>8</manvolnum>
<refmiscinfo>BIND10</refmiscinfo>
</refmeta>
<refnamediv>
- <refname>msgq</refname>
+ <refname>b10-msgq</refname>
<refpurpose>message routing daemon for the Command Channel</refpurpose>
</refnamediv>
@@ -44,7 +44,7 @@
<refsynopsisdiv>
<cmdsynopsis>
- <command>msgq</command>
+ <command>b10-msgq</command>
<arg><option>-m <replaceable>number</replaceable></option></arg>
<arg><option>-v</option></arg>
<arg><option>--msgq-port <replaceable>number</replaceable></option></arg>
@@ -55,7 +55,7 @@
<refsect1>
<title>DESCRIPTION</title>
<para>
- The <command>msgq</command>
+ The <command>b10-msgq</command>
daemon provides message routing for the Command Channel.
</para>
@@ -63,7 +63,7 @@
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 the <command>msgq</command> is
+ Every new connection to <command>b10-msgq</command> is
assigned a unique identifier -- this is the local name.
The commands it handles are:
<itemizedlist>
@@ -97,7 +97,7 @@
</para>
<para>
- The <command>msgq</command> daemon may be cleanly stopped by
+ The <command>b10-msgq</command> daemon may be cleanly stopped by
sending the SIGTERM signal to the process.
This shutdown does not notify the subscribers.
</para>
@@ -114,7 +114,7 @@
<term><option>-m <replaceable>number</replaceable></option>,
<option>--msgq-port <replaceable>number</replaceable></option></term>
<listitem><para>
- The port number that <command>msgq</command> will listen on.
+ The port number that <command>b10-msgq</command> will listen on.
The default is 9912.</para>
</listitem>
</varlistentry>
@@ -123,7 +123,7 @@
<term><option>-v</option>, <option>--verbose</option></term>
<listitem><para>
Enabled verbose mode. This enables diagnostic messages to
- STDERR. Displays more about what <command>msgq</command>
+ STDERR. Displays more about what <command>b10-msgq</command>
is doing.
<!-- TODO: is STDERR correct? -->
</para></listitem>
@@ -147,7 +147,7 @@
<refsect1>
<title>AUTHORS</title>
<para>
- The <command>msgq</command> daemon and Control Channel specification
+ The <command>b10-msgq</command> daemon and Control Channel specification
were initially designed by Michael Graff of ISC.
</para>
</refsect1>
Modified: experiments/python-binding/src/bin/msgq/run_msgq.sh.in
==============================================================================
--- experiments/python-binding/src/bin/msgq/run_msgq.sh.in (original)
+++ experiments/python-binding/src/bin/msgq/run_msgq.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
@@ -9,4 +24,4 @@
export PYTHONPATH
cd ${MYPATH_PATH}
-exec ${PYTHON_EXEC} -O msgq $*
+exec ${PYTHON_EXEC} -O b10-msgq $*
Modified: experiments/python-binding/src/bin/usermgr/run_b10-cmdctl-usermgr.sh.in
==============================================================================
--- experiments/python-binding/src/bin/usermgr/run_b10-cmdctl-usermgr.sh.in (original)
+++ experiments/python-binding/src/bin/usermgr/run_b10-cmdctl-usermgr.sh.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/xfrin/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/xfrin/Makefile.am (original)
+++ experiments/python-binding/src/bin/xfrin/Makefile.am Wed May 12 14:23:18 2010
@@ -1,3 +1,5 @@
+SUBDIRS = tests
+
pkglibexecdir = $(libexecdir)/@PACKAGE@
pkglibexec_SCRIPTS = b10-xfrin
@@ -5,11 +7,10 @@
b10_xfrindir = $(DESTDIR)$(pkgdatadir)
b10_xfrin_DATA = xfrin.spec
-CLEANFILES = b10-xfrin xfrin.spec
+CLEANFILES = b10-xfrin xfrin.pyc xfrin.spec
man_MANS = b10-xfrin.8
EXTRA_DIST = $(man_MANS) b10-xfrin.xml
-EXTRA_DIST += tests/xfrin_test.py
if ENABLE_MAN
Modified: experiments/python-binding/src/bin/xfrin/b10-xfrin.8
==============================================================================
--- experiments/python-binding/src/bin/xfrin/b10-xfrin.8 (original)
+++ experiments/python-binding/src/bin/xfrin/b10-xfrin.8 Wed May 12 14:23:18 2010
@@ -29,9 +29,7 @@
\fBb10\-xfrin\fR
daemon provides the BIND 10 incoming DNS zone transfer service\&. Normally it is started by the
\fBbind10\fR(8)
-master process and communicates with the
-\fBb10-auth\fR(8)
-authoritative DNS server\&.
+boss process\&. When triggered it can request and receive a zone transfer and store the zone in a BIND 10 zone data store\&.
.if n \{\
.sp
.\}
@@ -49,20 +47,37 @@
.sp .5v
.RE
.PP
-This daemon communicates over a
-\fBmsgq\fR(8)
+
+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
-It also receives its configurations from
-\fBb10-cfgmgr\fR(8)
-using the REST\-ful interface provided by
-\fBb10-cmdctl\fR(8)\&.
+
+\fBb10\-xfrin\fR
+receives its configurations from
+\fBb10-cfgmgr\fR(8)\&.
+.SH "CONFIGURATION AND COMMANDS"
.PP
-The configurable setting is transfers\-in which defines the maximum number of inbound zone transfers that can run concurrently\&. The default is 10\&.
+The configurable setting is
+\fItransfers\-in\fR
+which defines the maximum number of inbound zone transfers that can run concurrently\&. The default is 10\&.
.PP
-The configuration commands are: print_settings, shutdown, and retransfer (triggers the transfer in for a single zone without checking the zone\'s serial number)\&.
+The configuration commands are:
+.PP
+
+\fBshutdown\fR
+stops all incoming zone transfers and exits
+\fBb10\-xfrin\fR\&. (Note that the BIND 10 boss process will restart this service\&.)
+.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 and
+\fImaster\fR
+to define the IP address of the authoritative server to transfer from\&.
.if n \{\
.sp
.\}
@@ -82,11 +97,9 @@
.SH "SEE ALSO"
.PP
-\fBb10-auth\fR(8),
\fBb10-cfgmgr\fR(8),
-\fBb10-cmdctl\fR(8),
+\fBb10-msgq\fR(8),
\fBbind10\fR(8),
-\fBmsgq\fR(8),
BIND 10 Guide\&.
.SH "HISTORY"
.PP
Modified: experiments/python-binding/src/bin/xfrin/b10-xfrin.xml
==============================================================================
--- experiments/python-binding/src/bin/xfrin/b10-xfrin.xml (original)
+++ experiments/python-binding/src/bin/xfrin/b10-xfrin.xml Wed May 12 14:23:18 2010
@@ -58,38 +58,36 @@
incoming DNS zone transfer service.
Normally it is started by the
<citerefentry><refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- master process
- and communicates with the
- <citerefentry><refentrytitle>b10-auth</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- authoritative DNS server.
+ boss process.
+ When triggered it can request and receive a zone transfer and store
+ the zone in a BIND 10 zone data store.
</para>
<note><simpara>
The Y1 prototype release only supports AXFR. IXFR is not implemented.
</simpara></note>
-<!-- TODO:
-add a usage example of xfrin -->
-
- <para>
- This daemon communicates over a
- <citerefentry><refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ <para>
+<!-- TODO: does it really use msgq? what for? -->
+ This daemon communicates with BIND 10 over a
+ <citerefentry><refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum></citerefentry>
C-Channel connection. If this connection is not established,
<command>b10-xfrin</command> will exit.
-<!-- TODO what if connection closes later, will b10-auth exit? -->
- </para>
-
- <para>
- It also receives its configurations from
-<citerefentry><refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- using the REST-ful interface provided by
- <citerefentry><refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
- </para>
-
- <para>
- The configurable setting is transfers-in which defines
- the maximum number of inbound zone transfers that can run
- concurrently. The default is 10.
+<!-- TODO what if connection closes later, will b10-xfrin exit? -->
+ </para>
+
+ <para>
+ <command>b10-xfrin</command> receives its configurations from
+<citerefentry><refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
+ </para>
+ </refsect1>
+
+ <refsect1>
+ <title>CONFIGURATION AND COMMANDS</title>
+ <para>
+ The configurable setting is <varname>transfers-in</varname>
+ which defines the maximum number of inbound zone transfers
+ that can run concurrently. The default is 10.
</para>
<!-- TODO: formating -->
@@ -97,25 +95,30 @@
<!-- schedule immediate maintenance for a zone(check soa serial ) -->
<para>
The configuration commands are:
-print_settings,
-shutdown, and
-retransfer (triggers the transfer in for a single zone without checking
-the zone's serial number).
+ </para>
+ <para>
+ <command>shutdown</command> stops all incoming zone transfers
+ and exits <command>b10-xfrin</command>. (Note that the BIND 10
+ boss process will restart this service.)
+ </para>
+ <para>
+ <command>retransfer</command> triggers the transfer in for
+ a single zone without checking the zone's serial number.
+ It has the following arguments: <varname>zone_name</varname>
+ to define the zone to request and <varname>master</varname>
+ to define the IP address of the authoritative server to
+ transfer from.
</para>
-
-<!-- TODO:
-
-retransfer has the following arguments:
-zone_name
+<!-- TODO: later hostname for master? -->
+
+<!-- TODO:
+add a usage example of xfrin -->
+
+<!-- TODO:
+
port (defaults to 53)
-master
db_file (defaults to zone.sqlite3) --> <!-- TODO: fix this -->
-
-<!--
-If the admin want to get the latest zone data from master, he can send the
-command "retransfer to xfrin."
--->
<!-- TODO:
later it will can be triggered by :
@@ -129,16 +132,6 @@
4. Schedule zone maintenance for all zones.
-->
-
-<!-- TODO: reword -->
-<!-- TODO:
- <para>
- The administrator can send zone transfer-in command to xfrin
- module, or terminate all ongoing incoming transfers by sending
- the <quote>shutdown</quote> command to xfrin module.
- </para>
--->
-<!-- TODO: kills it and bind10 restarts? -->
<note><para>
This prototype version uses SQLite3 as its data source backend.
@@ -183,20 +176,14 @@
<title>SEE ALSO</title>
<para>
<citerefentry>
- <refentrytitle>b10-auth</refentrytitle><manvolnum>8</manvolnum>
- </citerefentry>,
- <citerefentry>
<refentrytitle>b10-cfgmgr</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
- <refentrytitle>b10-cmdctl</refentrytitle><manvolnum>8</manvolnum>
+ <refentrytitle>b10-msgq</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
<citerefentry>
<refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
</citerefentry>,
- <citerefentry>
- <refentrytitle>msgq</refentrytitle><manvolnum>8</manvolnum>
- </citerefentry>,
<citetitle>BIND 10 Guide</citetitle>.
</para>
</refsect1>
Modified: experiments/python-binding/src/bin/xfrin/run_b10-xfrin.sh.in
==============================================================================
--- experiments/python-binding/src/bin/xfrin/run_b10-xfrin.sh.in (original)
+++ experiments/python-binding/src/bin/xfrin/run_b10-xfrin.sh.in Wed May 12 14:23:18 2010
@@ -1,10 +1,25 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
MYPATH_PATH=@abs_top_builddir@/src/bin/xfrin
-PYTHONPATH=@abs_top_srcdir@/src/lib/python
+PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/dns/.libs
export PYTHONPATH
cd ${MYPATH_PATH}
Modified: experiments/python-binding/src/bin/xfrin/tests/xfrin_test.in
==============================================================================
--- experiments/python-binding/src/bin/xfrin/tests/xfrin_test.in (original)
+++ experiments/python-binding/src/bin/xfrin/tests/xfrin_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/xfrin/tests/xfrin_test.py
==============================================================================
--- experiments/python-binding/src/bin/xfrin/tests/xfrin_test.py (original)
+++ experiments/python-binding/src/bin/xfrin/tests/xfrin_test.py Wed May 12 14:23:18 2010
@@ -18,11 +18,62 @@
import socket
from xfrin import *
+# An axfr response of the simple zone "example.com(without soa record at the end)."
+axfr_response1 = b'\x84\x00\x00\x01\x00\x06\x00\x00\x00\x00\x07example\x03com\x00\x00\xfc\x00\x01\xc0\x0c\x00\x06\x00\x01\x00\x00\x0e\x10\x00$\x05dns01\xc0\x0c\x05admin\xc0\x0c\x00\x00\x04\xd2\x00\x00\x0e\x10\x00\x00\x07\x08\x00$\xea\x00\x00\x00\x1c \xc0\x0c\x00\x02\x00\x01\x00\x00\x0e\x10\x00\x02\xc0)\xc0)\x00\x01\x00\x01\x00\x00\x0e\x10\x00\x04\xc0\xa8\x02\x02\x04sql1\xc0\x0c\x00\x02\x00\x01\x00\x00\x0e\x10\x00\x02\xc0)\x04sql2\xc0\x0c\x00\x02\x00\x01\x00\x00\x0e\x10\x00\x02\xc0)\x03ns1\x07subzone\xc0\x0c\x00\x01\x00\x01\x00\x00\x0e\x10\x00\x04\xc0\xa8\x03\x01'
+
+# The second axfr response with only the end soa record.
+axfr_response2 = b'\x84\x00\x00\x00\x00\x01\x00\x00\x00\x00\x07example\x03com\x00\x00\x06\x00\x01\x00\x00\x0e\x10\x00$\x05dns01\xc0\x0c\x05admin\xc0\x0c\x00\x00\x04\xd2\x00\x00\x0e\x10\x00\x00\x07\x08\x00$\xea\x00\x00\x00\x1c '
+
+DB_FILE = 'db_file'
# Rewrite the class for unittest.
class MyXfrin(Xfrin):
def __init__(self):
pass
+class MyXfrinConnection(XfrinConnection):
+ query_data = b''
+ eply_data = b''
+
+ def _handle_xfrin_response(self):
+ for rr in super()._handle_xfrin_response():
+ pass
+
+ def _get_request_response(self, size):
+ ret = self.reply_data[:size]
+ self.reply_data = self.reply_data[size:]
+ if (len(ret) < size):
+ raise XfrinException('cannot get reply data')
+ return ret
+
+ def send(self, data):
+ self.query_data += data
+ return len(data)
+
+ def create_response_data(self, data):
+ reply_data = self.query_data[2:4] + data
+ size = socket.htons(len(reply_data))
+ reply_data = struct.pack('H', size) + reply_data
+ return reply_data
+
+
+class TestXfrinConnection(unittest.TestCase):
+ def setUp(self):
+ self.conn = MyXfrinConnection('example.com.', DB_FILE, threading.Event(), '1.1.1.1')
+
+ def test_response_with_invalid_msg(self):
+ self.conn.data_exchange = b'aaaxxxx'
+ self.assertRaises(Exception, self.conn._handle_xfrin_response)
+
+ def test_response_without_end_soa(self):
+ self.conn._send_query(rr_type.AXFR())
+ self.conn.reply_data = self.conn.create_response_data(axfr_response1)
+ self.assertRaises(XfrinException, self.conn._handle_xfrin_response)
+
+ def test_response(self):
+ self.conn._send_query(rr_type.AXFR())
+ self.conn.reply_data = self.conn.create_response_data(axfr_response1)
+ self.conn.reply_data += self.conn.create_response_data(axfr_response2)
+ self.conn._handle_xfrin_response()
class TestXfrin(unittest.TestCase):
def test_parse_cmd_params(self):
@@ -51,6 +102,10 @@
self.assertRaises(XfrinException, xfr._parse_cmd_params, {'zone_name':'ds.cn.'})
self.assertRaises(XfrinException, xfr._parse_cmd_params, {'master':'ds.cn.'})
+if __name__== "__main__":
+ try:
+ unittest.main()
+ os.remove(DB_FILE)
+ except KeyboardInterrupt as e:
+ print(e)
-if __name__== "__main__":
- unittest.main()
Modified: experiments/python-binding/src/bin/xfrin/xfrin.py.in
==============================================================================
--- experiments/python-binding/src/bin/xfrin/xfrin.py.in (original)
+++ experiments/python-binding/src/bin/xfrin/xfrin.py.in Wed May 12 14:23:18 2010
@@ -15,6 +15,7 @@
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# $Id$
import sys; sys.path.append ('@@PYTHONPATH@@')
import os
@@ -29,8 +30,10 @@
from isc.config.ccsession import *
try:
from bind10_dns import *
-except:
- pass
+except ImportError as e:
+ # C++ loadable module may not be installed; even so the xfrin process
+ # must keep running, so we warn about it and move forward.
+ sys.stderr.write('[b10-xfrin] failed to import DNS module: %s\n' % str(e))
# If B10_FROM_SOURCE is set in the environment, we use data files
# from a directory relative to that, otherwise we use the ones
@@ -47,54 +50,51 @@
__version__ = 'BIND10'
# define xfrin rcode
XFRIN_OK = 0
-XFRIN_RECV_TIMEOUT = 1
-XFRIN_NO_NEWDATA = 2
-XFRIN_QUOTA_ERROR = 3
-XFRIN_IS_DOING = 4
-
-# define xfrin state
-XFRIN_QUERY_SOA = 1
-XFRIN_FIRST_AXFR = 2
-XFRIN_FIRST_IXFR = 3
def log_error(msg):
sys.stderr.write("[b10-xfrin] ")
sys.stderr.write(str(msg))
sys.stderr.write('\n')
-
class XfrinException(Exception):
pass
-
class XfrinConnection(asyncore.dispatcher):
'''Do xfrin in this class. '''
- def __init__(self, zone_name, db_file,
- shutdown_event,
- master_addr,
- port = 53,
- check_soa = True,
- verbose = False,
- idle_timeout = 60):
+ def __init__(self,
+ zone_name, db_file, shutdown_event, master_addr,
+ port = 53, verbose = False, idle_timeout = 60):
''' idle_timeout: max idle time for read data from socket.
db_file: specify the data source file.
check_soa: when it's true, check soa first before sending xfr query
'''
+
asyncore.dispatcher.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self._zone_name = zone_name
self._db_file = db_file
- self._axfrin_db = isc.auth.sqlite3_ds.AXFRInDB(self._db_file, self._zone_name)
self._soa_rr_count = 0
self._idle_timeout = idle_timeout
self.setblocking(1)
- self.connect((master_addr, port))
self._shutdown_event = shutdown_event
self._verbose = verbose
+ self._master_addr = master_addr
+ self._port = port
+
+ def connect_to_master(self):
+ '''Connect to master in TCP.'''
+
+ try:
+ self.connect((self._master_addr, self._port))
+ return True
+ except socket.error as e:
+ self.log_msg('Failed to connect:(%s:%d), %s' % (self._master_addr, self._port, str(e)))
+ return False
def _create_query(self, query_type):
'''Create dns query message. '''
+
msg = message(message_mode.RENDER)
query_id = random.randint(1, 0xFFFF)
self._query_id = query_id
@@ -112,9 +112,9 @@
count = self.send(data[total_count:])
total_count += count
-
def _send_query(self, query_type):
'''Send query message over TCP. '''
+
msg = self._create_query(query_type)
obuf = output_buffer(0)
render = message_render(obuf)
@@ -123,7 +123,6 @@
self._send_data(header_len)
self._send_data(obuf.get_data())
-
def _get_request_response(self, size):
recv_size = 0
@@ -140,55 +139,56 @@
return data
-
- def handle_read(self):
- '''Read query's response from socket. '''
- self._recvd_data = self.recv(self._need_recv_size)
- self._recvd_size = len(self._recvd_data)
- self._recv_time_out = False
-
-
def _check_soa_serial(self):
''' Compare the soa serial, if soa serial in master is less than
the soa serial in local, Finish xfrin.
False: soa serial in master is less or equal to the local one.
True: soa serial in master is bigger
'''
+
self._send_query(rr_type.SOA())
data_size = self._get_request_response(2)
soa_reply = self._get_request_response(int(data_size))
#TODO, need select soa record from data source then compare the two
- #serial
+ #serial, current just return OK, since this function hasn't been used now
return XFRIN_OK
def do_xfrin(self, check_soa, ixfr_first = False):
+ '''Do xfr by sending xfr request and parsing response. '''
+
try:
ret = XFRIN_OK
if check_soa:
ret = self._check_soa_serial()
- self.log_msg('transfer of \'%s\': AXFR started' % self._zone_name)
+ logstr = 'transfer of \'%s\': AXFR ' % self._zone_name
if ret == XFRIN_OK:
- self._axfrin_db.prepare_axfrin()
+ self.log_msg(logstr + 'started')
self._send_query(rr_type.AXFR())
- ret = self._handle_xfrin_response()
-
- self.log_msg('transfer of \'%s\' AXFR ended' % self._zone_name)
+ isc.datasrc.sqlite3_ds.load(self._db_file, self._zone_name,
+ self._handle_xfrin_response)
+
+ self.log_msg(logstr + 'succeeded')
+
except XfrinException as e:
self.log_msg(e)
- self.log_msg('Error happened during xfrin!')
- #TODO, recover data source.
+ self.log_msg(logstr + 'failed')
+ #TODO, recover data source.
+ except isc.datasrc.sqlite3_ds.Sqlite3DSError as e:
+ self.log_msg(e)
+ self.log_msg(logstr + 'failed')
finally:
self.close()
- if ret == XFRIN_OK:
- self._axfrin_db.finish_axfrin()
return ret
def _check_response_status(self, msg):
+ '''Check validation of xfr response. '''
+
#TODO, check more?
- if msg.get_rcode() != rcode.NOERROR():
- raise XfrinException('error response: ')
+ msg_rcode = msg.get_rcode()
+ if msg_rcode != rcode.NOERROR():
+ raise XfrinException('error response: %s' % msg_rcode.to_text())
if not msg.get_header_flag(message_flag.QR()):
raise XfrinException('response is not a response ')
@@ -202,8 +202,9 @@
if msg.get_rr_count(section.QUESTION()) > 1:
raise XfrinException('query section count greater than 1')
-
def _handle_answer_section(self, rrset_iter):
+ '''Return a generator for the reponse in one tcp package to a zone transfer.'''
+
while not rrset_iter.is_last():
rrset = rrset_iter.get_rrset()
rrset_iter.next()
@@ -218,17 +219,24 @@
# Count the soa record count
if rrset.get_type() == rr_type.SOA():
self._soa_rr_count += 1
+
+ # XXX: the current DNS message parser can't preserve the
+ # RR order or separete the beginning and ending SOA RRs.
+ # As a short term workaround, we simply ignore the second
+ # SOA, and ignore the erroneous case where the transfer
+ # session doesn't end with an SOA.
if (self._soa_rr_count == 2):
- # Avoid inserting soa record twice
- return
+ # Avoid inserting soa record twice
+ break
rdata_text = rdata_iter.get_current().to_text()
- rr_data = (rrset_name, rrset_ttl, rrset_class, rrset_type, rdata_text)
- self._axfrin_db.insert_axfr_record([rr_data])
+ yield (rrset_name, rrset_ttl, rrset_class, rrset_type,
+ rdata_text)
rdata_iter.next()
-
def _handle_xfrin_response(self):
+ '''Return a generator for the response to a zone transfer. '''
+
while True:
data_len = self._get_request_response(2)
msg_len = socket.htons(struct.unpack('H', data_len)[0])
@@ -236,44 +244,48 @@
msg = message(message_mode.PARSE)
msg.from_wire(input_buffer(recvdata))
self._check_response_status(msg)
-
+
rrset_iter = section_iter(msg, section.ANSWER())
- self._handle_answer_section(rrset_iter)
+ for rr in self._handle_answer_section(rrset_iter):
+ yield rr
+
if self._soa_rr_count == 2:
- return XFRIN_OK
+ break
if self._shutdown_event.is_set():
- #Check if xfrin process is shutdown.
- #TODO, xfrin may be blocked in one loop.
raise XfrinException('xfrin is forced to stop')
- return XFRIN_OK
-
+ def handle_read(self):
+ '''Read query's response from socket. '''
+
+ self._recvd_data = self.recv(self._need_recv_size)
+ self._recvd_size = len(self._recvd_data)
+ self._recv_time_out = False
def writable(self):
'''Ignore the writable socket. '''
+
return False
-
def log_info(self, msg, type='info'):
# Overwrite the log function, log nothing
pass
def log_msg(self, msg):
- sys.stdout.write('[b10-xfrin] ')
- sys.stdout.write(str(msg))
- sys.stdout.write('\n')
+ if self._verbose:
+ sys.stdout.write('[b10-xfrin] ')
+ sys.stdout.write(str(msg))
+ sys.stdout.write('\n')
def process_xfrin(xfrin_recorder, zone_name, db_file,
shutdown_event, master_addr, port, check_soa, verbose):
- xfrin_recorder.increment(name)
- try:
- conn = XfrinConnection(zone_name, db_file, shutdown_event,
- master_addr, int(port), check_soa, verbose)
- conn.do_xfrin(False)
- except Exception as e:
- log_error(str(e))
+ port = int(port)
+ xfrin_recorder.increment(zone_name)
+ conn = XfrinConnection(zone_name, db_file, shutdown_event,
+ master_addr, port, verbose)
+ if conn.connect_to_master():
+ conn.do_xfrin(check_soa)
xfrin_recorder.decrement(zone_name)
@@ -319,13 +331,6 @@
def config_handler(self, new_config):
# TODO, process new config data
return create_answer(0)
-
-
- def _print_settings(self):
- full_config = self._cc.get_full_config()
- for item in full_config:
- print(item + ":" + str(full_config[item]))
-
def shutdown(self):
''' shutdown the xfrin process. the thread which is doing xfrin should be
@@ -343,13 +348,7 @@
answer = create_answer(0)
cmd = command
try:
- if cmd == 'print_message':
- print(args)
-
- elif cmd == 'print_settings':
- self._print_settings()
-
- elif cmd == 'shutdown':
+ if cmd == 'shutdown':
self._shutdown_event.set()
elif cmd == 'retransfer':
@@ -409,12 +408,12 @@
if self.recorder.xfrin_in_progress(zone_name):
return (1, 'zone xfrin is in progress')
- xfrin_thread = threading.Thread(target = process_xfrin,
- args = (self.recorder,
- zone_name,
- db_file,
+ xfrin_thread = threading.Thread(target = process_xfrin,
+ args = (self.recorder,
+ zone_name,
+ db_file,
self._shutdown_event,
- master_addr,
+ master_addr,
port, check_soa, self._verbose))
xfrin_thread.start()
@@ -471,6 +470,3 @@
if xfrind:
xfrind.shutdown()
-
-
-
Modified: experiments/python-binding/src/bin/xfrin/xfrin.spec.pre.in
==============================================================================
--- experiments/python-binding/src/bin/xfrin/xfrin.spec.pre.in (original)
+++ experiments/python-binding/src/bin/xfrin/xfrin.spec.pre.in Wed May 12 14:23:18 2010
@@ -10,22 +10,7 @@
}
],
"commands": [
- {
- "command_name": "print_message",
- "command_description": "Print the given message to stdout",
- "command_args": [ {
- "item_name": "message",
- "item_type": "string",
- "item_optional": False,
- "item_default": ""
- } ]
- },
- {
- "command_name": "print_settings",
- "command_description": "Print some_string and some_int to stdout",
- "command_args": []
- },
- {
+ {
'command_name': 'retransfer',
"command_description": 'retransfer a single zone without checking zone serial number',
'command_args': [ {
Modified: experiments/python-binding/src/bin/xfrout/Makefile.am
==============================================================================
--- experiments/python-binding/src/bin/xfrout/Makefile.am (original)
+++ experiments/python-binding/src/bin/xfrout/Makefile.am Wed May 12 14:23:18 2010
@@ -1,3 +1,5 @@
+SUBDIRS = tests
+
pkglibexecdir = $(libexecdir)/@PACKAGE@
pkglibexec_SCRIPTS = b10-xfrout
@@ -5,9 +7,18 @@
b10_xfroutdir = $(DESTDIR)$(pkgdatadir)
b10_xfrout_DATA = xfrout.spec
-CLEANFILES= b10-xfrout xfrout.spec
+CLEANFILES= b10-xfrout xfrout.pyc xfrout.spec
-EXTRA_DIST = tests/xfrout_test.py
+man_MANS = b10-xfrout.8
+EXTRA_DIST = $(man_MANS) b10-xfrout.xml
+
+if ENABLE_MAN
+
+b10-xfrout.8: b10-xfrout.xml
+ xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrout.xml
+
+endif
+
xfrout.spec: xfrout.spec.pre
$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" xfrout.spec.pre >$@
Modified: experiments/python-binding/src/bin/xfrout/run_b10-xfrout.sh.in
==============================================================================
--- experiments/python-binding/src/bin/xfrout/run_b10-xfrout.sh.in (original)
+++ experiments/python-binding/src/bin/xfrout/run_b10-xfrout.sh.in Wed May 12 14:23:18 2010
@@ -1,10 +1,25 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
MYPATH_PATH=@abs_top_builddir@/src/bin/xfrout
-PYTHONPATH=@abs_top_srcdir@/src/lib/python
+PYTHONPATH=@abs_top_srcdir@/src/lib/python:@abs_top_builddir@/src/lib/xfr/.libs
export PYTHONPATH
cd ${MYPATH_PATH}
Modified: experiments/python-binding/src/bin/xfrout/tests/xfrout_test.in
==============================================================================
--- experiments/python-binding/src/bin/xfrout/tests/xfrout_test.in (original)
+++ experiments/python-binding/src/bin/xfrout/tests/xfrout_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/bin/xfrout/xfrout.py.in
==============================================================================
--- experiments/python-binding/src/bin/xfrout/xfrout.py.in (original)
+++ experiments/python-binding/src/bin/xfrout/xfrout.py.in Wed May 12 14:23:18 2010
@@ -22,7 +22,7 @@
import threading
import struct
import signal
-from isc.auth import sqlite3_ds
+from isc.datasrc import sqlite3_ds
from socketserver import *
import os
from isc.config.ccsession import *
@@ -32,8 +32,10 @@
try:
from bind10_xfr import *
from bind10_dns import *
-except:
- pass
+except ImportError as e:
+ # C++ loadable module may not be installed; even so the xfrout process
+ # must keep running, so we warn about it and move forward.
+ sys.stderr.write('[b10-xfrout] failed to import DNS or XFR module: %s\n' % str(e))
if "B10_FROM_SOURCE" in os.environ:
SPECFILE_PATH = os.environ["B10_FROM_SOURCE"] + "/src/bin/xfrout"
@@ -42,6 +44,7 @@
DATAROOTDIR = "@datarootdir@"
SPECFILE_PATH = "@datadir@/@PACKAGE@".replace("${datarootdir}", DATAROOTDIR).replace("${prefix}", PREFIX)
SPECFILE_LOCATION = SPECFILE_PATH + "/xfrout.spec"
+UNIX_SOCKET_FILE = "@localstatedir@".replace("${prefix}", PREFIX) + "/auth_xfrout_conn"
MAX_TRANSFERS_OUT = 10
verbose_mode = False
@@ -53,8 +56,10 @@
class XfroutSession(BaseRequestHandler):
def handle(self):
fd = recv_fd(self.request.fileno())
+ if fd < 0:
+ raise XfroutException("failed to receive the FD for XFR connection")
data_len = self.request.recv(2)
- msg_len = struct.unpack('H', data_len)[0]
+ msg_len = struct.unpack('!H', data_len)[0]
msgdata = self.request.recv(msg_len)
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
try:
@@ -64,7 +69,7 @@
self.log_msg(str(e))
sock.close()
-
+
def _parse_query_message(self, mdata):
''' parse query message to [socket,message]'''
#TODO, need to add parseHeader() in case the message header is invalid
@@ -77,7 +82,6 @@
return rcode.FORMERR(), None
return rcode.NOERROR(), msg
-
def _get_query_zone_name(self, msg):
q_iter = question_iter(msg)
@@ -273,12 +277,25 @@
'''The unix domain socket server which accept xfr query sent from auth server.'''
def __init__(self, sock_file, handle_class, shutdown_event, config_data):
+ try:
+ os.unlink(sock_file)
+ except:
+ pass
+
+ self._sock_file = sock_file
ThreadingUnixStreamServer.__init__(self, sock_file, handle_class)
self._lock = threading.Lock()
self._transfers_counter = 0
self._shutdown_event = shutdown_event
self.update_config_data(config_data)
-
+
+
+ def shutdown(self):
+ ThreadingUnixStreamServer.shutdown(self)
+ try:
+ os.unlink(self._sock_file)
+ except:
+ pass
def update_config_data(self, new_config):
'''Apply the new config setting of xfrout module. '''
@@ -311,16 +328,18 @@
self._transfers_counter -= 1
self._lock.release()
-
def listen_on_xfr_query(unix_socket_server):
- '''Listen xfr query in one single thread. '''
- unix_socket_server.serve_forever()
+
+ '''Listen xfr query in one single thread. Polls for shutdown
+ every 0.1 seconds, is there a better time?
+ '''
+ unix_socket_server.serve_forever(poll_interval = 0.1)
class XfroutServer:
def __init__(self):
self._unix_socket_server = None
- self._listen_sock_file = '/tmp/auth_xfrout_conn' # TODO, should this be configurable in cfgmgr
+ self._listen_sock_file = UNIX_SOCKET_FILE
self._shutdown_event = threading.Event()
self._cc = isc.config.ModuleCCSession(SPECFILE_LOCATION, self.config_handler, self.command_handler)
self._config_data = self._cc.get_full_config()
@@ -330,11 +349,7 @@
def _start_xfr_query_listener(self):
'''Start a new thread to accept xfr query. '''
- try:
- os.unlink(self._listen_sock_file)
- except:
- pass
-
+
self._unix_socket_server = UnixSockServer(self._listen_sock_file, XfroutSession,
self._shutdown_event, self._config_data);
listener = threading.Thread(target = listen_on_xfr_query, args = (self._unix_socket_server,))
@@ -360,6 +375,9 @@
''' shutdown the xfrout process. The thread which is doing zone transfer-out should be
terminated.
'''
+
+ global xfrout_server
+ xfrout_server = None #Avoid shutdown is called twice
self._shutdown_event.set()
if self._unix_socket_server:
self._unix_socket_server.shutdown()
@@ -370,7 +388,6 @@
continue
th.join()
-
def command_handler(self, cmd, args):
if cmd == "shutdown":
if verbose_mode:
@@ -392,7 +409,7 @@
xfrout_server = None
def signal_handler(signal, frame):
- if xfrout_server:
+ if xfrout_server:
xfrout_server.shutdown()
sys.exit(0)
Modified: experiments/python-binding/src/lib/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/Makefile.am (original)
+++ experiments/python-binding/src/lib/Makefile.am Wed May 12 14:23:18 2010
@@ -1,4 +1,4 @@
-SUBDIRS = exceptions dns cc config auth dns-python python
+SUBDIRS = exceptions dns cc config datasrc python
if HAVE_BOOST_PYTHON
if HAVE_BOOST_SYSTEM
SUBDIRS += xfr
Modified: experiments/python-binding/src/lib/cc/data.cc
==============================================================================
--- experiments/python-binding/src/lib/cc/data.cc (original)
+++ experiments/python-binding/src/lib/cc/data.cc Wed May 12 14:23:18 2010
@@ -898,9 +898,9 @@
{
ss << encode_length(1, ITEM_BOOL);
if (boolValue()) {
- ss << 0x01;
- } else {
- ss << 0x00;
+ ss << '1';
+ } else {
+ ss << '0';
}
}
Modified: experiments/python-binding/src/lib/cc/data.h
==============================================================================
--- experiments/python-binding/src/lib/cc/data.h (original)
+++ experiments/python-binding/src/lib/cc/data.h Wed May 12 14:23:18 2010
@@ -411,7 +411,7 @@
std::map<std::string, ElementPtr> m;
public:
- MapElement(std::map<std::string, ElementPtr> v) : Element(map), m(v) {};
+ MapElement(const std::map<std::string, ElementPtr>& v) : Element(map), m(v) {};
const std::map<std::string, ElementPtr>& mapValue() { return m; }
using Element::getValue;
bool getValue(std::map<std::string, ElementPtr>& t) { t = m; return true; };
Modified: experiments/python-binding/src/lib/config/tests/data_def_unittests_config.h.in
==============================================================================
--- experiments/python-binding/src/lib/config/tests/data_def_unittests_config.h.in (original)
+++ experiments/python-binding/src/lib/config/tests/data_def_unittests_config.h.in Wed May 12 14:23:18 2010
@@ -1,1 +1,15 @@
+// Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
#define TEST_DATA_PATH "@abs_srcdir@/../testdata"
Modified: experiments/python-binding/src/lib/dns/base32.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/base32.cc (original)
+++ experiments/python-binding/src/lib/dns/base32.cc Wed May 12 14:23:18 2010
@@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
-#include "base32.h"
+#include <dns/base32.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/base64.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/base64.cc (original)
+++ experiments/python-binding/src/lib/dns/base64.cc Wed May 12 14:23:18 2010
@@ -14,8 +14,6 @@
// $Id$
-#include "config.h"
-
#include <stdint.h>
#include <cassert>
#include <iterator>
@@ -26,8 +24,9 @@
#include <boost/archive/iterators/binary_from_base64.hpp>
#include <boost/archive/iterators/transform_width.hpp>
-#include "base64.h"
#include <exceptions/exceptions.h>
+
+#include <dns/base64.h>
using namespace std;
using namespace boost::archive::iterators;
Modified: experiments/python-binding/src/lib/dns/dnssectime.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/dnssectime.cc (original)
+++ experiments/python-binding/src/lib/dns/dnssectime.cc Wed May 12 14:23:18 2010
@@ -25,15 +25,15 @@
#include <exceptions/exceptions.h>
-#include "base64.h"
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
-#include "rdataclass.h"
-#include "dnssectime.h"
+#include <dns/base64.h>
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
+#include <dns/dnssectime.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/exceptions.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/exceptions.cc (original)
+++ experiments/python-binding/src/lib/dns/exceptions.cc Wed May 12 14:23:18 2010
@@ -14,8 +14,8 @@
// $Id$
-#include "exceptions.h"
-#include "message.h"
+#include <dns/exceptions.h>
+#include <dns/message.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/hex.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/hex.cc (original)
+++ experiments/python-binding/src/lib/dns/hex.cc Wed May 12 14:23:18 2010
@@ -28,7 +28,7 @@
#include <ctype.h>
#include <stdint.h>
-#include "hex.h"
+#include <dns/hex.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/message.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/message.cc (original)
+++ experiments/python-binding/src/lib/dns/message.cc Wed May 12 14:23:18 2010
@@ -26,17 +26,17 @@
#include <exceptions/exceptions.h>
-#include "buffer.h"
-#include "exceptions.h"
-#include "message.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "question.h"
-#include "rdataclass.h"
-#include "rrclass.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rrset.h"
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/message.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/question.h>
+#include <dns/rdataclass.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rrset.h>
using namespace std;
using namespace boost;
Modified: experiments/python-binding/src/lib/dns/message.h
==============================================================================
--- experiments/python-binding/src/lib/dns/message.h (original)
+++ experiments/python-binding/src/lib/dns/message.h Wed May 12 14:23:18 2010
@@ -25,8 +25,8 @@
#include <exceptions/exceptions.h>
-#include "question.h"
-#include "rrset.h"
+#include <dns/question.h>
+#include <dns/rrset.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/messagerenderer.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/messagerenderer.cc (original)
+++ experiments/python-binding/src/lib/dns/messagerenderer.cc Wed May 12 14:23:18 2010
@@ -18,9 +18,9 @@
#include <cassert>
#include <set>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
namespace isc {
namespace dns {
@@ -34,8 +34,14 @@
/// objects, and searches the set for the position of the longest match
/// (ancestor) name against each new name to be rendered into the buffer.
struct NameCompressNode {
- NameCompressNode(const OutputBuffer& buffer, size_t pos, size_t len) :
- buffer_(buffer), pos_(pos), len_(len) {}
+ NameCompressNode(const MessageRenderer& renderer,
+ const OutputBuffer& buffer, const size_t pos,
+ const size_t len) :
+ renderer_(renderer), buffer_(buffer), pos_(pos), len_(len) {}
+ /// The renderer that performs name compression using the node.
+ /// This is kept in each node to detect the compression mode
+ /// (case-sensitive or not) in the comparison functor (\c NameCompare).
+ const MessageRenderer& renderer_;
/// The buffer in which the corresponding name is rendered.
const OutputBuffer& buffer_;
/// The position (offset from the beginning) in the buffer where the
@@ -77,6 +83,9 @@
return (false);
}
+ const bool case_sensitive =
+ (n1.renderer_.getCompressMode() == MessageRenderer::CASE_SENSITIVE);
+
uint16_t pos1 = n1.pos_;
uint16_t pos2 = n2.pos_;
uint16_t l1 = 0;
@@ -84,10 +93,19 @@
for (uint16_t i = 0; i < n1.len_; i++, pos1++, pos2++) {
pos1 = nextPosition(n1.buffer_, pos1, l1);
pos2 = nextPosition(n2.buffer_, pos2, l2);
- if (tolower(n1.buffer_[pos1]) < tolower(n2.buffer_[pos2])) {
- return (true);
- } else if (tolower(n1.buffer_[pos1]) > tolower(n2.buffer_[pos2])) {
- return (false);
+ if (case_sensitive) {
+ if (n1.buffer_[pos1] < n2.buffer_[pos2]) {
+ return (true);
+ } else if (n1.buffer_[pos1] > n2.buffer_[pos2]) {
+ return (false);
+ }
+ } else {
+ if (tolower(n1.buffer_[pos1]) < tolower(n2.buffer_[pos2])) {
+ return (true);
+ } else if (tolower(n1.buffer_[pos1]) >
+ tolower(n2.buffer_[pos2])) {
+ return (false);
+ }
}
}
@@ -129,14 +147,14 @@
/// The implementation is hidden from applications. We can refer to specific
/// members of this class only within the implementation source file.
///
-struct MessageRendererImpl {
+struct MessageRenderer::MessageRendererImpl {
/// \brief Constructor from an output buffer.
///
/// \param buffer An \c OutputBuffer object to which wire format data is
/// written.
MessageRendererImpl(OutputBuffer& buffer) :
buffer_(buffer), nbuffer_(Name::MAX_WIRE), msglength_limit_(512),
- truncated_(false)
+ truncated_(false), compress_mode_(MessageRenderer::CASE_INSENSITIVE)
{}
/// The buffer that holds the entire DNS message.
OutputBuffer& buffer_;
@@ -153,108 +171,105 @@
/// A boolean flag that indicates truncation has occurred while rendering
/// the data.
bool truncated_;
+ /// The name compression mode.
+ CompressMode compress_mode_;
};
MessageRenderer::MessageRenderer(OutputBuffer& buffer) :
impl_(new MessageRendererImpl(buffer))
{}
-MessageRenderer::~MessageRenderer()
-{
+MessageRenderer::~MessageRenderer() {
delete impl_;
}
void
-MessageRenderer::skip(size_t len)
-{
+MessageRenderer::skip(const size_t len) {
impl_->buffer_.skip(len);
}
void
-MessageRenderer::trim(size_t len)
-{
+MessageRenderer::trim(const size_t len) {
impl_->buffer_.trim(len);
}
void
-MessageRenderer::clear()
-{
+MessageRenderer::clear() {
impl_->buffer_.clear();
impl_->nbuffer_.clear();
impl_->nodeset_.clear();
impl_->msglength_limit_ = 512;
impl_->truncated_ = false;
-}
-
-void
-MessageRenderer::writeUint8(uint8_t data)
-{
+ impl_->compress_mode_ = CASE_INSENSITIVE;
+}
+
+void
+MessageRenderer::writeUint8(const uint8_t data) {
impl_->buffer_.writeUint8(data);
}
void
-MessageRenderer::writeUint16(uint16_t data)
-{
+MessageRenderer::writeUint16(const uint16_t data) {
impl_->buffer_.writeUint16(data);
}
void
-MessageRenderer::writeUint16At(uint16_t data, size_t pos)
-{
+MessageRenderer::writeUint16At(const uint16_t data, const size_t pos) {
impl_->buffer_.writeUint16At(data, pos);
}
void
-MessageRenderer::writeUint32(uint32_t data)
-{
+MessageRenderer::writeUint32(const uint32_t data) {
impl_->buffer_.writeUint32(data);
}
void
-MessageRenderer::writeData(const void* data, size_t len)
-{
+MessageRenderer::writeData(const void* const data, const size_t len) {
impl_->buffer_.writeData(data, len);
}
const void*
-MessageRenderer::getData() const
-{
+MessageRenderer::getData() const {
return (impl_->buffer_.getData());
}
size_t
-MessageRenderer::getLength() const
-{
+MessageRenderer::getLength() const {
return (impl_->buffer_.getLength());
}
size_t
-MessageRenderer::getLengthLimit() const
-{
+MessageRenderer::getLengthLimit() const {
return (impl_->msglength_limit_);
}
void
-MessageRenderer::setLengthLimit(size_t len)
-{
+MessageRenderer::setLengthLimit(const size_t len) {
impl_->msglength_limit_ = len;
}
bool
-MessageRenderer::isTruncated() const
-{
+MessageRenderer::isTruncated() const {
return (impl_->truncated_);
}
void
-MessageRenderer::setTruncated()
-{
+MessageRenderer::setTruncated() {
impl_->truncated_ = true;
}
-void
-MessageRenderer::writeName(const Name& name, bool compress)
-{
+MessageRenderer::CompressMode
+MessageRenderer::getCompressMode() const {
+ return (impl_->compress_mode_);
+}
+
+void
+MessageRenderer::setCompressMode(const CompressMode mode) {
+ impl_->compress_mode_ = mode;
+}
+
+void
+MessageRenderer::writeName(const Name& name, const bool compress) {
impl_->nbuffer_.clear();
name.toWire(impl_->nbuffer_);
@@ -269,7 +284,7 @@
if (impl_->nbuffer_[i] == 0) {
continue;
}
- n = impl_->nodeset_.find(NameCompressNode(impl_->nbuffer_, i,
+ n = impl_->nodeset_.find(NameCompressNode(*this, impl_->nbuffer_, i,
impl_->nbuffer_.getLength() -
i));
if (n != notfound) {
@@ -278,7 +293,7 @@
}
// Record the current offset before extending the buffer.
- size_t offset = impl_->buffer_.getLength();
+ const size_t offset = impl_->buffer_.getLength();
// Write uncompress part...
impl_->buffer_.writeData(impl_->nbuffer_.getData(),
compress ? i : impl_->nbuffer_.getLength());
@@ -298,7 +313,8 @@
if (offset + j > Name::MAX_COMPRESS_POINTER) {
break;
}
- impl_->nodeset_.insert(NameCompressNode(impl_->buffer_, offset + j,
+ impl_->nodeset_.insert(NameCompressNode(*this, impl_->buffer_,
+ offset + j,
impl_->nbuffer_.getLength() -
j));
}
Modified: experiments/python-binding/src/lib/dns/messagerenderer.h
==============================================================================
--- experiments/python-binding/src/lib/dns/messagerenderer.h (original)
+++ experiments/python-binding/src/lib/dns/messagerenderer.h Wed May 12 14:23:18 2010
@@ -22,7 +22,6 @@
// forward declarations
class OutputBuffer;
class Name;
-class MessageRendererImpl;
///
/// \brief The \c MessageRenderer class encapsulates implementation details
@@ -38,7 +37,7 @@
/// to care about this class.
///
/// A \c MessageRenderer class object is constructed with a \c OutputBuffer
-/// object, which is the buffer into which the rendered data will be written.
+/// object, which is the buffer into which the rendered %data will be written.
/// Normally the buffer is expected to be empty on construction, but it doesn't
/// have to be so; the \c MessageRenderer object will start rendering from the
/// end of the buffer at the time of construction. However, if the
@@ -69,6 +68,34 @@
/// abstraction and keep the definition simpler.
class MessageRenderer {
public:
+ /// \brief Compression mode constants.
+ ///
+ /// The \c CompressMode enum type represents the name compression mode
+ /// for the \c MessageRenderer.
+ /// \c CASE_INSENSITIVE means compress names in case-insensitive manner;
+ /// \c CASE_SENSITIVE means compress names in case-sensitive manner.
+ /// By default, \c MessageRenderer compresses names in case-insensitive
+ /// manner.
+ /// Compression mode can be dynamically modified by the
+ /// \c setCompressMode() method.
+ /// The mode can be changed even in the middle of rendering, although this
+ /// is not an intended usage. In this case the names already compressed
+ /// are intact; only names being compressed after the mode change are
+ /// affected by the change.
+ /// If the internal \c MessageRenderer is reinitialized by the \c clear()
+ /// method, the compression mode will be reset to the default, which is
+ /// \c CASE_INSENSITIVE
+ ///
+ /// One specific case where case-sensitive compression is required is
+ /// AXFR as described in draft-ietf-dnsext-axfr-clarify. A primary
+ /// authoritative DNS server implementation using this API would specify
+ /// \c CASE_SENSITIVE before rendering outgoing AXFR messages.
+ ///
+ enum CompressMode {
+ CASE_INSENSITIVE, //!< Compress names case-insensitive manner (default)
+ CASE_SENSITIVE //!< Compress names case-sensitive manner
+ };
+public:
///
/// \name Constructors and Destructor
//@{
@@ -116,6 +143,12 @@
///
/// \return The maximum length in bytes.
size_t getLengthLimit() const;
+ /// \brief Return the compression mode of the \c MessageRenderer.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \return The current compression mode.
+ CompressMode getCompressMode() const;
//@}
///
@@ -134,6 +167,12 @@
///
/// \param len The maximum length in bytes.
void setLengthLimit(size_t len);
+ /// \brief Set the compression mode of the \c MessageRenderer.
+ ///
+ /// This method never throws an exception.
+ ///
+ /// \param mode A \c CompressMode value representing the compression mode.
+ void setCompressMode(CompressMode mode);
//@}
///
@@ -220,6 +259,7 @@
/// \param compress A boolean indicating whether to enable name compression.
void writeName(const Name& name, bool compress = true);
private:
+ struct MessageRendererImpl;
MessageRendererImpl* impl_;
};
}
Modified: experiments/python-binding/src/lib/dns/name.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/name.cc (original)
+++ experiments/python-binding/src/lib/dns/name.cc Wed May 12 14:23:18 2010
@@ -20,13 +20,12 @@
#include <functional>
#include <vector>
#include <iostream>
-
#include <algorithm>
-#include "buffer.h"
-#include "exceptions.h"
-#include "name.h"
-#include "messagerenderer.h"
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
using namespace std;
using isc::dns::NameComparisonResult;
@@ -127,8 +126,7 @@
} ft_state;
}
-Name::Name(const std::string &namestring, bool downcase)
-{
+Name::Name(const std::string &namestring, bool downcase) {
//
// Initialize things to make the compiler happy; they're not required.
//
@@ -402,20 +400,17 @@
}
void
-Name::toWire(OutputBuffer& buffer) const
-{
+Name::toWire(OutputBuffer& buffer) const {
buffer.writeData(ndata_.data(), ndata_.size());
}
void
-Name::toWire(MessageRenderer& renderer) const
-{
+Name::toWire(MessageRenderer& renderer) const {
renderer.writeName(*this);
}
std::string
-Name::toText(bool omit_final_dot) const
-{
+Name::toText(bool omit_final_dot) const {
if (length_ == 1) {
//
// Special handling for the root label. We ignore omit_final_dot.
@@ -494,8 +489,7 @@
}
NameComparisonResult
-Name::compare(const Name& other) const
-{
+Name::compare(const Name& other) const {
// Determine the relative ordering under the DNSSEC order relation of
// 'this' and 'other', and also determine the hierarchical relationship
// of the names.
@@ -554,8 +548,7 @@
}
bool
-Name::equals(const Name& other) const
-{
+Name::equals(const Name& other) const {
if (length_ != other.length_ || labelcount_ != other.labelcount_) {
return (false);
}
@@ -582,38 +575,32 @@
}
bool
-Name::leq(const Name& other) const
-{
+Name::leq(const Name& other) const {
return (compare(other).getOrder() <= 0);
}
bool
-Name::geq(const Name& other) const
-{
+Name::geq(const Name& other) const {
return (compare(other).getOrder() >= 0);
}
bool
-Name::lthan(const Name& other) const
-{
+Name::lthan(const Name& other) const {
return (compare(other).getOrder() < 0);
}
bool
-Name::gthan(const Name& other) const
-{
+Name::gthan(const Name& other) const {
return (compare(other).getOrder() > 0);
}
bool
-Name::isWildcard() const
-{
+Name::isWildcard() const {
return (length_ >= 2 && ndata_[0] == 1 && ndata_[1] == '*');
}
Name
-Name::concatenate(const Name& suffix) const
-{
+Name::concatenate(const Name& suffix) const {
assert(this->length_ > 0 && suffix.length_ > 0);
assert(this->labelcount_ > 0 && suffix.labelcount_ > 0);
@@ -650,8 +637,7 @@
}
Name
-Name::reverse() const
-{
+Name::reverse() const {
Name retname;
//
// Set up offsets: The size of the string and number of labels will
@@ -680,9 +666,8 @@
}
Name
-Name::split(unsigned int first, unsigned int n) const
-{
- if (n == 0 || first + n > labelcount_) {
+Name::split(unsigned int first, unsigned int n) const {
+ if (n == 0 || n > labelcount_ || first > labelcount_ - n) {
isc_throw(OutOfRange, "Name::split: invalid split range");
}
@@ -718,8 +703,7 @@
}
Name&
-Name::downcase()
-{
+Name::downcase() {
unsigned int nlen = length_;
unsigned int labels = labelcount_;
unsigned int pos = 0;
@@ -747,8 +731,7 @@
}
std::ostream&
-operator<<(std::ostream& os, const Name& name)
-{
+operator<<(std::ostream& os, const Name& name) {
os << name.toText();
return (os);
}
Modified: experiments/python-binding/src/lib/dns/name.h
==============================================================================
--- experiments/python-binding/src/lib/dns/name.h (original)
+++ experiments/python-binding/src/lib/dns/name.h Wed May 12 14:23:18 2010
@@ -243,8 +243,7 @@
/// method will automatically decompress it.
///
/// If the given data does not represent a valid DNS name, an exception
- /// of class \c TooLongName, \c BadLabelType, \c BadPointer, or
- /// \c IncompleteName will be thrown.
+ /// of class \c DNSMessageFORMERR will be thrown.
/// In addition, if resource allocation for the new name fails, a
/// corresponding standard exception will be thrown.
///
@@ -605,8 +604,7 @@
};
inline const Name&
-Name::ROOT_NAME()
-{
+Name::ROOT_NAME() {
static Name root_name(".");
return (root_name);
}
Modified: experiments/python-binding/src/lib/dns/python_dns.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/python_dns.cc (original)
+++ experiments/python-binding/src/lib/dns/python_dns.cc Wed May 12 14:23:18 2010
@@ -14,8 +14,6 @@
// $Id: message_python.cc 2010-03-08 18:44:00 feng $
-#include <cassert>
-
#include <boost/python.hpp>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
@@ -25,20 +23,22 @@
#include <boost/python/copy_const_reference.hpp>
#include <boost/shared_ptr.hpp>
+#include <cassert>
+
#include <exceptions/exceptions.h>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rrtype.h"
-#include "rrclass.h"
-#include "rrttl.h"
-#include "rrset.h"
-#include "rdata.h"
-#include "rdataclass.h"
-#include "rrsetlist.h"
-#include "question.h"
-#include "message.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rrtype.h>
+#include <dns/rrclass.h>
+#include <dns/rrttl.h>
+#include <dns/rrset.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
+#include <dns/rrsetlist.h>
+#include <dns/question.h>
+#include <dns/message.h>
using namespace isc::dns;
using namespace boost::python;
Modified: experiments/python-binding/src/lib/dns/question.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/question.cc (original)
+++ experiments/python-binding/src/lib/dns/question.cc Wed May 12 14:23:18 2010
@@ -17,12 +17,12 @@
#include <iostream>
#include <string>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "question.h"
-#include "rrclass.h"
-#include "rrtype.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/question.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/question.h
==============================================================================
--- experiments/python-binding/src/lib/dns/question.h (original)
+++ experiments/python-binding/src/lib/dns/question.h Wed May 12 14:23:18 2010
@@ -22,9 +22,9 @@
#include <boost/shared_ptr.hpp>
-#include "name.h"
-#include "rrclass.h"
-#include "rrtype.h"
+#include <dns/name.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/rdata.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata.cc Wed May 12 14:23:18 2010
@@ -29,12 +29,12 @@
#include <boost/lexical_cast.hpp>
#include <boost/shared_ptr.hpp>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rrparamregistry.h"
-#include "rrtype.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rrparamregistry.h>
+#include <dns/rrtype.h>
using namespace std;
using namespace boost;
Modified: experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.cc Wed May 12 14:23:18 2010
@@ -18,11 +18,12 @@
#include <string>
-#include "buffer.h"
#include <exceptions/exceptions.h>
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/ch_3/a_1.h Wed May 12 14:23:18 2010
@@ -18,7 +18,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/cname_5.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/cname_5.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/cname_5.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,15 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/cname_5.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/cname_5.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/cname_5.h Wed May 12 14:23:18 2010
@@ -18,8 +18,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/dname_39.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/dname_39.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/dname_39.cc Wed May 12 14:23:18 2010
@@ -18,11 +18,11 @@
#include <string>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/dname_39.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/dname_39.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/dname_39.h Wed May 12 14:23:18 2010
@@ -18,8 +18,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.cc Wed May 12 14:23:18 2010
@@ -14,21 +14,20 @@
// $Id$
-#include "config.h"
-
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
-#include "base64.h"
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rdata.h"
-#include "rdataclass.h"
#include <boost/lexical_cast.hpp>
#include <boost/foreach.hpp>
+
+#include <dns/base64.h>
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/dnskey_48.h Wed May 12 14:23:18 2010
@@ -18,10 +18,10 @@
#include <string>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ds_43.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ds_43.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ds_43.cc Wed May 12 14:23:18 2010
@@ -14,20 +14,19 @@
// $Id$
-#include <config.h>
-
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
-#include "buffer.h"
-#include "hex.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rdata.h"
-#include "rdataclass.h"
#include <boost/lexical_cast.hpp>
+
+#include <dns/buffer.h>
+#include <dns/hex.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ds_43.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ds_43.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ds_43.h Wed May 12 14:23:18 2010
@@ -18,10 +18,10 @@
#include <string>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/mx_15.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/mx_15.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/mx_15.cc Wed May 12 14:23:18 2010
@@ -14,18 +14,19 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
#include <boost/lexical_cast.hpp>
-#include "buffer.h"
#include <exceptions/exceptions.h>
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
using namespace boost;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/mx_15.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/mx_15.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/mx_15.h Wed May 12 14:23:18 2010
@@ -20,8 +20,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ns_2.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ns_2.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ns_2.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,15 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ns_2.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ns_2.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ns_2.h Wed May 12 14:23:18 2010
@@ -18,8 +18,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.cc Wed May 12 14:23:18 2010
@@ -14,25 +14,24 @@
// $Id$
-#include "config.h"
-
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
-#include "base32.h"
-#include "buffer.h"
-#include "exceptions.h"
-#include "hex.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
-#include "rdataclass.h"
#include <boost/lexical_cast.hpp>
+
+#include <dns/base32.h>
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/hex.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec3_50.h Wed May 12 14:23:18 2010
@@ -19,10 +19,10 @@
#include <string>
#include <vector>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.cc Wed May 12 14:23:18 2010
@@ -14,20 +14,19 @@
// $Id$
-#include "config.h"
-
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
-#include "buffer.h"
-#include "hex.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rdata.h"
-#include "rdataclass.h"
#include <boost/lexical_cast.hpp>
+
+#include <dns/buffer.h>
+#include <dns/hex.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec3param_51.h Wed May 12 14:23:18 2010
@@ -19,10 +19,10 @@
#include <string>
#include <vector>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.cc Wed May 12 14:23:18 2010
@@ -14,22 +14,20 @@
// $Id$
-#include "config.h"
-
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
-#include "base64.h"
-#include "buffer.h"
-#include "exceptions.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/base64.h>
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/nsec_47.h Wed May 12 14:23:18 2010
@@ -18,10 +18,10 @@
#include <string>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/opt_41.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/opt_41.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/opt_41.cc Wed May 12 14:23:18 2010
@@ -14,14 +14,14 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/opt_41.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/opt_41.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/opt_41.h Wed May 12 14:23:18 2010
@@ -18,7 +18,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,15 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
-#include "buffer.h"
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/ptr_12.h Wed May 12 14:23:18 2010
@@ -18,8 +18,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.cc Wed May 12 14:23:18 2010
@@ -14,24 +14,23 @@
// $Id$
-#include "config.h"
-
#include <string>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
-#include "base64.h"
-#include "buffer.h"
-#include "dnssectime.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
-#include "rdataclass.h"
#include <boost/lexical_cast.hpp>
+
+#include <dns/base64.h>
+#include <dns/buffer.h>
+#include <dns/dnssectime.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
#include <stdio.h>
#include <time.h>
Modified: experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/rrsig_46.h Wed May 12 14:23:18 2010
@@ -18,10 +18,10 @@
#include <string>
-#include "name.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rdata.h>
// BEGIN_HEADER_GUARD
Modified: experiments/python-binding/src/lib/dns/rdata/generic/soa_6.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/soa_6.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/soa_6.cc Wed May 12 14:23:18 2010
@@ -14,18 +14,19 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <string>
#include <boost/lexical_cast.hpp>
-#include "buffer.h"
#include <exceptions/exceptions.h>
-#include "name.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+
+#include <dns/buffer.h>
+#include <dns/name.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
using namespace boost;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/soa_6.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/soa_6.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/soa_6.h Wed May 12 14:23:18 2010
@@ -18,8 +18,8 @@
#include <string>
-#include "name.h"
-#include "rdata.h"
+#include <dns/name.h>
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/generic/txt_16.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/txt_16.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/txt_16.cc Wed May 12 14:23:18 2010
@@ -14,18 +14,16 @@
// $Id$
-#include "config.h"
-
#include <stdint.h>
#include <string.h>
#include <string>
#include <vector>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/generic/txt_16.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/generic/txt_16.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/generic/txt_16.h Wed May 12 14:23:18 2010
@@ -21,7 +21,7 @@
#include <string>
#include <vector>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,16 @@
// $Id$
-#include <config.h> // for UNUSED
+#include <config.h> // for UNUSED_PARAM
#include <string>
-#include "buffer.h"
#include <exceptions/exceptions.h>
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/hs_4/a_1.h Wed May 12 14:23:18 2010
@@ -18,7 +18,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/in_1/a_1.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/in_1/a_1.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/in_1/a_1.cc Wed May 12 14:23:18 2010
@@ -14,8 +14,6 @@
// $Id: rdata.cc 545 2010-01-27 00:33:28Z jinmei $
-#include "config.h"
-
#include <stdint.h>
#include <string.h>
@@ -26,11 +24,11 @@
#include <exceptions/exceptions.h>
-#include "buffer.h"
-#include "exceptions.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/in_1/a_1.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/in_1/a_1.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/in_1/a_1.h Wed May 12 14:23:18 2010
@@ -18,7 +18,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.cc Wed May 12 14:23:18 2010
@@ -14,8 +14,6 @@
// $Id$
-#include "config.h"
-
#include <stdint.h>
#include <string.h>
@@ -26,11 +24,11 @@
#include <exceptions/exceptions.h>
-#include "buffer.h"
-#include "exceptions.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/exceptions.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/in_1/aaaa_28.h Wed May 12 14:23:18 2010
@@ -20,7 +20,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rdata/template.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/template.cc (original)
+++ experiments/python-binding/src/lib/dns/rdata/template.cc Wed May 12 14:23:18 2010
@@ -16,10 +16,10 @@
#include <string>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "rdata.h"
-#include "rdataclass.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
Modified: experiments/python-binding/src/lib/dns/rdata/template.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rdata/template.h (original)
+++ experiments/python-binding/src/lib/dns/rdata/template.h Wed May 12 14:23:18 2010
@@ -18,7 +18,7 @@
#include <string>
-#include "rdata.h"
+#include <dns/rdata.h>
// BEGIN_ISC_NAMESPACE
Modified: experiments/python-binding/src/lib/dns/rrclass.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrclass.cc (original)
+++ experiments/python-binding/src/lib/dns/rrclass.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,16 @@
// $Id$
+#include <stdint.h>
+
#include <string>
-#include <stdint.h>
+#include <exceptions/exceptions.h>
-#include "buffer.h"
-#include <exceptions/exceptions.h>
-#include "messagerenderer.h"
-#include "rrparamregistry.h"
-#include "rrclass.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rrparamregistry.h>
+#include <dns/rrclass.h>
using namespace std;
using namespace isc::dns;
Modified: experiments/python-binding/src/lib/dns/rrparamregistry-placeholder.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrparamregistry-placeholder.cc (original)
+++ experiments/python-binding/src/lib/dns/rrparamregistry-placeholder.cc Wed May 12 14:23:18 2010
@@ -28,11 +28,12 @@
#include <boost/shared_ptr.hpp>
#include <exceptions/exceptions.h>
-#include "rrparamregistry.h"
-#include "rrclass.h"
-#include "rrtype.h"
-#include "rdata.h"
-#include "rdataclass.h"
+
+#include <dns/rrparamregistry.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
+#include <dns/rdata.h>
+#include <dns/rdataclass.h>
using namespace std;
using namespace boost;
Modified: experiments/python-binding/src/lib/dns/rrparamregistry.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rrparamregistry.h (original)
+++ experiments/python-binding/src/lib/dns/rrparamregistry.h Wed May 12 14:23:18 2010
@@ -24,7 +24,8 @@
#include <boost/shared_ptr.hpp>
#include <exceptions/exceptions.h>
-#include "rdata.h"
+
+#include <dns/rdata.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/rrset.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrset.cc (original)
+++ experiments/python-binding/src/lib/dns/rrset.cc Wed May 12 14:23:18 2010
@@ -20,13 +20,13 @@
#include <boost/shared_ptr.hpp>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "name.h"
-#include "rrclass.h"
-#include "rrtype.h"
-#include "rrttl.h"
-#include "rrset.h"
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/name.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
+#include <dns/rrset.h>
using namespace std;
using namespace isc::dns;
Modified: experiments/python-binding/src/lib/dns/rrset.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rrset.h (original)
+++ experiments/python-binding/src/lib/dns/rrset.h Wed May 12 14:23:18 2010
@@ -24,8 +24,8 @@
#include <exceptions/exceptions.h>
-#include "rdata.h"
-#include "rrtype.h"
+#include <dns/rdata.h>
+#include <dns/rrtype.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/rrsetlist.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrsetlist.cc (original)
+++ experiments/python-binding/src/lib/dns/rrsetlist.cc Wed May 12 14:23:18 2010
@@ -20,10 +20,10 @@
#include <exceptions/exceptions.h>
-#include "rrclass.h"
-#include "rrtype.h"
-#include "rrset.h"
-#include "rrsetlist.h"
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
+#include <dns/rrset.h>
+#include <dns/rrsetlist.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/rrsetlist.h
==============================================================================
--- experiments/python-binding/src/lib/dns/rrsetlist.h (original)
+++ experiments/python-binding/src/lib/dns/rrsetlist.h Wed May 12 14:23:18 2010
@@ -23,9 +23,9 @@
#include <boost/shared_ptr.hpp>
-#include "rrset.h"
-#include "rrclass.h"
-#include "rrtype.h"
+#include <dns/rrset.h>
+#include <dns/rrclass.h>
+#include <dns/rrtype.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/dns/rrttl.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrttl.cc (original)
+++ experiments/python-binding/src/lib/dns/rrttl.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,15 @@
// $Id$
-#include <sstream>
-
#include <stdint.h>
-#include "buffer.h"
-#include "messagerenderer.h"
-#include "rrttl.h"
+#include <sstream>
+#include <ostream>
-#include <iostream>
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rrttl.h>
+
using namespace std;
using namespace isc::dns;
Modified: experiments/python-binding/src/lib/dns/rrtype.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/rrtype.cc (original)
+++ experiments/python-binding/src/lib/dns/rrtype.cc Wed May 12 14:23:18 2010
@@ -14,15 +14,17 @@
// $Id$
-#include <string>
-
#include <stdint.h>
-#include "buffer.h"
+#include <string>
+#include <ostream>
+
#include <exceptions/exceptions.h>
-#include "messagerenderer.h"
-#include "rrparamregistry.h"
-#include "rrtype.h"
+
+#include <dns/buffer.h>
+#include <dns/messagerenderer.h>
+#include <dns/rrparamregistry.h>
+#include <dns/rrtype.h>
using namespace std;
using isc::dns::RRType;
Modified: experiments/python-binding/src/lib/dns/sha1.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/sha1.cc (original)
+++ experiments/python-binding/src/lib/dns/sha1.cc Wed May 12 14:23:18 2010
@@ -50,7 +50,7 @@
* without express or implied warranty of any kind.
*
*/
-#include "sha1.h"
+#include <dns/sha1.h>
/* Local Function Prototyptes */
static void SHA1Finalize(SHA1Context *, uint8_t Pad_Byte);
Modified: experiments/python-binding/src/lib/dns/tests/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/Makefile.am (original)
+++ experiments/python-binding/src/lib/dns/tests/Makefile.am Wed May 12 14:23:18 2010
@@ -1,5 +1,6 @@
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
+AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"
CLEANFILES = *.gcno *.gcda
@@ -46,82 +47,96 @@
# NOTE: keep this in sync with real file listing
# so is included in tarball
-EXTRA_DIST = testdata/rrcode32_fromWire2
-EXTRA_DIST += testdata/rrcode16_fromWire1
-EXTRA_DIST += testdata/question_fromWire
-EXTRA_DIST += testdata/rrcode16_fromWire2
-EXTRA_DIST += testdata/rdata_dnskey_fromWire
-EXTRA_DIST += testdata/rdata_unknown_fromWire
-EXTRA_DIST += testdata/rdata_rrsig_fromWire2.spec
-EXTRA_DIST += testdata/rdata_opt_fromWire
+EXTRA_DIST = testdata/gen-wiredata.py.in
+EXTRA_DIST += testdata/message_fromWire1
+EXTRA_DIST += testdata/message_fromWire10
+EXTRA_DIST += testdata/message_fromWire10.spec
+EXTRA_DIST += testdata/message_fromWire11
EXTRA_DIST += testdata/message_fromWire11.spec
-EXTRA_DIST += testdata/name_toWire1
-EXTRA_DIST += testdata/name_toWire2
-EXTRA_DIST += testdata/name_fromWire10
-EXTRA_DIST += testdata/name_toWire3
-EXTRA_DIST += testdata/name_fromWire11
-EXTRA_DIST += testdata/name_toWire4
-EXTRA_DIST += testdata/name_fromWire3_1
-EXTRA_DIST += testdata/name_fromWire12
-EXTRA_DIST += testdata/rdata_nsec_fromWire1
-EXTRA_DIST += testdata/rdata_in_aaaa_fromWire
-EXTRA_DIST += testdata/message_toWire1
-EXTRA_DIST += testdata/name_fromWire13
-EXTRA_DIST += testdata/name_fromWire3_2
-EXTRA_DIST += testdata/rdata_nsec_fromWire2
-EXTRA_DIST += testdata/message_fromWire10
-EXTRA_DIST += testdata/name_fromWire14
-EXTRA_DIST += testdata/rdata_nsec_fromWire3
-EXTRA_DIST += testdata/message_fromWire11
-EXTRA_DIST += testdata/gen-wiredata.py.in
-EXTRA_DIST += testdata/rdata_soa_fromWire
-EXTRA_DIST += testdata/rrset_toWire1
-EXTRA_DIST += testdata/rdata_mx_fromWire
-EXTRA_DIST += testdata/rdata_dname_fromWire
-EXTRA_DIST += testdata/rrset_toWire2
-EXTRA_DIST += testdata/name_fromWire1
-EXTRA_DIST += testdata/name_fromWire2
-EXTRA_DIST += testdata/name_fromWire4
-EXTRA_DIST += testdata/message_fromWire1
-EXTRA_DIST += testdata/name_fromWire6
EXTRA_DIST += testdata/message_fromWire2
-EXTRA_DIST += testdata/name_fromWire7
EXTRA_DIST += testdata/message_fromWire3
-EXTRA_DIST += testdata/question_toWire1
-EXTRA_DIST += testdata/name_fromWire8
EXTRA_DIST += testdata/message_fromWire4
-EXTRA_DIST += testdata/question_toWire2
-EXTRA_DIST += testdata/name_fromWire9
EXTRA_DIST += testdata/message_fromWire5
EXTRA_DIST += testdata/message_fromWire6
EXTRA_DIST += testdata/message_fromWire7
EXTRA_DIST += testdata/message_fromWire8
EXTRA_DIST += testdata/message_fromWire9
-EXTRA_DIST += testdata/message_fromWire10.spec
+EXTRA_DIST += testdata/message_toWire1
+EXTRA_DIST += testdata/name_fromWire1
+EXTRA_DIST += testdata/name_fromWire10
+EXTRA_DIST += testdata/name_fromWire11
+EXTRA_DIST += testdata/name_fromWire12
+EXTRA_DIST += testdata/name_fromWire13
+EXTRA_DIST += testdata/name_fromWire14
+EXTRA_DIST += testdata/name_fromWire2
+EXTRA_DIST += testdata/name_fromWire3_1
+EXTRA_DIST += testdata/name_fromWire3_2
+EXTRA_DIST += testdata/name_fromWire4
+EXTRA_DIST += testdata/name_fromWire6
+EXTRA_DIST += testdata/name_fromWire7
+EXTRA_DIST += testdata/name_fromWire8
+EXTRA_DIST += testdata/name_fromWire9
+EXTRA_DIST += testdata/name_toWire1
+EXTRA_DIST += testdata/name_toWire2
+EXTRA_DIST += testdata/name_toWire3
+EXTRA_DIST += testdata/name_toWire4
+EXTRA_DIST += testdata/name_toWire5
+EXTRA_DIST += testdata/name_toWire5.spec
+EXTRA_DIST += testdata/name_toWire6
+EXTRA_DIST += testdata/name_toWire6.spec
+EXTRA_DIST += testdata/question_fromWire
+EXTRA_DIST += testdata/question_toWire1
+EXTRA_DIST += testdata/question_toWire2
+EXTRA_DIST += testdata/rdata_cname_fromWire
+EXTRA_DIST += testdata/rdata_dname_fromWire
+EXTRA_DIST += testdata/rdata_dnskey_fromWire
EXTRA_DIST += testdata/rdata_ds_fromWire
EXTRA_DIST += testdata/rdata_in_a_fromWire
+EXTRA_DIST += testdata/rdata_in_aaaa_fromWire
+EXTRA_DIST += testdata/rdata_mx_fromWire
+EXTRA_DIST += testdata/rdata_mx_toWire1
+EXTRA_DIST += testdata/rdata_ns_fromWire
+EXTRA_DIST += testdata/rdata_nsec3_fromWire1
+EXTRA_DIST += testdata/rdata_nsec3_fromWire2
+EXTRA_DIST += testdata/rdata_nsec3_fromWire3
+EXTRA_DIST += testdata/rdata_nsec3param_fromWire1
+EXTRA_DIST += testdata/rdata_nsec_fromWire1
+EXTRA_DIST += testdata/rdata_nsec_fromWire10
+EXTRA_DIST += testdata/rdata_nsec_fromWire10.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire2
+EXTRA_DIST += testdata/rdata_nsec_fromWire3
+EXTRA_DIST += testdata/rdata_nsec_fromWire4
+EXTRA_DIST += testdata/rdata_nsec_fromWire4.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire5
+EXTRA_DIST += testdata/rdata_nsec_fromWire5.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire6
+EXTRA_DIST += testdata/rdata_nsec_fromWire6.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire7
+EXTRA_DIST += testdata/rdata_nsec_fromWire7.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire8
+EXTRA_DIST += testdata/rdata_nsec_fromWire8.spec
+EXTRA_DIST += testdata/rdata_nsec_fromWire9
+EXTRA_DIST += testdata/rdata_nsec_fromWire9.spec
+EXTRA_DIST += testdata/rdata_opt_fromWire
EXTRA_DIST += testdata/rdata_rrsig_fromWire1
EXTRA_DIST += testdata/rdata_rrsig_fromWire2
-EXTRA_DIST += testdata/rdata_ns_fromWire
-EXTRA_DIST += testdata/rdata_cname_fromWire
-EXTRA_DIST += testdata/rdata_mx_toWire1
-EXTRA_DIST += testdata/rrcode32_fromWire1
-EXTRA_DIST += testdata/rdata_nsec3_fromWire1
-EXTRA_DIST += testdata/rdata_nsec3_fromWire2
-EXTRA_DIST += testdata/rdata_nsec3param_fromWire1
-EXTRA_DIST += testdata/rdata_nsec3_fromWire3
+EXTRA_DIST += testdata/rdata_rrsig_fromWire2.spec
+EXTRA_DIST += testdata/rdata_soa_fromWire
+EXTRA_DIST += testdata/rdata_soa_toWireUncompressed
EXTRA_DIST += testdata/rdata_soa_toWireUncompressed.spec
-EXTRA_DIST += testdata/rdata_soa_toWireUncompressed
-EXTRA_DIST += testdata/rdata_nsec_fromWire4.spec
-EXTRA_DIST += testdata/rdata_nsec_fromWire4
-EXTRA_DIST += testdata/rdata_txt_fromWire4.spec
-EXTRA_DIST += testdata/rdata_nsec_fromWire7.spec
-EXTRA_DIST += testdata/rdata_txt_fromWire5.spec
-EXTRA_DIST += testdata/rdata_nsec_fromWire8.spec
-EXTRA_DIST += testdata/rdata_txt_fromWire2.spec
EXTRA_DIST += testdata/rdata_txt_fromWire1
EXTRA_DIST += testdata/rdata_txt_fromWire2
+EXTRA_DIST += testdata/rdata_txt_fromWire2.spec
EXTRA_DIST += testdata/rdata_txt_fromWire3
+EXTRA_DIST += testdata/rdata_txt_fromWire3.spec
EXTRA_DIST += testdata/rdata_txt_fromWire4
+EXTRA_DIST += testdata/rdata_txt_fromWire4.spec
EXTRA_DIST += testdata/rdata_txt_fromWire5
-EXTRA_DIST += testdata/rdata_txt_fromWire3.spec
+EXTRA_DIST += testdata/rdata_txt_fromWire5.spec
+EXTRA_DIST += testdata/rdata_unknown_fromWire
+EXTRA_DIST += testdata/rrcode16_fromWire1
+EXTRA_DIST += testdata/rrcode16_fromWire2
+EXTRA_DIST += testdata/rrcode32_fromWire1
+EXTRA_DIST += testdata/rrcode32_fromWire2
+EXTRA_DIST += testdata/rrset_toWire1
+EXTRA_DIST += testdata/rrset_toWire2
Modified: experiments/python-binding/src/lib/dns/tests/message_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/message_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/message_unittest.cc Wed May 12 14:23:18 2010
@@ -95,7 +95,7 @@
TEST_F(MessageTest, fromWire) {
- factoryFromFile(message_parse, "testdata/message_fromWire1");
+ factoryFromFile(message_parse, "message_fromWire1");
EXPECT_EQ(0x1035, message_parse.getQid());
EXPECT_EQ(Opcode::QUERY(), message_parse.getOpcode());
EXPECT_EQ(Rcode::NOERROR(), message_parse.getRcode());
@@ -129,17 +129,17 @@
TEST_F(MessageTest, GetEDNS0DOBit) {
// Without EDNS0, DNSSEC is considered to be unsupported.
- factoryFromFile(message_parse, "testdata/message_fromWire1");
+ factoryFromFile(message_parse, "message_fromWire1");
EXPECT_FALSE(message_parse.isDNSSECSupported());
// If DO bit is on, DNSSEC is considered to be supported.
message_parse.clear(Message::PARSE);
- factoryFromFile(message_parse, "testdata/message_fromWire2");
+ factoryFromFile(message_parse, "message_fromWire2");
EXPECT_TRUE(message_parse.isDNSSECSupported());
// If DO bit is off, DNSSEC is considered to be unsupported.
message_parse.clear(Message::PARSE);
- factoryFromFile(message_parse, "testdata/message_fromWire3");
+ factoryFromFile(message_parse, "message_fromWire3");
EXPECT_FALSE(message_parse.isDNSSECSupported());
}
@@ -165,17 +165,17 @@
TEST_F(MessageTest, GetEDNS0UDPSize) {
// Without EDNS0, the default max UDP size is used.
- factoryFromFile(message_parse, "testdata/message_fromWire1");
+ factoryFromFile(message_parse, "message_fromWire1");
EXPECT_EQ(Message::DEFAULT_MAX_UDPSIZE, message_parse.getUDPSize());
// If the size specified in EDNS0 > default max, use it.
message_parse.clear(Message::PARSE);
- factoryFromFile(message_parse, "testdata/message_fromWire2");
+ factoryFromFile(message_parse, "message_fromWire2");
EXPECT_EQ(4096, message_parse.getUDPSize());
// If the size specified in EDNS0 < default max, keep using the default.
message_parse.clear(Message::PARSE);
- factoryFromFile(message_parse, "testdata/message_fromWire8");
+ factoryFromFile(message_parse, "message_fromWire8");
EXPECT_EQ(Message::DEFAULT_MAX_UDPSIZE, message_parse.getUDPSize());
}
@@ -204,36 +204,35 @@
TEST_F(MessageTest, EDNS0ExtCode) {
// Extended Rcode = BADVERS
- factoryFromFile(message_parse, "testdata/message_fromWire10");
+ factoryFromFile(message_parse, "message_fromWire10");
EXPECT_EQ(Rcode::BADVERS(), message_parse.getRcode());
// Maximum extended Rcode
message_parse.clear(Message::PARSE);
- factoryFromFile(message_parse, "testdata/message_fromWire11");
+ factoryFromFile(message_parse, "message_fromWire11");
EXPECT_EQ(0xfff, message_parse.getRcode().getCode());
}
TEST_F(MessageTest, BadEDNS0) {
// OPT RR in the answer section
- EXPECT_THROW(factoryFromFile(message_parse, "testdata/message_fromWire4"),
+ EXPECT_THROW(factoryFromFile(message_parse, "message_fromWire4"),
DNSMessageFORMERR);
// multiple OPT RRs (in the additional section)
message_parse.clear(Message::PARSE);
- EXPECT_THROW(factoryFromFile(message_parse, "testdata/message_fromWire5"),
+ EXPECT_THROW(factoryFromFile(message_parse, "message_fromWire5"),
DNSMessageFORMERR);
// OPT RR of a non root name
message_parse.clear(Message::PARSE);
- EXPECT_THROW(factoryFromFile(message_parse, "testdata/message_fromWire6"),
+ EXPECT_THROW(factoryFromFile(message_parse, "message_fromWire6"),
DNSMessageFORMERR);
// Compressed owner name of OPT RR points to a root name.
// Not necessarily bogus, but very unusual and mostly pathological.
// We accept it, but is it okay?
message_parse.clear(Message::PARSE);
- EXPECT_NO_THROW(factoryFromFile(message_parse,
- "testdata/message_fromWire7"));
+ EXPECT_NO_THROW(factoryFromFile(message_parse, "message_fromWire7"));
// Unsupported Version
message_parse.clear(Message::PARSE);
- EXPECT_THROW(factoryFromFile(message_parse, "testdata/message_fromWire9"),
+ EXPECT_THROW(factoryFromFile(message_parse, "message_fromWire9"),
DNSMessageBADVERS);
}
@@ -259,7 +258,7 @@
message_render.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/message_toWire1", data);
+ UnitTestUtil::readWireData("message_toWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, obuffer.getData(),
obuffer.getLength(), &data[0], data.size());
}
Modified: experiments/python-binding/src/lib/dns/tests/messagerenderer_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/messagerenderer_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/messagerenderer_unittest.cc Wed May 12 14:23:18 2010
@@ -49,8 +49,7 @@
const uint8_t MessageRendererTest::testdata[5] = {1, 2, 3, 4, 5};
// The test cases are borrowed from those for the OutputBuffer class.
-TEST_F(MessageRendererTest, writeIntger)
-{
+TEST_F(MessageRendererTest, writeIntger) {
renderer.writeUint16(data16);
expected_size += sizeof(data16);
@@ -58,9 +57,8 @@
renderer.getLength(), &testdata[1], sizeof(data16));
}
-TEST_F(MessageRendererTest, writeName)
-{
- UnitTestUtil::readWireData("testdata/name_toWire1", data);
+TEST_F(MessageRendererTest, writeName) {
+ UnitTestUtil::readWireData("name_toWire1", data);
renderer.writeName(Name("a.example.com."));
renderer.writeName(Name("b.example.com."));
renderer.writeName(Name("a.example.org."));
@@ -68,12 +66,11 @@
buffer.getLength(), &data[0], data.size());
}
-TEST_F(MessageRendererTest, writeNameInLargeBuffer)
-{
+TEST_F(MessageRendererTest, writeNameInLargeBuffer) {
size_t offset = 0x3fff;
buffer.skip(offset);
- UnitTestUtil::readWireData("testdata/name_toWire2", data);
+ UnitTestUtil::readWireData("name_toWire2", data);
renderer.writeName(Name("a.example.com."));
renderer.writeName(Name("a.example.com."));
renderer.writeName(Name("b.example.com."));
@@ -83,9 +80,8 @@
&data[0], data.size());
}
-TEST_F(MessageRendererTest, writeNameWithUncompressed)
-{
- UnitTestUtil::readWireData("testdata/name_toWire3", data);
+TEST_F(MessageRendererTest, writeNameWithUncompressed) {
+ UnitTestUtil::readWireData("name_toWire3", data);
renderer.writeName(Name("a.example.com."));
renderer.writeName(Name("b.example.com."), false);
renderer.writeName(Name("b.example.com."));
@@ -93,9 +89,8 @@
buffer.getLength(), &data[0], data.size());
}
-TEST_F(MessageRendererTest, writeNamePointerChain)
-{
- UnitTestUtil::readWireData("testdata/name_toWire4", data);
+TEST_F(MessageRendererTest, writeNamePointerChain) {
+ UnitTestUtil::readWireData("name_toWire4", data);
renderer.writeName(Name("a.example.com."));
renderer.writeName(Name("b.example.com."));
renderer.writeName(Name("b.example.com."));
@@ -103,9 +98,26 @@
buffer.getLength(), &data[0], data.size());
}
-TEST_F(MessageRendererTest, writeNameCaseCompress)
-{
- UnitTestUtil::readWireData("testdata/name_toWire1", data);
+TEST_F(MessageRendererTest, compressMode) {
+ // By default the render performs case insensitive compression.
+ EXPECT_EQ(MessageRenderer::CASE_INSENSITIVE, renderer.getCompressMode());
+
+ // The mode can be explicitly changed.
+ renderer.setCompressMode(MessageRenderer::CASE_SENSITIVE);
+ EXPECT_EQ(MessageRenderer::CASE_SENSITIVE, renderer.getCompressMode());
+ renderer.setCompressMode(MessageRenderer::CASE_INSENSITIVE);
+ EXPECT_EQ(MessageRenderer::CASE_INSENSITIVE, renderer.getCompressMode());
+
+ // The clear() method resets the mode to the default.
+ renderer.setCompressMode(MessageRenderer::CASE_SENSITIVE);
+ renderer.clear();
+ EXPECT_EQ(MessageRenderer::CASE_INSENSITIVE, renderer.getCompressMode());
+}
+
+TEST_F(MessageRendererTest, writeNameCaseCompress) {
+ // By default MessageRenderer performs case insensitive compression.
+
+ UnitTestUtil::readWireData("name_toWire1", data);
renderer.writeName(Name("a.example.com."));
// this should match the first name in terms of compression:
renderer.writeName(Name("b.exAmple.CoM."));
@@ -114,8 +126,34 @@
buffer.getLength(), &data[0], data.size());
}
-TEST_F(MessageRendererTest, writeRootName)
-{
+TEST_F(MessageRendererTest, writeNameCaseSensitiveCompress) {
+ // name compression in case sensitive manner. See the data file
+ // description for details.
+ renderer.setCompressMode(MessageRenderer::CASE_SENSITIVE);
+ UnitTestUtil::readWireData("name_toWire5", data);
+ renderer.writeName(Name("a.example.com."));
+ renderer.writeName(Name("b.eXample.com."));
+ renderer.writeName(Name("c.eXample.com."));
+ EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, buffer.getData(),
+ buffer.getLength(), &data[0], data.size());
+}
+
+TEST_F(MessageRendererTest, writeNameMixedCaseCompress) {
+ renderer.setCompressMode(MessageRenderer::CASE_SENSITIVE);
+ UnitTestUtil::readWireData("name_toWire6", data);
+ renderer.writeName(Name("a.example.com."));
+ renderer.writeName(Name("b.eXample.com."));
+
+ // Change the compression mode in the middle of rendering. This is an
+ // unusual operation and is unlikely to happen in practice, but is still
+ // allowed in this API.
+ renderer.setCompressMode(MessageRenderer::CASE_INSENSITIVE);
+ renderer.writeName(Name("c.b.EXAMPLE.com."));
+ EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, buffer.getData(),
+ buffer.getLength(), &data[0], data.size());
+}
+
+TEST_F(MessageRendererTest, writeRootName) {
// root name is special: it never causes compression or can (reasonably)
// be a compression pointer. So it makes sense to check this case
// explicitly.
Modified: experiments/python-binding/src/lib/dns/tests/name_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/name_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/name_unittest.cc Wed May 12 14:23:18 2010
@@ -18,6 +18,7 @@
#include <string>
#include <sstream>
#include <iomanip>
+#include <limits>
#include <stdexcept>
#include <dns/buffer.h>
@@ -222,33 +223,29 @@
//
// normal case with a compression pointer
EXPECT_PRED_FORMAT2(UnitTestUtil::matchName,
- nameFactoryFromWire("testdata/name_fromWire1", 25),
+ nameFactoryFromWire("name_fromWire1", 25),
Name("vix.com"));
// bogus label character (looks like a local compression pointer)
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire2", 25),
- DNSMessageFORMERR);
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire2", 25), DNSMessageFORMERR);
// a bad compression pointer (too big)
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire3_1", 25),
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire3_1", 25),
DNSMessageFORMERR);
// forward reference
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire3_2", 25),
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire3_2", 25),
DNSMessageFORMERR);
// invalid name length
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire4", 550),
- DNSMessageFORMERR);
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire4", 550), DNSMessageFORMERR);
// skip test for from Wire5. It's for disabling decompression, but our
// implementation always allows it.
// bad pointer (too big)
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire6", 25),
- DNSMessageFORMERR);
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire6", 25), DNSMessageFORMERR);
// input ends unexpectedly
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire7", 25),
- DNSMessageFORMERR);
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire7", 25), DNSMessageFORMERR);
// many hops of compression but valid. should succeed.
EXPECT_PRED_FORMAT2(UnitTestUtil::matchName,
- nameFactoryFromWire("testdata/name_fromWire8", 383),
+ nameFactoryFromWire("name_fromWire8", 383),
Name("vix.com"));
//
@@ -257,25 +254,21 @@
// large names, a long but valid one, and invalid (too long) one.
EXPECT_EQ(Name::MAX_WIRE,
- nameFactoryFromWire("testdata/name_fromWire9", 0).getLength());
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire10", 0).getLength(),
+ nameFactoryFromWire("name_fromWire9", 0).getLength());
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire10", 0).getLength(),
DNSMessageFORMERR);
// A name with possible maximum number of labels; awkward but valid
- EXPECT_EQ(nameFactoryFromWire("testdata/name_fromWire11",
- 0).getLabelCount(),
+ EXPECT_EQ(nameFactoryFromWire("name_fromWire11", 0).getLabelCount(),
Name::MAX_LABELS);
// Wire format including an invalid label length
- EXPECT_THROW(nameFactoryFromWire("testdata/name_fromWire12", 0),
- DNSMessageFORMERR);
+ EXPECT_THROW(nameFactoryFromWire("name_fromWire12", 0), DNSMessageFORMERR);
// converting upper-case letters to down-case
- EXPECT_EQ("vix.com.", nameFactoryFromWire("testdata/name_fromWire1",
- 25, true).toText());
- EXPECT_EQ(3,
- nameFactoryFromWire("testdata/name_fromWire1",
- 25).getLabelCount());
+ EXPECT_EQ("vix.com.",
+ nameFactoryFromWire("name_fromWire1", 25, true).toText());
+ EXPECT_EQ(3, nameFactoryFromWire("name_fromWire1", 25).getLabelCount());
}
TEST_F(NameTest, copyConstruct)
@@ -331,7 +324,7 @@
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"[\\\\]^_.`abcdefghijklmnopqrstuvwxyz{|}~.");
EXPECT_EQ(all_printable,
- nameFactoryFromWire("testdata/name_fromWire13", 0).toText());
+ nameFactoryFromWire("name_fromWire13", 0).toText());
string all_nonprintable(
"\\000\\001\\002\\003\\004\\005\\006\\007\\008\\009"
@@ -353,7 +346,7 @@
"\\240\\241\\242\\243\\244\\245\\246\\247\\248\\249"
"\\250\\251\\252\\253\\254\\255.");
EXPECT_EQ(all_nonprintable,
- nameFactoryFromWire("testdata/name_fromWire14", 0).toText());
+ nameFactoryFromWire("name_fromWire14", 0).toText());
}
TEST_F(NameTest, toWireBuffer)
@@ -407,8 +400,7 @@
unsigned int labels;
};
-TEST_F(NameTest, compare)
-{
+TEST_F(NameTest, compare) {
vector<CompareParameters> params;
params.push_back(CompareParameters(Name("c.d"), Name("a.b.c.d"),
NameComparisonResult::SUPERDOMAIN,
@@ -435,8 +427,7 @@
}
}
-TEST_F(NameTest, equal)
-{
+TEST_F(NameTest, equal) {
EXPECT_TRUE(example_name == Name("WWW.EXAMPLE.COM."));
EXPECT_TRUE(example_name.equals(Name("WWW.EXAMPLE.COM.")));
EXPECT_TRUE(example_name != Name("www.example.org."));
@@ -451,15 +442,13 @@
EXPECT_TRUE(example_name.nequals(Name("www\\.example.com.")));
}
-TEST_F(NameTest, isWildcard)
-{
+TEST_F(NameTest, isWildcard) {
EXPECT_EQ(false, example_name.isWildcard());
EXPECT_EQ(true, Name("*.a.example.com").isWildcard());
EXPECT_EQ(false, Name("a.*.example.com").isWildcard());
}
-TEST_F(NameTest, concatenate)
-{
+TEST_F(NameTest, concatenate) {
NameComparisonResult result =
Name("aaa.www.example.com.").compare(Name("aaa").concatenate(example_name));
EXPECT_EQ(NameComparisonResult::EQUAL, result.getRelation());
@@ -480,8 +469,7 @@
EXPECT_THROW(n1.concatenate(n2), TooLongName);
}
-TEST_F(NameTest, reverse)
-{
+TEST_F(NameTest, reverse) {
EXPECT_PRED_FORMAT2(UnitTestUtil::matchName, example_name.reverse(),
Name("com.example.www."));
EXPECT_PRED_FORMAT2(UnitTestUtil::matchName, Name(".").reverse(),
@@ -491,8 +479,7 @@
Name("s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a"));
}
-TEST_F(NameTest, split)
-{
+TEST_F(NameTest, split) {
// normal cases with or without explicitly specifying the trailing dot.
EXPECT_PRED_FORMAT2(UnitTestUtil::matchName, example_name.split(1, 2),
Name("example.com."));
@@ -506,10 +493,14 @@
// invalid range: an exception should be thrown.
EXPECT_THROW(example_name.split(1, 0), OutOfRange);
EXPECT_THROW(example_name.split(2, 3), OutOfRange);
-}
-
-TEST_F(NameTest, downcase)
-{
+
+ // invalid range: the following parameters would cause overflow,
+ // bypassing naive validation.
+ EXPECT_THROW(example_name.split(1, numeric_limits<unsigned int>::max()),
+ OutOfRange);
+}
+
+TEST_F(NameTest, downcase) {
// usual case: all-upper case name to all-lower case
compareInWireFormat(example_name_upper.downcase(), example_name);
// confirm that non upper-case characters are intact
@@ -521,8 +512,7 @@
}
-TEST_F(NameTest, at)
-{
+TEST_F(NameTest, at) {
// Confirm at() produces the exact sequence of wire-format name data
vector<uint8_t> data;
@@ -544,8 +534,7 @@
// The test logic is simple, and all tests are just straightforward variations
// of the first one.
//
-TEST_F(NameTest, leq)
-{
+TEST_F(NameTest, leq) {
// small <= large is true
EXPECT_TRUE(small_name.leq(large_name));
EXPECT_TRUE(small_name <= large_name);
@@ -559,8 +548,7 @@
EXPECT_FALSE(large_name <= small_name);
}
-TEST_F(NameTest, geq)
-{
+TEST_F(NameTest, geq) {
EXPECT_TRUE(large_name.geq(small_name));
EXPECT_TRUE(large_name >= small_name);
@@ -571,8 +559,7 @@
EXPECT_FALSE(small_name >= large_name);
}
-TEST_F(NameTest, lthan)
-{
+TEST_F(NameTest, lthan) {
EXPECT_TRUE(small_name.lthan(large_name));
EXPECT_TRUE(small_name < large_name);
@@ -583,8 +570,7 @@
EXPECT_FALSE(large_name < small_name);
}
-TEST_F(NameTest, gthan)
-{
+TEST_F(NameTest, gthan) {
EXPECT_TRUE(large_name.gthan(small_name));
EXPECT_TRUE(large_name > small_name);
@@ -595,14 +581,12 @@
EXPECT_FALSE(small_name > large_name);
}
-TEST_F(NameTest, constants)
-{
+TEST_F(NameTest, constants) {
EXPECT_EQ(Name("."), Name::ROOT_NAME());
}
// test operator<<. We simply confirm it appends the result of toText().
-TEST_F(NameTest, LeftShiftOperator)
-{
+TEST_F(NameTest, LeftShiftOperator) {
ostringstream oss;
oss << example_name;
EXPECT_EQ(example_name.toText(), oss.str());
Modified: experiments/python-binding/src/lib/dns/tests/question_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/question_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/question_unittest.cc Wed May 12 14:23:18 2010
@@ -69,7 +69,7 @@
TEST_F(QuestionTest, fromWire)
{
- Question q = questionFromWire("testdata/question_fromWire");
+ Question q = questionFromWire("question_fromWire");
EXPECT_EQ(example_name1, q.getName());
EXPECT_EQ(RRClass::IN(), q.getClass());
@@ -77,17 +77,15 @@
// owner name of the second Question is compressed. It's uncommon
// (to have multiple questions), but isn't prohibited by the protocol.
- q = questionFromWire("testdata/question_fromWire", 21);
+ q = questionFromWire("question_fromWire", 21);
EXPECT_EQ(example_name2, q.getName());
EXPECT_EQ(RRClass::CH(), q.getClass());
EXPECT_EQ(RRType::A(), q.getType());
// Pathological cases: Corresponding exceptions will be thrown from
// the underlying parser.
- EXPECT_THROW(questionFromWire("testdata/question_fromWire", 31),
- DNSMessageFORMERR);
- EXPECT_THROW(questionFromWire("testdata/question_fromWire", 36),
- IncompleteRRClass);
+ EXPECT_THROW(questionFromWire("question_fromWire", 31), DNSMessageFORMERR);
+ EXPECT_THROW(questionFromWire("question_fromWire", 36), IncompleteRRClass);
}
TEST_F(QuestionTest, toText)
@@ -100,7 +98,7 @@
{
test_question1.toWire(obuffer);
test_question2.toWire(obuffer);
- UnitTestUtil::readWireData("testdata/question_toWire1", wiredata);
+ UnitTestUtil::readWireData("question_toWire1", wiredata);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, obuffer.getData(),
obuffer.getLength(), &wiredata[0], wiredata.size());
}
@@ -109,7 +107,7 @@
{
test_question1.toWire(renderer);
test_question2.toWire(renderer);
- UnitTestUtil::readWireData("testdata/question_toWire2", wiredata);
+ UnitTestUtil::readWireData("question_toWire2", wiredata);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, obuffer.getData(),
obuffer.getLength(), &wiredata[0], wiredata.size());
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_cname_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_cname_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_cname_unittest.cc Wed May 12 14:23:18 2010
@@ -68,25 +68,25 @@
{
EXPECT_EQ(0, rdata_cname.compare(
*rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire")));
+ "rdata_cname_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire", 18),
+ "rdata_cname_fromWire", 18),
InvalidRdataLength);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire", 36),
+ "rdata_cname_fromWire", 36),
InvalidRdataLength);
// incomplete name. the error should be detected in the name constructor
EXPECT_THROW(rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire", 71),
+ "rdata_cname_fromWire", 71),
DNSMessageFORMERR);
EXPECT_EQ(0, generic::CNAME("cn2.example.com").compare(
*rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire", 55)));
+ "rdata_cname_fromWire", 55)));
EXPECT_THROW(*rdataFactoryFromFile(RRType("CNAME"), RRClass("IN"),
- "testdata/rdata_cname_fromWire", 63),
+ "rdata_cname_fromWire", 63),
InvalidRdataLength);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_dname_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_dname_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_dname_unittest.cc Wed May 12 14:23:18 2010
@@ -68,25 +68,25 @@
{
EXPECT_EQ(0, rdata_dname.compare(
*rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire")));
+ "rdata_dname_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire", 18),
+ "rdata_dname_fromWire", 18),
InvalidRdataLength);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire", 36),
+ "rdata_dname_fromWire", 36),
InvalidRdataLength);
// incomplete name. the error should be detected in the name constructor
EXPECT_THROW(rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire", 71),
+ "rdata_dname_fromWire", 71),
DNSMessageFORMERR);
EXPECT_EQ(0, generic::DNAME("dn2.example.com").compare(
*rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire", 55)));
+ "rdata_dname_fromWire", 55)));
EXPECT_THROW(*rdataFactoryFromFile(RRType("DNAME"), RRClass("IN"),
- "testdata/rdata_dname_fromWire", 63),
+ "rdata_dname_fromWire", 63),
InvalidRdataLength);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_dnskey_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_dnskey_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_dnskey_unittest.cc Wed May 12 14:23:18 2010
@@ -91,7 +91,7 @@
rdata_dnskey.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_dnskey_fromWire", data);
+ UnitTestUtil::readWireData("rdata_dnskey_fromWire", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
@@ -108,7 +108,7 @@
generic::DNSKEY rdata_dnskey(dnskey_txt);
EXPECT_EQ(0, rdata_dnskey.compare(
*rdataFactoryFromFile(RRType("DNSKEY"), RRClass("IN"),
- "testdata/rdata_dnskey_fromWire")));
+ "rdata_dnskey_fromWire")));
}
TEST_F(Rdata_DNSKEY_Test, getTag)
Modified: experiments/python-binding/src/lib/dns/tests/rdata_ds_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_ds_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_ds_unittest.cc Wed May 12 14:23:18 2010
@@ -52,19 +52,21 @@
EXPECT_THROW(const generic::DS ds2("11111 5 22222 BEEF"), InvalidRdataText);
EXPECT_THROW(const generic::DS ds2("11111 5 2"), InvalidRdataText);
EXPECT_THROW(const generic::DS ds2("GARBAGE IN"), InvalidRdataText);
+}
-#if 0 // this test currently fails
+// this test currently fails; we must fix it, and then migrate the test to
+// badText_DS
+TEST_F(Rdata_DS_Test, DISABLED_badText_DS) {
// no space between the digest type and the digest.
EXPECT_THROW(const generic::DS ds2(
"12892 5 2F1E184C0E1D615D20EB3C223ACED3B03C773DD952D"
"5F0EB5C777586DE18DA6B5"), InvalidRdataText);
-#endif
}
TEST_F(Rdata_DS_Test, createFromWire_DS) {
EXPECT_EQ(0, rdata_ds.compare(
*rdataFactoryFromFile(RRType::DS(), RRClass::IN(),
- "testdata/rdata_ds_fromWire")));
+ "rdata_ds_fromWire")));
}
TEST_F(Rdata_DS_Test, getTag_DS) {
@@ -77,7 +79,7 @@
rdata_ds.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_ds_fromWire", data);
+ UnitTestUtil::readWireData("rdata_ds_fromWire", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_in_a_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_in_a_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_in_a_unittest.cc Wed May 12 14:23:18 2010
@@ -54,18 +54,18 @@
// Valid data
EXPECT_EQ(0, rdata_in_a.compare(
*rdataFactoryFromFile(RRType::A(), RRClass::IN(),
- "testdata/rdata_in_a_fromWire")));
+ "rdata_in_a_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType::A(), RRClass::IN(),
- "testdata/rdata_in_a_fromWire", 6),
+ "rdata_in_a_fromWire", 6),
DNSMessageFORMERR);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType::A(), RRClass::IN(),
- "testdata/rdata_in_a_fromWire", 12),
+ "rdata_in_a_fromWire", 12),
DNSMessageFORMERR);
// buffer too short.
EXPECT_THROW(rdataFactoryFromFile(RRType::A(), RRClass::IN(),
- "testdata/rdata_in_a_fromWire", 19),
+ "rdata_in_a_fromWire", 19),
DNSMessageFORMERR);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_in_aaaa_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_in_aaaa_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_in_aaaa_unittest.cc Wed May 12 14:23:18 2010
@@ -52,18 +52,18 @@
// Valid data
EXPECT_EQ(0, rdata_in_aaaa.compare(
*rdataFactoryFromFile(RRType::AAAA(), RRClass::IN(),
- "testdata/rdata_in_aaaa_fromWire")));
+ "rdata_in_aaaa_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType::AAAA(), RRClass::IN(),
- "testdata/rdata_in_aaaa_fromWire", 18),
+ "rdata_in_aaaa_fromWire", 18),
DNSMessageFORMERR);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType::AAAA(), RRClass::IN(),
- "testdata/rdata_in_aaaa_fromWire", 36),
+ "rdata_in_aaaa_fromWire", 36),
DNSMessageFORMERR);
// buffer too short.
EXPECT_THROW(rdataFactoryFromFile(RRType::AAAA(), RRClass::IN(),
- "testdata/rdata_in_aaaa_fromWire", 55),
+ "rdata_in_aaaa_fromWire", 55),
DNSMessageFORMERR);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_mx_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_mx_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_mx_unittest.cc Wed May 12 14:23:18 2010
@@ -63,7 +63,7 @@
{
EXPECT_EQ(0, rdata_mx.compare(
*rdataFactoryFromFile(RRType("MX"), RRClass("IN"),
- "testdata/rdata_mx_fromWire")));
+ "rdata_mx_fromWire")));
// TBD: more tests
}
@@ -73,7 +73,7 @@
rdata_mx.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_mx_toWire1", data);
+ UnitTestUtil::readWireData("rdata_mx_toWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, obuffer.getData(),
obuffer.getLength(), &data[0], data.size());
}
@@ -86,7 +86,7 @@
#if 0
// XXX: does not pass
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_mx_toWire1", data);
+ UnitTestUtil::readWireData("rdata_mx_toWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, obuffer.getData(),
obuffer.getLength(), &data[0], data.size());
#endif
Modified: experiments/python-binding/src/lib/dns/tests/rdata_ns_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_ns_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_ns_unittest.cc Wed May 12 14:23:18 2010
@@ -67,25 +67,25 @@
{
EXPECT_EQ(0, rdata_ns.compare(
*rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire")));
+ "rdata_ns_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 18),
+ "rdata_ns_fromWire", 18),
InvalidRdataLength);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 36),
+ "rdata_ns_fromWire", 36),
InvalidRdataLength);
// incomplete name. the error should be detected in the name constructor
EXPECT_THROW(rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 71),
+ "rdata_ns_fromWire", 71),
DNSMessageFORMERR);
EXPECT_EQ(0, generic::NS("ns2.example.com").compare(
*rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 55)));
+ "rdata_ns_fromWire", 55)));
EXPECT_THROW(*rdataFactoryFromFile(RRType("NS"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 63),
+ "rdata_ns_fromWire", 63),
InvalidRdataLength);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_nsec3_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_nsec3_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_nsec3_unittest.cc Wed May 12 14:23:18 2010
@@ -85,16 +85,16 @@
const generic::NSEC3 rdata_nsec3(nsec3_txt);
EXPECT_EQ(0, rdata_nsec3.compare(
*rdataFactoryFromFile(RRType::NSEC3(), RRClass::IN(),
- "testdata/rdata_nsec3_fromWire1")));
+ "rdata_nsec3_fromWire1")));
// Too short RDLENGTH
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC3(), RRClass::IN(),
- "testdata/rdata_nsec3_fromWire2"),
+ "rdata_nsec3_fromWire2"),
InvalidRdataLength);
// Invalid type bits
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC3(), RRClass::IN(),
- "testdata/rdata_nsec3_fromWire3"),
+ "rdata_nsec3_fromWire3"),
DNSMessageFORMERR);
}
@@ -105,7 +105,7 @@
rdata_nsec3.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_nsec3_fromWire1", data);
+ UnitTestUtil::readWireData("rdata_nsec3_fromWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_nsec3param_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_nsec3param_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_nsec3param_unittest.cc Wed May 12 14:23:18 2010
@@ -65,7 +65,7 @@
const generic::NSEC3PARAM rdata_nsec3param(nsec3param_txt);
EXPECT_EQ(0, rdata_nsec3param.compare(
*rdataFactoryFromFile(RRType::NSEC3PARAM(), RRClass::IN(),
- "testdata/rdata_nsec3param_fromWire1")));
+ "rdata_nsec3param_fromWire1")));
}
TEST_F(Rdata_NSEC3PARAM_Test, toWireRenderer)
@@ -75,7 +75,7 @@
rdata_nsec3param.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_nsec3param_fromWire1", data);
+ UnitTestUtil::readWireData("rdata_nsec3param_fromWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_nsec_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_nsec_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_nsec_unittest.cc Wed May 12 14:23:18 2010
@@ -57,52 +57,52 @@
const generic::NSEC rdata_nsec(nsec_txt);
EXPECT_EQ(0, rdata_nsec.compare(
*rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire1")));
+ "rdata_nsec_fromWire1")));
// Too short RDLENGTH
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire2"),
+ "rdata_nsec_fromWire2"),
DNSMessageFORMERR);
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire3"),
+ "rdata_nsec_fromWire3"),
DNSMessageFORMERR);
// A malformed NSEC bitmap length field that could cause overflow.
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire4"),
+ "rdata_nsec_fromWire4"),
DNSMessageFORMERR);
// The bitmap field is incomplete (only the first byte is included)
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire5"),
+ "rdata_nsec_fromWire5"),
DNSMessageFORMERR);
// Bitmap length is 0, which is invalid.
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire6"),
+ "rdata_nsec_fromWire6"),
DNSMessageFORMERR);
// A boundary case: longest possible bitmaps (32 maps). This should be
// accepted.
EXPECT_NO_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire7"));
+ "rdata_nsec_fromWire7"));
// Another boundary condition: 33 bitmaps, which should be rejected.
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire8"),
+ "rdata_nsec_fromWire8"),
DNSMessageFORMERR);
// Disordered bitmap window blocks.
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire9"),
+ "rdata_nsec_fromWire9"),
DNSMessageFORMERR);
// Bitmap ending with all-zero bytes. Not necessarily harmful except
// the additional overhead of parsing, but invalid according to the
// spec anyway.
EXPECT_THROW(rdataFactoryFromFile(RRType::NSEC(), RRClass::IN(),
- "testdata/rdata_nsec_fromWire10"),
+ "rdata_nsec_fromWire10"),
DNSMessageFORMERR);
}
@@ -112,7 +112,7 @@
rdata_nsec.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_nsec_fromWire1", data);
+ UnitTestUtil::readWireData("rdata_nsec_fromWire1", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_opt_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_opt_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_opt_unittest.cc Wed May 12 14:23:18 2010
@@ -49,13 +49,13 @@
// Valid cases: in the simple implementation with no supported options,
// we can only check these don't throw.
EXPECT_NO_THROW(rdataFactoryFromFile(RRType::OPT(), RRClass("CLASS4096"),
- "testdata/rdata_opt_fromWire"));
+ "rdata_opt_fromWire"));
EXPECT_NO_THROW(rdataFactoryFromFile(RRType::OPT(), RRClass::CH(),
- "testdata/rdata_opt_fromWire", 2));
+ "rdata_opt_fromWire", 2));
// short buffer case.
EXPECT_THROW(rdataFactoryFromFile(RRType::OPT(), RRClass::IN(),
- "testdata/rdata_opt_fromWire", 11),
+ "rdata_opt_fromWire", 11),
InvalidRdataLength);
}
@@ -81,7 +81,7 @@
// This simple implementation always returns "true"
EXPECT_EQ(0, rdata_opt.compare(
*rdataFactoryFromFile(RRType::OPT(), RRClass::CH(),
- "testdata/rdata_opt_fromWire", 2)));
+ "rdata_opt_fromWire", 2)));
// comparison attempt between incompatible RR types should be rejected
EXPECT_THROW(rdata_opt.compare(*RdataTest::rdata_nomatch), bad_cast);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_ptr_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_ptr_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_ptr_unittest.cc Wed May 12 14:23:18 2010
@@ -71,25 +71,25 @@
{
EXPECT_EQ(0, rdata_ptr.compare(
*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire")));
+ "rdata_ns_fromWire")));
// RDLENGTH is too short
EXPECT_THROW(rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 18),
+ "rdata_ns_fromWire", 18),
InvalidRdataLength);
// RDLENGTH is too long
EXPECT_THROW(rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 36),
+ "rdata_ns_fromWire", 36),
InvalidRdataLength);
// incomplete name. the error should be detected in the name constructor
EXPECT_THROW(rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 71),
+ "rdata_ns_fromWire", 71),
DNSMessageFORMERR);
EXPECT_EQ(0, generic::PTR("ns2.example.com").compare(
*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 55)));
+ "rdata_ns_fromWire", 55)));
EXPECT_THROW(*rdataFactoryFromFile(RRType("PTR"), RRClass("IN"),
- "testdata/rdata_ns_fromWire", 63),
+ "rdata_ns_fromWire", 63),
InvalidRdataLength);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_rrsig_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_rrsig_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_rrsig_unittest.cc Wed May 12 14:23:18 2010
@@ -124,15 +124,15 @@
"ZgWZzQKeTKPOYWrnYtdZW4PnPQFeUl3orgLev7F8J6FZlDn0y/J/ThR5"
"m36Mo2/Gdxjj8lJ/IjPVkdpKyBpcnYND8KEIma5MyNCNeyO1UkfPQZGHNSQ=");
EXPECT_EQ(rrsig_txt, rdataFactoryFromFile(RRType("RRSIG"), RRClass("IN"),
- "testdata/rdata_rrsig_fromWire1")->toText());
+ "rdata_rrsig_fromWire1")->toText());
generic::RRSIG rdata_rrsig(rrsig_txt);
EXPECT_EQ(0, rdata_rrsig.compare(
*rdataFactoryFromFile(RRType("RRSIG"), RRClass("IN"),
- "testdata/rdata_rrsig_fromWire1")));
+ "rdata_rrsig_fromWire1")));
// RDLEN is too short
EXPECT_THROW(rdataFactoryFromFile(RRType::RRSIG(), RRClass::IN(),
- "testdata/rdata_rrsig_fromWire2"),
+ "rdata_rrsig_fromWire2"),
InvalidRdataLength);
}
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_soa_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_soa_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_soa_unittest.cc Wed May 12 14:23:18 2010
@@ -46,7 +46,7 @@
TEST_F(Rdata_SOA_Test, createFromWire) {
EXPECT_EQ(0, rdata_soa.compare(
*rdataFactoryFromFile(RRType("SOA"), RRClass("IN"),
- "testdata/rdata_soa_fromWire")));
+ "rdata_soa_fromWire")));
// TBD: more tests
}
@@ -55,7 +55,7 @@
rdata_soa.toWire(renderer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_soa_fromWire", data);
+ UnitTestUtil::readWireData("rdata_soa_fromWire", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
@@ -65,7 +65,7 @@
obuffer.skip(2);
rdata_soa.toWire(obuffer);
vector<unsigned char> data;
- UnitTestUtil::readWireData("testdata/rdata_soa_toWireUncompressed", data);
+ UnitTestUtil::readWireData("rdata_soa_toWireUncompressed", data);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData,
static_cast<const uint8_t *>(obuffer.getData()) + 2,
obuffer.getLength() - 2, &data[2], data.size() - 2);
Modified: experiments/python-binding/src/lib/dns/tests/rdata_txt_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_txt_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_txt_unittest.cc Wed May 12 14:23:18 2010
@@ -104,17 +104,17 @@
TEST_F(Rdata_TXT_Test, createFromWire) {
EXPECT_EQ(0, rdata_txt.compare(
*rdataFactoryFromFile(RRType("TXT"), RRClass("IN"),
- "testdata/rdata_txt_fromWire1")));
+ "rdata_txt_fromWire1")));
// Empty character string
EXPECT_EQ(0, rdata_txt_empty.compare(
*rdataFactoryFromFile(RRType("TXT"), RRClass("IN"),
- "testdata/rdata_txt_fromWire2")));
+ "rdata_txt_fromWire2")));
// Multiple character strings
obuffer.clear();
rdataFactoryFromFile(RRType("TXT"), RRClass("IN"),
- "testdata/rdata_txt_fromWire3")->toWire(obuffer);
+ "rdata_txt_fromWire3")->toWire(obuffer);
// the result should be 'wiredata_txt' repeated twice
vector<uint8_t> expected_data(wiredata_txt, wiredata_txt +
sizeof(wiredata_txt));
@@ -145,12 +145,12 @@
// RDATA is empty, which is invalid for TXT.
EXPECT_THROW(rdataFactoryFromFile(RRType("TXT"), RRClass("IN"),
- "testdata/rdata_txt_fromWire4"),
+ "rdata_txt_fromWire4"),
DNSMessageFORMERR);
// character-string length is too large, which could cause overrun.
EXPECT_THROW(rdataFactoryFromFile(RRType("TXT"), RRClass("IN"),
- "testdata/rdata_txt_fromWire5"),
+ "rdata_txt_fromWire5"),
DNSMessageFORMERR);
}
Modified: experiments/python-binding/src/lib/dns/tests/rdata_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rdata_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rdata_unittest.cc Wed May 12 14:23:18 2010
@@ -100,22 +100,22 @@
// "Unknown" RR Type used for the test cases below. If/when we use this
// type number as a "well-known" (probably experimental) type, we'll need to
// renumber it.
-const RRType unknown_rrtype = RRType("TYPE65000");
+const RRType unknown_rrtype = RRType(65000);
TEST_F(Rdata_Unknown_Test, createFromText)
{
// valid construction. This also tests a normal case of "FromWire".
EXPECT_EQ(0, generic::Generic("\\# 4 a1b2c30d").compare(
- *rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
- "testdata/rdata_unknown_fromWire")));
+ *rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
+ "rdata_unknown_fromWire")));
// upper case hexadecimal digits should also be okay.
EXPECT_EQ(0, generic::Generic("\\# 4 A1B2C30D").compare(
- *rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
- "testdata/rdata_unknown_fromWire")));
+ *rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
+ "rdata_unknown_fromWire")));
// 0-length RDATA should be accepted
EXPECT_EQ(0, generic::Generic("\\# 0").compare(
- *rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
- "testdata/rdata_unknown_fromWire", 6)));
+ *rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
+ "rdata_unknown_fromWire", 6)));
// hex encoding can be space-separated
EXPECT_EQ(0, generic::Generic("\\# 4 a1 b2c30d").compare(rdata_unknown));
EXPECT_EQ(0, generic::Generic("\\# 4 a1b2 c30d").compare(rdata_unknown));
@@ -153,8 +153,8 @@
// normal case (including 0-length data) is covered in createFromText.
// buffer too short. the error should be detected in buffer read
- EXPECT_THROW(rdataFactoryFromFile(unknown_rrtype, RRClass("IN"),
- "testdata/rdata_unknown_fromWire", 8),
+ EXPECT_THROW(rdataFactoryFromFile(unknown_rrtype, RRClass::IN(),
+ "rdata_unknown_fromWire", 8),
InvalidBufferPosition);
// too large data
@@ -170,10 +170,10 @@
TEST_F(Rdata_Unknown_Test, createRdataFromString)
{
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("IN"),
+ *createRdata(unknown_rrtype, RRClass::IN(),
rdata_unknowntxt)));
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("CH"),
+ *createRdata(unknown_rrtype, RRClass::CH(),
rdata_unknowntxt)));
EXPECT_EQ(0, rdata_unknown.compare(
*createRdata(unknown_rrtype, RRClass("CLASS65000"),
@@ -184,28 +184,28 @@
{
InputBuffer ibuffer(wiredata_unknown, sizeof(wiredata_unknown));
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("IN"),
+ *createRdata(unknown_rrtype, RRClass::IN(),
ibuffer, sizeof(wiredata_unknown))));
InputBuffer ibuffer2(wiredata_unknown, sizeof(wiredata_unknown));
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("CH"),
+ *createRdata(unknown_rrtype, RRClass::CH(),
ibuffer2, sizeof(wiredata_unknown))));
InputBuffer ibuffer3(wiredata_unknown, sizeof(wiredata_unknown));
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("CLASS65000"),
+ *createRdata(unknown_rrtype, RRClass(65000),
ibuffer3, sizeof(wiredata_unknown))));
}
TEST_F(Rdata_Unknown_Test, createRdataByCopy)
{
EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("IN"), rdata_unknown)));
- EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("CH"), rdata_unknown)));
- EXPECT_EQ(0, rdata_unknown.compare(
- *createRdata(unknown_rrtype, RRClass("CLASS65000"),
+ *createRdata(unknown_rrtype, RRClass::IN(), rdata_unknown)));
+ EXPECT_EQ(0, rdata_unknown.compare(
+ *createRdata(unknown_rrtype, RRClass::CH(), rdata_unknown)));
+ EXPECT_EQ(0, rdata_unknown.compare(
+ *createRdata(unknown_rrtype, RRClass(65000),
rdata_unknown)));
}
Modified: experiments/python-binding/src/lib/dns/tests/rrclass_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rrclass_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rrclass_unittest.cc Wed May 12 14:23:18 2010
@@ -84,8 +84,8 @@
TEST_F(RRClassTest, fromWire)
{
EXPECT_EQ(0x1234,
- rrclassFactoryFromWire("testdata/rrcode16_fromWire1").getCode());
- EXPECT_THROW(rrclassFactoryFromWire("testdata/rrcode16_fromWire2"),
+ rrclassFactoryFromWire("rrcode16_fromWire1").getCode());
+ EXPECT_THROW(rrclassFactoryFromWire("rrcode16_fromWire2"),
IncompleteRRClass);
}
Modified: experiments/python-binding/src/lib/dns/tests/rrset_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rrset_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rrset_unittest.cc Wed May 12 14:23:18 2010
@@ -201,7 +201,7 @@
{
rrset_a.toWire(buffer);
- UnitTestUtil::readWireData("testdata/rrset_toWire1", wiredata);
+ UnitTestUtil::readWireData("rrset_toWire1", wiredata);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, buffer.getData(),
buffer.getLength(), &wiredata[0], wiredata.size());
@@ -217,7 +217,7 @@
rrset_a.toWire(renderer);
rrset_ns.toWire(renderer);
- UnitTestUtil::readWireData("testdata/rrset_toWire2", wiredata);
+ UnitTestUtil::readWireData("rrset_toWire2", wiredata);
EXPECT_PRED_FORMAT4(UnitTestUtil::matchWireData, buffer.getData(),
buffer.getLength(), &wiredata[0], wiredata.size());
Modified: experiments/python-binding/src/lib/dns/tests/rrttl_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rrttl_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rrttl_unittest.cc Wed May 12 14:23:18 2010
@@ -85,8 +85,8 @@
TEST_F(RRTTLTest, fromWire)
{
EXPECT_EQ(0x12345678,
- rrttlFactoryFromWire("testdata/rrcode32_fromWire1").getValue());
- EXPECT_THROW(rrttlFactoryFromWire("testdata/rrcode32_fromWire2"),
+ rrttlFactoryFromWire("rrcode32_fromWire1").getValue());
+ EXPECT_THROW(rrttlFactoryFromWire("rrcode32_fromWire2"),
IncompleteRRTTL);
}
Modified: experiments/python-binding/src/lib/dns/tests/rrtype_unittest.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/rrtype_unittest.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/rrtype_unittest.cc Wed May 12 14:23:18 2010
@@ -88,9 +88,8 @@
TEST_F(RRTypeTest, fromWire)
{
EXPECT_EQ(0x1234,
- rrtypeFactoryFromWire("testdata/rrcode16_fromWire1").getCode());
- EXPECT_THROW(rrtypeFactoryFromWire("testdata/rrcode16_fromWire2"),
- IncompleteRRType);
+ rrtypeFactoryFromWire("rrcode16_fromWire1").getCode());
+ EXPECT_THROW(rrtypeFactoryFromWire("rrcode16_fromWire2"), IncompleteRRType);
}
// from string, lower case
Modified: experiments/python-binding/src/lib/dns/tests/run_unittests.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/run_unittests.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/run_unittests.cc Wed May 12 14:23:18 2010
@@ -16,9 +16,12 @@
#include <gtest/gtest.h>
+#include "unittest_util.h"
+
int
-main(int argc, char* argv[])
-{
+main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
+ isc::UnitTestUtil::addDataPath(TEST_DATA_DIR);
+
return (RUN_ALL_TESTS());
}
Modified: experiments/python-binding/src/lib/dns/tests/testdata/gen-wiredata.py.in
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/testdata/gen-wiredata.py.in (original)
+++ experiments/python-binding/src/lib/dns/tests/testdata/gen-wiredata.py.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#!@PYTHON@
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
import configparser, re, time, sys
from datetime import datetime
@@ -60,15 +75,16 @@
return dict[code] + '(' + str(code) + ')'
return str(code)
-def encode_name(name):
+def encode_name(name, absolute = True):
# make sure the name is dot-terminated. duplicate dots will be ignored
# below.
name += '.'
labels = name.split('.')
wire = ''
for l in labels:
- wire += '%02x' % len(l)
- wire += ''.join(['%02x' % ord(ch) for ch in l])
+ if absolute or len(l) > 0:
+ wire += '%02x' % len(l)
+ wire += ''.join(['%02x' % ord(ch) for ch in l])
if len(l) == 0:
break
return wire
@@ -102,6 +118,21 @@
### This data file was auto-generated from ''' + input_file + '''
###
''')
+
+class Name:
+ name = 'example.com'
+ pointer = -1 # no compression by default
+ def dump(self, f):
+ name_wire = encode_name(self.name,
+ True if self.pointer == -1 else False)
+ f.write('\n# DNS Name: %s' % self.name)
+ if self.pointer >= 0:
+ f.write(' + compression pointer: %d' % self.pointer)
+ f.write('\n')
+ f.write('%s' % name_wire)
+ if self.pointer >= 0:
+ f.write(' %04x' % (0xc000 | self.pointer))
+ f.write('\n')
class DNSHeader:
id = 0x1035
@@ -316,7 +347,8 @@
f.write('%04x %s %s\n' % (self.tag, name_wire, sig_wire))
def get_config_param(section):
- config_param = {'header' : (DNSHeader, header_xtables),
+ config_param = {'name' : (Name, {}),
+ 'header' : (DNSHeader, header_xtables),
'question' : (DNSQuestion, question_xtables),
'edns' : (EDNS, {}), 'soa' : (SOA, {}), 'txt' : (TXT, {}),
'rrsig' : (RRSIG, {}), 'nsec' : (NSEC, {})}
Modified: experiments/python-binding/src/lib/dns/tests/unittest_util.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/unittest_util.cc (original)
+++ experiments/python-binding/src/lib/dns/tests/unittest_util.cc Wed May 12 14:23:18 2010
@@ -14,7 +14,7 @@
// $Id$
-#include "config.h"
+#include <config.h>
#include <iostream>
#include <fstream>
@@ -33,16 +33,51 @@
using isc::UnitTestUtil;
using isc::dns::NameComparisonResult;
+namespace {
+class UnitTestUtilConfig {
+private:
+ // This is a singleton object and cannot be constructed explicitly.
+ UnitTestUtilConfig() {}
+ UnitTestUtilConfig(const UnitTestUtilConfig& source);
+ ~UnitTestUtilConfig() {}
+public:
+ /// Return a singleton unit test configuration object. On first invocation
+ /// one will be constructed.
+ static UnitTestUtilConfig& getConfig();
+
+ /// A list of paths to wire data files.
+ /// \c UnitTestUtil::readWireData() (first version)
+ /// will search the directories in this list for the specified data file.
+ std::vector<string> data_paths_;
+};
+
+UnitTestUtilConfig&
+UnitTestUtilConfig::getConfig() {
+ static UnitTestUtilConfig config;
+ return (config);
+}
+}
+
void
-UnitTestUtil::readWireData(const char* datafile,
- vector<unsigned char>& data)
-{
+UnitTestUtil::readWireData(const char* datafile, vector<unsigned char>& data) {
ifstream ifs;
-
- ifs.open(datafile, ios_base::in);
- if ((ifs.rdstate() & istream::failbit) != 0) {
- throw runtime_error("failed to open data file: " +
- string(datafile));
+
+ const UnitTestUtilConfig& config = UnitTestUtilConfig::getConfig();
+ vector<string>::const_iterator it = config.data_paths_.begin();
+ for (; it != config.data_paths_.end(); ++it) {
+ string data_path = *it;
+ if (data_path.empty() || *data_path.rbegin() != '/') {
+ data_path.push_back('/');
+ }
+ ifs.open((data_path + datafile).c_str(), ios_base::in);
+ if ((ifs.rdstate() & istream::failbit) == 0) {
+ break;
+ }
+ }
+
+ if (it == config.data_paths_.end()) {
+ throw runtime_error("failed to open data file in data paths: " +
+ string(datafile));
}
data.clear();
@@ -58,6 +93,11 @@
readWireData(s, data);
}
+}
+
+void
+UnitTestUtil::addDataPath(const string& directory) {
+ UnitTestUtilConfig::getConfig().data_paths_.push_back(directory);
}
void
Modified: experiments/python-binding/src/lib/dns/tests/unittest_util.h
==============================================================================
--- experiments/python-binding/src/lib/dns/tests/unittest_util.h (original)
+++ experiments/python-binding/src/lib/dns/tests/unittest_util.h Wed May 12 14:23:18 2010
@@ -31,8 +31,13 @@
///
/// read text format wire data from a file and put it to the given vector.
///
- static void readWireData(const char*datafile,
+ static void readWireData(const char* datafile,
std::vector<unsigned char>& data);
+
+ ///
+ /// add a path that \c readWireData() will search for test data files.
+ ///
+ static void addDataPath(const std::string& directory);
///
/// convert a sequence of hex strings into the corresponding list of
Modified: experiments/python-binding/src/lib/dns/tsig.cc
==============================================================================
--- experiments/python-binding/src/lib/dns/tsig.cc (original)
+++ experiments/python-binding/src/lib/dns/tsig.cc Wed May 12 14:23:18 2010
@@ -21,7 +21,7 @@
#include <algorithm>
-#include "tsig.h"
+#include <dns/tsig.h>
using namespace std;
using isc::dns::MessageRenderer;
Modified: experiments/python-binding/src/lib/dns/tsig.h
==============================================================================
--- experiments/python-binding/src/lib/dns/tsig.h (original)
+++ experiments/python-binding/src/lib/dns/tsig.h Wed May 12 14:23:18 2010
@@ -22,8 +22,8 @@
#include <exceptions/exceptions.h>
-#include "name.h"
-#include "message.h"
+#include <dns/name.h>
+#include <dns/message.h>
namespace isc {
namespace dns {
Modified: experiments/python-binding/src/lib/python/isc/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/python/isc/Makefile.am (original)
+++ experiments/python-binding/src/lib/python/isc/Makefile.am Wed May 12 14:23:18 2010
@@ -1,4 +1,4 @@
-SUBDIRS = auth cc config # Util
+SUBDIRS = datasrc cc config # Util
python_PYTHON = __init__.py
Modified: experiments/python-binding/src/lib/python/isc/__init__.py
==============================================================================
--- experiments/python-binding/src/lib/python/isc/__init__.py (original)
+++ experiments/python-binding/src/lib/python/isc/__init__.py Wed May 12 14:23:18 2010
@@ -1,4 +1,4 @@
-import isc.auth
+import isc.datasrc
import isc.cc
import isc.config
-import isc.dns
+#import isc.dns
Modified: experiments/python-binding/src/lib/python/isc/cc/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/python/isc/cc/Makefile.am (original)
+++ experiments/python-binding/src/lib/python/isc/cc/Makefile.am Wed May 12 14:23:18 2010
@@ -1,9 +1,5 @@
+SUBDIRS = tests
+
python_PYTHON = __init__.py data.py session.py message.py
pythondir = $(pyexecdir)/isc/cc
-
-EXTRA_DIST = tests/data_test.py
-EXTRA_DIST += tests/sendcmd.py
-EXTRA_DIST += tests/session_test.py
-EXTRA_DIST += tests/test.py
-EXTRA_DIST += tests/test_session.py
Modified: experiments/python-binding/src/lib/python/isc/cc/message.py
==============================================================================
--- experiments/python-binding/src/lib/python/isc/cc/message.py (original)
+++ experiments/python-binding/src/lib/python/isc/cc/message.py Wed May 12 14:23:18 2010
@@ -200,7 +200,7 @@
return (value, data)
def _decode_bool(data):
- return data == b'1' or data == b'0x01'
+ return data == b'1'
def _decode_int(data):
return int(str(data, 'utf-8'))
Modified: experiments/python-binding/src/lib/python/isc/cc/tests/cc_test.in
==============================================================================
--- experiments/python-binding/src/lib/python/isc/cc/tests/cc_test.in (original)
+++ experiments/python-binding/src/lib/python/isc/cc/tests/cc_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/lib/python/isc/cc/tests/data_test.py
==============================================================================
--- experiments/python-binding/src/lib/python/isc/cc/tests/data_test.py (original)
+++ experiments/python-binding/src/lib/python/isc/cc/tests/data_test.py Wed May 12 14:23:18 2010
@@ -19,7 +19,7 @@
import unittest
import os
-import data
+from isc.cc import data
class TestData(unittest.TestCase):
def test_remove_identical(self):
Modified: experiments/python-binding/src/lib/python/isc/cc/tests/test.py
==============================================================================
--- experiments/python-binding/src/lib/python/isc/cc/tests/test.py (original)
+++ experiments/python-binding/src/lib/python/isc/cc/tests/test.py Wed May 12 14:23:18 2010
@@ -80,11 +80,11 @@
def test_to_wire_of_bool_true(self):
wire = isc.cc.message.to_wire({ "bool": True })
- self.assertEqual(wire, b'Skan\x04bool%\x01\x01')
+ self.assertEqual(wire, b'Skan\x04bool%\x011')
def test_to_wire_of_bool_false(self):
wire = isc.cc.message.to_wire({ "bool": False })
- self.assertEqual(wire, b'Skan\x04bool%\x01\x00')
+ self.assertEqual(wire, b'Skan\x04bool%\x010')
def test_from_wire_of_bool_true(self):
wire = b'Skan\x04bool%\x01\x01'
Modified: experiments/python-binding/src/lib/python/isc/config/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/python/isc/config/Makefile.am (original)
+++ experiments/python-binding/src/lib/python/isc/config/Makefile.am Wed May 12 14:23:18 2010
@@ -1,9 +1,5 @@
+SUBDIRS = tests
+
python_PYTHON = __init__.py ccsession.py cfgmgr.py config_data.py module_spec.py
pythondir = $(pyexecdir)/isc/config
-
-EXTRA_DIST = tests/ccsession_test.py
-EXTRA_DIST += tests/cfgmgr_test.py
-EXTRA_DIST += tests/config_data_test.py
-EXTRA_DIST += tests/module_spec_test.py
-EXTRA_DIST += tests/unittest_fakesession.py
Modified: experiments/python-binding/src/lib/python/isc/config/tests/config_test.in
==============================================================================
--- experiments/python-binding/src/lib/python/isc/config/tests/config_test.in (original)
+++ experiments/python-binding/src/lib/python/isc/config/tests/config_test.in Wed May 12 14:23:18 2010
@@ -1,4 +1,19 @@
#! /bin/sh
+
+# Copyright (C) 2010 Internet Systems Consortium.
+#
+# Permission to use, copy, modify, and 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 INTERNET SYSTEMS CONSORTIUM
+# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+# INTERNET SYSTEMS CONSORTIUM 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.
PYTHON_EXEC=${PYTHON_EXEC:- at PYTHON@}
export PYTHON_EXEC
Modified: experiments/python-binding/src/lib/xfr/Makefile.am
==============================================================================
--- experiments/python-binding/src/lib/xfr/Makefile.am (original)
+++ experiments/python-binding/src/lib/xfr/Makefile.am Wed May 12 14:23:18 2010
@@ -2,7 +2,8 @@
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/dns -I$(top_builddir)/src/lib/dns
-AM_CPPFLAGS += -I$(top_srcdir)/ext
+AM_CPPFLAGS += -I$(top_srcdir)/ext -Wno-strict-aliasing
+
if GCC_WERROR_OK
AM_CPPFLAGS += -Werror
endif
Modified: experiments/python-binding/src/lib/xfr/fd_share.cc
==============================================================================
--- experiments/python-binding/src/lib/xfr/fd_share.cc (original)
+++ experiments/python-binding/src/lib/xfr/fd_share.cc Wed May 12 14:23:18 2010
@@ -12,7 +12,11 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <stdlib.h>
+// $Id$
+
+#include <cstring>
+#include <cstdlib>
+
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
@@ -21,95 +25,113 @@
namespace isc {
namespace xfr {
-#define FD_BUFFER_CREATE(n) \
- struct { \
- struct cmsghdr h; \
- int fd[n]; \
+namespace {
+// Not all OSes support advanced CMSG macros: CMSG_LEN and CMSG_SPACE.
+// In order to ensure as much portability as possible, we provide wrapper
+// functions of these macros.
+// Note that cmsg_space() could run slow on OSes that do not have
+// CMSG_SPACE.
+inline socklen_t
+cmsg_len(const socklen_t len) {
+#ifdef CMSG_LEN
+ return (CMSG_LEN(len));
+#else
+ // Cast NULL so that any pointer arithmetic performed by CMSG_DATA
+ // is correct.
+ const uintptr_t hdrlen = (uintptr_t)CMSG_DATA(((struct cmsghdr*)NULL));
+ return (hdrlen + len);
+#endif
+}
+
+inline socklen_t
+cmsg_space(const socklen_t len) {
+#ifdef CMSG_SPACE
+ return (CMSG_SPACE(len));
+#else
+ struct msghdr msg;
+ struct cmsghdr* cmsgp;
+ // XXX: The buffer length is an ad hoc value, but should be enough
+ // in a practical sense.
+ char dummybuf[sizeof(struct cmsghdr) + 1024];
+
+ memset(&msg, 0, sizeof(msg));
+ msg.msg_control = dummybuf;
+ msg.msg_controllen = sizeof(dummybuf);
+
+ cmsgp = (struct cmsghdr*)dummybuf;
+ cmsgp->cmsg_len = cmsg_len(len);
+
+ cmsgp = CMSG_NXTHDR(&msg, cmsgp);
+ if (cmsgp != NULL) {
+ return ((char*)cmsgp - (char*)msg.msg_control);
+ } else {
+ return (0);
}
-
-int
-send_fds_with_buffer(int sock, const int *fds, unsigned n_fds, void *buffer)
-{
- struct msghdr msghdr;
- char nothing = '!';
- struct iovec nothing_ptr;
- struct cmsghdr *cmsg;
- int i;
-
- nothing_ptr.iov_base = ¬hing;
- nothing_ptr.iov_len = 1;
- msghdr.msg_name = NULL;
- msghdr.msg_namelen = 0;
- msghdr.msg_iov = ¬hing_ptr;
- msghdr.msg_iovlen = 1;
- msghdr.msg_flags = 0;
- msghdr.msg_control = buffer;
- msghdr.msg_controllen = sizeof(struct cmsghdr) + sizeof(int) * n_fds;
- cmsg = CMSG_FIRSTHDR(&msghdr);
- cmsg->cmsg_len = msghdr.msg_controllen;
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_RIGHTS;
- for(i = 0; i < n_fds; i++)
- ((int *)CMSG_DATA(cmsg))[i] = fds[i];
-
- int ret = sendmsg(sock, &msghdr, 0);
- return (ret >= 0 ? 0 : -1);
+#endif // CMSG_SPACE
+}
}
int
-recv_fds_with_buffer(int sock, int *fds, unsigned n_fds, void *buffer)
-{
+recv_fd(const int sock) {
struct msghdr msghdr;
- char nothing;
- struct iovec nothing_ptr;
- struct cmsghdr *cmsg;
- int i;
+ struct iovec iov_dummy;
+ unsigned char dummy_data;
- nothing_ptr.iov_base = ¬hing;
- nothing_ptr.iov_len = 1;
+ iov_dummy.iov_base = &dummy_data;
+ iov_dummy.iov_len = sizeof(dummy_data);
msghdr.msg_name = NULL;
msghdr.msg_namelen = 0;
- msghdr.msg_iov = ¬hing_ptr;
+ msghdr.msg_iov = &iov_dummy;
msghdr.msg_iovlen = 1;
msghdr.msg_flags = 0;
- msghdr.msg_control = buffer;
- msghdr.msg_controllen = sizeof(struct cmsghdr) + sizeof(int) * n_fds;
- cmsg = CMSG_FIRSTHDR(&msghdr);
- cmsg->cmsg_len = msghdr.msg_controllen;
- cmsg->cmsg_level = SOL_SOCKET;
- cmsg->cmsg_type = SCM_RIGHTS;
- for(i = 0; i < n_fds; i++)
- ((int *)CMSG_DATA(cmsg))[i] = -1;
-
- if(recvmsg(sock, &msghdr, 0) < 0)
+ msghdr.msg_controllen = cmsg_space(sizeof(int));
+ msghdr.msg_control = malloc(msghdr.msg_controllen);
+ if (msghdr.msg_control == NULL) {
return (-1);
-
- for(i = 0; i < n_fds; i++) {
- fds[i] = ((int *)CMSG_DATA(cmsg))[i];
}
- n_fds = (msghdr.msg_controllen - sizeof(struct cmsghdr)) / sizeof(int);
- return n_fds;
+ if (recvmsg(sock, &msghdr, 0) < 0) {
+ free(msghdr.msg_control);
+ return (-1);
+ }
+ const struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msghdr);
+ int fd = -1;
+ if (cmsg != NULL && cmsg->cmsg_len == cmsg_len(sizeof(int)) &&
+ cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
+ fd = *(const int*)CMSG_DATA(cmsg);
+ }
+ free(msghdr.msg_control);
+ return (fd);
}
int
-recv_fd(int sock)
-{
- FD_BUFFER_CREATE(1) buffer;
- int fd = 0;
- int ret = recv_fds_with_buffer(sock, &fd, 1, &buffer);
- if (ret == -1)
- return -1;
+send_fd(const int sock, const int fd) {
+ struct msghdr msghdr;
+ struct iovec iov_dummy;
+ unsigned char dummy_data = 0;
- return fd;
-}
+ iov_dummy.iov_base = &dummy_data;
+ iov_dummy.iov_len = sizeof(dummy_data);
+ msghdr.msg_name = NULL;
+ msghdr.msg_namelen = 0;
+ msghdr.msg_iov = &iov_dummy;
+ msghdr.msg_iovlen = 1;
+ msghdr.msg_flags = 0;
+ msghdr.msg_controllen = cmsg_space(sizeof(int));
+ msghdr.msg_control = malloc(msghdr.msg_controllen);
+ if (msghdr.msg_control == NULL) {
+ return (-1);
+ }
-int
-send_fd(int sock, int fd)
-{
- FD_BUFFER_CREATE(1) buffer;
- int ret = send_fds_with_buffer(sock, &fd, 1, &buffer);
- return ((ret < 0) ? -1 : ret);
+ struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msghdr);
+ cmsg->cmsg_len = cmsg_len(sizeof(int));
+ cmsg->cmsg_level = SOL_SOCKET;
+ cmsg->cmsg_type = SCM_RIGHTS;
+ *(int*)CMSG_DATA(cmsg) = fd;
+
+ const int ret = sendmsg(sock, &msghdr, 0);
+ free(msghdr.msg_control);
+ return (ret >= 0 ? 0 : -1);
}
} // End for namespace xfr
Modified: experiments/python-binding/src/lib/xfr/fd_share.h
==============================================================================
--- experiments/python-binding/src/lib/xfr/fd_share.h (original)
+++ experiments/python-binding/src/lib/xfr/fd_share.h Wed May 12 14:23:18 2010
@@ -12,10 +12,10 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+// $Id$
+
#ifndef FD_SHARE_H_
#define FD_SHARE_H_
-
-#include <stdlib.h>
namespace isc {
namespace xfr {
@@ -23,16 +23,18 @@
// Receive socket descriptor on unix domain socket 'sock'.
// Returned value is the socket descriptor received.
// Errors are indicated by a return value of -1.
-int
-recv_fd(int sock);
+int recv_fd(int sock);
// Send socket descriptor "fd" to server over unix domain socket 'sock',
// the connection from socket 'sock' to unix domain server should be established first.
// Errors are indicated by a return value of -1.
-int
-send_fd(int sock, int fd);
+int send_fd(int sock, int fd);
} // End for namespace xfr
} // End for namespace isc
#endif
+
+// Local Variables:
+// mode: c++
+// End:
Modified: experiments/python-binding/src/lib/xfr/python_xfr.cc
==============================================================================
--- experiments/python-binding/src/lib/xfr/python_xfr.cc (original)
+++ experiments/python-binding/src/lib/xfr/python_xfr.cc Wed May 12 14:23:18 2010
@@ -12,9 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-// $Id: message_python.cc 2010-03-08 18:44:00 feng $
+// $Id$
-#include <string>
#include <boost/python.hpp>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
@@ -29,10 +28,8 @@
using namespace isc::xfr;
using namespace boost::python;
-
BOOST_PYTHON_MODULE(bind10_xfr)
{
def("recv_fd", &recv_fd);
def("send_fd", &send_fd);
}
-
Modified: experiments/python-binding/src/lib/xfr/xfrout_client.cc
==============================================================================
--- experiments/python-binding/src/lib/xfr/xfrout_client.cc (original)
+++ experiments/python-binding/src/lib/xfr/xfrout_client.cc Wed May 12 14:23:18 2010
@@ -12,6 +12,7 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+// $Id$
#include <cstdlib>
#include <cstring>
@@ -25,45 +26,40 @@
namespace xfr {
void
-XfroutClient::connect()
-{
+XfroutClient::connect() {
socket_.connect(stream_protocol::endpoint(file_path_));
}
void
-XfroutClient::disconnect()
-{
+XfroutClient::disconnect() {
socket_.close();
}
-void
-XfroutClient::sendData(uint8_t *msg_data, uint16_t msg_len)
+int
+XfroutClient::sendXfroutRequestInfo(const int tcp_sock, uint8_t* msg_data,
+ const uint16_t msg_len)
{
- int count = 0;
- while(count < msg_len) {
- int size = send(socket_.native(), msg_data + count, msg_len - count, 0);
- if (size == -1)
- isc_throw(XfroutError, "auth failed to send data to xfrout module\n");
-
- count += size;
+ if (-1 == send_fd(socket_.native(), tcp_sock)) {
+ isc_throw(XfroutError,
+ "Fail to send socket descriptor to xfrout module");
}
- return;
-}
-
-int
-XfroutClient::sendXfroutRequestInfo(int tcp_sock, uint8_t *msg_data, uint16_t msg_len)
-{
- if (-1 == send_fd(socket_.native(), tcp_sock))
- isc_throw(XfroutError, "Fail to send socket descriptor to xfrout module\n");
-
- sendData((uint8_t *)&msg_len, 2);
- sendData(msg_data, msg_len);
+ // XXX: this shouldn't be blocking send, even though it's unlikely to block.
+ const uint8_t lenbuf[2] = { msg_len >> 8, msg_len & 0xff };
+ if (send(socket_.native(), lenbuf, sizeof(lenbuf), 0) != sizeof(lenbuf)) {
+ isc_throw(XfroutError,
+ "failed to send XFR request length to xfrout module");
+ }
+ if (send(socket_.native(), msg_data, msg_len, 0) != msg_len) {
+ isc_throw(XfroutError,
+ "failed to send XFR request data to xfrout module");
+ }
int databuf = 0;
- int status = recv(socket_.native(), &databuf, sizeof(int), 0);
- if (status != 0)
- isc_throw(XfroutError, "xfr query doesn't been processed properly by xfrout module\n");
+ if (recv(socket_.native(), &databuf, sizeof(int), 0) != 0) {
+ isc_throw(XfroutError,
+ "xfr query hasn't been processed properly by xfrout module");
+ }
return 0;
}
Modified: experiments/python-binding/src/lib/xfr/xfrout_client.h
==============================================================================
--- experiments/python-binding/src/lib/xfr/xfrout_client.h (original)
+++ experiments/python-binding/src/lib/xfr/xfrout_client.h Wed May 12 14:23:18 2010
@@ -12,9 +12,12 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+// $Id$
#ifndef _XFROUT_CLIENT_H
#define _XFROUT_CLIENT_H
+
+#include <string>
#include <boost/asio.hpp>
#include <exceptions/exceptions.h>
@@ -22,26 +25,22 @@
namespace isc {
namespace xfr {
-class XfroutError: public Exception
-{
-public:
+class XfroutError: public Exception {
+public:
XfroutError(const char *file, size_t line, const char *what):
isc::Exception(file, line, what) {}
};
using boost::asio::local::stream_protocol;
-class XfroutClient
-{
+class XfroutClient {
public:
- XfroutClient(const std::string &file):
+ XfroutClient(const std::string& file):
socket_(io_service_), file_path_(file) {}
void connect();
void disconnect();
- int sendXfroutRequestInfo(int tcp_sock, uint8_t *msg_data, uint16_t msg_len);
-
-private:
- void sendData(uint8_t *msg_data, uint16_t msg_len);
+ int sendXfroutRequestInfo(int tcp_sock, uint8_t* msg_data,
+ uint16_t msg_len);
private:
boost::asio::io_service io_service_;
@@ -54,3 +53,7 @@
} // End for namespace isc
#endif
+
+// Local Variables:
+// mode: c++
+// End:
More information about the bind10-changes
mailing list