Browse Source

[master] Merge branch 'trac3065'

Adds new library, libdhcp_ddns used for sending and
receiving DHCP_DDNS requests.
Thomas Markwalder 12 years ago
parent
commit
3d39bccaf3

+ 2 - 0
configure.ac

@@ -1316,6 +1316,8 @@ AC_CONFIG_FILES([Makefile
                  src/lib/dns/benchmarks/Makefile
                  src/lib/dns/benchmarks/Makefile
                  src/lib/dhcp/Makefile
                  src/lib/dhcp/Makefile
                  src/lib/dhcp/tests/Makefile
                  src/lib/dhcp/tests/Makefile
+                 src/lib/dhcp_ddns/Makefile
+                 src/lib/dhcp_ddns/tests/Makefile
                  src/lib/dhcpsrv/Makefile
                  src/lib/dhcpsrv/Makefile
                  src/lib/dhcpsrv/tests/Makefile
                  src/lib/dhcpsrv/tests/Makefile
                  src/lib/exceptions/Makefile
                  src/lib/exceptions/Makefile

+ 1 - 0
doc/Doxyfile

@@ -690,6 +690,7 @@ INPUT                  = ../src/lib/exceptions \
                          ../src/lib/dhcp \
                          ../src/lib/dhcp \
                          ../src/lib/dhcpsrv \
                          ../src/lib/dhcpsrv \
                          ../src/bin/dhcp4 \
                          ../src/bin/dhcp4 \
+                         ../src/lib/dhcp_ddns \
                          ../src/bin/d2 \
                          ../src/bin/d2 \
                          ../tests/tools/perfdhcp \
                          ../tests/tools/perfdhcp \
                          devel
                          devel

+ 1 - 0
doc/devel/mainpage.dox

@@ -66,6 +66,7 @@
  *   - @subpage allocengine
  *   - @subpage allocengine
  * - @subpage dhcpDatabaseBackends
  * - @subpage dhcpDatabaseBackends
  * - @subpage perfdhcpInternals
  * - @subpage perfdhcpInternals
+ * - @subpage libdhcp_ddns
  *
  *
  * @section miscellaneousTopics Miscellaneous topics
  * @section miscellaneousTopics Miscellaneous topics
  * - @subpage LoggingApi
  * - @subpage LoggingApi

+ 1 - 3
src/bin/d2/Makefile.am

@@ -57,9 +57,6 @@ b10_dhcp_ddns_SOURCES += d2_cfg_mgr.cc d2_cfg_mgr.h
 b10_dhcp_ddns_SOURCES += d2_update_message.cc d2_update_message.h
 b10_dhcp_ddns_SOURCES += d2_update_message.cc d2_update_message.h
 b10_dhcp_ddns_SOURCES += d2_zone.cc d2_zone.h
 b10_dhcp_ddns_SOURCES += d2_zone.cc d2_zone.h
 b10_dhcp_ddns_SOURCES += dns_client.cc dns_client.h
 b10_dhcp_ddns_SOURCES += dns_client.cc dns_client.h
-b10_dhcp_ddns_SOURCES += ncr_io.cc ncr_io.h
-b10_dhcp_ddns_SOURCES += ncr_msg.cc ncr_msg.h
-b10_dhcp_ddns_SOURCES += ncr_udp.cc ncr_udp.h
 
 
 nodist_b10_dhcp_ddns_SOURCES = d2_messages.h d2_messages.cc
 nodist_b10_dhcp_ddns_SOURCES = d2_messages.h d2_messages.cc
 EXTRA_DIST += d2_messages.mes
 EXTRA_DIST += d2_messages.mes
@@ -70,6 +67,7 @@ b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/asiodns/libb10-asiodns.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/asiodns/libb10-asiodns.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
+b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libb10-dhcp_ddns.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la 
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la 
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
 b10_dhcp_ddns_LDADD += $(top_builddir)/src/lib/util/libb10-util.la

+ 0 - 48
src/bin/d2/d2_messages.mes

@@ -124,47 +124,11 @@ has been invoked.
 This is a debug message issued when the Dhcp-Ddns application encounters an
 This is a debug message issued when the Dhcp-Ddns application encounters an
 unrecoverable error from within the event loop.
 unrecoverable error from within the event loop.
 
 
-% DHCP_DDNS_INVALID_NCR application received an invalid DNS update request: %1
-This is an error message that indicates that an invalid request to update
-a DNS entry was received by the application.  Either the format or the content
-of the request is incorrect. The request will be ignored.
-
 % DHCP_DDNS_INVALID_RESPONSE received response to DNS Update message is malformed: %1
 % DHCP_DDNS_INVALID_RESPONSE received response to DNS Update message is malformed: %1
 This is a debug message issued when the DHCP-DDNS application encountered an
 This is a debug message issued when the DHCP-DDNS application encountered an
 error while decoding a response to DNS Update message. Typically, this error
 error while decoding a response to DNS Update message. Typically, this error
 will be encountered when a response message is malformed.
 will be encountered when a response message is malformed.
 
 
-% DHCP_DDNS_NCR_LISTEN_CLOSE_ERROR application encountered an error while closing the listener used to receive NameChangeRequests : %1
-This is an error message that indicates the application was unable to close the
-listener connection used to receive NameChangeRequests.  Closure may occur
-during the course of error recovery or during normal shutdown procedure.  In
-either case the error is unlikely to impair the application's ability to
-process requests but it should be reported for analysis.
-
-% DHCP_DDNS_NCR_RECV_NEXT_ERROR application could not initiate the next read following a request receive.
-This is a error message indicating that NameChangeRequest listener could not
-start another read after receiving a request.  While possible, this is highly
-unlikely and is probably a programmatic error.  The application should recover
-on its own.
-
-% DHCP_DDNS_NCR_SEND_CLOSE_ERROR DHCP-DDNS client encountered an error while closing the sender connection used to send NameChangeRequests : %1
-This is an error message that indicates the DHCP-DDNS client was unable to
-close the connection used to send NameChangeRequests.  Closure may occur during
-the course of error recovery or during normal shutdown procedure.  In either
-case the error is unlikely to impair the client's ability to send requests but
-it should be reported for analysis.
-
-% DHCP_DDNS_NCR_SEND_NEXT_ERROR DHCP-DDNS client could not initiate the next request send following send completion.
-This is a error message indicating that NameChangeRequest sender could not
-start another send after completing the send of the previous request.  While
-possible, this is highly unlikely and is probably a programmatic error.  The
-application should recover on its own.
-
-% DHCP_DDNS_NCR_UDP_RECV_ERROR UDP socket receive error while listening for DNS Update requests: %1
-This is an error message indicating that an IO error occurred while listening
-over a UDP socket for DNS update requests. This could indicate a network
-connectivity or system resource issue.
-
 % DHCP_DDNS_NO_MATCH No DNS servers match FQDN: %1
 % DHCP_DDNS_NO_MATCH No DNS servers match FQDN: %1
 This is warning message issued when there are no domains in the configuration
 This is warning message issued when there are no domains in the configuration
 which match the cited fully qualified domain name (FQDN).  The DNS Update
 which match the cited fully qualified domain name (FQDN).  The DNS Update
@@ -185,15 +149,3 @@ in event loop.
 % DHCP_DDNS_SHUTDOWN application is performing a normal shut down
 % DHCP_DDNS_SHUTDOWN application is performing a normal shut down
 This is a debug message issued when the application has been instructed
 This is a debug message issued when the application has been instructed
 to shut down by the controller.
 to shut down by the controller.
-
-% DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR unexpected exception thrown from the application receive completion handler: %1
-This is an error message that indicates that an exception was thrown but not
-caught in the application's request receive completion handler.  This is a
-programmatic error that needs to be reported.  Dependent upon the nature of
-the error the application may or may not continue operating normally.
-
-% DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR unexpected exception thrown from the DHCP-DDNS client send completion handler: %1
-This is an error message that indicates that an exception was thrown but not
-caught in the application's send completion handler.  This is a programmatic
-error that needs to be reported.  Dependent upon the nature of the error the
-client may or may not continue operating normally.

+ 1 - 5
src/bin/d2/tests/Makefile.am

@@ -62,9 +62,6 @@ d2_unittests_SOURCES += ../d2_cfg_mgr.cc ../d2_cfg_mgr.h
 d2_unittests_SOURCES += ../d2_update_message.cc ../d2_update_message.h
 d2_unittests_SOURCES += ../d2_update_message.cc ../d2_update_message.h
 d2_unittests_SOURCES += ../d2_zone.cc ../d2_zone.h
 d2_unittests_SOURCES += ../d2_zone.cc ../d2_zone.h
 d2_unittests_SOURCES += ../dns_client.cc ../dns_client.h
 d2_unittests_SOURCES += ../dns_client.cc ../dns_client.h
-d2_unittests_SOURCES += ../ncr_io.cc ../ncr_io.h
-d2_unittests_SOURCES += ../ncr_msg.cc ../ncr_msg.h
-d2_unittests_SOURCES += ../ncr_udp.cc ../ncr_udp.h
 d2_unittests_SOURCES += d_test_stubs.cc d_test_stubs.h
 d2_unittests_SOURCES += d_test_stubs.cc d_test_stubs.h
 d2_unittests_SOURCES += d2_unittests.cc
 d2_unittests_SOURCES += d2_unittests.cc
 d2_unittests_SOURCES += d2_process_unittests.cc
 d2_unittests_SOURCES += d2_process_unittests.cc
@@ -75,8 +72,6 @@ d2_unittests_SOURCES += d2_cfg_mgr_unittests.cc
 d2_unittests_SOURCES += d2_update_message_unittests.cc
 d2_unittests_SOURCES += d2_update_message_unittests.cc
 d2_unittests_SOURCES += d2_zone_unittests.cc
 d2_unittests_SOURCES += d2_zone_unittests.cc
 d2_unittests_SOURCES += dns_client_unittests.cc
 d2_unittests_SOURCES += dns_client_unittests.cc
-d2_unittests_SOURCES += ncr_unittests.cc
-d2_unittests_SOURCES += ncr_udp_unittests.cc
 nodist_d2_unittests_SOURCES = ../d2_messages.h ../d2_messages.cc
 nodist_d2_unittests_SOURCES = ../d2_messages.h ../d2_messages.cc
 
 
 d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
 d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
@@ -88,6 +83,7 @@ d2_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libb10-asiodns.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
+d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libb10-dhcp_ddns.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
 d2_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la

+ 1 - 1
src/lib/Makefile.am

@@ -1,3 +1,3 @@
 SUBDIRS = exceptions util log hooks cryptolink dns cc config acl xfr bench \
 SUBDIRS = exceptions util log hooks cryptolink dns cc config acl xfr bench \
           asiolink asiodns nsas cache resolve testutils datasrc \
           asiolink asiodns nsas cache resolve testutils datasrc \
-          server_common python dhcp dhcpsrv statistics
+          server_common python dhcp dhcp_ddns dhcpsrv statistics

+ 51 - 0
src/lib/dhcp_ddns/Makefile.am

@@ -0,0 +1,51 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CXXFLAGS  = $(B10_CXXFLAGS)
+
+# Some versions of GCC warn about some versions of Boost regarding
+# missing initializer for members in its posix_time.
+# https://svn.boost.org/trac/boost/ticket/3477
+# But older GCC compilers don't have the flag.
+AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
+
+
+# Define rule to build logging source files from message file
+dhcp_ddns_messages.h dhcp_ddns_messages.cc: dhcp_ddns_messages.mes
+	$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/dhcp_ddns/dhcp_ddns_messages.mes
+
+# Tell automake that the message files are built as part of the build process
+# (so that they are built before the main library is built).
+BUILT_SOURCES = dhcp_ddns_messages.h dhcp_ddns_messages.cc
+
+# Ensure that the message file is included in the distribution
+EXTRA_DIST = dhcp_ddns_messages.mes libdhcp_ddns.dox
+
+# Get rid of generated message files on a clean
+CLEANFILES = *.gcno *.gcda dhcp_ddns_messages.h dhcp_ddns_messages.cc
+
+lib_LTLIBRARIES = libb10-dhcp_ddns.la
+libb10_dhcp_ddns_la_SOURCES  =
+libb10_dhcp_ddns_la_SOURCES += dhcp_ddns_log.cc dhcp_ddns_log.h
+libb10_dhcp_ddns_la_SOURCES += ncr_io.cc ncr_io.h
+libb10_dhcp_ddns_la_SOURCES += ncr_msg.cc ncr_msg.h
+libb10_dhcp_ddns_la_SOURCES += ncr_udp.cc ncr_udp.h
+
+nodist_libb10_dhcp_ddns_la_SOURCES = dhcp_ddns_messages.cc dhcp_ddns_messages.h
+
+libb10_dhcp_ddns_la_CXXFLAGS = $(AM_CXXFLAGS)
+libb10_dhcp_ddns_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES)
+libb10_dhcp_ddns_la_LDFLAGS  = $(AM_LDFLAGS)
+libb10_dhcp_ddns_la_LIBADD  =
+libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/log/libb10-log.la
+libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/util/libb10-util.la
+libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
+libb10_dhcp_ddns_la_LIBADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
+
+if USE_CLANGPP
+# Disable unused parameter warning caused by some of the
+# Boost headers when compiling with clang.
+libb10_dhcp_ddns_la_CXXFLAGS += -Wno-unused-parameter
+endif
+

+ 27 - 0
src/lib/dhcp_ddns/dhcp_ddns_log.cc

@@ -0,0 +1,27 @@
+// Copyright (C) 2013  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-dhcp_ddns.
+
+#include <dhcp_ddns/dhcp_ddns_log.h>
+
+namespace isc {
+namespace dhcp_ddns {
+
+/// @brief Defines the logger used within lib dhcp_ddns.
+isc::log::Logger dhcp_ddns_logger("libdhcp-ddns");
+
+} // namespace dhcp_ddns
+} // namespace isc
+

+ 31 - 0
src/lib/dhcp_ddns/dhcp_ddns_log.h

@@ -0,0 +1,31 @@
+// Copyright (C) 2013  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 DHCP_DDNS_LOG_H
+#define DHCP_DDNS_LOG_H
+
+#include <log/logger_support.h>
+#include <log/macros.h>
+#include <dhcp_ddns/dhcp_ddns_messages.h>
+
+namespace isc {
+namespace dhcp_ddns {
+
+/// Define the logger for the "dhcp_ddns" logging.
+extern isc::log::Logger dhcp_ddns_logger;
+
+} // namespace dhcp_ddns
+} // namespace isc
+
+#endif // DHCP_DDNS_LOG_H

+ 63 - 0
src/lib/dhcp_ddns/dhcp_ddns_messages.mes

@@ -0,0 +1,63 @@
+# Copyright (C) 2013  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_ddns
+
+% DHCP_DDNS_INVALID_NCR application received an invalid DNS update request: %1
+This is an error message that indicates that an invalid request to update
+a DNS entry was received by the application.  Either the format or the content
+of the request is incorrect. The request will be ignored.
+
+% DHCP_DDNS_NCR_LISTEN_CLOSE_ERROR application encountered an error while closing the listener used to receive NameChangeRequests : %1
+This is an error message that indicates the application was unable to close the
+listener connection used to receive NameChangeRequests.  Closure may occur
+during the course of error recovery or during normal shutdown procedure.  In
+either case the error is unlikely to impair the application's ability to
+process requests but it should be reported for analysis.
+
+% DHCP_DDNS_NCR_RECV_NEXT_ERROR application could not initiate the next read following a request receive.
+This is a error message indicating that NameChangeRequest listener could not
+start another read after receiving a request.  While possible, this is highly
+unlikely and is probably a programmatic error.  The application should recover
+on its own.
+
+% DHCP_DDNS_NCR_SEND_CLOSE_ERROR DHCP-DDNS client encountered an error while closing the sender connection used to send NameChangeRequests : %1
+This is an error message that indicates the DHCP-DDNS client was unable to
+close the connection used to send NameChangeRequests.  Closure may occur during
+the course of error recovery or during normal shutdown procedure.  In either
+case the error is unlikely to impair the client's ability to send requests but
+it should be reported for analysis.
+
+% DHCP_DDNS_NCR_SEND_NEXT_ERROR DHCP-DDNS client could not initiate the next request send following send completion.
+This is a error message indicating that NameChangeRequest sender could not
+start another send after completing the send of the previous request.  While
+possible, this is highly unlikely and is probably a programmatic error.  The
+application should recover on its own.
+
+% DHCP_DDNS_NCR_UDP_RECV_ERROR UDP socket receive error while listening for DNS Update requests: %1
+This is an error message indicating that an IO error occurred while listening
+over a UDP socket for DNS update requests. This could indicate a network
+connectivity or system resource issue.
+
+% DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR unexpected exception thrown from the application receive completion handler: %1
+This is an error message that indicates that an exception was thrown but not
+caught in the application's request receive completion handler.  This is a
+programmatic error that needs to be reported.  Dependent upon the nature of
+the error the application may or may not continue operating normally.
+
+% DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR unexpected exception thrown from the DHCP-DDNS client send completion handler: %1
+This is an error message that indicates that an exception was thrown but not
+caught in the application's send completion handler.  This is a programmatic
+error that needs to be reported.  Dependent upon the nature of the error the
+client may or may not continue operating normally.

+ 47 - 0
src/lib/dhcp_ddns/libdhcp_ddns.dox

@@ -0,0 +1,47 @@
+// Copyright (C) 2013  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.
+
+/**
+@page libdhcp_ddns DHCP_DDNS Request IO Library
+
+@section libdhcp_ddnsIntro Libdhcp_ddns Library Introduction
+
+libdhcp_ddns is a library of classes for sending and receiving requests used
+by ISC's  DHCP-DDNS service for carrying out DHCP-driven DDNS.  These requests
+are implemented in this library by the class, NameChangeRequest.
+
+This class provides services for constructing the requests as well as
+marshalling them to and from various transport formats.  Currently, the only
+format supported is JSON, however the design of the classes in this library is such that supporting additional formats will be easy to add.
+
+For sending and receiving NameChangeRequests, this library supplies an abstract
+pair of classes, NameChangeSender and NameChangeListener.  NameChangeSender
+defines the public interface that DHCP_DDNS clients, such as DHCP servers use
+for sending requests to DHCP_DDNS.   NameChangeListener is used by request
+consumers, primarily the DHCP_DDNS service, for receiving the requests.
+
+By providing abstract interfaces, the implementation isolates the senders and
+listeners from any underlying details of request transportation.  This was done
+to allow support for a variety of transportation mechanisms.  Currently, the
+only transport supported is via UDP Sockets, though support for TCP/IP sockets
+is forthcoming.  There may eventually be an implementation which is driven
+through an RDBMS.
+
+The UDP implementation is provided by NameChangeUDPSender and NameChangeUPDListener.
+The implementation is strictly unidirectional.  This means that there is no explicit
+acknowledgement of receipt of a request, and as it is UDP there is no guarantee of
+delivery.  Once provided, transport via TCP/IP sockets will provide a more reliable
+mechanism.
+
+*/

+ 15 - 13
src/bin/d2/ncr_io.cc

@@ -12,11 +12,11 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 // PERFORMANCE OF THIS SOFTWARE.
 
 
-#include <d2/d2_log.h>
+#include <dhcp_ddns/dhcp_ddns_log.h>
-#include <d2/ncr_io.h>
+#include <dhcp_ddns/ncr_io.h>
 
 
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 //************************** NameChangeListener ***************************
 //************************** NameChangeListener ***************************
 
 
@@ -60,7 +60,8 @@ NameChangeListener::stopListening() {
     } catch (const isc::Exception &ex) {
     } catch (const isc::Exception &ex) {
         // Swallow exceptions. If we have some sort of error we'll log
         // Swallow exceptions. If we have some sort of error we'll log
         // it but we won't propagate the throw.
         // it but we won't propagate the throw.
-        LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_LISTEN_CLOSE_ERROR).arg(ex.what());
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_LISTEN_CLOSE_ERROR)
+                  .arg(ex.what());
     }
     }
 
 
     // Set it false, no matter what.  This allows us to at least try to
     // Set it false, no matter what.  This allows us to at least try to
