]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5187] flush, maxsize and maxver parameters added to all parsers.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 18 Apr 2017 19:37:20 +0000 (21:37 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 18 Apr 2017 19:37:20 +0000 (21:37 +0200)
src/bin/agent/agent_lexer.ll
src/bin/agent/agent_parser.yy
src/bin/d2/d2_lexer.ll
src/bin/d2/d2_parser.yy
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 113ebdffafbe87154dab0a1f311c07b57d80b28c..8fa65374c2b37fd149002e6e2704392ca0f2c488 100644 (file)
@@ -329,6 +329,33 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
+\"flush\" {
+    switch(driver.ctx_) {
+    case ParserContext::OUTPUT_OPTIONS:
+        return AgentParser::make_FLUSH(driver.loc_);
+    default:
+        return AgentParser::make_STRING("flush", driver.loc_);
+    }
+}
+
+\"maxsize\" {
+    switch(driver.ctx_) {
+    case ParserContext::OUTPUT_OPTIONS:
+        return AgentParser::make_MAXSIZE(driver.loc_);
+    default:
+        return AgentParser::make_STRING("maxsize", driver.loc_);
+    }
+}
+
+\"maxver\" {
+    switch(driver.ctx_) {
+    case ParserContext::OUTPUT_OPTIONS:
+        return AgentParser::make_MAXVER(driver.loc_);
+    default:
+        return AgentParser::make_STRING("maxver", driver.loc_);
+    }
+}
+
 \"debuglevel\" {
     switch(driver.ctx_) {
     case ParserContext::LOGGERS:
index 9414ea7688f6bb77aae0f3c9e48ed51c69e95edc..da309b7b55cce78269eba23d268bcda3aa8103fb 100644 (file)
@@ -71,6 +71,9 @@ using namespace std;
   OUTPUT "output"
   DEBUGLEVEL "debuglevel"
   SEVERITY "severity"
+  FLUSH "flush"
+  MAXSIZE "maxsize"
+  MAXVER "maxver"
 
   DHCP4 "Dhcp4"
   DHCP6 "Dhcp6"
@@ -549,15 +552,21 @@ output_entry: LCURLY_BRACKET {
     ElementPtr m(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->add(m);
     ctx.stack_.push_back(m);
-} output_params RCURLY_BRACKET {
+} output_params_list RCURLY_BRACKET {
     ctx.stack_.pop_back();
 };
 
-output_params: output_param
-             | output_params COMMA output_param
+output_params_list: output_params
+             | output_params_list COMMA output_params
              ;
 
-output_param: OUTPUT {
+output_params: output
+             | flush
+             | maxsize
+             | maxver
+             ;
+
+output: OUTPUT {
     ctx.enter(ctx.NO_KEYWORDS);
 } COLON STRING {
     ElementPtr sev(new StringElement($4, ctx.loc2pos(@4)));
@@ -565,6 +574,21 @@ output_param: OUTPUT {
     ctx.leave();
 };
 
+flush: FLUSH COLON BOOLEAN {
+    ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("flush", flush);
+}
+
+maxsize: MAXSIZE COLON INTEGER {
+    ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxsize", maxsize);
+}
+
+maxver: MAXVER COLON INTEGER {
+    ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxver", maxver);
+}
+
 %%
 
 void
index c9f83df715710da52755f5f5c0dd79abb72ee2de..90a1caa45c3e261b318af82ab84bbaf6deb1ddc2 100644 (file)
@@ -389,6 +389,33 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
+\"flush\" {
+    switch(driver.ctx_) {
+    case isc::d2::D2ParserContext::OUTPUT_OPTIONS:
+        return isc::d2::D2Parser::make_FLUSH(driver.loc_);
+    default:
+        return isc::d2::D2Parser::make_STRING("flush", driver.loc_);
+    }
+}
+
+\"maxsize\" {
+    switch(driver.ctx_) {
+    case isc::d2::D2ParserContext::OUTPUT_OPTIONS:
+        return isc::d2::D2Parser::make_MAXSIZE(driver.loc_);
+    default:
+        return isc::d2::D2Parser::make_STRING("maxsize", driver.loc_);
+    }
+}
+
+\"maxver\" {
+    switch(driver.ctx_) {
+    case isc::d2::D2ParserContext::OUTPUT_OPTIONS:
+        return isc::d2::D2Parser::make_MAXVER(driver.loc_);
+    default:
+        return isc::d2::D2Parser::make_STRING("maxver", driver.loc_);
+    }
+}
+
 \"name\" {
     switch(driver.ctx_) {
     case isc::d2::D2ParserContext::LOGGERS:
index 5c585d1e8a177d92f208ce81f019110826693527..46d431462869482d86537e8eee9a2aeca6387f94 100644 (file)
@@ -79,6 +79,9 @@ using namespace std;
   OUTPUT "output"
   DEBUGLEVEL "debuglevel"
   SEVERITY "severity"
+  FLUSH "flush"
+  MAXSIZE "maxsize"
+  MAXVER "maxver"
 
   // Not real tokens, just a way to signal what the parser is expected to
   // parse.
@@ -711,15 +714,21 @@ output_entry: LCURLY_BRACKET {
     ElementPtr m(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->add(m);
     ctx.stack_.push_back(m);
-} output_params RCURLY_BRACKET {
+} output_params_list RCURLY_BRACKET {
     ctx.stack_.pop_back();
 };
 
-output_params: output_param
-             | output_params COMMA output_param
+output_params_list: output_params
+             | output_params_list COMMA output_params
              ;
 
-output_param: OUTPUT {
+output_params: output
+             | flush
+             | maxsize
+             | maxver
+             ;
+
+output: OUTPUT {
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
     ElementPtr sev(new StringElement($4, ctx.loc2pos(@4)));
@@ -727,6 +736,21 @@ output_param: OUTPUT {
     ctx.leave();
 };
 
+flush: FLUSH COLON BOOLEAN {
+    ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("flush", flush);
+}
+
+maxsize: MAXSIZE COLON INTEGER {
+    ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxsize", maxsize);
+}
+
+maxver: MAXVER COLON INTEGER {
+    ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxver", maxver);
+}
+
 %%
 
 void
index 07bb8f465ecbc6dbcbcee21631c10420611a8759..93570f8002bf7369dae72340fb69e9b8b09e0388 100644 (file)
@@ -630,6 +630,33 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
+\"flush\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser4Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp4Parser::make_FLUSH(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp4Parser::make_STRING("flush", driver.loc_);
+    }
+}
+
+\"maxsize\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser4Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp4Parser::make_MAXSIZE(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp4Parser::make_STRING("maxsize", driver.loc_);
+    }
+}
+
+\"maxver\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser4Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp4Parser::make_MAXVER(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp4Parser::make_STRING("maxver", driver.loc_);
+    }
+}
+
 \"severity\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser4Context::LOGGERS:
