diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/bin/dhcp4/Makefile.am | 1 | ||||
-rw-r--r-- | src/bin/dhcp4/dhcp4.dox | 2 | ||||
-rw-r--r-- | src/bin/dhcp4/kea_controller.cc | 2 | ||||
-rw-r--r-- | src/bin/dhcp6/Makefile.am | 1 | ||||
-rw-r--r-- | src/bin/dhcp6/dhcp6.dox | 2 | ||||
-rw-r--r-- | src/bin/dhcp6/kea_controller.cc | 2 | ||||
-rw-r--r-- | src/lib/dhcpsrv/Makefile.am | 1 | ||||
-rw-r--r-- | src/lib/dhcpsrv/daemon.h | 10 | ||||
-rw-r--r-- | src/lib/util/Makefile.am | 1 | ||||
-rw-r--r-- | src/lib/util/io/Makefile.am | 3 | ||||
-rw-r--r-- | src/lib/util/io/tests/Makefile.am | 31 | ||||
-rw-r--r-- | src/lib/util/io/tests/run_unittests.cc | 23 | ||||
-rw-r--r-- | src/lib/util/signal_set.cc (renamed from src/lib/util/io/signal_set.cc) | 6 | ||||
-rw-r--r-- | src/lib/util/signal_set.h (renamed from src/lib/util/io/signal_set.h) | 2 | ||||
-rw-r--r-- | src/lib/util/tests/Makefile.am | 1 | ||||
-rw-r--r-- | src/lib/util/tests/signal_set_unittest.cc (renamed from src/lib/util/io/tests/signal_set_unittest.cc) | 6 |
17 files changed, 17 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac index 71a2e007dc..8e6680bb0b 100644 --- a/configure.ac +++ b/configure.ac @@ -1562,7 +1562,6 @@ AC_CONFIG_FILES([compatcheck/Makefile src/lib/testutils/Makefile src/lib/testutils/testdata/Makefile src/lib/util/io/Makefile - src/lib/util/io/tests/Makefile src/lib/util/Makefile src/lib/util/python/doxygen2pydoc.py src/lib/util/python/gen_wiredata.py diff --git a/src/bin/dhcp4/Makefile.am b/src/bin/dhcp4/Makefile.am index 139559c0d4..c7f7d5c7ed 100644 --- a/src/bin/dhcp4/Makefile.am +++ b/src/bin/dhcp4/Makefile.am @@ -76,7 +76,6 @@ b10_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la b10_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la -b10_dhcp4_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la b10_dhcp4dir = $(pkgdatadir) b10_dhcp4_DATA = dhcp4.spec diff --git a/src/bin/dhcp4/dhcp4.dox b/src/bin/dhcp4/dhcp4.dox index 664fedf962..353a687e20 100644 --- a/src/bin/dhcp4/dhcp4.dox +++ b/src/bin/dhcp4/dhcp4.dox @@ -248,7 +248,7 @@ If the reconfiguration fails, the server will continue to run and use the last g configuration. The signal handler for SIGHUP (also for SIGTERM and SIGINT) are installed in the -kea_controller.cc using the @c isc::util::io::SignalSet class. The +kea_controller.cc using the @c isc::util::SignalSet class. The @c isc::dhcp::Dhcp6Srv calls @c isc::dhcp::Daemon::handleSignal on each pass through the main loop. This method fetches the last received signal and calls a handler function defined in the kea_controller.cc. The handler function diff --git a/src/bin/dhcp4/kea_controller.cc b/src/bin/dhcp4/kea_controller.cc index bfc4b7ca3f..017bad5f72 100644 --- a/src/bin/dhcp4/kea_controller.cc +++ b/src/bin/dhcp4/kea_controller.cc @@ -157,7 +157,7 @@ ControlledDhcpv4Srv::init(const std::string& file_name) { // Set signal handlers. When the SIGHUP is received by the process // the server reconfiguration will be triggered. When SIGTERM or // SIGINT will be received, the server will start shutting down. - signal_set_.reset(new isc::util::io::SignalSet(SIGINT, SIGHUP, SIGTERM)); + signal_set_.reset(new isc::util::SignalSet(SIGINT, SIGHUP, SIGTERM)); // Set the pointer to the handler function. signal_handler_ = signalHandler; diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am index 27967e91f8..8f0dd76f12 100644 --- a/src/bin/dhcp6/Makefile.am +++ b/src/bin/dhcp6/Makefile.am @@ -77,7 +77,6 @@ b10_dhcp6_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la -b10_dhcp6_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la b10_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la b10_dhcp6dir = $(pkgdatadir) diff --git a/src/bin/dhcp6/dhcp6.dox b/src/bin/dhcp6/dhcp6.dox index 5097755866..fff4065c90 100644 --- a/src/bin/dhcp6/dhcp6.dox +++ b/src/bin/dhcp6/dhcp6.dox @@ -280,7 +280,7 @@ If the reconfiguration fails, the server will continue to run and use the last g configuration. The signal handler for SIGHUP (also for SIGTERM and SIGINT) are installed in the -kea_controller.cc using the @c isc::util::io::SignalSet class. The +kea_controller.cc using the @c isc::util::SignalSet class. The @c isc::dhcp::Dhcp6Srv calls @c isc::dhcp::Daemon::handleSignal on each pass through the main loop. This method fetches the last received signal and calls a handler function defined in the kea_controller.cc. The handler function diff --git a/src/bin/dhcp6/kea_controller.cc b/src/bin/dhcp6/kea_controller.cc index 7e578c4f6a..c70cf3bf60 100644 --- a/src/bin/dhcp6/kea_controller.cc +++ b/src/bin/dhcp6/kea_controller.cc @@ -160,7 +160,7 @@ ControlledDhcpv6Srv::init(const std::string& file_name) { // Set signal handlers. When the SIGHUP is received by the process // the server reconfiguration will be triggered. When SIGTERM or // SIGINT will be received, the server will start shutting down. - signal_set_.reset(new isc::util::io::SignalSet(SIGINT, SIGHUP, SIGTERM)); + signal_set_.reset(new isc::util::SignalSet(SIGINT, SIGHUP, SIGTERM)); // Set the pointer to the handler function. signal_handler_ = signalHandler; } diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am index 541e25fa0c..6044edcf3e 100644 --- a/src/lib/dhcpsrv/Makefile.am +++ b/src/lib/dhcpsrv/Makefile.am @@ -83,7 +83,6 @@ libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns. libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la -libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la diff --git a/src/lib/dhcpsrv/daemon.h b/src/lib/dhcpsrv/daemon.h index 09b1c2a939..b670c22423 100644 --- a/src/lib/dhcpsrv/daemon.h +++ b/src/lib/dhcpsrv/daemon.h @@ -13,7 +13,7 @@ // PERFORMANCE OF THIS SOFTWARE. #include <config.h> -#include <util/io/signal_set.h> +#include <util/signal_set.h> #include <boost/noncopyable.hpp> #include <string> @@ -46,7 +46,7 @@ namespace dhcp { /// is assigned to the static object in @c Daemon::init function. /// /// Classes derived from @c Daemon may install custom signal handlers using -/// @c isc::util::io::SignalSet class. This base class provides a declaration +/// @c isc::util::SignalSet class. This base class provides a declaration /// of the @c SignalSet object that should be initialized in the derived /// classes to install the custom exception handlers. /// @@ -120,7 +120,7 @@ protected: /// /// This function provides a default implementation for the function /// handling next signal received by the process. It checks if a pointer - /// to @c isc::util::io::SignalSet object and the signal handler function + /// to @c isc::util::SignalSet object and the signal handler function /// have been set. If they have been set, the signal handler is invoked for /// the the next signal registered in the @c SignalSet object. /// @@ -132,7 +132,7 @@ protected: /// This pointer needs to be initialized to point to the @c SignalSet /// object in the derived classes which need to handle signals received /// by the process. - isc::util::io::SignalSetPtr signal_set_; + isc::util::SignalSetPtr signal_set_; /// @brief Pointer to the common signal handler invoked by the handleSignal /// function. @@ -140,7 +140,7 @@ protected: /// This pointer needs to be initialized to point to the signal handler /// function for signals being handled by the process. If signal handler /// it not initialized, the signals will not be handled. - isc::util::io::SignalHandler signal_handler_; + isc::util::SignalHandler signal_handler_; private: diff --git a/src/lib/util/Makefile.am b/src/lib/util/Makefile.am index ffb84719d5..1f47ed3a6c 100644 --- a/src/lib/util/Makefile.am +++ b/src/lib/util/Makefile.am @@ -31,6 +31,7 @@ if USE_SHARED_MEMORY libkea_util_la_SOURCES += memory_segment_mapped.h memory_segment_mapped.cc endif libkea_util_la_SOURCES += range_utilities.h +libkea_util_la_SOURCES += signal_set.cc signal_set.h libkea_util_la_SOURCES += hash/sha1.h hash/sha1.cc libkea_util_la_SOURCES += encode/base16_from_binary.h libkea_util_la_SOURCES += encode/base32hex.h encode/base64.h diff --git a/src/lib/util/io/Makefile.am b/src/lib/util/io/Makefile.am index c0fae76b1f..8a1522d734 100644 --- a/src/lib/util/io/Makefile.am +++ b/src/lib/util/io/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = . tests +SUBDIRS = . AM_CXXFLAGS = $(B10_CXXFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib @@ -7,7 +7,6 @@ AM_CPPFLAGS += $(BOOST_INCLUDES) lib_LTLIBRARIES = libkea-util-io.la libkea_util_io_la_SOURCES = fd.h fd.cc fd_share.h fd_share.cc libkea_util_io_la_SOURCES += socketsession.h socketsession.cc sockaddr_util.h -libkea_util_io_la_SOURCES += signal_set.cc signal_set.h libkea_util_io_la_SOURCES += pktinfo_utilities.h libkea_util_io_la_LIBADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la diff --git a/src/lib/util/io/tests/Makefile.am b/src/lib/util/io/tests/Makefile.am deleted file mode 100644 index d71c28b8c3..0000000000 --- a/src/lib/util/io/tests/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -SUBDIRS = . - -AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib -AM_CPPFLAGS += $(BOOST_INCLUDES) -AM_CXXFLAGS = $(B10_CXXFLAGS) - -if USE_STATIC_LINK -AM_LDFLAGS = -static -endif - -CLEANFILES = *.gcno *.gcda - -TESTS_ENVIRONMENT = \ - $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) - -TESTS = -if HAVE_GTEST -TESTS += run_unittests -run_unittests_SOURCES = run_unittests.cc -run_unittests_SOURCES += signal_set_unittest.cc - -run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) -run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) - -run_unittests_LDADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la -run_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la -run_unittests_LDADD += $(GTEST_LDADD) - -endif - -noinst_PROGRAMS = $(TESTS) diff --git a/src/lib/util/io/tests/run_unittests.cc b/src/lib/util/io/tests/run_unittests.cc deleted file mode 100644 index 304c652382..0000000000 --- a/src/lib/util/io/tests/run_unittests.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2014 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); - int result = RUN_ALL_TESTS(); - return (result); -} diff --git a/src/lib/util/io/signal_set.cc b/src/lib/util/signal_set.cc index b187df69d1..5834c409f2 100644 --- a/src/lib/util/io/signal_set.cc +++ b/src/lib/util/signal_set.cc @@ -12,13 +12,13 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/io/signal_set.h> +#include <util/signal_set.h> #include <cerrno> #include <list> using namespace isc; -using namespace isc::util::io; +using namespace isc::util; namespace { @@ -70,7 +70,6 @@ void internalHandler(int sig) { namespace isc { namespace util { -namespace io { SignalSet::SignalSet(const int sig0) { add(sig0); @@ -222,6 +221,5 @@ SignalSet::remove(const int sig) { } } -} // end of isc::util::io } // end of isc::util } // end of isc diff --git a/src/lib/util/io/signal_set.h b/src/lib/util/signal_set.h index 5d52559568..f561d9c44c 100644 --- a/src/lib/util/io/signal_set.h +++ b/src/lib/util/signal_set.h @@ -24,7 +24,6 @@ namespace isc { namespace util { -namespace io { /// @brief Exception thrown when the @c isc::util::io::SignalSet class /// experiences an error. @@ -183,7 +182,6 @@ private: } } -} #endif // SIGNAL_SET_H diff --git a/src/lib/util/tests/Makefile.am b/src/lib/util/tests/Makefile.am index b3019dbefd..c4cc086cc4 100644 --- a/src/lib/util/tests/Makefile.am +++ b/src/lib/util/tests/Makefile.am @@ -47,6 +47,7 @@ run_unittests_SOURCES += socketsession_unittest.cc run_unittests_SOURCES += strutil_unittest.cc run_unittests_SOURCES += time_utilities_unittest.cc run_unittests_SOURCES += range_utilities_unittest.cc +run_unittests_SOURCES += signal_set_unittest.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) diff --git a/src/lib/util/io/tests/signal_set_unittest.cc b/src/lib/util/tests/signal_set_unittest.cc index 9fcd4fda47..58bc0d8760 100644 --- a/src/lib/util/io/tests/signal_set_unittest.cc +++ b/src/lib/util/tests/signal_set_unittest.cc @@ -12,7 +12,7 @@ // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR // PERFORMANCE OF THIS SOFTWARE. -#include <util/io/signal_set.h> +#include <util/signal_set.h> #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <gtest/gtest.h> @@ -21,9 +21,9 @@ namespace { using namespace isc; -using namespace isc::util::io; +using namespace isc::util; -/// @brief Test fixture class for @c isc::util::io::SignalSet class. +/// @brief Test fixture class for @c isc::util::SignalSet class. /// /// This class contains a handler function which records the signal /// being handled. It allows for checking whether the signal set |