Browse Source

Merge branch 'master' into trac2108_3

Conflicts fixed:
	src/lib/datasrc/memory/tests/treenode_rrset_unittest.cc
	src/lib/datasrc/memory/treenode_rrset.cc
	src/lib/datasrc/memory/treenode_rrset.h
Mukund Sivaraman 12 years ago
parent
commit
ee0950bcf9
100 changed files with 1380 additions and 17054 deletions
  1. 25 0
      ChangeLog
  2. 5 1
      Makefile.am
  3. 27 4
      configure.ac
  4. 3 0
      doc/guide/.gitignore
  5. 19 11
      doc/guide/Makefile.am
  6. 0 2070
      doc/guide/bind10-guide.html
  7. 0 2156
      doc/guide/bind10-guide.txt
  8. 43 26
      doc/guide/bind10-guide.xml
  9. 0 3303
      doc/guide/bind10-messages.html
  10. 0 7116
      doc/guide/bind10-messages.xml
  11. 1 0
      src/bin/auth/.gitignore
  12. 9 2
      src/bin/auth/Makefile.am
  13. 5 0
      src/bin/auth/auth.spec.pre.in
  14. 25 0
      src/bin/auth/auth_config.cc
  15. 22 0
      src/bin/auth/auth_srv.cc
  16. 10 0
      src/bin/auth/auth_srv.h
  17. 0 213
      src/bin/auth/b10-auth.8
  18. 7 0
      src/bin/auth/b10-auth.xml
  19. 1 1
      src/bin/auth/command.cc
  20. 1 2
      src/bin/auth/query.cc
  21. 3 4
      src/bin/auth/tests/auth_srv_unittest.cc
  22. 22 4
      src/bin/auth/tests/config_syntax_unittest.cc
  23. 13 0
      src/bin/auth/tests/config_unittest.cc
  24. 1 0
      src/bin/bind10/.gitignore
  25. 16 2
      src/bin/bind10/Makefile.am
  26. 0 288
      src/bin/bind10/bind10.8
  27. 1 0
      src/bin/bindctl/.gitignore
  28. 9 2
      src/bin/bindctl/Makefile.am
  29. 0 157
      src/bin/bindctl/bindctl.1
  30. 1 0
      src/bin/cfgmgr/.gitignore
  31. 9 2
      src/bin/cfgmgr/Makefile.am
  32. 0 82
      src/bin/cfgmgr/b10-cfgmgr.8
  33. 1 0
      src/bin/cmdctl/.gitignore
  34. 9 2
      src/bin/cmdctl/Makefile.am
  35. 0 133
      src/bin/cmdctl/b10-cmdctl.8
  36. 1 0
      src/bin/dbutil/.gitignore
  37. 9 2
      src/bin/dbutil/Makefile.am
  38. 0 89
      src/bin/dbutil/b10-dbutil.8
  39. 1 0
      src/bin/ddns/.gitignore
  40. 10 2
      src/bin/ddns/Makefile.am
  41. 0 115
      src/bin/ddns/b10-ddns.8
  42. 1 0
      src/bin/dhcp4/.gitignore
  43. 23 6
      src/bin/dhcp4/Makefile.am
  44. 0 60
      src/bin/dhcp4/b10-dhcp4.8
  45. 23 20
      src/bin/dhcp4/ctrl_dhcp4_srv.cc
  46. 26 0
      src/bin/dhcp4/dhcp4_log.cc
  47. 59 0
      src/bin/dhcp4/dhcp4_log.h
  48. 98 0
      src/bin/dhcp4/dhcp4_messages.mes
  49. 66 27
      src/bin/dhcp4/dhcp4_srv.cc
  50. 21 4
      src/bin/dhcp4/dhcp4_srv.h
  51. 29 31
      src/bin/dhcp4/main.cc
  52. 2 0
      src/bin/dhcp4/tests/Makefile.am
  53. 33 1
      src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
  54. 29 27
      src/bin/dhcp4/tests/dhcp4_test.py
  55. 1 0
      src/bin/dhcp6/.gitignore
  56. 23 6
      src/bin/dhcp6/Makefile.am
  57. 0 51
      src/bin/dhcp6/b10-dhcp6.8
  58. 23 20
      src/bin/dhcp6/ctrl_dhcp6_srv.cc
  59. 26 0
      src/bin/dhcp6/dhcp6_log.cc
  60. 59 0
      src/bin/dhcp6/dhcp6_log.h
  61. 101 0
      src/bin/dhcp6/dhcp6_messages.mes
  62. 88 27
      src/bin/dhcp6/dhcp6_srv.cc
  63. 18 0
      src/bin/dhcp6/dhcp6_srv.h
  64. 27 31
      src/bin/dhcp6/main.cc
  65. 5 2
      src/bin/dhcp6/tests/Makefile.am
  66. 46 1
      src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
  67. 28 25
      src/bin/dhcp6/tests/dhcp6_test.py
  68. 1 0
      src/bin/host/.gitignore
  69. 9 2
      src/bin/host/Makefile.am
  70. 0 118
      src/bin/host/b10-host.1
  71. 1 0
      src/bin/loadzone/.gitignore
  72. 9 2
      src/bin/loadzone/Makefile.am
  73. 0 80
      src/bin/loadzone/b10-loadzone.8
  74. 1 0
      src/bin/loadzone/tests/correct/Makefile.am
  75. 8 0
      src/bin/loadzone/tests/correct/comment.db
  76. 4 0
      src/bin/loadzone/tests/correct/correct_test.sh.in
  77. 1 1
      src/bin/loadzone/tests/correct/get_zonedatas.py
  78. 6 0
      src/bin/loadzone/tests/correct/known.test.out
  79. 1 0
      src/bin/msgq/.gitignore
  80. 9 2
      src/bin/msgq/Makefile.am
  81. 0 125
      src/bin/msgq/b10-msgq.8
  82. 1 0
      src/bin/resolver/.gitignore
  83. 9 2
      src/bin/resolver/Makefile.am
  84. 0 149
      src/bin/resolver/b10-resolver.8
  85. 1 0
      src/bin/sockcreator/.gitignore
  86. 17 0
      src/bin/sockcreator/Makefile.am
  87. 96 0
      src/bin/sockcreator/b10-sockcreator.xml
  88. 2 0
      src/bin/stats/.gitignore
  89. 10 3
      src/bin/stats/Makefile.am
  90. 0 126
      src/bin/stats/b10-stats-httpd.8
  91. 0 170
      src/bin/stats/b10-stats.8
  92. 1 0
      src/bin/sysinfo/.gitignore
  93. 9 2
      src/bin/sysinfo/Makefile.am
  94. 0 66
      src/bin/sysinfo/isc-sysinfo.1
  95. 1 0
      src/bin/usermgr/.gitignore
  96. 9 2
      src/bin/usermgr/Makefile.am
  97. 0 74
      src/bin/usermgr/b10-cmdctl-usermgr.8
  98. 1 0
      src/bin/xfrin/.gitignore
  99. 9 2
      src/bin/xfrin/Makefile.am
  100. 0 0
      src/bin/xfrin/b10-xfrin.8

+ 25 - 0
ChangeLog