@@ -78,7 +79,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
     try {
     try {
         recv_handler_(result, ncr);
         recv_handler_(result, ncr);
     } catch (const std::exception& ex) {
     } catch (const std::exception& ex) {
-        LOG_ERROR(dctl_logger, DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR)
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR)
                   .arg(ex.what());
                   .arg(ex.what());
     }
     }
 
 
@@ -95,7 +96,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
             // at the IOService::run (or run variant) invocation.  So we will
             // at the IOService::run (or run variant) invocation.  So we will
             // close the window by invoking the application handler with
             // close the window by invoking the application handler with
             // a failed result, and let the application layer sort it out.
             // a failed result, and let the application layer sort it out.
-            LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_RECV_NEXT_ERROR)
+            LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_RECV_NEXT_ERROR)
                       .arg(ex.what());
                       .arg(ex.what());
 
 
             // Call the registered application layer handler.
             // Call the registered application layer handler.
@@ -106,7 +107,7 @@ NameChangeListener::invokeRecvHandler(const Result result,
             try {
             try {
                 recv_handler_(ERROR, empty);
                 recv_handler_(ERROR, empty);
             } catch (const std::exception& ex) {
             } catch (const std::exception& ex) {
-                LOG_ERROR(dctl_logger,
+                LOG_ERROR(dhcp_ddns_logger,
                           DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR)
                           DHCP_DDNS_UNCAUGHT_NCR_RECV_HANDLER_ERROR)
                           .arg(ex.what());
                           .arg(ex.what());
             }
             }
@@ -158,7 +159,8 @@ NameChangeSender::stopSending() {
     } catch (const isc::Exception &ex) {
     } catch (const isc::Exception &ex) {
         // Swallow exceptions. If we have some sort of error we'll log
         // Swallow exceptions. If we have some sort of error we'll log
         // it but we won't propagate the throw.
         // it but we won't propagate the throw.
-        LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_SEND_CLOSE_ERROR).arg(ex.what());
+        LOG_ERROR(dhcp_ddns_logger, 
+                  DHCP_DDNS_NCR_SEND_CLOSE_ERROR).arg(ex.what());
     }
     }
 
 
     // Set it false, no matter what.  This allows us to at least try to
     // Set it false, no matter what.  This allows us to at least try to
