]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[897-add-infinite-valid-lifetime] Added allow-static-leases to flex/bison
authorFrancis Dupont <fdupont@isc.org>
Mon, 9 Sep 2019 13:11:53 +0000 (15:11 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 9 Sep 2019 13:11:53 +0000 (15:11 +0200)
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy

index 106d6c52c7dfd7cc9e78cb3754ba9ccc3b7fd921..5f3ed8457951db30e4e791bd11f0b0b658f1535a 100644 (file)
@@ -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:
index fd400433beb0c9eb90d76247eaa9ed149dd789a1..4c97e065b7d812b5d4a11733f038c568b2a4a87c 100644 (file)
@@ -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
                     ;
 
index 1fcea99e1324a3ddd4b0f04fa7a064cde94a7b8e..2861ae0cff943da873201efaa018f2b20bf4f7b6 100644 (file)
@@ -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:
index 3523ad7de649f936b1c6ddae9b11f08a001bd66e..3eb2ebe839abc4d5e3912d17a87374ef512f0ade 100644 (file)
@@ -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
                     ;