]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2356] enable pgsql cb for v6
authorRazvan Becheriu <razvan@isc.org>
Tue, 15 Mar 2022 09:43:20 +0000 (11:43 +0200)
committerRazvan Becheriu <razvan@isc.org>
Tue, 15 Mar 2022 11:18:13 +0000 (13:18 +0200)
12 files changed:
src/hooks/dhcp/mysql_cb/mysql_cb_callouts.cc
src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
src/hooks/dhcp/mysql_cb/mysql_cb_log.cc
src/hooks/dhcp/mysql_cb/mysql_cb_log.h
src/hooks/dhcp/mysql_cb/tests/mysql_cb_impl_unittest.cc
src/hooks/dhcp/mysql_cb/tests/run_unittests.cc
src/hooks/dhcp/mysql_cb/version.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_callouts.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.cc
src/hooks/dhcp/pgsql_cb/pgsql_cb_impl.h
src/hooks/dhcp/pgsql_cb/pgsql_cb_log.h
src/hooks/dhcp/pgsql_cb/version.cc

index e2840832e417ec388eebb29951f07e3dd54fda75..ddd4f3cfb5f1694c08e9f584995879a726663e97 100644 (file)
@@ -9,9 +9,13 @@
 // issues related to namespaces.
 
 #include <config.h>
+
 #include <hooks/hooks.h>
+#include <mysql_cb_impl.h>
+
 #include <mysql_cb_dhcp4.h>
 #include <mysql_cb_dhcp6.h>
+#include <mysql_cb_log.h>
 
 using namespace isc::cb;
 using namespace isc::dhcp;
index 85f7adc8440ba25db8d48604b12d0b425fabcf72..3894ced649e5da4c35ffecf00b5017dc585fdbe7 100644 (file)
@@ -596,8 +596,7 @@ public:
     /// @param first_binding Iterator of the output binding containing
     /// option definition id.
     /// @return Pointer to the option definition.
-    OptionDefinitionPtr
-    processOptionDefRow(db::MySqlBindingCollection::iterator first_binding);
+    OptionDefinitionPtr processOptionDefRow(db::MySqlBindingCollection::iterator first_binding);
 
     /// @brief Associates a configuration element with multiple servers.
     ///
index 3c173425efcb001372a182167904618bd2252632..3ee1a179aeb2c449bd252d1b29776c90a93ad9a7 100644 (file)
@@ -15,4 +15,3 @@ isc::log::Logger mysql_cb_logger("mysql-cb-hooks");
 
 }  // namespace dhcp
 }  // namespace isc
-
index 7f568aec49b370dcac0b3ff99bd008ee850ca1c0..05cad615b28d94d2a401f003dc313a07b1251858 100644 (file)
@@ -19,5 +19,4 @@ extern isc::log::Logger mysql_cb_logger;
 }  // namespace dhcp
 }  // namespace isc
 
-
 #endif
index f79f4b59fb0df90699071524ffdacb5693a502c2..b25f04793a746cc80bc6ded1494277f6a9ed8d40 100644 (file)
@@ -9,8 +9,8 @@
 #include <gtest/gtest.h>
 
 using namespace isc::db;
-using namespace isc::util;
 using namespace isc::dhcp;
+using namespace isc::util;
 
 namespace {
 
@@ -57,4 +57,4 @@ TEST(MySqlConfigBackendImplTest, createTripletFromBinding) {
                  isc::Unexpected);
 }
 
-}
+}  // namespace
index 3b1baf9e98c4186368149cd9414c6a0a566c290a..c1f3bc8598c5ff53a6a1fda536f0fde3614e2520 100644 (file)
@@ -7,6 +7,7 @@
 #include <config.h>
 
 #include <log/logger_support.h>
+
 #include <gtest/gtest.h>
 
 int
