2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 14:05:33 +00:00

[#42] kea-dhcp4 parsing simplified

kea-dhcp4 parsing now matches kea-dhpc6 in parsing queue-control
as simply a map that must contain "queue-type".
This commit is contained in:
Thomas Markwalder
2018-11-06 09:42:59 -05:00
parent 32d8549e52
commit eddf6e3dfb
8 changed files with 2190 additions and 2351 deletions

View File

@@ -461,61 +461,59 @@ namespace isc { namespace dhcp {
TOKEN_SOCKET_TYPE = 368,
TOKEN_SOCKET_NAME = 369,
TOKEN_QUEUE_CONTROL = 370,
TOKEN_QUEUE_TYPE = 371,
TOKEN_CAPACITY = 372,
TOKEN_DHCP_DDNS = 373,
TOKEN_ENABLE_UPDATES = 374,
TOKEN_QUALIFYING_SUFFIX = 375,
TOKEN_SERVER_IP = 376,
TOKEN_SERVER_PORT = 377,
TOKEN_SENDER_IP = 378,
TOKEN_SENDER_PORT = 379,
TOKEN_MAX_QUEUE_SIZE = 380,
TOKEN_NCR_PROTOCOL = 381,
TOKEN_NCR_FORMAT = 382,
TOKEN_ALWAYS_INCLUDE_FQDN = 383,
TOKEN_OVERRIDE_NO_UPDATE = 384,
TOKEN_OVERRIDE_CLIENT_UPDATE = 385,
TOKEN_REPLACE_CLIENT_NAME = 386,
TOKEN_GENERATED_PREFIX = 387,
TOKEN_TCP = 388,
TOKEN_JSON = 389,
TOKEN_WHEN_PRESENT = 390,
TOKEN_NEVER = 391,
TOKEN_ALWAYS = 392,
TOKEN_WHEN_NOT_PRESENT = 393,
TOKEN_HOSTNAME_CHAR_SET = 394,
TOKEN_HOSTNAME_CHAR_REPLACEMENT = 395,
TOKEN_LOGGING = 396,
TOKEN_LOGGERS = 397,
TOKEN_OUTPUT_OPTIONS = 398,
TOKEN_OUTPUT = 399,
TOKEN_DEBUGLEVEL = 400,
TOKEN_SEVERITY = 401,
TOKEN_FLUSH = 402,
TOKEN_MAXSIZE = 403,
TOKEN_MAXVER = 404,
TOKEN_DHCP6 = 405,
TOKEN_DHCPDDNS = 406,
TOKEN_CONTROL_AGENT = 407,
TOKEN_TOPLEVEL_JSON = 408,
TOKEN_TOPLEVEL_DHCP4 = 409,
TOKEN_SUB_DHCP4 = 410,
TOKEN_SUB_INTERFACES4 = 411,
TOKEN_SUB_SUBNET4 = 412,
TOKEN_SUB_POOL4 = 413,
TOKEN_SUB_RESERVATION = 414,
TOKEN_SUB_OPTION_DEFS = 415,
TOKEN_SUB_OPTION_DEF = 416,
TOKEN_SUB_OPTION_DATA = 417,
TOKEN_SUB_HOOKS_LIBRARY = 418,
TOKEN_SUB_DHCP_DDNS = 419,
TOKEN_SUB_LOGGING = 420,
TOKEN_SUB_CONFIG_CONTROL = 421,
TOKEN_STRING = 422,
TOKEN_INTEGER = 423,
TOKEN_FLOAT = 424,
TOKEN_BOOLEAN = 425
TOKEN_DHCP_DDNS = 371,
TOKEN_ENABLE_UPDATES = 372,
TOKEN_QUALIFYING_SUFFIX = 373,
TOKEN_SERVER_IP = 374,
TOKEN_SERVER_PORT = 375,
TOKEN_SENDER_IP = 376,
TOKEN_SENDER_PORT = 377,
TOKEN_MAX_QUEUE_SIZE = 378,
TOKEN_NCR_PROTOCOL = 379,
TOKEN_NCR_FORMAT = 380,
TOKEN_ALWAYS_INCLUDE_FQDN = 381,
TOKEN_OVERRIDE_NO_UPDATE = 382,
TOKEN_OVERRIDE_CLIENT_UPDATE = 383,
TOKEN_REPLACE_CLIENT_NAME = 384,
TOKEN_GENERATED_PREFIX = 385,
TOKEN_TCP = 386,
TOKEN_JSON = 387,
TOKEN_WHEN_PRESENT = 388,
TOKEN_NEVER = 389,
TOKEN_ALWAYS = 390,
TOKEN_WHEN_NOT_PRESENT = 391,
TOKEN_HOSTNAME_CHAR_SET = 392,
TOKEN_HOSTNAME_CHAR_REPLACEMENT = 393,
TOKEN_LOGGING = 394,
TOKEN_LOGGERS = 395,
TOKEN_OUTPUT_OPTIONS = 396,
TOKEN_OUTPUT = 397,
TOKEN_DEBUGLEVEL = 398,
TOKEN_SEVERITY = 399,
TOKEN_FLUSH = 400,
TOKEN_MAXSIZE = 401,
TOKEN_MAXVER = 402,
TOKEN_DHCP6 = 403,
TOKEN_DHCPDDNS = 404,
TOKEN_CONTROL_AGENT = 405,
TOKEN_TOPLEVEL_JSON = 406,
TOKEN_TOPLEVEL_DHCP4 = 407,
TOKEN_SUB_DHCP4 = 408,
TOKEN_SUB_INTERFACES4 = 409,
TOKEN_SUB_SUBNET4 = 410,
TOKEN_SUB_POOL4 = 411,
TOKEN_SUB_RESERVATION = 412,
TOKEN_SUB_OPTION_DEFS = 413,
TOKEN_SUB_OPTION_DEF = 414,
TOKEN_SUB_OPTION_DATA = 415,
TOKEN_SUB_HOOKS_LIBRARY = 416,
TOKEN_SUB_DHCP_DDNS = 417,
TOKEN_SUB_LOGGING = 418,
TOKEN_SUB_CONFIG_CONTROL = 419,
TOKEN_STRING = 420,
TOKEN_INTEGER = 421,
TOKEN_FLOAT = 422,
TOKEN_BOOLEAN = 423
};
};
@@ -1086,14 +1084,6 @@ namespace isc { namespace dhcp {
symbol_type
make_QUEUE_CONTROL (const location_type& l);
static inline
symbol_type
make_QUEUE_TYPE (const location_type& l);
static inline
symbol_type
make_CAPACITY (const location_type& l);
static inline
symbol_type
make_DHCP_DDNS (const location_type& l);
@@ -1511,12 +1501,12 @@ namespace isc { namespace dhcp {
enum
{
yyeof_ = 0,
yylast_ = 1029, ///< Last index in yytable_.
yynnts_ = 379, ///< Number of nonterminal symbols.
yylast_ = 988, ///< Last index in yytable_.
yynnts_ = 374, ///< Number of nonterminal symbols.
yyfinal_ = 30, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
yyntokens_ = 171 ///< Number of tokens.
yyntokens_ = 169 ///< Number of tokens.
};
@@ -1575,9 +1565,9 @@ namespace isc { namespace dhcp {
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, 161, 162, 163, 164,
165, 166, 167, 168, 169, 170
165, 166, 167, 168
};
const unsigned int user_token_number_max_ = 425;
const unsigned int user_token_number_max_ = 423;
const token_number_type undef_token_ = 2;
if (static_cast<int>(t) <= yyeof_)
@@ -1610,30 +1600,30 @@ namespace isc { namespace dhcp {
{
switch (other.type_get ())
{
case 187: // value
case 191: // map_value
case 231: // socket_type
case 234: // outbound_interface_value
case 256: // db_type
case 338: // hr_mode
case 492: // ncr_protocol_value
case 500: // replace_client_name_value
case 185: // value
case 189: // map_value
case 229: // socket_type
case 232: // outbound_interface_value
case 254: // db_type
case 336: // hr_mode
case 485: // ncr_protocol_value
case 493: // replace_client_name_value
value.copy< ElementPtr > (other.value);
break;
case 170: // "boolean"
case 168: // "boolean"
value.copy< bool > (other.value);
break;
case 169: // "floating point"
case 167: // "floating point"
value.copy< double > (other.value);
break;
case 168: // "integer"
case 166: // "integer"
value.copy< int64_t > (other.value);
break;
case 167: // "constant string"
case 165: // "constant string"
value.copy< std::string > (other.value);
break;
@@ -1654,30 +1644,30 @@ namespace isc { namespace dhcp {
(void) v;
switch (this->type_get ())
{
case 187: // value
case 191: // map_value
case 231: // socket_type
case 234: // outbound_interface_value
case 256: // db_type
case 338: // hr_mode
case 492: // ncr_protocol_value
case 500: // replace_client_name_value
case 185: // value
case 189: // map_value
case 229: // socket_type
case 232: // outbound_interface_value
case 254: // db_type
case 336: // hr_mode
case 485: // ncr_protocol_value
case 493: // replace_client_name_value
value.copy< ElementPtr > (v);
break;
case 170: // "boolean"
case 168: // "boolean"
value.copy< bool > (v);
break;
case 169: // "floating point"
case 167: // "floating point"
value.copy< double > (v);
break;
case 168: // "integer"
case 166: // "integer"
value.copy< int64_t > (v);
break;
case 167: // "constant string"
case 165: // "constant string"
value.copy< std::string > (v);
break;
@@ -1757,30 +1747,30 @@ namespace isc { namespace dhcp {
// Type destructor.
switch (yytype)
{
case 187: // value
case 191: // map_value
case 231: // socket_type
case 234: // outbound_interface_value
case 256: // db_type
case 338: // hr_mode
case 492: // ncr_protocol_value
case 500: // replace_client_name_value
case 185: // value
case 189: // map_value
case 229: // socket_type
case 232: // outbound_interface_value
case 254: // db_type
case 336: // hr_mode
case 485: // ncr_protocol_value
case 493: // replace_client_name_value
value.template destroy< ElementPtr > ();
break;
case 170: // "boolean"
case 168: // "boolean"
value.template destroy< bool > ();
break;
case 169: // "floating point"
case 167: // "floating point"
value.template destroy< double > ();
break;
case 168: // "integer"
case 166: // "integer"
value.template destroy< int64_t > ();
break;
case 167: // "constant string"
case 165: // "constant string"
value.template destroy< std::string > ();
break;
@@ -1807,30 +1797,30 @@ namespace isc { namespace dhcp {
super_type::move(s);
switch (this->type_get ())
{
case 187: // value
case 191: // map_value
case 231: // socket_type
case 234: // outbound_interface_value
case 256: // db_type
case 338: // hr_mode
case 492: // ncr_protocol_value
case 500: // replace_client_name_value
case 185: // value
case 189: // map_value
case 229: // socket_type
case 232: // outbound_interface_value
case 254: // db_type
case 336: // hr_mode
case 485: // ncr_protocol_value
case 493: // replace_client_name_value
value.move< ElementPtr > (s.value);
break;
case 170: // "boolean"
case 168: // "boolean"
value.move< bool > (s.value);
break;
case 169: // "floating point"
case 167: // "floating point"
value.move< double > (s.value);
break;
case 168: // "integer"
case 166: // "integer"
value.move< int64_t > (s.value);
break;
case 167: // "constant string"
case 165: // "constant string"
value.move< std::string > (s.value);
break;
@@ -1905,8 +1895,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, 416, 417, 418, 419, 420, 421, 422, 423, 424,
425
415, 416, 417, 418, 419, 420, 421, 422, 423
};
return static_cast<token_type> (yytoken_number_[type]);
}
@@ -2595,18 +2584,6 @@ namespace isc { namespace dhcp {
return symbol_type (token::TOKEN_QUEUE_CONTROL, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_QUEUE_TYPE (const location_type& l)
{
return symbol_type (token::TOKEN_QUEUE_TYPE, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_CAPACITY (const location_type& l)
{
return symbol_type (token::TOKEN_CAPACITY, l);
}
Dhcp4Parser::symbol_type
Dhcp4Parser::make_DHCP_DDNS (const location_type& l)
{
@@ -2928,7 +2905,7 @@ namespace isc { namespace dhcp {
#line 14 "dhcp4_parser.yy" // lalr1.cc:377
} } // isc::dhcp
#line 2932 "dhcp4_parser.h" // lalr1.cc:377
#line 2909 "dhcp4_parser.h" // lalr1.cc:377