]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3144] addressed review comments
authorRazvan Becheriu <razvan@isc.org>
Thu, 14 May 2026 08:02:19 +0000 (11:02 +0300)
committerRazvan Becheriu <razvan@isc.org>
Mon, 18 May 2026 11:22:02 +0000 (14:22 +0300)
20 files changed:
doc/sphinx/api-files.txt
doc/sphinx/arm/ctrl-channel.rst
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/ctrl_dhcp4_srv.h
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/http_control_socket_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.h
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/http_control_socket_unittest.cc
src/bin/shell/tests/dhcp4_basic_auth_tests.sh.in
src/bin/shell/tests/dhcp6_basic_auth_tests.sh.in
src/bin/shell/tests/shell_dhcp4_process_tests.sh.in
src/bin/shell/tests/shell_dhcp6_process_tests.sh.in
src/bin/shell/tests/tls_dhcp4_process_tests.sh.in
src/bin/shell/tests/tls_dhcp6_process_tests.sh.in
src/lib/dhcpsrv/cfg_iface.cc
src/share/api/interface-add.json [moved from src/share/api/interface-use.json with 84% similarity]

index 50d0ff2fef7e98af11537e32208a47017c166eb7..4841b800591b466d6009deb6f249b96e4183d4d6 100644 (file)
@@ -45,7 +45,7 @@ src/share/api/ha-sync.json
 src/share/api/ha-sync-complete-notify.json
 src/share/api/interface-list.json
 src/share/api/interface-redetect.json
-src/share/api/interface-use.json
+src/share/api/interface-add.json
 src/share/api/kea-lfc-start.json
 src/share/api/lease4-add.json
 src/share/api/lease4-del.json
index d1f3bdd1742a8fb8cc1b9e460d0b71ee4a63b232..00a3caeb95e2f455a99063419101d33e2d8d0517 100644 (file)
@@ -503,13 +503,13 @@ The :isccmd:`interface-redetect` command retrieves the list of detected interfac
 after performing a re-detect procedure.
 This command does not take any parameters."
 
-.. isccmd:: interface-use
-.. _command-interface-use:
+.. isccmd:: interface-add
+.. _command-interface-add:
 
-The ``interface-use`` Command
+The ``interface-add`` Command
 -----------------------------
 
-The :isccmd:`interface-use` command updates the list of interfaces used
+The :isccmd:`interface-add` command updates the list of interfaces used
 to process DHCP traffic.
 The command takes as parameter the list of interfaces with respective
 addresses (if specified) on which the server should start listening for
index ba5dc6b222f19e8cf4ddbef8307d620638d78fff..6c9895563da4056499ee0f7e67cd64eeae58887b 100644 (file)
@@ -8007,7 +8007,7 @@ The DHCPv4 server supports the following operational commands:
 - :isccmd:`dhcp-enable`
 - :isccmd:`interface-list`
 - :isccmd:`interface-redetect`
-- :isccmd:`interface-use`
+- :isccmd:`interface-add`
 - :isccmd:`leases-reclaim`
 - :isccmd:`list-commands`
 - :isccmd:`shutdown`
index aab3bc79512abc9d5d89b16054c522c95a09e60b..0db8298001c61c6db8a6724f5802d6941dfee3b2 100644 (file)
@@ -7986,7 +7986,7 @@ The DHCPv6 server supports the following operational commands:
 - :isccmd:`dhcp-enable`
 - :isccmd:`interface-list`
 - :isccmd:`interface-redetect`
-- :isccmd:`interface-use`
+- :isccmd:`interface-add`
 - :isccmd:`leases-reclaim`
 - :isccmd:`list-commands`
 - :isccmd:`shutdown`
