From: Marcin Siodelski Date: Sun, 7 Oct 2018 17:52:30 +0000 (+0200) Subject: [#93,!56] Addressed review comments. X-Git-Tag: 5-netconf-extend-syntax_base~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64cb34ec34ccc413b83d5fece5b0e90e50ae270a;p=thirdparty%2Fkea.git [#93,!56] Addressed review comments. --- diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc index 0ae0ee0cd6..5f79f9ada8 100644 --- a/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc +++ b/src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc @@ -121,11 +121,17 @@ public: void getGlobalParameters4(const StatementIndex& index, const MySqlBindingCollection& in_bindings, StampedValueCollection& parameters) { + // The following parameters from the dhcp4_global_parameter table are + // returned: + // - id + // - name - parameter name + // - value - parameter value + // - modification_ts - modification timestamp. MySqlBindingCollection out_bindings = { - MySqlBinding::createInteger(), - MySqlBinding::createString(128), - MySqlBinding::createString(65536), - MySqlBinding::createTimestamp() + MySqlBinding::createInteger(), // id + MySqlBinding::createString(GLOBAL_PARAMETER_NAME_BUF_LENGTH), // name + MySqlBinding::createString(GLOBAL_PARAMETER_VALUE_BUF_LENGTH), // value + MySqlBinding::createTimestamp() // modification_ts }; conn_.selectQuery(index, in_bindings, out_bindings, @@ -1974,7 +1980,7 @@ TaggedStatementArray tagged_statements = { { }, // Retrieves all global options. - { MySqlConfigBackendDHCPv4Impl::GET_ALL_OPTIONS4, + { MySqlConfigBackendDHCPv4Impl::GET_ALL_OPTIONS4, "SELECT" " option_id," " code," diff --git a/src/lib/cc/stamped_element.h b/src/lib/cc/stamped_element.h index 9d15bb952c..b6a59e913c 100644 --- a/src/lib/cc/stamped_element.h +++ b/src/lib/cc/stamped_element.h @@ -21,6 +21,13 @@ namespace data { /// which stores configuration in the database and must be able /// to recognize recently modified objects to fetch incremental /// changes. +/// +/// @note This class is not derived from @c Element and should not +/// be confused with the classes being derived from @c Element class. +/// Those classes are used to represent JSON structures, whereas this +/// class represents data fetched from the database. +/// +/// @todo Find a better name for @c StamepedElement. class StampedElement { public: diff --git a/src/lib/config_backend/constants.h b/src/lib/config_backend/constants.h index 65d9249856..95550b29ee 100644 --- a/src/lib/config_backend/constants.h +++ b/src/lib/config_backend/constants.h @@ -52,6 +52,9 @@ constexpr unsigned long OPTION_ENCAPSULATE_BUF_LENGTH = 128; constexpr unsigned long OPTION_RECORD_TYPES_BUF_LENGTH = 512; +constexpr unsigned long GLOBAL_PARAMETER_NAME_BUF_LENGTH = 128; + +constexpr unsigned long GLOBAL_PARAMETER_VALUE_BUF_LENGTH = 65536; //*}