From: Francis Dupont Date: Mon, 9 Sep 2019 13:11:53 +0000 (+0200) Subject: [897-add-infinite-valid-lifetime] Added allow-static-leases to flex/bison X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29bee88b12b2216e9c5103a00666e51d9556be6f;p=thirdparty%2Fkea.git [897-add-infinite-valid-lifetime] Added allow-static-leases to flex/bison --- diff --git a/src/bin/dhcp4/dhcp4_lexer.ll b/src/bin/dhcp4/dhcp4_lexer.ll index 106d6c52c7..5f3ed84579 100644 --- a/src/bin/dhcp4/dhcp4_lexer.ll +++ b/src/bin/dhcp4/dhcp4_lexer.ll @@ -645,6 +645,17 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"allow-static-leases\" { + switch(driver.ctx_) { + case isc::dhcp::Parser4Context::DHCP4: + case isc::dhcp::Parser4Context::SUBNET4: + case isc::dhcp::Parser4Context::SHARED_NETWORK: + return isc::dhcp::Dhcp4Parser::make_ALLOW_STATIC_LEASES(driver.loc_); + default: + return isc::dhcp::Dhcp4Parser::make_STRING("allow-static-leases", driver.loc_); + } +} + \"decline-probation-period\" { switch(driver.ctx_) { case isc::dhcp::Parser4Context::DHCP4: diff --git a/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy index fd400433be..4c97e065b7 100644 --- a/src/bin/dhcp4/dhcp4_parser.yy +++ b/src/bin/dhcp4/dhcp4_parser.yy @@ -107,6 +107,7 @@ using namespace std; MAX_VALID_LIFETIME "max-valid-lifetime" RENEW_TIMER "renew-timer" REBIND_TIMER "rebind-timer" + ALLOW_STATIC_LEASES "allow-static-leases" CALCULATE_TEE_TIMES "calculate-tee-times" T1_PERCENT "t1-percent" T2_PERCENT "t2-percent" @@ -485,6 +486,7 @@ global_param: valid_lifetime | loggers | hostname_char_set | hostname_char_replacement + | allow_static_leases | unknown_map_entry ; @@ -513,6 +515,11 @@ rebind_timer: REBIND_TIMER COLON INTEGER { ctx.stack_.back()->set("rebind-timer", prf); }; +allow_static_leases: ALLOW_STATIC_LEASES COLON BOOLEAN { + ElementPtr asl(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("allow-static-leases", asl); +}; + calculate_tee_times: CALCULATE_TEE_TIMES COLON BOOLEAN { ElementPtr ctt(new BoolElement($3, ctx.loc2pos(@3))); ctx.stack_.back()->set("calculate-tee-times", ctt); @@ -1135,6 +1142,7 @@ subnet4_param: valid_lifetime | calculate_tee_times | t1_percent | t2_percent + | allow_static_leases | unknown_map_entry ; @@ -1271,6 +1279,7 @@ shared_network_param: name | calculate_tee_times | t1_percent | t2_percent + | allow_static_leases | unknown_map_entry ; diff --git a/src/bin/dhcp6/dhcp6_lexer.ll b/src/bin/dhcp6/dhcp6_lexer.ll index 1fcea99e13..2861ae0cff 100644 --- a/src/bin/dhcp6/dhcp6_lexer.ll +++ b/src/bin/dhcp6/dhcp6_lexer.ll @@ -874,6 +874,17 @@ ControlCharacterFill [^"\\]|\\{JSONEscapeSequence} } } +\"allow-static-leases\" { + switch(driver.ctx_) { + case isc::dhcp::Parser6Context::DHCP6: + case isc::dhcp::Parser6Context::SUBNET6: + case isc::dhcp::Parser6Context::SHARED_NETWORK: + return isc::dhcp::Dhcp6Parser::make_ALLOW_STATIC_LEASES(driver.loc_); + default: + return isc::dhcp::Dhcp6Parser::make_STRING("allow-static-leases", driver.loc_); + } +} + \"decline-probation-period\" { switch(driver.ctx_) { case isc::dhcp::Parser6Context::DHCP6: diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy index 3523ad7de6..3eb2ebe839 100644 --- a/src/bin/dhcp6/dhcp6_parser.yy +++ b/src/bin/dhcp6/dhcp6_parser.yy @@ -94,6 +94,7 @@ using namespace std; MAX_VALID_LIFETIME "max-valid-lifetime" RENEW_TIMER "renew-timer" REBIND_TIMER "rebind-timer" + ALLOW_STATIC_LEASES "allow-static-leases" CALCULATE_TEE_TIMES "calculate-tee-times" T1_PERCENT "t1-percent" T2_PERCENT "t2-percent" @@ -491,6 +492,7 @@ global_param: data_directory | loggers | hostname_char_set | hostname_char_replacement + | allow_static_leases | unknown_map_entry ; @@ -542,6 +544,11 @@ rebind_timer: REBIND_TIMER COLON INTEGER { ctx.stack_.back()->set("rebind-timer", prf); }; +allow_static_leases: ALLOW_STATIC_LEASES COLON BOOLEAN { + ElementPtr asl(new BoolElement($3, ctx.loc2pos(@3))); + ctx.stack_.back()->set("allow-static-leases", asl); +}; + calculate_tee_times: CALCULATE_TEE_TIMES COLON BOOLEAN { ElementPtr ctt(new BoolElement($3, ctx.loc2pos(@3))); ctx.stack_.back()->set("calculate-tee-times", ctt); @@ -1142,6 +1149,7 @@ subnet6_param: preferred_lifetime | calculate_tee_times | t1_percent | t2_percent + | allow_static_leases | unknown_map_entry ; @@ -1268,6 +1276,7 @@ shared_network_param: name | calculate_tee_times | t1_percent | t2_percent + | allow_static_leases | unknown_map_entry ;