@@ -227,7 +229,7 @@ NameChangeSender::invokeSendHandler(const NameChangeSender::Result result) {
     try {
     try {
         send_handler_(result, ncr_to_send_);
         send_handler_(result, ncr_to_send_);
     } catch (const std::exception& ex) {
     } catch (const std::exception& ex) {
-        LOG_ERROR(dctl_logger, DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR)
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR)
                   .arg(ex.what());
                   .arg(ex.what());
     }
     }
 
 
@@ -244,7 +246,7 @@ NameChangeSender::invokeSendHandler(const NameChangeSender::Result result) {
         // at the IOService::run (or run variant) invocation.  So we will
         // at the IOService::run (or run variant) invocation.  So we will
         // close the window by invoking the application handler with
         // close the window by invoking the application handler with
         // a failed result, and let the application layer sort it out.
         // a failed result, and let the application layer sort it out.
-        LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_SEND_NEXT_ERROR)
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_SEND_NEXT_ERROR)
                   .arg(ex.what());
                   .arg(ex.what());
 
 
         // Invoke the completion handler passing in failed result.
         // Invoke the completion handler passing in failed result.
@@ -254,8 +256,8 @@ NameChangeSender::invokeSendHandler(const NameChangeSender::Result result) {
         try {
         try {
             send_handler_(ERROR, ncr_to_send_);
             send_handler_(ERROR, ncr_to_send_);
         } catch (const std::exception& ex) {
         } catch (const std::exception& ex) {
-            LOG_ERROR(dctl_logger, DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR)
+            LOG_ERROR(dhcp_ddns_logger, 
-                      .arg(ex.what());
+                      DHCP_DDNS_UNCAUGHT_NCR_SEND_HANDLER_ERROR).arg(ex.what());
         }
         }
     }
     }
 }
 }
@@ -277,5 +279,5 @@ NameChangeSender::clearSendQueue() {
     send_queue_.clear();
     send_queue_.clear();
 }
 }
 
 
-} // namespace isc::d2
+} // namespace isc::dhcp_ddns
 } // namespace isc
 } // namespace isc

+ 4 - 4
src/bin/d2/ncr_io.h

@@ -58,13 +58,13 @@
 
 
 #include <asiolink/io_address.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_service.h>
 #include <asiolink/io_service.h>
-#include <d2/ncr_msg.h>
+#include <dhcp_ddns/ncr_msg.h>
 #include <exceptions/exceptions.h>
 #include <exceptions/exceptions.h>
 
 
 #include <deque>
 #include <deque>
 
 
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 /// @brief Exception thrown if an NcrListenerError encounters a general error.
 /// @brief Exception thrown if an NcrListenerError encounters a general error.
 class NcrListenerError : public isc::Exception {
 class NcrListenerError : public isc::Exception {
@@ -439,7 +439,7 @@ public:
         virtual void operator ()(const Result result,
         virtual void operator ()(const Result result,
                                  NameChangeRequestPtr& ncr) = 0;
                                  NameChangeRequestPtr& ncr) = 0;
 
 
-        virtual ~RequestSendHandler(){
+        virtual ~RequestSendHandler() {
         }
         }
     };
     };
 
 
