2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-13 14:06:26 +00:00
Files
kea/src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc

214 lines
6.2 KiB
C++
Raw Normal View History

// Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
//
// 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
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <cc/data.h>
#include <dhcpsrv/cfgmgr.h>
#include <dhcpsrv/parsers/dhcp_queue_control_parser.h>
2020-08-02 13:30:34 +02:00
#include <testutils/multi_threading_utils.h>
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
#include <testutils/test_to_element.h>
2020-08-02 13:30:34 +02:00
#include <util/multi_threading_mgr.h>
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
#include <gtest/gtest.h>
using namespace isc::data;
using namespace isc::dhcp;
using namespace isc::test;
using namespace isc::util;
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
namespace {
/// @brief Test fixture class for @c DHCPQueueControlParser
class DHCPQueueControlParserTest : public ::testing::Test {
public:
/// @brief Constructor
DHCPQueueControlParserTest() = default;
/// @brief Destructor
virtual ~DHCPQueueControlParserTest() = default;
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
protected:
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
/// @brief Setup for each test.
///
/// Clears the configuration in the @c CfgMgr.
virtual void SetUp();
/// @brief Cleans up after each test.
///
/// Clears the configuration in the @c CfgMgr.
virtual void TearDown();
};
void
DHCPQueueControlParserTest::SetUp() {
CfgMgr::instance().clear();
}
void
DHCPQueueControlParserTest::TearDown() {
CfgMgr::instance().clear();
}
// Verifies that DHCPQueueControlParser handles
2021-01-22 01:36:41 +02:00
// expected valid dhcp-queue-control content
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
TEST_F(DHCPQueueControlParserTest, validContent) {
struct Scenario {
std::string description_;
std::string json_;
};
std::vector<Scenario> scenarios = {
{
"queue disabled",
"{ \n"
" \"enable-queue\": false \n"
"} \n"
},
{
"queue disabled, arbitrary content allowed",
"{ \n"
" \"enable-queue\": false, \n"
" \"foo\": \"bogus\", \n"
" \"random-int\" : 1234 \n"
"} \n"
},
{
"queue enabled, with queue-type",
"{ \n"
" \"enable-queue\": true, \n"
" \"queue-type\": \"some-type\" \n"
"} \n"
},
{
"queue enabled with queue-type and arbitrary content",
"{ \n"
" \"enable-queue\": true, \n"
" \"queue-type\": \"some-type\", \n"
" \"foo\": \"bogus\", \n"
" \"random-int\" : 1234 \n"
"} \n"
}
};
// Iterate over the valid scenarios and verify they succeed.
ConstElementPtr config_elems;
ConstElementPtr queue_control;
for (auto scenario : scenarios) {
SCOPED_TRACE(scenario.description_);
{
// Construct the config JSON
ASSERT_NO_THROW(config_elems = Element::fromJSON(scenario.json_))
<< "invalid JSON, test is broken";
// Parsing config into a queue control should succeed.
DHCPQueueControlParser parser;
try {
queue_control = parser.parse(config_elems);
} catch (const std::exception& ex) {
ADD_FAILURE() << "parser threw an exception: " << ex.what();
}
// Verify the resultant queue control.
ASSERT_TRUE(queue_control);
// The parser should have created a duplicate of the
// configuration elements.
ASSERT_TRUE(queue_control.get() != config_elems.get());
EXPECT_TRUE(queue_control->equals(*config_elems));
}
}
}
// Verifies that DHCPQueueControlParser correctly catches
// invalid dhcp-queue-control content
TEST_F(DHCPQueueControlParserTest, invalidContent) {
struct Scenario {
std::string description_;
std::string json_;
};
std::vector<Scenario> scenarios = {
{
"enable-queue missing",
"{ \n"
" \"enable-type\": \"some-type\" \n"
"} \n"
},
{
"enable-queue not boolean",
"{ \n"
" \"enable-queue\": \"always\" \n"
"} \n"
},
{
"queue enabled, type missing",
"{ \n"
" \"enable-queue\": true \n"
"} \n"
},
{
"queue enabled, type not a string",
"{ \n"
" \"enable-queue\": true, \n"
" \"queue-type\": 7777 \n"
"} \n"
}
};
2020-11-16 20:01:06 +02:00
// Iterate over the valid scenarios and verify they succeed.
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
ConstElementPtr config_elems;
2020-11-16 20:01:06 +02:00
ConstElementPtr queue_control;
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
for (auto scenario : scenarios) {
SCOPED_TRACE(scenario.description_);
{
// Construct the config JSON
ASSERT_NO_THROW(config_elems = Element::fromJSON(scenario.json_))
<< "invalid JSON, test is broken";
// Parsing config into a queue control should succeed.
DHCPQueueControlParser parser;
EXPECT_THROW(parser.parse(config_elems), DhcpConfigError);
}
}
}
// Verifies that DHCPQueueControlParser disables the queue when multi-threading
// is enabled
TEST_F(DHCPQueueControlParserTest, multiThreading) {
// Enable config with some queue type.
std::string config =
"{ \n"
" \"enable-queue\": true, \n"
" \"queue-type\": \"some-type\" \n"
"} \n";
// Construct the config JSON.
ConstElementPtr config_elems;
ASSERT_NO_THROW(config_elems = Element::fromJSON(config))
<< "invalid JSON, test is broken";
// Parse config.
DHCPQueueControlParser parser;
ConstElementPtr queue_control;
ASSERT_FALSE(MultiThreadingMgr::instance().getMode());
ASSERT_NO_THROW(queue_control = parser.parse(config_elems))
<< "parse fails, test is broken";
// Verify that queue is enabled.
ASSERT_TRUE(queue_control);
ASSERT_TRUE(queue_control->get("enable-queue"));
EXPECT_EQ("true", queue_control->get("enable-queue")->str());
// Retry with multi-threading.
2020-08-02 13:30:34 +02:00
MultiThreadingTest mt(true);
ASSERT_TRUE(MultiThreadingMgr::instance().getMode());
ASSERT_NO_THROW(queue_control = parser.parse(config_elems));
ASSERT_TRUE(queue_control);
ASSERT_TRUE(queue_control->get("enable-queue"));
EXPECT_EQ("false", queue_control->get("enable-queue")->str());
}
[#260,!20] Packet queueing is now optional src/bin/dhcp<4/6>/ctrl_dhcp<4/6>_srv.cc ControlledDhcpv<4/6>Srv::processConfig() - now calls IfaceMgr::configureDHCPPacketQueue src/bin/dhcp<4/6>/dhcp<4/6>_parser.yy dhpc-queue-control parsing updated to enforce enable-queue/queue-type rules src/bin/dhcp<4/6>/tests/config_parser_unittest.cc TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControl) TEST_F(Dhcp<4/6>ParserTest, dhcpQueueControlInvalid) src/lib/dhcp/iface_mgr.* IfaceMgr - closeSockets() - now calls stopDHCPReceiver - openSockets<4/6>() - now calls startDHCPReceiver - receive<4/6>Indirect() - new function which monitors receiver thread watch sockets, reads DHCP packets from queue - receive<4/6>Direct() - new function which monitors and reads DHCP packets from interface sockets directly - receive<4/6>() - rewritten to call receive<4/6>Indirect if receiver thread is running, otherwise it calls receive<4/6>Direct - configureDHCPPacketQueue() - new function which either enables queuing by creating a new packet queue, or disables it by destroying the existing queue src/lib/dhcp/packet_queue_mgr.h PacketQueue::destroyPacketQueue() - new function src/lib/dhcp/packet_queue_mgr<4/6>.cc PacketQueueMgr<4/6>::PacketQueueMgr<4/6>() - no longer creates a default packet queue src/lib/dhcpsrv/cfg_iface.cc CfgIface::closeSockets() - removed call to stopDHCPReceiver CfgIface::openSockets() - removed call to startDHCPReceiver src/lib/dhcpsrv/parsers/dhcp_queue_control_parser.* DHCPQueueControlParser - removed unused family_ member - parse() - added support for enable-queue src/lib/dhcpsrv/tests/dhcp_queue_control_parser_unittest.cc - new file
2018-11-10 13:20:22 -05:00
}; // anonymous namespace