]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3536] merge mysql and pgsql hooks
authorRazvan Becheriu <razvan@isc.org>
Tue, 1 Oct 2024 12:27:45 +0000 (15:27 +0300)
committerRazvan Becheriu <razvan@isc.org>
Thu, 3 Oct 2024 18:04:37 +0000 (21:04 +0300)
157 files changed:
configure.ac
doc/sphinx/mes-files.txt
doc/sphinx/mes_files.mk
src/bin/dhcp4/tests/Makefile.am
src/bin/dhcp4/tests/decline_unittest.cc
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp6/tests/Makefile.am
src/bin/dhcp6/tests/decline_unittest.cc
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/hooks/dhcp/Makefile.am
src/hooks/dhcp/mysql/.gitattributes [new file with mode: 0644]
src/hooks/dhcp/mysql/Makefile.am [new file with mode: 0644]
src/hooks/dhcp/mysql/libloadtests/.gitignore [moved from src/hooks/dhcp/mysql_cb/libloadtests/.gitignore with 100% similarity]
src/hooks/dhcp/mysql/libloadtests/Makefile.am [moved from src/hooks/dhcp/mysql_lb/libloadtests/Makefile.am with 91% similarity]
src/hooks/dhcp/mysql/libloadtests/load_unload_unittests.cc [moved from src/hooks/dhcp/mysql_cb/libloadtests/load_unload_unittests.cc with 84% similarity]
src/hooks/dhcp/mysql/libloadtests/run_unittests.cc [moved from src/hooks/dhcp/mysql_cb/libloadtests/run_unittests.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_callouts.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_callouts.cc with 76% similarity]
src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_dhcp4.h [moved from src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_dhcp6.h [moved from src/hooks/dhcp/mysql_cb/mysql_cb_dhcp6.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_impl.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_impl.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_impl.h [moved from src/hooks/dhcp/mysql_cb/mysql_cb_impl.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_log.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_log.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_log.h [moved from src/hooks/dhcp/mysql_cb/mysql_cb_log.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_cb_messages.cc [moved from src/hooks/dhcp/mysql_cb/mysql_cb_messages.cc with 99% similarity]
src/hooks/dhcp/mysql/mysql_cb_messages.h [moved from src/hooks/dhcp/mysql_cb/mysql_cb_messages.h with 99% similarity]
src/hooks/dhcp/mysql/mysql_cb_messages.mes [moved from src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes with 100% similarity]
src/hooks/dhcp/mysql/mysql_hb_log.cc [moved from src/hooks/dhcp/mysql_hb/mysql_hb_log.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_hb_log.h [moved from src/hooks/dhcp/mysql_hb/mysql_hb_log.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_hb_messages.cc [moved from src/hooks/dhcp/mysql_hb/mysql_hb_messages.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_hb_messages.h [moved from src/hooks/dhcp/mysql_hb/mysql_hb_messages.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_hb_messages.mes [moved from src/hooks/dhcp/mysql_hb/mysql_hb_messages.mes with 100% similarity]
src/hooks/dhcp/mysql/mysql_host_data_source.cc [moved from src/hooks/dhcp/mysql_hb/mysql_host_data_source.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_host_data_source.h [moved from src/hooks/dhcp/mysql_hb/mysql_host_data_source.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_lb_log.cc [moved from src/hooks/dhcp/mysql_lb/mysql_lb_log.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_lb_log.h [moved from src/hooks/dhcp/mysql_lb/mysql_lb_log.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_lb_messages.cc [moved from src/hooks/dhcp/mysql_lb/mysql_lb_messages.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_lb_messages.h [moved from src/hooks/dhcp/mysql_lb/mysql_lb_messages.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_lb_messages.mes [moved from src/hooks/dhcp/mysql_lb/mysql_lb_messages.mes with 100% similarity]
src/hooks/dhcp/mysql/mysql_lease_mgr.cc [moved from src/hooks/dhcp/mysql_lb/mysql_lease_mgr.cc with 100% similarity]
src/hooks/dhcp/mysql/mysql_lease_mgr.h [moved from src/hooks/dhcp/mysql_lb/mysql_lease_mgr.h with 100% similarity]
src/hooks/dhcp/mysql/mysql_query_macros_dhcp.h [moved from src/hooks/dhcp/mysql_cb/mysql_query_macros_dhcp.h with 100% similarity]
src/hooks/dhcp/mysql/tests/.gitignore [new file with mode: 0644]
src/hooks/dhcp/mysql/tests/Makefile.am [new file with mode: 0644]
src/hooks/dhcp/mysql/tests/mysql_bootp_unittest.cc [moved from src/hooks/dhcp/mysql_lb/tests/mysql_bootp_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_cb_dhcp4_mgr_unittest.cc [moved from src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_mgr_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_cb_dhcp4_unittest.cc [moved from src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp4_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_cb_dhcp6_mgr_unittest.cc [moved from src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp6_mgr_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_cb_dhcp6_unittest.cc [moved from src/hooks/dhcp/mysql_cb/tests/mysql_cb_dhcp6_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_cb_impl_unittest.cc [moved from src/hooks/dhcp/mysql_cb/tests/mysql_cb_impl_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_host_data_source_unittest.cc [moved from src/hooks/dhcp/mysql_hb/tests/mysql_host_data_source_unittest.cc with 99% similarity]
src/hooks/dhcp/mysql/tests/mysql_lease_extended_info_unittest.cc [moved from src/hooks/dhcp/mysql_lb/tests/mysql_lease_extended_info_unittest.cc with 100% similarity]
src/hooks/dhcp/mysql/tests/mysql_lease_mgr_unittest.cc [moved from src/hooks/dhcp/mysql_lb/tests/mysql_lease_mgr_unittest.cc with 99% similarity]
src/hooks/dhcp/mysql/tests/run_unittests.cc [moved from src/hooks/dhcp/mysql_cb/tests/run_unittests.cc with 100% similarity]
src/hooks/dhcp/mysql/version.cc [moved from src/hooks/dhcp/mysql_cb/version.cc with 100% similarity]
src/hooks/dhcp/mysql_cb/.gitattributes [deleted file]
src/hooks/dhcp/mysql_cb/Makefile.am [deleted file]
src/hooks/dhcp/mysql_cb/libloadtests/Makefile.am [deleted file]
src/hooks/dhcp/mysql_cb/tests/.gitignore [deleted file]
src/hooks/dhcp/mysql_cb/tests/Makefile.am [deleted file]
src/hooks/dhcp/mysql_hb/.gitattributes [deleted file]
src/hooks/dhcp/mysql_hb/Makefile.am [deleted file]
src/hooks/dhcp/mysql_hb/libloadtests/Makefile.am [deleted file]
src/hooks/dhcp/mysql_hb/libloadtests/load_unload_unittests.cc [deleted file]
src/hooks/dhcp/mysql_hb/libloadtests/run_unittests.cc [deleted file]
src/hooks/dhcp/mysql_hb/mysql_hb_callouts.cc [deleted file]
src/hooks/dhcp/mysql_hb/tests/.gitignore [deleted file]
src/hooks/dhcp/mysql_hb/tests/Makefile.am [deleted file]
src/hooks/dhcp/mysql_hb/tests/run_unittests.cc [deleted file]
src/hooks/dhcp/mysql_hb/version.cc [deleted file]
src/hooks/dhcp/mysql_lb/.gitattributes [deleted file]
src/hooks/dhcp/mysql_lb/Makefile.am [deleted file]
src/hooks/dhcp/mysql_lb/libloadtests/.gitignore [deleted file]
src/hooks/dhcp/mysql_lb/libloadtests/load_unload_unittests.cc [deleted file]
src/hooks/dhcp/mysql_lb/libloadtests/run_unittests.cc [deleted file]
src/hooks/dhcp/mysql_lb/mysql_lb_callouts.cc [deleted file]
src/hooks/dhcp/mysql_lb/tests/.gitignore [deleted file]
src/hooks/dhcp/mysql_lb/tests/Makefile.am [deleted file]
src/hooks/dhcp/mysql_lb/tests/run_unittests.cc [deleted file]
src/hooks/dhcp/mysql_lb/version.cc [deleted file]
src/hooks/dhcp/pgsql/.gitattributes [new file with mode: 0644]
src/hooks/dhcp/pgsql/Makefile.am [new file with mode: 0644]
src/hooks/dhcp/pgsql/libloadtests/.gitignore [moved from src/hooks/dhcp/mysql_hb/libloadtests/.gitignore with 100% similarity]
src/hooks/dhcp/pgsql/libloadtests/Makefile.am [moved from src/hooks/dhcp/pgsql_hb/libloadtests/Makefile.am with 91% similarity]
src/hooks/dhcp/pgsql/libloadtests/load_unload_unittests.cc [moved from src/hooks/dhcp/pgsql_cb/libloadtests/load_unload_unittests.cc with 80% similarity]
src/hooks/dhcp/pgsql/libloadtests/run_unittests.cc [moved from src/hooks/dhcp/pgsql_cb/libloadtests/run_unittests.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_callouts.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_callouts.cc with 76% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp4.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_dhcp6.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_impl.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_impl.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_log.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_log.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_log.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_log.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_messages.cc [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.cc with 99% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_messages.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.h with 99% similarity]
src/hooks/dhcp/pgsql/pgsql_cb_messages.mes [moved from src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_hb_log.cc [moved from src/hooks/dhcp/pgsql_hb/pgsql_hb_log.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_hb_log.h [moved from src/hooks/dhcp/pgsql_hb/pgsql_hb_log.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_hb_messages.cc [moved from src/hooks/dhcp/pgsql_hb/pgsql_hb_messages.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_hb_messages.h [moved from src/hooks/dhcp/pgsql_hb/pgsql_hb_messages.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_hb_messages.mes [moved from src/hooks/dhcp/pgsql_hb/pgsql_hb_messages.mes with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_host_data_source.cc [moved from src/hooks/dhcp/pgsql_hb/pgsql_host_data_source.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_host_data_source.h [moved from src/hooks/dhcp/pgsql_hb/pgsql_host_data_source.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lb_log.cc [moved from src/hooks/dhcp/pgsql_lb/pgsql_lb_log.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lb_log.h [moved from src/hooks/dhcp/pgsql_lb/pgsql_lb_log.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lb_messages.cc [moved from src/hooks/dhcp/pgsql_lb/pgsql_lb_messages.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lb_messages.h [moved from src/hooks/dhcp/pgsql_lb/pgsql_lb_messages.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lb_messages.mes [moved from src/hooks/dhcp/pgsql_lb/pgsql_lb_messages.mes with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lease_mgr.cc [moved from src/hooks/dhcp/pgsql_lb/pgsql_lease_mgr.cc with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_lease_mgr.h [moved from src/hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h with 100% similarity]
src/hooks/dhcp/pgsql/pgsql_query_macros_dhcp.h [moved from src/hooks/dhcp/pgsql_cb/pgsql_query_macros_dhcp.h with 100% similarity]
src/hooks/dhcp/pgsql/tests/.gitignore [new file with mode: 0644]
src/hooks/dhcp/pgsql/tests/Makefile.am [new file with mode: 0644]
src/hooks/dhcp/pgsql/tests/pgsql_bootp_unittest.cc [moved from src/hooks/dhcp/pgsql_lb/tests/pgsql_bootp_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_cb_dhcp4_mgr_unittest.cc [moved from src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_mgr_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_cb_dhcp4_unittest.cc [moved from src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp4_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_cb_dhcp6_mgr_unittest.cc [moved from src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_mgr_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_cb_dhcp6_unittest.cc [moved from src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_dhcp6_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_cb_impl_unittest.cc [moved from src/hooks/dhcp/pgsql_cb/tests/pgsql_cb_impl_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_host_data_source_unittest.cc [moved from src/hooks/dhcp/pgsql_hb/tests/pgsql_host_data_source_unittest.cc with 99% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_lease_extended_info_unittest.cc [moved from src/hooks/dhcp/pgsql_lb/tests/pgsql_lease_extended_info_unittest.cc with 100% similarity]
src/hooks/dhcp/pgsql/tests/pgsql_lease_mgr_unittest.cc [moved from src/hooks/dhcp/pgsql_lb/tests/pgsql_lease_mgr_unittest.cc with 99% similarity]
src/hooks/dhcp/pgsql/tests/run_unittests.cc [moved from src/hooks/dhcp/pgsql_cb/tests/run_unittests.cc with 100% similarity]
src/hooks/dhcp/pgsql/version.cc [moved from src/hooks/dhcp/pgsql_cb/version.cc with 100% similarity]
src/hooks/dhcp/pgsql_cb/.gitattributes [deleted file]
src/hooks/dhcp/pgsql_cb/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_cb/libloadtests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_cb/libloadtests/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_cb/tests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_cb/tests/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_hb/.gitattributes [deleted file]
src/hooks/dhcp/pgsql_hb/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_hb/libloadtests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_hb/libloadtests/load_unload_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_hb/libloadtests/run_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_hb/pgsql_hb_callouts.cc [deleted file]
src/hooks/dhcp/pgsql_hb/tests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_hb/tests/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_hb/tests/run_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_hb/version.cc [deleted file]
src/hooks/dhcp/pgsql_lb/.gitattributes [deleted file]
src/hooks/dhcp/pgsql_lb/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_lb/libloadtests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_lb/libloadtests/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_lb/libloadtests/load_unload_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_lb/libloadtests/run_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_lb/pgsql_lb_callouts.cc [deleted file]
src/hooks/dhcp/pgsql_lb/tests/.gitignore [deleted file]
src/hooks/dhcp/pgsql_lb/tests/Makefile.am [deleted file]
src/hooks/dhcp/pgsql_lb/tests/run_unittests.cc [deleted file]
src/hooks/dhcp/pgsql_lb/version.cc [deleted file]

index 1e40516fb2eb479f58b662bbb6574bea6a733729..fcf4bebe1b749cd76fb9e713d8702283164b59e0 100644 (file)
@@ -1600,24 +1600,12 @@ AC_CONFIG_FILES([src/hooks/dhcp/high_availability/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/lease_cmds/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_cb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_hb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/mysql_lb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_cb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_hb/tests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/libloadtests/Makefile])
-AC_CONFIG_FILES([src/hooks/dhcp/pgsql_lb/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/mysql/tests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql/libloadtests/Makefile])
+AC_CONFIG_FILES([src/hooks/dhcp/pgsql/tests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/libloadtests/Makefile])
 AC_CONFIG_FILES([src/hooks/dhcp/run_script/tests/Makefile])
index 22eed980d85e2e7ff2440bb105f96ab8da34a785..dd9162d29b609311016926b0ababf05a58c5b038 100644 (file)
@@ -21,9 +21,13 @@ src/hooks/dhcp/bootp/bootp_messages.mes
 src/hooks/dhcp/flex_option/flex_option_messages.mes
 src/hooks/dhcp/high_availability/ha_messages.mes
 src/hooks/dhcp/lease_cmds/lease_cmds_messages.mes
-src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
+src/hooks/dhcp/mysql/mysql_cb_messages.mes
+src/hooks/dhcp/mysql/mysql_hb_messages.mes
+src/hooks/dhcp/mysql/mysql_lb_messages.mes
 src/hooks/dhcp/perfmon/perfmon_messages.mes
-src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes
+src/hooks/dhcp/pgsql/pgsql_cb_messages.mes
+src/hooks/dhcp/pgsql/pgsql_hb_messages.mes
+src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
 src/hooks/dhcp/run_script/run_script_messages.mes
 src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
 src/hooks/dhcp/user_chk/user_chk_messages.mes
index 9164afe12ccf32bc4312ec2c512eea5a01bf96a9..9b0a6ec9be078afc14151e026a1b913e01d40da0 100644 (file)
@@ -21,9 +21,13 @@ mes_files += $(top_srcdir)/src/hooks/dhcp/bootp/bootp_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/flex_option/flex_option_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/high_availability/ha_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/lease_cmds/lease_cmds_messages.mes
-mes_files += $(top_srcdir)/src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/mysql/mysql_cb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/mysql/mysql_hb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/mysql/mysql_lb_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/perfmon/perfmon_messages.mes
-mes_files += $(top_srcdir)/src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_cb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_hb_messages.mes
+mes_files += $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/run_script/run_script_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/stat_cmds/stat_cmds_messages.mes
 mes_files += $(top_srcdir)/src/hooks/dhcp/user_chk/user_chk_messages.mes
index f826f8e1e5df872eca02d25d2151a11ca27c6b6e..9ae47a84823dd5dc99621fa73c6858a42567fe2f 100644 (file)
@@ -134,13 +134,11 @@ dhcp4_unittests_LDFLAGS += $(GTEST_LDFLAGS)
 dhcp4_unittests_LDADD  = $(top_builddir)/src/bin/dhcp4/libdhcp4.la
 
 if HAVE_PGSQL
-dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_lb/libpgsqllb.la
-dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_hb/libpgsqlhb.la
+dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql/libpgsql.la
 endif
 
 if HAVE_MYSQL
-dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_lb/libmysqllb.la
-dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_hb/libmysqlhb.la
+dhcp4_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql/libmysql.la
 endif
 
 dhcp4_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
index 53f8db19b366e98b58da4c61a9146a28b3bd9f3e..813a64f268371e1e182dfb9b679314db2f8234cc 100644 (file)
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#include <hooks/dhcp/mysql/mysql_lease_mgr.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
+#include <hooks/dhcp/pgsql/pgsql_lease_mgr.h>
 #endif
 
 #include <dhcp4/tests/dhcp4_test_utils.h>
index 226a2a19a5496876b3d84c585bf6912a8a6fed09..3eaa2ab12116851280ce9409b8fbcbd74620baa9 100644 (file)
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_hb/mysql_host_data_source.h>
+#include <hooks/dhcp/mysql/mysql_host_data_source.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
-#include <hooks/dhcp/pgsql_hb/pgsql_host_data_source.h>
+#include <hooks/dhcp/pgsql/pgsql_host_data_source.h>
 #endif
 
 #include <boost/scoped_ptr.hpp>
index 3b592b15c046185a7496697f315afbc56152df89..a190968f68a81763779d398b4d7e517a6d0f7036 100644 (file)
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#include <hooks/dhcp/mysql/mysql_lease_mgr.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
+#include <hooks/dhcp/pgsql/pgsql_lease_mgr.h>
 #endif
 
 #include <dhcp4/tests/dhcp4_test_utils.h>
index 97d003404d01581fc385a0a235cea5abc12bbc22..3e4bdc79d87236bd16b90768446b2f22c9e657cb 100644 (file)
@@ -24,7 +24,7 @@
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#include <hooks/dhcp/mysql/mysql_lease_mgr.h>
 #endif
 
 #include <log/logger_support.h>
index 38dae6c83a10b2a1d232fecd338153680cfad1b5..b8bcaf5a5e351c29c96f1dcb7386c2b16530d3a8 100644 (file)
@@ -134,13 +134,11 @@ dhcp6_unittests_LDFLAGS += $(GTEST_LDFLAGS)
 dhcp6_unittests_LDADD  = $(top_builddir)/src/bin/dhcp6/libdhcp6.la
 
 if HAVE_PGSQL
-dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_lb/libpgsqllb.la
-dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql_hb/libpgsqlhb.la
+dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/pgsql/libpgsql.la
 endif
 
 if HAVE_MYSQL
-dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_lb/libmysqllb.la
-dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql_hb/libmysqlhb.la
+dhcp6_unittests_LDADD += $(top_builddir)/src/hooks/dhcp/mysql/libmysql.la
 endif
 
 dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
index 4fcd99f4bef43f213ea90812c920438e6c87c0d0..17e1b19b056e9a5412b42da1420ae59e36f9882e 100644 (file)
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#include <hooks/dhcp/mysql/mysql_lease_mgr.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
-#include <hooks/dhcp/pgsql_lb/pgsql_lease_mgr.h>
+#include <hooks/dhcp/pgsql/pgsql_lease_mgr.h>
 #endif
 
 #include <stats/stats_mgr.h>
index dbb7965ef17a212aad50925c55ed01b57e97a67a..86adae853be20c7e92f22a7f1856b71b3137eda3 100644 (file)
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_hb/mysql_host_data_source.h>
+#include <hooks/dhcp/mysql/mysql_host_data_source.h>
 #endif
 
 #ifdef HAVE_PGSQL
 #include <pgsql/testutils/pgsql_schema.h>
-#include <hooks/dhcp/pgsql_hb/pgsql_host_data_source.h>
+#include <hooks/dhcp/pgsql/pgsql_host_data_source.h>
 #endif
 
 #include <boost/pointer_cast.hpp>
index b282c5e7e0eafc3d28bb4a445ca33edf0427d7f1..13af8004bfbf9a68d95130096333635d01702c32 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifdef HAVE_MYSQL
 #include <mysql/testutils/mysql_schema.h>
-#include <hooks/dhcp/mysql_lb/mysql_lease_mgr.h>
+#include <hooks/dhcp/mysql/mysql_lease_mgr.h>
 #endif
 
 #include <log/logger_support.h>
index 6c7ef38503ee8e5dafae7ac07af88b7c35c7872b..0eb80e190c40ed8fcb5d6e3ecb19b6ad1b034104 100644 (file)
@@ -1,11 +1,11 @@
 SUBDIRS = bootp flex_option high_availability lease_cmds perfmon
 
 if HAVE_MYSQL
-SUBDIRS += mysql_lb mysql_hb mysql_cb
+SUBDIRS += mysql
 endif
 
 if HAVE_PGSQL
-SUBDIRS += pgsql_lb pgsql_hb pgsql_cb
+SUBDIRS += pgsql
 endif
 
 SUBDIRS += run_script stat_cmds user_chk
diff --git a/src/hooks/dhcp/mysql/.gitattributes b/src/hooks/dhcp/mysql/.gitattributes
new file mode 100644 (file)
index 0000000..4686716
--- /dev/null
@@ -0,0 +1,6 @@
+/mysql_cb_messages.cc            -diff merge=ours
+/mysql_cb_messages.h             -diff merge=ours
+/mysql_hb_messages.cc            -diff merge=ours
+/mysql_hb_messages.h             -diff merge=ours
+/mysql_lb_messages.cc            -diff merge=ours
+/mysql_lb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/mysql/Makefile.am b/src/hooks/dhcp/mysql/Makefile.am
new file mode 100644 (file)
index 0000000..868abfb
--- /dev/null
@@ -0,0 +1,108 @@
+SUBDIRS = . tests libloadtests
+
+AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
+AM_CXXFLAGS  = $(KEA_CXXFLAGS)
+
+# Ensure that the message file is included in the distribution
+EXTRA_DIST = mysql_cb_messages.mes
+EXTRA_DIST += mysql_hb_messages.mes
+EXTRA_DIST += mysql_lb_messages.mes
+
+CLEANFILES = *.gcno *.gcda
+
+# convenience archive
+
+noinst_LTLIBRARIES = libmysql.la
+
+libmysql_la_SOURCES  = mysql_callouts.cc
+libmysql_la_SOURCES += mysql_cb_dhcp4.cc mysql_cb_dhcp4.h
+libmysql_la_SOURCES += mysql_cb_dhcp6.cc mysql_cb_dhcp6.h
+libmysql_la_SOURCES += mysql_cb_impl.cc mysql_cb_impl.h
+libmysql_la_SOURCES += mysql_cb_messages.cc mysql_cb_messages.h
+libmysql_la_SOURCES += mysql_cb_log.cc mysql_cb_log.h
+libmysql_la_SOURCES += mysql_query_macros_dhcp.h
+libmysql_la_SOURCES += mysql_hb_log.cc mysql_hb_log.h
+libmysql_la_SOURCES += mysql_hb_messages.cc mysql_hb_messages.h
+libmysql_la_SOURCES += mysql_host_data_source.cc mysql_host_data_source.h
+libmysql_la_SOURCES += mysql_lb_log.cc mysql_lb_log.h
+libmysql_la_SOURCES += mysql_lb_messages.cc mysql_lb_messages.h
+libmysql_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
+libmysql_la_SOURCES += version.cc
+
+libmysql_la_CXXFLAGS = $(AM_CXXFLAGS)
+libmysql_la_CPPFLAGS = $(AM_CPPFLAGS)
+
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
+lib_hooks_LTLIBRARIES = libdhcp_mysql.la
+
+libdhcp_mysql_la_SOURCES  =
+libdhcp_mysql_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
+libdhcp_mysql_la_LDFLAGS  += -avoid-version -export-dynamic -module
+
+libdhcp_mysql_la_LIBADD  = libmysql.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
+libdhcp_mysql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+
+# If we want to get rid of all generated messages files, we need to use
+# make maintainer-clean. The proper way to introduce custom commands for
+# that operation is to define maintainer-clean-local target. However,
+# make maintainer-clean also removes Makefile, so running configure script
+# is required.  To make it easy to rebuild messages without going through
+# reconfigure, a new target messages-clean has been added.
+maintainer-clean-local:
+       rm -f mysql_cb_messages.h mysql_cb_messages.cc
+       rm -f mysql_hb_messages.h mysql_hb_messages.cc
+       rm -f mysql_lb_messages.h mysql_lb_messages.cc
+
+# To regenerate messages files, one can do:
+#
+# make messages-clean
+# make messages
+#
+# This is needed only when a .mes file is modified.
+messages-clean: maintainer-clean-local
+
+if GENERATE_MESSAGES
+
+# Define rule to build logging source files from message file
+messages: mysql_cb_messages.h mysql_cb_messages.cc \
+         mysql_hb_messages.h mysql_hb_messages.cc \
+         mysql_lb_messages.h mysql_lb_messages.cc
+       @echo Message files regenerated
+
+mysql_cb_messages.h mysql_cb_messages.cc: mysql_cb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql/mysql_cb_messages.mes
+
+mysql_hb_messages.h mysql_hb_messages.cc: mysql_hb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql/mysql_hb_messages.mes
+
+mysql_lb_messages.h mysql_lb_messages.cc: mysql_lb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql/mysql_lb_messages.mes
+
+else
+
+messages: mysql_cb_messages.h mysql_cb_messages.cc \
+         mysql_hb_messages.h mysql_hb_messages.cc \
+         mysql_lb_messages.h mysql_lb_messages.cc
+       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
+
+endif
+
similarity index 91%
rename from src/hooks/dhcp/mysql_lb/libloadtests/Makefile.am
rename to src/hooks/dhcp/mysql/libloadtests/Makefile.am
index f423defdd78939ded8df2425a8934fbffd0150a7..8de28ce337afd1b7c94e9d4520b090b8736b55c3 100644 (file)
@@ -1,9 +1,9 @@
 SUBDIRS = .
 
 AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_lb -I$(top_srcdir)/src/hooks/dhcp/mysql_lb
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql -I$(top_srcdir)/src/hooks/dhcp/mysql
 AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_MYSQL_LB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/mysql_lb/.libs/libdhcp_mysql_lb.so\"
+AM_CPPFLAGS += -DLIBDHCP_MYSQL_SO=\"$(abs_top_builddir)/src/hooks/dhcp/mysql/.libs/libdhcp_mysql.so\"
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 if USE_STATIC_LINK
similarity index 84%
rename from src/hooks/dhcp/mysql_cb/libloadtests/load_unload_unittests.cc
rename to src/hooks/dhcp/mysql/libloadtests/load_unload_unittests.cc
index 8b27e5153dedb33fedbf4293d0836e9039b72508..5c2230a1fadfe2414a1feeb55dac4635d42c5e22 100644 (file)
@@ -28,30 +28,30 @@ using namespace isc::process;
 namespace {
 
 /// @brief Test fixture for testing loading and unloading the MySQL cb library
-class MySqlCbLibLoadTest : public isc::test::LibLoadTest {
+class MySqlLibLoadTest : public isc::test::LibLoadTest {
 public:
     /// @brief Constructor
-    MySqlCbLibLoadTest() : LibLoadTest(LIBDHCP_MYSQL_CB_SO) {
+    MySqlLibLoadTest() : LibLoadTest(LIBDHCP_MYSQL_SO) {
     }
 
     /// @brief Destructor
-    virtual ~MySqlCbLibLoadTest() {
+    virtual ~MySqlLibLoadTest() {
         unloadLibraries();
     }
 };
 
 // Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlCbLibLoadTest, validLoad4) {
+TEST_F(MySqlLibLoadTest, validLoad4) {
     validDaemonTest("kea-dhcp4");
 }
 
 // Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlCbLibLoadTest, validLoad6) {
+TEST_F(MySqlLibLoadTest, validLoad6) {
     validDaemonTest("kea-dhcp6", AF_INET6);
 }
 
 // Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(MySqlCbLibLoadTest, invalidDaemonLoad) {
+TEST_F(MySqlLibLoadTest, invalidDaemonLoad) {
     invalidDaemonTest("kea-ctrl-agent");
     invalidDaemonTest("kea-dhcp-ddns");
     invalidDaemonTest("bogus");
similarity index 76%
rename from src/hooks/dhcp/mysql_cb/mysql_cb_callouts.cc
rename to src/hooks/dhcp/mysql/mysql_callouts.cc
index f9e6f09ed35d3715c49918ea2af05cf481dbb0e0..4e8cd4e48fcfbaaee5d2e59a8ac0d58e218f130a 100644 (file)
 #include <config.h>
 
 #include <asiolink/io_service_mgr.h>
+#include <dhcpsrv/base_host_data_source.h>
 #include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/lease_mgr_factory.h>
 #include <hooks/hooks.h>
 #include <process/daemon.h>
 #include <mysql_cb_impl.h>
-
 #include <mysql_cb_dhcp4.h>
 #include <mysql_cb_dhcp6.h>
 #include <mysql_cb_log.h>
+#include <mysql_hb_log.h>
+#include <mysql_host_data_source.h>
+#include <mysql_lb_log.h>
+#include <mysql_lease_mgr.h>
 
 #include <sstream>
 #include <string>
@@ -54,11 +59,24 @@ int load(LibraryHandle& /* handle */) {
         }
     }
 
-    LOG_INFO(mysql_cb_logger, MYSQL_CB_INIT_OK);
     // Register MySQL CB factories with CB Managers
     isc::dhcp::MySqlConfigBackendDHCPv4::registerBackendType();
     isc::dhcp::MySqlConfigBackendDHCPv6::registerBackendType();
+    LOG_INFO(mysql_cb_logger, MYSQL_CB_INIT_OK);
 
+    // Register MySQL HB factories with Host Managers
+    HostDataSourceFactory::registerFactory("mysql",
+                                           MySqlHostDataSource::factory,
+                                           true,
+                                           MySqlHostDataSource::getDBVersion);
+    LOG_INFO(mysql_hb_logger, MYSQL_HB_INIT_OK);
+
+    // Register MySQL LB factories with Lease Managers
+    LeaseMgrFactory::registerFactory("mysql",
+                                     MySqlLeaseMgr::factory,
+                                     true,
+                                     MySqlLeaseMgr::getDBVersion);
+    LOG_INFO(mysql_lb_logger, MYSQL_LB_INIT_OK);
     return (0);
 }
 
@@ -90,7 +108,6 @@ int dhcp6_srv_configured(CalloutHandle& /* handle */) {
 ///
 /// @return 0 if deregistration was successful, 1 otherwise
 int unload() {
-    LOG_INFO(mysql_cb_logger, MYSQL_CB_DEINIT_OK);
     // Unregister the factories and remove MySQL backends
     isc::dhcp::MySqlConfigBackendDHCPv4::unregisterBackendType();
     isc::dhcp::MySqlConfigBackendDHCPv6::unregisterBackendType();
@@ -100,6 +117,15 @@ int unload() {
         io_service->stopAndPoll();
         isc::dhcp::MySqlConfigBackendImpl::setIOService(IOServicePtr());
     }
+    LOG_INFO(mysql_cb_logger, MYSQL_CB_DEINIT_OK);
+
+    // Unregister the factories and remove MySQL backends
+    HostDataSourceFactory::deregisterFactory("mysql", true);
+    LOG_INFO(mysql_hb_logger, MYSQL_HB_DEINIT_OK);
+
+    // Unregister the factories and remove MySQL backends
+    LeaseMgrFactory::deregisterFactory("mysql", true);
+    LOG_INFO(mysql_lb_logger, MYSQL_LB_DEINIT_OK);
     return (0);
 }
 
similarity index 99%
rename from src/hooks/dhcp/mysql_cb/mysql_cb_messages.cc
rename to src/hooks/dhcp/mysql/mysql_cb_messages.cc
index 2a2d91db12e9d397503ecd4ee5062ad87a1d455a..9fb64d48d04797f69531552484b69f41642ba3ca 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../../src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
+// File created from ../../../../src/hooks/dhcp/mysql/mysql_cb_messages.mes
 
 #include <cstddef>
 #include <log/message_types.h>
similarity index 99%
rename from src/hooks/dhcp/mysql_cb/mysql_cb_messages.h
rename to src/hooks/dhcp/mysql/mysql_cb_messages.h
index 7b3b39d3abcfb9942e4d32e510c3590e79019b94..7662936eeb034fa1407594c63a809402720260af 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../../src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
+// File created from ../../../../src/hooks/dhcp/mysql/mysql_cb_messages.mes
 
 #ifndef MYSQL_CB_MESSAGES_H
 #define MYSQL_CB_MESSAGES_H
diff --git a/src/hooks/dhcp/mysql/tests/.gitignore b/src/hooks/dhcp/mysql/tests/.gitignore
new file mode 100644 (file)
index 0000000..b72f84f
--- /dev/null
@@ -0,0 +1 @@
+/mysql_unittests
\ No newline at end of file
diff --git a/src/hooks/dhcp/mysql/tests/Makefile.am b/src/hooks/dhcp/mysql/tests/Makefile.am
new file mode 100644 (file)
index 0000000..132299e
--- /dev/null
@@ -0,0 +1,68 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql -I$(top_srcdir)/src/hooks/dhcp/mysql
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
+AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+# Unit test data files need to get installed.
+EXTRA_DIST =
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+TESTS =
+if HAVE_GTEST
+TESTS += mysql_unittests
+
+mysql_unittests_SOURCES  = mysql_cb_impl_unittest.cc
+mysql_unittests_SOURCES += mysql_cb_dhcp4_unittest.cc
+mysql_unittests_SOURCES += mysql_cb_dhcp4_mgr_unittest.cc
+mysql_unittests_SOURCES += mysql_cb_dhcp6_unittest.cc
+mysql_unittests_SOURCES += mysql_cb_dhcp6_mgr_unittest.cc
+mysql_unittests_SOURCES += mysql_host_data_source_unittest.cc
+mysql_unittests_SOURCES += mysql_lease_mgr_unittest.cc
+mysql_unittests_SOURCES += mysql_lease_extended_info_unittest.cc
+mysql_unittests_SOURCES += mysql_bootp_unittest.cc
+mysql_unittests_SOURCES += run_unittests.cc
+
+mysql_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+
+mysql_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
+
+mysql_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+
+mysql_unittests_LDADD  = $(top_builddir)/src/hooks/dhcp/mysql/libmysql.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+mysql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+mysql_unittests_LDADD += $(LOG4CPLUS_LIBS)
+mysql_unittests_LDADD += $(CRYPTO_LIBS)
+mysql_unittests_LDADD += $(BOOST_LIBS)
+mysql_unittests_LDADD += $(GTEST_LDADD)
+endif
+noinst_PROGRAMS = $(TESTS)
similarity index 99%
rename from src/hooks/dhcp/mysql_hb/tests/mysql_host_data_source_unittest.cc
rename to src/hooks/dhcp/mysql/tests/mysql_host_data_source_unittest.cc
index 5a7f938700a7803b5fd3a065e409d2be8d8bd0ee..729e46649bb5147a0a3bf89f57e9debe32c66561 100644 (file)
@@ -1856,19 +1856,21 @@ TEST_F(MySQLHostMgrDbLostCallbackTest, testDbLostAndFailedAfterTimeoutCallbackMu
 
 /// @brief Test fixture class for testing @ref CfgDbAccessTest using MySQL
 /// backend.
-class CfgMySqlDbAccessTest : public ::testing::Test {
+class CfgMySqlHbDbAccessTest : public ::testing::Test {
 public:
 
     /// @brief Constructor.
-    CfgMySqlDbAccessTest() {
+    CfgMySqlHbDbAccessTest() {
         // Ensure we have the proper schema with no transient data.
         db::test::createMySQLSchema();
+        HostMgr::create();
     }
 
     /// @brief Destructor.
-    virtual ~CfgMySqlDbAccessTest() {
+    virtual ~CfgMySqlHbDbAccessTest() {
         // If data wipe enabled, delete transient data otherwise destroy the schema
         db::test::destroyMySQLSchema();
+        HostMgr::create();
     }
 
     /// @brief Initializer.
@@ -1877,7 +1879,7 @@ public:
 
 // Tests that memfile lease manager and MySQL host data source can be created from a
 // specified configuration.
-TEST_F(CfgMySqlDbAccessTest, createManagers) {
+TEST_F(CfgMySqlHbDbAccessTest, createManagers) {
     CfgDbAccess cfg;
     ASSERT_NO_THROW(cfg.setLeaseDbAccessString("type=memfile persist=false universe=4"));
     ASSERT_NO_THROW(cfg.setHostDbAccessString(db::test::validMySQLConnectionString()));
@@ -1909,7 +1911,7 @@ TEST_F(CfgMySqlDbAccessTest, createManagers) {
 // Tests that the createManagers function utilizes the setting in the
 // CfgDbAccess class which controls whether the IP reservations must
 // be unique or can be non-unique.
-TEST_F(CfgMySqlDbAccessTest, createManagersIPResrvUnique) {
+TEST_F(CfgMySqlHbDbAccessTest, createManagersIPResrvUnique) {
     CfgDbAccess cfg;
 
     cfg.setIPReservationsUnique(false);
similarity index 99%
rename from src/hooks/dhcp/mysql_lb/tests/mysql_lease_mgr_unittest.cc
rename to src/hooks/dhcp/mysql/tests/mysql_lease_mgr_unittest.cc
index da7da302225e5cdbfcf568273d14d901c0110522..6c74422754e386e9b6ceca8f9018cd5fcdc6fceb 100644 (file)
@@ -1363,17 +1363,18 @@ TEST_F(MySqlLeaseMgrTest, bigStats) {
 
 /// @brief Test fixture class for testing @ref CfgDbAccessTest using MySQL
 /// backend.
-class CfgMySqlDbAccessTest : public ::testing::Test {
+class CfgMySqlLbDbAccessTest : public ::testing::Test {
 public:
 
     /// @brief Constructor.
-    CfgMySqlDbAccessTest() {
+    CfgMySqlLbDbAccessTest() {
         // Ensure we have the proper schema with no transient data.
         db::test::createMySQLSchema();
+        LeaseMgrFactory::destroy();
     }
 
     /// @brief Destructor.
-    virtual ~CfgMySqlDbAccessTest() {
+    virtual ~CfgMySqlLbDbAccessTest() {
         // If data wipe enabled, delete transient data otherwise destroy the schema
         db::test::destroyMySQLSchema();
         LeaseMgrFactory::destroy();
@@ -1385,7 +1386,7 @@ public:
 
 // Tests that MySQL lease manager and host data source can be created from a
 // specified configuration.
-TEST_F(CfgMySqlDbAccessTest, createManagers) {
+TEST_F(CfgMySqlLbDbAccessTest, createManagers) {
     CfgDbAccess cfg;
     ASSERT_NO_THROW(cfg.setLeaseDbAccessString(db::test::validMySQLConnectionString()));
     ASSERT_NO_THROW(cfg.createManagers());
diff --git a/src/hooks/dhcp/mysql_cb/.gitattributes b/src/hooks/dhcp/mysql_cb/.gitattributes
deleted file mode 100644 (file)
index 99ccfa7..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/mysql_cb_messages.cc            -diff merge=ours
-/mysql_cb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/mysql_cb/Makefile.am b/src/hooks/dhcp/mysql_cb/Makefile.am
deleted file mode 100644 (file)
index 1263a3d..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
-AM_CXXFLAGS  = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = mysql_cb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libmysqlcb.la
-
-libmysqlcb_la_SOURCES  = mysql_cb_callouts.cc
-libmysqlcb_la_SOURCES += mysql_cb_dhcp4.cc mysql_cb_dhcp4.h
-libmysqlcb_la_SOURCES += mysql_cb_dhcp6.cc mysql_cb_dhcp6.h
-libmysqlcb_la_SOURCES += mysql_cb_impl.cc mysql_cb_impl.h
-libmysqlcb_la_SOURCES += mysql_cb_messages.cc mysql_cb_messages.h
-libmysqlcb_la_SOURCES += mysql_cb_log.cc mysql_cb_log.h
-libmysqlcb_la_SOURCES += mysql_query_macros_dhcp.h
-libmysqlcb_la_SOURCES += version.cc
-
-libmysqlcb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libmysqlcb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_mysql_cb.la
-
-libdhcp_mysql_cb_la_SOURCES  =
-libdhcp_mysql_cb_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
-libdhcp_mysql_cb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_mysql_cb_la_LIBADD  = libmysqlcb.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f mysql_cb_messages.h mysql_cb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: mysql_cb_messages.h mysql_cb_messages.cc
-       @echo Message files regenerated
-
-mysql_cb_messages.h mysql_cb_messages.cc: mysql_cb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql_cb/mysql_cb_messages.mes
-
-else
-
-messages mysql_cb_messages.h mysql_cb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
-
diff --git a/src/hooks/dhcp/mysql_cb/libloadtests/Makefile.am b/src/hooks/dhcp/mysql_cb/libloadtests/Makefile.am
deleted file mode 100644 (file)
index 391c1ec..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_cb -I$(top_srcdir)/src/hooks/dhcp/mysql_cb
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_MYSQL_CB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/mysql_cb/.libs/libdhcp_mysql_cb.so\"
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = \
-       $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-if HAVE_GTEST
-
-TESTS = hook_load_unittests
-
-hook_load_unittests_SOURCES  =
-hook_load_unittests_SOURCES += load_unload_unittests.cc
-hook_load_unittests_SOURCES += run_unittests.cc
-hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-
-hook_load_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-hook_load_unittests_LDADD += $(LOG4CPLUS_LIBS)
-hook_load_unittests_LDADD += $(CRYPTO_LIBS)
-hook_load_unittests_LDADD += $(BOOST_LIBS)
-hook_load_unittests_LDADD += $(GTEST_LDADD)
-
-noinst_PROGRAMS = $(TESTS)
-
-endif
diff --git a/src/hooks/dhcp/mysql_cb/tests/.gitignore b/src/hooks/dhcp/mysql_cb/tests/.gitignore
deleted file mode 100644 (file)
index 98266a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/mysql_cb_unittests
\ No newline at end of file
diff --git a/src/hooks/dhcp/mysql_cb/tests/Makefile.am b/src/hooks/dhcp/mysql_cb/tests/Makefile.am
deleted file mode 100644 (file)
index 8f1d8cb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_cb -I$(top_srcdir)/src/hooks/dhcp/mysql_cb
-AM_CPPFLAGS += $(BOOST_INCLUDES) $(MYSQL_CPPFLAGS)
-AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-# Unit test data files need to get installed.
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-TESTS =
-if HAVE_GTEST
-TESTS += mysql_cb_unittests
-
-mysql_cb_unittests_SOURCES  = mysql_cb_dhcp4_unittest.cc
-mysql_cb_unittests_SOURCES += mysql_cb_dhcp4_mgr_unittest.cc
-mysql_cb_unittests_SOURCES += mysql_cb_dhcp6_unittest.cc
-mysql_cb_unittests_SOURCES += mysql_cb_dhcp6_mgr_unittest.cc
-mysql_cb_unittests_SOURCES += mysql_cb_impl_unittest.cc
-mysql_cb_unittests_SOURCES += run_unittests.cc
-
-mysql_cb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-
-mysql_cb_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-
-mysql_cb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-mysql_cb_unittests_LDADD  = $(top_builddir)/src/hooks/dhcp/mysql_cb/libmysqlcb.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-mysql_cb_unittests_LDADD += $(LOG4CPLUS_LIBS)
-mysql_cb_unittests_LDADD += $(CRYPTO_LIBS)
-mysql_cb_unittests_LDADD += $(BOOST_LIBS)
-mysql_cb_unittests_LDADD += $(GTEST_LDADD)
-endif
-noinst_PROGRAMS = $(TESTS)
diff --git a/src/hooks/dhcp/mysql_hb/.gitattributes b/src/hooks/dhcp/mysql_hb/.gitattributes
deleted file mode 100644 (file)
index 2545371..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/mysql_hb_messages.cc            -diff merge=ours
-/mysql_hb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/mysql_hb/Makefile.am b/src/hooks/dhcp/mysql_hb/Makefile.am
deleted file mode 100644 (file)
index 09b789d..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = mysql_hb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libmysqlhb.la
-libmysqlhb_la_SOURCES  = mysql_hb_callouts.cc
-libmysqlhb_la_SOURCES += mysql_hb_log.cc mysql_hb_log.h
-libmysqlhb_la_SOURCES += mysql_hb_messages.cc mysql_hb_messages.h
-libmysqlhb_la_SOURCES += mysql_host_data_source.cc mysql_host_data_source.h
-libmysqlhb_la_SOURCES += version.cc
-
-libmysqlhb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libmysqlhb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_mysql_hb.la
-
-libdhcp_mysql_hb_la_SOURCES  =
-libdhcp_mysql_hb_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
-libdhcp_mysql_hb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_mysql_hb_la_LIBADD = libmysqlhb.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_mysql_hb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-libdhcp_mysql_hb_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f mysql_hb_messages.h mysql_hb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: mysql_hb_messages.h mysql_hb_messages.cc
-       @echo Message files regenerated
-
-mysql_hb_messages.h mysql_hb_messages.cc: mysql_hb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql_hb/mysql_hb_messages.mes
-
-else
-
-messages mysql_hb_messages.h mysql_hb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
-
diff --git a/src/hooks/dhcp/mysql_hb/libloadtests/Makefile.am b/src/hooks/dhcp/mysql_hb/libloadtests/Makefile.am
deleted file mode 100644 (file)
index cefa663..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_hb -I$(top_srcdir)/src/hooks/dhcp/mysql_hb
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_MYSQL_HB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/mysql_hb/.libs/libdhcp_mysql_hb.so\"
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = \
-       $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-if HAVE_GTEST
-
-TESTS = hook_load_unittests
-
-hook_load_unittests_SOURCES  =
-hook_load_unittests_SOURCES += load_unload_unittests.cc
-hook_load_unittests_SOURCES += run_unittests.cc
-hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-
-hook_load_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-hook_load_unittests_LDADD += $(LOG4CPLUS_LIBS)
-hook_load_unittests_LDADD += $(CRYPTO_LIBS)
-hook_load_unittests_LDADD += $(BOOST_LIBS)
-hook_load_unittests_LDADD += $(GTEST_LDADD)
-
-noinst_PROGRAMS = $(TESTS)
-
-endif
diff --git a/src/hooks/dhcp/mysql_hb/libloadtests/load_unload_unittests.cc b/src/hooks/dhcp/mysql_hb/libloadtests/load_unload_unittests.cc
deleted file mode 100644 (file)
index b3c736b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2024 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/.
-
-/// @file This file contains tests which exercise the load and unload
-/// functions in the ddns tuning hook library. In order to test the load
-/// function, one must be able to pass it hook library parameters. The
-/// the only way to populate these parameters is by actually loading the
-/// library via HooksManager::loadLibraries().
-
-#include <config.h>
-
-#include <dhcpsrv/testutils/lib_load_test_fixture.h>
-#include <testutils/gtest_utils.h>
-
-#include <gtest/gtest.h>
-#include <errno.h>
-
-using namespace std;
-using namespace isc;
-using namespace isc::hooks;
-using namespace isc::data;
-using namespace isc::dhcp;
-using namespace isc::process;
-
-namespace {
-
-/// @brief Test fixture for testing loading and unloading the MySQL hb library
-class MySqlHbLibLoadTest : public isc::test::LibLoadTest {
-public:
-    /// @brief Constructor
-    MySqlHbLibLoadTest() : LibLoadTest(LIBDHCP_MYSQL_HB_SO) {
-    }
-
-    /// @brief Destructor
-    virtual ~MySqlHbLibLoadTest() {
-        unloadLibraries();
-    }
-};
-
-// Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlHbLibLoadTest, validLoad4) {
-    validDaemonTest("kea-dhcp4");
-}
-
-// Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlHbLibLoadTest, validLoad6) {
-    validDaemonTest("kea-dhcp6", AF_INET6);
-}
-
-// Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(MySqlHbLibLoadTest, invalidDaemonLoad) {
-    invalidDaemonTest("kea-ctrl-agent");
-    invalidDaemonTest("kea-dhcp-ddns");
-    invalidDaemonTest("bogus");
-}
-
-} // end of anonymous namespace
diff --git a/src/hooks/dhcp/mysql_hb/libloadtests/run_unittests.cc b/src/hooks/dhcp/mysql_hb/libloadtests/run_unittests.cc
deleted file mode 100644 (file)
index 755b9e4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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/hooks/dhcp/mysql_hb/mysql_hb_callouts.cc b/src/hooks/dhcp/mysql_hb/mysql_hb_callouts.cc
deleted file mode 100644 (file)
index 56a4fca..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2024 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/.
-
-// Functions accessed by the hooks framework use C linkage to avoid the name
-// mangling that accompanies use of the C++ compiler as well as to avoid
-// issues related to namespaces.
-
-#include <config.h>
-
-#include <asiolink/io_service_mgr.h>
-#include <dhcpsrv/base_host_data_source.h>
-#include <dhcpsrv/cfgmgr.h>
-#include <hooks/hooks.h>
-#include <process/daemon.h>
-#include <mysql_hb_log.h>
-#include <mysql_host_data_source.h>
-
-#include <sstream>
-#include <string>
-
-using namespace isc::asiolink;
-using namespace isc::dhcp;
-using namespace isc::hooks;
-using namespace isc::log;
-using namespace isc::process;
-using namespace std;
-
-extern "C" {
-
-/// @brief This function is called when the library is loaded.
-///
-/// @param handle library handle
-/// @return 0 when initialization is successful, 1 otherwise
-
-int load(LibraryHandle& /* handle */) {
-    // Make the hook library not loadable by d2 or ca.
-    uint16_t family = CfgMgr::instance().getFamily();
-    const std::string& proc_name = Daemon::getProcName();
-    if (family == AF_INET) {
-        if (proc_name != "kea-dhcp4") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp4");
-        }
-    } else {
-        if (proc_name != "kea-dhcp6") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp6");
-        }
-    }
-
-    // Register MySQL HB factories with Host Managers
-    HostDataSourceFactory::registerFactory("mysql",
-                                           MySqlHostDataSource::factory,
-                                           true,
-                                           MySqlHostDataSource::getDBVersion);
-
-    LOG_INFO(mysql_hb_logger, MYSQL_HB_INIT_OK);
-    return (0);
-}
-
-/// @brief This function is called when the library is unloaded.
-///
-/// @return 0 if deregistration was successful, 1 otherwise
-int unload() {
-    // Unregister the factories and remove MySQL backends
-    HostDataSourceFactory::deregisterFactory("mysql", true);
-
-    LOG_INFO(mysql_hb_logger, MYSQL_HB_DEINIT_OK);
-    return (0);
-}
-
-/// @brief This function is called to retrieve the multi-threading compatibility.
-///
-/// @note: the compatibility is based on the assumption this hook library
-/// is always called from the main thread.
-///
-/// @return 1 which means compatible with multi-threading.
-int multi_threading_compatible() {
-    return (1);
-}
-
-} // end extern "C"
diff --git a/src/hooks/dhcp/mysql_hb/tests/.gitignore b/src/hooks/dhcp/mysql_hb/tests/.gitignore
deleted file mode 100644 (file)
index b408055..0000000
+++ /dev/null
@@ -1 +0,0 @@
-mysql_hb_unittests
diff --git a/src/hooks/dhcp/mysql_hb/tests/Makefile.am b/src/hooks/dhcp/mysql_hb/tests/Makefile.am
deleted file mode 100644 (file)
index a16ce32..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_hb -I$(top_srcdir)/src/hooks/dhcp/mysql_hb
-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 += mysql_hb_unittests
-
-mysql_hb_unittests_SOURCES  = run_unittests.cc
-mysql_hb_unittests_SOURCES += mysql_host_data_source_unittest.cc
-
-mysql_hb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-mysql_hb_unittests_CPPFLAGS += $(MYSQL_CPPFLAGS)
-
-mysql_hb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-mysql_hb_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-mysql_hb_unittests_LDFLAGS += $(MYSQL_LIBS)
-
-mysql_hb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/mysql_hb/libmysqlhb.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/testutils/libdhcptest.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-mysql_hb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-mysql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
-endif
-
-noinst_PROGRAMS = $(TESTS)
-
diff --git a/src/hooks/dhcp/mysql_hb/tests/run_unittests.cc b/src/hooks/dhcp/mysql_hb/tests/run_unittests.cc
deleted file mode 100644 (file)
index 63b2d4a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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 <gtest/gtest.h>
-
-#include <util/unittests/run_all.h>
-#include <log/logger_support.h>
-
-int
-main(int argc, char* argv[]) {
-    ::testing::InitGoogleTest(&argc, argv);
-    isc::log::initLogger();
-    return (isc::util::unittests::run_all());
-}
diff --git a/src/hooks/dhcp/mysql_hb/version.cc b/src/hooks/dhcp/mysql_hb/version.cc
deleted file mode 100644 (file)
index d64404b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2024 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 <hooks/hooks.h>
-
-extern "C" {
-
-/// @brief returns Kea hooks version.
-int version() {
-    return (KEA_HOOKS_VERSION);
-}
-
-}
diff --git a/src/hooks/dhcp/mysql_lb/.gitattributes b/src/hooks/dhcp/mysql_lb/.gitattributes
deleted file mode 100644 (file)
index 16c190a..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/mysql_lb_messages.cc            -diff merge=ours
-/mysql_lb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/mysql_lb/Makefile.am b/src/hooks/dhcp/mysql_lb/Makefile.am
deleted file mode 100644 (file)
index 57034e2..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(MYSQL_CPPFLAGS)
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = mysql_lb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libmysqllb.la
-libmysqllb_la_SOURCES  = mysql_lb_callouts.cc
-libmysqllb_la_SOURCES += mysql_lb_log.cc mysql_lb_log.h
-libmysqllb_la_SOURCES += mysql_lb_messages.cc mysql_lb_messages.h
-libmysqllb_la_SOURCES += mysql_lease_mgr.cc mysql_lease_mgr.h
-libmysqllb_la_SOURCES += version.cc
-
-libmysqllb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libmysqllb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_mysql_lb.la
-
-libdhcp_mysql_lb_la_SOURCES  =
-libdhcp_mysql_lb_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
-libdhcp_mysql_lb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_mysql_lb_la_LIBADD = libmysqllb.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_mysql_lb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-libdhcp_mysql_lb_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f mysql_lb_messages.h mysql_lb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: mysql_lb_messages.h mysql_lb_messages.cc
-       @echo Message files regenerated
-
-mysql_lb_messages.h mysql_lb_messages.cc: mysql_lb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/mysql_lb/mysql_lb_messages.mes
-
-else
-
-messages mysql_lb_messages.h mysql_lb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
-
diff --git a/src/hooks/dhcp/mysql_lb/libloadtests/.gitignore b/src/hooks/dhcp/mysql_lb/libloadtests/.gitignore
deleted file mode 100644 (file)
index ada6ed5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hook_load_unittests
diff --git a/src/hooks/dhcp/mysql_lb/libloadtests/load_unload_unittests.cc b/src/hooks/dhcp/mysql_lb/libloadtests/load_unload_unittests.cc
deleted file mode 100644 (file)
index 339c60f..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2024 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/.
-
-/// @file This file contains tests which exercise the load and unload
-/// functions in the ddns tuning hook library. In order to test the load
-/// function, one must be able to pass it hook library parameters. The
-/// the only way to populate these parameters is by actually loading the
-/// library via HooksManager::loadLibraries().
-
-#include <config.h>
-
-#include <dhcpsrv/testutils/lib_load_test_fixture.h>
-#include <testutils/gtest_utils.h>
-
-#include <gtest/gtest.h>
-#include <errno.h>
-
-using namespace std;
-using namespace isc;
-using namespace isc::hooks;
-using namespace isc::data;
-using namespace isc::dhcp;
-using namespace isc::process;
-
-namespace {
-
-/// @brief Test fixture for testing loading and unloading the MySQL lb library
-class MySqlLbLibLoadTest : public isc::test::LibLoadTest {
-public:
-    /// @brief Constructor
-    MySqlLbLibLoadTest() : LibLoadTest(LIBDHCP_MYSQL_LB_SO) {
-    }
-
-    /// @brief Destructor
-    virtual ~MySqlLbLibLoadTest() {
-        unloadLibraries();
-    }
-};
-
-// Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlLbLibLoadTest, validLoad4) {
-    validDaemonTest("kea-dhcp4");
-}
-
-// Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(MySqlLbLibLoadTest, validLoad6) {
-    validDaemonTest("kea-dhcp6", AF_INET6);
-}
-
-// Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(MySqlLbLibLoadTest, invalidDaemonLoad) {
-    invalidDaemonTest("kea-ctrl-agent");
-    invalidDaemonTest("kea-dhcp-ddns");
-    invalidDaemonTest("bogus");
-}
-
-} // end of anonymous namespace
diff --git a/src/hooks/dhcp/mysql_lb/libloadtests/run_unittests.cc b/src/hooks/dhcp/mysql_lb/libloadtests/run_unittests.cc
deleted file mode 100644 (file)
index 755b9e4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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/hooks/dhcp/mysql_lb/mysql_lb_callouts.cc b/src/hooks/dhcp/mysql_lb/mysql_lb_callouts.cc
deleted file mode 100644 (file)
index fe557ed..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2024 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/.
-
-// Functions accessed by the hooks framework use C linkage to avoid the name
-// mangling that accompanies use of the C++ compiler as well as to avoid
-// issues related to namespaces.
-
-#include <config.h>
-
-#include <asiolink/io_service_mgr.h>
-#include <dhcpsrv/cfgmgr.h>
-#include <hooks/hooks.h>
-#include <process/daemon.h>
-#include <mysql_lb_log.h>
-#include <mysql_lease_mgr.h>
-#include <dhcpsrv/lease_mgr_factory.h>
-
-#include <sstream>
-#include <string>
-
-using namespace isc::asiolink;
-using namespace isc::dhcp;
-using namespace isc::hooks;
-using namespace isc::log;
-using namespace isc::process;
-using namespace std;
-
-extern "C" {
-
-/// @brief This function is called when the library is loaded.
-///
-/// @param handle library handle
-/// @return 0 when initialization is successful, 1 otherwise
-
-int load(LibraryHandle& /* handle */) {
-    // Make the hook library not loadable by d2 or ca.
-    uint16_t family = CfgMgr::instance().getFamily();
-    const std::string& proc_name = Daemon::getProcName();
-    if (family == AF_INET) {
-        if (proc_name != "kea-dhcp4") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp4");
-        }
-    } else {
-        if (proc_name != "kea-dhcp6") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp6");
-        }
-    }
-
-    // Register MySQL LB factories with Lease Managers
-    LeaseMgrFactory::registerFactory("mysql",
-                                     MySqlLeaseMgr::factory,
-                                     true,
-                                     MySqlLeaseMgr::getDBVersion);
-
-    LOG_INFO(mysql_lb_logger, MYSQL_LB_INIT_OK);
-    return (0);
-}
-
-/// @brief This function is called when the library is unloaded.
-///
-/// @return 0 if deregistration was successful, 1 otherwise
-int unload() {
-    // Unregister the factories and remove MySQL backends
-    LeaseMgrFactory::deregisterFactory("mysql", true);
-
-    LOG_INFO(mysql_lb_logger, MYSQL_LB_DEINIT_OK);
-    return (0);
-}
-
-/// @brief This function is called to retrieve the multi-threading compatibility.
-///
-/// @note: the compatibility is based on the assumption this hook library
-/// is always called from the main thread.
-///
-/// @return 1 which means compatible with multi-threading.
-int multi_threading_compatible() {
-    return (1);
-}
-
-} // end extern "C"
diff --git a/src/hooks/dhcp/mysql_lb/tests/.gitignore b/src/hooks/dhcp/mysql_lb/tests/.gitignore
deleted file mode 100644 (file)
index c691613..0000000
+++ /dev/null
@@ -1 +0,0 @@
-mysql_lb_unittests
diff --git a/src/hooks/dhcp/mysql_lb/tests/Makefile.am b/src/hooks/dhcp/mysql_lb/tests/Makefile.am
deleted file mode 100644 (file)
index aae7a20..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/mysql_lb -I$(top_srcdir)/src/hooks/dhcp/mysql_lb
-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 += mysql_lb_unittests
-
-mysql_lb_unittests_SOURCES  = run_unittests.cc
-mysql_lb_unittests_SOURCES += mysql_lease_mgr_unittest.cc
-mysql_lb_unittests_SOURCES += mysql_lease_extended_info_unittest.cc
-mysql_lb_unittests_SOURCES += mysql_bootp_unittest.cc
-
-mysql_lb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-mysql_lb_unittests_CPPFLAGS += $(MYSQL_CPPFLAGS)
-
-mysql_lb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-mysql_lb_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-mysql_lb_unittests_LDFLAGS += $(MYSQL_LIBS)
-
-mysql_lb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/mysql_lb/libmysqllb.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/testutils/libdhcptest.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/mysql/testutils/libmysqltest.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/mysql/libkea-mysql.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-mysql_lb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-mysql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
-endif
-
-noinst_PROGRAMS = $(TESTS)
-
diff --git a/src/hooks/dhcp/mysql_lb/tests/run_unittests.cc b/src/hooks/dhcp/mysql_lb/tests/run_unittests.cc
deleted file mode 100644 (file)
index 63b2d4a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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 <gtest/gtest.h>
-
-#include <util/unittests/run_all.h>
-#include <log/logger_support.h>
-
-int
-main(int argc, char* argv[]) {
-    ::testing::InitGoogleTest(&argc, argv);
-    isc::log::initLogger();
-    return (isc::util::unittests::run_all());
-}
diff --git a/src/hooks/dhcp/mysql_lb/version.cc b/src/hooks/dhcp/mysql_lb/version.cc
deleted file mode 100644 (file)
index d64404b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2024 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 <hooks/hooks.h>
-
-extern "C" {
-
-/// @brief returns Kea hooks version.
-int version() {
-    return (KEA_HOOKS_VERSION);
-}
-
-}
diff --git a/src/hooks/dhcp/pgsql/.gitattributes b/src/hooks/dhcp/pgsql/.gitattributes
new file mode 100644 (file)
index 0000000..13f2249
--- /dev/null
@@ -0,0 +1,6 @@
+/pgsql_cb_messages.cc            -diff merge=ours
+/pgsql_cb_messages.h             -diff merge=ours
+/pgsql_hb_messages.cc            -diff merge=ours
+/pgsql_hb_messages.h             -diff merge=ours
+/pgsql_lb_messages.cc            -diff merge=ours
+/pgsql_lb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/pgsql/Makefile.am b/src/hooks/dhcp/pgsql/Makefile.am
new file mode 100644 (file)
index 0000000..78237b7
--- /dev/null
@@ -0,0 +1,108 @@
+SUBDIRS = . tests libloadtests
+
+AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(PGSQL_CPPFLAGS)
+AM_CXXFLAGS  = $(KEA_CXXFLAGS)
+
+# Ensure that the message file is included in the distribution
+EXTRA_DIST = pgsql_cb_messages.mes
+EXTRA_DIST += pgsql_hb_messages.mes
+EXTRA_DIST += pgsql_lb_messages.mes
+
+CLEANFILES = *.gcno *.gcda
+
+# convenience archive
+
+noinst_LTLIBRARIES = libpgsql.la
+
+libpgsql_la_SOURCES  = pgsql_callouts.cc
+libpgsql_la_SOURCES += pgsql_cb_dhcp4.cc pgsql_cb_dhcp4.h
+libpgsql_la_SOURCES += pgsql_cb_dhcp6.cc pgsql_cb_dhcp6.h
+libpgsql_la_SOURCES += pgsql_cb_impl.cc pgsql_cb_impl.h
+libpgsql_la_SOURCES += pgsql_cb_messages.cc pgsql_cb_messages.h
+libpgsql_la_SOURCES += pgsql_cb_log.cc pgsql_cb_log.h
+libpgsql_la_SOURCES += pgsql_query_macros_dhcp.h
+libpgsql_la_SOURCES += pgsql_hb_log.cc pgsql_hb_log.h
+libpgsql_la_SOURCES += pgsql_hb_messages.cc pgsql_hb_messages.h
+libpgsql_la_SOURCES += pgsql_host_data_source.cc pgsql_host_data_source.h
+libpgsql_la_SOURCES += pgsql_lb_log.cc pgsql_lb_log.h
+libpgsql_la_SOURCES += pgsql_lb_messages.cc pgsql_lb_messages.h
+libpgsql_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
+libpgsql_la_SOURCES += version.cc
+
+libpgsql_la_CXXFLAGS = $(AM_CXXFLAGS)
+libpgsql_la_CPPFLAGS = $(AM_CPPFLAGS)
+
+# install the shared object into $(libdir)/kea/hooks
+lib_hooksdir = $(libdir)/kea/hooks
+lib_hooks_LTLIBRARIES = libdhcp_pgsql.la
+
+libdhcp_pgsql_la_SOURCES  =
+libdhcp_pgsql_la_LDFLAGS  = $(AM_LDFLAGS) $(PGSQL_LIBS)
+libdhcp_pgsql_la_LDFLAGS  += -avoid-version -export-dynamic -module
+
+libdhcp_pgsql_la_LIBADD  = libpgsql.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
+libdhcp_pgsql_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+
+# If we want to get rid of all generated messages files, we need to use
+# make maintainer-clean. The proper way to introduce custom commands for
+# that operation is to define maintainer-clean-local target. However,
+# make maintainer-clean also removes Makefile, so running configure script
+# is required.  To make it easy to rebuild messages without going through
+# reconfigure, a new target messages-clean has been added.
+maintainer-clean-local:
+       rm -f pgsql_cb_messages.h pgsql_cb_messages.cc
+       rm -f pgsql_hb_messages.h pgsql_hb_messages.cc
+       rm -f pgsql_lb_messages.h pgsql_lb_messages.cc
+
+# To regenerate messages files, one can do:
+#
+# make messages-clean
+# make messages
+#
+# This is needed only when a .mes file is modified.
+messages-clean: maintainer-clean-local
+
+if GENERATE_MESSAGES
+
+# Define rule to build logging source files from message file
+messages: pgsql_cb_messages.h pgsql_cb_messages.cc \
+         pgsql_hb_messages.h pgsql_hb_messages.cc \
+         pgsql_lb_messages.h pgsql_lb_messages.cc
+       @echo Message files regenerated
+
+pgsql_cb_messages.h pgsql_cb_messages.cc: pgsql_cb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_cb_messages.mes
+
+pgsql_hb_messages.h pgsql_hb_messages.cc: pgsql_hb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_hb_messages.mes
+
+pgsql_lb_messages.h pgsql_lb_messages.cc: pgsql_lb_messages.mes
+       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql/pgsql_lb_messages.mes
+
+else
+
+messages: pgsql_cb_messages.h pgsql_cb_messages.cc \
+         pgsql_hb_messages.h pgsql_hb_messages.cc \
+         pgsql_lb_messages.h pgsql_lb_messages.cc
+       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
+
+endif
+
similarity index 91%
rename from src/hooks/dhcp/pgsql_hb/libloadtests/Makefile.am
rename to src/hooks/dhcp/pgsql/libloadtests/Makefile.am
index 552e49a5508f6831e33bd74faeb172476320097d..b098047ae9a5952a937b309845afcbf7a0c194d5 100644 (file)
@@ -1,9 +1,9 @@
 SUBDIRS = .
 
 AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_hb -I$(top_srcdir)/src/hooks/dhcp/pgsql_hb
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql -I$(top_srcdir)/src/hooks/dhcp/pgsql
 AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_PGSQL_HB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/pgsql_hb/.libs/libdhcp_pgsql_hb.so\"
+AM_CPPFLAGS += -DLIBDHCP_PGSQL_SO=\"$(abs_top_builddir)/src/hooks/dhcp/pgsql/.libs/libdhcp_pgsql.so\"
 AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 if USE_STATIC_LINK
similarity index 80%
rename from src/hooks/dhcp/pgsql_cb/libloadtests/load_unload_unittests.cc
rename to src/hooks/dhcp/pgsql/libloadtests/load_unload_unittests.cc
index 11388463ce1b19a6f06aa96684567807098468ec..c55925133383474bdfd401d88ac84218999d4c4d 100644 (file)
@@ -27,31 +27,31 @@ using namespace isc::process;
 
 namespace {
 
-/// @brief Test fixture for testing loading and unloading the PgSQL cb library
-class PgSqlCbLibLoadTest : public isc::test::LibLoadTest {
+/// @brief Test fixture for testing loading and unloading the PostgreSQL cb library
+class PgSqlLibLoadTest : public isc::test::LibLoadTest {
 public:
     /// @brief Constructor
-    PgSqlCbLibLoadTest() : LibLoadTest(LIBDHCP_PGSQL_CB_SO) {
+    PgSqlLibLoadTest() : LibLoadTest(LIBDHCP_PGSQL_SO) {
     }
 
     /// @brief Destructor
-    virtual ~PgSqlCbLibLoadTest() {
+    virtual ~PgSqlLibLoadTest() {
         unloadLibraries();
     }
 };
 
 // Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlCbLibLoadTest, validLoad4) {
+TEST_F(PgSqlLibLoadTest, validLoad4) {
     validDaemonTest("kea-dhcp4");
 }
 
 // Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlCbLibLoadTest, validLoad6) {
+TEST_F(PgSqlLibLoadTest, validLoad6) {
     validDaemonTest("kea-dhcp6", AF_INET6);
 }
 
 // Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(PgSqlCbLibLoadTest, invalidDaemonLoad) {
+TEST_F(PgSqlLibLoadTest, invalidDaemonLoad) {
     invalidDaemonTest("kea-ctrl-agent");
     invalidDaemonTest("kea-dhcp-ddns");
     invalidDaemonTest("bogus");
similarity index 76%
rename from src/hooks/dhcp/pgsql_cb/pgsql_cb_callouts.cc
rename to src/hooks/dhcp/pgsql/pgsql_callouts.cc
index 536f94f11485c8096821f60908cf045b7192933e..e3735da1a793b16aad86b672c89cecf215f6eb01 100644 (file)
 #include <config.h>
 
 #include <asiolink/io_service_mgr.h>
+#include <dhcpsrv/base_host_data_source.h>
 #include <dhcpsrv/cfgmgr.h>
+#include <dhcpsrv/lease_mgr_factory.h>
 #include <hooks/hooks.h>
 #include <process/daemon.h>
 #include <pgsql_cb_impl.h>
-
 #include <pgsql_cb_dhcp4.h>
 #include <pgsql_cb_dhcp6.h>
 #include <pgsql_cb_log.h>
+#include <pgsql_hb_log.h>
+#include <pgsql_host_data_source.h>
+#include <pgsql_lb_log.h>
+#include <pgsql_lease_mgr.h>
 
 #include <sstream>
 #include <string>
@@ -54,11 +59,24 @@ int load(LibraryHandle& /* handle */) {
         }
     }
 
-    LOG_INFO(pgsql_cb_logger, PGSQL_CB_INIT_OK);
     // Register PostgreSQL CB factories with CB Managers
     isc::dhcp::PgSqlConfigBackendDHCPv4::registerBackendType();
     isc::dhcp::PgSqlConfigBackendDHCPv6::registerBackendType();
+    LOG_INFO(pgsql_cb_logger, PGSQL_CB_INIT_OK);
 
+    // Register PostgreSQL HB factories with Host Managers
+    HostDataSourceFactory::registerFactory("postgresql",
+                                           PgSqlHostDataSource::factory,
+                                           true,
+                                           PgSqlHostDataSource::getDBVersion);
+    LOG_INFO(pgsql_hb_logger, PGSQL_HB_INIT_OK);
+
+    // Register PostgreSQL LB factories with Lease Managers
+    LeaseMgrFactory::registerFactory("postgresql",
+                                     PgSqlLeaseMgr::factory,
+                                     true,
+                                     PgSqlLeaseMgr::getDBVersion);
+    LOG_INFO(pgsql_lb_logger, PGSQL_LB_INIT_OK);
     return (0);
 }
 
@@ -90,7 +108,6 @@ int dhcp6_srv_configured(CalloutHandle& /* handle */) {
 ///
 /// @return 0 if deregistration was successful, 1 otherwise
 int unload() {
-    LOG_INFO(pgsql_cb_logger, PGSQL_CB_DEINIT_OK);
     // Unregister the factories and remove PostgreSQL backends
     isc::dhcp::PgSqlConfigBackendDHCPv4::unregisterBackendType();
     isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType();
@@ -100,6 +117,15 @@ int unload() {
         io_service->stopAndPoll();
         isc::dhcp::PgSqlConfigBackendImpl::setIOService(IOServicePtr());
     }
+    LOG_INFO(pgsql_cb_logger, PGSQL_CB_DEINIT_OK);
+
+    // Unregister the factories and remove PostgreSQL backends
+    HostDataSourceFactory::deregisterFactory("postgresql", true);
+    LOG_INFO(pgsql_hb_logger, PGSQL_HB_DEINIT_OK);
+
+    // Unregister the factories and remove PostgreSQL backends
+    LeaseMgrFactory::deregisterFactory("postgresql", true);
+    LOG_INFO(pgsql_lb_logger, PGSQL_LB_DEINIT_OK);
     return (0);
 }
 
similarity index 99%
rename from src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.cc
rename to src/hooks/dhcp/pgsql/pgsql_cb_messages.cc
index ea9550beae8cbd3fb68b5c2eafe1a0b4d4eb7a89..e292cd3e5a064336d42bc74764386bb65c1d04d3 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../../src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes
+// File created from ../../../../src/hooks/dhcp/pgsql/pgsql_cb_messages.mes
 
 #include <cstddef>
 #include <log/message_types.h>
similarity index 99%
rename from src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.h
rename to src/hooks/dhcp/pgsql/pgsql_cb_messages.h
index 57a41d30cc9bb05c8a41a068e97a4fe02b0e3116..9c21d1f5caf3b4c6c89e06b17ea8495bf72ae8af 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../../src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes
+// File created from ../../../../src/hooks/dhcp/pgsql/pgsql_cb_messages.mes
 
 #ifndef PGSQL_CB_MESSAGES_H
 #define PGSQL_CB_MESSAGES_H
diff --git a/src/hooks/dhcp/pgsql/tests/.gitignore b/src/hooks/dhcp/pgsql/tests/.gitignore
new file mode 100644 (file)
index 0000000..a876b60
--- /dev/null
@@ -0,0 +1 @@
+/pgsql_unittests
\ No newline at end of file
diff --git a/src/hooks/dhcp/pgsql/tests/Makefile.am b/src/hooks/dhcp/pgsql/tests/Makefile.am
new file mode 100644 (file)
index 0000000..5935707
--- /dev/null
@@ -0,0 +1,68 @@
+SUBDIRS = .
+
+AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql -I$(top_srcdir)/src/hooks/dhcp/pgsql
+AM_CPPFLAGS += $(BOOST_INCLUDES) $(PGSQL_CPPFLAGS)
+AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
+
+AM_CXXFLAGS = $(KEA_CXXFLAGS)
+
+if USE_STATIC_LINK
+AM_LDFLAGS = -static
+endif
+
+# Unit test data files need to get installed.
+EXTRA_DIST =
+
+CLEANFILES = *.gcno *.gcda
+
+TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
+
+TESTS =
+if HAVE_GTEST
+TESTS += pgsql_unittests
+
+pgsql_unittests_SOURCES  = pgsql_cb_impl_unittest.cc
+pgsql_unittests_SOURCES += pgsql_cb_dhcp4_unittest.cc
+pgsql_unittests_SOURCES += pgsql_cb_dhcp4_mgr_unittest.cc
+pgsql_unittests_SOURCES += pgsql_cb_dhcp6_unittest.cc
+pgsql_unittests_SOURCES += pgsql_cb_dhcp6_mgr_unittest.cc
+pgsql_unittests_SOURCES += pgsql_host_data_source_unittest.cc
+pgsql_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
+pgsql_unittests_SOURCES += pgsql_lease_extended_info_unittest.cc
+pgsql_unittests_SOURCES += pgsql_bootp_unittest.cc
+pgsql_unittests_SOURCES += run_unittests.cc
+
+pgsql_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
+
+pgsql_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
+
+pgsql_unittests_CXXFLAGS = $(AM_CXXFLAGS)
+
+pgsql_unittests_LDADD  = $(top_builddir)/src/hooks/dhcp/pgsql/libpgsql.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
+pgsql_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
+pgsql_unittests_LDADD += $(LOG4CPLUS_LIBS)
+pgsql_unittests_LDADD += $(CRYPTO_LIBS)
+pgsql_unittests_LDADD += $(BOOST_LIBS)
+pgsql_unittests_LDADD += $(GTEST_LDADD)
+endif
+noinst_PROGRAMS = $(TESTS)
similarity index 99%
rename from src/hooks/dhcp/pgsql_hb/tests/pgsql_host_data_source_unittest.cc
rename to src/hooks/dhcp/pgsql/tests/pgsql_host_data_source_unittest.cc
index b5c3d53e2cc47db0e801c2b108a7d07dab7a5c5b..1f128308bc972552a3eafbec0cc2a89f7831c8cc 100644 (file)
@@ -1824,19 +1824,21 @@ TEST_F(PgSQLHostMgrDbLostCallbackTest, testDbLostAndFailedAfterTimeoutCallbackMu
 
 /// @brief Test fixture class for testing @ref CfgDbAccessTest using PostgreSQL
 /// backend.
-class CfgPgSqlDbAccessTest : public ::testing::Test {
+class CfgPgSqlHbDbAccessTest : public ::testing::Test {
 public:
 
     /// @brief Constructor.
-    CfgPgSqlDbAccessTest() {
+    CfgPgSqlHbDbAccessTest() {
         // Ensure we have the proper schema with no transient data.
         db::test::createPgSQLSchema();
+        HostMgr::create();
     }
 
     /// @brief Destructor.
-    virtual ~CfgPgSqlDbAccessTest() {
+    virtual ~CfgPgSqlHbDbAccessTest() {
         // If data wipe enabled, delete transient data otherwise destroy the schema
         db::test::destroyPgSQLSchema();
+        HostMgr::create();
     }
 
     /// @brief Initializer.
@@ -1845,7 +1847,7 @@ public:
 
 // Tests that memfile lease manager and PostgreSQL host data source can be created from a
 // specified configuration.
-TEST_F(CfgPgSqlDbAccessTest, createManagers) {
+TEST_F(CfgPgSqlHbDbAccessTest, createManagers) {
     CfgDbAccess cfg;
     ASSERT_NO_THROW(cfg.setLeaseDbAccessString("type=memfile persist=false universe=4"));
     ASSERT_NO_THROW(cfg.setHostDbAccessString(db::test::validPgSQLConnectionString()));
@@ -1877,7 +1879,7 @@ TEST_F(CfgPgSqlDbAccessTest, createManagers) {
 // Tests that the createManagers function utilizes the setting in the
 // CfgDbAccess class which controls whether the IP reservations must
 // be unique or can be non-unique.
-TEST_F(CfgPgSqlDbAccessTest, createManagersIPResrvUnique) {
+TEST_F(CfgPgSqlHbDbAccessTest, createManagersIPResrvUnique) {
     CfgDbAccess cfg;
 
     cfg.setIPReservationsUnique(false);
similarity index 99%
rename from src/hooks/dhcp/pgsql_lb/tests/pgsql_lease_mgr_unittest.cc
rename to src/hooks/dhcp/pgsql/tests/pgsql_lease_mgr_unittest.cc
index 7e0fa4a28dc72b1a9229216f90aaa24ddc47d5a6..095f78a7c10037744208eaae2c22c66b45ba1e72 100644 (file)
@@ -1357,17 +1357,18 @@ TEST_F(PgSqlLeaseMgrTest, bigStats) {
 
 /// @brief Test fixture class for testing @ref CfgDbAccessTest using PostgreSQL
 /// backend.
-class CfgPgSqlDbAccessTest : public ::testing::Test {
+class CfgPgSqlLbDbAccessTest : public ::testing::Test {
 public:
 
     /// @brief Constructor.
-    CfgPgSqlDbAccessTest() {
+    CfgPgSqlLbDbAccessTest() {
         // Ensure we have the proper schema with no transient data.
         db::test::createPgSQLSchema();
+        LeaseMgrFactory::destroy();
     }
 
     /// @brief Destructor.
-    virtual ~CfgPgSqlDbAccessTest() {
+    virtual ~CfgPgSqlLbDbAccessTest() {
         // If data wipe enabled, delete transient data otherwise destroy the schema
         db::test::destroyPgSQLSchema();
         LeaseMgrFactory::destroy();
@@ -1379,7 +1380,7 @@ public:
 
 // Tests that PostgreSQL lease manager and host data source can be created from a
 // specified configuration.
-TEST_F(CfgPgSqlDbAccessTest, createManagers) {
+TEST_F(CfgPgSqlLbDbAccessTest, createManagers) {
     CfgDbAccess cfg;
     ASSERT_NO_THROW(cfg.setLeaseDbAccessString(db::test::validPgSQLConnectionString()));
     ASSERT_NO_THROW(cfg.createManagers());
diff --git a/src/hooks/dhcp/pgsql_cb/.gitattributes b/src/hooks/dhcp/pgsql_cb/.gitattributes
deleted file mode 100644 (file)
index 09fb0fe..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/pgsql_cb_messages.cc            -diff merge=ours
-/pgsql_cb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/pgsql_cb/Makefile.am b/src/hooks/dhcp/pgsql_cb/Makefile.am
deleted file mode 100644 (file)
index 2bb8eae..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES) $(PGSQL_CPPFLAGS)
-AM_CXXFLAGS  = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = pgsql_cb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libpgsqlcb.la
-       
-libpgsqlcb_la_SOURCES  = pgsql_cb_callouts.cc
-
-# Commented out for now - see kea#95
-libpgsqlcb_la_SOURCES += pgsql_cb_dhcp4.cc pgsql_cb_dhcp4.h
-
-# Commented out for now - to be added back in #96
-libpgsqlcb_la_SOURCES += pgsql_cb_dhcp6.cc pgsql_cb_dhcp6.h
-
-libpgsqlcb_la_SOURCES += pgsql_cb_impl.cc pgsql_cb_impl.h
-libpgsqlcb_la_SOURCES += pgsql_cb_messages.cc pgsql_cb_messages.h
-libpgsqlcb_la_SOURCES += pgsql_cb_log.cc pgsql_cb_log.h
-libpgsqlcb_la_SOURCES += pgsql_query_macros_dhcp.h
-libpgsqlcb_la_SOURCES += version.cc
-
-libpgsqlcb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libpgsqlcb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_pgsql_cb.la
-
-libdhcp_pgsql_cb_la_SOURCES  =
-libdhcp_pgsql_cb_la_LDFLAGS  = $(AM_LDFLAGS) $(pgsql_LIBS)
-libdhcp_pgsql_cb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_pgsql_cb_la_LIBADD  = libpgsqlcb.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/http/libkea-http.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_pgsql_cb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f pgsql_cb_messages.h pgsql_cb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: pgsql_cb_messages.h pgsql_cb_messages.cc
-       @echo Message files regenerated
-
-pgsql_cb_messages.h pgsql_cb_messages.cc: pgsql_cb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql_cb/pgsql_cb_messages.mes
-
-else
-
-messages pgsql_cb_messages.h pgsql_cb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
diff --git a/src/hooks/dhcp/pgsql_cb/libloadtests/.gitignore b/src/hooks/dhcp/pgsql_cb/libloadtests/.gitignore
deleted file mode 100644 (file)
index ada6ed5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hook_load_unittests
diff --git a/src/hooks/dhcp/pgsql_cb/libloadtests/Makefile.am b/src/hooks/dhcp/pgsql_cb/libloadtests/Makefile.am
deleted file mode 100644 (file)
index 1d6f178..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_cb -I$(top_srcdir)/src/hooks/dhcp/pgsql_cb
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_PGSQL_CB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/pgsql_cb/.libs/libdhcp_pgsql_cb.so\"
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = \
-       $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-if HAVE_GTEST
-
-TESTS = hook_load_unittests
-
-hook_load_unittests_SOURCES  =
-hook_load_unittests_SOURCES += load_unload_unittests.cc
-hook_load_unittests_SOURCES += run_unittests.cc
-hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-
-hook_load_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-hook_load_unittests_LDADD += $(LOG4CPLUS_LIBS)
-hook_load_unittests_LDADD += $(CRYPTO_LIBS)
-hook_load_unittests_LDADD += $(BOOST_LIBS)
-hook_load_unittests_LDADD += $(GTEST_LDADD)
-
-noinst_PROGRAMS = $(TESTS)
-
-endif
diff --git a/src/hooks/dhcp/pgsql_cb/tests/.gitignore b/src/hooks/dhcp/pgsql_cb/tests/.gitignore
deleted file mode 100644 (file)
index d87fadf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/pgsql_cb_unittests
\ No newline at end of file
diff --git a/src/hooks/dhcp/pgsql_cb/tests/Makefile.am b/src/hooks/dhcp/pgsql_cb/tests/Makefile.am
deleted file mode 100644 (file)
index f285cfd..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_cb -I$(top_srcdir)/src/hooks/dhcp/pgsql_cb
-AM_CPPFLAGS += $(BOOST_INCLUDES) $(PGSQL_CPPFLAGS)
-AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-# Unit test data files need to get installed.
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-TESTS =
-if HAVE_GTEST
-TESTS += pgsql_cb_unittests
-
-pgsql_cb_unittests_SOURCES  = pgsql_cb_impl_unittest.cc
-pgsql_cb_unittests_SOURCES  += pgsql_cb_dhcp4_unittest.cc
-pgsql_cb_unittests_SOURCES += pgsql_cb_dhcp4_mgr_unittest.cc
-pgsql_cb_unittests_SOURCES += pgsql_cb_dhcp6_unittest.cc
-pgsql_cb_unittests_SOURCES += pgsql_cb_dhcp6_mgr_unittest.cc
-pgsql_cb_unittests_SOURCES += run_unittests.cc
-
-pgsql_cb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-
-pgsql_cb_unittests_LDFLAGS  = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-
-pgsql_cb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-pgsql_cb_unittests_LDADD  = $(top_builddir)/src/hooks/dhcp/pgsql_cb/libpgsqlcb.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-pgsql_cb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-pgsql_cb_unittests_LDADD += $(LOG4CPLUS_LIBS)
-pgsql_cb_unittests_LDADD += $(CRYPTO_LIBS)
-pgsql_cb_unittests_LDADD += $(BOOST_LIBS)
-pgsql_cb_unittests_LDADD += $(GTEST_LDADD)
-endif
-noinst_PROGRAMS = $(TESTS)
diff --git a/src/hooks/dhcp/pgsql_hb/.gitattributes b/src/hooks/dhcp/pgsql_hb/.gitattributes
deleted file mode 100644 (file)
index 9a63b22..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/pgsql_hb_messages.cc            -diff merge=ours
-/pgsql_hb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/pgsql_hb/Makefile.am b/src/hooks/dhcp/pgsql_hb/Makefile.am
deleted file mode 100644 (file)
index a2ee882..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = pgsql_hb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libpgsqlhb.la
-libpgsqlhb_la_SOURCES  = pgsql_hb_callouts.cc
-libpgsqlhb_la_SOURCES += pgsql_hb_log.cc pgsql_hb_log.h
-libpgsqlhb_la_SOURCES += pgsql_hb_messages.cc pgsql_hb_messages.h
-libpgsqlhb_la_SOURCES += pgsql_host_data_source.cc pgsql_host_data_source.h
-libpgsqlhb_la_SOURCES += version.cc
-
-libpgsqlhb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libpgsqlhb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_pgsql_hb.la
-
-libdhcp_pgsql_hb_la_SOURCES  =
-libdhcp_pgsql_hb_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
-libdhcp_pgsql_hb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_pgsql_hb_la_LIBADD = libpgsqlhb.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_pgsql_hb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-libdhcp_pgsql_hb_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f pgsql_hb_messages.h pgsql_hb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: pgsql_hb_messages.h pgsql_hb_messages.cc
-       @echo Message files regenerated
-
-pgsql_hb_messages.h pgsql_hb_messages.cc: pgsql_hb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql_hb/pgsql_hb_messages.mes
-
-else
-
-messages pgsql_hb_messages.h pgsql_hb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
-
diff --git a/src/hooks/dhcp/pgsql_hb/libloadtests/.gitignore b/src/hooks/dhcp/pgsql_hb/libloadtests/.gitignore
deleted file mode 100644 (file)
index ada6ed5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hook_load_unittests
diff --git a/src/hooks/dhcp/pgsql_hb/libloadtests/load_unload_unittests.cc b/src/hooks/dhcp/pgsql_hb/libloadtests/load_unload_unittests.cc
deleted file mode 100644 (file)
index 5de4cd2..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2024 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/.
-
-/// @file This file contains tests which exercise the load and unload
-/// functions in the ddns tuning hook library. In order to test the load
-/// function, one must be able to pass it hook library parameters. The
-/// the only way to populate these parameters is by actually loading the
-/// library via HooksManager::loadLibraries().
-
-#include <config.h>
-
-#include <dhcpsrv/testutils/lib_load_test_fixture.h>
-#include <testutils/gtest_utils.h>
-
-#include <gtest/gtest.h>
-#include <errno.h>
-
-using namespace std;
-using namespace isc;
-using namespace isc::hooks;
-using namespace isc::data;
-using namespace isc::dhcp;
-using namespace isc::process;
-
-namespace {
-
-/// @brief Test fixture for testing loading and unloading the PgSQL hb library
-class PgSqlHbLibLoadTest : public isc::test::LibLoadTest {
-public:
-    /// @brief Constructor
-    PgSqlHbLibLoadTest() : LibLoadTest(LIBDHCP_PGSQL_HB_SO) {
-    }
-
-    /// @brief Destructor
-    virtual ~PgSqlHbLibLoadTest() {
-        unloadLibraries();
-    }
-};
-
-// Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlHbLibLoadTest, validLoad4) {
-    validDaemonTest("kea-dhcp4");
-}
-
-// Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlHbLibLoadTest, validLoad6) {
-    validDaemonTest("kea-dhcp6", AF_INET6);
-}
-
-// Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(PgSqlHbLibLoadTest, invalidDaemonLoad) {
-    invalidDaemonTest("kea-ctrl-agent");
-    invalidDaemonTest("kea-dhcp-ddns");
-    invalidDaemonTest("bogus");
-}
-
-} // end of anonymous namespace
diff --git a/src/hooks/dhcp/pgsql_hb/libloadtests/run_unittests.cc b/src/hooks/dhcp/pgsql_hb/libloadtests/run_unittests.cc
deleted file mode 100644 (file)
index 755b9e4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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/hooks/dhcp/pgsql_hb/pgsql_hb_callouts.cc b/src/hooks/dhcp/pgsql_hb/pgsql_hb_callouts.cc
deleted file mode 100644 (file)
index ce82230..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2024 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/.
-
-// Functions accessed by the hooks framework use C linkage to avoid the name
-// mangling that accompanies use of the C++ compiler as well as to avoid
-// issues related to namespaces.
-
-#include <config.h>
-
-#include <asiolink/io_service_mgr.h>
-#include <dhcpsrv/base_host_data_source.h>
-#include <dhcpsrv/cfgmgr.h>
-#include <hooks/hooks.h>
-#include <process/daemon.h>
-#include <pgsql_hb_log.h>
-#include <pgsql_host_data_source.h>
-
-#include <sstream>
-#include <string>
-
-using namespace isc::asiolink;
-using namespace isc::dhcp;
-using namespace isc::hooks;
-using namespace isc::log;
-using namespace isc::process;
-using namespace std;
-
-extern "C" {
-
-/// @brief This function is called when the library is loaded.
-///
-/// @param handle library handle
-/// @return 0 when initialization is successful, 1 otherwise
-
-int load(LibraryHandle& /* handle */) {
-    // Make the hook library not loadable by d2 or ca.
-    uint16_t family = CfgMgr::instance().getFamily();
-    const std::string& proc_name = Daemon::getProcName();
-    if (family == AF_INET) {
-        if (proc_name != "kea-dhcp4") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp4");
-        }
-    } else {
-        if (proc_name != "kea-dhcp6") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp6");
-        }
-    }
-
-    // Register PgSQL HB factories with Host Managers
-    HostDataSourceFactory::registerFactory("postgresql",
-                                           PgSqlHostDataSource::factory,
-                                           true,
-                                           PgSqlHostDataSource::getDBVersion);
-
-    LOG_INFO(pgsql_hb_logger, PGSQL_HB_INIT_OK);
-    return (0);
-}
-
-/// @brief This function is called when the library is unloaded.
-///
-/// @return 0 if deregistration was successful, 1 otherwise
-int unload() {
-    // Unregister the factories and remove PgSQL backends
-    HostDataSourceFactory::deregisterFactory("postgresql", true);
-
-    LOG_INFO(pgsql_hb_logger, PGSQL_HB_DEINIT_OK);
-    return (0);
-}
-
-/// @brief This function is called to retrieve the multi-threading compatibility.
-///
-/// @note: the compatibility is based on the assumption this hook library
-/// is always called from the main thread.
-///
-/// @return 1 which means compatible with multi-threading.
-int multi_threading_compatible() {
-    return (1);
-}
-
-} // end extern "C"
diff --git a/src/hooks/dhcp/pgsql_hb/tests/.gitignore b/src/hooks/dhcp/pgsql_hb/tests/.gitignore
deleted file mode 100644 (file)
index 2ab2ed2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pgsql_hb_unittests
diff --git a/src/hooks/dhcp/pgsql_hb/tests/Makefile.am b/src/hooks/dhcp/pgsql_hb/tests/Makefile.am
deleted file mode 100644 (file)
index 9c4b946..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_hb -I$(top_srcdir)/src/hooks/dhcp/pgsql_hb
-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 += pgsql_hb_unittests
-
-pgsql_hb_unittests_SOURCES  = run_unittests.cc
-pgsql_hb_unittests_SOURCES += pgsql_host_data_source_unittest.cc
-
-pgsql_hb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-pgsql_hb_unittests_CPPFLAGS += $(PGSQL_CPPFLAGS)
-
-pgsql_hb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-pgsql_hb_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-pgsql_hb_unittests_LDFLAGS += $(PGSQL_LIBS)
-
-pgsql_hb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/pgsql_hb/libpgsqlhb.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/testutils/libdhcptest.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-pgsql_hb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-pgsql_hb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
-endif
-
-noinst_PROGRAMS = $(TESTS)
-
diff --git a/src/hooks/dhcp/pgsql_hb/tests/run_unittests.cc b/src/hooks/dhcp/pgsql_hb/tests/run_unittests.cc
deleted file mode 100644 (file)
index 63b2d4a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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 <gtest/gtest.h>
-
-#include <util/unittests/run_all.h>
-#include <log/logger_support.h>
-
-int
-main(int argc, char* argv[]) {
-    ::testing::InitGoogleTest(&argc, argv);
-    isc::log::initLogger();
-    return (isc::util::unittests::run_all());
-}
diff --git a/src/hooks/dhcp/pgsql_hb/version.cc b/src/hooks/dhcp/pgsql_hb/version.cc
deleted file mode 100644 (file)
index d64404b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2024 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 <hooks/hooks.h>
-
-extern "C" {
-
-/// @brief returns Kea hooks version.
-int version() {
-    return (KEA_HOOKS_VERSION);
-}
-
-}
diff --git a/src/hooks/dhcp/pgsql_lb/.gitattributes b/src/hooks/dhcp/pgsql_lb/.gitattributes
deleted file mode 100644 (file)
index 2b7068e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/pgsql_lb_messages.cc            -diff merge=ours
-/pgsql_lb_messages.h             -diff merge=ours
diff --git a/src/hooks/dhcp/pgsql_lb/Makefile.am b/src/hooks/dhcp/pgsql_lb/Makefile.am
deleted file mode 100644 (file)
index 00eb7a3..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-SUBDIRS = . tests libloadtests
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += $(PGSQL_CPPFLAGS)
-
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-# Ensure that the message file is included in the distribution
-EXTRA_DIST = pgsql_lb_messages.mes
-
-CLEANFILES = *.gcno *.gcda
-
-# convenience archive
-
-noinst_LTLIBRARIES = libpgsqllb.la
-libpgsqllb_la_SOURCES  = pgsql_lb_callouts.cc
-libpgsqllb_la_SOURCES += pgsql_lb_log.cc pgsql_lb_log.h
-libpgsqllb_la_SOURCES += pgsql_lb_messages.cc pgsql_lb_messages.h
-libpgsqllb_la_SOURCES += pgsql_lease_mgr.cc pgsql_lease_mgr.h
-libpgsqllb_la_SOURCES += version.cc
-
-libpgsqllb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libpgsqllb_la_CPPFLAGS = $(AM_CPPFLAGS)
-
-# install the shared object into $(libdir)/kea/hooks
-lib_hooksdir = $(libdir)/kea/hooks
-lib_hooks_LTLIBRARIES = libdhcp_pgsql_lb.la
-
-libdhcp_pgsql_lb_la_SOURCES  =
-libdhcp_pgsql_lb_la_LDFLAGS  = $(AM_LDFLAGS) $(MYSQL_LIBS)
-libdhcp_pgsql_lb_la_LDFLAGS  += -avoid-version -export-dynamic -module
-
-libdhcp_pgsql_lb_la_LIBADD = libpgsqllb.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/database/libkea-database.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la
-libdhcp_pgsql_lb_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-libdhcp_pgsql_lb_la_LIBADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS)
-
-# If we want to get rid of all generated messages files, we need to use
-# make maintainer-clean. The proper way to introduce custom commands for
-# that operation is to define maintainer-clean-local target. However,
-# make maintainer-clean also removes Makefile, so running configure script
-# is required.  To make it easy to rebuild messages without going through
-# reconfigure, a new target messages-clean has been added.
-maintainer-clean-local:
-       rm -f pgsql_lb_messages.h pgsql_lb_messages.cc
-
-# To regenerate messages files, one can do:
-#
-# make messages-clean
-# make messages
-#
-# This is needed only when a .mes file is modified.
-messages-clean: maintainer-clean-local
-
-if GENERATE_MESSAGES
-
-# Define rule to build logging source files from message file
-messages: pgsql_lb_messages.h pgsql_lb_messages.cc
-       @echo Message files regenerated
-
-pgsql_lb_messages.h pgsql_lb_messages.cc: pgsql_lb_messages.mes
-       $(top_builddir)/src/lib/log/compiler/kea-msg-compiler $(top_srcdir)/src/hooks/dhcp/pgsql_lb/pgsql_lb_messages.mes
-
-else
-
-messages pgsql_lb_messages.h pgsql_lb_messages.cc:
-       @echo Messages generation disabled. Configure with --enable-generate-messages to enable it.
-
-endif
-
diff --git a/src/hooks/dhcp/pgsql_lb/libloadtests/.gitignore b/src/hooks/dhcp/pgsql_lb/libloadtests/.gitignore
deleted file mode 100644 (file)
index ada6ed5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hook_load_unittests
diff --git a/src/hooks/dhcp/pgsql_lb/libloadtests/Makefile.am b/src/hooks/dhcp/pgsql_lb/libloadtests/Makefile.am
deleted file mode 100644 (file)
index c436c60..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS  = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_lb -I$(top_srcdir)/src/hooks/dhcp/pgsql_lb
-AM_CPPFLAGS += $(BOOST_INCLUDES)
-AM_CPPFLAGS += -DLIBDHCP_PGSQL_LB_SO=\"$(abs_top_builddir)/src/hooks/dhcp/pgsql_lb/.libs/libdhcp_pgsql_lb.so\"
-AM_CXXFLAGS = $(KEA_CXXFLAGS)
-
-if USE_STATIC_LINK
-AM_LDFLAGS = -static
-endif
-
-EXTRA_DIST =
-
-CLEANFILES = *.gcno *.gcda
-
-TESTS_ENVIRONMENT = \
-       $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
-
-if HAVE_GTEST
-
-TESTS = hook_load_unittests
-
-hook_load_unittests_SOURCES  =
-hook_load_unittests_SOURCES += load_unload_unittests.cc
-hook_load_unittests_SOURCES += run_unittests.cc
-hook_load_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
-hook_load_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-hook_load_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
-
-hook_load_unittests_LDADD  = $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-hook_load_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-hook_load_unittests_LDADD += $(LOG4CPLUS_LIBS)
-hook_load_unittests_LDADD += $(CRYPTO_LIBS)
-hook_load_unittests_LDADD += $(BOOST_LIBS)
-hook_load_unittests_LDADD += $(GTEST_LDADD)
-
-noinst_PROGRAMS = $(TESTS)
-
-endif
diff --git a/src/hooks/dhcp/pgsql_lb/libloadtests/load_unload_unittests.cc b/src/hooks/dhcp/pgsql_lb/libloadtests/load_unload_unittests.cc
deleted file mode 100644 (file)
index dc975d3..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (C) 2024 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/.
-
-/// @file This file contains tests which exercise the load and unload
-/// functions in the ddns tuning hook library. In order to test the load
-/// function, one must be able to pass it hook library parameters. The
-/// the only way to populate these parameters is by actually loading the
-/// library via HooksManager::loadLibraries().
-
-#include <config.h>
-
-#include <dhcpsrv/testutils/lib_load_test_fixture.h>
-#include <testutils/gtest_utils.h>
-
-#include <gtest/gtest.h>
-#include <errno.h>
-
-using namespace std;
-using namespace isc;
-using namespace isc::hooks;
-using namespace isc::data;
-using namespace isc::dhcp;
-using namespace isc::process;
-
-namespace {
-
-/// @brief Test fixture for testing loading and unloading the PgSQL lb library
-class PgSqlLbLibLoadTest : public isc::test::LibLoadTest {
-public:
-    /// @brief Constructor
-    PgSqlLbLibLoadTest() : LibLoadTest(LIBDHCP_PGSQL_LB_SO) {
-    }
-
-    /// @brief Destructor
-    virtual ~PgSqlLbLibLoadTest() {
-        unloadLibraries();
-    }
-};
-
-// Simple V4 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlLbLibLoadTest, validLoad4) {
-    validDaemonTest("kea-dhcp4");
-}
-
-// Simple V6 test that checks the library can be loaded and unloaded several times.
-TEST_F(PgSqlLbLibLoadTest, validLoad6) {
-    validDaemonTest("kea-dhcp6", AF_INET6);
-}
-
-// Simple test that checks the library cannot by loaded by invalid daemons.
-TEST_F(PgSqlLbLibLoadTest, invalidDaemonLoad) {
-    invalidDaemonTest("kea-ctrl-agent");
-    invalidDaemonTest("kea-dhcp-ddns");
-    invalidDaemonTest("bogus");
-}
-
-} // end of anonymous namespace
diff --git a/src/hooks/dhcp/pgsql_lb/libloadtests/run_unittests.cc b/src/hooks/dhcp/pgsql_lb/libloadtests/run_unittests.cc
deleted file mode 100644 (file)
index 755b9e4..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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/hooks/dhcp/pgsql_lb/pgsql_lb_callouts.cc b/src/hooks/dhcp/pgsql_lb/pgsql_lb_callouts.cc
deleted file mode 100644 (file)
index 85e507e..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (C) 2024 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/.
-
-// Functions accessed by the hooks framework use C linkage to avoid the name
-// mangling that accompanies use of the C++ compiler as well as to avoid
-// issues related to namespaces.
-
-#include <config.h>
-
-#include <asiolink/io_service_mgr.h>
-#include <dhcpsrv/cfgmgr.h>
-#include <hooks/hooks.h>
-#include <process/daemon.h>
-#include <pgsql_lb_log.h>
-#include <pgsql_lease_mgr.h>
-#include <dhcpsrv/lease_mgr_factory.h>
-
-#include <sstream>
-#include <string>
-
-using namespace isc::asiolink;
-using namespace isc::dhcp;
-using namespace isc::hooks;
-using namespace isc::log;
-using namespace isc::process;
-using namespace std;
-
-extern "C" {
-
-/// @brief This function is called when the library is loaded.
-///
-/// @param handle library handle
-/// @return 0 when initialization is successful, 1 otherwise
-
-int load(LibraryHandle& /* handle */) {
-    // Make the hook library not loadable by d2 or ca.
-    uint16_t family = CfgMgr::instance().getFamily();
-    const std::string& proc_name = Daemon::getProcName();
-    if (family == AF_INET) {
-        if (proc_name != "kea-dhcp4") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp4");
-        }
-    } else {
-        if (proc_name != "kea-dhcp6") {
-            isc_throw(isc::Unexpected, "Bad process name: " << proc_name
-                      << ", expected kea-dhcp6");
-        }
-    }
-
-    // Register PgSQL LB factories with Lease Managers
-    LeaseMgrFactory::registerFactory("postgresql",
-                                     PgSqlLeaseMgr::factory,
-                                     true,
-                                     PgSqlLeaseMgr::getDBVersion);
-
-    LOG_INFO(pgsql_lb_logger, PGSQL_LB_INIT_OK);
-    return (0);
-}
-
-/// @brief This function is called when the library is unloaded.
-///
-/// @return 0 if deregistration was successful, 1 otherwise
-int unload() {
-    // Unregister the factories and remove PgSQL backends
-    LeaseMgrFactory::deregisterFactory("postgresql", true);
-
-    LOG_INFO(pgsql_lb_logger, PGSQL_LB_DEINIT_OK);
-    return (0);
-}
-
-/// @brief This function is called to retrieve the multi-threading compatibility.
-///
-/// @note: the compatibility is based on the assumption this hook library
-/// is always called from the main thread.
-///
-/// @return 1 which means compatible with multi-threading.
-int multi_threading_compatible() {
-    return (1);
-}
-
-} // end extern "C"
diff --git a/src/hooks/dhcp/pgsql_lb/tests/.gitignore b/src/hooks/dhcp/pgsql_lb/tests/.gitignore
deleted file mode 100644 (file)
index 16bd905..0000000
+++ /dev/null
@@ -1 +0,0 @@
-pgsql_lb_unittests
diff --git a/src/hooks/dhcp/pgsql_lb/tests/Makefile.am b/src/hooks/dhcp/pgsql_lb/tests/Makefile.am
deleted file mode 100644 (file)
index 6153365..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-SUBDIRS = .
-
-AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
-AM_CPPFLAGS += -I$(top_builddir)/src/hooks/dhcp/pgsql_lb -I$(top_srcdir)/src/hooks/dhcp/pgsql_lb
-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 += pgsql_lb_unittests
-
-pgsql_lb_unittests_SOURCES  = run_unittests.cc
-pgsql_lb_unittests_SOURCES += pgsql_lease_mgr_unittest.cc
-pgsql_lb_unittests_SOURCES += pgsql_lease_extended_info_unittest.cc
-pgsql_lb_unittests_SOURCES += pgsql_bootp_unittest.cc
-
-pgsql_lb_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
-pgsql_lb_unittests_CPPFLAGS += $(PGSQL_CPPFLAGS)
-
-pgsql_lb_unittests_CXXFLAGS = $(AM_CXXFLAGS)
-
-pgsql_lb_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) $(GTEST_LDFLAGS)
-pgsql_lb_unittests_LDFLAGS += $(PGSQL_LIBS)
-
-pgsql_lb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/pgsql_lb/libpgsqllb.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/testutils/libdhcptest.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/testutils/libpgsqltest.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/pgsql/libkea-pgsql.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
-pgsql_lb_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
-pgsql_lb_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) $(BOOST_LIBS) $(GTEST_LDADD)
-endif
-
-noinst_PROGRAMS = $(TESTS)
-
diff --git a/src/hooks/dhcp/pgsql_lb/tests/run_unittests.cc b/src/hooks/dhcp/pgsql_lb/tests/run_unittests.cc
deleted file mode 100644 (file)
index 63b2d4a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (C) 2024 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 <gtest/gtest.h>
-
-#include <util/unittests/run_all.h>
-#include <log/logger_support.h>
-
-int
-main(int argc, char* argv[]) {
-    ::testing::InitGoogleTest(&argc, argv);
-    isc::log::initLogger();
-    return (isc::util::unittests::run_all());
-}
diff --git a/src/hooks/dhcp/pgsql_lb/version.cc b/src/hooks/dhcp/pgsql_lb/version.cc
deleted file mode 100644 (file)
index d64404b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (C) 2024 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 <hooks/hooks.h>
-
-extern "C" {
-
-/// @brief returns Kea hooks version.
-int version() {
-    return (KEA_HOOKS_VERSION);
-}
-
-}