diff options
author | Razvan Becheriu <razvan@isc.org> | 2024-09-11 17:14:09 +0200 |
---|---|---|
committer | Razvan Becheriu <razvan@isc.org> | 2024-09-16 15:31:01 +0200 |
commit | 09a17d0d8d1ad620c176b55fbcbf0e3fabc5f628 (patch) | |
tree | f1c5c366c8028c2aaa750c9b84da1ec5688c0565 /src/lib | |
parent | [#3542] Added ChangeLog entry (diff) | |
download | kea-09a17d0d8d1ad620c176b55fbcbf0e3fabc5f628.tar.xz kea-09a17d0d8d1ad620c176b55fbcbf0e3fabc5f628.zip |
[#3536] move lease and host backends
Diffstat (limited to 'src/lib')
18 files changed, 87 insertions, 38 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index f69bf37d18..0f77fc48da 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -22,3 +22,14 @@ SUBDIRS += yang endif SUBDIRS += asiodns dhcp_ddns eval process dhcpsrv d2srv + +if HAVE_MYSQL +SUBDIRS += mysql_lease_backend +SUBDIRS += mysql_host_backend +endif + +if HAVE_PGSQL +SUBDIRS += pgsql_lease_backend +SUBDIRS += pgsql_host_backend +endif + diff --git a/src/lib/dhcpsrv/Makefile.am b/src/lib/dhcpsrv/Makefile.am index e56ed12bce..1c2f5d8e03 100644 --- a/src/lib/dhcpsrv/Makefile.am +++ b/src/lib/dhcpsrv/Makefile.am @@ -128,21 +128,9 @@ libkea_dhcpsrv_la_SOURCES += lease_mgr_factory.cc lease_mgr_factory.h libkea_dhcpsrv_la_SOURCES += memfile_lease_limits.cc memfile_lease_limits.h libkea_dhcpsrv_la_SOURCES += memfile_lease_mgr.cc memfile_lease_mgr.h libkea_dhcpsrv_la_SOURCES += memfile_lease_storage.h - -if HAVE_MYSQL -libkea_dhcpsrv_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h -libkea_dhcpsrv_la_SOURCES += mysql_host_data_source.cc mysql_host_data_source.h -endif - libkea_dhcpsrv_la_SOURCES += ncr_generator.cc ncr_generator.h libkea_dhcpsrv_la_SOURCES += network.cc network.h libkea_dhcpsrv_la_SOURCES += network_state.cc network_state.h - -if HAVE_PGSQL -libkea_dhcpsrv_la_SOURCES += pgsql_host_data_source.cc pgsql_host_data_source.h -libkea_dhcpsrv_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h -endif - libkea_dhcpsrv_la_SOURCES += pool.cc pool.h libkea_dhcpsrv_la_SOURCES += random_allocation_state.cc random_allocation_state.h libkea_dhcpsrv_la_SOURCES += random_allocator.cc random_allocator.h @@ -206,14 +194,6 @@ libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.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 -if HAVE_PGSQL -libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la -endif - libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la libkea_dhcpsrv_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la @@ -226,12 +206,6 @@ libkea_dhcpsrv_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) libkea_dhcpsrv_la_LDFLAGS = -no-undefined -version-info 121:0:0 libkea_dhcpsrv_la_LDFLAGS += $(CRYPTO_LDFLAGS) -if HAVE_MYSQL -libkea_dhcpsrv_la_LDFLAGS += $(MYSQL_LIBS) -endif -if HAVE_PGSQL -libkea_dhcpsrv_la_LDFLAGS += $(PGSQL_LIBS) -endif # The message file should be in the distribution EXTRA_DIST += alloc_engine_messages.mes @@ -382,18 +356,6 @@ libkea_dhcpsrv_include_HEADERS = \ utils.h \ writable_host_data_source.h -if HAVE_MYSQL -libkea_dhcpsrv_include_HEADERS += \ - mysql_host_data_source.h \ - mysql_lease_mgr.h -endif - -if HAVE_PGSQL -libkea_dhcpsrv_include_HEADERS += \ - pgsql_host_data_source.h \ - pgsql_lease_mgr.h -endif - if ENABLE_AFL libkea_dhcpsrv_include_HEADERS += \ fuzz.h \ diff --git a/src/lib/mysql_host_backend/Makefile.am b/src/lib/mysql_host_backend/Makefile.am new file mode 100644 index 0000000000..2469a386b3 --- /dev/null +++ b/src/lib/mysql_host_backend/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = . tests + +AM_CXXFLAGS = $(KEA_CXXFLAGS) + +CLEANFILES = *.gcno *.gcda + +lib_LTLIBRARIES = libkea-mysql-host-backend.la + +libkea_mysql_host_backend_la_SOURCES = mysql_host_data_source.cc mysql_host_data_source.h + +libkea_mysql_host_backend_la_LIBADD = $(top_builddir)/src/lib/mysql/libkea-mysql.la + +libkea_mysql_host_backend_la_LDFLAGS = $(MYSQL_LIBS) + +# Specify the headers for copying into the installation directory tree. +libkea_mysql_host_backend_includedir = $(pkgincludedir)/mysql_host_backend + +libkea_mysql_host_backend_include_HEADERS = \ + mysql_host_data_source.h diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/mysql_host_backend/mysql_host_data_source.cc index 87559d0a5c..87559d0a5c 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/src/lib/mysql_host_backend/mysql_host_data_source.cc diff --git a/src/lib/dhcpsrv/mysql_host_data_source.h b/src/lib/mysql_host_backend/mysql_host_data_source.h index 10643d1183..10643d1183 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.h +++ b/src/lib/mysql_host_backend/mysql_host_data_source.h diff --git a/src/lib/mysql_host_backend/tests/Makefile.am b/src/lib/mysql_host_backend/tests/Makefile.am new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/lib/mysql_host_backend/tests/Makefile.am diff --git a/src/lib/mysql_lease_backend/Makefile.am b/src/lib/mysql_lease_backend/Makefile.am new file mode 100644 index 0000000000..85d94126ec --- /dev/null +++ b/src/lib/mysql_lease_backend/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = . tests + +AM_CXXFLAGS = $(KEA_CXXFLAGS) + +CLEANFILES = *.gcno *.gcda + +lib_LTLIBRARIES = libkea-mysql-lease-backend.la + +libkea_mysql_lease_backend_la_SOURCES = mysql_lease_mgr.cc mysql_lease_mgr.h + +libkea_mysql_lease_backend_la_LIBADD = $(top_builddir)/src/lib/mysql/libkea-mysql.la + +libkea_mysql_lease_backend_la_LDFLAGS = $(MYSQL_LIBS) + +# Specify the headers for copying into the installation directory tree. +libkea_mysql_lease_backend_includedir = $(pkgincludedir)/mysql_lease_backend + +libkea_mysql_lease_backend_include_HEADERS = \ + mysql_lease_mgr.h diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/mysql_lease_backend/mysql_lease_mgr.cc index b403d66ae1..b403d66ae1 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/mysql_lease_backend/mysql_lease_mgr.cc diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.h b/src/lib/mysql_lease_backend/mysql_lease_mgr.h index af1c964eaf..af1c964eaf 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.h +++ b/src/lib/mysql_lease_backend/mysql_lease_mgr.h diff --git a/src/lib/mysql_lease_backend/tests/Makefile.am b/src/lib/mysql_lease_backend/tests/Makefile.am new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/lib/mysql_lease_backend/tests/Makefile.am diff --git a/src/lib/pgsql_host_backend/Makefile.am b/src/lib/pgsql_host_backend/Makefile.am new file mode 100644 index 0000000000..ac788ea45b --- /dev/null +++ b/src/lib/pgsql_host_backend/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = . tests + +AM_CXXFLAGS = $(KEA_CXXFLAGS) + +CLEANFILES = *.gcno *.gcda + +lib_LTLIBRARIES = libkea-pgsql-host-backend.la + +libkea_pgsql_host_backend_la_SOURCES = pgsql_host_data_source.cc pgsql_host_data_source.h + +libkea_pgsql_host_backend_la_LIBADD = $(top_builddir)/src/lib/pgsql/libkea-pgsql.la + +libkea_pgsql_host_backend_la_LDFLAGS = $(PGSQL_LIBS) + +# Specify the headers for copying into the installation directory tree. +libkea_pgsql_host_backend_includedir = $(pkgincludedir)/pgsql_host_backend + +libkea_pgsql_host_backend_include_HEADERS = \ + pgsql_host_data_source.h diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.cc b/src/lib/pgsql_host_backend/pgsql_host_data_source.cc index 249e549165..249e549165 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.cc +++ b/src/lib/pgsql_host_backend/pgsql_host_data_source.cc diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.h b/src/lib/pgsql_host_backend/pgsql_host_data_source.h index 61043c575a..61043c575a 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.h +++ b/src/lib/pgsql_host_backend/pgsql_host_data_source.h diff --git a/src/lib/pgsql_host_backend/tests/Makefile.am b/src/lib/pgsql_host_backend/tests/Makefile.am new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/lib/pgsql_host_backend/tests/Makefile.am diff --git a/src/lib/pgsql_lease_backend/Makefile.am b/src/lib/pgsql_lease_backend/Makefile.am new file mode 100644 index 0000000000..87b33d9a54 --- /dev/null +++ b/src/lib/pgsql_lease_backend/Makefile.am @@ -0,0 +1,19 @@ +SUBDIRS = . tests + +AM_CXXFLAGS = $(KEA_CXXFLAGS) + +CLEANFILES = *.gcno *.gcda + +lib_LTLIBRARIES = libkea-pgsql-lease-backend.la + +libkea_pgsql_lease_backend_la_SOURCES = pgsql_lease_mgr.cc pgsql_lease_mgr.h + +libkea_pgsql_lease_backend_la_LIBADD = $(top_builddir)/src/lib/pgsql/libkea-pgsql.la + +libkea_pgsql_lease_backend_la_LDFLAGS = $(PGSQL_LIBS) + +# Specify the headers for copying into the installation directory tree. +libkea_pgsql_lease_backend_includedir = $(pkgincludedir)/pgsql_lease_backend + +libkea_pgsql_lease_backend_include_HEADERS = \ + pgsql_lease_mgr.h diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.cc b/src/lib/pgsql_lease_backend/pgsql_lease_mgr.cc index c860ebbf6b..c860ebbf6b 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.cc +++ b/src/lib/pgsql_lease_backend/pgsql_lease_mgr.cc diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.h b/src/lib/pgsql_lease_backend/pgsql_lease_mgr.h index d6bc94a212..d6bc94a212 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.h +++ b/src/lib/pgsql_lease_backend/pgsql_lease_mgr.h diff --git a/src/lib/pgsql_lease_backend/tests/Makefile.am b/src/lib/pgsql_lease_backend/tests/Makefile.am new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/src/lib/pgsql_lease_backend/tests/Makefile.am |