// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// List of client classes which must be evaluated when this shared
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Subnet level compute T1 and T2 timers.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Global compute T1 and T2 timers.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// List of client classes which must be evaluated when this shared
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Subnet level compute T1 and T2 timers.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Global compute T1 and T2 timers.
// Since Kea 1.9.1, a more flexible option of configuring the way Kea uses host
// reservations is available through the 'reservation-modes' map.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
// Define several global host reservations.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"reservations": [
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// This starts a list of subnets allowed in this shared network.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"subnet": "10.0.0.0/8",
"valid-lifetime": 30
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"subnet": "192.0.2.0/24",
"valid-lifetime": 30
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// List of client classes which must be evaluated when this shared
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Subnet level compute T1 and T2 timers.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Data directory.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// List of client classes which must be evaluated when this shared
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Subnet level compute T1 and T2 timers.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// Data directory.
// Since Kea 1.9.1, a more flexible option of configuring the way Kea uses host
// reservations is available through the 'reservation-modes' map.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
// Define several global host reservations.
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"pools": [ { "pool": "2001:db8:1::/120" } ],
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
// List of subnets belonging to this particular shared-network
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"subnet": "2001:db8:1::/64",
"pools": [ { "pool": "2001:db8:1:abcd::/64" } ],
// Reservation modes specifying server's mode of operation when it
// fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"subnet": "3000::/16",
"valid-lifetime": 40
"Dhcp4": {
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": False
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": false
}
}
"Dhcp4": {
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
}
}
"Dhcp4": {
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": true
}
}
"Dhcp4": {
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
}
}
"Dhcp4": {
"reservation-modes": {
- "global": True,
- "in-subnet": True,
- "out-of-pool": True
+ "global": true,
+ "in-subnet": true,
+ "out-of-pool": true
}
}
{
"subnet": "192.0.2.0/24",
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": False
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": false
},
...
}
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"reservations": [
{
# Reservation modes specifying server's mode of operation when it
# fetches host reservations.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"pools": [ { "pool": "10.0.0.10-10.0.0.100" } ]
} ]
# Reservation modes specifying server's mode of operation when it
# fetches host reservations.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"shared-networks": [{
"subnet4": [
a reservation for the ``reserved_class`` will be assigned an address from
the subnet 192.0.2.0/24. The subnets must belong to the same shared network.
In addition, the reservation for the client class must be specified at the
-global scope (global reservation) and the ``reservation-mode`` must be
-set to ``global``.
+global scope (global reservation) and the ``reservation-modes`` must
+set ``global`` to true.
In the example above the ``client-class`` could also be specified at the
subnet level rather than pool level yielding the same effect.
+-----------------------------+----------------------------+-------------+-------------+-------------+
| reservation-mode | yes | yes | yes | n/a |
+-----------------------------+----------------------------+-------------+-------------+-------------+
+ | reservation-modes | yes | yes | yes | n/a |
+ +-----------------------------+----------------------------+-------------+-------------+-------------+
| t1-percent | yes | yes | yes | n/a |
+-----------------------------+----------------------------+-------------+-------------+-------------+
| t2-percent | yes | yes | yes | n/a |
"Dhcp6": {
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": False
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": false
}
}
"Dhcp6": {
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
}
}
"Dhcp6": {
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": true
}
}
"Dhcp6": {
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
}
}
"Dhcp6": {
"reservation-modes": {
- "global": True,
- "in-subnet": True,
- "out-of-pool": True
+ "global": true,
+ "in-subnet": true,
+ "out-of-pool": true
}
}
{
"subnet": "2001:db8:1::/64",
"reservation-modes": {
- "global": False,
- "in-subnet": False,
- "out-of-pool": False
+ "global": false,
+ "in-subnet": false,
+ "out-of-pool": false
},
...
}
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"reservations": [
{
# Reservation modes specifying server's mode of operation when it
# fetches host reservations.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"pools": [ { "pool": "2001:db8:1::-2001:db8:1::100" } ]
} ]
# Reservation modes specifying server's mode of operation when it
# fetches host reservations.
"reservation-modes": {
- "global": True,
- "in-subnet": False,
- "out-of-pool": False
+ "global": true,
+ "in-subnet": false,
+ "out-of-pool": false
},
"shared-networks": [{
"subnet6": [
a reservation for the ``reserved_class`` will be assigned an address from
the subnet 2001:db8:1::/64. The subnets must belong to the same shared network.
In addition, the reservation for the client class must be specified at the
-global scope (global reservation) and the ``reservation-mode`` must be
-set to ``global``.
+global scope (global reservation) and the ``reservation-modes`` must
+set ``global`` to true.
In the example above the ``client-class`` could also be specified at the
subnet level rather than pool level yielding the same effect.
+-----------------------------+----------------------------+-----------+-----------+-----------+------------+
| reservation-mode | yes | yes | yes | n/a | n/a |
+-----------------------------+----------------------------+-----------+-----------+-----------+------------+
+ | reservation-modes | yes | yes | yes | n/a | n/a |
+ +-----------------------------+----------------------------+-----------+-----------+-----------+------------+
| t1-percent | yes | yes | yes | n/a | n/a |
+-----------------------------+----------------------------+-----------+-----------+-----------+------------+
| t2-percent | yes | yes | yes | n/a | n/a |
# Reservation modes specifying server's mode of operation when it
# fetches host reservations.
"reservation-modes": {
- "global": False,
- "in-subnet": True,
- "out-of-pool": True
+ "global": false,
+ "in-subnet": true,
+ "out-of-pool": true
},
"subnet4": [
{
" \"pools\": [ { \"pool\": \"192.0.1.0/24\" } ],"
" \"subnet\": \"192.0.1.0/24\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
" \"subnet\": \"192.0.2.0/24\", "
" \"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"192.0.3.0/24\" } ],"
" \"subnet\": \"192.0.4.0/24\", "
" \"reservation-modes\": {"
- " \"in-subnet\": False,"
- " \"out-of-pool\": False,"
- " \"global\": False"
+ " \"in-subnet\": false,"
+ " \"out-of-pool\": false,"
+ " \"global\": false"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"192.0.4.0/24\" } ],"
" \"subnet\": \"192.0.4.0/24\", "
" \"reservation-modes\": {"
- " \"global\": True"
+ " \"global\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"192.0.6.0/24\" } ],"
" \"subnet\": \"192.0.6.0/24\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True,"
- " \"global\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true,"
+ " \"global\": true"
" }"
" } ],"
"\"valid-lifetime\": 4000 }";
"\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, "
"\"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" },"
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
" \"subnet\": \"192.0.2.0/24\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" \"ip-address\": \"5.6.7.8\"\n"
" },\n"
" \"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" },"
" \"renew-timer\": 10,\n"
" \"rebind-timer\": 20,\n"
" \"ip-address\": \"55.66.77.88\"\n"
" },\n"
" \"reservation-modes\": {"
- " \"global\": False"
+ " \"global\": false"
" }"
" }\n"
" ]\n"
"\"valid-lifetime\": 600,\n"
"\"subnet4\": [ { \n"
" \"subnet\": \"10.0.0.0/24\", \n"
- " \"reservation-modes\": { \"global\": True },"
+ " \"reservation-modes\": { \"global\": true },"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]\n"
"} ]\n"
"}\n"
" \"id\": 20,"
" \"pools\": [ { \"pool\": \"192.0.2.10-192.0.2.63\" } ],\n"
" \"interface\": \"eth1\",\n"
- " \"reservation-modes\": { \"global\": True },"
+ " \"reservation-modes\": { \"global\": true },"
" \"reservations\": [ \n"
" {\n"
" \"hw-address\": \"aa:bb:cc:dd:ee:ff\",\n"
" \"id\": 10,"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
" \"interface\": \"eth0\",\n"
- " \"reservation-modes\": { \"out-of-pool\": True },"
+ " \"reservation-modes\": { \"out-of-pool\": true },"
" \"reservations\": [ \n"
" {\n"
" \"hw-address\": \"aa:bb:cc:dd:ee:ff\",\n"
" \"id\": 10,"
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
" \"interface\": \"eth0\",\n"
- " \"reservation-modes\": { \"in-subnet\": True, \"out-of-pool\": True },"
+ " \"reservation-modes\": { \"in-subnet\": true, \"out-of-pool\": true },"
" \"reservations\": [ \n"
" {\n"
" \"hw-address\": \"aa:bb:cc:dd:ee:ff\",\n"
" \"test\": \"not member('reserved_class')\""
"}"
"],\n"
- "\"reservation-modes\": { \"global\": True },"
+ "\"reservation-modes\": { \"global\": true },"
"\"valid-lifetime\": 600,\n"
"\"reservations\": [ \n"
"{\n"
" \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
" \"subnet\": \"2001:db8:1::/48\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
" \"subnet\": \"2001:db8:2::/48\", "
" \"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ],"
" \"subnet\": \"2001:db8:3::/48\", "
" \"reservation-modes\": {"
- " \"in-subnet\": False,"
- " \"out-of-pool\": False,"
- " \"global\": False"
+ " \"in-subnet\": false,"
+ " \"out-of-pool\": false,"
+ " \"global\": false"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ],"
" \"subnet\": \"2001:db8:4::/48\", "
" \"reservation-modes\": {"
- " \"global\": True"
+ " \"global\": true"
" }"
" },"
" {"
" \"pools\": [ { \"pool\": \"2001:db8:6::/64\" } ],"
" \"subnet\": \"2001:db8:6::/48\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True,"
- " \"global\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true,"
+ " \"global\": true"
" }"
" } ],"
"\"valid-lifetime\": 4000 }";
"\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, "
"\"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" },"
"\"subnet6\": [ { "
" \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
" \"subnet\": \"2001:db8:1::/48\", "
" \"reservation-modes\": {"
- " \"in-subnet\": True,"
- " \"out-of-pool\": True"
+ " \"in-subnet\": true,"
+ " \"out-of-pool\": true"
" }"
" },"
" {"
" },\n"
" \"rapid-commit\": true,\n"
" \"reservation-modes\": {"
- " \"global\": False"
+ " \"global\": false"
" }"
" \"subnet6\": [\n"
" { \n"
" \"interface-id\": \"twotwo\",\n"
" \"rapid-commit\": true,\n"
" \"reservation-modes\": {"
- " \"out-of-pool\": True"
+ " \"out-of-pool\": true"
" }"
" }\n"
" ]\n"
// Set reservation mode
Optional<Network::HRMode> hrmode = host_reservation_mode_;
if (!hrmode.unspecified()) {
- std::string mode;
- switch (hrmode.get()) {
- case HR_DISABLED:
- mode = "disabled";
- break;
- case HR_OUT_OF_POOL:
- mode = "out-of-pool";
- break;
- case HR_GLOBAL:
- mode = "global";
- break;
- case HR_ALL:
- mode = "all";
- break;
- default:
- isc_throw(ToElementError,
- "invalid host reservation mode: " << hrmode.get());
+ bool hr_global = false;
+ bool hr_in_sunbet = false;
+ bool hr_out_of_pool = false;
+ if (hrmode & Network::HR_GLOBAL) {
+ hr_global = true;
}
- map->set("reservation-mode", Element::create(mode));
+ if (hrmode & Network::HR_IN_SUBNET) {
+ hr_in_sunbet = true;
+ }
+ if (hrmode & Network::HR_OUT_OF_POOL) {
+ hr_out_of_pool = true;
+ }
+ ElementPtr reservation_modes = Element::createMap();
+ if (hrmode == Network::HR_DISABLED) {
+ reservation_modes->set("global", Element::create(false));
+ reservation_modes->set("in-subnet", Element::create(false));
+ reservation_modes->set("out-of-pool", Element::create(false));
+ } else {
+ if (hr_global) {
+ reservation_modes->set("global", Element::create(true));
+ }
+ if (hr_in_sunbet) {
+ reservation_modes->set("in-subnet", Element::create(true));
+ }
+ if (hr_out_of_pool) {
+ reservation_modes->set("out-of-pool", Element::create(true));
+ }
+ }
+
+ map->set("reservation-modes", reservation_modes);
}
// Set options
{ "config-control", Element::map },
{ "server-tag", Element::string },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map },
{ "calculate-tee-times", Element::boolean },
{ "t1-percent", Element::real },
{ "t2-percent", Element::real },
{ "boot-file-name", Element::string, "" },
{ "server-tag", Element::string, "" },
{ "reservation-mode", Element::string, "all" },
+ { "reservation-modes", Element::map, "{\"in-subnet\": true, \"out-of-pool\": true}" },
{ "calculate-tee-times", Element::boolean, "false" },
{ "t1-percent", Element::real, ".50" },
{ "t2-percent", Element::real, ".875" },
{ "require-client-classes", Element::list },
{ "reservations", Element::list },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map, },
{ "relay", Element::map },
{ "match-client-id", Element::boolean },
{ "authoritative", Element::boolean },
{ "boot-file-name", Element::string },
{ "relay", Element::map },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map },
{ "client-class", Element::string },
{ "require-client-classes", Element::list },
{ "valid-lifetime", Element::integer },
{ "config-control", Element::map },
{ "server-tag", Element::string },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map },
{ "calculate-tee-times", Element::boolean },
{ "t1-percent", Element::real },
{ "t2-percent", Element::real },
{ "dhcp4o6-port", Element::integer, "0" },
{ "server-tag", Element::string, "" },
{ "reservation-mode", Element::string, "all" },
+ { "reservation-modes", Element::map, "{\"in-subnet\": true, \"out-of-pool\": true}" },
{ "calculate-tee-times", Element::boolean, "true" },
{ "t1-percent", Element::real, ".50" },
{ "t2-percent", Element::real, ".80" },
{ "require-client-classes", Element::list },
{ "reservations", Element::list },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map },
{ "relay", Element::map },
{ "user-context", Element::map },
{ "comment", Element::string },
{ "option-data", Element::list },
{ "relay", Element::map },
{ "reservation-mode", Element::string },
+ { "reservation-modes", Element::map },
{ "client-class", Element::string },
{ "require-client-classes", Element::list },
{ "preferred-lifetime", Element::integer },
x.reset(new DoubleElement(dbl_value, pos));
break;
}
+ case Element::map: {
+ auto data = Element::fromJSON(def_value.value_);
+ if (data->getType() != Element::map) {
+ isc_throw(BadValue,
+ "Internal error. Incorrect map value type for "
+ << def_value.name_ << " : " << def_value.value_);
+ }
+ x = data;
+ break;
+ }
+ case Element::list: {
+ auto data = Element::fromJSON(def_value.value_);
+ if (data->getType() != Element::list) {
+ isc_throw(BadValue,
+ "Internal error. Incorrect list value type for "
+ << def_value.name_ << " : " << def_value.value_);
+ }
+ x = data;
+ break;
+ }
default:
- // No default values for null, list or map
+ // No default values for null
isc_throw(BadValue,
"Internal error. Incorrect default value type for "
<< def_value.name_);
" \"4o6-interface-id\": \"\",\n"
" \"4o6-subnet\": \"\",\n"
" \"authoritative\": false,\n"
- " \"reservation-mode\": \"all\",\n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"option-data\": [ ],\n"
" \"pools\": [ ]\n,"
" \"require-client-classes\": [ \"foo\", \"bar\" ],\n"
" \"boot-file-name\": \"\", \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\", \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"4o6-interface\": \"\", \n"
" \"4o6-interface-id\": \"\", \n"
" \"4o6-subnet\": \"\" \n"
" \"boot-file-name\": \"\", \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\", \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"4o6-interface\": \"\", \n"
" \"4o6-interface-id\": \"\", \n"
" \"4o6-subnet\": \"\" \n"
" \"boot-file-name\": \"\", \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\", \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"4o6-interface\": \"\", \n"
" \"4o6-interface-id\": \"\", \n"
" \"4o6-subnet\": \"\" \n"
" \"boot-file-name\": \"\", \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\", \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"4o6-interface\": \"\", \n"
" \"4o6-interface-id\": \"\", \n"
" \"4o6-subnet\": \"\" \n"
" \"min-valid-lifetime\": 100,\n"
" \"max-valid-lifetime\": 300,\n"
" \"rapid-commit\": false,\n"
- " \"reservation-mode\": \"all\",\n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},\n"
" \"pools\": [ ],\n"
" \"pd-pools\": [ ],\n"
" \"option-data\": [ ],\n"
" \"valid-lifetime\": 300, \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\" \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true}\n"
" }";
" \"valid-lifetime\": 300, \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\" \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true}\n"
" }";
" \"valid-lifetime\": 300, \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\" \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true}\n"
" }";
data::ElementPtr elems;
" \"valid-lifetime\": 300, \n"
" \"client-class\": \"\", \n"
" \"require-client-classes\": [] \n,"
- " \"reservation-mode\": \"all\" \n"
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true}\n"
" }";
data::ElementPtr elems;
" \"rebind-timer\": 199,"
" \"relay\": { \"ip-addresses\": [ \"10.1.1.1\" ] },"
" \"renew-timer\": 99,"
- " \"reservation-modes\": {\"out-of-pool\": True},"
+ " \"reservation-modes\": {\"out-of-pool\": true},"
" \"server-hostname\": \"example.org\","
" \"require-client-classes\": [ \"runner\" ],"
" \"user-context\": { \"comment\": \"example\" },"
" \"boot-file-name\": \"\","
" \"client-class\": \"\","
" \"require-client-classes\": []\n,"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"4o6-interface\": \"\","
" \"4o6-interface-id\": \"\","
" \"4o6-subnet\": \"\","
- " \"reservation-mode\": \"all\","
" \"calculate-tee-times\": true,"
" \"t1-percent\": .45,"
" \"t2-percent\": .65,"
" \"boot-file-name\": \"\","
" \"client-class\": \"\","
" \"require-client-classes\": []\n,"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"4o6-interface\": \"\","
" \"4o6-interface-id\": \"\","
" \"4o6-subnet\": \"\","
- " \"reservation-mode\": \"all\","
" \"calculate-tee-times\": false,"
" \"t1-percent\": .40,"
" \"t2-percent\": .80,"
" \"relay\": { \"ip-addresses\": [ \"2001:db8:1::1\" ] },"
" \"renew-timer\": 99,"
" \"require-client-classes\": [ \"runner\" ],"
- " \"reservation-modes\": {\"out-of-pool\": True},"
+ " \"reservation-modes\": {\"out-of-pool\": true},"
" \"user-context\": { },"
" \"valid-lifetime\": 399,"
" \"min-valid-lifetime\": 299,"
" \"max-valid-lifetime\": 500,"
" \"client-class\": \"\","
" \"require-client-classes\": []\n,"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"rapid-commit\": false,"
" \"hostname-char-set\": \"\""
" },"
" \"valid-lifetime\": 40,"
" \"client-class\": \"\","
" \"require-client-classes\": []\n,"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"rapid-commit\": false"
" }"
" ]"
" },\n"
" \"renew-timer\": 100,\n"
" \"require-client-classes\": [ \"foo\" ],\n"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"subnet4\": [\n"
" {\n"
" \"4o6-interface\": \"\",\n"
" },\n"
" \"renew-timer\": 100,\n"
" \"require-client-classes\": [ \"foo\" ],\n"
- " \"reservation-mode\": \"all\","
+ " \"reservation-modes\": {\"in-subnet\": true, \"out-of-pool\": true},"
" \"subnet6\": [\n"
" {\n"
" \"id\": 1,\n"