]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3477] Addressed review comments.
authorMarcin Siodelski <marcin@isc.org>
Thu, 21 Aug 2014 05:59:52 +0000 (07:59 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 21 Aug 2014 05:59:52 +0000 (07:59 +0200)
src/bin/d2/d2_cfg_mgr.cc
src/bin/d2/d2_cfg_mgr.h
src/bin/d2/d2_config.cc
src/bin/d2/d_cfg_mgr.h
src/bin/d2/tests/d_cfg_mgr_unittests.cc
src/bin/d2/tests/d_test_stubs.h
src/lib/dhcpsrv/configuration.h
src/lib/dhcpsrv/tests/configuration_unittest.cc

index 4e1d8978df4ab3379c8c9b17ec6cc4185cceee4a..05a7c4b124415ea26cfae377859f96c71fca6ba5 100644 (file)
@@ -197,7 +197,7 @@ D2CfgMgr::getD2Params() {
 }
 
 std::string
-D2CfgMgr::getConfigSummary(const uint16_t) {
+D2CfgMgr::getConfigSummary(const uint32_t) {
     return (getD2Params()->getConfigSummary());
 }
 
index 6208677d8c9ba3824fa65e814f1ec0e1d4eff097..e1afa6778e1d5b21198dc7df3882a5409275d61a 100644 (file)
@@ -244,7 +244,7 @@ public:
     /// to be returned. This parameter is ignored for the D2.
     ///
     /// @return Summary of the configuration in the textual format.
-    virtual std::string getConfigSummary(const uint16_t selection);
+    virtual std::string getConfigSummary(const uint32_t selection);
 
 protected:
     /// @brief Performs the parsing of the given "params" element.
index 4eba5d331d574fdc1af0150d2563c30454fcec3a..6b1ae252ab0a16fd174b280283c49754d91e0083 100644 (file)
@@ -92,7 +92,8 @@ D2Params::validateContents() {
 std::string
 D2Params::getConfigSummary() const {
     std::ostringstream s;
-    s << "listening on " << getIpAddress() << ", port " << getPort();
+    s << "listening on " << getIpAddress() << ", port " << getPort()
+      << ", using " << ncrProtocolToString(ncr_protocol_);
     return (s.str());
 }
 
index b9d58dc29125bc243a6a2b1db8cbe5095c663c19..2317519f65609aad4c2242e7080c854682de66c5 100644 (file)
@@ -318,7 +318,7 @@ public:
     /// to be returned.
     ///
     /// @return Summary of the configuration in the textual format.
-    virtual std::string getConfigSummary(const uint16_t selection) = 0;
+    virtual std::string getConfigSummary(const uint32_t selection) = 0;
 
 protected:
     /// @brief Parses a set of scalar configuration elements into global
index 735bff8a50b38276ad11d836c2e422214ee7ba04..ba2ccf906c40afb13760451403a18be5ecc920cb 100644 (file)
@@ -59,7 +59,7 @@ public:
     }
 
     /// @brief Returns summary of configuration in the textual format.
-    virtual std::string getConfigSummary(const uint16_t) {
+    virtual std::string getConfigSummary(const uint32_t) {
         return ("");
     }
 };
index d836d34aaabc589c866f28f43339c7118a456617..5e658ed274f701fb7623f9322faa32cdca489c29 100644 (file)
@@ -183,7 +183,7 @@ public:
     /// @brief Returns configuration summary in the textual format.
     ///
     /// @return Always an empty string.
-    virtual std::string getConfigSummary(const uint16_t) {
+    virtual std::string getConfigSummary(const uint32_t) {
         return ("");
     }
 
@@ -711,7 +711,7 @@ public:
     /// @brief Returns a summary of the configuration in the textual format.
     ///
     /// @return Always an empty string.
-    virtual std::string getConfigSummary(const uint16_t) {
+    virtual std::string getConfigSummary(const uint32_t) {
         return ("");
     }
 
index 16bb1dda821c5ad1bc9dc209f55789699337360b..39af734be92776511236b42b7566b9606cf75100 100644 (file)
@@ -87,17 +87,26 @@ struct Configuration {
     /// @name Constants for selection of parameters returned by @c getConfigSummary
     ///
     //@{
-    static const uint16_t CFGSEL_NONE    = 0x0000; ///< Nothing selected
-    static const uint16_t CFGSEL_SUBNET4 = 0x0001; ///< Number of IPv4 subnets
-    static const uint16_t CFGSEL_SUBNET6 = 0x0002; ///< Number of IPv6 subnets
-    static const uint16_t CFGSEL_IFACE4  = 0x0004; ///< Number of enabled ifaces
-    static const uint16_t CFGSEL_IFACE6  = 0x0008; ///< Number of v6 ifaces
-    static const uint16_t CFGSEL_DDNS    = 0x0010; ///< DDNS enabled/disabled
-
-    static const uint16_t CFGSEL_SUBNET  = 0x0003; ///< Number of all subnets
-    static const uint16_t CFGSEL_ALL4    = 0x0015; ///< IPv4 related config
-    static const uint16_t CFGSEL_ALL6    = 0x001A; ///< IPv6 related config
-    static const uint16_t CFGSEL_ALL     = 0xFFFF; ///< Whole config
+    /// Nothing selected
+    static const uint32_t CFGSEL_NONE    = 0x00000000;
+    /// Number of IPv4 subnets
+    static const uint32_t CFGSEL_SUBNET4 = 0x00000001;
+    /// Number of IPv6 subnets
+    static const uint32_t CFGSEL_SUBNET6 = 0x00000002;
+    /// Number of enabled ifaces
+    static const uint32_t CFGSEL_IFACE4  = 0x00000004;
+    /// Number of v6 ifaces
+    static const uint32_t CFGSEL_IFACE6  = 0x00000008;
+    /// DDNS enabled/disabled
+    static const uint32_t CFGSEL_DDNS    = 0x00000010;
+    /// Number of all subnets
+    static const uint32_t CFGSEL_SUBNET  = 0x00000003;
+    /// IPv4 related config
+    static const uint32_t CFGSEL_ALL4    = 0x00000015;
+    /// IPv6 related config
+    static const uint32_t CFGSEL_ALL6    = 0x0000001A;
+    /// Whole config
+    static const uint32_t CFGSEL_ALL     = 0xFFFFFFFF;
     //@}
 
     /// @brief logging specific information
index a917bb8d8d3a5b093f157bf21417190c89d7d384..94692af05ff785d859891e5a29fc229091dac41c 100644 (file)
@@ -149,6 +149,7 @@ ConfigurationTest::clearSubnets() {
 
 void
 ConfigurationTest::enableDDNS(const bool enable) {
+    // D2 configuration should always be non-NULL.
     CfgMgr::instance().getD2ClientConfig()->enableUpdates(enable);
 }