@@ -1,3 +1,28 @@
+474.	[func]      stephen
+	DHCP servers now use the BIND 10 logging system for messages.
+	(Trac #1545, git de69a92613b36bd3944cb061e1b7c611c3c85506)
+
+473.	[bug]		jelte
+	TCP connections now time out in b10-auth if no (or not all) query
+	data is sent by the client. The timeout value defaults to 5000
+	milliseconds, but is configurable in Auth/tcp_recv_timeout.
+	(Trac #357, git cdf3f04442f8f131542bd1d4a2228a9d0bed12ff)
+
+472.	[build]		jreed
+	All generated documentation is removed from the git repository.
+	The ./configure --enable-man option is removed. A new option
+	-enable-generate-docs is added; it checks for required
+	documentation building dependencies. Dummy documentation is
+	built and installed if not used. Distributed tarballs will
+	contain the generated documentation.
+	(Trac #1687, git 2d4063b1a354f5048ca9dfb195e8e169650f43d0)
+
+471.    [bug]		vorner
+	Fixed a problem when b10-loadzone tried to tread semicolon
+	in string data as start of comment, which caused invalid
+	data being loaded.
+	(Trac #2188, git 12efec3477feb62d7cbe36bdcfbfc7aa28a36f57)
+
 470.	[func]		naokikambe
 	The stats module now supports partial statistics updates. Each
 	module can return only statistics data which have been updated since

+ 5 - 1
Makefile.am

@@ -113,8 +113,12 @@ systest:
 	cd tests/system; \
 	sh $(abs_srcdir)/tests/system/runall.sh
 
+### include tool to generate documentation from log message specifications
+### in the distributed tarball:
+EXTRA_DIST = tools/system_messages.py
+
 #### include external sources in the distributed tarball:
-EXTRA_DIST = ext/asio/README
+EXTRA_DIST += ext/asio/README
 EXTRA_DIST += ext/asio/README
 EXTRA_DIST += ext/asio/asio.hpp
 EXTRA_DIST += ext/asio/asio/basic_socket.hpp

+ 27 - 4
configure.ac

@@ -1027,10 +1027,32 @@ AC_SUBST(PERL)
 AC_PATH_PROGS(AWK, gawk awk)
 AC_SUBST(AWK)
 
-AC_ARG_ENABLE(man, [AC_HELP_STRING([--enable-man],
-  [regenerate man pages [default=no]])], enable_man=$enableval, enable_man=no)
+AC_ARG_ENABLE(generate_docs, [AC_HELP_STRING([--enable-generate-docs],
+  [regenerate documentation using Docbook [default=no]])],
+  enable_generate_docs=$enableval, enable_generate_docs=no)
+
+# Check for xsltproc
+if test "x$enable_generate_docs" != xno ; then
+  AC_PATH_PROG([XSLTPROC], [xsltproc])
+  if test -z "$XSLTPROC"; then
+    AC_MSG_ERROR("xsltproc not found; it is required for --enable-generate-docs")
+  else
+    AC_MSG_CHECKING([if $XSLTPROC works])
+    # run xsltproc to see if works
+    $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
+    if test $? -ne 0 ; then
+      AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/manpages/docbook.xsl")
+    fi
+    $XSLTPROC --novalid --xinclude --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
+    if test $? -ne 0 ; then
+      AC_MSG_ERROR("Error with $XSLTPROC using release/xsl/current/html/docbook.xsl")
+    fi
+    AC_MSG_RESULT(yes)
+  fi
+fi
+
 
-AM_CONDITIONAL(ENABLE_MAN, test x$enable_man != xno)
+AM_CONDITIONAL(GENERATE_DOCS, test x$enable_generate_docs != xno)
 
 AC_ARG_ENABLE(install-configurations,
   [AC_HELP_STRING([--disable-install-configurations],
@@ -1202,6 +1224,7 @@ AC_CONFIG_FILES([Makefile
                  tests/tools/badpacket/tests/Makefile
                  tests/tools/perfdhcp/Makefile
                  tests/tools/perfdhcp/tests/Makefile
+                 tests/tools/perfdhcp/templates/Makefile
                  dns++.pc
                ])
 AC_OUTPUT([doc/version.ent
@@ -1377,7 +1400,7 @@ Developer:
   C++ Code Coverage: $USE_LCOV
   Python Code Coverage: $USE_PYCOVERAGE
   Logger checks: $enable_logger_checks
-  Generate Manuals: $enable_man
+  Generate Documentation: $enable_generate_docs
 
 END
 

+ 3 - 0
doc/guide/.gitignore

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

+ 19 - 11
doc/guide/Makefile.am

@@ -1,15 +1,18 @@
-dist_doc_DATA = bind10-guide.txt
-dist_html_DATA = bind10-guide.css bind10-guide.html bind10-messages.html
+# generated documentation
+HTMLDOCS = bind10-guide.html bind10-messages.html
+DOCS = bind10-guide.txt
 
-EXTRA_DIST = bind10-guide.xml bind10-messages.xml
+dist_doc_DATA = $(DOCS)
+dist_html_DATA = $(HTMLDOCS) bind10-guide.css
 
-# This is not a "man" manual, but reuse this for now for docbook.
-if ENABLE_MAN
+EXTRA_DIST = bind10-guide.xml
+DISTCLEANFILES = $(HTMLDOCS) $(DOCS) bind10-messages.xml
 
-.PHONY: bind10-messages.xml
+# This is not a "man" manual, but reuse this for now for docbook.
+if GENERATE_DOCS
 
 bind10-guide.html: bind10-guide.xml
-	xsltproc --novalid --xinclude --nonet \
+	@XSLTPROC@ --novalid --xinclude --nonet \
 		--path $(top_builddir)/doc \
 		-o $@ \
 		--stringparam section.autolabel 1 \
@@ -21,18 +24,23 @@ bind10-guide.html: bind10-guide.xml
 HTML2TXT = elinks -dump -no-numbering -no-references
 
 bind10-guide.txt: bind10-guide.html
-	$(HTML2TXT) $(srcdir)/bind10-guide.html > $@
+	$(HTML2TXT) bind10-guide.html > $@
 
 bind10-messages.html: bind10-messages.xml
-	xsltproc --novalid --xinclude --nonet \
+	@XSLTPROC@ --novalid --xinclude --nonet \
 		--path $(top_builddir)/doc \
 		-o $@ \
 		--stringparam html.stylesheet $(srcdir)/bind10-guide.css \
 		http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl \
-		$(srcdir)/bind10-messages.xml
+		bind10-messages.xml
 
-# So many dependencies that it's easiest just to regenerate it every time
 bind10-messages.xml:
 	$(PYTHON) $(top_srcdir)/tools/system_messages.py -o $@ $(top_srcdir)
 
+else
+
+$(HTMLDOCS) $(DOCS):
+	@echo Doc generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Doc generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
+
 endif

File diff suppressed because it is too large
+ 0 - 2070
doc/guide/bind10-guide.html


File diff suppressed because it is too large
+ 0 - 2156
doc/guide/bind10-guide.txt


+ 43 - 26
doc/guide/bind10-guide.xml

@@ -785,7 +785,7 @@ as a dependency earlier -->
   </chapter>
 
   <chapter id="bind10">
-    <title>Starting BIND10 with <command>bind10</command></title>
+    <title>Starting BIND 10 with <command>bind10</command></title>
     <para>
       BIND 10 provides the <command>bind10</command> command which
       starts up the required processes.
@@ -1633,6 +1633,17 @@ can use various data source backends.
               </simpara>
             </listitem>
           </varlistentry>
+          <varlistentry>
+            <term>tcp_recv_timeout</term>
+            <listitem>
+              <simpara>
+                <varname>tcp_recv_timeout</varname> is the timeout used on
+                incoming TCP connections, in milliseconds. If the query
+                is not sent within this time, the connection is closed.
+                Setting this to 0 will disable TCP timeouts completely.
+              </simpara>
+            </listitem>
+          </varlistentry>
         </variablelist>
 
       </para>
@@ -1735,7 +1746,7 @@ can use various data source backends.
       <para>
         Each data source has several options. The first one is
         <varname>type</varname>, which specifies the type of data source to
-        use. Valid types include the ones listed below, but bind10 uses
+        use. Valid types include the ones listed below, but BIND 10 uses
         dynamically loaded modules for them, so there may be more in your
         case. This option is mandatory.
       </para>
@@ -1754,8 +1765,14 @@ can use various data source backends.
         answering up. The first option is <varname>cache-enable</varname>,
         a boolean value turning the cache on and off (off is the default).
         The second one, <varname>cache-zones</varname>, is a list of zone
-        origins to load into in-memory. Remember that zones in the data source
-        not listed here will not be loaded and will not be available at all.
+        origins to load into in-memory.
+
+<!-- NOT YET:  http://bind10.isc.org/ticket/2240
+ Once the cache is enabled,
+        the zones in the data source not listed in
+        <varname>cache-zones</varname> will not be loaded and will
+        not be available at all.
+-->
       </para>
 
       <section id='datasource-types'>
@@ -1764,7 +1781,7 @@ can use various data source backends.
           As mentioned, the type used by default is <quote>sqlite3</quote>.
           It has single configuration option inside <varname>params</varname>
           &mdash; <varname>database_file</varname>, which contains the path
-          to the sqlite3 file containing the data.
+          to the SQLite3 file containing the data.
         </para>
 
         <para>
@@ -1781,7 +1798,7 @@ can use various data source backends.
       <section id='datasrc-examples'>
         <title>Examples</title>
         <para>
-          As this is one of the more complex configurations of Bind10,
+          As this is one of the more complex configurations of BIND 10,
           we show some examples. They all assume they start with default
           configuration.
         </para>
@@ -1807,7 +1824,7 @@ can use various data source backends.
 &gt; <userinput>config commit</userinput></screen>
 
           Now every time the zone in the data source is changed by the
-          operator, Bind10 needs to be told to reload it, by
+          operator, the authoritative server needs to be told to reload it, by
           <screen>&gt; <userinput>Auth loadzone example.org</userinput></screen>
           You don't need to do this when the zone is modified by
           XfrIn, it does so automatically.
@@ -1815,7 +1832,7 @@ can use various data source backends.
 
         <para>
           Now, the last example is when there are master files we want to
-          serve in addition to whatever is inside the sqlite3 database.
+          serve in addition to whatever is inside the SQLite3 database.
 
           <screen>&gt; <userinput>config add data_sources/classes/IN</userinput>
 &gt; <userinput>config set data_sources/classes/IN[1]/type MasterFiles</userinput>
@@ -1844,7 +1861,7 @@ can use various data source backends.
       <note>
       <para>
         There's also <varname>Auth/database_file</varname> configuration
-        variable, pointing to a sqlite3 database file. This is no longer
+        variable, pointing to a SQLite3 database file. This is no longer
         used by <command>b10-auth</command>, but it is left in place for
         now, since other modules use it. Once <command>b10-xfrin</command>,
         <command>b10-xfrout</command> and <command>b10-ddns</command>
@@ -2589,18 +2606,18 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
     be deployed that facilitate communication between servers and
     clients. Even though principles of both DHCPv4 and DHCPv6 are
     somewhat similar, these are two radically different
-    protocols. BIND10 offers server implementations for both DHCPv4
+    protocols. BIND 10 offers server implementations for both DHCPv4
     and DHCPv6. This chapter is about DHCP for IPv4. For a description
     of the DHCPv6 server, see <xref linkend="dhcp6"/>.</para>
 
     <para>The DHCPv4 server component is currently under intense
     development. You may want to check out <ulink
-    url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
+    url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
     and recent posts on <ulink
-    url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
+    url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
     developers mailing list</ulink>.</para>
 
-    <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
+    <para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
     internally code named <quote>Kea</quote>.</para>
 
     <note>
@@ -2618,7 +2635,7 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
 
     <section id="dhcp4-usage">
       <title>DHCPv4 Server Usage</title>
-      <para>BIND10 provides the DHCPv4 server component since December
+      <para>BIND 10 provides the DHCPv4 server component since December
       2011. It is a skeleton server and can be described as an early
       prototype that is not fully functional yet. It is mature enough
       to conduct first tests in lab environment, but it has
@@ -2627,9 +2644,9 @@ then change those defaults with config set Resolver/forward_addresses[0]/address
       </para>
 
       <para>
-        <command>b10-dhcp4</command> is a BIND10 component and is being
-        run under BIND10 framework. To add a DHCPv4 process to the set of running
-        BIND10 services, you can use following commands in <command>bindctl</command>:
+        <command>b10-dhcp4</command> is a BIND 10 component and is being
+        run under BIND 10 framework. To add a DHCPv4 process to the set of running
+        BIND 10 services, you can use following commands in <command>bindctl</command>:
         <screen>&gt; <userinput>config add Boss/components b10-dhcp4</userinput>
 &gt; <userinput>config set Boss/components/b10-dhcp4/kind dispensable</userinput>
 &gt; <userinput>config commit</userinput></screen></para>
@@ -2779,19 +2796,19 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
   <chapter id="dhcp6">
     <title>DHCPv6 Server</title>
     <para>Dynamic Host Configuration Protocol for IPv6 (DHCPv6) is
-    specified in RFC3315. BIND10 provides DHCPv6 server implementation
+    specified in RFC3315. BIND 10 provides DHCPv6 server implementation
     that is described in this chapter. For a description of the DHCPv4
     server implementation, see <xref linkend="dhcp4"/>.
     </para>
 
     <para>The DHCPv6 server component is currently under intense
     development. You may want to check out <ulink
-    url="http://bind10.isc.org/wiki/Kea">BIND10 DHCP (Kea) wiki</ulink>
+    url="http://bind10.isc.org/wiki/Kea">BIND 10 DHCP (Kea) wiki</ulink>
     and recent posts on <ulink
-    url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND10
+    url="https://lists.isc.org/mailman/listinfo/bind10-dev">BIND 10
     developers mailing list</ulink>.</para>
 
-    <para>The DHCPv4 and DHCPv6 components in BIND10 architecture are
+    <para>The DHCPv4 and DHCPv6 components in BIND 10 architecture are
     internally code named <quote>Kea</quote>.</para>
 
     <note>
@@ -2810,7 +2827,7 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
     <section id="dhcp6-usage">
       <title>DHCPv6 Server Usage</title>
       <para>
-        BIND10 provides the DHCPv6 server component since September
+        BIND 10 provides the DHCPv6 server component since September
         2011. It is a skeleton server and can be described as an early
         prototype that is not fully functional yet. It is mature
         enough to conduct first tests in lab environment, but it has
@@ -2819,9 +2836,9 @@ const std::string HARDCODED_SERVER_ID = "192.0.2.1";</screen>
       </para>
 
       <para>
-        <command>b10-dhcp6</command> is a BIND10 component and is being
-        run under BIND10 framework. To add a DHCPv6 process to the set of running
-        BIND10 services, you can use following commands in <command>bindctl</command>:
+        <command>b10-dhcp6</command> is a BIND 10 component and is being
+        run under BIND 10 framework. To add a DHCPv6 process to the set of running
+        BIND 10 services, you can use following commands in <command>bindctl</command>:
         <screen>&gt; <userinput>config add Boss/components b10-dhcp6</userinput>
 &gt; <userinput>config set Boss/components/b10-dhcp6/kind dispensable</userinput>
 &gt; <userinput>config commit</userinput></screen>
@@ -2988,7 +3005,7 @@ const std::string HARDCODED_DNS_SERVER = "2001:db8:1::1";</screen>
       <para>For non-Linux systems, there is currently stub
       implementation provided. Interface manager detects loopback
       interfaces only as their name (lo or lo0) can be easily predicted.
-      Please contact BIND10 development team if you are interested
+      Please contact the BIND 10 development team if you are interested
       in running DHCP components on systems other than Linux.</para>
     </section>
 

File diff suppressed because it is too large
+ 0 - 3303
doc/guide/bind10-messages.html


File diff suppressed because it is too large
+ 0 - 7116
doc/guide/bind10-messages.xml


+ 1 - 0
src/bin/auth/.gitignore

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

+ 9 - 2
src/bin/auth/Makefile.am

@@ -20,12 +20,19 @@ CLEANFILES  = *.gcno *.gcda auth.spec spec_config.h
 CLEANFILES += auth_messages.h auth_messages.cc
 
 man_MANS = b10-auth.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-auth.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-auth.8: b10-auth.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-auth.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 5 - 0
src/bin/auth/auth.spec.pre.in

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

+ 25 - 0
src/bin/auth/auth_config.cc

@@ -116,6 +116,29 @@ private:
      */
     AddrListPtr rollbackAddresses_;
 };
+
+/// \brief Configuration for TCP receive timeouts
+class TCPRecvTimeoutConfig : public AuthConfigParser {
+public:
+    TCPRecvTimeoutConfig(AuthSrv& server) : server_(server), timeout_(0)
+    {}
+
+    virtual void build(ConstElementPtr config) {
+        if (config->intValue() >= 0) {
+            timeout_ = config->intValue();
+        } else {
+            isc_throw(AuthConfigError, "tcp_recv_timeout must be 0 or higher");
+        }
+    }
+
+    virtual void commit() {
+        server_.setTCPRecvTimeout(timeout_);
+    }
+private:
+    AuthSrv& server_;
+    size_t timeout_;
+};
+
 } // end of unnamed namespace
 
 AuthConfigParser*
@@ -147,6 +170,8 @@ createAuthConfigParser(AuthSrv& server, const std::string& config_id) {
         // We need to return something. The VersionConfig is empty now,
         // so we may abuse that one, as it is a short-term solution only.
         return (new VersionConfig());
+    } else if (config_id == "tcp_recv_timeout") {
+        return (new TCPRecvTimeoutConfig(server));
     } else {
         isc_throw(AuthConfigError, "Unknown configuration identifier: " <<
                   config_id);

+ 22 - 0
src/bin/auth/auth_srv.cc

@@ -114,6 +114,18 @@ private:
     MessageRenderer& renderer_;
 };
 
+// Similar to Renderer holder, this is a very basic RAII-style class
+// that calls clear(Message::PARSE) on the given Message upon destruction
+class MessageHolder {
+public:
+    MessageHolder(Message& message) : message_(message) {}
+    ~MessageHolder() {
+        message_.clear(Message::PARSE);
+    }
+private:
+    Message& message_;
+};
+
 // A helper container of socket session forwarder.
 //
 // This class provides a simple wrapper interface to SocketSessionForwarder
@@ -344,6 +356,11 @@ public:
                             OutputBufferPtr buffer,
                             DNSServer* server) const
     {
+        // Keep a holder on the message, so that it is automatically
+        // cleared if processMessage() is done
+        // This is not done in processMessage itself (which would be
+        // equivalent), to allow tests to inspect the message handling.
+        MessageHolder message_holder(*message);
         server_->processMessage(io_message, *message, *buffer, server);
     }
 private:
@@ -927,3 +944,8 @@ AuthSrv::getClientListClasses() const {
     }
     return (result);
 }
+
+void
+AuthSrv::setTCPRecvTimeout(size_t timeout) {
+    dnss_->setTCPRecvTimeout(timeout);
+}

+ 10 - 0
src/bin/auth/auth_srv.h

@@ -319,6 +319,16 @@ public:
     ///     has been set by setClientList.
     std::vector<isc::dns::RRClass> getClientListClasses() const;
 
+    /// \brief Sets the timeout for incoming TCP connections
+    ///
+    /// Incoming TCP connections that have not sent their data
+    /// withing this time are dropped.
+    ///
+    /// \param timeout The timeout (in milliseconds). If se to
+    /// zero, no timeouts are used, and the connection will remain
+    /// open forever.
+    void setTCPRecvTimeout(size_t timeout);
+
 private:
     AuthSrvImpl* impl_;
     isc::asiolink::SimpleCallback* checkin_;

+ 0 - 213
src/bin/auth/b10-auth.8

@@ -1,213 +0,0 @@
-'\" t
-.\"     Title: b10-auth
-.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\"      Date: June 20, 2012
-.\"    Manual: BIND10
-.\"    Source: BIND10
-.\"  Language: English
-.\"
-.TH "B10\-AUTH" "8" "June 20, 2012" "BIND10" "BIND10"
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-b10-auth \- Authoritative DNS server
-.SH "SYNOPSIS"
-.HP \w'\fBb10\-auth\fR\ 'u
-\fBb10\-auth\fR [\fB\-v\fR]
-.SH "DESCRIPTION"
-.PP
-The
-\fBb10\-auth\fR
-daemon provides the BIND 10 authoritative DNS server\&. Normally it is started by the
-\fBbind10\fR(8)
-boss process\&.
-.PP
-This daemon communicates with other BIND 10 components over a
-\fBb10-msgq\fR(8)
-C\-Channel connection\&. If this connection is not established,
-\fBb10\-auth\fR
-will exit\&.
-It receives its configurations from
-\fBb10-cfgmgr\fR(8)\&.
-.SH "OPTIONS"
-.PP
-The arguments are as follows:
-.PP
-\fB\-v\fR
-.RS 4
-Enable verbose logging mode\&. This enables logging of diagnostic messages at the maximum debug level\&.
-.RE
-.SH "CONFIGURATION AND COMMANDS"
-.PP
-The configurable settings are:
-.PP
-
-\fIdatabase_file\fR
-defines the path to the SQLite3 zone file when using the sqlite datasource\&. The default is
-/usr/local/var/bind10\-devel/zone\&.sqlite3\&.
-.PP
-
-\fIdatasources\fR
-configures data sources\&. The list items include:
-\fItype\fR
-to define the required data source type (such as
-\(lqmemory\(rq);
-\fIclass\fR
-to optionally select the class (it defaults to
-\(lqIN\(rq); and
-\fIzones\fR
-to define the
-\fIfile\fR
-path name,
-\fIorigin\fR
-(default domain), and optional
-\fIfiletype\fR\&. By default,
-\fIzones\fR
-is empty\&. For the in\-memory data source (i\&.e\&., the
-\fItype\fR
-is
-\(lqmemory\(rq), the optional
-\fIfiletype\fR
-configuration item for
-\fIzones\fR
-can be specified so the in\-memory zone data can be built from another data source that is based on a database backend (in practice with current implementation, it would be an SQLite3 database file for the SQLite3 data source)\&. See the
-BIND 10 Guide
-for configuration details\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.sp
-Only the IN class is supported at this time\&. By default, the memory data source is disabled\&. Also, currently the zone file must be canonical such as generated by \fBnamed\-compilezone \-D\fR\&.
-.sp .5v
-.RE
-.PP
-
-\fIlisten_on\fR
-is a list of addresses and ports for
-\fBb10\-auth\fR
-to listen on\&. The list items are the
-\fIaddress\fR
-string and
-\fIport\fR
-number\&. By default,
-\fBb10\-auth\fR
-listens on port 53 on the IPv6 (::) and IPv4 (0\&.0\&.0\&.0) wildcard addresses\&.
-.PP
-
-\fIstatistics\-interval\fR
-is the timer interval in seconds for
-\fBb10\-auth\fR
-to share its statistics information to
-\fBb10-stats\fR(8)\&. Statistics updates can be disabled by setting this to 0\&. The default is 60\&.
-.PP
-The configuration commands are:
-.PP
-
-\fBloadzone\fR
-tells
-\fBb10\-auth\fR
-to load or reload a zone file\&. The arguments include:
-\fIclass\fR
-which optionally defines the class (it defaults to
-\(lqIN\(rq);
-\fIorigin\fR
-is the domain name of the zone; and
-\fIdatasrc\fR
-optionally defines the type of datasource (it defaults to
-\(lqmemory\(rq)\&.
-.if n \{\
-.sp
-.\}
-.RS 4
-.it 1 an-trap
-.nr an-no-space-flag 1
-.nr an-break-flag 1
-.br
-.ps +1
-\fBNote\fR
-.ps -1
-.br
-.sp
-In this development version, currently this only supports the IN class and the memory data source\&.
-.sp .5v
-.RE
-.PP
-
-\fBsendstats\fR
-tells
-\fBb10\-auth\fR
-to send its statistics data to
-\fBb10-stats\fR(8)
-immediately\&.
-.PP
-
-\fBshutdown\fR
-exits
-\fBb10\-auth\fR\&. This has an optional
-\fIpid\fR
-argument to select the process ID to stop\&. (Note that the BIND 10 boss process may restart this service if configured\&.)
-.SH "STATISTICS DATA"
-.PP
-The statistics data collected by the
-\fBb10\-stats\fR
-daemon for
-\(lqAuth\(rq
-include:
-.PP
-queries\&.tcp
-.RS 4
-Total count of queries received by the
-\fBb10\-auth\fR
-server over TCP since startup\&.
-.RE
-.PP
-queries\&.udp
-.RS 4
-Total count of queries received by the
-\fBb10\-auth\fR
-server over UDP since startup\&.
-.RE
-.SH "FILES"
-.PP
-
-/usr/local/var/bind10\-devel/zone\&.sqlite3
-\(em Location for the SQLite3 zone database when
-\fIdatabase_file\fR
-configuration is not defined\&.
-.SH "SEE ALSO"
-.PP
-
-\fBb10-cfgmgr\fR(8),
-\fBb10-loadzone\fR(8),
-\fBb10-msgq\fR(8),
-\fBb10-stats\fR(8),
-\fBb10-zonemgr\fR(8),
-\fBbind10\fR(8),
-BIND 10 Guide\&.
-.SH "HISTORY"
-.PP
-The
-\fBb10\-auth\fR
-daemon was first coded in October 2009\&.
-.SH "COPYRIGHT"
-.br
-Copyright \(co 2010-2012 Internet Systems Consortium, Inc. ("ISC")
-.br

+ 7 - 0
src/bin/auth/b10-auth.xml

@@ -152,6 +152,13 @@
       The default is 60.
     </para>
 
+    <para>
+      <varname>tcp_recv_timeout</varname> is the timeout used on
+      incoming TCP connections, in milliseconds. If the query
+      is not sent within this time, the connection is closed.
+      Setting this to 0 will disable TCP timeouts completely.
+    </para>
+
 <!-- TODO: formating -->
     <para>
       The configuration commands are:

+ 1 - 1
src/bin/auth/command.cc

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

+ 1 - 2
src/bin/auth/query.cc

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

+ 3 - 4
src/bin/auth/tests/auth_srv_unittest.cc

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

+ 22 - 4
src/bin/auth/tests/config_syntax_unittest.cc

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

+ 13 - 0
src/bin/auth/tests/config_unittest.cc

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

+ 1 - 0
src/bin/bind10/.gitignore

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

+ 16 - 2
src/bin/bind10/Makefile.am

@@ -17,12 +17,26 @@ bind10_DATA = bob.spec
 EXTRA_DIST = bob.spec
 
 man_MANS = bind10.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST += $(man_MANS) bind10.xml bind10_messages.mes
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 bind10.8: bind10.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml 
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bind10.xml 
+
+#dist-local-check-mans-enabled:
+#	@if grep "Man generation disabled" $(man_MANS) >/dev/null; then $(RM) $(man_MANS); fi
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
+
+#dist-local-check-mans-enabled:
+#	@echo "*** --enable-generate-docs must be used in order to make dist"
+#	@false
 
 endif
 

File diff suppressed because it is too large
+ 0 - 288
src/bin/bind10/bind10.8


+ 1 - 0
src/bin/bindctl/.gitignore

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

+ 9 - 2
src/bin/bindctl/Makefile.am

@@ -14,11 +14,18 @@ pythondir = $(pyexecdir)/bindctl
 bindctldir = $(pkgdatadir)
 
 CLEANFILES = bindctl bindctl_main.pyc
+DISTCLEANFILES = $(man_MANS)
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 bindctl.1: bindctl.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/bindctl.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 157
src/bin/bindctl/bindctl.1

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

+ 1 - 0
src/bin/cfgmgr/.gitignore

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

+ 9 - 2
src/bin/cfgmgr/Makefile.am

@@ -10,12 +10,19 @@ b10_cfgmgrdir = @localstatedir@/@PACKAGE@
 #B10_cfgmgr_DATA = 
 
 man_MANS = b10-cfgmgr.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-cfgmgr.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-cfgmgr.8: b10-cfgmgr.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cfgmgr.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 82
src/bin/cfgmgr/b10-cfgmgr.8

@@ -1,82 +0,0 @@
-'\" t
-.\"     Title: b10-cfgmgr
-.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
-.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
-.\"      Date: June 20, 2012
-.\"    Manual: BIND10
-.\"    Source: BIND10
-.\"  Language: English
-.\"
-.TH "B10\-CFGMGR" "8" "June 20, 2012" "BIND10" "BIND10"
-.\" -----------------------------------------------------------------
-.\" * set default formatting
-.\" -----------------------------------------------------------------
-.\" disable hyphenation
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.\" * MAIN CONTENT STARTS HERE *
-.\" -----------------------------------------------------------------
-.SH "NAME"
-b10-cfgmgr \- Configuration manager
-.SH "SYNOPSIS"
-.HP \w'\fBb10\-cfgmgr\fR\ 'u
-\fBb10\-cfgmgr\fR [\fB\-c\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-p\ \fR\fB\fIdata_path\fR\fR] [\fB\-\-clear\-config\fR] [\fB\-\-config\-filename\ \fR\fB\fIconfig\-filename\fR\fR] [\fB\-\-data\-path\ \fR\fB\fIdata_path\fR\fR]
-.SH "DESCRIPTION"
-.PP
-The
-\fBb10\-cfgmgr\fR
-daemon handles all BIND 10 system configuration\&. It provides persistent storage for configuration, and notifies running BIND 10 modules of configuration changes\&.
-.PP
-The
-\fBbindctl\fR
-can be used to talk to this configuration manager via a
-\fBb10\-cmdctl\fR
-connection\&.
-.PP
-This daemon communicates over a
-\fBb10\-msgq\fR
-C\-Channel connection\&. If this connection is not established,
-\fBb10\-cfgmgr\fR
-will exit\&.
-.PP
-The daemon may be cleanly stopped by sending the SIGTERM signal to the process\&. This shutdown does not notify the subscribers\&.
-.SH "ARGUMENTS"
-.PP
-The arguments are as follows:
-.PP
-\fB\-\-clear\-config\fR
-.RS 4
-This will create a backup of the existing configuration file, remove it, and
-b10\-cfgmgr(8)
-will use the default configurations\&. The name of the backup file can be found in the logs (\fICFGMGR_BACKED_UP_CONFIG_FILE\fR)\&. (It will append a number to the backup filename if a previous backup file exists\&.)
-.RE
-.PP
-\fB\-c\fR \fIconfig\-filename\fR, \fB\-\-config\-filename\fR \fIconfig\-filename\fR
-.RS 4
-The configuration database filename to use\&. Can be either absolute or relative to data path\&. It defaults to "b10\-config\&.db"\&.
-.RE
-.PP
-\fB\-p\fR \fIdata\-path\fR, \fB\-\-data\-path\fR \fIdata\-path\fR
-.RS 4
-The path where BIND 10 looks for files\&. The configuration file is looked for here, if it is relative\&. If it is absolute, the path is ignored\&.
-.RE
-.SH "FILES"
-.PP
-/usr/local/var/bind10\-devel/b10\-config\&.db
-\(em Configuration storage file\&.
-.SH "SEE ALSO"
-.PP
-
-\fBbind10\fR(8),
-\fBmsgq\fR(8)\&.
-.SH "HISTORY"
-.PP
-The
-\fBb10\-cfgmgr\fR
-daemon and configuration specification were initially designed by Jelte Jansen of ISC\&. Its development began in October 2009\&.
-.SH "COPYRIGHT"
-.br
-Copyright \(co 2010 Internet Systems Consortium, Inc. ("ISC")
-.br

+ 1 - 0
src/bin/cmdctl/.gitignore

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

+ 9 - 2
src/bin/cmdctl/Makefile.am

@@ -26,12 +26,19 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.py
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/cmdctl_messages.pyc
 
 man_MANS = b10-cmdctl.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST += $(man_MANS) b10-cmdctl.xml cmdctl_messages.mes
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-cmdctl.8: b10-cmdctl.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 133
src/bin/cmdctl/b10-cmdctl.8

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

+ 1 - 0
src/bin/dbutil/.gitignore

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

+ 9 - 2
src/bin/dbutil/Makefile.am

@@ -14,11 +14,18 @@ CLEANFILES = b10-dbutil b10-dbutil.pyc
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.py
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyc
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/dbutil_messages.pyo
+DISTCLEANFILES = $(man_MANS)
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-dbutil.8: b10-dbutil.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-dbutil.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

File diff suppressed because it is too large
+ 0 - 89
src/bin/dbutil/b10-dbutil.8


+ 1 - 0
src/bin/ddns/.gitignore

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

+ 10 - 2
src/bin/ddns/Makefile.am

@@ -15,13 +15,21 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.py
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/ddns_messages.pyc
 
 EXTRA_DIST =  ddns_messages.mes ddns.spec
+
 man_MANS = b10-ddns.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST += $(man_MANS) b10-ddns.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-ddns.8: b10-ddns.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-ddns.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 115
src/bin/ddns/b10-ddns.8

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

+ 1 - 0
src/bin/dhcp4/.gitignore

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

+ 23 - 6
src/bin/dhcp4/Makefile.am

@@ -12,26 +12,43 @@ endif
 
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
-CLEANFILES = spec_config.h
+CLEANFILES  = *.gcno *.gcda spec_config.h dhcp4_messages.h dhcp4_messages.cc
 
 man_MANS = b10-dhcp4.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-dhcp4.xml dhcp4.spec
 
-if ENABLE_MAN
+if GENERATE_DOCS
 b10-dhcp4.8: b10-dhcp4.xml
-	xsltproc --novalid --xinclude --nonet -o $@ \
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ \
         http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \
 	$(srcdir)/b10-dhcp4.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
+
 endif
 
 spec_config.h: spec_config.h.pre
 	$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@
 
-BUILT_SOURCES = spec_config.h
+dhcp4_messages.h dhcp4_messages.cc: dhcp4_messages.mes
+	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp4/dhcp4_messages.mes
+
+BUILT_SOURCES = spec_config.h dhcp4_messages.h dhcp4_messages.cc
+
 pkglibexec_PROGRAMS = b10-dhcp4
 
-b10_dhcp4_SOURCES = main.cc dhcp4_srv.cc dhcp4_srv.h
+b10_dhcp4_SOURCES  = main.cc
 b10_dhcp4_SOURCES += ctrl_dhcp4_srv.cc ctrl_dhcp4_srv.h
+b10_dhcp4_SOURCES += dhcp4_log.cc dhcp4_log.h
+b10_dhcp4_SOURCES += dhcp4_srv.cc dhcp4_srv.h
+
+nodist_b10_dhcp4_SOURCES = dhcp4_messages.h dhcp4_messages.cc
+EXTRA_DIST += dhcp4_messages.mes
 
 if USE_CLANGPP
 # Disable unused parameter warning caused by some of the
@@ -39,7 +56,7 @@ if USE_CLANGPP
 b10_dhcp4_CXXFLAGS = -Wno-unused-parameter
 endif
 
-b10_dhcp4_LDADD = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
+b10_dhcp4_LDADD  = $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libb10-log.la

+ 0 - 60
src/bin/dhcp4/b10-dhcp4.8

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

+ 23 - 20
src/bin/dhcp4/ctrl_dhcp4_srv.cc

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

+ 26 - 0
src/bin/dhcp4/dhcp4_log.cc

@@ -0,0 +1,26 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+/// Defines the logger used by the top-level component of b10-dhcp4.
+
+#include "dhcp4_log.h"
+
+namespace isc {
+namespace dhcp {
+
+isc::log::Logger dhcp4_logger("dhcp4");
+
+} // namespace dhcp
+} // namespace isc
+

+ 59 - 0
src/bin/dhcp4/dhcp4_log.h

@@ -0,0 +1,59 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __DHCP4_LOG__H
+#define __DHCP4_LOG__H
+
+#include <log/macros.h>
+#include <log/logger_support.h>
+#include <dhcp4/dhcp4_messages.h>
+
+namespace isc {
+namespace dhcp {
+
+/// \brief DHCP4 Logging
+///
+/// Defines the levels used to output debug messages in the non-library part of
+/// the b10-dhcp4 program.  Higher numbers equate to more verbose (and detailed)
+/// output.
+
+// Debug levels used to log information during startup and shutdown.
+const int DBG_DHCP4_START = DBGLVL_START_SHUT;
+const int DBG_DHCP4_SHUT = DBGLVL_START_SHUT;
+
+// Debug level used to log setting information (such as configuration changes).
+const int DBG_DHCP4_COMMAND = DBGLVL_COMMAND;
+
+// Trace basic operations within the code.
+const int DBG_DHCP4_BASIC = DBGLVL_TRACE_BASIC;
+
+// Trace detailed operations, including errors raised when processing invalid
+// packets.  (These are not logged at severities of WARN or higher for fear
+// that a set of deliberately invalid packets set to the server could overwhelm
+// the logging.)
+const int DBG_DHCP4_DETAIL = DBGLVL_TRACE_DETAIL;
+
+// This level is used to log the contents of packets received and sent.
+const int DBG_DHCP4_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+
+/// Define the logger for the "dhcp4" module part of b10-dhcp4.  We could define
+/// a logger in each file, but we would want to define a common name to avoid
+/// spelling mistakes, so it is just one small step from there to define a
+/// module-common logger.
+extern isc::log::Logger dhcp4_logger;
+
+} // namespace dhcp4
+} // namespace isc
+
+#endif // __DHCP4_LOG__H

+ 98 - 0
src/bin/dhcp4/dhcp4_messages.mes

@@ -0,0 +1,98 @@
+# Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+$NAMESPACE isc::dhcp
+
+% DHCP4_CCSESSION_STARTED control channel session started on socket %1
+A debug message issued during startup after the IPv4 DHCP server has
+successfully established a session with the BIND 10 control channel.
+
+% DHCP4_CCSESSION_STARTING starting control channel session, specfile: %1
+This debug message is issued just before the IPv4 DHCP server attempts
+to establish a session with the BIND 10 control channel.
+
+% DHCP4_COMMAND_RECEIVED received command %1, arguments: %2
+A debug message listing the command (and possible arguments) received
+from the BIND 10 control system by the IPv4 DHCP server.
+
+% DHCP4_CONFIG_UPDATE updated configuration received: %1
+A debug message indicating that the IPv4 DHCP server has received an
+updated configuration from the BIND 10 configuration system.
+
+% DHCP4_NOT_RUNNING IPv4 DHCP server is not running
+A warning message is issued when an attempt is made to shut down the
+IPv4 DHCP server but it is not running.
+
+% DHCP4_OPEN_SOCKET opening sockets on port %1
+A debug message issued during startup, this indicates that the IPv4 DHCP
+server is about to open sockets on the specified port.
+
+% DHCP4_PACKET_PARSE_FAIL failed to parse incoming packet: %1
+The IPv4 DHCP server has received a packet that it is unable to
+interpret. The reason why the packet is invalid is included in the message.
+
+% DHCP4_PACKET_RECEIVED %1 (type %2) packet received on interface %3
+A debug message noting that the server has received the specified type of
+packet on the specified interface.  Note that a packet marked as UNKNOWN
+may well be a valid DHCP packet, just a type not expected by the server
+(e.g. it will report a received OFFER packet as UNKNOWN).
+
+% DHCP4_PACK_FAIL failed to assemble response correctly
+This error is output if the server failed to assemble the data to be
+returned to the client into a valid packet.  The cause is most likely
+to be a programming error: please raise a bug report.
+
+% DHCP4_QUERY_DATA received packet type %1, data is <%2>
+A debug message listing the data received from the client.
+
+% DHCP4_RESPONSE_DATA responding with packet type %1, data is <%2>
+A debug message listing the data returned to the client.
+
+% DHCP4_SERVER_FAILED server failed: %1
+The IPv4 DHCP server has encountered a fatal error and is terminating.
+The reason for the failure is included in the message.
+
+% DHCP4_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone
+The server has failed to establish communication with the rest of BIND
+10 and is running in stand-alone mode.  (This behavior will change once
+the IPv4 DHCP server is properly integrated with the rest of BIND 10.)
+
+% DHCP4_SHUTDOWN server shutdown
+The IPv4 DHCP server has terminated normally.
+
+% DHCP4_SHUTDOWN_REQUEST shutdown of server requested
+This debug message indicates that a shutdown of the IPv4 server has
+been requested via a call to the 'shutdown' method of the core Dhcpv4Srv
+object.
+
+% DHCP4_SRV_CONSTRUCT_ERROR error creating Dhcpv4Srv object, reason: %1
+This error message indicates that during startup, the construction of a
+core component within the IPv4 DHCP server (the Dhcpv4 server object)
+has failed.  As a result, the server will exit.  The reason for the
+failure is given within the message.
+
+% DHCP4_STANDALONE skipping message queue, running standalone
+This is a debug message indicating that the IPv4 server is running in
+standalone mode, not connected to the message queue.  Standalone mode
+is only useful during program development, and should not be used in a
+production environment.
+
+% DHCP4_STARTING server starting
+This informational message indicates that the IPv4 DHCP server has
+processed any command-line switches and is starting.
+
+% DHCP4_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4
+This is a debug message issued during the IPv4 DHCP server startup.
+It lists some information about the parameters with which the server
+is running.

+ 66 - 27
src/bin/dhcp4/dhcp4_srv.cc

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

+ 21 - 4
src/bin/dhcp4/dhcp4_srv.h

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

+ 29 - 31
src/bin/dhcp4/main.cc

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

+ 2 - 0
src/bin/dhcp4/tests/Makefile.am

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

+ 33 - 1
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

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

+ 29 - 27
src/bin/dhcp4/tests/dhcp4_test.py

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

+ 1 - 0
src/bin/dhcp6/.gitignore

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

+ 23 - 6
src/bin/dhcp6/Makefile.am

@@ -13,27 +13,44 @@ endif
 
 pkglibexecdir = $(libexecdir)/@PACKAGE@
 
-CLEANFILES = spec_config.h
+CLEANFILES = spec_config.h dhcp6_messages.h dhcp6_messages.cc
 
 man_MANS = b10-dhcp6.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-dhcp6.xml dhcp6.spec
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-dhcp6.8: b10-dhcp6.xml
-	xsltproc --novalid --xinclude --nonet -o $@ \
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ \
         http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl \
         $(srcdir)/b10-dhcp6.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
+
 endif
 
 spec_config.h: spec_config.h.pre
 	$(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@
 
-BUILT_SOURCES = spec_config.h
+dhcp6_messages.h dhcp6_messages.cc: dhcp6_messages.mes
+	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/dhcp6/dhcp6_messages.mes
+
+BUILT_SOURCES = spec_config.h dhcp6_messages.h dhcp6_messages.cc
+
 pkglibexec_PROGRAMS = b10-dhcp6
 
-b10_dhcp6_SOURCES = main.cc dhcp6_srv.cc dhcp6_srv.h
+b10_dhcp6_SOURCES  = main.cc
 b10_dhcp6_SOURCES += ctrl_dhcp6_srv.cc ctrl_dhcp6_srv.h
+b10_dhcp6_SOURCES += dhcp6_log.cc dhcp6_log.h
+b10_dhcp6_SOURCES += dhcp6_srv.cc dhcp6_srv.h
+
+nodist_b10_dhcp6_SOURCES = dhcp6_messages.h dhcp6_messages.cc
+EXTRA_DIST += dhcp6_messages.mes
 
 if USE_CLANGPP
 # Disable unused parameter warning caused by some of the
@@ -41,7 +58,7 @@ if USE_CLANGPP
 b10_dhcp6_CXXFLAGS = -Wno-unused-parameter
 endif
 
-b10_dhcp6_LDADD = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
+b10_dhcp6_LDADD  = $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
 b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcp/libb10-dhcp++.la

+ 0 - 51
src/bin/dhcp6/b10-dhcp6.8

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

+ 23 - 20
src/bin/dhcp6/ctrl_dhcp6_srv.cc

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

+ 26 - 0
src/bin/dhcp6/dhcp6_log.cc

@@ -0,0 +1,26 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+/// Defines the logger used by the top-level component of b10-dhcp6.
+
+#include "dhcp6_log.h"
+
+namespace isc {
+namespace dhcp {
+
+isc::log::Logger dhcp6_logger("dhcp6");
+
+} // namespace dhcp
+} // namespace isc
+

+ 59 - 0
src/bin/dhcp6/dhcp6_log.h

@@ -0,0 +1,59 @@
+// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __DHCP6_LOG__H
+#define __DHCP6_LOG__H
+
+#include <log/macros.h>
+#include <log/logger_support.h>
+#include <dhcp6/dhcp6_messages.h>
+
+namespace isc {
+namespace dhcp {
+
+/// \brief DHCP6 Logging
+///
+/// Defines the levels used to output debug messages in the non-library part of
+/// the b10-dhcp6 program.  Higher numbers equate to more verbose (and detailed)
+/// output.
+
+// Debug levels used to log information during startup and shutdown.
+const int DBG_DHCP6_START = DBGLVL_START_SHUT;
+const int DBG_DHCP6_SHUT = DBGLVL_START_SHUT;
+
+// Debug level used to log setting information (such as configuration changes).
+const int DBG_DHCP6_COMMAND = DBGLVL_COMMAND;
+
+// Trace basic operations within the code.
+const int DBG_DHCP6_BASIC = DBGLVL_TRACE_BASIC;
+
+// Trace detailed operations, including errors raised when processing invalid
+// packets.  (These are not logged at severities of WARN or higher for fear
+// that a set of deliberately invalid packets set to the server could overwhelm
+// the logging.)
+const int DBG_DHCP6_DETAIL = DBGLVL_TRACE_DETAIL;
+
+// This level is used to log the contents of packets received and sent.
+const int DBG_DHCP6_DETAIL_DATA = DBGLVL_TRACE_DETAIL_DATA;
+
+/// Define the logger for the "dhcp6" module part of b10-dhcp6.  We could define
+/// a logger in each file, but we would want to define a common name to avoid
+/// spelling mistakes, so it is just one small step from there to define a
+/// module-common logger.
+extern isc::log::Logger dhcp6_logger;
+
+} // namespace dhcp6
+} // namespace isc
+
+#endif // __DHCP6_LOG__H

+ 101 - 0
src/bin/dhcp6/dhcp6_messages.mes

@@ -0,0 +1,101 @@
+# Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+$NAMESPACE isc::dhcp
+
+% DHCP6_CCSESSION_STARTED control channel session started on socket %1
+A debug message issued during startup after the IPv6 DHCP server has
+successfully established a session with the BIND 10 control channel.
+
+% DHCP6_CCSESSION_STARTING starting control channel session, specfile: %1
+This debug message is issued just before the IPv6 DHCP server attempts
+to establish a session with the BIND 10 control channel.
+
+% DHCP6_COMMAND_RECEIVED received command %1, arguments: %2
+A debug message listing the command (and possible arguments) received
+from the BIND 10 control system by the IPv6 DHCP server.
+
+% DHCP6_CONFIG_UPDATE updated configuration received: %1
+A debug message indicating that the IPv6 DHCP server has received an
+updated configuration from the BIND 10 configuration system.
+
+% DHCP6_NOT_RUNNING IPv6 DHCP server is not running
+A warning message is issued when an attempt is made to shut down the
+IPv6 DHCP server but it is not running.
+
+% DHCP6_NO_INTERFACES failed to detect any network interfaces
+During startup the IPv6 DHCP server failed to detect any network
+interfaces and is therefore shutting down.
+
+% DHCP6_OPEN_SOCKET opening sockets on port %1
+A debug message issued during startup, this indicates that the IPv6 DHCP
+server is about to open sockets on the specified port.
+
+% DHCP6_PACKET_PARSE_FAIL failed to parse incoming packet
+The IPv6 DHCP server has received a packet that it is unable to interpret.
+
+% DHCP6_PACKET_RECEIVED %1 (type %2) packet received
+A debug message noting that the server has received the specified type
+of packet.  Note that a packet marked as UNKNOWN may well be a valid
+DHCP packet, just a type not expected by the server (e.g. it will report
+a received OFFER packet as UNKNOWN).
+
+% DHCP6_PACK_FAIL failed to assemble response correctly
+This error is output if the server failed to assemble the data to be
+returned to the client into a valid packet.  The reason is most likely
+to be to a programming error: please raise a bug report.
+
+% DHCP6_QUERY_DATA received packet length %1, data length %2, data is <%3>
+A debug message listing the data received from the client or relay.
+
+% DHCP6_RESPONSE_DATA responding with packet type %1 data is <%2>
+A debug message listing the data returned to the client.
+
+% DHCP6_SERVER_FAILED server failed: %1
+The IPv6 DHCP server has encountered a fatal error and is terminating.
+The reason for the failure is included in the message.
+
+% DHCP6_SESSION_FAIL failed to establish BIND 10 session (%1), running stand-alone
+The server has failed to establish communication with the rest of BIND
+10 and is running in stand-alone mode.  (This behavior will change once
+the IPv6 DHCP server is properly integrated with the rest of BIND 10.)
+
+% DHCP6_SHUTDOWN server shutdown
+The IPv6 DHCP server has terminated normally.
+
+% DHCP6_SHUTDOWN_REQUEST shutdown of server requested
+This debug message indicates that a shutdown of the IPv6 server has
+been requested via a call to the 'shutdown' method of the core Dhcpv6Srv
+object.
+
+% DHCP6_SRV_CONSTRUCT_ERROR error creating Dhcpv6Srv object, reason: %1
+This error message indicates that during startup, the construction of a
+core component within the IPv6 DHCP server (the Dhcpv6 server object)
+has failed.  As a result, the server will exit.  The reason for the
+failure is given within the message.
+
+% DHCP6_STANDALONE skipping message queue, running standalone
+This is a debug message indicating that the IPv6 server is running in
+standalone mode, not connected to the message queue.  Standalone mode
+is only useful during program development, and should not be used in a
+production environment.
+
+% DHCP6_STARTING server starting
+This informational message indicates that the IPv6 DHCP server has
+processed any command-line switches and is starting.
+
+% DHCP6_START_INFO pid: %1, port: %2, verbose: %3, standalone: %4
+This is a debug message issued during the IPv6 DHCP server startup.
+It lists some information about the parameters with which the server
+is running.

+ 88 - 27
src/bin/dhcp6/dhcp6_srv.cc

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

+ 18 - 0
src/bin/dhcp6/dhcp6_srv.h

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

+ 27 - 31
src/bin/dhcp6/main.cc

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

+ 5 - 2
src/bin/dhcp6/tests/Makefile.am

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

+ 46 - 1
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc

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

+ 28 - 25
src/bin/dhcp6/tests/dhcp6_test.py

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

+ 1 - 0
src/bin/host/.gitignore

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

+ 9 - 2
src/bin/host/Makefile.am

@@ -17,14 +17,21 @@ b10_host_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
 b10_host_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
 
 man_MANS = b10-host.1
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-host.xml
 
 .PHONY: man
-if ENABLE_MAN
+if GENERATE_DOCS
 
 man: b10-host.1
 
 b10-host.1: b10-host.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-host.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif

+ 0 - 118
src/bin/host/b10-host.1

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

+ 1 - 0
src/bin/loadzone/.gitignore

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

+ 9 - 2
src/bin/loadzone/Makefile.am

@@ -5,12 +5,19 @@ noinst_SCRIPTS = run_loadzone.sh
 CLEANFILES = b10-loadzone
 
 man_MANS = b10-loadzone.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-loadzone.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-loadzone.8: b10-loadzone.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-loadzone.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 80
src/bin/loadzone/b10-loadzone.8

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

+ 1 - 0
src/bin/loadzone/tests/correct/Makefile.am

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

+ 8 - 0
src/bin/loadzone/tests/correct/comment.db

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

+ 4 - 0
src/bin/loadzone/tests/correct/correct_test.sh.in

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

+ 1 - 1
src/bin/loadzone/tests/correct/get_zonedatas.py

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

+ 6 - 0
src/bin/loadzone/tests/correct/known.test.out

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

+ 1 - 0
src/bin/msgq/.gitignore

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

+ 9 - 2
src/bin/msgq/Makefile.am

@@ -7,12 +7,19 @@ pkglibexec_SCRIPTS = b10-msgq
 CLEANFILES = b10-msgq msgq.pyc
 
 man_MANS = b10-msgq.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) msgq.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-msgq.8: msgq.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/msgq.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 125
src/bin/msgq/b10-msgq.8

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

+ 1 - 0
src/bin/resolver/.gitignore

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

+ 9 - 2
src/bin/resolver/Makefile.am

@@ -23,12 +23,19 @@ CLEANFILES += resolver.spec spec_config.h
 CLEANFILES += resolver_messages.cc resolver_messages.h
 
 man_MANS = b10-resolver.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-resolver.xml resolver_messages.mes
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-resolver.8: b10-resolver.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-resolver.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 149
src/bin/resolver/b10-resolver.8

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

+ 1 - 0
src/bin/sockcreator/.gitignore

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

+ 17 - 0
src/bin/sockcreator/Makefile.am

@@ -12,6 +12,23 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@
 
 CLEANFILES = *.gcno *.gcda
 
+man_MANS = b10-sockcreator.8
+DISTCLEANFILES = $(man_MANS)
+EXTRA_DIST = $(man_MANS) b10-sockcreator.xml
+
+if GENERATE_DOCS
+
+b10-sockcreator.8: b10-sockcreator.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-sockcreator.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
+
+endif
+
 pkglibexec_PROGRAMS = b10-sockcreator
 
 b10_sockcreator_SOURCES = sockcreator.cc sockcreator.h main.cc

+ 96 - 0
src/bin/sockcreator/b10-sockcreator.xml

@@ -0,0 +1,96 @@
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+               "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
+	       [<!ENTITY mdash "&#8212;">]>
+<!--
+ - Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+ -
+ - Permission to use, copy, modify, and/or distribute this software for any
+ - purpose with or without fee is hereby granted, provided that the above
+ - copyright notice and this permission notice appear in all copies.
+ -
+ - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ - AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+ - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ - PERFORMANCE OF THIS SOFTWARE.
+-->
+
+<refentry>
+
+  <refentryinfo>
+    <date>February 28, 2012</date>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>b10-sockcreator</refentrytitle>
+    <manvolnum>8</manvolnum>
+    <refmiscinfo>BIND10</refmiscinfo>
+  </refmeta>
+
+  <refnamediv>
+    <refname>b10-sockcreator</refname>
+    <refpurpose>socket creation daemon</refpurpose>
+  </refnamediv>
+
+  <docinfo>
+    <copyright>
+      <year>2012</year>
+      <holder>Internet Systems Consortium, Inc. ("ISC")</holder>
+    </copyright>
+  </docinfo>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>b10-sockcreator</command>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>DESCRIPTION</title>
+    <para>
+      The <command>b10-sockcreator</command> daemon's entire job
+      is to create sockets and assign names to them.
+      It is started by
+      <citerefentry><refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+      and communicates with it.
+      The new socket is sent over a file descriptor.
+    </para>
+
+<!-- TODO: integrate README here -->
+
+    <para>
+      The <command>b10-sockcreator</command> daemon will exit
+      if there is an unrecoverable error or unknown command.
+    </para>
+
+  </refsect1>
+
+  <refsect1>
+    <title>SEE ALSO</title>
+    <para>
+      <citerefentry>
+        <refentrytitle>bind10</refentrytitle><manvolnum>8</manvolnum>
+      </citerefentry>,
+      <citetitle>BIND 10 Guide</citetitle>.
+    </para>
+<!-- TODO: point to developer docs -->
+  </refsect1>
+
+  <refsect1>
+    <title>AUTHORS</title>
+    <para>
+      The <command>b10-sockcreator</command> daemon
+      was initially designed by Michal Vaner of CZNIC.
+    </para>
+  </refsect1>
+
+</refentry><!--
+ - Local variables:
+ - mode: sgml
+ - End:
+-->
+
+
+

+ 2 - 0
src/bin/stats/.gitignore

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

+ 10 - 3
src/bin/stats/Makefile.am

@@ -20,18 +20,25 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.py
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/stats_httpd_messages.pyc
 
 man_MANS = b10-stats.8 b10-stats-httpd.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-stats.xml b10-stats-httpd.xml
 EXTRA_DIST += stats.spec stats-httpd.spec
 EXTRA_DIST += stats-httpd-xml.tpl stats-httpd-xsd.tpl stats-httpd-xsl.tpl
 EXTRA_DIST += stats_messages.mes stats_httpd_messages.mes
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-stats.8: b10-stats.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats.xml
 
 b10-stats-httpd.8: b10-stats-httpd.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-stats-httpd.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

File diff suppressed because it is too large
+ 0 - 126
src/bin/stats/b10-stats-httpd.8


+ 0 - 170
src/bin/stats/b10-stats.8

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

+ 1 - 0
src/bin/sysinfo/.gitignore

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

+ 9 - 2
src/bin/sysinfo/Makefile.am

@@ -12,11 +12,18 @@ MAN1_FILES = \
 
 man_MANS = \
 	$(MAN1_FILES:.xml=.1)
+DISTCLEANFILES = $(man_MANS)
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 .xml.1:
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 66
src/bin/sysinfo/isc-sysinfo.1

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

+ 1 - 0
src/bin/usermgr/.gitignore

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

+ 9 - 2
src/bin/usermgr/Makefile.am

@@ -5,12 +5,19 @@ b10_cmdctl_usermgrdir = $(pkgdatadir)
 CLEANFILES=	b10-cmdctl-usermgr
 
 man_MANS = b10-cmdctl-usermgr.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-cmdctl-usermgr.xml
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-cmdctl-usermgr.8: b10-cmdctl-usermgr.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-cmdctl-usermgr.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 74
src/bin/usermgr/b10-cmdctl-usermgr.8

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

+ 1 - 0
src/bin/xfrin/.gitignore

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

+ 9 - 2
src/bin/xfrin/Makefile.am

@@ -15,13 +15,20 @@ CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.py
 CLEANFILES += $(PYTHON_LOGMSGPKG_DIR)/work/xfrin_messages.pyc
 
 man_MANS = b10-xfrin.8
+DISTCLEANFILES = $(man_MANS)
 EXTRA_DIST = $(man_MANS) b10-xfrin.xml
 EXTRA_DIST += xfrin.spec xfrin_messages.mes
 
-if ENABLE_MAN
+if GENERATE_DOCS
 
 b10-xfrin.8: b10-xfrin.xml
-	xsltproc --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.xml
+	@XSLTPROC@ --novalid --xinclude --nonet -o $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $(srcdir)/b10-xfrin.xml
+
+else
+
+$(man_MANS):
+	@echo Man generation disabled.  Creating dummy $@.  Configure with --enable-generate-docs to enable it.
+	@echo Man generation disabled.  Remove this file, configure with --enable-generate-docs, and rebuild BIND 10 > $@
 
 endif
 

+ 0 - 0
src/bin/xfrin/b10-xfrin.8


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