diff --git a/src/lib/eval/lexer.cc b/src/lib/eval/lexer.cc index 06f7bb0f5a..33e5c55d5e 100644 --- a/src/lib/eval/lexer.cc +++ b/src/lib/eval/lexer.cc @@ -486,7 +486,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[98] = +static yyconst flex_int16_t yy_acclist[99] = { 0, 22, 20, 21, 1, 20, 21, 2, 21, 20, 21, 15, 20, 21, 16, 20, 21, 19, 20, 21, 20, @@ -496,20 +496,20 @@ static yyconst flex_int16_t yy_acclist[98] = 20, 21,16390, 20, 21,16390, 20, 21,16390, 1, 2, 3, 5, 7,16390, 8198,16390,16390,16390,16390, 16390,16390, 4, 13,16390, 10,16390,16390,16390,16390, - 16390,16390,16390,16390, 9,16390,16390, 12,16390,16390, - 8,16390,16390,16390,16390, 11,16390 + 16390,16390,16390,16390, 9,16390,16390,16390,16390, 8, + 16390, 12,16390,16390,16390,16390, 11,16390 } ; -static yyconst flex_int16_t yy_accept[63] = +static yyconst flex_int16_t yy_accept[64] = { 0, 1, 1, 1, 2, 4, 7, 9, 11, 14, 17, 20, 22, 25, 28, 31, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 61, 62, 62, 63, 64, 64, 65, 65, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 76, 78, 79, 80, 81, 82, 83, - 84, 85, 87, 88, 90, 91, 93, 94, 95, 96, - 98, 98 + 84, 85, 87, 88, 89, 90, 92, 94, 95, 96, + 97, 99, 99 } ; static yyconst flex_int32_t yy_ec[256] = @@ -519,15 +519,15 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 4, 5, 6, 1, 1, 7, 8, 9, 1, 10, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 1, 1, 1, - 12, 1, 1, 1, 13, 13, 13, 13, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 15, 14, 14, - 16, 1, 17, 1, 18, 1, 19, 20, 13, 13, + 11, 12, 11, 11, 11, 11, 11, 1, 1, 1, + 13, 1, 1, 1, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 16, 15, 15, + 17, 1, 18, 1, 19, 1, 20, 21, 14, 14, - 21, 13, 22, 23, 24, 14, 14, 25, 14, 26, - 27, 28, 14, 29, 30, 31, 32, 14, 14, 33, - 34, 14, 1, 1, 1, 1, 1, 1, 1, 1, + 22, 14, 23, 24, 25, 15, 15, 26, 15, 27, + 28, 29, 15, 30, 31, 32, 33, 15, 15, 34, + 35, 15, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -544,78 +544,80 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[35] = +static yyconst flex_int32_t yy_meta[36] = { 0, 1, 2, 3, 1, 1, 1, 1, 2, 1, 4, - 4, 1, 4, 2, 2, 1, 2, 2, 4, 4, - 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2 + 4, 4, 1, 4, 2, 2, 1, 2, 2, 4, + 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[65] = +static yyconst flex_int16_t yy_base[66] = { 0, - 0, 0, 128, 129, 125, 123, 121, 129, 129, 129, - 25, 129, 27, 29, 112, 41, 129, 129, 59, 20, - 22, 27, 21, 30, 121, 119, 117, 129, 46, 0, - 129, 61, 63, 95, 129, 94, 46, 43, 93, 50, - 48, 0, 92, 91, 58, 66, 62, 64, 69, 65, - 72, 90, 75, 85, 73, 68, 80, 81, 47, 61, - 129, 107, 110, 50 + 0, 0, 135, 136, 132, 130, 128, 136, 136, 136, + 26, 136, 29, 32, 118, 46, 136, 136, 64, 24, + 26, 25, 27, 35, 128, 126, 124, 136, 58, 0, + 136, 56, 73, 101, 136, 100, 45, 30, 99, 52, + 51, 0, 98, 97, 55, 66, 58, 61, 68, 62, + 69, 96, 76, 86, 74, 95, 90, 80, 81, 87, + 85, 136, 113, 116, 105 } ; -static yyconst flex_int16_t yy_def[65] = +static yyconst flex_int16_t yy_def[66] = { 0, - 61, 1, 61, 61, 61, 61, 62, 61, 61, 61, - 61, 61, 61, 61, 61, 63, 61, 61, 63, 19, - 19, 19, 19, 19, 61, 61, 62, 61, 61, 64, - 61, 61, 19, 19, 61, 19, 19, 19, 19, 19, - 19, 64, 19, 19, 19, 19, 19, 19, 19, 19, + 62, 1, 62, 62, 62, 62, 63, 62, 62, 62, + 62, 62, 62, 62, 62, 64, 62, 62, 64, 19, + 19, 19, 19, 19, 62, 62, 63, 62, 62, 65, + 62, 62, 19, 19, 62, 19, 19, 19, 19, 19, + 19, 65, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, - 0, 61, 61, 61 + 19, 0, 62, 62, 62 } ; -static yyconst flex_int16_t yy_nxt[164] = +static yyconst flex_int16_t yy_nxt[172] = { 0, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 16, 16, 17, 18, 4, 19, 16, - 16, 16, 20, 16, 16, 16, 21, 16, 22, 23, - 24, 16, 16, 16, 29, 29, 29, 29, 29, 29, - 37, 30, 32, 32, 34, 34, 34, 39, 33, 38, - 41, 34, 40, 42, 34, 29, 29, 35, 33, 30, - 32, 32, 32, 32, 61, 61, 33, 34, 60, 47, - 34, 34, 34, 45, 34, 35, 33, 35, 44, 61, - 48, 49, 34, 36, 50, 34, 34, 34, 34, 34, - 34, 51, 34, 34, 52, 53, 34, 34, 54, 34, + 14, 14, 15, 16, 16, 16, 17, 18, 4, 19, + 16, 16, 16, 20, 16, 16, 16, 21, 16, 22, + 23, 24, 16, 16, 16, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 30, 37, 39, 32, 32, 34, + 34, 34, 34, 33, 38, 34, 41, 32, 32, 40, + 34, 45, 30, 35, 33, 32, 32, 29, 29, 29, + 34, 33, 47, 35, 62, 62, 34, 34, 44, 49, + 34, 35, 33, 34, 48, 50, 34, 34, 51, 36, + 62, 34, 52, 34, 34, 53, 54, 57, 34, 34, - 56, 57, 55, 58, 34, 34, 59, 27, 27, 34, - 27, 34, 34, 34, 34, 34, 34, 46, 43, 34, - 28, 26, 25, 31, 28, 26, 25, 61, 3, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61 + 55, 34, 56, 58, 59, 34, 34, 60, 42, 61, + 34, 34, 34, 27, 27, 34, 27, 34, 34, 34, + 34, 34, 34, 34, 46, 43, 34, 28, 26, 25, + 31, 28, 26, 25, 62, 3, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62 } ; -static yyconst flex_int16_t yy_chk[164] = +static yyconst flex_int16_t yy_chk[172] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 11, 11, 13, 13, 14, 14, - 20, 13, 16, 16, 20, 23, 21, 22, 16, 21, - 24, 22, 23, 64, 24, 29, 29, 16, 16, 13, - 19, 19, 32, 32, 33, 33, 19, 38, 59, 40, - 37, 59, 41, 38, 40, 19, 19, 32, 37, 33, - 41, 45, 45, 19, 46, 60, 47, 33, 48, 50, - 46, 47, 56, 49, 48, 49, 51, 55, 50, 53, + 1, 1, 1, 1, 1, 11, 11, 11, 13, 13, + 13, 14, 14, 14, 13, 20, 22, 16, 16, 20, + 22, 21, 23, 16, 21, 38, 24, 32, 32, 23, + 24, 38, 13, 16, 16, 19, 19, 29, 29, 29, + 37, 19, 40, 32, 33, 33, 41, 40, 37, 45, + 45, 19, 19, 47, 41, 46, 48, 50, 47, 19, + 33, 46, 48, 49, 51, 49, 50, 54, 33, 55, - 53, 55, 51, 57, 57, 58, 58, 62, 62, 54, - 62, 63, 63, 63, 52, 44, 43, 39, 36, 34, - 27, 26, 25, 15, 7, 6, 5, 3, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61 + 51, 53, 53, 55, 58, 58, 59, 59, 65, 60, + 61, 54, 60, 63, 63, 57, 63, 64, 64, 64, + 56, 52, 44, 43, 39, 36, 34, 27, 26, 25, + 15, 7, 6, 5, 3, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62 } ; /* Table of booleans, true if rule could match eol. */ @@ -657,7 +659,7 @@ goto find_rule; \ #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lexer.ll" -/* Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") +/* Copyright (C) 2015-2016 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 @@ -707,7 +709,7 @@ static isc::eval::location loc; // by moving it ahead by yyleng bytes. yyleng specifies the length of the // currently matched token. #define YY_USER_ACTION loc.columns(yyleng); -#line 711 "lexer.cc" +#line 713 "lexer.cc" #define INITIAL 0 @@ -1001,7 +1003,7 @@ YY_DECL loc.step(); -#line 1005 "lexer.cc" +#line 1007 "lexer.cc" while ( 1 ) /* loops until end-of-file is reached */ { @@ -1029,14 +1031,14 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 62 ) + if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } - while ( yy_current_state != 61 ); + while ( yy_current_state != 62 ); yy_find_action: /* %% [10.0] code to find the action number goes here */ @@ -1210,7 +1212,7 @@ return isc::eval::EvalParser::make_SUBSTRING(loc); case 12: YY_RULE_SETUP #line 130 "lexer.ll" -return isc::eval::EvalParser::make_RELAY(loc); +return isc::eval::EvalParser::make_RELAY4(loc); YY_BREAK case 13: YY_RULE_SETUP @@ -1261,7 +1263,7 @@ YY_RULE_SETUP #line 141 "lexer.ll" ECHO; YY_BREAK -#line 1265 "lexer.cc" +#line 1267 "lexer.cc" case YY_END_OF_BUFFER: { @@ -1542,7 +1544,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 62 ) + if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1570,11 +1572,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 62 ) + if ( yy_current_state >= 63 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 61); + yy_is_jam = (yy_current_state == 62); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; diff --git a/src/lib/eval/parser.cc b/src/lib/eval/parser.cc index fdd7f0ecd4..9289f5364c 100644 --- a/src/lib/eval/parser.cc +++ b/src/lib/eval/parser.cc @@ -653,82 +653,89 @@ namespace isc { namespace eval { break; } case Option::V6: - error(yystack_[5].location, "relay support for v6 is not implemented"); + // We will have relay6[123] for the DHCPv6. + // In a very distant future we'll possibly be able + // to mix both if we have DHCPv4-over-DHCPv6, so it + // has some sense to make it explicit whether we + // talk about DHCPv4 relay or DHCPv6 relay. However, + // for the time being relay4 can be used in DHCPv4 + // only. + error(yystack_[5].location, "relay4 can only be used in DHCPv4."); } } -#line 660 "parser.cc" // lalr1.cc:847 +#line 667 "parser.cc" // lalr1.cc:847 break; case 8: -#line 111 "parser.yy" // lalr1.cc:847 +#line 118 "parser.yy" // lalr1.cc:847 { TokenPtr sub(new TokenSubstring()); ctx.expression.push_back(sub); } -#line 669 "parser.cc" // lalr1.cc:847 +#line 676 "parser.cc" // lalr1.cc:847 break; case 10: -#line 120 "parser.yy" // lalr1.cc:847 +#line 127 "parser.yy" // lalr1.cc:847 { yylhs.value.as< uint16_t > () = ctx.convertOptionCode(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 677 "parser.cc" // lalr1.cc:847 +#line 684 "parser.cc" // lalr1.cc:847 break; case 11: -#line 124 "parser.yy" // lalr1.cc:847 +#line 131 "parser.yy" // lalr1.cc:847 { yylhs.value.as< uint16_t > () = ctx.convertOptionName(yystack_[0].value.as< std::string > (), yystack_[0].location); } -#line 685 "parser.cc" // lalr1.cc:847 +#line 692 "parser.cc" // lalr1.cc:847 break; case 12: -#line 130 "parser.yy" // lalr1.cc:847 +#line 137 "parser.yy" // lalr1.cc:847 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::TEXTUAL; } -#line 693 "parser.cc" // lalr1.cc:847 +#line 700 "parser.cc" // lalr1.cc:847 break; case 13: -#line 134 "parser.yy" // lalr1.cc:847 +#line 141 "parser.yy" // lalr1.cc:847 { yylhs.value.as< TokenOption::RepresentationType > () = TokenOption::HEXADECIMAL; } -#line 701 "parser.cc" // lalr1.cc:847 +#line 708 "parser.cc" // lalr1.cc:847 break; case 14: -#line 140 "parser.yy" // lalr1.cc:847 +#line 147 "parser.yy" // lalr1.cc:847 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); } -#line 710 "parser.cc" // lalr1.cc:847 +#line 717 "parser.cc" // lalr1.cc:847 break; case 15: -#line 147 "parser.yy" // lalr1.cc:847 +#line 154 "parser.yy" // lalr1.cc:847 { TokenPtr str(new TokenString(yystack_[0].value.as< std::string > ())); ctx.expression.push_back(str); } -#line 719 "parser.cc" // lalr1.cc:847 +#line 726 "parser.cc" // lalr1.cc:847 break; case 16: -#line 152 "parser.yy" // lalr1.cc:847 +#line 159 "parser.yy" // lalr1.cc:847 { TokenPtr str(new TokenString("all")); ctx.expression.push_back(str); } -#line 728 "parser.cc" // lalr1.cc:847 +#line 735 "parser.cc" // lalr1.cc:847 break; -#line 732 "parser.cc" // lalr1.cc:847 +#line 739 "parser.cc" // lalr1.cc:847 default: break; } @@ -1066,7 +1073,7 @@ namespace isc { namespace eval { const EvalParser::yytname_[] = { "\"end of file\"", "error", "$undefined", "\"==\"", "\"option\"", - "\"substring\"", "\"text\"", "\"relay\"", "\"hex\"", "\"all\"", "\".\"", + "\"substring\"", "\"text\"", "\"relay4\"", "\"hex\"", "\"all\"", "\".\"", "\",\"", "\"(\"", "\")\"", "\"[\"", "\"]\"", "\"constant string\"", "\"integer\"", "\"constant hexstring\"", "\"option name\"", "TOKEN", "$accept", "expression", "bool_expr", "string_expr", "option_code", @@ -1077,8 +1084,8 @@ namespace isc { namespace eval { const unsigned char EvalParser::yyrline_[] = { - 0, 72, 72, 75, 82, 87, 92, 97, 110, 115, - 119, 123, 129, 133, 139, 146, 151 + 0, 72, 72, 75, 82, 87, 92, 97, 117, 122, + 126, 130, 136, 140, 146, 153, 158 }; // Print the state stack on the debug stream. @@ -1113,8 +1120,8 @@ namespace isc { namespace eval { #line 13 "parser.yy" // lalr1.cc:1155 } } // isc::eval -#line 1117 "parser.cc" // lalr1.cc:1155 -#line 158 "parser.yy" // lalr1.cc:1156 +#line 1124 "parser.cc" // lalr1.cc:1155 +#line 165 "parser.yy" // lalr1.cc:1156 void isc::eval::EvalParser::error(const location_type& loc, diff --git a/src/lib/eval/parser.h b/src/lib/eval/parser.h index 8c3fada9bd..388cb5fbb4 100644 --- a/src/lib/eval/parser.h +++ b/src/lib/eval/parser.h @@ -333,7 +333,7 @@ namespace isc { namespace eval { TOKEN_OPTION = 259, TOKEN_SUBSTRING = 260, TOKEN_TEXT = 261, - TOKEN_RELAY = 262, + TOKEN_RELAY4 = 262, TOKEN_HEX = 263, TOKEN_ALL = 264, TOKEN_DOT = 265, @@ -467,7 +467,7 @@ namespace isc { namespace eval { static inline symbol_type - make_RELAY (const location_type& l); + make_RELAY4 (const location_type& l); static inline symbol_type @@ -1039,9 +1039,9 @@ namespace isc { namespace eval { } EvalParser::symbol_type - EvalParser::make_RELAY (const location_type& l) + EvalParser::make_RELAY4 (const location_type& l) { - return symbol_type (token::TOKEN_RELAY, l); + return symbol_type (token::TOKEN_RELAY4, l); } EvalParser::symbol_type