@@ -632,7 +632,7 @@ private:
 /// @brief Defines a smart pointer to an instance of a sender.
 /// @brief Defines a smart pointer to an instance of a sender.
 typedef boost::shared_ptr<NameChangeSender> NameChangeSenderPtr;
 typedef boost::shared_ptr<NameChangeSender> NameChangeSenderPtr;
 
 
-} // namespace isc::d2
+} // namespace isc::dhcp_ddns
 } // namespace isc
 } // namespace isc
 
 
 #endif
 #endif

+ 2 - 2
src/bin/d2/ncr_msg.cc

@@ -12,7 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 // PERFORMANCE OF THIS SOFTWARE.
 
 
-#include <d2/ncr_msg.h>
+#include <dhcp_ddns/ncr_msg.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_address.h>
 #include <asiolink/io_error.h>
 #include <asiolink/io_error.h>
 
 
@@ -20,7 +20,7 @@
 #include <limits>
 #include <limits>
 
 
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 /********************************* D2Dhcid ************************************/
 /********************************* D2Dhcid ************************************/
 
 

+ 2 - 2
src/bin/d2/ncr_msg.h

@@ -30,7 +30,7 @@
 #include <string>
 #include <string>
 
 
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 /// @brief Exception thrown when NameChangeRequest marshalling error occurs.
 /// @brief Exception thrown when NameChangeRequest marshalling error occurs.
 class NcrMessageError : public isc::Exception {
 class NcrMessageError : public isc::Exception {
@@ -494,7 +494,7 @@ private:
 };
 };
 
 
 
 
