summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2018-08-30 12:49:34 +0200
committerMarcin Siodelski <marcin@isc.org>2018-09-03 09:31:34 +0200
commit1d9c696fbdd6385fad6ceb1395ead3542073e3f5 (patch)
tree679a19f128252b87e3d4abc0638983fb90fb025b /src
parent[#92,!13] Moved PgSqlConnection and PgSqlExchange to libkea-pgsql. (diff)
downloadkea-1d9c696fbdd6385fad6ceb1395ead3542073e3f5.tar.xz
kea-1d9c696fbdd6385fad6ceb1395ead3542073e3f5.zip
[#92,!13] Moved CqlConnection and CqlExchange classes to libkea-cql.
Diffstat (limited to 'src')
-rw-r--r--src/bin/d2/Makefile.am3
-rw-r--r--src/bin/d2/tests/Makefile.am3
-rw-r--r--src/bin/dhcp4/Makefile.am3
-rw-r--r--src/bin/dhcp4/tests/Makefile.am3
-rw-r--r--src/bin/dhcp6/Makefile.am3
-rw-r--r--src/bin/dhcp6/tests/Makefile.am3
-rw-r--r--src/bin/lfc/Makefile.am3
-rw-r--r--src/bin/lfc/tests/Makefile.am3
-rw-r--r--src/lib/Makefile.am4
-rw-r--r--src/lib/cql/Makefile.am33
-rw-r--r--src/lib/cql/cql_connection.cc (renamed from src/lib/dhcpsrv/cql_connection.cc)8
-rw-r--r--src/lib/cql/cql_connection.h (renamed from src/lib/dhcpsrv/cql_connection.h)4
-rw-r--r--src/lib/cql/cql_exchange.cc (renamed from src/lib/dhcpsrv/cql_exchange.cc)12
-rw-r--r--src/lib/cql/cql_exchange.h (renamed from src/lib/dhcpsrv/cql_exchange.h)9
-rw-r--r--src/lib/cql/sql_common.h (renamed from src/lib/dhcpsrv/sql_common.h)5
-rw-r--r--src/lib/cql/tests/.gitignore1
-rw-r--r--src/lib/cql/tests/Makefile.am38
-rw-r--r--src/lib/cql/tests/cql_connection_unittest.cc (renamed from src/lib/dhcpsrv/tests/cql_connection_unittest.cc)15
-rw-r--r--src/lib/cql/tests/run_unittests.cc20
-rw-r--r--src/lib/dhcpsrv/Makefile.am9
-rw-r--r--src/lib/dhcpsrv/cql_host_data_source.cc2
-rw-r--r--src/lib/dhcpsrv/cql_host_data_source.h4
-rw-r--r--src/lib/dhcpsrv/cql_lease_mgr.h11
-rw-r--r--src/lib/dhcpsrv/lease_mgr.h1
-rw-r--r--src/lib/dhcpsrv/tests/Makefile.am1
-rw-r--r--src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc4
-rw-r--r--src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc2
-rw-r--r--src/lib/dhcpsrv/testutils/cql_schema.cc4
-rw-r--r--src/lib/mysql/Makefile.am2
-rw-r--r--src/lib/pgsql/Makefile.am5
-rw-r--r--src/lib/process/Makefile.am3
31 files changed, 167 insertions, 54 deletions
diff --git a/src/bin/d2/Makefile.am b/src/bin/d2/Makefile.am
index f529ae55a8..2cea3a7232 100644
--- a/src/bin/d2/Makefile.am
+++ b/src/bin/d2/Makefile.am
@@ -104,6 +104,9 @@ endif
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
diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am
index 609ca8ed57..ac2962469e 100644
--- a/src/bin/d2/tests/Makefile.am
+++ b/src/bin/d2/tests/Makefile.am
@@ -92,6 +92,9 @@ endif
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
diff --git a/src/bin/dhcp4/Makefile.am b/src/bin/dhcp4/Makefile.am
index b2376041f0..c975976aa4 100644
--- a/src/bin/dhcp4/Makefile.am
+++ b/src/bin/dhcp4/Makefile.am
@@ -91,6 +91,9 @@ endif
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
diff --git a/src/bin/dhcp4/tests/Makefile.am b/src/bin/dhcp4/tests/Makefile.am
index f913edf330..c236143438 100644
--- a/src/bin/dhcp4/tests/Makefile.am
+++ b/src/bin/dhcp4/tests/Makefile.am
@@ -138,6 +138,9 @@ endif
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
diff --git a/src/bin/dhcp6/Makefile.am b/src/bin/dhcp6/Makefile.am
index a624707824..e752b93b54 100644
--- a/src/bin/dhcp6/Makefile.am
+++ b/src/bin/dhcp6/Makefile.am
@@ -91,6 +91,9 @@ endif
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
diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am
index 119fa169bc..e6af5b61f6 100644
--- a/src/bin/dhcp6/tests/Makefile.am
+++ b/src/bin/dhcp6/tests/Makefile.am
@@ -142,6 +142,9 @@ endif
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
diff --git a/src/bin/lfc/Makefile.am b/src/bin/lfc/Makefile.am
index 33c3db56e4..463c7be8c2 100644
--- a/src/bin/lfc/Makefile.am
+++ b/src/bin/lfc/Makefile.am
@@ -68,6 +68,9 @@ endif
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
diff --git a/src/bin/lfc/tests/Makefile.am b/src/bin/lfc/tests/Makefile.am
index 6f7a955764..59b7465b6f 100644
--- a/src/bin/lfc/tests/Makefile.am
+++ b/src/bin/lfc/tests/Makefile.am
@@ -68,6 +68,9 @@ endif
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
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 14ecc0bb92..0373e3f820 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -9,6 +9,10 @@ if HAVE_PGSQL
SUBDIRS += pgsql
endif
+if HAVE_CQL
+SUBDIRS += cql
+endif
+
SUBDIRS += testutils hooks dhcp config stats asiodns dhcp_ddns eval \
dhcpsrv cfgrpt \
process http
diff --git a/src/lib/cql/Makefile.am b/src/lib/cql/Makefile.am
new file mode 100644
index 0000000000..28856fd85f
--- /dev/null
+++ b/src/lib/cql/Makefile.am
@@ -0,0 +1,33 @@
+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
diff --git a/src/lib/dhcpsrv/cql_connection.cc b/src/lib/cql/cql_connection.cc
index 3c32cff820..e60da1d8b2 100644
--- a/src/lib/dhcpsrv/cql_connection.cc
+++ b/src/lib/cql/cql_connection.cc
@@ -18,17 +18,15 @@
#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),
diff --git a/src/lib/dhcpsrv/cql_connection.h b/src/lib/cql/cql_connection.h
index f7bb963133..fa70ff90cf 100644
--- a/src/lib/dhcpsrv/cql_connection.h
+++ b/src/lib/cql/cql_connection.h
@@ -32,7 +32,7 @@
#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
@@ -211,7 +211,7 @@ public:
typedef std::shared_ptr<CqlConnection> CqlConnectionPtr;
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // CQL_CONNECTION_H
diff --git a/src/lib/dhcpsrv/cql_exchange.cc b/src/lib/cql/cql_exchange.cc
index 75a5a8911c..41d82f5df0 100644
--- a/src/lib/dhcpsrv/cql_exchange.cc
+++ b/src/lib/cql/cql_exchange.cc
@@ -18,10 +18,10 @@
#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>
@@ -37,10 +37,8 @@
#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) \
@@ -1007,5 +1005,5 @@ CqlVersionExchange::retrieveVersion(const CqlConnection& connection) {
return VersionPair();
}
-} // namespace dhcp
+} // namespace db
} // namespace isc
diff --git a/src/lib/dhcpsrv/cql_exchange.h b/src/lib/cql/cql_exchange.h
index c99f762e41..f30413e6c8 100644
--- a/src/lib/dhcpsrv/cql_exchange.h
+++ b/src/lib/cql/cql_exchange.h
@@ -1,3 +1,4 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2017 Deutsche Telekom AG.
//
// Authors: Razvan Becheriu <razvan.becheriu@qualitance.com>
@@ -18,8 +19,8 @@
#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
@@ -30,7 +31,7 @@
#include <vector>
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Host identifier converted to Cassandra data type
typedef std::vector<cass_byte_t> CassBlob;
@@ -318,7 +319,7 @@ exchangeType(const boost::any& object);
ExchangeDataType
exchangeType(const CassValueType& type);
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // CQL_EXCHANGE_H
diff --git a/src/lib/dhcpsrv/sql_common.h b/src/lib/cql/sql_common.h
index 610abd62e1..a9e7e3865d 100644
--- a/src/lib/dhcpsrv/sql_common.h
+++ b/src/lib/cql/sql_common.h
@@ -1,3 +1,4 @@
+// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2017 Deutsche Telekom AG.
//
// Author: Cristian Secăreanu <cristian.secareanu@qualitance.com>
@@ -18,7 +19,7 @@
#define SQL_COMMON_H
namespace isc {
-namespace dhcp {
+namespace db {
/// @brief Used to map server data types with internal backend storage data
/// types.
@@ -49,7 +50,7 @@ public:
}
};
-} // namespace dhcp
+} // namespace db
} // namespace isc
#endif // SQL_COMMON_H
diff --git a/src/lib/cql/tests/.gitignore b/src/lib/cql/tests/.gitignore
new file mode 100644
index 0000000000..248092a24e
--- /dev/null
+++ b/src/lib/cql/tests/.gitignore
@@ -0,0 +1 @@
+/libcql_unittests
diff --git a/src/lib/cql/tests/Makefile.am b/src/lib/cql/tests/Makefile.am
new file mode 100644
index 0000000000..cc96dfb72c
--- /dev/null
+++ b/src/lib/cql/tests/Makefile.am
@@ -0,0 +1,38 @@
+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)
diff --git a/src/lib/dhcpsrv/tests/cql_connection_unittest.cc b/src/lib/cql/tests/cql_connection_unittest.cc
index 5d66802431..a35717db39 100644
--- a/src/lib/dhcpsrv/tests/cql_connection_unittest.cc
+++ b/src/lib/cql/tests/cql_connection_unittest.cc
@@ -1,3 +1,4 @@
+// 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
@@ -6,8 +7,8 @@
#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>
@@ -17,11 +18,11 @@
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:
diff --git a/src/lib/cql/tests/run_unittests.cc b/src/lib/cql/tests/run_unittests.cc
new file mode 100644
index 0000000000..4e83d4bd6c
--- /dev/null
+++ b/src/lib/cql/tests/run_unittests.cc
@@ -0,0 +1,20 @@
+// 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);
+}
diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am
index f6ccf62174..d9a6961a93 100644
--- a/src/lib/dhcpsrv/Makefile.am
+++ b/src/lib/dhcpsrv/Makefile.am
@@ -134,7 +134,6 @@ libkea_dhcpsrv_la_SOURCES += logging.cc logging.h
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
@@ -151,8 +150,6 @@ libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_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
@@ -219,6 +216,9 @@ 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
@@ -302,7 +302,6 @@ libkea_dhcpsrv_include_HEADERS = \
network_state.h \
pool.h \
shared_network.h \
- sql_common.h \
srv_config.h \
subnet.h \
subnet_id.h \
@@ -314,8 +313,6 @@ libkea_dhcpsrv_include_HEADERS = \
if HAVE_CQL
libkea_dhcpsrv_include_HEADERS += \
- cql_connection.h \
- cql_exchange.h \
cql_host_data_source.h \
cql_lease_mgr.h
endif
diff --git a/src/lib/dhcpsrv/cql_host_data_source.cc b/src/lib/dhcpsrv/cql_host_data_source.cc
index 56ad30ca20..a67d650fd8 100644
--- a/src/lib/dhcpsrv/cql_host_data_source.cc
+++ b/src/lib/dhcpsrv/cql_host_data_source.cc
@@ -17,6 +17,7 @@
#include <config.h>
+#include <cql/cql_exchange.h>
#include <database/db_exceptions.h>
#include <dhcpsrv/cql_host_data_source.h>
#include <dhcp/duid.h>
@@ -25,7 +26,6 @@
#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>
diff --git a/src/lib/dhcpsrv/cql_host_data_source.h b/src/lib/dhcpsrv/cql_host_data_source.h
index 091372bc09..7376892955 100644
--- a/src/lib/dhcpsrv/cql_host_data_source.h
+++ b/src/lib/dhcpsrv/cql_host_data_source.h
@@ -18,8 +18,8 @@
#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>
@@ -281,7 +281,7 @@ public:
///
/// @throw isc::db::DbOperationError An operation on the open database
/// has failed.
- virtual VersionPair getVersion() const;
+ virtual db::VersionPair getVersion() const;
/// @brief Commit Transactions
///
diff --git a/src/lib/dhcpsrv/cql_lease_mgr.h b/src/lib/dhcpsrv/cql_lease_mgr.h
index e4789add80..9292bfe0e9 100644
--- a/src/lib/dhcpsrv/cql_lease_mgr.h
+++ b/src/lib/dhcpsrv/cql_lease_mgr.h
@@ -19,9 +19,9 @@
#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>
@@ -34,11 +34,6 @@
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
@@ -568,7 +563,7 @@ public:
private:
/// @brief Database connection object
- mutable CqlConnection dbconn_;
+ mutable db::CqlConnection dbconn_;
};
} // namespace dhcp
diff --git a/src/lib/dhcpsrv/lease_mgr.h b/src/lib/dhcpsrv/lease_mgr.h
index 99e8ec936e..233f3539c8 100644
--- a/src/lib/dhcpsrv/lease_mgr.h
+++ b/src/lib/dhcpsrv/lease_mgr.h
@@ -15,7 +15,6 @@
#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>
diff --git a/src/lib/dhcpsrv/tests/Makefile.am b/src/lib/dhcpsrv/tests/Makefile.am
index 235e709963..a37c27bae9 100644
--- a/src/lib/dhcpsrv/tests/Makefile.am
+++ b/src/lib/dhcpsrv/tests/Makefile.am
@@ -114,7 +114,6 @@ libdhcpsrv_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
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
diff --git a/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc b/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
index 0afdf5dc27..1dbbd4473f 100644
--- a/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
@@ -17,12 +17,12 @@
#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>
diff --git a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
index 6fb33717bf..676116dac8 100644
--- a/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
@@ -19,8 +19,8 @@
#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>
diff --git a/src/lib/dhcpsrv/testutils/cql_schema.cc b/src/lib/dhcpsrv/testutils/cql_schema.cc
index abd7c19859..2df5324530 100644
--- a/src/lib/dhcpsrv/testutils/cql_schema.cc
+++ b/src/lib/dhcpsrv/testutils/cql_schema.cc
@@ -1,4 +1,4 @@
-// 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
@@ -8,7 +8,7 @@
#include <cassandra.h>
-#include <dhcpsrv/cql_connection.h>
+#include <cql/cql_connection.h>
#include <dhcpsrv/testutils/cql_schema.h>
#include <stdlib.h>
diff --git a/src/lib/mysql/Makefile.am b/src/lib/mysql/Makefile.am
index d1af246aab..fd2a8336e4 100644
--- a/src/lib/mysql/Makefile.am
+++ b/src/lib/mysql/Makefile.am
@@ -24,6 +24,6 @@ libkea_mysql_la_LDFLAGS = -no-undefined -version-info 0:0:0
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
diff --git a/src/lib/pgsql/Makefile.am b/src/lib/pgsql/Makefile.am
index 1a86faca3f..d9dc6515b9 100644
--- a/src/lib/pgsql/Makefile.am
+++ b/src/lib/pgsql/Makefile.am
@@ -26,6 +26,7 @@ libkea_pgsql_la_LDFLAGS = -no-undefined -version-info 0:0:0
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
diff --git a/src/lib/process/Makefile.am b/src/lib/process/Makefile.am
index 33f9692d7c..d65fbb66d6 100644
--- a/src/lib/process/Makefile.am
+++ b/src/lib/process/Makefile.am
@@ -62,6 +62,9 @@ endif
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