Commit 8300f8c9 authored by Marcin Siodelski's avatar Marcin Siodelski

[#92,!13] Moved MySqlConnection class to libkea-mysql library.

parent 4255e8fc
......@@ -1572,6 +1572,7 @@ AC_CONFIG_FILES([Makefile
src/lib/log/tests/logger_lock_test.sh
src/lib/log/tests/severity_test.sh
src/lib/log/tests/tempdir.h
src/lib/mysql/Makefile
src/lib/process/Makefile
src/lib/process/tests/Makefile
src/lib/process/testutils/Makefile
......
......@@ -97,6 +97,12 @@ kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
if HAVE_MYSQL
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.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
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_dhcp_ddns_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
......
......@@ -85,6 +85,12 @@ d2_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
d2_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
if HAVE_MYSQL
d2_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
endif
d2_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
......
......@@ -84,6 +84,11 @@ kea_dhcp4_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
if HAVE_MYSQL
kea_dhcp4_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
endif
kea_dhcp4_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp4_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
......
......@@ -84,6 +84,11 @@ kea_dhcp6_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
if HAVE_MYSQL
kea_dhcp6_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
endif
kea_dhcp6_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
kea_dhcp6_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
......
......@@ -135,6 +135,11 @@ dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
if HAVE_MYSQL
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
endif
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
......
# The following build order must be maintained.
SUBDIRS = exceptions util log cryptolink dns asiolink cc database testutils \
hooks dhcp config stats asiodns dhcp_ddns eval dhcpsrv cfgrpt \
process http
SUBDIRS = exceptions util log cryptolink dns asiolink cc database
if HAVE_MYSQL
SUBDIRS += mysql
endif
SUBDIRS += testutils hooks dhcp config stats asiodns dhcp_ddns eval \
dhcpsrv cfgrpt \
process http
......@@ -20,7 +20,7 @@ BUILT_SOURCES = db_messages.h db_messages.cc
EXTRA_DIST = db_messages.mes
# Get rid of generated message files on a clean
CLEANFILES = *.gcno *.gcda http_messages.h http_messages.cc s-messages
CLEANFILES = *.gcno *.gcda db_messages.h db_messages.cc s-messages
lib_LTLIBRARIES = libkea-database.la
libkea_database_la_SOURCES = database_connection.cc database_connection.h
......
......@@ -138,7 +138,6 @@ libkea_dhcpsrv_la_SOURCES += sql_common.h
if HAVE_MYSQL
libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
libkea_dhcpsrv_la_SOURCES += mysql_connection.cc mysql_connection.h
libkea_dhcpsrv_la_SOURCES += mysql_host_data_source.cc mysql_host_data_source.h
endif
......@@ -215,6 +214,11 @@ libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
if HAVE_MYSQL
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.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
libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
......@@ -317,7 +321,6 @@ endif
if HAVE_MYSQL
libkea_dhcpsrv_include_HEADERS += \
mysql_connection.h \
mysql_host_data_source.h \
mysql_lease_mgr.h
endif
......
......@@ -9,7 +9,7 @@
#include <database/db_exceptions.h>
#include <dhcpsrv/base_host_data_source.h>
#include <dhcpsrv/mysql_connection.h>
#include <mysql/mysql_connection.h>
#include <stdint.h>
......
......@@ -11,7 +11,7 @@
#include <dhcp/hwaddr.h>
#include <dhcpsrv/dhcpsrv_log.h>
#include <dhcpsrv/mysql_lease_mgr.h>
#include <dhcpsrv/mysql_connection.h>
#include <mysql/mysql_connection.h>
#include <boost/array.hpp>
#include <boost/static_assert.hpp>
......
......@@ -10,7 +10,7 @@
#include <dhcp/hwaddr.h>
#include <dhcpsrv/dhcpsrv_exceptions.h>
#include <dhcpsrv/lease_mgr.h>
#include <dhcpsrv/mysql_connection.h>
#include <mysql/mysql_connection.h>
#include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp>
......@@ -803,7 +803,7 @@ private:
boost::scoped_ptr<MySqlLease6Exchange> exchange6_; ///< Exchange object
/// @brief MySQL connection
MySqlConnection conn_;
db::MySqlConnection conn_;
};
} // namespace dhcp
......
......@@ -170,6 +170,11 @@ libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
if HAVE_MYSQL
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
endif
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
libdhcpsrv_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
......
......@@ -10,13 +10,13 @@
#include <dhcpsrv/tests/test_utils.h>
#include <exceptions/exceptions.h>
#include <dhcpsrv/host.h>
#include <dhcpsrv/mysql_connection.h>
#include <dhcpsrv/mysql_host_data_source.h>
#include <dhcpsrv/testutils/generic_host_data_source_unittest.h>
#include <dhcpsrv/testutils/mysql_schema.h>
#include <dhcpsrv/testutils/host_data_source_utils.h>
#include <dhcpsrv/host_mgr.h>
#include <dhcpsrv/host_data_source_factory.h>
#include <mysql/mysql_connection.h>
#include <gtest/gtest.h>
......
......@@ -8,12 +8,12 @@
#include <asiolink/io_address.h>
#include <dhcpsrv/lease_mgr_factory.h>
#include <dhcpsrv/mysql_connection.h>
#include <dhcpsrv/mysql_lease_mgr.h>
#include <dhcpsrv/tests/test_utils.h>
#include <dhcpsrv/tests/generic_lease_mgr_unittest.h>
#include <dhcpsrv/testutils/mysql_schema.h>
#include <exceptions/exceptions.h>
#include <mysql/mysql_connection.h>
#include <gtest/gtest.h>
......
// Copyright (C) 2015-2016 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
......@@ -7,8 +7,8 @@
#include <config.h>
#include <string>
#include <mysql.h>
#include <dhcpsrv/mysql_connection.h>
#include <dhcpsrv/testutils/mysql_schema.h>
#include <mysql/mysql_connection.h>
#include <fstream>
#include <iostream>
......
SUBDIRS = .
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
AM_CXXFLAGS = $(KEA_CXXFLAGS)
CLEANFILES = *.gcno *.gcda
lib_LTLIBRARIES = libkea-mysql.la
libkea_mysql_la_SOURCES = mysql_connection.cc mysql_connection.h
libkea_mysql_la_LIBADD = $(top_builddir)/src/lib/database/libkea-database.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
libkea_mysql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
libkea_mysql_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS)
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_include_HEADERS = \
mysql_connection.h
......@@ -8,8 +8,8 @@
#include <config.h>
#include <database/db_log.h>
#include <dhcpsrv/mysql_connection.h>
#include <exceptions/exceptions.h>
#include <mysql/mysql_connection.h>
#include <boost/lexical_cast.hpp>
......@@ -19,12 +19,10 @@
#include <limits>
using namespace isc;
using namespace isc::db;
using namespace isc::dhcp;
using namespace std;
namespace isc {
namespace dhcp {
namespace db {
const my_bool MLM_FALSE = 0;
const my_bool MLM_TRUE = 1;
......@@ -400,5 +398,5 @@ MySqlConnection::rollback() {
}
} // namespace isc::dhcp
} // namespace isc::db
} // namespace isc
......@@ -18,7 +18,7 @@
#include <stdint.h>
namespace isc {
namespace dhcp {
namespace db {
/// @name MySQL constants.
///
......@@ -436,7 +436,7 @@ public:
MySqlHolder mysql_;
};
}; // end of isc::dhcp namespace
}; // end of isc::db namespace
}; // end of isc namespace
#endif // MYSQL_CONNECTION_H
......@@ -55,6 +55,12 @@ libkea_process_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
if HAVE_MYSQL
libkea_process_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.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
libkea_process_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
libkea_process_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment