2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 06:25:34 +00:00

[5680] kea-dhcp4/6 now parse hostname-char-set and hostname-char-replacment params

Added to parsing and parsing unit tests.
Servers do not yet utilize the values.

Modified:

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy

src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/fqdn_unittest.cc
src/bin/dhcp4/tests/get_config_unittest.

src/bin/dhcp6/dhcp6_lexer.ll
src/bin/dhcp6/dhcp6_parser.yy

src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
src/bin/dhcp6/tests/get_config_unittest.
This commit is contained in:
Thomas Markwalder
2018-07-09 13:36:06 -04:00
committed by Tomek Mrugalski
parent 54bb07ee25
commit ea3d6bca65
21 changed files with 5188 additions and 5007 deletions

View File

@@ -477,35 +477,37 @@ namespace isc { namespace dhcp {
TOKEN_NEVER = 384,
TOKEN_ALWAYS = 385,
TOKEN_WHEN_NOT_PRESENT = 386,
TOKEN_LOGGING = 387,
TOKEN_LOGGERS = 388,
TOKEN_OUTPUT_OPTIONS = 389,
TOKEN_OUTPUT = 390,
TOKEN_DEBUGLEVEL = 391,
TOKEN_SEVERITY = 392,
TOKEN_FLUSH = 393,
TOKEN_MAXSIZE = 394,
TOKEN_MAXVER = 395,
TOKEN_DHCP6 = 396,
TOKEN_DHCPDDNS = 397,
TOKEN_CONTROL_AGENT = 398,
TOKEN_TOPLEVEL_JSON = 399,
TOKEN_TOPLEVEL_DHCP4 = 400,
TOKEN_SUB_DHCP4 = 401,
TOKEN_SUB_INTERFACES4 = 402,
TOKEN_SUB_SUBNET4 = 403,
TOKEN_SUB_POOL4 = 404,
TOKEN_SUB_RESERVATION = 405,
TOKEN_SUB_OPTION_DEFS = 406,
TOKEN_SUB_OPTION_DEF = 407,
TOKEN_SUB_OPTION_DATA = 408,
TOKEN_SUB_HOOKS_LIBRARY = 409,
TOKEN_SUB_DHCP_DDNS = 410,
TOKEN_SUB_LOGGING = 411,
TOKEN_STRING = 412,
TOKEN_INTEGER = 413,
TOKEN_FLOAT = 414,
TOKEN_BOOLEAN = 415
TOKEN_HOSTNAME_CHAR_SET = 387,
TOKEN_HOSTNAME_CHAR_REPLACEMENT = 388,
TOKEN_LOGGING = 389,
TOKEN_LOGGERS = 390,
TOKEN_OUTPUT_OPTIONS = 391,
TOKEN_OUTPUT = 392,
TOKEN_DEBUGLEVEL = 393,
TOKEN_SEVERITY = 394,
TOKEN_FLUSH = 395,
TOKEN_MAXSIZE = 396,
TOKEN_MAXVER = 397,
TOKEN_DHCP6 = 398,
TOKEN_DHCPDDNS = 399,
TOKEN_CONTROL_AGENT = 400,
TOKEN_TOPLEVEL_JSON = 401,
TOKEN_TOPLEVEL_DHCP4 = 402,
TOKEN_SUB_DHCP4 = 403,
TOKEN_SUB_INTERFACES4 = 404,
TOKEN_SUB_SUBNET4 = 405,
TOKEN_SUB_POOL4 = 406,
TOKEN_SUB_RESERVATION = 407,
TOKEN_SUB_OPTION_DEFS = 408,
TOKEN_SUB_OPTION_DEF = 409,
TOKEN_SUB_OPTION_DATA = 410,
TOKEN_SUB_HOOKS_LIBRARY = 411,
TOKEN_SUB_DHCP_DDNS = 412,
TOKEN_SUB_LOGGING = 413,
TOKEN_STRING = 414,
TOKEN_INTEGER = 415,
TOKEN_FLOAT = 416,
TOKEN_BOOLEAN = 417
};
};
@@ -1140,6 +1142,14 @@ namespace isc { namespace dhcp {
symbol_type
make_WHEN_NOT_PRESENT (const location_type& l);
static inline
symbol_type
make_HOSTNAME_CHAR_SET (const location_type& l);
static inline
symbol_type
make_HOSTNAME_CHAR_REPLACEMENT (const location_type& l);
static inline
symbol_type
make_LOGGING (const location_type& l);
@@ -1461,12 +1471,12 @@ namespace isc { namespace dhcp {
enum
{
yyeof_ = 0,
yylast_ = 935, ///< Last index in yytable_.
yynnts_ = 353, ///< Number of nonterminal symbols.
yylast_ = 945, ///< Last index in yytable_.
yynnts_ = 357, ///< Number of nonterminal symbols.
yyfinal_ = 28, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
yyntokens_ = 161 ///< Number of tokens.
yyntokens_ = 163 ///< Number of tokens.
};
@@ -1524,9 +1534,9 @@ namespace isc { namespace dhcp {
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160
155, 156, 157, 158, 159, 160, 161, 162
};
const unsigned int user_token_number_max_ = 415;
const unsigned int user_token_number_max_ = 417;
const token_number_type undef_token_ = 2;
if (static_cast<int>(t) <= yyeof_)
@@ -1559,30 +1569,30 @@ namespace isc { namespace dhcp {
{
switch (other.type_get ())
{
case 176: // value
case 180: // map_value
case 218: // socket_type
case 221: // outbound_interface_value
case 237: // db_type
case 321: // hr_mode
case 469: // ncr_protocol_value
case 477: // replace_client_name_value
case 178: // value
case 182: // map_value
case 220: // socket_type
case 223: // outbound_interface_value
case 239: // db_type
case 323: // hr_mode
case 471: // ncr_protocol_value
case 479: // replace_client_name_value
value.copy< ElementPtr > (other.value);
break;
case 160: // "boolean"
case 162: // "boolean"
value.copy< bool > (other.value);
break;
case 159: // "floating point"
case 161: // "floating point"
value.copy< double > (other.value);
break;
case 158: // "integer"
case 160: // "integer"
value.copy< int64_t > (other.value);
break;
case 157: // "constant string"
case 159: // "constant string"
value.copy< std::string > (other.value);
break;
@@ -1603,30 +1613,30 @@ namespace isc { namespace dhcp {
(void) v;
switch (this->type_get ())
{
case 176: // value
case 180: // map_value
case 218: // socket_type
case 221: // outbound_interface_value
case 237: // db_type
case 321: // hr_mode
case 469: // ncr_protocol_value
case 477: // replace_client_name_value
case 178: // value
case 182: // map_value
case 220: // socket_type
case 223: // outbound_interface_value
case 239: // db_type
case 323: // hr_mode
case 471: // ncr_protocol_value
case 479: // replace_client_name_value
value.copy< ElementPtr > (v);
break;
case 160: // "boolean"
case 162: // "boolean"
value.copy< bool > (v);
break;
case 159: // "floating point"
case 161: // "floating point"
value.copy< double > (v);
break;
case 158: // "integer"
case 160: // "integer"
value.copy< int64_t > (v);
break;
case 157: // "constant string"
case 159: // "constant string"
value.copy< std::string > (v);
break;
@@ -1706,30 +1716,30 @@ namespace isc { namespace dhcp {
// Type destructor.
switch (yytype)
{
case 176: // value
case 180: // map_value
case 218: // socket_type
case 221: // outbound_interface_value
case 237: // db_type
case 321: // hr_mode
case 469: // ncr_protocol_value
case 477: // replace_client_name_value
case 178: // value
case 182: // map_value
case 220: // socket_type
case 223: // outbound_interface_value
case 239: // db_type
case 323: // hr_mode
case 471: // ncr_protocol_value
case 479: // replace_client_name_value
value.template destroy< ElementPtr > ();
break;
case 160: // "boolean"
case 162: // "boolean"
value.template destroy< bool > ();
break;
case 159: // "floating point"
case 161: // "floating point"
value.template destroy< double > ();
break;
case 158: // "integer"
case 160: // "integer"
value.template destroy< int64_t > ();
break;
case 157: // "constant string"
case 159: // "constant string"
value.template destroy< std::string > ();
break;
@@ -1756,30 +1766,30 @@ namespace isc { namespace dhcp {
super_type::move(s);
switch (this->type_get ())
{
case 176: // value
case 180: // map_value
case 218: // socket_type
case 221: // outbound_interface_value
case 237: // db_type
case 321: // hr_mode
case 469: // ncr_protocol_value
case 477: // replace_client_name_value
case 178: // value
case 182: // map_value
case 220: // socket_type
case 223: // outbound_interface_value
case 239: // db_type
case 323: // hr_mode
case 471: // ncr_protocol_value
case 479: // replace_client_name_value
value.move< ElementPtr > (s.value);
break;
case 160: // "boolean"
case 162: // "boolean"
value.move< bool > (s.value);
break;
case 159: // "floating point"
case 161: // "floating point"
value.move< double > (s.value);
break;
case 158: // "integer"
case 160: // "integer"
value.move< int64_t > (s.value);
break;
case 157: // "constant string"
case 159: // "constant string"
value.move< std::string > (s.value);
break;
@@ -1854,7 +1864,7 @@ namespace isc { namespace dhcp {
385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
405, 406, 407, 408, 409, 410, 411, 412, 413, 414,
415
415, 416, 417
};
return static_cast<token_type> (yytoken_number_[type]);
}
@@ -2639,6 +2649,18 @@ namespace isc { namespace dhcp {
return symbol_type (token::TOKEN_WHEN_NOT_PRESENT, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_HOSTNAME_CHAR_SET (const location_type& l)
{
return symbol_type (token::TOKEN_HOSTNAME_CHAR_SET, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_HOSTNAME_CHAR_REPLACEMENT (const location_type& l)
{
return symbol_type (token::TOKEN_HOSTNAME_CHAR_REPLACEMENT, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_LOGGING (const location_type& l)
{
@@ -2816,7 +2838,7 @@ namespace isc { namespace dhcp {
#line 14 "dhcp4_parser.yy" // lalr1.cc:377
} } // isc::dhcp
#line 2820 "dhcp4_parser.h" // lalr1.cc:377
#line 2842 "dhcp4_parser.h" // lalr1.cc:377