index 59131d78e23b4a986fabf84e3e2ead1bcbd69169..4509c978984dfa8d6954afd45bea52ae2dd93dab 100644 (file)
@@ -679,9 +679,11 @@ ControlledDhcpv4Srv::commandDhcpEnableHandler(const std::string&,
 ConstElementPtr
 ControlledDhcpv4Srv::commandInterfaceListHandler(const std::string&,
                                                  ConstElementPtr) {
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     ElementPtr ifaces = Element::createMap();
-    bool error = false;
     std::string message;
+    bool error = false;
     try {
         ifaces->set("interfaces", IfaceMgr::instance().ifacesToElement());
     } catch (const std::exception& ex) {
@@ -706,8 +708,10 @@ ControlledDhcpv4Srv::commandInterfaceListHandler(const std::string&,
 ConstElementPtr
 ControlledDhcpv4Srv::commandInterfaceRedetectHandler(const std::string&,
                                                      ConstElementPtr args) {
-    bool error = false;
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     std::string message;
+    bool error = false;
     try {
         IfaceMgr::instance().detectIfaces(true);
     } catch (const std::exception& ex) {
@@ -728,16 +732,18 @@ ControlledDhcpv4Srv::commandInterfaceRedetectHandler(const std::string&,
 }
 
 ConstElementPtr
-ControlledDhcpv4Srv::commandInterfaceUseHandler(const std::string&,
+ControlledDhcpv4Srv::commandInterfaceAddHandler(const std::string&,
                                                 ConstElementPtr args) {
-    bool error = false;
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     string message;
+    bool error = false;
     ConstElementPtr ifaces_config;
     if (!args) {
         message = "Missing mandatory 'arguments' parameter.";
     } else {
         if (args->getType() != Element::map) {
-            message = "arguments for the 'interface-use' command must be a map";
+            message = "arguments for the 'interface-add' command must be a map";
         } else {
             ifaces_config = args->get("interfaces");
             if (!ifaces_config) {
@@ -756,10 +762,30 @@ ControlledDhcpv4Srv::commandInterfaceUseHandler(const std::string&,
     if (!message.empty()) {
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, message));
     }
+    if (!ifaces_config->size()) {
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+    }
     try {
+        ElementPtr mutable_cfg = boost::const_pointer_cast<Element>(args);
         CfgIfacePtr running_cfg_iface = CfgMgr::instance().getCurrentCfg()->getCfgIface();
         ElementPtr mutable_running_cfg = running_cfg_iface->toElement();
-        merge(mutable_running_cfg, args);
+        auto const& element_empty = [](ElementPtr&) {
+            return (true);
+        };
+        auto const& element_match_any = [](ElementPtr&, ElementPtr&) -> bool {
+            return (true);
+        };
+        auto const& element_match = [](ElementPtr& left, ElementPtr& right) -> bool {
+            return (left->stringValue() == right->stringValue());
+        };
+        auto const& element_is_key = [](const std::string& key) -> bool {
+            return (key == "interfaces");
+        };
+        isc::data::HierarchyDescriptor hierarchy = {
+            { { "interfaces-config", { element_match_any, element_empty, element_is_key } } },
+            { { "interfaces", { element_match, element_empty, element_is_key } } }
+        };
+        mergeDiffAdd(mutable_running_cfg, mutable_cfg, hierarchy, "interfaces");
         IfacesConfigParser parser(AF_INET, true);
         CfgIfacePtr cfg_iface(new CfgIface());
         parser.parseInterfacesList(cfg_iface, mutable_running_cfg->get("interfaces"));
@@ -1640,8 +1666,8 @@ ControlledDhcpv4Srv::ControlledDhcpv4Srv(uint16_t server_port /*= DHCP4_SERVER_P
     CommandMgr::instance().registerCommand("interface-redetect",
         std::bind(&ControlledDhcpv4Srv::commandInterfaceRedetectHandler, this, ph::_1, ph::_2));
 
-    CommandMgr::instance().registerCommand("interface-use",
-        std::bind(&ControlledDhcpv4Srv::commandInterfaceUseHandler, this, ph::_1, ph::_2));
+    CommandMgr::instance().registerCommand("interface-add",
+        std::bind(&ControlledDhcpv4Srv::commandInterfaceAddHandler, this, ph::_1, ph::_2));
 
     CommandMgr::instance().registerCommand("kea-lfc-start",
         std::bind(&ControlledDhcpv4Srv::commandLfcStartHandler, this, ph::_1, ph::_2));
@@ -1741,7 +1767,7 @@ ControlledDhcpv4Srv::~ControlledDhcpv4Srv() {
         CommandMgr::instance().deregisterCommand("dhcp-enable");
         CommandMgr::instance().deregisterCommand("interface-list");
         CommandMgr::instance().deregisterCommand("interface-redetect");
-        CommandMgr::instance().deregisterCommand("interface-use");
+        CommandMgr::instance().deregisterCommand("interface-add");
         CommandMgr::instance().deregisterCommand("kea-lfc-start");
         CommandMgr::instance().deregisterCommand("leases-reclaim");
         CommandMgr::instance().deregisterCommand("subnet4-select-test");
index f3c5b856f2feca152ac7181351afadbcdd410d49..2fd9d2cbafcd726199ef1e4e1d713ecb5e6b47ac 100644 (file)
@@ -262,16 +262,16 @@ private:
     commandInterfaceRedetectHandler(const std::string& command,
                                     isc::data::ConstElementPtr args);
 
-    /// @brief Handler for processing 'interface-use' command
+    /// @brief Handler for processing 'interface-add' command
     ///
-    /// This handler processes interface-use command.
+    /// This handler processes interface-add command.
     ///
     /// @param command (parameter ignored)
     /// @param args arguments for the command.
     ///
     /// @return status of the command with the result
     isc::data::ConstElementPtr
-    commandInterfaceUseHandler(const std::string& command,
+    commandInterfaceAddHandler(const std::string& command,
                                isc::data::ConstElementPtr args);
 
     /// @Brief handler for processing 'version-get' command
index 7d2abbfbed611d2d4ac1ad962e2cbe9709aff4a1..577f9dfb1dfed13cbdfddc80a1977bf4ef838a69 100644 (file)
@@ -553,7 +553,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, commandsRegistration) {
     EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"interface-list\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"interface-redetect\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"interface-use\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"interface-add\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"kea-lfc-start\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"subnet4-select-test\"") != string::npos);
@@ -1877,7 +1877,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, listCommands) {
     checkListCommands(rsp, "config-write");
     checkListCommands(rsp, "interface-list");
     checkListCommands(rsp, "interface-redetect");
-    checkListCommands(rsp, "interface-use");
+    checkListCommands(rsp, "interface-add");
     checkListCommands(rsp, "kea-lfc-start");
     checkListCommands(rsp, "list-commands");
     checkListCommands(rsp, "leases-reclaim");
@@ -2555,8 +2555,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, interfaceRedetect) {
     EXPECT_EQ(response, expected);
 }
 
-// Tests if interface-use works properly.
-TEST_F(CtrlChannelDhcpv4SrvTest, interfaceUse) {
+// Tests if interface-add works properly.
+TEST_F(CtrlChannelDhcpv4SrvTest, interfaceAdd) {
     interfaces_ = "";
     IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", ETH0_INDEX,
                                                     "11:22:33:44:55:66");
@@ -2579,7 +2579,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, interfaceUse) {
     SKIP_IF(skipped_);
     std::string response;
 
-    std::string command = "{ \"command\": \"interface-use\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
+    std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendUnixCommand(command, response);
     EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Configuration successful.\" }");
index c01a478e83a3d616e4ffed4206c02afc94cb5c34..880f2ccc642319a63825a52698abc31791301e47 100644 (file)
@@ -581,8 +581,8 @@ public:
     // Tests if interface-redetect works properly.
     void testInterfaceRedetect();
 
-    // Tests if interface-use works properly.
-    void testInterfaceUse();
+    // Tests if interface-add works properly.
+    void testInterfaceAdd();
 
     // This test verifies that disable DHCP service command performs
     // sanity check on parameters.
@@ -2982,7 +2982,7 @@ BaseCtrlChannelDhcpv4Test::testListCommands() {
     checkListCommands(rsp, "config-write");
     checkListCommands(rsp, "interface-list");
     checkListCommands(rsp, "interface-redetect");
-    checkListCommands(rsp, "interface-use");
+    checkListCommands(rsp, "interface-add");
     checkListCommands(rsp, "kea-lfc-start");
     checkListCommands(rsp, "list-commands");
     checkListCommands(rsp, "leases-reclaim");
@@ -3780,9 +3780,9 @@ TEST_F(HttpsCtrlChannelDhcpv4Test, interfaceRedetect) {
     testInterfaceRedetect();
 }
 
-// Tests if interface-use works properly.
+// Tests if interface-add works properly.
 void
-BaseCtrlChannelDhcpv4Test::testInterfaceUse() {
+BaseCtrlChannelDhcpv4Test::testInterfaceAdd() {
     interfaces_ = "";
     IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", ETH0_INDEX,
                                                     "11:22:33:44:55:66");
@@ -3804,7 +3804,7 @@ BaseCtrlChannelDhcpv4Test::testInterfaceUse() {
     IfaceMgr::instance().setPacketFilter(filter);
     std::string response;
 
-    std::string command = "{ \"command\": \"interface-use\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
+    std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendHttpCommand(command, response);
     EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Configuration successful.\" } ]");
@@ -3827,12 +3827,12 @@ BaseCtrlChannelDhcpv4Test::testInterfaceUse() {
     EXPECT_EQ(response, expected);
 }
 
-TEST_F(HttpCtrlChannelDhcpv4Test, interfaceUse) {
-    testInterfaceUse();
+TEST_F(HttpCtrlChannelDhcpv4Test, interfaceAdd) {
+    testInterfaceAdd();
 }
 
-TEST_F(HttpsCtrlChannelDhcpv4Test, interfaceUse) {
-    testInterfaceUse();
+TEST_F(HttpsCtrlChannelDhcpv4Test, interfaceAdd) {
+    testInterfaceAdd();
 }
 
 // This test verifies that disable DHCP service command performs
index 830f0c91446c10a0d4628ed2ab16821bbea4a141..73a12ba146a10e13ce6b0a42877343c9eeae7b6e 100644 (file)
@@ -682,9 +682,11 @@ ControlledDhcpv6Srv::commandDhcpEnableHandler(const std::string&,
 ConstElementPtr
 ControlledDhcpv6Srv::commandInterfaceListHandler(const std::string&,
                                                  ConstElementPtr) {
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     ElementPtr ifaces = Element::createMap();
-    bool error = false;
     std::string message;
+    bool error = false;
     try {
         ifaces->set("interfaces", IfaceMgr::instance().ifacesToElement());
     } catch (const std::exception& ex) {
@@ -709,8 +711,10 @@ ControlledDhcpv6Srv::commandInterfaceListHandler(const std::string&,
 ConstElementPtr
 ControlledDhcpv6Srv::commandInterfaceRedetectHandler(const std::string&,
                                                      ConstElementPtr args) {
-    bool error = false;
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     std::string message;
+    bool error = false;
     try {
         IfaceMgr::instance().detectIfaces(true);
     } catch (const std::exception& ex) {
@@ -731,16 +735,18 @@ ControlledDhcpv6Srv::commandInterfaceRedetectHandler(const std::string&,
 }
 
 ConstElementPtr
-ControlledDhcpv6Srv::commandInterfaceUseHandler(const std::string&,
+ControlledDhcpv6Srv::commandInterfaceAddHandler(const std::string&,
                                                 ConstElementPtr args) {
-    bool error = false;
+    // stop thread pool (if running)
+    MultiThreadingCriticalSection cs;
     string message;
+    bool error = false;
     ConstElementPtr ifaces_config;
     if (!args) {
         message = "Missing mandatory 'arguments' parameter.";
     } else {
         if (args->getType() != Element::map) {
-            message = "arguments for the 'interface-use' command must be a map";
+            message = "arguments for the 'interface-add' command must be a map";
         } else {
             ifaces_config = args->get("interfaces");
             if (!ifaces_config) {
@@ -759,10 +765,30 @@ ControlledDhcpv6Srv::commandInterfaceUseHandler(const std::string&,
     if (!message.empty()) {
         return (isc::config::createAnswer(CONTROL_RESULT_ERROR, message));
     }
+    if (!ifaces_config->size()) {
+        return (isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful."));
+    }
     try {
+        ElementPtr mutable_cfg = boost::const_pointer_cast<Element>(args);
         CfgIfacePtr running_cfg_iface = CfgMgr::instance().getCurrentCfg()->getCfgIface();
         ElementPtr mutable_running_cfg = running_cfg_iface->toElement();
-        merge(mutable_running_cfg, args);
+        auto const& element_empty = [](ElementPtr&) {
+            return (true);
+        };
+        auto const& element_match_any = [](ElementPtr&, ElementPtr&) -> bool {
+            return (true);
+        };
+        auto const& element_match = [](ElementPtr& left, ElementPtr& right) -> bool {
+            return (left->stringValue() == right->stringValue());
+        };
+        auto const& element_is_key = [](const std::string& key) -> bool {
+            return (key == "interfaces");
+        };
+        isc::data::HierarchyDescriptor hierarchy = {
+            { { "interfaces-config", { element_match_any, element_empty, element_is_key } } },
+            { { "interfaces", { element_match, element_empty, element_is_key } } }
+        };
+        mergeDiffAdd(mutable_running_cfg, mutable_cfg, hierarchy, "interfaces");
         IfacesConfigParser parser(AF_INET6, true);
         CfgIfacePtr cfg_iface(new CfgIface());
         parser.parseInterfacesList(cfg_iface, mutable_running_cfg->get("interfaces"));
@@ -1430,8 +1456,8 @@ ControlledDhcpv6Srv::ControlledDhcpv6Srv(uint16_t server_port /*= DHCP6_SERVER_P
     CommandMgr::instance().registerCommand("interface-redetect",
         std::bind(&ControlledDhcpv6Srv::commandInterfaceRedetectHandler, this, ph::_1, ph::_2));
 
-    CommandMgr::instance().registerCommand("interface-use",
-        std::bind(&ControlledDhcpv6Srv::commandInterfaceUseHandler, this, ph::_1, ph::_2));
+    CommandMgr::instance().registerCommand("interface-add",
+        std::bind(&ControlledDhcpv6Srv::commandInterfaceAddHandler, this, ph::_1, ph::_2));
 
     CommandMgr::instance().registerCommand("kea-lfc-start",
         std::bind(&ControlledDhcpv6Srv::commandLfcStartHandler, this, ph::_1, ph::_2));
@@ -1528,7 +1554,7 @@ ControlledDhcpv6Srv::~ControlledDhcpv6Srv() {
         CommandMgr::instance().deregisterCommand("dhcp-enable");
         CommandMgr::instance().deregisterCommand("interface-list");
         CommandMgr::instance().deregisterCommand("interface-redetect");
-        CommandMgr::instance().deregisterCommand("interface-use");
+        CommandMgr::instance().deregisterCommand("interface-add");
         CommandMgr::instance().deregisterCommand("kea-lfc-start");
         CommandMgr::instance().deregisterCommand("leases-reclaim");
         CommandMgr::instance().deregisterCommand("subnet6-select-test");
index ccdcde3ea6c51c7db181209b94e2f93365bc3ae6..e8e70d85cdec9479ebc2928123e152713c565036 100644 (file)
@@ -262,16 +262,16 @@ private:
     commandInterfaceRedetectHandler(const std::string& command,
                                     isc::data::ConstElementPtr args);
 
-    /// @brief Handler for processing 'interface-use' command
+    /// @brief Handler for processing 'interface-add' command
     ///
-    /// This handler processes interface-use command.
+    /// This handler processes interface-add command.
     ///
     /// @param command (parameter ignored)
     /// @param args arguments for the command.
     ///
     /// @return status of the command with the result
     isc::data::ConstElementPtr
-    commandInterfaceUseHandler(const std::string& command,
+    commandInterfaceAddHandler(const std::string& command,
                                isc::data::ConstElementPtr args);
 
     /// @Brief handler for processing 'version-get' command
index 2a6995c7136b9163961e82ffeed988ba7c4ffec2..fb19537bbb2d9037730dc64a1cf1e7fbc7285127 100644 (file)
@@ -556,7 +556,7 @@ TEST_F(CtrlDhcpv6SrvTest, commandsRegistration) {
     EXPECT_TRUE(command_list.find("\"config-write\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"interface-list\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"interface-redetect\"") != string::npos);
-    EXPECT_TRUE(command_list.find("\"interface-use\"") != string::npos);
+    EXPECT_TRUE(command_list.find("\"interface-add\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"kea-lfc-start\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"leases-reclaim\"") != string::npos);
     EXPECT_TRUE(command_list.find("\"subnet6-select-test\"") != string::npos);
@@ -1877,7 +1877,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, listCommands) {
     checkListCommands(rsp, "config-write");
     checkListCommands(rsp, "interface-list");
     checkListCommands(rsp, "interface-redetect");
-    checkListCommands(rsp, "interface-use");
+    checkListCommands(rsp, "interface-add");
     checkListCommands(rsp, "kea-lfc-start");
     checkListCommands(rsp, "list-commands");
     checkListCommands(rsp, "leases-reclaim");
@@ -2549,8 +2549,8 @@ TEST_F(CtrlChannelDhcpv6SrvTest, interfaceRedetect) {
     EXPECT_EQ(response, expected);
 }
 
-// Tests if interface-use works properly.
-TEST_F(CtrlChannelDhcpv6SrvTest, interfaceUse) {
+// Tests if interface-add works properly.
+TEST_F(CtrlChannelDhcpv6SrvTest, interfaceAdd) {
     interfaces_ = "";
     IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", ETH0_INDEX,
                                                     "11:22:33:44:55:66");
@@ -2573,7 +2573,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, interfaceUse) {
     SKIP_IF(skipped_);
     std::string response;
 
-    std::string command = "{ \"command\": \"interface-use\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
+    std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendUnixCommand(command, response);
     EXPECT_EQ(response, "{ \"result\": 0, \"text\": \"Configuration successful.\" }");
index 5d66fa0f2d2f1b91c9c00c410fb9e3ccc8ebc771..f532cae51c40d51669618c6f55061b9205e55a09 100644 (file)
@@ -590,8 +590,8 @@ public:
     // Tests if interface-redetect works properly.
     void testInterfaceRedetect();
 
-    // Tests if interface-use works properly.
-    void testInterfaceUse();
+    // Tests if interface-add works properly.
+    void testInterfaceAdd();
 
     // This test verifies that disable DHCP service command performs
     // sanity check on parameters.
@@ -2980,7 +2980,7 @@ BaseCtrlChannelDhcpv6Test::testListCommands() {
     checkListCommands(rsp, "config-write");
     checkListCommands(rsp, "interface-list");
     checkListCommands(rsp, "interface-redetect");
-    checkListCommands(rsp, "interface-use");
+    checkListCommands(rsp, "interface-add");
     checkListCommands(rsp, "kea-lfc-start");
     checkListCommands(rsp, "list-commands");
     checkListCommands(rsp, "leases-reclaim");
@@ -3772,9 +3772,9 @@ TEST_F(HttpsCtrlChannelDhcpv6Test, interfaceRedetect) {
     testInterfaceRedetect();
 }
 
-// Tests if interface-use works properly.
+// Tests if interface-add works properly.
 void
-BaseCtrlChannelDhcpv6Test::testInterfaceUse() {
+BaseCtrlChannelDhcpv6Test::testInterfaceAdd() {
     interfaces_ = "";
     IfacePtr eth0 = IfaceMgrTestConfig::createIface("eth0", ETH0_INDEX,
                                                     "11:22:33:44:55:66");
@@ -3796,7 +3796,7 @@ BaseCtrlChannelDhcpv6Test::testInterfaceUse() {
     IfaceMgr::instance().setPacketFilter(filter);
     std::string response;
 
-    std::string command = "{ \"command\": \"interface-use\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
+    std::string command = "{ \"command\": \"interface-add\", \"arguments\": { \"interfaces\": [ \"eth0\" ] } }";
 
     sendHttpCommand(command, response);
     EXPECT_EQ(response, "[ { \"result\": 0, \"text\": \"Configuration successful.\" } ]");
@@ -3819,12 +3819,12 @@ BaseCtrlChannelDhcpv6Test::testInterfaceUse() {
     EXPECT_EQ(response, expected);
 }
 
-TEST_F(HttpCtrlChannelDhcpv6Test, interfaceUse) {
-    testInterfaceUse();
+TEST_F(HttpCtrlChannelDhcpv6Test, interfaceAdd) {
+    testInterfaceAdd();
 }
 
-TEST_F(HttpsCtrlChannelDhcpv6Test, interfaceUse) {
-    testInterfaceUse();
+TEST_F(HttpsCtrlChannelDhcpv6Test, interfaceAdd) {
+    testInterfaceAdd();
 }
 
 // This test verifies that disable DHCP service command performs
index b2cd1a8915c4893ad3f551ff124bfae2d484ee98..6b56adab54a9b24340313d48f5aee3d9db7e5254 100755 (executable)
@@ -229,7 +229,7 @@ shell_command_test "shell.bad-auth" \
     "Failed to run: HTTP Error 401: Unauthorized"
 shell_command_test "shell.authorized" \
     "--auth-user pet --auth-password meow" "list-commands" "" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 shell_command_test "shell.bad-auth-password-file" \
     "--auth-user foo --auth-password-file foobar" "list-commands" "fail" \
     "Failed to run: [Errno 2] No such file or directory: 'foobar'"
@@ -238,7 +238,7 @@ shell_command_test "shell.bad-auth-password-file-content" \
     "Failed to run: HTTP Error 401: Unauthorized"
 shell_command_test "shell.good-auth-password-file-content" \
     "--auth-user pet --auth-password-file ${tmpfile_path}/auth_password_file" "list-commands" "" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 shell_command_test "shell.flag-precedence" \
     "--auth-user pet --auth-password meow --auth-password-file ${tmpfile_path}/auth_bad_password_file" "list-commands" "fail" \
     "Failed to run: HTTP Error 401: Unauthorized"
index df7a816977b86b13a36b53a8c9f8dc64fc2d5146..7cee3fab14fa33625b5dd958f6826e61c38b2e33 100755 (executable)
@@ -234,7 +234,7 @@ shell_command_test "shell.bad-auth" \
     "Failed to run: HTTP Error 401: Unauthorized"
 shell_command_test "shell.authorized" \
     "--auth-user pet --auth-password meow" "list-commands" "" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 shell_command_test "shell.bad-auth-password-file" \
     "--auth-user foo --auth-password-file foobar" "list-commands" "fail" \
     "Failed to run: [Errno 2] No such file or directory: 'foobar'"
@@ -243,7 +243,7 @@ shell_command_test "shell.bad-auth-password-file-content" \
     "Failed to run: HTTP Error 401: Unauthorized"
 shell_command_test "shell.good-auth-password-file-content" \
     "--auth-user pet --auth-password-file ${tmpfile_path}/auth_password_file" "list-commands" "" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 shell_command_test "shell.flag-precedence" \
     "--auth-user pet --auth-password meow --auth-password-file ${tmpfile_path}/auth_bad_password_file" "list-commands" "fail" \
     "Failed to run: HTTP Error 401: Unauthorized"
index 3bc1968968e5c1cfdc35e26e2320ad4681cc03ac..4b40deeb643957ba15c3c49febd7a0f5aa6fd152 100755 (executable)
@@ -195,7 +195,7 @@ shell_command_test() {
 }
 
 shell_command_test "shell.list-commands" "list-commands" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]" ""
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]" ""
 shell_command_test "shell.bogus" "give-me-a-beer" \
 "[ { \"result\": 2, \"text\": \"'give-me-a-beer' command not supported.\" } ]" ""
 shell_command_test "shell.empty-config-test" "config-test" \
index 12d672e12758b8476cb0d14eaa09570f14a354a7..70b9760bdb593f46ae16896597ff44f6e2806647 100755 (executable)
@@ -200,7 +200,7 @@ shell_command_test() {
 }
 
 shell_command_test "shell.list-commands" "list-commands" \
-    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]" ""
+    "[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]" ""
 shell_command_test "shell.bogus" "give-me-a-beer" \
 "[ { \"result\": 2, \"text\": \"'give-me-a-beer' command not supported.\" } ]" ""
 shell_command_test "shell.empty-config-test" "config-test" \
index 882020e751888a172140334b388e216c4ae24db3..f51ae351048991b42500c4e8efdb1045432fc91d 100755 (executable)
@@ -306,10 +306,10 @@ list_commands_test() {
 }
 
 list_commands_test "NoTLS" "${CONFIG_NONE}" "" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 list_commands_test "Encrypted" "${CONFIG_NOCR}" \
 "--ca ${TEST_CA_DIR}/kea-ca.crt" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 list_commands_test "Authenticated" "${CONFIG}" \
 "--ca ${TEST_CA_DIR}/kea-ca.crt --cert ${TEST_CA_DIR}/kea-client.crt --key ${TEST_CA_DIR}/kea-client.key" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet4-select-test\", \"subnet4o6-select-test\", \"version-get\" ], \"result\": 0 } ]"
index 0c194c279ae854ab29ba0846d9b0703532f26090..0196bad6c3ecf790a5f2589c9f388cbd172a0061 100755 (executable)
@@ -321,10 +321,10 @@ list_commands_test() {
 }
 
 list_commands_test "NoTLS" "${CONFIG_NONE}" "" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 list_commands_test "Encrypted" "${CONFIG_NOCR}" \
 "--ca ${TEST_CA_DIR}/kea-ca.crt" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
 list_commands_test "Authenticated" "${CONFIG}" \
 "--ca ${TEST_CA_DIR}/kea-ca.crt --cert ${TEST_CA_DIR}/kea-client.crt --key ${TEST_CA_DIR}/kea-client.key" \
-"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-use\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
+"[ { \"arguments\": [ \"build-report\", \"config-backend-pull\", \"config-get\", \"config-hash-get\", \"config-reload\", \"config-set\", \"config-test\", \"config-write\", \"dhcp-disable\", \"dhcp-enable\", \"interface-list\", \"interface-redetect\", \"interface-add\", \"kea-lfc-start\", \"leases-reclaim\", \"list-commands\", \"server-tag-get\", \"shutdown\", \"statistic-get\", \"statistic-get-all\", \"statistic-global-get-all\", \"statistic-remove\", \"statistic-remove-all\", \"statistic-reset\", \"statistic-reset-all\", \"statistic-sample-age-set\", \"statistic-sample-age-set-all\", \"statistic-sample-count-set\", \"statistic-sample-count-set-all\", \"status-get\", \"subnet6-select-test\", \"version-get\" ], \"result\": 0 } ]"
index c07ef0c4ff9400452d787bb8faa00f581a2c8152..b7ff6277b2aa5a88880c8a43535096c5f351bfa4 100644 (file)
@@ -102,6 +102,8 @@ CfgIface::triggerOpenSocketsWithRetry(const uint16_t family, const uint16_t port
     // we only handle the relayed (unicast) traffic.
     const bool can_use_bcast = use_bcast && (socket_type_ == SOCKET_RAW);
 
+    reconnect_ctl_->resetRetries();
+
     openSocketsWithRetry(reconnect_ctl_, family, port, can_use_bcast);
 }
 
similarity index 84%
rename from src/share/api/interface-use.json
rename to src/share/api/interface-add.json
index 126f5932eea24c1fdff2a07ce7e6474fd4bc9c71..df9311c8945d11f45e94860f7d4cb25e255d9c3c 100644 (file)
@@ -9,14 +9,14 @@
     ],
     "cmd-syntax": [
         "{",
-        "    \"command\": \"interface-use\",",
+        "    \"command\": \"interface-add\",",
         "    \"arguments\": {",
         "        \"interfaces\": [ \"eth0/10.10.1.1\", \"eth0/192.168.1.1\", \"eth1\"]",
         "    }",
         "}"
     ],
-    "description": "See <xref linkend=\"command-interface-use\"/>",
-    "name": "interface-use",
+    "description": "See <xref linkend=\"command-interface-add\"/>",
+    "name": "interface-add",
     "resp-syntax": [
         "{",
         "    \"result\": 0,",