]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#93,!56] Addressed review comments.
authorMarcin Siodelski <marcin@isc.org>
Sun, 7 Oct 2018 17:52:30 +0000 (19:52 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 8 Oct 2018 20:03:17 +0000 (22:03 +0200)
src/hooks/dhcp/mysql_cb/mysql_cb_dhcp4.cc
src/lib/cc/stamped_element.h
src/lib/config_backend/constants.h

index 0ae0ee0cd6deff0caa368a917d5f5eea9fc2e1b0..5f79f9ada868a68293cddc531bee8653c1a7a2f1 100644 (file)
@@ -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<uint64_t>(),
-            MySqlBinding::createString(128),
-            MySqlBinding::createString(65536),
-            MySqlBinding::createTimestamp()
+            MySqlBinding::createInteger<uint64_t>(), // 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,"
index 9d15bb952c8ed62adb2f2bb497938f80f0973e9c..b6a59e913cc43564b845c1e9b22705f0b0d50dd8 100644 (file)
@@ -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:
 
index 65d924985653b15677fc8cba3065f30836d123be..95550b29eea08dfe34934fe7b024f256b4e5a7a1 100644 (file)
@@ -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;
 
 //*}