]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[430-configure-location-of-datadir] Extended syntax
authorFrancis Dupont <fdupont@isc.org>
Wed, 6 Mar 2019 11:39:27 +0000 (12:39 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 15 Mar 2019 23:21:08 +0000 (00:21 +0100)
src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy

index 4347991bde326d75f62a55cb786c55cf18c32a11..6565d4ae5e911604576c608f707467e89844fcf1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2016-2019 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
@@ -432,6 +432,15 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
+\"data-directory\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser6Context::DHCP6:
+        return  isc::dhcp::Dhcp6Parser::make_DATA_DIRECTORY(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp6Parser::make_STRING("data-directory", driver.loc_);
+    }
+}
+
 \"interfaces-config\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser6Context::DHCP6:
index 71253663eceeeda409653ebbef3531d323fd235e..164598c3e8708131265009436efcf9d7bdbaa36f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
+/* Copyright (C) 2016-2019 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
@@ -50,6 +50,7 @@ using namespace std;
   NULL_TYPE "null"
 
   DHCP6 "Dhcp6"
+  DATA_DIRECTORY "data-directory"
   CONFIG_CONTROL "config-control"
   CONFIG_DATABASES "config-databases"
   INTERFACES_CONFIG "interfaces-config"
@@ -435,7 +436,8 @@ global_params: global_param
 
 // These are the parameters that are allowed in the top-level for
 // Dhcp6.
-global_param: preferred_lifetime
+global_param: data_directory
+            | preferred_lifetime
             | valid_lifetime
             | renew_timer
             | rebind_timer
@@ -469,6 +471,14 @@ global_param: preferred_lifetime
             | unknown_map_entry
             ;
 
+data_directory: DATA_DIRECTORY {
+    ctx.enter(ctx.NO_KEYWORD);
+} COLON STRING {
+    ElementPtr datadir(new StringElement($4, ctx.loc2pos(@4)));
+    ctx.stack_.back()->set("data-directory", datadir);
+    ctx.leave();
+};
+
 preferred_lifetime: PREFERRED_LIFETIME COLON INTEGER {
     ElementPtr prf(new IntElement($3, ctx.loc2pos(@3)));
     ctx.stack_.back()->set("preferred-lifetime", prf);
@@ -494,7 +504,7 @@ decline_probation_period: DECLINE_PROBATION_PERIOD COLON INTEGER {
     ctx.stack_.back()->set("decline-probation-period", dpp);
 };
 
-server_tag: SERVER_TAG  {
+server_tag: SERVER_TAG {
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
     ElementPtr stag(new StringElement($4, ctx.loc2pos(@4)));