doc/version.ent
ext/asio/asio/Makefile
ext/asio/Makefile
- ext/gtest/Makefile
+ ext/gtest/Makefile
ext/Makefile
m4macros/Makefile
Makefile
src/bin/d2/tests/Makefile
src/bin/d2/tests/d2_process_tests.sh
src/bin/d2/tests/test_data_files_config.h
+ src/bin/cfgrpt/Makefile
src/bin/dhcp4/Makefile
src/bin/dhcp4/spec_config.h.pre
src/bin/dhcp4/tests/Makefile
src/bin/admin/tests/mysql_tests.sh
src/bin/admin/scripts/mysql/Makefile
src/bin/admin/scripts/mysql/upgrade_1.0_to_2.0.sh
- src/bin/admin/scripts/mysql/upgrade_2.0_to_3.0.sh
+ src/bin/admin/scripts/mysql/upgrade_2.0_to_3.0.sh
src/bin/admin/scripts/pgsql/Makefile
src/hooks/Makefile
src/hooks/dhcp/Makefile
END
+# Create config_report.cc with embedded config.report
+chmod +x ${srcdir}/tools/mk_cfgrpt.sh
+${srcdir}/tools/mk_cfgrpt.sh ${srcdir}/src/bin/cfgrpt/config_report.cc
+
cat config.report
cat <<EOF
</listitem>
</itemizedlist>
+ <para>
+ As for any Kea executable binary, the <filename>config.report</filename>
+ file produced by <userinput>./configure</userinput> is embbeded.
+ The command extracting it is:
+<screen>
+strings <userinput>path</userinput>/kea-dhcp-ddns | sed -n 's/;;;; //p'
+</screen>
+ Beware the <userinput>path</userinput> to use for a binary
+ in the build tree finishes by <filename>.libs</filename>.
+ </para>
+
<para>
Upon start up the module will load its configuration and begin listening
for NCRs based on that configuration.
</listitem>
</itemizedlist>
+ <para>
+ As for any Kea executable binary, the <filename>config.report</filename>
+ file produced by <userinput>./configure</userinput> is embbeded.
+ The command extracting it is:
+<screen>
+strings <userinput>path</userinput>/kea-dhcp4 | sed -n 's/;;;; //p'
+</screen>
+ Beware the <userinput>path</userinput> to use for a binary
+ in the build tree finishes by <filename>.libs</filename>.
+ </para>
+
<para>
When running in a console, the server can be shut down by
pressing ctrl-c. It detects the key combination and shuts
</listitem>
</itemizedlist>
+ <para>
+ As for any Kea executable binary, the <filename>config.report</filename>
+ file produced by <userinput>./configure</userinput> is embbeded.
+ The command extracting it is:
+<screen>
+strings <userinput>path</userinput>/kea-dhcp6 | sed -n 's/;;;; //p'
+</screen>
+ Beware the <userinput>path</userinput> to use for a binary
+ in the build tree finishes by <filename>.libs</filename>.
+ </para>
+
<para>
When running in a console, the server can be shut down by
pressing ctrl-c. It detects the key combination and shuts
dependencies.
</para>
+ <para>
+ <userinput>./configure</userinput> when it succeeds displays a report
+ with the building parameters. This report is saved into
+ <filename>config.report</filename> and embedded into executable
+ binaries, e.g., <userinput>kea-dhcp4</userinput>.
+ </para>
</section>
# The following build order must be maintained.
-SUBDIRS = dhcp4 dhcp6 d2 perfdhcp admin lfc
+SUBDIRS = cfgrpt dhcp4 dhcp6 d2 perfdhcp admin lfc
if CONFIG_BACKEND_JSON
SUBDIRS += keactrl
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
AM_CXXFLAGS = $(KEA_CXXFLAGS)
if USE_CLANGPP
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+kea_dhcp_ddns_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
kea_dhcp_ddnsdir = $(pkgdatadir)
kea_dhcp_ddns_DATA = dhcp-ddns.spec
#include <exceptions/exceptions.h>
#include <log/logger_support.h>
#include <dhcpsrv/cfgmgr.h>
+#include <cryptolink/cryptolink.h>
+#include <log/logger.h>
+#include <cfgrpt/config_report.h>
+
+#ifdef HAVE_MYSQL
+#include <dhcpsrv/mysql_lease_mgr.h>
+#else
+#ifdef HAVE_PGSQL
+#include <dhcpsrv/pgsql_lease_mgr.h>
+#else
+#include <dhcpsrv/memfile_lease_mgr.h>
+#endif
+#endif
#include <sstream>
#include <unistd.h>
DControllerBase::~DControllerBase() {
}
-}; // namespace isc::d2
-
-}; // namespace isc
+// Refer to config_report so it will be embedded in the binary
+const char* const* d2_config_report = isc::detail::config_report;
std::string
-isc::dhcp::Daemon::getVersion(bool extended) {
+DControllerBase::getVersion(bool extended) {
std::stringstream tmp;
tmp << VERSION;
if (extended) {
- tmp << std::endl << EXTENDED_VERSION;
-
- // @todo print more details (is it Botan or OpenSSL build,
- // with or without MySQL/Postgres? What compilation options were
- // used? etc)
+ tmp << std::endl << EXTENDED_VERSION << std::endl;
+ tmp << "linked with " << log::Logger::getVersion() << std::endl;
+ tmp << "and " << cryptolink::CryptoLink::getVersion()
+ << std::endl;
+#ifdef HAVE_MYSQL
+ tmp << "database: " << isc::dhcp::MySqlLeaseMgr::getDBVersion();
+#else
+#ifdef HAVE_PGSQL
+ tmp << "database: " << isc::dhcp::PgSqlLeaseMgr::getDBVersion();
+#else
+ tmp << "database: " << isc::dhcp::Memfile_LeaseMgr::getDBVersion();
+#endif
+#endif
+ // @todo: more details about database runtime
}
return (tmp.str());
}
+
+}; // namespace isc::d2
+
+}; // namespace isc
/// @brief Destructor
virtual ~DControllerBase();
+ /// @brief returns Kea version on stdout and exit.
+ /// redeclaration/redefinition. @ref Daemon::getVersion())
+ static std::string getVersion(bool extended);
+
/// @brief Acts as the primary entry point into the controller execution
/// and provides the outermost application control logic:
///
d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
d2_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+d2_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
endif
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
AM_CXXFLAGS = $(KEA_CXXFLAGS)
if USE_CLANGPP
kea_dhcp4_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+kea_dhcp4_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+kea_dhcp4_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
kea_dhcp4dir = $(pkgdatadir)
kea_dhcp4_DATA = dhcp4.spec
#include <hooks/hooks_log.h>
#include <hooks/hooks_manager.h>
#include <util/strutil.h>
+#include <log/logger.h>
+#include <cryptolink/cryptolink.h>
+#include <cfgrpt/config_report.h>
+
+#ifdef HAVE_MYSQL
+#include <dhcpsrv/mysql_lease_mgr.h>
+#else
+#ifdef HAVE_PGSQL
+#include <dhcpsrv/pgsql_lease_mgr.h>
+#else
+#include <dhcpsrv/memfile_lease_mgr.h>
+#endif
+#endif
#include <asio.hpp>
#include <boost/bind.hpp>
using namespace isc;
using namespace isc::asiolink;
+using namespace isc::cryptolink;
using namespace isc::dhcp;
using namespace isc::dhcp_ddns;
using namespace isc::hooks;
CfgMgr::instance().getD2ClientMgr().suspendUpdates();
}
+// Refer to config_report so it will be embedded in the binary
+const char* const* dhcp4_config_report = isc::detail::config_report;
+
std::string
-Daemon::getVersion(bool extended) {
+Dhcpv4Srv::getVersion(bool extended) {
std::stringstream tmp;
tmp << VERSION;
if (extended) {
- tmp << endl << EXTENDED_VERSION;
-
- // @todo print more details (is it Botan or OpenSSL build,
- // with or without MySQL/Postgres? What compilation options were
- // used? etc)
+ tmp << endl << EXTENDED_VERSION << endl;
+ tmp << "linked with " << Logger::getVersion() << endl;
+ tmp << "and " << CryptoLink::getVersion() << endl;
+#ifdef HAVE_MYSQL
+ tmp << "database: " << MySqlLeaseMgr::getDBVersion();
+#else
+#ifdef HAVE_PGSQL
+ tmp << "database: " << PgSqlLeaseMgr::getDBVersion();
+#else
+ tmp << "database: " << Memfile_LeaseMgr::getDBVersion();
+#endif
+#endif
+ // @todo: more details about database runtime
}
return (tmp.str());
/// @brief Destructor. Used during DHCPv4 service shutdown.
virtual ~Dhcpv4Srv();
+ /// @brief returns Kea version on stdout and exit.
+ /// redeclaration/redefinition. @ref Daemon::getVersion())
+ static std::string getVersion(bool extended);
+
/// @brief Main server processing loop.
///
/// Main server processing loop. Receives incoming packets, verifies
break;
case 'v':
- cout << Daemon::getVersion(false) << endl;
+ cout << Dhcpv4Srv::getVersion(false) << endl;
return (EXIT_SUCCESS);
case 'V':
- cout << Daemon::getVersion(true) << endl;
+ cout << Dhcpv4Srv::getVersion(true) << endl;
return (EXIT_SUCCESS);
case 'p':
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
+dhcp4_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
endif
noinst_EXTRA_DIST = configs-list.txt
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/cc -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += $(BOOST_INCLUDES)
+if HAVE_MYSQL
+AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
+endif
+if HAVE_PGSQL
+AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
+endif
AM_CXXFLAGS = $(KEA_CXXFLAGS)
if USE_CLANGPP
kea_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+kea_dhcp6_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+kea_dhcp6_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
kea_dhcp6dir = $(pkgdatadir)
kea_dhcp6_DATA = dhcp6.spec
#include <util/encode/hex.h>
#include <util/io_utilities.h>
#include <util/range_utilities.h>
+#include <log/logger.h>
+#include <cryptolink/cryptolink.h>
+#include <cfgrpt/config_report.h>
+
+#ifdef HAVE_MYSQL
+#include <dhcpsrv/mysql_lease_mgr.h>
+#else
+#ifdef HAVE_PGSQL
+#include <dhcpsrv/pgsql_lease_mgr.h>
+#else
+#include <dhcpsrv/memfile_lease_mgr.h>
+#endif
+#endif
#include <asio.hpp>
using namespace isc;
using namespace isc::asiolink;
-using namespace isc::dhcp_ddns;
+using namespace isc::cryptolink;
using namespace isc::dhcp;
+using namespace isc::dhcp_ddns;
using namespace isc::hooks;
+using namespace isc::log;
using namespace isc::util;
using namespace std;
CfgMgr::instance().getD2ClientMgr().suspendUpdates();
}
+// Refer to config_report so it will be embedded in the binary
+const char* const* dhcp6_config_report = isc::detail::config_report;
+
std::string
-Daemon::getVersion(bool extended) {
+Dhcpv6Srv::getVersion(bool extended) {
std::stringstream tmp;
tmp << VERSION;
if (extended) {
tmp << endl << EXTENDED_VERSION;
-
- // @todo print more details (is it Botan or OpenSSL build,
- // with or without MySQL/Postgres? What compilation options were
- // used? etc)
+ tmp << endl << EXTENDED_VERSION << endl;
+ tmp << "linked with " << Logger::getVersion() << endl;
+ tmp << "and " << CryptoLink::getVersion() << endl;
+#ifdef HAVE_MYSQL
+ tmp << "database: " << MySqlLeaseMgr::getDBVersion();
+#else
+#ifdef HAVE_PGSQL
+ tmp << "database: " << PgSqlLeaseMgr::getDBVersion();
+#else
+ tmp << "database: " << Memfile_LeaseMgr::getDBVersion();
+#endif
+#endif
+ // @todo: more details about database runtime
}
return (tmp.str());
/// @brief Destructor. Used during DHCPv6 service shutdown.
virtual ~Dhcpv6Srv();
+ /// @brief returns Kea version on stdout and exit.
+ /// redeclaration/redefinition. @ref Daemon::getVersion())
+ static std::string getVersion(bool extended);
+
/// @brief Returns server-indentifier option.
///
/// @return server-id option
break;
case 'v':
- cout << Daemon::getVersion(false) << endl;
+ cout << Dhcpv6Srv::getVersion(false) << endl;
return (EXIT_SUCCESS);
case 'V':
- cout << Daemon::getVersion(true) << endl;
+ cout << Dhcpv6Srv::getVersion(true) << endl;
return (EXIT_SUCCESS);
case 'p': // port number
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/io/libkea-util-io.la
+dhcp6_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
endif
noinst_PROGRAMS = $(TESTS)
kea_lfc_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
kea_lfc_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
kea_lfc_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+kea_lfc_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
kea_lfcdir = $(pkgdatadir)
#include <dhcpsrv/lease_file_loader.h>
#include <log/logger_manager.h>
#include <log/logger_name.h>
+#include <cfgrpt/config_report.h>
#include <iostream>
#include <sstream>
namespace isc {
namespace lfc {
+// Refer to config_report so it will be embedded in the binary
+const char* const* lfc_config_report = isc::detail::config_report;
+
/// @brief Defines the application name, it may be used to locate
/// configuration data and appears in log statements.
const char* LFCController::lfc_app_name_ = "DhcpLFC";
lfc_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
lfc_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+lfc_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
endif
SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/log -I$(top_builddir)/src/lib/log
AM_CPPFLAGS += $(BOOST_INCLUDES)
perfdhcp_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
perfdhcp_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
perfdhcp_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-
+perfdhcp_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
# ... and the documentation
EXTRA_DIST = perfdhcp_internals.dox
#include <exceptions/exceptions.h>
#include <dhcp/iface_mgr.h>
#include <dhcp/duid.h>
+#include <cfgrpt/config_report.h>
#include <boost/lexical_cast.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
namespace isc {
namespace perfdhcp {
+// Refer to config_report so it will be embedded in the binary
+const char* const* perfdhcp_config_report = isc::detail::config_report;
+
CommandOptions::LeaseType::LeaseType()
: type_(ADDRESS) {
}
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
+run_unittests_LDADD += $(top_builddir)/src/bin/cfgrpt/libcfgrpt.la
run_unittests_LDADD += $(GTEST_LDADD)
endif
-// Copyright (C) 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015 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
}
}
+std::string
+CryptoLink::getVersion() {
+ return (Botan::version_string());
+}
+
} // namespace cryptolink
} // namespace isc
-// Copyright (C) 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015 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
///
static void initialize();
+ /// \brief Get version string
+ static std::string getVersion();
+
/// \brief Factory function for Hash objects
///
/// CryptoLink objects cannot be constructed directly. This
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015 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
#include <cryptolink/crypto_hash.h>
#include <cryptolink/crypto_hmac.h>
+#include <openssl/crypto.h>
+
namespace isc {
namespace cryptolink {
}
}
+std::string
+CryptoLink::getVersion() {
+ return (SSLeay_version(SSLEAY_VERSION));
+}
+
} // namespace cryptolink
} // namespace isc
-// Copyright (C) 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015 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
using namespace isc::cryptolink;
+// Test get version
+TEST(CryptoLinkTest, Version) {
+ EXPECT_NO_THROW(CryptoLink::getVersion());
+}
+
// Tests whether getCryptoLink() returns a singleton instance
TEST(CryptoLinkTest, Singleton) {
const CryptoLink& c1 = CryptoLink::getCryptoLink();
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015 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
isc::log::setDefaultLoggingOutput(verbose);
}
+std::string Daemon::getVersion(bool /*extended*/) {
+ isc_throw(isc::NotImplemented, "Daemon::getVersion() called");
+}
+
};
};
/// also additional information about sources. It is expected to
/// return extra information about dependencies and used DB backends.
///
+ /// As there is no static virtual methods in C++ this class method
+ /// has to be redefined in derived classes and called with the
+ /// derived class name or a child name.
+ ///
/// @param extended print additional information?
/// @return text string
static std::string getVersion(bool extended);
return (*col.begin());
}
+std::string
+LeaseMgr::getDBVersion() {
+ isc_throw(NotImplemented, "LeaseMgr::getDBVersion() called");
+}
+
} // namespace isc::dhcp
} // namespace isc
virtual ~LeaseMgr()
{}
+ /// @brief Class method to return extended version info
+ /// This class method must be redeclared and redefined in derived classes
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
}
}
+std::string
+Memfile_LeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "Memfile backend " << MAJOR_VERSION;
+ tmp << "." << MINOR_VERSION;
+ return (tmp.str());
+}
+
bool
Memfile_LeaseMgr::addLease(const Lease4Ptr& lease) {
LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
/// @brief Destructor (closes file)
virtual ~Memfile_LeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease.
///
/// @param lease lease to be added
// closed in the destructor of the mysql_ member variable.
}
+std::string
+MySqlLeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "MySQL backend " << CURRENT_VERSION_VERSION;
+ tmp << "." << CURRENT_VERSION_MINOR;
+ tmp << " library " << mysql_get_client_info();
+ return (tmp.str());
+}
+
// Time conversion methods.
//
/// @brief Destructor (closes database)
virtual ~MySqlLeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added
}
}
+std::string
+PgSqlLeaseMgr::getDBVersion() {
+ std::stringstream tmp;
+ tmp << "PostgreSQL backend " << PG_CURRENT_VERSION;
+ tmp << "." << PG_CURRENT_MINOR;
+ tmp << " library " << PQlibVersion();
+ return (tmp.str());
+}
+
void
PgSqlLeaseMgr::prepareStatements() {
for(int i = 0; tagged_statements[i].text != NULL; ++ i) {
/// @brief Destructor (closes database)
virtual ~PgSqlLeaseMgr();
+ /// @brief Local version of getDBVersion() class method
+ static std::string getDBVersion();
+
/// @brief Adds an IPv4 lease
///
/// @param lease lease to be added
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014, 2015 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
using namespace isc::dhcp;
using namespace isc::data;
-std::string isc::dhcp::Daemon::getVersion(bool extended) {
+namespace isc {
+namespace dhcp {
+
+// @brief Derived Daemon class
+class DaemonImpl : public Daemon {
+public:
+ static std::string getVersion(bool extended);
+};
+
+std::string DaemonImpl::getVersion(bool extended) {
if (extended) {
return (std::string("EXTENDED"));
} else {
}
}
+};
+};
+
namespace {
/// @brief Daemon Test test fixture class
EXPECT_EQ("stdout" , storage->getLoggingInfo()[0].destinations_[0].output_);
}
+// Test the getVersion() redefinition
+TEST_F(DaemonTest, getVersion) {
+ EXPECT_THROW(Daemon::getVersion(false), NotImplemented);
+
+ ASSERT_NO_THROW(DaemonImpl::getVersion(false));
+
+ EXPECT_EQ(DaemonImpl::getVersion(true), "EXTENDED");
+}
+
// More tests will appear here as we develop Daemon class.
-// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015 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
loggerptr_ = 0;
}
+// Get Version
+std::string
+Logger::getVersion() {
+ return (LoggerImpl::getVersion());
+}
+
// Get Name of Logger
std::string
-// Copyright (C) 2011, 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014, 2015 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
/// \brief Destructor
virtual ~Logger();
+ /// \brief Version
+ static std::string getVersion();
+
/// \brief The formatter used to replace placeholders
typedef isc::log::Formatter<Logger> Formatter;
-// Copyright (C) 2011,2014-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2014-2015 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
#include <stdarg.h>
#include <stdio.h>
#include <cstring>
+#include <sstream>
#include <boost/lexical_cast.hpp>
#include <boost/static_assert.hpp>
#include <boost/algorithm/string.hpp>
+#include <log4cplus/version.h>
#include <log4cplus/configurator.h>
#include <log4cplus/loggingmacros.h>
delete sync_;
}
+/// \brief Version
+std::string
+LoggerImpl::getVersion() {
+ std::ostringstream ver;
+ ver << "log4plus ";
+ ver << log4cplus::versionStr;
+ return (ver.str());
+}
+
// Set the severity for logging.
void
LoggerImpl::setSeverity(isc::log::Severity severity, int dbglevel) {
-// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015 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
virtual ~LoggerImpl();
+ /// \brief Version
+ static std::string getVersion();
+
+
/// \brief Get the full name of the logger (including the root name)
virtual std::string getName() {
return (name_);
}
};
+// Check version
+
+TEST_F(LoggerTest, Version) {
+ EXPECT_NO_THROW(Logger::getVersion());
+}
// Checks that the logger is named correctly.