}
}
-\"always-include-fqdn\" {
- switch(driver.ctx_) {
- case isc::dhcp::Parser4Context::DHCP_DDNS:
- return isc::dhcp::Dhcp4Parser::make_ALWAYS_INCLUDE_FQDN(driver.loc_);
- default:
- return isc::dhcp::Dhcp4Parser::make_STRING("always-include-fqdn", driver.loc_);
- }
-}
-
\"override-no-update\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP_DDNS:
MAX_QUEUE_SIZE "max-queue-size"
NCR_PROTOCOL "ncr-protocol"
NCR_FORMAT "ncr-format"
- ALWAYS_INCLUDE_FQDN "always-include-fqdn"
OVERRIDE_NO_UPDATE "override-no-update"
OVERRIDE_CLIENT_UPDATE "override-client-update"
REPLACE_CLIENT_NAME "replace-client-name"
| max_queue_size
| ncr_protocol
| ncr_format
- | always_include_fqdn
| override_no_update
| override_client_update
| replace_client_name
ctx.leave();
};
-always_include_fqdn: ALWAYS_INCLUDE_FQDN COLON BOOLEAN {
- ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
- ctx.stack_.back()->set("always-include-fqdn", b);
-};
-
override_no_update: OVERRIDE_NO_UPDATE COLON BOOLEAN {
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("override-no-update", b);
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
" \"server-port\" : 5301, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
-// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
" \"max-queue-size\" : " << max_queue_size << ", "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
" \"max-queue-size\" : 1024, "
" \"ncr-protocol\" : \"TCP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
" \"max-queue-size\" : 1024, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
" \"max-queue-size\" : 1024, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
}
}
-\"always-include-fqdn\" {
- switch(driver.ctx_) {
- case isc::dhcp::Parser6Context::DHCP_DDNS:
- return isc::dhcp::Dhcp6Parser::make_ALWAYS_INCLUDE_FQDN(driver.loc_);
- default:
- return isc::dhcp::Dhcp6Parser::make_STRING("always-include-fqdn", driver.loc_);
- }
-}
-
\"override-no-update\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP_DDNS:
MAX_QUEUE_SIZE "max-queue-size"
NCR_PROTOCOL "ncr-protocol"
NCR_FORMAT "ncr-format"
- ALWAYS_INCLUDE_FQDN "always-include-fqdn"
OVERRIDE_NO_UPDATE "override-no-update"
OVERRIDE_CLIENT_UPDATE "override-client-update"
REPLACE_CLIENT_NAME "replace-client-name"
| max_queue_size
| ncr_protocol
| ncr_format
- | always_include_fqdn
| override_no_update
| override_client_update
| replace_client_name
ctx.leave();
};
-always_include_fqdn: ALWAYS_INCLUDE_FQDN COLON BOOLEAN {
- ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
- ctx.stack_.back()->set("always-include-fqdn", b);
-};
-
override_no_update: OVERRIDE_NO_UPDATE COLON BOOLEAN {
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("override-no-update", b);
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
" \"server-port\" : 5301, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
-// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
" \"max-queue-size\" : " << max_queue_size << ", "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
const size_t D2ClientConfig::DFT_MAX_QUEUE_SIZE = 1024;
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 char* D2ClientConfig::DFT_REPLACE_CLIENT_NAME_MODE = "NEVER";
NameChangeProtocol& ncr_protocol,
const dhcp_ddns::
NameChangeFormat& ncr_format,
- const bool always_include_fqdn,
const bool override_no_update,
const bool override_client_update,
const ReplaceClientNameMode replace_client_name_mode,
max_queue_size_(max_queue_size),
ncr_protocol_(ncr_protocol),
ncr_format_(ncr_format),
- always_include_fqdn_(always_include_fqdn),
override_no_update_(override_no_update),
override_client_update_(override_client_update),
replace_client_name_mode_(replace_client_name_mode),
max_queue_size_(DFT_MAX_QUEUE_SIZE),
ncr_protocol_(dhcp_ddns::stringToNcrProtocol(DFT_NCR_PROTOCOL)),
ncr_format_(dhcp_ddns::stringToNcrFormat(DFT_NCR_FORMAT)),
- always_include_fqdn_(DFT_ALWAYS_INCLUDE_FQDN),
override_no_update_(DFT_OVERRIDE_NO_UPDATE),
override_client_update_(DFT_OVERRIDE_CLIENT_UPDATE),
replace_client_name_mode_(stringToReplaceClientNameMode(DFT_REPLACE_CLIENT_NAME_MODE)),
(max_queue_size_ == other.max_queue_size_) &&
(ncr_protocol_ == other.ncr_protocol_) &&
(ncr_format_ == other.ncr_format_) &&
- (always_include_fqdn_ == other.always_include_fqdn_) &&
(override_no_update_ == other.override_no_update_) &&
(override_client_update_ == other.override_client_update_) &&
(replace_client_name_mode_ == other.replace_client_name_mode_) &&
<< ", max-queue-size: " << max_queue_size_
<< ", ncr-protocol: " << ncrProtocolToString(ncr_protocol_)
<< ", ncr-format: " << ncrFormatToString(ncr_format_)
- << ", always-include-fqdn: " << (always_include_fqdn_ ?
- "yes" : "no")
<< ", override-no-update: " << (override_no_update_ ?
"yes" : "no")
<< ", override-client-update: " << (override_client_update_ ?
result->set("ncr-protocol", Element::create(dhcp_ddns::ncrProtocolToString(ncr_protocol_)));
// Set ncr-format
result->set("ncr-format", Element::create(dhcp_ddns::ncrFormatToString(ncr_format_)));
- // Set always-include-fqdn
- result->set("always-include-fqdn", Element::create(always_include_fqdn_));
// Set override-no-update
result->set("override-no-update", Element::create(override_no_update_));
// Set override-client-update
static const size_t DFT_MAX_QUEUE_SIZE;
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 char* DFT_REPLACE_CLIENT_NAME_MODE;
/// Currently only UDP is supported.
/// @param ncr_format Format of the kea-dhcp-ddns requests.
/// Currently only JSON format is supported.
- /// @param always_include_fqdn Enables always including the FQDN option in
- /// DHCP responses.
/// @param override_no_update Enables updates, even if clients request no
/// updates.
/// @param override_client_update Perform updates, even if client requested
const size_t max_queue_size,
const dhcp_ddns::NameChangeProtocol& ncr_protocol,
const dhcp_ddns::NameChangeFormat& ncr_format,
- const bool always_include_fqdn,
const bool override_no_update,
const bool override_client_update,
const ReplaceClientNameMode replace_client_name_mode,
return(ncr_format_);
}
- /// @brief Return whether or not FQDN is always included in DHCP responses.
- bool getAlwaysIncludeFqdn() const {
- return(always_include_fqdn_);
- }
-
/// @brief Return if updates are done even if clients request no updates.
bool getOverrideNoUpdate() const {
return(override_no_update_);
/// Currently only JSON format is supported.
dhcp_ddns::NameChangeFormat ncr_format_;
- /// @brief Should Kea always include the FQDN option in its response.
- bool always_include_fqdn_;
-
/// @brief Should Kea perform updates, even if client requested no updates.
/// Overrides the client request for no updates via the N flag.
bool override_no_update_;
dhcp_ddns::NameChangeFormat ncr_format =
getFormat(client_config, "ncr-format");
- bool always_include_fqdn =
- getBoolean(client_config, "always-include-fqdn");
-
bool override_no_update =
getBoolean(client_config, "override-no-update");
max_queue_size,
ncr_protocol,
ncr_format,
- always_include_fqdn,
override_no_update,
override_client_update,
replace_client_name_mode,
{ "max-queue-size", Element::integer, "1024" },
{ "ncr-protocol", Element::string, "UDP" },
{ "ncr-format", Element::string, "JSON" },
- { "always-include-fqdn", Element::boolean, "false" },
{ "override-no-update", Element::boolean, "false" },
{ "override-client-update", Element::boolean, "false" },
{ "replace-client-name", Element::string, "never" },
/// -# max-queue-size
/// -# ncr-protocol
/// -# ncr-format
- /// -# always-include-fqdn
/// -# override-no-update
/// -# override-client-update
/// -# replace-client-name
size_t max_queue_size = 2048;
dhcp_ddns::NameChangeProtocol ncr_protocol = dhcp_ddns::NCR_UDP;
dhcp_ddns::NameChangeFormat ncr_format = dhcp_ddns::FMT_JSON;
- bool always_include_fqdn = true;
bool override_no_update = true;
bool override_client_update = true;
D2ClientConfig::ReplaceClientNameMode replace_client_name_mode = D2ClientConfig::
max_queue_size,
ncr_protocol,
ncr_format,
- always_include_fqdn,
override_no_update,
override_client_update,
replace_client_name_mode,
EXPECT_EQ(d2_client_config->getMaxQueueSize(), max_queue_size);
EXPECT_EQ(d2_client_config->getNcrProtocol(), ncr_protocol);
EXPECT_EQ(d2_client_config->getNcrFormat(), ncr_format);
- EXPECT_EQ(d2_client_config->getAlwaysIncludeFqdn(), always_include_fqdn);
EXPECT_EQ(d2_client_config->getOverrideNoUpdate(), override_no_update);
EXPECT_EQ(d2_client_config->getOverrideClientUpdate(),
override_client_update);
"\"max-queue-size\": 2048,\n"
"\"ncr-protocol\": \"UDP\",\n"
"\"ncr-format\": \"JSON\",\n"
- "\"always-include-fqdn\": true,\n"
"\"override-no-update\": true,\n"
"\"override-client-update\": true,\n"
"\"replace-client-name\": \"when-present\",\n"
max_queue_size,
dhcp_ddns::NCR_TCP,
ncr_format,
- always_include_fqdn,
override_no_update,
override_client_update,
replace_client_name_mode,
EXPECT_FALSE(*ref_config == *test_config);
EXPECT_TRUE(*ref_config != *test_config);
- // Check a configuration that differs only by always_include_fqdn.
- ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
- ref_address, 477, ref_address, 478, 1024,
- dhcp_ddns::NCR_UDP, dhcp_ddns::FMT_JSON,
- false, true, true, D2ClientConfig::RCM_WHEN_PRESENT,
- "pre-fix", "suf-fix", "[^A-Z]", "*")));
- ASSERT_TRUE(test_config);
- EXPECT_FALSE(*ref_config == *test_config);
- EXPECT_TRUE(*ref_config != *test_config);
-
// Check a configuration that differs only by override_no_update.
ASSERT_NO_THROW(test_config.reset(new D2ClientConfig(true,
ref_address, 477, ref_address, 478, 1024,
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"when-present\", "
EXPECT_EQ(3432, d2_client_config->getServerPort());
EXPECT_EQ(dhcp_ddns::NCR_UDP, d2_client_config->getNcrProtocol());
EXPECT_EQ(dhcp_ddns::FMT_JSON, d2_client_config->getNcrFormat());
- EXPECT_TRUE(d2_client_config->getAlwaysIncludeFqdn());
EXPECT_TRUE(d2_client_config->getOverrideNoUpdate());
EXPECT_TRUE(d2_client_config->getOverrideClientUpdate());
EXPECT_EQ(D2ClientConfig::RCM_WHEN_PRESENT, d2_client_config->getReplaceClientNameMode());
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : false, "
" \"override-no-update\" : false, "
" \"override-client-update\" : false, "
" \"replace-client-name\" : \"never\", "
EXPECT_EQ(43567, d2_client_config->getServerPort());
EXPECT_EQ(dhcp_ddns::NCR_UDP, d2_client_config->getNcrProtocol());
EXPECT_EQ(dhcp_ddns::FMT_JSON, d2_client_config->getNcrFormat());
- EXPECT_FALSE(d2_client_config->getAlwaysIncludeFqdn());
EXPECT_FALSE(d2_client_config->getOverrideNoUpdate());
EXPECT_FALSE(d2_client_config->getOverrideClientUpdate());
EXPECT_EQ(D2ClientConfig::RCM_NEVER, d2_client_config->getReplaceClientNameMode());
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,
" \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"server-port\" : 53001, "
" \"ncr-protocol\" : \"Bogus\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"server-port\" : 53001, "
" \"ncr-protocol\" : \"TCP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"server-port\" : 53001, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"Bogus\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"server-port\" : \"bogus\", "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : true, "
" \"max-queue-size\" : 2048, "
" \"ncr-protocol\" : \"UDP\", "
" \"ncr-format\" : \"JSON\", "
- " \"always-include-fqdn\" : true, "
" \"override-no-update\" : true, "
" \"override-client-update\" : true, "
" \"replace-client-name\" : \"BOGUS\", "