+2231. [func] fdupont
+ The "ip-address" parameter in the "relay" element
+ is no longer supported: it was replaced by
+ "ip-addresses" taking a list of addresses in Kea 1.4.
+ (Gitlab #3378)
+
2230. [func] tmark
Both kea-dhcp4 and kea-dhcp6 will now emit a INFO
level log statement for each packet received and
// valid cases when it makes sense. One case is when there
// is a shared subnet.
"relay": {
- "ip-address": "192.168.1.1"
+ "ip-addresses": [ "192.168.1.1" ]
}
},
{
// This subnet will be selected for queries coming from the following
// IP address.
- "relay": { "ip-address": "192.168.56.1" }
+ "relay": { "ip-addresses": [ "192.168.56.1" ] }
}
],
// This subnet will be selected for queries coming from the following
// IP address.
- "relay": { "ip-address": "192.168.56.1" }
+ "relay": { "ip-addresses": [ "192.168.56.1" ] }
}
],
// It would be better to skip the relay scope altogether, but
// it was left here for demonstration purposes.
"relay": {
- "ip-address": "0.0.0.0"
+ "ip-addresses": [ "0.0.0.0" ]
},
// Timer values can be overridden here.
// here if your relay uses different IP addresses for
// each subnet.
"relay": {
- "ip-address": "0.0.0.0"
+ "ip-addresses": [ "0.0.0.0" ]
},
"renew-timer": 10,
// "reservation-mode": "all",
// makes sense. One case is when the relay has only link-local address
// and another is when there is a shared subnet scenario.
"relay": {
- "ip-address": "3000::1"
+ "ip-addresses": [ "3000::1" ]
}
}
],
"rapid-commit": true,
"rebind-timer": 150,
"relay": {
- "ip-address": "2001:db8::1"
+ "ip-addresses": [ "2001:db8::1" ]
},
"renew-timer": 100,
"rebind-timer": 20,
// It is possible to override some values here.
"relay": {
- "ip-address": "2001:db8:1::123"
+ "ip-addresses": [ "2001:db8:1::123" ]
},
"renew-timer": 10,
// "reservation-mode": "all",
"rapid-commit": false,
"rebind-timer": 20,
"relay": {
- "ip-address": "3000::1"
+ "ip-addresses": [ "3000::1" ]
},
"renew-timer": 10,
// "reservation-mode": "all",
" \"rebind-timer\": 2, "
" \"valid-lifetime\": 4,"
" \"relay\": { "
- " \"ip-address\": \"192.0.2.123\""
+ " \"ip-addresses\": [ \"192.0.2.123\" ]"
" },"
" \"subnet\": \"192.0.2.0/24\" } ],"
"\"valid-lifetime\": 4000 }";
" \"boot-file-name\": \"bar\",\n"
" \"store-extended-info\": true,\n"
" \"relay\": {\n"
- " \"ip-address\": \"5.6.7.8\"\n"
+ " \"ip-addresses\": [ \"5.6.7.8\" ]\n"
" },\n"
" \"reservations-global\": false,\n"
" \"reservations-in-subnet\": false,\n"
" \"server-hostname\": \"some-name.example.org\",\n"
" \"boot-file-name\": \"bootfile.efi\",\n"
" \"relay\": {\n"
- " \"ip-address\": \"55.66.77.88\"\n"
+ " \"ip-addresses\": [ \"55.66.77.88\" ]\n"
" },\n"
" \"reservations-global\": false,\n"
" \"reservations-in-subnet\": true,\n"
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 1, "
" \"subnet\": \"192.0.2.0/24\" }, "
"{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.2\""
+ " \"ip-addresses\": [ \"192.0.5.2\" ]"
" },"
" \"id\": 2, "
" \"subnet\": \"192.0.3.0/24\" } "
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
" \"client-class\": \"foo\", "
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 1, "
" \"subnet\": \"192.0.2.0/24\" }, "
"{ \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 2, "
" \"subnet\": \"192.0.3.0/24\" } "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 1, "
" \"subnet\": \"192.0.2.0/24\" }, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 1, "
" \"subnet\": \"192.0.2.0/24\" }, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.2 - 192.0.2.100\" } ],"
" \"relay\": { "
- " \"ip-address\": \"192.0.5.1\""
+ " \"ip-addresses\": [ \"192.0.5.1\" ]"
" },"
" \"id\": 1, "
" \"subnet\": \"192.0.2.0/24\" }, "
" \"id\": 3, "
" \"pools\": [ { \"pool\": \"192.0.2.65-192.0.2.100\" } ],"
" \"relay\": {"
- " \"ip-address\": \"10.2.3.4\""
+ " \"ip-addresses\": [ \"10.2.3.4\" ]"
" }"
" }"
"]"
-// Copyright (C) 2017-2024 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2017-2023 Internet Systems Consortium, Inc. ("ISC")
//
// 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
" ],\n"
" \"rebind-timer\": 2,\n"
" \"relay\": {\n"
-" \"ip-address\": \"192.0.2.123\"\n"
+" \"ip-addresses\": [ \"192.0.2.123\" ]\n"
" },\n"
" \"renew-timer\": 1,\n"
" \"subnet\": \"192.0.2.0/24\",\n"
-// Copyright (C) 2016-2023 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
//
// 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
"\"subnet4\": [ { "
" \"subnet\": \"10.0.0.0/24\", "
" \"id\": 1,"
- " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
+ " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
"\"subnet4\": [ { "
" \"subnet\": \"10.0.0.0/24\", "
" \"id\": 1,"
- " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
+ " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
"\"subnet4\": [ { "
" \"subnet\": \"10.0.0.0/24\", "
" \"id\": 1,"
- " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
+ " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
" \"reservations\": [ "
" {"
" \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
"\"subnet4\": [ { "
" \"subnet\": \"10.0.0.0/24\", "
" \"id\": 1,"
- " \"relay\": { \"ip-address\": \"10.0.0.233\" },"
+ " \"relay\": { \"ip-addresses\": [ \"10.0.0.233\" ] },"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"reservations\": [ "
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" \"subnet\": \"192.0.2.64/26\","
" \"id\": 1000,"
" \"relay\": {"
- " \"ip-address\": \"192.1.2.3\""
+ " \"ip-addresses\": [ \"192.1.2.3\" ]"
" },"
" \"pools\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" \"shared-networks\": ["
" {"
" \"name\": \"frog\","
- " \"relay\": { \"ip-address\": \"10.1.2.3\" },"
+ " \"relay\": { \"ip-addresses\": [ \"10.1.2.3\" ] },"
" \"subnet4\": ["
" {"
" \"subnet\": \"192.0.2.0/26\","
" },"
" {"
" \"name\": \"dog\","
- " \"relay\": { \"ip-address\": \"192.1.2.3\" },"
+ " \"relay\": { \"ip-addresses\": [ \"192.1.2.3\" ] },"
" \"subnet4\": ["
" {"
" \"subnet\": \"10.0.0.0/26\","
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" \"subnet\": \"192.0.2.0/26\","
" \"id\": 10,"
" \"relay\": {"
- " \"ip-address\": \"192.1.1.1\""
+ " \"ip-addresses\": [ \"192.1.1.1\" ]"
" },"
" \"pools\": ["
" {"
" \"subnet\": \"10.0.0.0/24\","
" \"id\": 100,"
" \"relay\": {"
- " \"ip-address\": \"192.2.2.2\""
+ " \"ip-addresses\": [ \"192.2.2.2\" ]"
" },"
" \"pools\": ["
" {"
" \"subnet\": \"192.0.2.64/26\","
" \"id\": 1000,"
" \"relay\": {"
- " \"ip-address\": \"192.3.3.3\""
+ " \"ip-addresses\": [ \"192.3.3.3\" ]"
" },"
" \"pools\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"192.3.5.6\""
+ " \"ip-addresses\": [ \"192.3.5.6\" ]"
" },"
" \"subnet4\": ["
" {"
" \"subnet\": \"2001:db8:1::/48\", "
" \"client-class\": \"foo\", "
" \"relay\": { "
- " \"ip-address\": \"2001:db8:3::1\""
+ " \"ip-addresses\": [ \"2001:db8:3::1\" ]"
" }"
" }, "
" { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
" \"id\": 2, "
" \"subnet\": \"2001:db8:2::/48\", "
" \"relay\": { "
- " \"ip-address\": \"2001:db8:3::1\""
+ " \"ip-addresses\": [ \"2001:db8:3::1\" ]"
" }"
" } "
"],"
" \"id\": 1,"
" \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
" \"relay\": { "
- " \"ip-address\": \"2001:db8:1::abcd\""
+ " \"ip-addresses\": [ \"2001:db8:1::abcd\" ]"
" },"
" \"subnet\": \"2001:db8:1::/64\" } ],"
"\"preferred-lifetime\": 3000, "
" \"interface-id\": \"oneone\",\n"
" \"store-extended-info\": true,\n"
" \"relay\": {\n"
- " \"ip-address\": \"1111::1\"\n"
+ " \"ip-addresses\": [ \"1111::1\" ]\n"
" },\n"
" \"rapid-commit\": true,\n"
" \"reservations-global\": false,\n"
" \"min-preferred-lifetime\": 200,\n"
" \"max-preferred-lifetime\": 400,\n"
" \"relay\": {\n"
- " \"ip-address\": \"2222::2\"\n"
+ " \"ip-addresses\": [ \"2222::2\" ]\n"
" },\n"
" \"valid-lifetime\": 400, \n"
" \"min-valid-lifetime\": 300, \n"
" \"id\": 1, "
" \"subnet\": \"2001:db8:1::/48\", "
" \"relay\": { "
- " \"ip-address\": \"2001:db8:3::1\""
+ " \"ip-addresses\": [ \"2001:db8:3::1\" ]"
" }"
" }, "
" { \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
" \"id\": 2, "
" \"subnet\": \"2001:db8:2::/48\", "
" \"relay\": { "
- " \"ip-address\": \"2001:db8:3::2\""
+ " \"ip-addresses\": [ \"2001:db8:3::2\" ]"
" }"
" } "
"],"
" }\n"
" ],\n"
" \"relay\": {\n"
-" \"ip-address\": \"2001:db8:1::abcd\"\n"
+" \"ip-addresses\": [ \"2001:db8:1::abcd\" ]\n"
" },\n"
" \"subnet\": \"2001:db8:1::/64\"\n"
" }\n"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"3001::1\""
+ " \"ip-addresses\": [ \"3001::1\" ]"
" },"
" \"subnet6\": ["
" {"
" \"subnet\": \"2001:db8:2::/64\","
" \"id\": 1000,"
" \"relay\": {"
- " \"ip-address\": \"3001::2\""
+ " \"ip-addresses\": [ \"3001::2\" ]"
" },"
" \"pools\": ["
" {"
" {"
" \"name\": \"frog\","
" \"relay\": {"
- " \"ip-address\": \"3000::1\""
+ " \"ip-addresses\": [ \"3000::1\" ]"
" },"
" \"subnet6\": ["
" {"
" {"
" \"name\": \"dog\","
" \"relay\": {"
- " \"ip-address\": \"3000::2\""
+ " \"ip-addresses\": [ \"3000::2\" ]"
" },"
" \"subnet6\": ["
" {"
" \"subnet\": \"2001:db8:1::/64\","
" \"id\": 10,"
" \"relay\": {"
- " \"ip-address\": \"3001::1\""
+ " \"ip-addresses\": [ \"3001::1\" ]"
" },"
" \"pools\": ["
" {"
" \"subnet\": \"2001:db8:2::/64\","
" \"id\": 100,"
" \"relay\": {"
- " \"ip-address\": \"3001::1\""
+ " \"ip-addresses\": [ \"3001::1\" ]"
" },"
" \"pools\": ["
" {"
" \"subnet\": \"2001:db8:3::/64\","
" \"id\": 1000,"
" \"relay\": {"
- " \"ip-address\": \"3001::2\""
+ " \"ip-addresses\": [ \"3001::2\" ]"
" },"
" \"pools\": ["
" {"
extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET4 = "DHCPSRV_CFGMGR_ONLY_SUBNET4";
extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET6 = "DHCPSRV_CFGMGR_ONLY_SUBNET6";
extern const isc::log::MessageID DHCPSRV_CFGMGR_OPTION_DUPLICATE = "DHCPSRV_CFGMGR_OPTION_DUPLICATE";
-extern const isc::log::MessageID DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED = "DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED";
extern const isc::log::MessageID DHCPSRV_CFGMGR_RENEW_GTR_REBIND = "DHCPSRV_CFGMGR_RENEW_GTR_REBIND";
extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED = "DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED";
extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT = "DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT";
"DHCPSRV_CFGMGR_ONLY_SUBNET4", "retrieved subnet %1 for address hint %2",
"DHCPSRV_CFGMGR_ONLY_SUBNET6", "retrieved subnet %1 for address hint %2",
"DHCPSRV_CFGMGR_OPTION_DUPLICATE", "multiple options with the code: %1 added to the subnet: %2",
- "DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED", "\"relay\" uses \"ip-address\", which has been deprecated, please use \"ip-addresses\": %1",
"DHCPSRV_CFGMGR_RENEW_GTR_REBIND", "in %1, the value of renew-timer %2 is greater than the value of rebind-timer %3, ignoring renew-timer",
"DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED", "use of raw sockets is unsupported on this OS, UDP sockets will be used",
"DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT", "\"dhcp-socket-type\" not specified , using default socket type %1",
extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET4;
extern const isc::log::MessageID DHCPSRV_CFGMGR_ONLY_SUBNET6;
extern const isc::log::MessageID DHCPSRV_CFGMGR_OPTION_DUPLICATE;
-extern const isc::log::MessageID DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED;
extern const isc::log::MessageID DHCPSRV_CFGMGR_RENEW_GTR_REBIND;
extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED;
extern const isc::log::MessageID DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT;
same option code for the particular subnet. Adding multiple options is uncommon
for DHCPv6, but it is not prohibited.
-% DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED "relay" uses "ip-address", which has been deprecated, please use "ip-addresses": %1
-This is debug message issued when the "relay" element being parse
-contains "ip-address" rather than its replacement, "ip-addresses".
-The server will still honor the value but users are encouraged to
-move to the new list parameter.
-
% DHCPSRV_CFGMGR_RENEW_GTR_REBIND in %1, the value of renew-timer %2 is greater than the value of rebind-timer %3, ignoring renew-timer
A warning message that indicates the configured renew-timer is greater
than the configured rebind-timer. The server will ignore the renew
isc_throw(DhcpConfigError, "relay must be a map");
}
- ConstElementPtr address = relay_elem->get("ip-address");
ConstElementPtr addresses = relay_elem->get("ip-addresses");
-
- if (address && addresses) {
- isc_throw(DhcpConfigError,
- "specify either ip-address or ip-addresses, not both");
- }
-
- if (!address && !addresses) {
+ if (!addresses) {
isc_throw(DhcpConfigError, "ip-addresses is required");
}
// Create our resultant RelayInfo structure
*relay_info = isc::dhcp::Network::RelayInfo();
- if (address) {
- addAddress("ip-address", getString(relay_elem, "ip-address"),
- relay_elem, relay_info);
- LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL,
- DHCPSRV_CFGMGR_RELAY_IP_ADDRESS_DEPRECATED)
- .arg(getPosition("ip-address", relay_elem));
- return;
- }
-
if (addresses->getType() != Element::list) {
isc_throw(DhcpConfigError, "ip-addresses must be a list "
"(" << getPosition("ip-addresses", relay_elem) << ")");
// Relay information structure. Very simple for now.
std::string config_str =
" {"
- " \"ip-address\" : \"192.0.2.1\""
+ " \"ip-addresses\" : [ \"192.0.2.1\" ]"
" }";
ElementPtr json = Element::fromJSON(config_str);
// Invalid config (wrong family type of the ip-address field)
std::string config_str_bogus1 =
" {"
- " \"ip-address\" : \"2001:db8::1\""
+ " \"ip-addresses\" : [ \"2001:db8::1\" ]"
" }";
ElementPtr json_bogus1 = Element::fromJSON(config_str_bogus1);
// Invalid config (that thing is not an IPv4 address)
std::string config_str_bogus2 =
" {"
- " \"ip-address\" : \"256.345.123.456\""
+ " \"ip-addresses\" : [ \"256.345.123.456\" ]"
" }";
ElementPtr json_bogus2 = Element::fromJSON(config_str_bogus2);
// Relay information structure. Very simple for now.
std::string config_str =
" {"
- " \"ip-address\" : \"2001:db8::1\""
+ " \"ip-addresses\" : [ \"2001:db8::1\" ]"
" }";
ElementPtr json = Element::fromJSON(config_str);
// Invalid config (wrong family type of the ip-address field
std::string config_str_bogus1 =
" {"
- " \"ip-address\" : \"192.0.2.1\""
+ " \"ip-addresses\" : [ \"192.0.2.1\" ]"
" }";
ElementPtr json_bogus1 = Element::fromJSON(config_str_bogus1);
// That IPv6 address doesn't look right
std::string config_str_bogus2 =
" {"
- " \"ip-address\" : \"2001:db8:::4\""
+ " \"ip-addresses\" : [ \"2001:db8:::4\" ]"
" }";
ElementPtr json_bogus2 = Element::fromJSON(config_str_bogus2);
// Create the vector of test scenarios.
std::vector<RelayTest> tests = {
- {
- "valid ip-address #1",
- "{ \"ip-address\": \"192.168.2.1\" }",
- true,
- { asiolink::IOAddress("192.168.2.1") }
- },
- {
- "invalid ip-address #1",
- "{ \"ip-address\": \"not an address\" }",
- false,
- { }
- },
- {
- "invalid ip-address #2",
- "{ \"ip-address\": \"2001:db8::1\" }",
- false,
- { }
- },
{
"valid ip-addresses #1",
"{ \"ip-addresses\": [ ] }",
{ }
},
{
- "invalid both ip-address and ip-addresses",
- "{"
- " \"ip-address\": \"192.168.2.1\", "
- " \"ip-addresses\": [ \"192.168.2.1\", \"192.168.2.2\" ]"
- " }",
- false,
- { }
- },
- {
- "invalid neither ip-address nor ip-addresses",
+ "invalid no ip-addresses",
"{}",
false,
{ }
// Create the vector of test scenarios.
std::vector<RelayTest> tests = {
- {
- "valid ip-address #1",
- "{ \"ip-address\": \"2001:db8::1\" }",
- true,
- { asiolink::IOAddress("2001:db8::1") }
- },
- {
- "invalid ip-address #1",
- "{ \"ip-address\": \"not an address\" }",
- false,
- { }
- },
- {
- "invalid ip-address #2",
- "{ \"ip-address\": \"192.168.2.1\" }",
- false,
- { }
- },
{
"valid ip-addresses #1",
"{ \"ip-addresses\": [ ] }",
{ }
},
{
- "invalid both ip-address and ip-addresses",
- "{"
- " \"ip-address\": \"2001:db8::1\", "
- " \"ip-addresses\": [ \"2001:db8::1\", \"2001:db8::2\" ]"
- " }",
- false,
- { }
- },
- {
- "invalid neither ip-address nor ip-addresses",
+ "invalid no ip-addresses",
"{}",
false,
{ }