src/lib/mysql/Makefile
src/lib/pgsql/Makefile
src/lib/pgsql/tests/Makefile
+ src/lib/cql/Makefile
+ src/lib/cql/tests/Makefile
src/lib/process/Makefile
src/lib/process/tests/Makefile
src/lib/process/testutils/Makefile
if HAVE_PGSQL
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
if HAVE_PGSQL
d2_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+d2_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
d2_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
if HAVE_PGSQL
kea_dhcp4_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+kea_dhcp4_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
kea_dhcp4_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
if HAVE_PGSQL
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
dhcp4_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
if HAVE_PGSQL
kea_dhcp6_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+kea_dhcp6_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
kea_dhcp6_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
if HAVE_PGSQL
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
if HAVE_PGSQL
kea_lfc_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+kea_lfc_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
kea_lfc_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_lfc_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
if HAVE_PGSQL
lfc_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+lfc_unittests_LDADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
lfc_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
SUBDIRS += pgsql
endif
+if HAVE_CQL
+SUBDIRS += cql
+endif
+
SUBDIRS += testutils hooks dhcp config stats asiodns dhcp_ddns eval \
dhcpsrv cfgrpt \
process http
--- /dev/null
+SUBDIRS = . tests
+
+AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(CQL_CPPFLAGS)
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+CLEANFILES = *.gcno *.gcda
+
+lib_LTLIBRARIES = libkea-cql.la
+libkea_cql_la_SOURCES = cql_connection.cc cql_connection.h
+libkea_cql_la_SOURCES += cql_exchange.cc cql_exchange.h
+libkea_cql_la_SOURCES += sql_common.h
+
+libkea_cql_la_LIBADD = $(top_builddir)/src/lib/database/libkea-database.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
+libkea_cql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+libkea_cql_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
+
+libkea_cql_la_LDFLAGS = -no-undefined -version-info 0:0:0
+
+libkea_cql_la_LDFLAGS += $(CQL_LIBS)
+
+# Specify the headers for copying into the installation directory tree.
+libkea_cql_includedir = $(pkgincludedir)/cql
+libkea_cql_include_HEADERS = \
+ cql_connection.h \
+ cql_exchange.h \
+ sql_common.h
#include <config.h>
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
#include <database/db_exceptions.h>
#include <database/db_log.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
#include <string>
-using namespace isc::db;
-
namespace isc {
-namespace dhcp {
+namespace db {
CqlConnection::CqlConnection(const ParameterMap& parameters)
: DatabaseConnection(parameters), statements_(), cluster_(NULL),
#include <vector>
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Pair containing major and minor versions
/// @todo: This is already defined in lease_mgr.h. Need to have one
typedef std::shared_ptr<CqlConnection> CqlConnectionPtr;
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // CQL_CONNECTION_H
#include <config.h>
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
+#include <cql/sql_common.h>
#include <database/db_exceptions.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
-#include <dhcpsrv/sql_common.h>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/member.hpp>
#include <utility>
#include <vector>
-using namespace isc::db;
-
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Macro to return directly from caller function
#define KEA_CASS_CHECK(cass_error) \
return VersionPair();
}
-} // namespace dhcp
+} // namespace db
} // namespace isc
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2017 Deutsche Telekom AG.
//
// Authors: Razvan Becheriu <razvan.becheriu@qualitance.com>
#ifndef CQL_EXCHANGE_H
#define CQL_EXCHANGE_H
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/sql_common.h>
+#include <cql/cql_connection.h>
+#include <cql/sql_common.h>
#include <boost/any.hpp> // for boost::any
#include <vector>
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Host identifier converted to Cassandra data type
typedef std::vector<cass_byte_t> CassBlob;
ExchangeDataType
exchangeType(const CassValueType& type);
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // CQL_EXCHANGE_H
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2017 Deutsche Telekom AG.
//
// Author: Cristian Secăreanu <cristian.secareanu@qualitance.com>
#define SQL_COMMON_H
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Used to map server data types with internal backend storage data
/// types.
}
};
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // SQL_COMMON_H
--- /dev/null
+/libcql_unittests
--- /dev/null
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES)
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = \
+ $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+TESTS =
+if HAVE_GTEST
+TESTS += libcql_unittests
+
+libcql_unittests_SOURCES = cql_connection_unittest.cc
+libcql_unittests_SOURCES += run_unittests.cc
+
+libcql_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(CQL_CPPFLAGS)
+libcql_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) $(CQL_LIBS)
+
+libcql_unittests_LDADD = $(top_builddir)/src/lib/cql/libkea-cql.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+libcql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+libcql_unittests_LDADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
+
+endif
+
+noinst_PROGRAMS = $(TESTS)
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2017 Deutsche Telekom AG.
//
// This Source Code Form is subject to the terms of the Mozilla Public
#include <config.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
#include <cstring>
namespace {
-using isc::dhcp::CqlTaggedStatement;
-using isc::dhcp::StatementMap;
-using isc::dhcp::StatementTag;
-using isc::dhcp::StatementTagHash;
-using isc::dhcp::exchangeType;
+using isc::db::CqlTaggedStatement;
+using isc::db::StatementMap;
+using isc::db::StatementTag;
+using isc::db::StatementTagHash;
+using isc::db::exchangeType;
class CqlConnectionTest {
public:
--- /dev/null
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+//
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+#include <config.h>
+
+#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);
+}
libkea_dhcpsrv_la_SOURCES += logging_info.cc logging_info.h
libkea_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h
libkea_dhcpsrv_la_SOURCES += memfile_lease_storage.h
-libkea_dhcpsrv_la_SOURCES += sql_common.h
if HAVE_MYSQL
libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
endif
if HAVE_CQL
-libkea_dhcpsrv_la_SOURCES += cql_connection.cc cql_connection.h
-libkea_dhcpsrv_la_SOURCES += cql_exchange.cc cql_exchange.h
libkea_dhcpsrv_la_SOURCES += cql_host_data_source.cc cql_host_data_source.h
libkea_dhcpsrv_la_SOURCES += cql_lease_mgr.cc cql_lease_mgr.h
endif
if HAVE_PGSQL
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
network_state.h \
pool.h \
shared_network.h \
- sql_common.h \
srv_config.h \
subnet.h \
subnet_id.h \
if HAVE_CQL
libkea_dhcpsrv_include_HEADERS += \
- cql_connection.h \
- cql_exchange.h \
cql_host_data_source.h \
cql_lease_mgr.h
endif
#include <config.h>
+#include <cql/cql_exchange.h>
#include <database/db_exceptions.h>
#include <dhcpsrv/cql_host_data_source.h>
#include <dhcp/duid.h>
#include <dhcp/option_definition.h>
#include <dhcpsrv/cfg_option.h>
#include <dhcpsrv/cfgmgr.h>
-#include <dhcpsrv/cql_exchange.h>
#include <dhcpsrv/dhcpsrv_log.h>
#include <util/buffer.h>
#include <util/hash.h>
#ifndef CQL_HOST_DATA_SOURCE_H
#define CQL_HOST_DATA_SOURCE_H
+#include <cql/cql_connection.h>
#include <dhcpsrv/base_host_data_source.h>
-#include <dhcpsrv/cql_connection.h>
#include <string>
#include <vector>
///
/// @throw isc::db::DbOperationError An operation on the open database
/// has failed.
- virtual VersionPair getVersion() const;
+ virtual db::VersionPair getVersion() const;
/// @brief Commit Transactions
///
#ifndef CQL_LEASE_MGR_H
#define CQL_LEASE_MGR_H
+#include <cql/cql_connection.h>
+#include <cql/cql_exchange.h>
#include <dhcp/hwaddr.h>
-#include <dhcpsrv/cql_connection.h>
-#include <dhcpsrv/cql_exchange.h>
#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
namespace isc {
namespace dhcp {
-class CqlVersionExchange;
-class CqlLeaseExchange;
-class CqlLease4Exchange;
-class CqlLease6Exchange;
-
/// @brief Cassandra Lease Manager
///
/// This class provides the @ref isc::dhcp::LeaseMgr interface to the Cassandra
private:
/// @brief Database connection object
- mutable CqlConnection dbconn_;
+ mutable db::CqlConnection dbconn_;
};
} // namespace dhcp
#include <dhcp/hwaddr.h>
#include <dhcpsrv/lease.h>
#include <dhcpsrv/subnet.h>
-#include <dhcpsrv/sql_common.h>
#include <boost/noncopyable.hpp>
#include <boost/shared_ptr.hpp>
libdhcpsrv_unittests_SOURCES += pgsql_host_data_source_unittest.cc
endif
if HAVE_CQL
-libdhcpsrv_unittests_SOURCES += cql_connection_unittest.cc
libdhcpsrv_unittests_SOURCES += cql_lease_mgr_unittest.cc
libdhcpsrv_unittests_SOURCES += cql_host_data_source_unittest.cc
endif
#include <config.h>
-#include <exceptions/exceptions.h>
#include <asiolink/io_address.h>
+#include <exceptions/exceptions.h>
+#include <cql/cql_connection.h>
#include <dhcpsrv/host.h>
#include <dhcpsrv/host_mgr.h>
#include <dhcpsrv/host_data_source_factory.h>
-#include <dhcpsrv/cql_connection.h>
#include <dhcpsrv/cql_lease_mgr.h>
#include <dhcpsrv/cql_host_data_source.h>
#include <dhcpsrv/testutils/cql_schema.h>
#include <config.h>
#include <asiolink/io_address.h>
+#include <cql/cql_connection.h>
#include <dhcpsrv/lease_mgr_factory.h>
-#include <dhcpsrv/cql_connection.h>
#include <dhcpsrv/cql_lease_mgr.h>
#include <dhcpsrv/tests/test_utils.h>
#include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
#include <cassandra.h>
-#include <dhcpsrv/cql_connection.h>
+#include <cql/cql_connection.h>
#include <dhcpsrv/testutils/cql_schema.h>
#include <stdlib.h>
libkea_mysql_la_LDFLAGS += $(MYSQL_LIBS)
# Specify the headers for copying into the installation directory tree.
-libkea_mysql_includedir = $(pkgincludedir)/database
+libkea_mysql_includedir = $(pkgincludedir)/mysql
libkea_mysql_include_HEADERS = \
mysql_connection.h
libkea_pgsql_la_LDFLAGS += $(PGSQL_LIBS)
# Specify the headers for copying into the installation directory tree.
-libkea_pgsql_includedir = $(pkgincludedir)/database
+libkea_pgsql_includedir = $(pkgincludedir)/pgsql
libkea_pgsql_include_HEADERS = \
- pgsql_connection.h
+ pgsql_connection.h \
+ pgsql_exchange.h
if HAVE_PGSQL
libkea_process_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
endif
+if HAVE_CQL
+libkea_process_la_LIBADD += $(top_builddir)/src/lib/cql/libkea-cql.la
+endif
libkea_process_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la