-}; // end of isc::d2 namespace
+}; // end of isc::dhcp_ddns namespace
 }; // end of isc namespace
 }; // end of isc namespace
 
 
 #endif
 #endif

+ 7 - 7
src/bin/d2/ncr_udp.cc

@@ -12,15 +12,15 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 // PERFORMANCE OF THIS SOFTWARE.
 
 
-#include <d2/d2_log.h>
+#include <dhcp_ddns/dhcp_ddns_log.h>
-#include <d2/ncr_udp.h>
+#include <dhcp_ddns/ncr_udp.h>
 
 
 #include <asio/ip/udp.hpp>
 #include <asio/ip/udp.hpp>
 #include <asio/error_code.hpp>
 #include <asio/error_code.hpp>
 #include <boost/bind.hpp>
 #include <boost/bind.hpp>
 
 
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 //*************************** UDPCallback ***********************
 //*************************** UDPCallback ***********************
 UDPCallback::UDPCallback (RawBufferPtr& buffer, const size_t buf_size,
 UDPCallback::UDPCallback (RawBufferPtr& buffer, const size_t buf_size,
@@ -161,7 +161,7 @@ NameChangeUDPListener::receiveCompletionHandler(const bool successful,
             ncr = NameChangeRequest::fromFormat(format_, input_buffer);
             ncr = NameChangeRequest::fromFormat(format_, input_buffer);
         } catch (const NcrMessageError& ex) {
         } catch (const NcrMessageError& ex) {
             // log it and go back to listening
             // log it and go back to listening
-            LOG_ERROR(dctl_logger, DHCP_DDNS_INVALID_NCR).arg(ex.what());
+            LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_INVALID_NCR).arg(ex.what());
 
 
             // Queue up the next recieve.
             // Queue up the next recieve.
             doReceive();
             doReceive();
@@ -169,7 +169,7 @@ NameChangeUDPListener::receiveCompletionHandler(const bool successful,
         }
         }
     } else {
     } else {
         asio::error_code error_code = callback->getErrorCode();
         asio::error_code error_code = callback->getErrorCode();
-        LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_UDP_RECV_ERROR)
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_UDP_RECV_ERROR)
                   .arg(error_code.message());
                   .arg(error_code.message());
         result = ERROR;
         result = ERROR;
     }
     }
