Commit 29d0f7c2 authored by Francis Dupont's avatar Francis Dupont
Browse files

[295-min-max-lease-time-configuration-options] Extend syntax

parent f27a1dee
......@@ -592,6 +592,39 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"default-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
case isc::dhcp::Parser4Context::SUBNET4:
case isc::dhcp::Parser4Context::SHARED_NETWORK:
return isc::dhcp::Dhcp4Parser::make_DEFAULT_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("default-valid-lifetime", driver.loc_);
}
}
\"min-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
case isc::dhcp::Parser4Context::SUBNET4:
case isc::dhcp::Parser4Context::SHARED_NETWORK:
return isc::dhcp::Dhcp4Parser::make_MIN_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("min-valid-lifetime", driver.loc_);
}
}
\"max-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
case isc::dhcp::Parser4Context::SUBNET4:
case isc::dhcp::Parser4Context::SHARED_NETWORK:
return isc::dhcp::Dhcp4Parser::make_MAX_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp4Parser::make_STRING("max-valid-lifetime", driver.loc_);
}
}
\"renew-timer\" {
switch(driver.ctx_) {
case isc::dhcp::Parser4Context::DHCP4:
......
......@@ -102,6 +102,9 @@ using namespace std;
TCP_NODELAY "tcp-nodelay"
VALID_LIFETIME "valid-lifetime"
DEFAULT_VALID_LIFETIME "default-valid-lifetime"
MIN_VALID_LIFETIME "min-valid-lifetime"
MAX_VALID_LIFETIME "max-valid-lifetime"
RENEW_TIMER "renew-timer"
REBIND_TIMER "rebind-timer"
CALCULATE_TEE_TIMES "calculate-tee-times"
......@@ -441,6 +444,9 @@ global_params: global_param
// These are the parameters that are allowed in the top-level for
// Dhcp4.
global_param: valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| renew_timer
| rebind_timer
| decline_probation_period
......@@ -487,6 +493,21 @@ valid_lifetime: VALID_LIFETIME COLON INTEGER {
ctx.stack_.back()->set("valid-lifetime", prf);
};
default_valid_lifetime: DEFAULT_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("valid-lifetime", prf);
};
min_valid_lifetime: MIN_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("min-valid-lifetime", prf);
};
max_valid_lifetime: MAX_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("max-valid-lifetime", prf);
};
renew_timer: RENEW_TIMER COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("renew-timer", prf);
......@@ -1085,6 +1106,9 @@ subnet4_params: subnet4_param
// This defines a list of allowed parameters for each subnet.
subnet4_param: valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| renew_timer
| rebind_timer
| option_data_list
......@@ -1239,6 +1263,9 @@ shared_network_param: name
| client_class
| require_client_classes
| valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| user_context
| comment
| calculate_tee_times
......
......@@ -788,6 +788,39 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"default-preferred-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_DEFAULT_PREFERRED_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("default-preferred-lifetime", driver.loc_);
}
}
\"min-preferred-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_MIN_PREFERRED_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("min-preferred-lifetime", driver.loc_);
}
}
\"max-preferred-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_MAX_PREFERRED_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("max-preferred-lifetime", driver.loc_);
}
}
\"valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
......@@ -799,6 +832,39 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence}
}
}
\"default-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_DEFAULT_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("default-valid-lifetime", driver.loc_);
}
}
\"min-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_MIN_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("min-valid-lifetime", driver.loc_);
}
}
\"max-valid-lifetime\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
case isc::dhcp::Parser6Context::SUBNET6:
case isc::dhcp::Parser6Context::SHARED_NETWORK:
return isc::dhcp::Dhcp6Parser::make_MAX_VALID_LIFETIME(driver.loc_);
default:
return isc::dhcp::Dhcp6Parser::make_STRING("max-valid-lifetime", driver.loc_);
}
}
\"renew-timer\" {
switch(driver.ctx_) {
case isc::dhcp::Parser6Context::DHCP6:
......
......@@ -86,7 +86,13 @@ using namespace std;
TCP_NODELAY "tcp-nodelay"
PREFERRED_LIFETIME "preferred-lifetime"
DEFAULT_PREFERRED_LIFETIME "default-preferred-lifetime"
MIN_PREFERRED_LIFETIME "min-preferred-lifetime"
MAX_PREFERRED_LIFETIME "max-preferred-lifetime"
VALID_LIFETIME "valid-lifetime"
DEFAULT_VALID_LIFETIME "default-valid-lifetime"
MIN_VALID_LIFETIME "min-valid-lifetime"
MAX_VALID_LIFETIME "max-valid-lifetime"
RENEW_TIMER "renew-timer"
REBIND_TIMER "rebind-timer"
CALCULATE_TEE_TIMES "calculate-tee-times"
......@@ -445,7 +451,13 @@ global_params: global_param
// Dhcp6.
global_param: data_directory
| preferred_lifetime
| default_preferred_lifetime
| min_preferred_lifetime
| max_preferred_lifetime
| valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| renew_timer
| rebind_timer
| decline_probation_period
......@@ -497,11 +509,41 @@ preferred_lifetime: PREFERRED_LIFETIME COLON INTEGER {
ctx.stack_.back()->set("preferred-lifetime", prf);
};
default_preferred_lifetime: DEFAULT_PREFERRED_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("preferred-lifetime", prf);
};
min_preferred_lifetime: MIN_PREFERRED_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("min-preferred-lifetime", prf);
};
max_preferred_lifetime: MAX_PREFERRED_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("max-preferred-lifetime", prf);
};
valid_lifetime: VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("valid-lifetime", prf);
};
default_valid_lifetime: DEFAULT_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("valid-lifetime", prf);
};
min_valid_lifetime: MIN_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("min-valid-lifetime", prf);
};
max_valid_lifetime: MAX_VALID_LIFETIME COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("max-valid-lifetime", prf);
};
renew_timer: RENEW_TIMER COLON INTEGER {
ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("renew-timer", prf);
......@@ -1081,7 +1123,13 @@ subnet6_params: subnet6_param
// This defines a list of allowed parameters for each subnet.
subnet6_param: preferred_lifetime
| default_preferred_lifetime
| min_preferred_lifetime
| max_preferred_lifetime
| valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| renew_timer
| rebind_timer
| option_data_list
......@@ -1217,8 +1265,14 @@ shared_network_param: name
| client_class
| require_client_classes
| preferred_lifetime
| default_preferred_lifetime
| min_preferred_lifetime
| max_preferred_lifetime
| rapid_commit
| valid_lifetime
| default_valid_lifetime
| min_valid_lifetime
| max_valid_lifetime
| user_context
| comment
| calculate_tee_times
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment