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
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
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
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);
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.
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);
" \"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.
" \"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.
" \"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.
" \"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.
" \"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.