@@ -286,7 +286,7 @@ NameChangeUDPSender::sendCompletionHandler(const bool successful,
     else {
     else {
         // On a failure, log the error and set the result to ERROR.
         // On a failure, log the error and set the result to ERROR.
         asio::error_code error_code = send_callback->getErrorCode();
         asio::error_code error_code = send_callback->getErrorCode();
-        LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_UDP_RECV_ERROR)
+        LOG_ERROR(dhcp_ddns_logger, DHCP_DDNS_NCR_UDP_RECV_ERROR)
                   .arg(error_code.message());
                   .arg(error_code.message());
 
 
         result = ERROR;
         result = ERROR;
@@ -295,5 +295,5 @@ NameChangeUDPSender::sendCompletionHandler(const bool successful,
     // Call the application's registered request send handler.
     // Call the application's registered request send handler.
     invokeSendHandler(result);
     invokeSendHandler(result);
 }
 }
-}; // end of isc::d2 namespace
+}; // end of isc::dhcp_ddns namespace
 }; // end of isc namespace
 }; // end of isc namespace

+ 3 - 3
src/bin/d2/ncr_udp.h

@@ -111,7 +111,7 @@
 #include <asiolink/io_service.h>
 #include <asiolink/io_service.h>
 #include <asiolink/udp_endpoint.h>
 #include <asiolink/udp_endpoint.h>
 #include <asiolink/udp_socket.h>
 #include <asiolink/udp_socket.h>
-#include <d2/ncr_io.h>
+#include <dhcp_ddns/ncr_io.h>
 #include <util/buffer.h>
 #include <util/buffer.h>
 
 
 #include <boost/shared_array.hpp>
 #include <boost/shared_array.hpp>
@@ -121,7 +121,7 @@
 /// UDPCallback operator implementation is mostly a pass through.
 /// UDPCallback operator implementation is mostly a pass through.
 ///
 ///
 namespace isc {
 namespace isc {
-namespace d2 {
+namespace dhcp_ddns {
 
 
 /// @brief Thrown when a UDP level exception occurs.
 /// @brief Thrown when a UDP level exception occurs.
 class NcrUDPError : public isc::Exception {
 class NcrUDPError : public isc::Exception {
@@ -556,7 +556,7 @@ private:
     bool reuse_address_;
     bool reuse_address_;
 };
 };
 
 
-} // namespace isc::d2
+} // namespace isc::dhcp_ddns
 } // namespace isc
 } // namespace isc
 
 
 #endif
 #endif

