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

[#42] Implemented PacketQueueMgr class

New files:
    src/lib/dhcp/packet_queue_mgr.h
    src/lib/dhcp/packet_queue_mgr4.cc
    src/lib/dhcp/packet_queue_mgr4.h
    src/lib/dhcp/packet_queue_mgr6.cc
    src/lib/dhcp/packet_queue_mgr6.h
    src/lib/dhcp/tests/packet_queue_mgr4_unittest.cc
    src/lib/dhcp/tests/packet_queue_mgr6_unittest.cc
    src/lib/dhcp/tests/packet_queue_testutils.h

src/bin/dhcp4/ctrl_dhcp4_srv.cc
    Cleaned up packet queue config block

src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/tests/config_parser_unittest.cc
    added queue-type

src/bin/dhcp4/dhcp4_messages.mes
    added DHCP4_CONFIG_PACKET_QUEUE message

src/lib/dhcp/Makefile.am
    packet_queue_mgr.h
    packet_queue_mgr4.cc packet_queue_mgr4.h
    packet_queue_mgr6.cc packet_queue_mgr6.h

src/lib/dhcp/iface_mgr.*
    Replaced packet queue members with PQM members
    Added PQM instantion to IfaceMgr ctor

src/lib/dhcp/packet_queue.h
    added getInfo,getInfoStr

src/lib/dhcp/tests/Makefile.am
    packet_queue_mgr4_unittest.cc
    packet_queue_mgr6_unittest.cc

src/lib/dhcpsrv/parsers/queue_control_parser.cc
    added queue-type
This commit is contained in:
Thomas Markwalder
2018-11-05 11:21:29 -05:00
parent 036d249fd1
commit 90fd7ebfaa
31 changed files with 3179 additions and 2449 deletions

View File

@@ -461,60 +461,61 @@ namespace isc { namespace dhcp {
TOKEN_SOCKET_TYPE = 368,
TOKEN_SOCKET_NAME = 369,
TOKEN_QUEUE_CONTROL = 370,
TOKEN_CAPACITY = 371,
TOKEN_DHCP_DDNS = 372,
TOKEN_ENABLE_UPDATES = 373,
TOKEN_QUALIFYING_SUFFIX = 374,
TOKEN_SERVER_IP = 375,
TOKEN_SERVER_PORT = 376,
TOKEN_SENDER_IP = 377,
TOKEN_SENDER_PORT = 378,
TOKEN_MAX_QUEUE_SIZE = 379,
TOKEN_NCR_PROTOCOL = 380,
TOKEN_NCR_FORMAT = 381,
TOKEN_ALWAYS_INCLUDE_FQDN = 382,
TOKEN_OVERRIDE_NO_UPDATE = 383,
TOKEN_OVERRIDE_CLIENT_UPDATE = 384,
TOKEN_REPLACE_CLIENT_NAME = 385,
TOKEN_GENERATED_PREFIX = 386,
TOKEN_TCP = 387,
TOKEN_JSON = 388,
TOKEN_WHEN_PRESENT = 389,
TOKEN_NEVER = 390,
TOKEN_ALWAYS = 391,
TOKEN_WHEN_NOT_PRESENT = 392,
TOKEN_HOSTNAME_CHAR_SET = 393,
TOKEN_HOSTNAME_CHAR_REPLACEMENT = 394,
TOKEN_LOGGING = 395,
TOKEN_LOGGERS = 396,
TOKEN_OUTPUT_OPTIONS = 397,
TOKEN_OUTPUT = 398,
TOKEN_DEBUGLEVEL = 399,
TOKEN_SEVERITY = 400,
TOKEN_FLUSH = 401,
TOKEN_MAXSIZE = 402,
TOKEN_MAXVER = 403,
TOKEN_DHCP6 = 404,
TOKEN_DHCPDDNS = 405,
TOKEN_CONTROL_AGENT = 406,
TOKEN_TOPLEVEL_JSON = 407,
TOKEN_TOPLEVEL_DHCP4 = 408,
TOKEN_SUB_DHCP4 = 409,
TOKEN_SUB_INTERFACES4 = 410,
TOKEN_SUB_SUBNET4 = 411,
TOKEN_SUB_POOL4 = 412,
TOKEN_SUB_RESERVATION = 413,
TOKEN_SUB_OPTION_DEFS = 414,
TOKEN_SUB_OPTION_DEF = 415,
TOKEN_SUB_OPTION_DATA = 416,
TOKEN_SUB_HOOKS_LIBRARY = 417,
TOKEN_SUB_DHCP_DDNS = 418,
TOKEN_SUB_LOGGING = 419,
TOKEN_SUB_CONFIG_CONTROL = 420,
TOKEN_STRING = 421,
TOKEN_INTEGER = 422,
TOKEN_FLOAT = 423,
TOKEN_BOOLEAN = 424
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
};
};
@@ -1085,6 +1086,10 @@ 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);
@@ -1506,12 +1511,12 @@ namespace isc { namespace dhcp {
enum
{
yyeof_ = 0,
yylast_ = 1005, ///< Last index in yytable_.
yynnts_ = 377, ///< Number of nonterminal symbols.
yylast_ = 1029, ///< Last index in yytable_.
yynnts_ = 379, ///< Number of nonterminal symbols.
yyfinal_ = 30, ///< Termination state number.
yyterror_ = 1,
yyerrcode_ = 256,
yyntokens_ = 170 ///< Number of tokens.
yyntokens_ = 171 ///< Number of tokens.
};
@@ -1570,9 +1575,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
165, 166, 167, 168, 169, 170
};
const unsigned int user_token_number_max_ = 424;
const unsigned int user_token_number_max_ = 425;
const token_number_type undef_token_ = 2;
if (static_cast<int>(t) <= yyeof_)
@@ -1605,30 +1610,30 @@ namespace isc { namespace dhcp {
{
switch (other.type_get ())
{
case 186: // value
case 190: // map_value
case 230: // socket_type
case 233: // outbound_interface_value
case 255: // db_type
case 337: // hr_mode
case 489: // ncr_protocol_value
case 497: // replace_client_name_value
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
value.copy< ElementPtr > (other.value);
break;
case 169: // "boolean"
case 170: // "boolean"
value.copy< bool > (other.value);
break;
case 168: // "floating point"
case 169: // "floating point"
value.copy< double > (other.value);
break;
case 167: // "integer"
case 168: // "integer"
value.copy< int64_t > (other.value);
break;
case 166: // "constant string"
case 167: // "constant string"
value.copy< std::string > (other.value);
break;
@@ -1649,30 +1654,30 @@ namespace isc { namespace dhcp {
(void) v;
switch (this->type_get ())
{
case 186: // value
case 190: // map_value
case 230: // socket_type
case 233: // outbound_interface_value
case 255: // db_type
case 337: // hr_mode
case 489: // ncr_protocol_value
case 497: // replace_client_name_value
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
value.copy< ElementPtr > (v);
break;
case 169: // "boolean"
case 170: // "boolean"
value.copy< bool > (v);
break;
case 168: // "floating point"
case 169: // "floating point"
value.copy< double > (v);
break;
case 167: // "integer"
case 168: // "integer"
value.copy< int64_t > (v);
break;
case 166: // "constant string"
case 167: // "constant string"
value.copy< std::string > (v);
break;
@@ -1752,30 +1757,30 @@ namespace isc { namespace dhcp {
// Type destructor.
switch (yytype)
{
case 186: // value
case 190: // map_value
case 230: // socket_type
case 233: // outbound_interface_value
case 255: // db_type
case 337: // hr_mode
case 489: // ncr_protocol_value
case 497: // replace_client_name_value
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
value.template destroy< ElementPtr > ();
break;
case 169: // "boolean"
case 170: // "boolean"
value.template destroy< bool > ();
break;
case 168: // "floating point"
case 169: // "floating point"
value.template destroy< double > ();
break;
case 167: // "integer"
case 168: // "integer"
value.template destroy< int64_t > ();
break;
case 166: // "constant string"
case 167: // "constant string"
value.template destroy< std::string > ();
break;
@@ -1802,30 +1807,30 @@ namespace isc { namespace dhcp {
super_type::move(s);
switch (this->type_get ())
{
case 186: // value
case 190: // map_value
case 230: // socket_type
case 233: // outbound_interface_value
case 255: // db_type
case 337: // hr_mode
case 489: // ncr_protocol_value
case 497: // replace_client_name_value
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
value.move< ElementPtr > (s.value);
break;
case 169: // "boolean"
case 170: // "boolean"
value.move< bool > (s.value);
break;
case 168: // "floating point"
case 169: // "floating point"
value.move< double > (s.value);
break;
case 167: // "integer"
case 168: // "integer"
value.move< int64_t > (s.value);
break;
case 166: // "constant string"
case 167: // "constant string"
value.move< std::string > (s.value);
break;
@@ -1900,7 +1905,8 @@ 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
415, 416, 417, 418, 419, 420, 421, 422, 423, 424,
425
};
return static_cast<token_type> (yytoken_number_[type]);
}
@@ -2589,6 +2595,12 @@ 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)
{
@@ -2916,7 +2928,7 @@ namespace isc { namespace dhcp {
#line 14 "dhcp4_parser.yy" // lalr1.cc:377
} } // isc::dhcp
#line 2920 "dhcp4_parser.h" // lalr1.cc:377
#line 2932 "dhcp4_parser.h" // lalr1.cc:377