index e1c0615b11f75c5491b1c10bd91ed2f8388570bc..7a3f56bfa456ed099a20624fe81bdef3d200dd39 100644 (file)
@@ -173,6 +173,9 @@ using namespace std;
   OUTPUT "output"
   DEBUGLEVEL "debuglevel"
   SEVERITY "severity"
+  FLUSH "flush"
+  MAXSIZE "maxsize"
+  MAXVER "maxver"
 
   DHCP6 "Dhcp6"
   DHCPDDNS "DhcpDdns"
@@ -1731,15 +1734,21 @@ output_entry: LCURLY_BRACKET {
     ElementPtr m(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->add(m);
     ctx.stack_.push_back(m);
-} output_params RCURLY_BRACKET {
+} output_params_list RCURLY_BRACKET {
     ctx.stack_.pop_back();
 };
 
-output_params: output_param
-             | output_params COMMA output_param
+output_params_list: output_params
+                  | output_params_list COMMA output_params
+                  ;
+
+output_params: output
+             | flush
+             | maxsize
+             | maxver
              ;
 
-output_param: OUTPUT {
+output: OUTPUT {
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
     ElementPtr sev(new StringElement($4, ctx.loc2pos(@4)));
@@ -1747,6 +1756,21 @@ output_param: OUTPUT {
     ctx.leave();
 };
 
+flush: FLUSH COLON BOOLEAN {
+    ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("flush", flush);
+}
+
+maxsize: MAXSIZE COLON INTEGER {
+    ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxsize", maxsize);
+}
+
+maxver: MAXVER COLON INTEGER {
+    ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxver", maxver);
+}
+
 %%
 
 void
index 239e8d0869460d2db7ca3f436b2454218b087641..df5867b56824777403bec004de851815993ccc18 100644 (file)
@@ -897,6 +897,34 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
     }
 }
 
+\"flush\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp6Parser::make_FLUSH(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp6Parser::make_STRING("flush", driver.loc_);
+    }
+}
+
+\"maxsize\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp6Parser::make_MAXSIZE(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp6Parser::make_STRING("maxsize", driver.loc_);
+    }
+}
+
+\"maxver\" {
+    switch(driver.ctx_) {
+    case isc::dhcp::Parser6Context::OUTPUT_OPTIONS:
+        return isc::dhcp::Dhcp6Parser::make_MAXVER(driver.loc_);
+    default:
+        return isc::dhcp::Dhcp6Parser::make_STRING("maxver", driver.loc_);
+    }
+}
+
+
 \"debuglevel\" {
     switch(driver.ctx_) {
     case isc::dhcp::Parser6Context::LOGGERS:
index f774a11f15ab5679507ed45e02ea9ed60cbdcb98..dd81e45f7e5d026b0948da33191c952da12870bc 100644 (file)
@@ -180,6 +180,9 @@ using namespace std;
   OUTPUT "output"
   DEBUGLEVEL "debuglevel"
   SEVERITY "severity"
+  FLUSH "flush"
+  MAXSIZE "maxsize"
+  MAXVER "maxver"
 
   DHCP4 "Dhcp4"
   DHCPDDNS "DhcpDdns"
@@ -1820,15 +1823,21 @@ output_entry: LCURLY_BRACKET {
     ElementPtr m(new MapElement(ctx.loc2pos(@1)));
     ctx.stack_.back()->add(m);
     ctx.stack_.push_back(m);
-} output_params RCURLY_BRACKET {
+} output_params_list RCURLY_BRACKET {
     ctx.stack_.pop_back();
 };
 
-output_params: output_param
-             | output_params COMMA output_param
+output_params_list: output_params
+                  | output_params_list COMMA output_params
+                  ;
+
+output_params: output
+             | flush
+             | maxsize
+             | maxver
              ;
 
-output_param: OUTPUT {
+output: OUTPUT {
     ctx.enter(ctx.NO_KEYWORD);
 } COLON STRING {
     ElementPtr sev(new StringElement($4, ctx.loc2pos(@4)));
@@ -1836,6 +1845,21 @@ output_param: OUTPUT {
     ctx.leave();
 };
 
+flush: FLUSH COLON BOOLEAN {
+    ElementPtr flush(new BoolElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("flush", flush);
+}
+
+maxsize: MAXSIZE COLON INTEGER {
+    ElementPtr maxsize(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxsize", maxsize);
+}
+
+maxver: MAXVER COLON INTEGER {
+    ElementPtr maxver(new IntElement($3, ctx.loc2pos(@3)));
+    ctx.stack_.back()->set("maxver", maxver);
+}
+
 %%
 
 void