+ 59 - 0
src/lib/dhcp_ddns/tests/Makefile.am

@@ -0,0 +1,59 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/dhcp_ddns/tests\"
+AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
+
+AM_CXXFLAGS = $(B10_CXXFLAGS)
+
+# Some versions of GCC warn about some versions of Boost regarding
+# missing initializer for members in its posix_time.
+# https://svn.boost.org/trac/boost/ticket/3477
+# But older GCC compilers don't have the flag.
+AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = \
+	$(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+TESTS =
+if HAVE_GTEST
+TESTS += libdhcp_ddns_unittests
+
+libdhcp_ddns_unittests_SOURCES  = run_unittests.cc
+libdhcp_ddns_unittests_SOURCES += ../dhcp_ddns_log.cc ../dhcp_ddns_log.h
+libdhcp_ddns_unittests_SOURCES += ../ncr_io.cc ../ncr_io.h
+libdhcp_ddns_unittests_SOURCES += ../ncr_msg.cc ../ncr_msg.h
+libdhcp_ddns_unittests_SOURCES += ../ncr_udp.cc ../ncr_udp.h
+libdhcp_ddns_unittests_SOURCES += ncr_unittests.cc
+libdhcp_ddns_unittests_SOURCES += ncr_udp_unittests.cc
+nodist_libdhcp_ddns_unittests_SOURCES = ../dhcp_ddns_messages.h ../dhcp_ddns_messages.cc
+
+libdhcp_ddns_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+
+libdhcp_ddns_unittests_LDFLAGS  = $(AM_LDFLAGS)  $(GTEST_LDFLAGS)
+
+libdhcp_ddns_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+if USE_CLANGPP
+# This is to workaround unused variables tcout and tcerr in
+# log4cplus's streams.h and unused parameters from some of the
+# Boost headers.
+libdhcp_ddns_unittests_CXXFLAGS += -Wno-unused-parameter
+endif
+
+libdhcp_ddns_unittests_LDADD = $(top_builddir)/src/lib/log/libb10-log.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
+libdhcp_ddns_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
+libdhcp_ddns_unittests_LDADD += $(GTEST_LDADD)
+endif
+
+noinst_PROGRAMS = $(TESTS)

+ 3 - 3
src/bin/d2/tests/ncr_udp_unittests.cc

@@ -13,8 +13,8 @@
 // PERFORMANCE OF THIS SOFTWARE.
 // PERFORMANCE OF THIS SOFTWARE.
 
 
 #include <asiolink/interval_timer.h>
 #include <asiolink/interval_timer.h>
-#include <d2/ncr_io.h>
+#include <dhcp_ddns/ncr_io.h>
-#include <d2/ncr_udp.h>
+#include <dhcp_ddns/ncr_udp.h>
 #include <util/time_utilities.h>
 #include <util/time_utilities.h>
 
 
 #include <asio/ip/udp.hpp>
 #include <asio/ip/udp.hpp>
@@ -25,7 +25,7 @@
 
 
 using namespace std;
 using namespace std;
 using namespace isc;
 using namespace isc;
-using namespace isc::d2;
+using namespace isc::dhcp_ddns;
 
 
 namespace {
 namespace {
 
 

+ 2 - 2
src/bin/d2/tests/ncr_unittests.cc

@@ -12,7 +12,7 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 // PERFORMANCE OF THIS SOFTWARE.
 
 
-#include <d2/ncr_msg.h>
+#include <dhcp_ddns/ncr_msg.h>
 #include <util/time_utilities.h>
 #include <util/time_utilities.h>
 
 
 #include <gtest/gtest.h>
 #include <gtest/gtest.h>
@@ -20,7 +20,7 @@
 
 
 using namespace std;
 using namespace std;
 using namespace isc;
 using namespace isc;
-using namespace isc::d2;
+using namespace isc::dhcp_ddns;
 
 
 namespace {
 namespace {
 
 

+ 27 - 0
src/lib/dhcp_ddns/tests/run_unittests.cc

@@ -0,0 +1,27 @@
+// Copyright (C) 2011  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.
+
+#include <log/logger_support.h>
+
+#include <gtest/gtest.h>
+
+int
+main(int argc, char* argv[]) {
+    ::testing::InitGoogleTest(&argc, argv);
+    isc::log::initLogger();
+
+    int result = RUN_ALL_TESTS();
+
+    return (result);
+}