index 32834cec8beef222095344e1cecda0a6d653a437..846f1673e8db16ba3ff5ad47c5e1fe0fcbdec15c 100644 (file)
@@ -5,6 +5,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 #include <config.h>
+
 #include <hooks/hooks.h>
 
 extern "C" {
index b77a3e5297c92964b401d96b38a5ba62da29b144..2358f1779916b64ad6713b04d238ea1a3deee99b 100644 (file)
@@ -14,9 +14,7 @@
 #include <pgsql_cb_impl.h>
 
 #include <pgsql_cb_dhcp4.h>
-
-/// @todo disabled for now, to be added in #96
-/// #include <pgsql_cb_dhcp6.h>
+#include <pgsql_cb_dhcp6.h>
 #include <pgsql_cb_log.h>
 
 using namespace isc::cb;
@@ -31,15 +29,11 @@ extern "C" {
 /// @param handle library handle
 /// @return 0 when initialization is successful, 1 otherwise
 
-int
-load(LibraryHandle& /* handle */) {
+int load(LibraryHandle& /* handle */) {
     LOG_INFO(pgsql_cb_logger, PGSQL_CB_INIT_OK);
-
-    // Register Postgres CB factories with CB Managers
+    // Register PostgreSQL CB factories with CB Managers
     isc::dhcp::PgSqlConfigBackendDHCPv4::registerBackendType();
-
-    /// @todo disabled for now, to be added in #96
-    ///isc::dhcp::PgSqlConfigBackendDHCPv6::registerBackendType();
+    isc::dhcp::PgSqlConfigBackendDHCPv6::registerBackendType();
 
     return (0);
 }
@@ -50,8 +44,7 @@ load(LibraryHandle& /* handle */) {
 ///
 /// @param handle callout handle passed to the callout.
 /// @return 0 on success, 1 otherwise.
-int
-dhcp4_srv_configured(CalloutHandle& handle) {
+int dhcp4_srv_configured(CalloutHandle& handle) {
     isc::asiolink::IOServicePtr io_service;
     handle.getArgument("io_context", io_service);
     isc::dhcp::PgSqlConfigBackendImpl::setIOService(io_service);
@@ -64,8 +57,7 @@ dhcp4_srv_configured(CalloutHandle& handle) {
 ///
 /// @param handle callout handle passed to the callout.
 /// @return 0 on success, 1 otherwise.
-int
-dhcp6_srv_configured(CalloutHandle& handle) {
+int dhcp6_srv_configured(CalloutHandle& handle) {
     isc::asiolink::IOServicePtr io_service;
     handle.getArgument("io_context", io_service);
     isc::dhcp::PgSqlConfigBackendImpl::setIOService(io_service);
@@ -75,13 +67,11 @@ dhcp6_srv_configured(CalloutHandle& handle) {
 /// @brief This function is called when the library is unloaded.
 ///
 /// @return 0 if deregistration was successful, 1 otherwise
-int
-unload() {
+int unload() {
     LOG_INFO(pgsql_cb_logger, PGSQL_CB_DEINIT_OK);
-    // Unregister the factories and remove Postgres backends
+    // Unregister the factories and remove PostgreSQL backends
     isc::dhcp::PgSqlConfigBackendDHCPv4::unregisterBackendType();
-    ///  @todo disabled for now, to be added in #96
-    ///isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType();
+    isc::dhcp::PgSqlConfigBackendDHCPv6::unregisterBackendType();
     return (0);
 }
 
@@ -91,9 +81,8 @@ unload() {
 /// is always called from the main thread.
 ///
 /// @return 1 which means compatible with multi-threading.
-int
-multi_threading_compatible() {
+int multi_threading_compatible() {
     return (1);
 }
 
-}  // end extern "C"
+} // end extern "C"
index 06947fd781c3661544d31ff20c758bdebd1853d8..4399cb08a2ec0703736967acfcee1a747df02315 100644 (file)
@@ -1134,5 +1134,5 @@ PgSqlConfigBackendImpl::addOptionValueBinding(PsqlBindArray& bindings,
     }
 }
 
-}  // namespace dhcp
-}  // end of namespace isc
+} // end of namespace isc::dhcp
+} // end of namespace isc
index 1d9c5a74d18f8f375ce9468626e3c3b1519e6345..03cdd3876284a41ed2584bdc795a76e09db65cd9 100644 (file)
@@ -118,8 +118,6 @@ public:
     /// @brief Destructor.
     virtual ~PgSqlConfigBackendImpl();
 
-    /// @todo: implement condCreateInteger(const util::Optional<T>& value)
-
     /// @brief Returns server tag associated with the particular selector.
     ///
     /// This method expects that there is exactly one server tag associated with
@@ -205,8 +203,6 @@ public:
                                const uint64_t& modification_id,
                                db::AuditEntryCollection& audit_entries);
 
-    /// @todo: implement uint64_t deleteFromTable(const int index, ...)
-
     /// @brief Sends query to delete rows from a table.
     ///
     /// @param index Index of the statement to be executed.
@@ -648,7 +644,6 @@ public:
     /// will be inserted.
     void getAllServers(const int index, db::ServerCollection& servers);
 
-    /// @todo implement
     /// @brief Sends query to retrieve servers.
     ///
     /// @param index Index of the query to be used.
@@ -900,7 +895,7 @@ private:
     size_t last_insert_id_index_;
 };
 
-}  // namespace dhcp
-}  // end of namespace isc
+} // end of namespace isc::dhcp
+} // end of namespace isc
 
 #endif
index 8bb6dc5687896ebea96109dcdc2094dbe3eb8ee9..e4b0548598618881875a1e11685db45648bd75d8 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <log/logger_support.h>
 #include <log/macros.h>
-
 #include <pgsql_cb_messages.h>
 
 namespace isc {
index 23cfd35cc568ce761f30d0576e64ecb5eb5bd933..8c2b2ddc97195565a192a22558760621bc246065 100644 (file)
@@ -11,8 +11,8 @@
 extern "C" {
 
 /// @brief returns Kea hooks version.
-int
-version() {
+int version() {
     return (KEA_HOOKS_VERSION);
 }
+
 }