Browse Source

[3358] Addressed review comments.

Added the constant D2ClientConfig::DFT_ALWAYS_INCLUDE_FQDN
Thomas Markwalder 11 years ago
parent
commit
250a2bb1b9

+ 1 - 0
src/lib/dhcpsrv/d2_client_cfg.cc

@@ -27,6 +27,7 @@ const char *D2ClientConfig::DFT_SERVER_IP = "127.0.0.1";
 const size_t D2ClientConfig::DFT_SERVER_PORT = 53001;
 const char *D2ClientConfig::DFT_NCR_PROTOCOL = "UDP";
 const char *D2ClientConfig::DFT_NCR_FORMAT = "JSON";
+const bool D2ClientConfig::DFT_ALWAYS_INCLUDE_FQDN = false;
 const bool D2ClientConfig::DFT_OVERRIDE_NO_UPDATE = false;
 const bool D2ClientConfig::DFT_OVERRIDE_CLIENT_UPDATE = false;
 const bool D2ClientConfig::DFT_REPLACE_CLIENT_NAME = false;

+ 1 - 0
src/lib/dhcpsrv/d2_client_cfg.h

@@ -64,6 +64,7 @@ public:
     static const size_t DFT_SERVER_PORT;
     static const char *DFT_NCR_PROTOCOL;
     static const char *DFT_NCR_FORMAT;
+    static const bool DFT_ALWAYS_INCLUDE_FQDN;
     static const bool DFT_OVERRIDE_NO_UPDATE;
     static const bool DFT_OVERRIDE_CLIENT_UPDATE;
     static const bool DFT_REPLACE_CLIENT_NAME;

+ 3 - 1
src/lib/dhcpsrv/dhcp_parsers.cc

@@ -1301,7 +1301,9 @@ D2ClientConfigParser::build(isc::data::ConstElementPtr client_config) {
                                                      DFT_QUALIFYING_SUFFIX);
 
     bool always_include_fqdn = boolean_values_->
-                               getOptionalParam("always-include-fqdn", false);
+                               getOptionalParam("always-include-fqdn",
+                                               D2ClientConfig::
+                                               DFT_ALWAYS_INCLUDE_FQDN);
 
     bool override_no_update = boolean_values_->
                               getOptionalParam("override-no-update",

+ 2 - 0
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc

@@ -853,6 +853,8 @@ TEST_F(ParseConfigTest, parserDefaultsD2Config) {
               d2_client_config->getNcrProtocol());
     EXPECT_EQ(dhcp_ddns::stringToNcrFormat(D2ClientConfig::DFT_NCR_FORMAT),
               d2_client_config->getNcrFormat());
+    EXPECT_EQ(D2ClientConfig::DFT_ALWAYS_INCLUDE_FQDN,
+              d2_client_config->getAlwaysIncludeFqdn());
     EXPECT_EQ(D2ClientConfig::DFT_OVERRIDE_NO_UPDATE,
               d2_client_config->getOverrideNoUpdate());
     EXPECT_EQ(D2ClientConfig::DFT_OVERRIDE_CLIENT_UPDATE,