From c397e58b78ff86b36c07421483eb0d82dee96023 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Wed, 6 Mar 2019 12:39:27 +0100 Subject: [PATCH] [430-configure-location-of-datadir] Extended syntax --- src/bin/dhcp6/dhcp6_lexer.ll | 11 ++++++++++- src/bin/dhcp6/dhcp6_parser.yy | 16 +++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/bin/dhcp6/dhcp6_lexer.ll b/src/bin/dhcp6/dhcp6_lexer.ll index 4347991bde..6565d4ae5e 100644 --- a/src/bin/dhcp6/dhcp6_lexer.ll +++ b/src/bin/dhcp6/dhcp6_lexer.ll @@ -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: diff --git a/src/bin/dhcp6/dhcp6_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy index 71253663ec..164598c3e8 100644 --- a/src/bin/dhcp6/dhcp6_parser.yy +++ b/src/bin/dhcp6/dhcp6_parser.yy @@ -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))); -- 2.47.2