]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2974] Addressed some comments
authorFrancis Dupont <fdupont@isc.org>
Sun, 20 Oct 2024 11:42:01 +0000 (13:42 +0200)
committerRazvan Becheriu <razvan@isc.org>
Wed, 23 Oct 2024 14:42:09 +0000 (17:42 +0300)
doc/sphinx/arm/ctrl-channel.rst
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

index 11a621d70a5600457d8def969d98128e4d8f65d8..239e92e70d2ab448c831d491ea41ff7248871ae6 100644 (file)
@@ -873,8 +873,9 @@ Commands Supported by the DHCPv4 Server
 The ``localize4`` Command
 -------------------------
 
-The :isccmd:`localize4` command returns the result of DHCPv4 subnet selection.
-Recognized entries take strings and are:
+The :isccmd:`localize4` provides a way to test DHCPv4 subnet selection based 
+on a set of input parameters typically supplied in a client packet.
+Recognized parameters take strings and are:
 
  -  ``interface`` - the incoming interface name
  -  ``address`` - the client address
@@ -901,8 +902,9 @@ Outside of errors possible results are:
 The ``localize4o6`` Command
 ---------------------------
 
-The :isccmd:`localize4o6` command returns the result of DHCPv4-over-DHCPv6
-subnet selection. Recognized entries take strings and are:
+The :isccmd:`localize4to5` provides a way to test DHCPv4-over-DHCPv6 subnet
+selection based  on a set of input parameters typically supplied in a client
+packet. Recognized parameters take strings and are:
 
  -  ``interface`` - the incoming interface name of the DHCPv6 server
  -  ``interface-id`` - the binary content of the interface-id relay option
@@ -935,8 +937,9 @@ Commands Supported by the DHCPv6 Server
 The ``localize6`` Command
 -------------------------
 
-The :isccmd:`localize6` command returns the result of DHCPv6 subnet selection.
-Recognized entries take strings and are:
+The :isccmd:`localize6` provides a way to test DHCPv6 subnet selection based 
+on a set of input parameters typically supplied in a client packet.
+Recognized parameters take strings and are:
 
  -  ``interface`` - the incoming interface name
  -  ``interface-id`` - the binary content of the interface-id relay option
index 8285d7a2d72fe1ab09153f31df7d0954eb606ac3..89e1b261f608d933dff8ae47ff360e309364f3b8 100644 (file)
@@ -848,7 +848,7 @@ ControlledDhcpv4Srv::commandLocalize4Handler(const string&,
     ConstSubnet4Ptr subnet = CfgMgr::instance().getCurrentCfg()->
         getCfgSubnets4()->selectSubnet(selector);
     if (!subnet) {
-        return (createAnswer(CONTROL_RESULT_EMPTY, "no selected subnet"));
+        return (createAnswer(CONTROL_RESULT_EMPTY, "no subnet selected"));
     }
     SharedNetwork4Ptr network;
     subnet->getSharedNetwork(network);
index 847cbf832f894a78ae3aeb59bc21bc18de5c9fbc..0972166fa1a6e31825e3f1f3c170d58fd03bba30 100644 (file)
@@ -2349,7 +2349,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4RAILinkSelect) {
                     "        \"link\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2400,7 +2400,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4SubnetSelect) {
                     "        \"subnet\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2452,7 +2452,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4RelayAddress) {
                     "        \"relay\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2503,7 +2503,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4Gateway) {
                     "        \"relay\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2554,7 +2554,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4Client) {
                     "        \"address\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2605,7 +2605,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4Remote) {
                     "        \"remote\": \"10.0.1.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2659,7 +2659,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4Iface) {
                     "        \"interface\": \"eth0\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Same interface: the subnet is selected.
@@ -2710,7 +2710,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4Class) {
                     "        \"address\": \"192.0.2.1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range and in guard: the subnet is selected.
@@ -3036,7 +3036,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4o6Remote) {
                     "        \"remote\": \"2001:db8:2::2\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -3092,7 +3092,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4o6RelayInterfaceId) {
                     "        \"interface-id\": \"'foobar'\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Same interface: the subnet is selected.
@@ -3145,7 +3145,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, localize4o6Iface) {
                     "        \"interface\": \"foobar\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Same interface: the subnet is selected.
index f6d5b32751b17ac3c163a0f9cce65fe8286d6798..d7b0acff94c6b13fbfa670c3842665b1fa86958f 100644 (file)
@@ -798,7 +798,7 @@ ControlledDhcpv6Srv::commandLocalize6Handler(const string&,
     ConstSubnet6Ptr subnet = CfgMgr::instance().getCurrentCfg()->
         getCfgSubnets6()->selectSubnet(selector);
     if (!subnet) {
-        return (createAnswer(CONTROL_RESULT_EMPTY, "no selected subnet"));
+        return (createAnswer(CONTROL_RESULT_EMPTY, "no subnet selected"));
     }
     SharedNetwork6Ptr network;
     subnet->getSharedNetwork(network);
index 1fd21ab3f0d6c4af8a715b261270d78473de9121..fec8263d4836ccbb87f390a7f739f8f3da6af23b 100644 (file)
@@ -2280,7 +2280,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, localize6Addr) {
                     "        \"remote\": \"fe80::abcd\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2332,7 +2332,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, localize6Iface) {
                     "        \"interface\": \"bar\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Same interface: the subnet is selected.
@@ -2383,7 +2383,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, localize6RelayLinkaddr) {
                     "        \"link\": \"2001:db8:2::2\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range: the subnet is selected.
@@ -2441,7 +2441,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, localize6RelayInterfaceId) {
                     "        \"interface-id\": \"'foobar'\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Same interface id: the subnet is selected.
@@ -2494,7 +2494,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, localize6Class) {
                     "        \"remote\": \"2001:db8:1::1\""
                     "    }"
                     "}", response);
-    EXPECT_EQ("{ \"result\": 3, \"text\": \"no selected subnet\" }",
+    EXPECT_EQ("{ \"result\": 3, \"text\": \"no subnet selected\" }",
               response);
 
     // Address in range and in guard: the subnet is selected.