|
@@ -30,6 +30,7 @@
|
|
#include <config/command_mgr.h>
|
|
#include <config/command_mgr.h>
|
|
#include <util/encode/hex.h>
|
|
#include <util/encode/hex.h>
|
|
#include <util/strutil.h>
|
|
#include <util/strutil.h>
|
|
|
|
+#include <defaults.h>
|
|
|
|
|
|
#include <boost/foreach.hpp>
|
|
#include <boost/foreach.hpp>
|
|
#include <boost/lexical_cast.hpp>
|
|
#include <boost/lexical_cast.hpp>
|
|
@@ -375,7 +376,8 @@ namespace dhcp {
|
|
DhcpConfigParser* parser = NULL;
|
|
DhcpConfigParser* parser = NULL;
|
|
if ((config_id.compare("valid-lifetime") == 0) ||
|
|
if ((config_id.compare("valid-lifetime") == 0) ||
|
|
(config_id.compare("renew-timer") == 0) ||
|
|
(config_id.compare("renew-timer") == 0) ||
|
|
- (config_id.compare("rebind-timer") == 0)) {
|
|
+ (config_id.compare("rebind-timer") == 0) ||
|
|
|
|
+ (config_id.compare("decline-probation-period") == 0) ) {
|
|
parser = new Uint32Parser(config_id,
|
|
parser = new Uint32Parser(config_id,
|
|
globalContext()->uint32_values_);
|
|
globalContext()->uint32_values_);
|
|
} else if (config_id.compare("interfaces-config") == 0) {
|
|
} else if (config_id.compare("interfaces-config") == 0) {
|
|
@@ -411,7 +413,13 @@ namespace dhcp {
|
|
return (parser);
|
|
return (parser);
|
|
}
|
|
}
|
|
|
|
|
|
-void commitGlobalOptions() {
|
|
+/// @brief Sets global parameters in staging configuration
|
|
|
|
+///
|
|
|
|
+/// Currently this method sets the following global parameters:
|
|
|
|
+///
|
|
|
|
+/// - echo-client-id
|
|
|
|
+/// - decline-probation-period
|
|
|
|
+void setGlobalParameters4() {
|
|
// Although the function is modest for now, it is certain that the number
|
|
// Although the function is modest for now, it is certain that the number
|
|
// of global switches will increase over time, hence the name.
|
|
// of global switches will increase over time, hence the name.
|
|
|
|
|
|
@@ -423,6 +431,16 @@ void commitGlobalOptions() {
|
|
} catch (...) {
|
|
} catch (...) {
|
|
// Ignore errors. This flag is optional
|
|
// Ignore errors. This flag is optional
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // Set the probation period for decline handling.
|
|
|
|
+ try {
|
|
|
|
+ uint32_t probation_period = globalContext()->uint32_values_
|
|
|
|
+ ->getOptionalParam("decline-probation-period",
|
|
|
|
+ DEFAULT_DECLINE_PROBATION_PERIOD);
|
|
|
|
+ CfgMgr::instance().getStagingCfg()->setDeclinePeriod(probation_period);
|
|
|
|
+ } catch (...) {
|
|
|
|
+ // That's not really needed.
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
isc::data::ConstElementPtr
|
|
isc::data::ConstElementPtr
|
|
@@ -591,8 +609,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
|
|
// No need to commit interface names as this is handled by the
|
|
// No need to commit interface names as this is handled by the
|
|
// CfgMgr::commit() function.
|
|
// CfgMgr::commit() function.
|
|
|
|
|
|
- // Apply global options
|
|
+ // Apply global options in the staging config.
|
|
- commitGlobalOptions();
|
|
+ setGlobalParameters4();
|
|
|
|
|
|
// This occurs last as if it succeeds, there is no easy way
|
|
// This occurs last as if it succeeds, there is no easy way
|
|
// revert it. As a result, the failure to commit a subsequent
|
|
// revert it. As a result, the failure to commit a subsequent
|