]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2866] Updated server tests
authorFrancis Dupont <fdupont@isc.org>
Tue, 6 Jun 2023 12:13:18 +0000 (14:13 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 26 Jun 2023 12:24:42 +0000 (14:24 +0200)
37 files changed:
doc/examples/kea6/mysql-reservations.json
doc/examples/kea6/pgsql-reservations.json
src/bin/dhcp4/tests/config_parser_unittest.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/d2_unittest.cc
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/direct_client_unittest.cc
src/bin/dhcp4/tests/dora_unittest.cc
src/bin/dhcp4/tests/hooks_unittest.cc
src/bin/dhcp4/tests/host_unittest.cc
src/bin/dhcp4/tests/inform_unittest.cc
src/bin/dhcp4/tests/kea_controller_unittest.cc
src/bin/dhcp4/tests/out_of_range_unittest.cc
src/bin/dhcp4/tests/parser_unittest.cc
src/bin/dhcp4/tests/shared_network_unittest.cc
src/bin/dhcp4/tests/vendor_opts_unittest.cc
src/bin/dhcp6/tests/classify_unittests.cc
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/confirm_unittest.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/d2_unittest.cc
src/bin/dhcp6/tests/decline_unittest.cc
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/fqdn_unittest.cc
src/bin/dhcp6/tests/hooks_unittest.cc
src/bin/dhcp6/tests/host_unittest.cc
src/bin/dhcp6/tests/infrequest_unittest.cc
src/bin/dhcp6/tests/kea_controller_unittest.cc
src/bin/dhcp6/tests/parser_unittest.cc
src/bin/dhcp6/tests/rebind_unittest.cc
src/bin/dhcp6/tests/renew_unittest.cc
src/bin/dhcp6/tests/sarr_unittest.cc
src/bin/dhcp6/tests/shared_network_unittest.cc
src/bin/dhcp6/tests/tee_times_unittest.cc
src/bin/dhcp6/tests/vendor_opts_unittest.cc

index f8a99a059f5dd093833084424d7612016b33395b..74beb2c631860b22da75ca436df76c73fe164cb2 100644 (file)
@@ -65,8 +65,6 @@
 // id will be used to search for the reservations within the database.
   "subnet6": [
     {
-      "id": 1,
-
       "subnet": "2001:db8:1::/48",
 
       "pools": [ { "pool": "2001:db8:1::/80" } ],
index 35b571e189294c92d525bdf631530b3a7a02f65e..6c610196504ebf00d19d1fabf21260c009393192 100644 (file)
@@ -62,8 +62,6 @@
 // id will be used to search for the reservations within the database.
   "subnet6": [
     {
-      "id": 1,
-
       "subnet": "2001:db8:1::/48",
 
       "pools": [ { "pool": "2001:db8:1::/80" } ],
index 9e30f2358086c26ea0e04c56bce9af77edd39dc8..24e6bf81fa7b4f1cce184c4af16aa362633ef190 100644 (file)
@@ -74,6 +74,7 @@ const char* PARSER_CONFIGS[] = {
     "        \"pools\": [ "
     "            { \"pool\":  \"192.0.2.0/28\" }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"192.0.2.0/24\""
     "     } ]"
     "}",
@@ -93,6 +94,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"192.0.2.0/24\""
     "     } ]"
     "}",
@@ -115,6 +117,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"192.0.2.0/24\""
     "     } ]"
     "}",
@@ -137,6 +140,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"192.0.2.0/24\""
     "     } ]"
     "}",
@@ -429,6 +433,7 @@ public:
             "\"rebind-timer\": 2000, "
             "\"renew-timer\": 1000, "
             "\"subnet4\": [ { "
+            "    \"id\": 1,"
             "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
             "    \"subnet\": \"192.0.2.0/24\", "
             "    \"option-data\": [ {";
@@ -894,6 +899,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) {
 
     string too_small =  "{ " + genIfaceConfig() + "," +
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000 }";
@@ -911,6 +917,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) {
 
     string too_large =  "{ " + genIfaceConfig() + "," +
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 2000, \"max-valid-lifetime\": 1000 }";
@@ -925,6 +932,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) {
 
     string before =  "{ " + genIfaceConfig() + "," +
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000, "
@@ -940,6 +948,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) {
 
     string after =  "{ " + genIfaceConfig() + "," +
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 5000, \"min-valid-lifetime\": 1000, "
@@ -955,6 +964,7 @@ TEST_F(Dhcp4ParserTest, outBoundValidLifetime) {
 
     string crossed =  "{ " + genIfaceConfig() + "," +
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 1500, \"min-valid-lifetime\": 2000, "
@@ -1041,6 +1051,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) {
     string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1075,6 +1086,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRebindTimer) {
     string config = "{ " + genIfaceConfig() + "," +
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1109,6 +1121,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000,"
@@ -1140,6 +1153,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) {
     EXPECT_EQ(1, subnet->getID());
 }
 
+#if deprecated_unnumbered
 // Goal of this test is to verify that multiple subnets get unique
 // subnet-ids. Also, test checks that it's possible to do reconfiguration
 // multiple times.
@@ -1199,6 +1213,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) {
         // a bit.
     } while (++cnt < 10);
 }
+#endif
 
 // This test checks that it is possible to assign arbitrary ids for subnets.
 TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
@@ -1437,6 +1452,7 @@ TEST_F(Dhcp4ParserTest, nextServerGlobal) {
         "\"server-hostname\": \"foo\", "
         "\"boot-file-name\": \"bar\", "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1473,6 +1489,7 @@ TEST_F(Dhcp4ParserTest, nextServerSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"server-hostname\": \"foo\", "
@@ -1510,6 +1527,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1522,6 +1540,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1534,6 +1553,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1547,6 +1567,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1560,6 +1581,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -1620,6 +1642,7 @@ TEST_F(Dhcp4ParserTest, nextServerOverride) {
         "\"server-hostname\": \"nohost\","
         "\"boot-file-name\": \"nofile\","
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"server-hostname\": \"some-name.example.org\","
@@ -1655,6 +1678,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": false,"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1664,6 +1688,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": true,"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1707,6 +1732,7 @@ TEST_F(Dhcp4ParserTest, compatibility) {
         "    \"exclude-first-last-24\": true"
         "},"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1741,6 +1767,7 @@ TEST_F(Dhcp4ParserTest, compatibilityUnknown) {
         "    \"foo-bar\": true"
         "},"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1767,6 +1794,7 @@ TEST_F(Dhcp4ParserTest, compatibilityNotBool) {
         "    \"lenient-option-parsing\": 1"
         "},"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1792,11 +1820,13 @@ TEST_F(Dhcp4ParserTest, matchClientIdNoGlobal) {
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"match-client-id\": true,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"match-client-id\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
@@ -1839,11 +1869,13 @@ TEST_F(Dhcp4ParserTest, matchClientIdGlobal) {
         "\"match-client-id\": true,"
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"match-client-id\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
         "} ],"
@@ -1883,11 +1915,13 @@ TEST_F(Dhcp4ParserTest, authoritativeNoGlobal) {
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"authoritative\": true,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"authoritative\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
@@ -1930,11 +1964,13 @@ TEST_F(Dhcp4ParserTest, authoritativeGlobal) {
         "\"authoritative\": true,"
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"authoritative\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
         "} ],"
@@ -1974,6 +2010,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
@@ -2014,6 +2051,7 @@ TEST_F(Dhcp4ParserTest, multiplePools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ "
         "        { \"pool\": \"192.0.2.0/28\" },"
         "        { \"pool\": \"192.0.2.200-192.0.2.255\" }"
@@ -2021,6 +2059,7 @@ TEST_F(Dhcp4ParserTest, multiplePools) {
         "    \"subnet\": \"192.0.2.0/24\" "
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ "
         "    { \"pool\": \"192.0.3.0/25\" },"
         "    { \"pool\": \"192.0.3.128/25\" }"
@@ -2074,6 +2113,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.4.0/28\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2130,6 +2170,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo/28\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2139,6 +2180,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.128/foo\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2148,6 +2190,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.128/100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2157,6 +2200,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2166,6 +2210,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo - bar\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2175,6 +2220,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.200 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2184,6 +2230,7 @@ TEST_F(Dhcp4ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.128/1052\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2256,6 +2303,7 @@ TEST_F(Dhcp4ParserTest, noPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"user-context\": { } } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2343,6 +2391,7 @@ TEST_F(Dhcp4ParserTest, unknownInterface) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"interface\": \"ethX\" } ],"
@@ -2966,6 +3015,7 @@ TEST_F(Dhcp4ParserTest, optionDataDefaultsGlobal) {
         "    \"csv-format\": false"
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ],"
@@ -3027,6 +3077,7 @@ TEST_F(Dhcp4ParserTest, optionDataDefaultsSubnet) {
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"option-data\": [ {"
@@ -3119,6 +3170,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) {
         "    \"space\": \"isc\""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
@@ -3253,6 +3305,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
         "    \"space\": \"isc\""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
@@ -3304,6 +3357,7 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
         "      \"csv-format\": false"
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": [ {"
@@ -3449,6 +3503,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": [ {"
@@ -3458,6 +3513,7 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
         "        } ]"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"option-data\": [ {"
@@ -3524,6 +3580,7 @@ TEST_F(Dhcp4ParserTest, optionDataSinglePool) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { "
         "        \"pool\": \"192.0.2.1 - 192.0.2.100\","
         "        \"option-data\": [ {"
@@ -3595,6 +3652,7 @@ TEST_F(Dhcp4ParserTest, optionDataMultiplePools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { "
         "        \"pool\": \"192.0.2.1 - 192.0.2.100\","
         "        \"option-data\": [ {"
@@ -3900,6 +3958,7 @@ TEST_F(Dhcp4ParserTest, slpOptions) {
         "    \"data\": \"false, \""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ],"
@@ -4031,6 +4090,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
         "    \"space\": \"vendor-encapsulated-options-space\""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
@@ -4110,6 +4170,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsHex) {
         "    \"csv-format\": false"
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
@@ -4166,6 +4227,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) {
         "    \"space\": \"vendor-4491\""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" "
         " } ]"
@@ -4241,6 +4303,7 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries = {},
         "    \"space\": \"isc\""
         " } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]");
@@ -4524,6 +4587,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigValid) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -4593,6 +4657,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigMoveToGlobal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -4670,6 +4735,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfigBoth) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -4748,6 +4814,7 @@ TEST_F(Dhcp4ParserTest, invalidD2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -4792,6 +4859,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
@@ -4829,6 +4897,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfoList) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
@@ -4868,21 +4937,25 @@ TEST_F(Dhcp4ParserTest, classifySubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"client-class\": \"alpha\" "
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"client-class\": \"beta\" "
         " },"
         " {"
+        "    \"id\": 3,"
         "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"client-class\": \"gamma\" "
         " },"
         " {"
+        "    \"id\": 4,"
         "    \"pools\": [ { \"pool\": \"192.0.5.101 - 192.0.5.150\" } ],"
         "    \"subnet\": \"192.0.5.0/24\" "
         " } ],"
@@ -4960,6 +5033,7 @@ TEST_F(Dhcp4ParserTest, classifyPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { "
         "        \"pool\": \"192.0.2.1 - 192.0.2.100\", "
         "        \"client-class\": \"alpha\" "
@@ -5423,6 +5497,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.1.0/24\" } ],"
         "    \"subnet\": \"192.0.1.0/24\", "
         "    \"reservations-global\": false,"
@@ -5430,6 +5505,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"reservations-global\": false,"
@@ -5437,22 +5513,26 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": true"
         " },"
         " {"
+        "    \"id\": 3,"
         "    \"pools\": [ { \"pool\": \"192.0.3.0/24\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
         "    \"reservations-global\": false,"
         "    \"reservations-in-subnet\": false"
         " },"
         " {"
+        "    \"id\": 4,"
         "    \"pools\": [ { \"pool\": \"192.0.4.0/24\" } ],"
         "    \"subnet\": \"192.0.4.0/24\", "
         "    \"reservations-global\": true,"
         "    \"reservations-in-subnet\": false"
         " },"
         " {"
+        "    \"id\": 5,"
         "    \"pools\": [ { \"pool\": \"192.0.5.0/24\" } ],"
         "    \"subnet\": \"192.0.5.0/24\""
         " },"
         " {"
+        "    \"id\": 6,"
         "    \"pools\": [ { \"pool\": \"192.0.6.0/24\" } ],"
         "    \"subnet\": \"192.0.6.0/24\", "
         "    \"reservations-global\": true,"
@@ -5460,6 +5540,7 @@ TEST_F(Dhcp4ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 7,"
         "    \"pools\": [ { \"pool\": \"192.0.7.0/24\" } ],"
         "    \"subnet\": \"192.0.7.0/24\", "
         "    \"reservations-global\": true,"
@@ -5553,6 +5634,7 @@ TEST_F(Dhcp4ParserTest, hostReservationGlobal) {
         "\"reservations-in-subnet\": true,"
         "\"reservations-out-of-pool\": true,"
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"reservations-global\": false,"
@@ -5560,6 +5642,7 @@ TEST_F(Dhcp4ParserTest, hostReservationGlobal) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.0/24\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
         " } ],"
@@ -5784,6 +5867,7 @@ TEST_F(Dhcp4ParserTest, 4o6default) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -5818,6 +5902,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-subnet\": \"2001:db8::123/45\" } ],"
@@ -5857,6 +5942,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-subnet\": \"2001:db8::123\" } ],"
@@ -5867,6 +5953,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-subnet\": \"2001:db8:bogus/45\" } ],"
@@ -5877,6 +5964,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetBogus) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-subnet\": \"2001:db8::123/200\" } ],"
@@ -5914,6 +6002,7 @@ TEST_F(Dhcp4ParserTest, 4o6iface) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-interface\": \"ethX\" } ],"
@@ -5950,6 +6039,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetIface) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-subnet\": \"2001:db8::543/21\","
@@ -5990,6 +6080,7 @@ TEST_F(Dhcp4ParserTest, 4o6subnetInterfaceId) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\","
         "    \"4o6-interface-id\": \"vlan123\" } ],"
@@ -6040,6 +6131,7 @@ TEST_F(Dhcp4ParserTest, validClientClassDictionary) {
         "   } \n"
         "], \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ], \n"
         "    \"subnet\": \"192.0.2.0/24\"  \n"
         " } ] \n"
@@ -6083,6 +6175,7 @@ TEST_F(Dhcp4ParserTest, invalidClientClassDictionary) {
         "   } \n"
         "], \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ], \n"
         "    \"subnet\": \"192.0.2.0/24\"  \n"
         " } ] \n"
@@ -6107,6 +6200,7 @@ TEST_F(Dhcp4ParserTest, clientClassValidLifetime) {
         "   } \n"
         "], \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ], \n"
         "    \"subnet\": \"192.0.2.0/24\"  \n"
         " } ] \n"
@@ -6164,6 +6258,7 @@ TEST_F(Dhcp4ParserTest, templateClientClassValidLifetime) {
         "   } \n"
         "], \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ], \n"
         "    \"subnet\": \"192.0.2.0/24\"  \n"
         " } ] \n"
@@ -6306,13 +6401,14 @@ TEST_F(Dhcp4ParserTest, invalidPoolRange) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 19.2.0.200\" } ], \n"
         "    \"subnet\": \"192.0.2.0/24\"  \n"
         " } ] \n"
         "} \n";
 
     string expected = "Failed to create pool defined by: "
-        "192.0.2.1-19.2.0.200 (<string>:6:26)";
+        "192.0.2.1-19.2.0.200 (<string>:7:26)";
 
     configure(config, CONTROL_RESULT_ERROR, expected);
 }
@@ -6325,6 +6421,7 @@ TEST_F(Dhcp4ParserTest, outsideSubnetPool) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], \n"
         "    \"subnet\": \"10.0.2.0/24\"  \n"
         " } ] \n"
@@ -6345,6 +6442,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmpty) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n"
         "    \"subnet\": \"10.0.2.0/24\"  \n"
         " } ],\n"
@@ -6362,6 +6460,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksNoName) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n"
         "    \"subnet\": \"10.0.2.0/24\"  \n"
         " } ],\n"
@@ -6378,6 +6477,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmptyName) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n"
         "    \"subnet\": \"10.0.2.0/24\"  \n"
         " } ],\n"
@@ -6393,6 +6493,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksEmptyName) {
 TEST_F(Dhcp4ParserTest, sharedNetworksName) {
     string config = "{\n"
         "\"subnet4\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"10.0.2.1 - 10.0.2.100\" } ], \n"
         "    \"subnet\": \"10.0.2.0/24\"  \n"
         " } ],\n"
@@ -6428,6 +6529,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworks1subnet) {
         "\"shared-networks\": [ {\n"
         "    \"name\": \"foo\"\n,"
         "    \"subnet4\": [ { \n"
+        "        \"id\": 1,\n"
         "        \"subnet\": \"192.0.2.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ]\n"
         "    } ]\n"
@@ -6484,10 +6586,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworks3subnets) {
         "    \"name\": \"foo\"\n,"
         "    \"subnet4\": [\n"
         "    { \n"
+        "        \"id\": 1,\n"
         "        \"subnet\": \"192.0.1.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2,\n"
         "        \"subnet\": \"192.0.2.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n"
         "        \"renew-timer\": 2,\n"
@@ -6497,6 +6601,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworks3subnets) {
         "        \"max-valid-lifetime\": 333\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 3,\n"
         "        \"subnet\": \"192.0.3.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n"
         "    }\n"
@@ -6583,10 +6688,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
         "    \"max-valid-lifetime\": 50,\n"
         "    \"subnet4\": [\n"
         "    { \n"
+        "        \"id\": 1,\n"
         "        \"subnet\": \"192.0.1.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2,\n"
         "        \"subnet\": \"192.0.2.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n"
         "        \"renew-timer\": 100,\n"
@@ -6611,6 +6718,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDerive) {
         "    \"name\": \"bar\",\n"
         "    \"subnet4\": [\n"
         "    {\n"
+        "        \"id\": 3,\n"
         "        \"subnet\": \"192.0.3.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n"
         "    }\n"
@@ -6716,10 +6824,12 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDeriveClientClass) {
         "    \"client-class\": \"alpha\",\n"
         "    \"subnet4\": [\n"
         "    { \n"
+        "        \"id\": 1,\n"
         "        \"subnet\": \"192.0.1.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.1.1-192.0.1.10\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2,\n"
         "        \"subnet\": \"192.0.2.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.2.1-192.0.2.10\" } ],\n"
         "        \"client-class\": \"beta\"\n"
@@ -6730,6 +6840,7 @@ TEST_F(Dhcp4ParserTest, sharedNetworksDeriveClientClass) {
         "    \"name\": \"bar\",\n"
         "    \"subnet4\": [\n"
         "    {\n"
+        "        \"id\": 3,\n"
         "        \"subnet\": \"192.0.3.0/24\",\n"
         "        \"pools\": [ { \"pool\": \"192.0.3.1-192.0.3.10\" } ]\n"
         "    }\n"
@@ -7506,11 +7617,13 @@ TEST_F(Dhcp4ParserTest, storeExtendedInfoNoGlobal) {
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"store-extended-info\": true,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"store-extended-info\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
@@ -7553,11 +7666,13 @@ TEST_F(Dhcp4ParserTest, storeExtendedInfoGlobal) {
         "\"store-extended-info\": true,"
         "\"subnet4\": [ "
         "{"
+        "    \"id\": 1,"
         "    \"store-extended-info\": false,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         "},"
         "{"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"subnet\": \"192.0.3.0/24\""
         "} ],"
index 5cf130618fffc521e6ee490af9e077f490583527..88d685f3e67bc5be4702cd441a6b0d2db0c06520 100644 (file)
@@ -748,13 +748,13 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configSet) {
         "        },"
         "        \"subnet4\": [ \n";
     string subnet1 =
-        "               {\"subnet\": \"192.2.0.0/24\", \n"
+        "               {\"subnet\": \"192.2.0.0/24\", \"id\": 1, \n"
         "                \"pools\": [{ \"pool\": \"192.2.0.1-192.2.0.50\" }]}\n";
     string subnet2 =
-        "               {\"subnet\": \"192.2.1.0/24\", \n"
+        "               {\"subnet\": \"192.2.1.0/24\", \"id\": 2, \n"
         "                \"pools\": [{ \"pool\": \"192.2.1.1-192.2.1.50\" }]}\n";
     string bad_subnet =
-        "               {\"comment\": \"192.2.2.0/24\", \n"
+        "               {\"comment\": \"192.2.2.0/24\", \"id\": 10, \n"
         "                \"pools\": [{ \"pool\": \"192.2.2.1-192.2.2.50\" }]}\n";
     string subnet_footer =
         "          ] \n";
@@ -985,13 +985,13 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configTest) {
         "        },"
         "        \"subnet4\": [ \n";
     string subnet1 =
-        "               {\"subnet\": \"192.2.0.0/24\", \n"
+        "               {\"subnet\": \"192.2.0.0/24\", \"id\": 1, \n"
         "                \"pools\": [{ \"pool\": \"192.2.0.1-192.2.0.50\" }]}\n";
     string subnet2 =
-        "               {\"subnet\": \"192.2.1.0/24\", \n"
+        "               {\"subnet\": \"192.2.1.0/24\", \"id\": 2, \n"
         "                \"pools\": [{ \"pool\": \"192.2.1.1-192.2.1.50\" }]}\n";
     string bad_subnet =
-        "               {\"comment\": \"192.2.2.0/24\", \n"
+        "               {\"comment\": \"192.2.2.0/24\", \"id\": 10, \n"
         "                \"pools\": [{ \"pool\": \"192.2.2.1-192.2.2.50\" }]}\n";
     string subnet_footer =
         "          ] \n";
@@ -1578,8 +1578,8 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadValid) {
         "        \"interfaces\": [ \"*\" ]"
         "    },"
         "    \"subnet4\": ["
-        "        { \"subnet\": \"192.0.2.0/24\" },"
-        "        { \"subnet\": \"192.0.3.0/24\" }"
+        "        { \"id\": 1, \"subnet\": \"192.0.2.0/24\" },"
+        "        { \"id\": 2, \"subnet\": \"192.0.3.0/24\" }"
         "     ],"
         "    \"valid-lifetime\": 4000,"
         "    \"lease-database\": {"
index 0a11144fd4a747874d7864049722d91960f98f66..a5114d8392c1f7383a0d35bf33ccec0af8663239 100644 (file)
@@ -100,6 +100,7 @@ Dhcp4SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -411,6 +412,7 @@ TEST_F(Dhcp4SrvD2Test, badTCP) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -450,6 +452,7 @@ TEST_F(Dhcp4SrvD2Test, badFamily) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
@@ -489,6 +492,7 @@ TEST_F(Dhcp4SrvD2Test, senderEqServer) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         " \"dhcp-ddns\" : {"
index 663df46a17a9d804e37cbd35e871d83a4ceab5c7..76e7177094f6d3c159dd3616f840faad7d62390b 100644 (file)
@@ -45,6 +45,7 @@ CONFIG="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ],
@@ -84,6 +85,7 @@ CONFIG_BAD_SYNTAX="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pool\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ],
@@ -119,6 +121,7 @@ CONFIG_BAD_VALUES="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pools\": [ { \"pool\": \"192.168.0.10-192.168.0.100\" } ]
         } ],
@@ -154,6 +157,7 @@ CONFIG_INVALID="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pool\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ],
@@ -194,6 +198,7 @@ INVALID_CONFIG_HOOKS_LOAD="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ],
@@ -245,6 +250,7 @@ INVALID_CONFIG_HOOKS_CALLOUT_FAIL="{
         },
         \"subnet4\": [
         {
+            \"id\": 1,
             \"subnet\": \"10.0.0.0/8\",
             \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]
         } ],
index 648bd83556e638b70937c8b152542c9ba42b3f84..c47c06f25095216e6f379f6c05020b33011aa50a 100644 (file)
@@ -75,6 +75,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ],"
         "    \"subnet\": \"10.254.226.0/24\", "
         "    \"rebind-timer\": 2000, "
@@ -99,6 +100,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"rebind-timer\": 2000, "
@@ -117,6 +119,7 @@ const char* CONFIGS[] = {
     "    \"renew-timer\": 1000, "
     "    \"valid-lifetime\": 4000, "
     "    \"subnet4\": [ {"
+    "        \"id\": 1,"
     "        \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
     "        \"subnet\": \"192.0.2.0/24\""
     "    } ], "
@@ -144,6 +147,7 @@ const char* CONFIGS[] = {
     "    \"renew-timer\": 1000, "
     "    \"valid-lifetime\": 4000, "
     "    \"subnet4\": [ {"
+    "        \"id\": 1,"
     "        \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
     "        \"subnet\": \"192.0.2.0/24\","
     "        \"option-data\": ["
@@ -172,6 +176,7 @@ const char* CONFIGS[] = {
     // - user-contexts defined in both subnet and pool
     "{"
         "    \"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.254.226.0/25\","
         "                   \"user-context\": { \"value\": 42 } } ],"
         "    \"subnet\": \"10.254.226.0/24\", "
@@ -3134,6 +3139,7 @@ TEST_F(Dhcpv4SrvTest, nextServerOverride) {
         "\"server-hostname\": \"nohost\", "
         "\"boot-file-name\": \"nofile\", "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"next-server\": \"1.2.3.4\", "
         "    \"server-hostname\": \"some-name.example.org\", "
@@ -3199,6 +3205,7 @@ TEST_F(Dhcpv4SrvTest, nextServerGlobal) {
         "\"server-hostname\": \"some-name.example.org\", "
         "\"boot-file-name\": \"bootfile.efi\", "
         "\"subnet4\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -3256,6 +3263,7 @@ TEST_F(Dhcpv4SrvTest, matchClassification) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ], "
         "\"client-classes\": [ "
         "{   \"name\": \"router\", "
@@ -3378,6 +3386,7 @@ TEST_F(Dhcpv4SrvTest, matchClassificationOptionName) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ], "
         "\"client-classes\": [ "
         "{   \"name\": \"router\", "
@@ -3425,6 +3434,7 @@ TEST_F(Dhcpv4SrvTest, matchClassificationOptionDef) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ], "
         "\"client-classes\": [ "
         "{   \"name\": \"router\", "
@@ -3479,6 +3489,7 @@ TEST_F(Dhcpv4SrvTest, subnetClassPriority) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": ["
         "        {    \"name\": \"ip-forwarding\", "
@@ -3556,6 +3567,7 @@ TEST_F(Dhcpv4SrvTest, subnetGlobalPriority) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"option-data\": ["
         "        {    \"name\": \"ip-forwarding\", "
@@ -3626,6 +3638,7 @@ TEST_F(Dhcpv4SrvTest, classGlobalPriority) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ], "
         "\"option-data\": ["
         "    {    \"name\": \"ip-forwarding\", "
@@ -3707,6 +3720,7 @@ TEST_F(Dhcpv4SrvTest, classGlobalPersistency) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ], "
         "\"option-data\": ["
         "    {    \"name\": \"ip-forwarding\", "
@@ -3790,9 +3804,11 @@ TEST_F(Dhcpv4SrvTest, clientClassify) {
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"client-class\": \"foo\", "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" }, "
         "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
         "    \"client-class\": \"xyzzy\", "
+        "    \"id\": 2, "
         "    \"subnet\": \"192.0.3.0/24\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -3851,6 +3867,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassify) {
         "      \"client-class\": \"foo\" }, "
         "    { \"pool\": \"192.0.3.1 - 192.0.3.100\", "
         "      \"client-class\": \"xyzzy\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.0.0/16\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -3919,6 +3936,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassifyKnown) {
         "      \"client-class\": \"KNOWN\" }, "
         "    { \"pool\": \"192.0.3.1 - 192.0.3.100\", "
         "      \"client-class\": \"UNKNOWN\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.0.0/16\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -3972,6 +3990,7 @@ TEST_F(Dhcpv4SrvTest, clientPoolClassifyUnknown) {
         "      \"client-class\": \"UNKNOWN\" }, "
         "    { \"pool\": \"192.0.3.1 - 192.0.3.100\", "
         "      \"client-class\": \"KNOWN\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.0.0/16\", "
         "    \"reservations\": [ { "
         "       \"hw-address\": \"00:00:00:11:22:33\", "
@@ -4028,6 +4047,7 @@ TEST_F(Dhcpv4SrvTest, privateOption) {
         "\"valid-lifetime\": 4000, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"private\", "
@@ -4239,11 +4259,13 @@ TEST_F(Dhcpv4SrvTest, relayOverride) {
         "    \"relay\": { "
         "        \"ip-address\": \"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\""
         "    },"
+        "    \"id\": 2, "
         "    \"subnet\": \"192.0.3.0/24\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -4326,11 +4348,13 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) {
         "    \"relay\": { "
         "        \"ip-address\": \"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\""
         "    },"
+        "    \"id\": 2, "
         "    \"subnet\": \"192.0.3.0/24\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -4387,11 +4411,14 @@ TEST_F(Dhcpv4SrvTest, relayLinkSelect) {
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.1\""
         "    },"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" }, "
         "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
+        "    \"id\": 2, "
         "    \"subnet\": \"192.0.3.0/24\" }, "
         "{   \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ],"
         "    \"client-class\": \"foo\", "
+        "    \"id\": 3, "
         "    \"subnet\": \"192.0.4.0/24\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -4519,11 +4546,14 @@ TEST_F(Dhcpv4SrvTest, relayIgnoreLinkSelect) {
                     "    \"relay\": { "
                     "        \"ip-address\": \"192.0.5.1\""
                     "    },"
+                    "    \"id\": 1, "
                     "    \"subnet\": \"192.0.2.0/24\" }, "
                     "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
+                    "    \"id\": 2, "
                     "    \"subnet\": \"192.0.3.0/24\" }, "
                     "{   \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ],"
                     "    \"client-class\": \"foo\", "
+                    "    \"id\": 3, "
                     "    \"subnet\": \"192.0.4.0/24\" } "
                     "],"
                     "\"valid-lifetime\": 4000 }";
@@ -4652,11 +4682,14 @@ TEST_F(Dhcpv4SrvTest, subnetSelect) {
         "    \"relay\": { "
         "        \"ip-address\": \"192.0.5.1\""
         "    },"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" }, "
         "{   \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
+        "    \"id\": 2, "
         "    \"subnet\": \"192.0.3.0/24\" }, "
         "{   \"pools\": [ { \"pool\": \"192.0.4.1 - 192.0.4.100\" } ],"
         "    \"client-class\": \"foo\", "
+        "    \"id\": 3, "
         "    \"subnet\": \"192.0.4.0/24\" } "
         "],"
         "\"valid-lifetime\": 4000 }";
@@ -5074,6 +5107,7 @@ TEST_F(Dhcpv4SrvTest, fixedFieldsInClassOrder) {
 
         "subnet4": [
         {
+            "id": 1,
             "subnet": "192.0.2.0/24",
             "pools": [ { "pool": "192.0.2.1 - 192.0.2.100" } ],
             "reservations": [
index c861a0f8b67aabdf3dd65a581a48ef8b27392167..27439e2baa2c4b563e7a4849973f44f29802d628 100644 (file)
@@ -153,6 +153,7 @@ DirectClientTest::configureSubnet(const std::string& prefix) {
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"" << prefix << "/24\" } ],"
         "    \"subnet\": \"" << prefix << "/24\", "
         "    \"rebind-timer\": 2000, "
@@ -175,6 +176,7 @@ DirectClientTest::configureTwoSubnets(const std::string& prefix1,
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"subnet4\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"" << prefix1 << "/24\" } ],"
         "    \"subnet\": \"" << prefix1 << "/24\", "
         "    \"rebind-timer\": 2000, "
@@ -182,6 +184,7 @@ DirectClientTest::configureTwoSubnets(const std::string& prefix1,
         "    \"valid-lifetime\": 4000"
         " },"
         "{ "
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"" << prefix2 << "/24\" } ],"
         "    \"subnet\": \"" << prefix2 << "/24\", "
         "    \"rebind-timer\": 2000, "
index bedf20d9bdf0bf45b4cee7481b8ef2307db65e34..be2c7cf25a3482973234560aa30295740ca2cfba 100644 (file)
@@ -204,6 +204,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1,"
         "    \"option-data\": [ {"
         "        \"name\": \"routers\","
         "        \"data\": \"192.0.2.200,192.0.2.201\""
@@ -230,6 +231,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -278,6 +280,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -309,6 +312,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -341,6 +345,7 @@ const char* DORA_CONFIGS[] = {
         "\"boot-file-name\": \"nofile\","
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -367,6 +372,7 @@ const char* DORA_CONFIGS[] = {
         "\"subnet4\": ["
         "    {"
         "        \"subnet\": \"10.0.0.0/24\", "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "        \"interface\": \"eth0\","
         "        \"option-data\": ["
@@ -378,6 +384,7 @@ const char* DORA_CONFIGS[] = {
         "    },"
         "    {"
         "        \"subnet\": \"192.0.2.0/26\", "
+        "        \"id\": 2, "
         "        \"pools\": [ { \"pool\": \"192.0.2.10-192.0.2.63\" } ],"
         "        \"interface\": \"eth1\","
         "        \"option-data\": ["
@@ -389,6 +396,7 @@ const char* DORA_CONFIGS[] = {
         "    },"
         "    {"
         "        \"subnet\": \"192.0.2.64/26\", "
+        "        \"id\": 3, "
         "        \"pools\": [ { \"pool\": \"192.0.2.65-192.0.2.100\" } ],"
         "        \"relay\": {"
         "            \"ip-address\": \"10.2.3.4\""
@@ -441,6 +449,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.5-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -458,6 +467,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\","
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations-global\": false,"
         "    \"reservations-in-subnet\": true,"
@@ -478,6 +488,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\","
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations-global\": false,"
         "    \"reservations-in-subnet\": false,"
@@ -497,6 +508,7 @@ const char* DORA_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\","
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations-global\": false,"
         "    \"reservations-in-subnet\": true,"
@@ -556,12 +568,14 @@ const char* DORA_CONFIGS[] = {
         "\"subnet4\": ["
         "    {"
         "        \"subnet\": \"10.0.0.0/24\", "
+        "        \"id\": 1, "
         "        \"store-extended-info\": true,"
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "        \"interface\": \"eth0\""
         "    },"
         "    {"
         "        \"subnet\": \"192.0.2.0/26\", "
+        "        \"id\": 2, "
         "        \"store-extended-info\": false,"
         "        \"pools\": [ { \"pool\": \"192.0.2.10-192.0.2.63\" } ],"
         "        \"interface\": \"eth1\""
@@ -578,6 +592,7 @@ const char* DORA_CONFIGS[] = {
         "\"subnet4\": ["
         "    {"
         "        \"subnet\": \"10.0.0.0/24\", "
+        "        \"id\": 1, "
         "        \"pools\": ["
         "            {"
         "                \"pool\": \"10.0.0.10-10.0.0.20\""
index 6622995dfa4cd902b514b8efd36b9f04b10dcdb6..5d60a75096691552e2d4f2970b3cca3e4e1b1c80 100644 (file)
@@ -1696,10 +1696,12 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectSimple) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\" "
         " }, {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ],"
         "    \"subnet\": \"192.0.3.0/24\" "
         " } ],"
@@ -1779,10 +1781,12 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectChange) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\" "
         " }, {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"192.0.3.0/25\" } ],"
         "    \"subnet\": \"192.0.3.0/24\" "
         " } ],"
@@ -3004,6 +3008,7 @@ TEST_F(HooksDhcpv4SrvTest, host4Identifier) {
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth0\", "
         "    \"reservations\": ["
         "        {"
@@ -3075,6 +3080,7 @@ TEST_F(HooksDhcpv4SrvTest, host4IdentifierHWAddr) {
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth0\", "
         "    \"reservations\": ["
         "        {"
@@ -3315,6 +3321,7 @@ TEST_F(HooksDhcpv4SrvTest, leases4ParkedPacketLimit) {
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth1\" "
         " } ],"
         "\"valid-lifetime\": 4000"
index da59968e9a08a654049c1f3cbd4cdf1471104c1e..74aace18bad434d236b33e52aa6ea9b804bbe41e 100644 (file)
@@ -74,6 +74,7 @@ const char* CONFIGS[] = {
         "\"valid-lifetime\": 600,\n"
         "\"subnet4\": [ { \n"
         "    \"subnet\": \"10.0.0.0/24\",\n"
+        "    \"id\": 10,\n"
         "    \"reservations-global\": true,\n"
         "    \"reservations-in-subnet\": false,\n"
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]\n"
@@ -97,7 +98,7 @@ const char* CONFIGS[] = {
         "\"subnet4\": [\n"
         "    {\n"
         "        \"subnet\": \"10.0.0.0/24\", \n"
-        "        \"id\": 10,"
+        "        \"id\": 10, \n"
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
         "        \"interface\": \"eth0\",\n"
         "        \"reservations\": [ \n"
@@ -136,7 +137,7 @@ const char* CONFIGS[] = {
         "\"subnet4\": [\n"
         "    {\n"
         "        \"subnet\": \"10.0.0.0/24\", \n"
-        "        \"id\": 10,"
+        "        \"id\": 10, \n"
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
         "        \"interface\": \"eth0\",\n"
         "        \"reservations-global\": false,\n"
@@ -166,7 +167,7 @@ const char* CONFIGS[] = {
         "\"subnet4\": [\n"
         "    {\n"
         "        \"subnet\": \"10.0.0.0/24\", \n"
-        "        \"id\": 10,"
+        "        \"id\": 10, \n"
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
         "        \"interface\": \"eth0\",\n"
         "        \"reservations-global\": false,\n"
@@ -211,7 +212,7 @@ const char* CONFIGS[] = {
         "    \"subnet4\": [\n"
         "        {\n"
         "            \"subnet\": \"10.0.0.0/24\", \n"
-        "            \"id\": 10,"
+        "            \"id\": 10, \n"
         "            \"pools\": ["
         "                {"
         "                    \"pool\": \"10.0.0.10-10.0.0.11\","
@@ -263,7 +264,7 @@ const char* CONFIGS[] = {
         "    \"subnet4\": [\n"
         "        {\n"
         "            \"subnet\": \"10.0.0.0/24\", \n"
-        "            \"id\": 10,"
+        "            \"id\": 10, \n"
         "            \"client-class\": \"reserved_class\","
         "            \"pools\": ["
         "                {"
@@ -304,7 +305,7 @@ const char* CONFIGS[] = {
         "\"subnet4\": [\n"
         "    {\n"
         "        \"subnet\": \"10.0.0.0/24\", \n"
-        "        \"id\": 10,"
+        "        \"id\": 10, \n"
         "        \"reservations\": [{ \n"
         "            \"hw-address\": \"aa:bb:cc:dd:ee:fe\",\n"
         "            \"client-classes\": [ \"reserved_class\" ]\n"
@@ -372,7 +373,7 @@ const char* CONFIGS[] = {
         "\"subnet4\": [\n"
         "    {\n"
         "        \"subnet\": \"10.0.0.0/24\", \n"
-        "        \"id\": 10,"
+        "        \"id\": 10, \n"
         "        \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],\n"
         "        \"interface\": \"eth0\",\n"
         "        \"reservations\": [ \n"
index 07bd35d6040b3aa3441f52fe6c5d5e5c31fa22ae..2482110f72807e306c8f5e09ba208912b9140f3f 100644 (file)
@@ -70,6 +70,7 @@ const char* INFORM_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"option-data\": [ {"
         "        \"name\": \"routers\","
@@ -97,6 +98,7 @@ const char* INFORM_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"option-data\": [ {"
         "        \"name\": \"routers\","
         "        \"data\": \"192.0.2.200,192.0.2.201\""
@@ -126,6 +128,7 @@ const char* INFORM_CONFIGS[] = {
         "\"boot-file-name\": \"nofile\","
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"reservations\": [ "
         "       {"
         "         \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
@@ -157,6 +160,7 @@ const char* INFORM_CONFIGS[] = {
         "],"
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"reservations\": [ "
         "       {"
         "         \"hw-address\": \"aa:bb:cc:dd:ee:ff\","
index b1ade98c255bc1ee7cb4202e8fe7a7ca4676a3dd..ea5149fdb9b37d277c55a4f53deaff45376965bc 100644 (file)
@@ -398,15 +398,17 @@ TEST_F(JSONFileBackendTest, jsonFile) {
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/24\" "
         " },"
         " {"
         "    \"pools\": [ { \"pool\": \"192.0.3.101 - 192.0.3.150\" } ],"
         "    \"subnet\": \"192.0.3.0/24\", "
-        "    \"id\": 0 "
+        "    \"id\": 2 "
         " },"
         " {"
         "    \"pools\": [ { \"pool\": \"192.0.4.101 - 192.0.4.150\" } ],"
+        "    \"id\": 3, "
         "    \"subnet\": \"192.0.4.0/24\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -483,6 +485,7 @@ TEST_F(JSONFileBackendTest, hashComments) {
         "# comments in the middle should be ignored, too\n"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -534,6 +537,7 @@ TEST_F(JSONFileBackendTest, cppLineComments) {
         "// comments in the middle should be ignored, too\n"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -585,6 +589,7 @@ TEST_F(JSONFileBackendTest, cBlockComments) {
         "/* comments in the middle should be ignored, too*/\n"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -637,6 +642,7 @@ TEST_F(JSONFileBackendTest, include) {
     string include = "\n"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ]\n";
 
@@ -683,6 +689,7 @@ TEST_F(JSONFileBackendTest, recursiveInclude) {
         "\"renew-timer\": 1000, \n"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.0/24\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"192.0.2.0/22\" "
         " } ],"
         "\"valid-lifetime\": 4000 }"
@@ -727,6 +734,7 @@ TEST_F(JSONFileBackendTest, configBroken) {
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "    \"pool\": [ \"2001:db8::/80\" ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8::/64\" "
         " } ]}";
 
index d5dc1f159afe43a769d2059d1ed18ea480f60786..c4758742e969fc6d579f5b0bef130566bdfcfeda 100644 (file)
@@ -48,6 +48,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -73,6 +74,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.101-10.0.0.200\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -98,6 +100,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.101-10.0.0.200\" } ],"
         "} ],"
         "\"dhcp-ddns\": {"
@@ -113,6 +116,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"192.0.2.101-192.0.2.200\" } ],"
         "    \"reservations\": [ "
         "       {"
@@ -138,6 +142,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"192.0.2.101-192.0.2.200\" } ]"
         "} ],"
         "\"dhcp-ddns\": {"
@@ -153,6 +158,7 @@ const char* OOR_CONFIGS[] = {
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ]"
         "} ],"
         "\"dhcp-ddns\": {"
index 706365d0859815e98f57b1e5f595bc09d879c383..426cf8e72429a00e484cfbc41bfe5eaa0b7065e0 100644 (file)
@@ -140,6 +140,7 @@ TEST(ParserTest, keywordDhcp4) {
                   "\"renew-timer\": 1000, \n"
                   "\"subnet4\": [ { "
                   "  \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                  "  \"id\": 1, "
                   "  \"subnet\": \"192.0.2.0/24\", "
                   "  \"interface\": \"test\" } ],\n"
                    "\"valid-lifetime\": 4000 } }";
@@ -159,6 +160,7 @@ TEST(ParserTest, bashComments) {
                 "\"renew-timer\": 1000, \n"
                 "\"subnet4\": [ { "
                 "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                "    \"id\": 1, "
                 "    \"subnet\": \"192.0.2.0/24\", "
                 "    \"interface\": \"eth0\""
                 " } ],"
@@ -175,6 +177,7 @@ TEST(ParserTest, cppComments) {
                 "\"renew-timer\": 1000, // this will be ignored, too\n"
                 "\"subnet4\": [ { "
                 "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                "    \"id\": 1, "
                 "    \"subnet\": \"192.0.2.0/24\", "
                 "    \"interface\": \"eth0\""
                 " } ],"
@@ -191,6 +194,7 @@ TEST(ParserTest, bashCommentsInline) {
                 "\"renew-timer\": 1000, # this will be ignored, too\n"
                 "\"subnet4\": [ { "
                 "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                "    \"id\": 1, "
                 "    \"subnet\": \"192.0.2.0/24\", "
                 "    \"interface\": \"eth0\""
                 " } ],"
@@ -209,6 +213,7 @@ TEST(ParserTest, multilineComments) {
                 "\"renew-timer\": 1000, \n"
                 "\"subnet4\": [ { "
                 "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                "    \"id\": 1, "
                 "    \"subnet\": \"192.0.2.0/24\", "
                 "    \"interface\": \"eth0\""
                 " } ],"
@@ -227,6 +232,7 @@ TEST(ParserTest, embbededComments) {
                 "\"subnet4\": [ { "
                 "    \"user-context\": { \"comment\": \"indirect\" },"
                 "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
+                "    \"id\": 1, "
                 "    \"subnet\": \"192.0.2.0/24\", "
                 "    \"interface\": \"eth0\""
                 " } ],"
@@ -948,6 +954,7 @@ TEST_F(TrailingCommasTest, tests) {
             "pool": "192.168.0.0/24",
           },
         ],
+        "id": 1,
         "subnet": "192.168.0.0/24",
       },
     ],
@@ -967,10 +974,10 @@ TEST_F(TrailingCommasTest, tests) {
     addLog("<string>:32.8");
     addLog("<string>:43.37");
     addLog("<string>:44.12");
-    addLog("<string>:46.35");
-    addLog("<string>:47.8");
-    addLog("<string>:48.6");
-    addLog("<string>:49.4");
+    addLog("<string>:47.35");
+    addLog("<string>:48.8");
+    addLog("<string>:49.6");
+    addLog("<string>:50.4");
     EXPECT_TRUE(checkFile());
 
     // Test with many consecutive commas.
index 4377f4590f1d7130ec4448689d20563ea62b9810..a5cefbe90af47e1e9b225ad8349cdc1a905e54ba 100644 (file)
@@ -1073,6 +1073,7 @@ const char* NETWORKS_CONFIG[] = {
     "            \"subnet4\": ["
     "                {"
     "                    \"subnet\": \"192.0.2.0/24\","
+    "                    \"id\": 100,"
     "                    \"allocator\": \"flq\","
     "                    \"pools\": ["
     "                        {"
@@ -1082,6 +1083,7 @@ const char* NETWORKS_CONFIG[] = {
     "                },"
     "                {"
     "                    \"subnet\": \"192.0.3.0/24\","
+    "                    \"id\": 10,"
     "                    \"allocator\": \"random\","
     "                    \"pools\": ["
     "                        {"
@@ -1111,6 +1113,7 @@ const char* NETWORKS_CONFIG[] = {
     "            \"subnet4\": ["
     "                {"
     "                    \"subnet\": \"192.0.2.0/24\","
+    "                    \"id\": 100,"
     "                    \"allocator\": \"random\","
     "                    \"pools\": ["
     "                        {"
@@ -1120,6 +1123,7 @@ const char* NETWORKS_CONFIG[] = {
     "                },"
     "                {"
     "                    \"subnet\": \"192.0.3.0/24\","
+    "                    \"id\": 10,"
     "                    \"allocator\": \"flq\","
     "                    \"pools\": ["
     "                        {"
index 327f67a3351126c3a12fe1571f1bd61df00b0618..cf38afcf7038d2ffddc534421e459c0f361b4df2 100644 (file)
@@ -165,7 +165,8 @@ public:
                                 "pool": "192.0.2.0/25"
                             }
                         ],
-                        "subnet": "192.0.2.0/24"
+                        "subnet": "192.0.2.0/24",
+                        "id": 10
                     }
                 ]
             }
@@ -433,7 +434,8 @@ public:
                                 "pool": "192.0.2.0/25"
                             }
                         ],
-                        "subnet": "192.0.2.0/24"
+                        "subnet": "192.0.2.0/24",
+                        "id": 10
                     }
                 ]
             }
@@ -691,7 +693,8 @@ public:
                                 "pool": "192.0.2.0/25"
                             }
                         ],
-                        "subnet": "192.0.2.0/24"
+                        "subnet": "192.0.2.0/24",
+                        "id": 10
                     }
                 ]
             }
@@ -852,7 +855,8 @@ TEST_F(VendorOptsTest, vendorOptionsDocsis) {
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ],"
         "    \"subnet\": \"10.254.226.0/24\", "
-        "    \"interface\": \"eth0\" "
+        "    \"interface\": \"eth0\", "
+        "    \"id\": 10"
         " } ],"
         "\"valid-lifetime\": 4000 }";
 
@@ -1357,6 +1361,7 @@ TEST_F(VendorOptsTest, vendorCancelledOptions) {
         "          \"data\": \"bar\""
         "        } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 10,"
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\", "
@@ -1457,6 +1462,7 @@ TEST_F(VendorOptsTest, vendorOptionsDocsisDefinitions) {
         "          \"csv-format\": true"
         "        }],"
         "\"subnet4\": [ { "
+        "    \"id\": 10,"
         "    \"pools\": [ { \"pool\":  \"192.0.2.1 - 192.0.2.50\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"\""
@@ -1564,6 +1570,7 @@ TEST_F(VendorOptsTest, vivsoInResponseOnly) {
         "        } ]"
         "    } ],"
         "\"subnet4\": [ { "
+        "    \"id\": 10,"
         "    \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"interface\": \"eth0\" "
@@ -1625,6 +1632,7 @@ TEST_F(VendorOptsTest, option43LastResort) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 1, "
@@ -1703,6 +1711,7 @@ TEST_F(VendorOptsTest, option43BadRaw) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"option-data\": [ "
         "{   \"name\": \"vendor-class-identifier\", "
@@ -1786,6 +1795,7 @@ TEST_F(VendorOptsTest, option43FailRaw) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 1, "
@@ -1855,6 +1865,7 @@ TEST_F(VendorOptsTest, option43RawGlobal) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 43, "
@@ -1942,6 +1953,7 @@ TEST_F(VendorOptsTest, option43RawClass) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"vendor\", "
@@ -2037,6 +2049,7 @@ TEST_F(VendorOptsTest, option43Class) {
         "    \"type\": \"uint32\" } ],"
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"alpha\", "
@@ -2166,6 +2179,7 @@ TEST_F(VendorOptsTest, option43ClassPriority) {
         "    \"data\": \"33\" } ],"
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"alpha\", "
@@ -2287,6 +2301,7 @@ TEST_F(VendorOptsTest, option43Classes) {
         "    \"type\": \"uint8\" } ],"
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"client-classes\": [ "
         "{   \"name\": \"alpha\", "
@@ -2414,6 +2429,7 @@ TEST_F(VendorOptsTest, clientOption43FailRaw) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"10.0.0.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 1, "
@@ -2449,6 +2465,7 @@ TEST_F(VendorOptsTest, clientOption43RawGlobal) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"10.0.0.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 1, "
@@ -2492,6 +2509,7 @@ TEST_F(VendorOptsTest, clientOption43RawClass) {
         "    \"interfaces\": [ \"*\" ] }, "
         "\"subnet4\": [ "
         "{   \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
+        "    \"id\": 10,"
         "    \"subnet\": \"10.0.0.0/24\" } ],"
         "\"option-def\": [ "
         "{   \"code\": 1, "
@@ -2539,6 +2557,7 @@ TEST_F(Dhcpv4SrvTest, truncatedVIVSOOption) {
         "},"
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"10.206.80.0/25\" } ],"
+        "    \"id\": 10,"
         "    \"subnet\": \"10.206.80.0/24\", "
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
@@ -2645,6 +2664,7 @@ TEST_F(VendorOptsTest, vendorOpsSubOption0) {
         "        }"
         "    ],"
         "\"subnet4\": [ { "
+        "    \"id\": 10,"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"subnet\": \"192.0.2.0/24\""
         " } ]"
@@ -2731,6 +2751,7 @@ TEST_F(VendorOptsTest, twoVivcos) {
         "        }"
         "    ],"
         "\"subnet4\": [ { "
+        "    \"id\": 10,"
         "    \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ],"
         "    \"subnet\": \"10.0.0.0/24\", "
         "    \"interface\": \"eth0\" "
index e2a1aaf7138ba0f1c5c694dfd643392a5fbb2c3c..fdc82cab8d3406db0efed3fca5a32bc00a7a638f 100644 (file)
@@ -158,6 +158,7 @@ const char* CONFIGS[] = {
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
         "    \"subnet\": \"2001:db8:1::/48\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth1\","
         "    \"reservations\": ["
         "    {"
@@ -214,6 +215,7 @@ const char* CONFIGS[] = {
         "],"
         "\"subnet6\": [ "
         "{   \"subnet\": \"2001:db8:1::/48\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth1\","
         "    \"pools\": [ "
         "        { \"pool\": \"2001:db8:1:1::/64\","
@@ -274,6 +276,7 @@ const char* CONFIGS[] = {
         "],"
         "\"subnet6\": [ "
         "{   \"subnet\": \"2001:db8::/32\", "
+        "    \"id\": 1, "
         "    \"interface\": \"eth1\","
         "    \"pd-pools\": [ "
         "        { \"prefix\": \"2001:db8:1::\","
@@ -317,6 +320,7 @@ const char* CONFIGS[] = {
         "],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\""
         " } ],"
@@ -337,6 +341,7 @@ const char* CONFIGS[] = {
         "],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\","
         "    \"reservations\": ["
@@ -369,6 +374,7 @@ const char* CONFIGS[] = {
         "],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\","
         "    \"reservations\": ["
@@ -578,6 +584,7 @@ TEST_F(ClassifyTest, matchClassification) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" } ],"
         "\"client-classes\": [ "
@@ -702,6 +709,7 @@ TEST_F(ClassifyTest, required) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" } ],"
         "\"client-classes\": [ "
@@ -809,6 +817,7 @@ TEST_F(ClassifyTest, requiredClassification) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"require-client-classes\": [ \"router\" ], "
         "    \"interface\": \"eth1\" } ],"
@@ -922,6 +931,7 @@ TEST_F(ClassifyTest, subnetClassPriority) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\", "
         "    \"option-data\": ["
@@ -1000,6 +1010,7 @@ TEST_F(ClassifyTest, subnetGlobalPriority) {
         "         \"data\": \"false\" } ], "
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\", "
         "    \"option-data\": ["
@@ -1063,6 +1074,7 @@ TEST_F(ClassifyTest, classGlobalPriority) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" } ],"
         "\"option-data\": ["
@@ -1145,6 +1157,7 @@ TEST_F(ClassifyTest, classGlobalPersistency) {
         "         \"never-send\": false } ], "
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\", "
         "    \"option-data\": ["
@@ -1215,6 +1228,7 @@ TEST_F(ClassifyTest, classNeverSend) {
         "         \"never-send\": false } ], "
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\", "
         "    \"option-data\": ["
@@ -1270,10 +1284,12 @@ TEST_F(ClassifyTest, clientClassifySubnet) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"client-class\": \"foo\" "
         " }, "
         " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
+        "    \"id\": 2, "
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"client-class\": \"xyzzy\" "
         " } "
@@ -1340,6 +1356,7 @@ TEST_F(ClassifyTest, clientClassifyPool) {
         "       \"client-class\": \"xyzzy\" "
         "    } "
         "   ], "
+        "   \"id\": 1, "
         "   \"subnet\": \"2001:db8::/40\" "
         " } "
         "], "
@@ -1424,6 +1441,7 @@ TEST_F(ClassifyTest, clientClassifyPoolKnown) {
         "       \"client-class\": \"UNKNOWN\" "
         "    } "
         "   ], "
+        "   \"id\": 1, "
         "   \"subnet\": \"2001:db8::/40\", "
         "   \"reservations\": [ "
         "      { \"duid\": \"01:02:03:04\", \"hostname\": \"foo\" } ] "
@@ -1535,6 +1553,7 @@ TEST_F(ClassifyTest, relayOverrideAndClientClass) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"client-class\": \"foo\", "
         "    \"relay\": { "
@@ -1542,6 +1561,7 @@ TEST_F(ClassifyTest, relayOverrideAndClientClass) {
         "    }"
         " }, "
         " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
+        "    \"id\": 2, "
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::1\""
@@ -1683,6 +1703,7 @@ TEST_F(ClassifyTest, member) {
         "    \"type\": \"boolean\" }],"
         "\"subnet6\": [ "
         "{   \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" } ],"
         "\"client-classes\": [ "
index 7eb5186d3c4ae371e5e929bf6abb3c7c4489d0f1..9ba9e352243d999b482770822701bdc7ed07e903 100644 (file)
@@ -78,6 +78,7 @@ const char* PARSER_CONFIGS[] = {
     "        \"pools\": [ "
     "            { \"pool\":  \"2001:db8::/64\" }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -98,6 +99,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -122,6 +124,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -146,6 +149,7 @@ const char* PARSER_CONFIGS[] = {
     "                }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -165,6 +169,7 @@ const char* PARSER_CONFIGS[] = {
     "              \"prefix-len\": 56,"
     "              \"delegated-len\": 64 }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -186,6 +191,7 @@ const char* PARSER_CONFIGS[] = {
     "              \"user-context\": { }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -212,6 +218,7 @@ const char* PARSER_CONFIGS[] = {
     "              }"
     "            }"
     "        ],"
+    "        \"id\": 1,"
     "        \"subnet\": \"2001:db8::/32\""
     "     } ]"
     "}",
@@ -583,6 +590,7 @@ public:
             "  \"space\": \"dhcp6\""
             "} ],"
             "\"subnet6\": [ { "
+            "    \"id\": 1, "
             "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
             "    \"subnet\": \"2001:db8:1::/64\", "
             "    \"option-data\": [ {";
@@ -1043,6 +1051,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) {
 
     string too_small =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000 }";
@@ -1060,6 +1069,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) {
 
     string too_large =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"valid-lifetime\": 2000, \"max-valid-lifetime\": 1000 }";
@@ -1074,6 +1084,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) {
 
     string before =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"valid-lifetime\": 1000, \"min-valid-lifetime\": 2000, "
@@ -1089,6 +1100,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) {
 
     string after =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"valid-lifetime\": 5000, \"min-valid-lifetime\": 1000, "
@@ -1104,6 +1116,7 @@ TEST_F(Dhcp6ParserTest, outBoundValidLifetime) {
 
     string crossed =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"valid-lifetime\": 1500, \"min-valid-lifetime\": 2000, "
@@ -1190,6 +1203,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) {
 
     string too_small =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"preferred-lifetime\": 1000, \"min-preferred-lifetime\": 2000 }";
@@ -1207,6 +1221,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) {
 
     string too_large =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"preferred-lifetime\": 2000, \"max-preferred-lifetime\": 1000 }";
@@ -1221,6 +1236,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) {
 
     string before =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"preferred-lifetime\": 1000, \"min-preferred-lifetime\": 2000, "
@@ -1236,6 +1252,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) {
 
     string after =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"preferred-lifetime\": 5000, \"min-preferred-lifetime\": 1000, "
@@ -1251,6 +1268,7 @@ TEST_F(Dhcp6ParserTest, outBoundPreferredLifetime) {
 
     string crossed =  "{ " + genIfaceConfig() + "," +
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/32\" } ],"
         "\"preferred-lifetime\": 1500, \"min-preferred-lifetime\": 2000, "
@@ -1363,6 +1381,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000,"
@@ -1407,19 +1426,22 @@ TEST_F(Dhcp6ParserTest, multipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
-        "    \"id\": 0"
         " },"
         " {"
+        "    \"id\": 3,"
         "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\" "
         " },"
         " {"
+        "    \"id\": 4,"
         "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\" "
         " } ],"
@@ -1699,6 +1721,7 @@ TEST_F(Dhcp6ParserTest, compatibility) {
         "    \"lenient-option-parsing\": true"
         "},"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1728,6 +1751,7 @@ TEST_F(Dhcp6ParserTest, compatibilityUnknown) {
         "    \"foo-bar\": true"
         "},"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1755,6 +1779,7 @@ TEST_F(Dhcp6ParserTest, compatibilityNotBool) {
         "    \"lenient-option-parsing\": 1"
         "},"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1783,6 +1808,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"renew-timer\": 1, "
         "    \"rebind-timer\": 2, "
@@ -1832,6 +1858,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) {
                 "\"rebind-timer\": 2000, "
                 "\"renew-timer\": 1000, "
                 "\"subnet6\": [ { "
+                "    \"id\": 1,"
                 "    \"pools\": [ { "
                 "        \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
                 "    \"interface\": \"" + iface + "\","
@@ -1866,6 +1893,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface\": \"" + bogus_iface_ + "\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
@@ -1897,6 +1925,7 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) {
         "\"renew-timer\": 1000, "
         "\"interface\": \"" + valid_iface_ + "\"," // Not valid. Can be defined in subnet only
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1928,6 +1957,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface-id\": \"" + valid_interface_id + "\","
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
@@ -1971,6 +2001,7 @@ TEST_F(Dhcp6ParserTest, interfaceIdGlobal) {
         "\"renew-timer\": 1000, "
         "\"interface-id\": \"foobar\"," // Not valid. Can be defined in subnet only
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -1995,6 +2026,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceAndInterfaceId) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"interface\": \"" + valid_iface_ + "\","
         "    \"interface-id\": \"foobar\","
@@ -2089,6 +2121,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) {
                         "\"subnet6\": [ { "
                         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - "
                         "2001:db8:1::ffff\" } ],"
+                        "    \"id\": 1,"
                         "    \"subnet\": \"2001:db8:1::/64\" } ],"
                         "\"valid-lifetime\": 4000 }",
                         false);
@@ -2104,6 +2137,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) {
                         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - "
                         "2001:db8:1::ffff\" } ],"
                         "    \"rapid-commit\": true,"
+                        "    \"id\": 1,"
                         "    \"subnet\": \"2001:db8:1::/64\" } ],"
                         "\"valid-lifetime\": 4000 }",
                         true);
@@ -2119,6 +2153,7 @@ TEST_F(Dhcp6ParserTest, subnetRapidCommit) {
                         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - "
                         "2001:db8:1::ffff\" } ],"
                         "    \"rapid-commit\": false,"
+                        "    \"id\": 1,"
                         "    \"subnet\": \"2001:db8:1::/64\" } ],"
                         "\"valid-lifetime\": 4000 }",
                         false);
@@ -2134,6 +2169,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ "
         "        { \"pool\": \"2001:db8:1::/96\" },"
         "        { \"pool\": \"2001:db8:1:0:abcd::/112\" }"
@@ -2141,6 +2177,7 @@ TEST_F(Dhcp6ParserTest, multiplePools) {
         "    \"subnet\": \"2001:db8:1::/64\" "
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ "
         "    { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ff\" },"
         "    { \"pool\": \"2001:db8:2::300 - 2001:db8:2::3ff\" }"
@@ -2195,6 +2232,7 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"4001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2225,6 +2263,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2257,6 +2296,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2267,6 +2307,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/foo\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2277,6 +2318,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/200\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2287,6 +2329,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2297,6 +2340,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"foo - bar\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2307,6 +2351,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::ffff - 2001:db8:1::\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2317,6 +2362,7 @@ TEST_F(Dhcp6ParserTest, badPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/1104\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         "\"valid-lifetime\": 4000 }";
@@ -2393,6 +2439,7 @@ TEST_F(Dhcp6ParserTest, pdPoolBasics) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1::\", "
@@ -2450,6 +2497,7 @@ TEST_F(Dhcp6ParserTest, pdPoolPrefixExclude) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
@@ -2523,6 +2571,7 @@ TEST_F(Dhcp6ParserTest, pdPoolList) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1:04::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/40\","
         "    \"pd-pools\": ["
@@ -2590,6 +2639,7 @@ TEST_F(Dhcp6ParserTest, subnetAndPrefixDelegated) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1::\", "
@@ -2649,6 +2699,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { "
@@ -2663,6 +2714,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1::\", "
@@ -2676,6 +2728,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1::\", "
@@ -2689,6 +2742,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:1::\", "
@@ -3327,6 +3381,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaultsGlobal) {
         "    \"data\": \"01\""
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ],"
@@ -3391,6 +3446,7 @@ TEST_F(Dhcp6ParserTest, optionDataDefaultsSubnet) {
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"option-data\": [ {"
@@ -3491,6 +3547,7 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) {
         "    \"space\": \"isc\""
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
@@ -3627,6 +3684,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
         "    \"space\": \"isc\""
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
@@ -3672,6 +3730,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"option-data\": [ {"
@@ -3681,6 +3740,7 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
         "        } ]"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"option-data\": [ {"
@@ -3752,6 +3812,7 @@ TEST_F(Dhcp6ParserTest, optionDataMultiplePools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { "
         "        \"pool\": \"2001:db8:1::10 - 2001:db8:1::100\","
         "        \"option-data\": [ {"
@@ -4218,6 +4279,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsHex) {
         "    \"csv-format\": false"
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
@@ -4276,6 +4338,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsCsv) {
         "    \"space\": \"vendor-4491\""
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
@@ -4398,6 +4461,7 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
         "    \"space\": \"vendor-1234\""
         " } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ]"
@@ -4732,6 +4796,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfo) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:1::abcd\""
@@ -4765,6 +4830,7 @@ TEST_F(Dhcp6ParserTest, subnetRelayInfoList) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"relay\": { "
         "        \"ip-addresses\": [ \"2001:db9::abcd\", \"2001:db9::abce\" ]"
@@ -4801,21 +4867,25 @@ TEST_F(Dhcp6ParserTest, classifySubnets) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\", "
         "    \"client-class\": \"alpha\" "
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
         "    \"client-class\": \"beta\" "
         " },"
         " {"
+        "    \"id\": 3,"
         "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\", "
         "    \"client-class\": \"gamma\" "
         " },"
         " {"
+        "    \"id\": 4,"
         "    \"pools\": [ { \"pool\": \"2001:db8:4::/80\" } ],"
         "    \"subnet\": \"2001:db8:4::/64\" "
         " } ],"
@@ -4894,6 +4964,7 @@ TEST_F(Dhcp6ParserTest, classifyPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { "
         "        \"pool\": \"2001:db8:1::/80\", "
         "        \"client-class\": \"alpha\" "
@@ -4984,6 +5055,7 @@ TEST_F(Dhcp6ParserTest, classifyPdPools) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pd-pools\": [ { "
         "        \"prefix-len\": 48, "
         "        \"delegated-len\": 64, "
@@ -5087,6 +5159,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigValid) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
@@ -5156,6 +5229,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigMoveToGlobal) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
@@ -5233,6 +5307,7 @@ TEST_F(Dhcp6ParserTest, d2ClientConfigBoth) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
@@ -5310,6 +5385,7 @@ TEST_F(Dhcp6ParserTest, invalidD2ClientConfig) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ], "
         " \"dhcp-ddns\" : {"
@@ -5849,6 +5925,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"reservations-global\": false,"
@@ -5856,6 +5933,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"reservations-global\": false,"
@@ -5863,22 +5941,26 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": true"
         " },"
         " {"
+        "    \"id\": 3,"
         "    \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ],"
         "    \"subnet\": \"2001:db8:3::/48\", "
         "    \"reservations-global\": false,"
         "    \"reservations-in-subnet\": false"
         " },"
         " {"
+        "    \"id\": 4,"
         "    \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ],"
         "    \"subnet\": \"2001:db8:4::/48\", "
         "    \"reservations-global\": true,"
         "    \"reservations-in-subnet\": false"
         " },"
         " {"
+        "    \"id\": 5,"
         "    \"pools\": [ { \"pool\": \"2001:db8:5::/64\" } ],"
         "    \"subnet\": \"2001:db8:5::/48\" "
         " },"
         " {"
+        "    \"id\": 6,"
         "    \"pools\": [ { \"pool\": \"2001:db8:6::/64\" } ],"
         "    \"subnet\": \"2001:db8:6::/48\", "
         "    \"reservations-global\": true,"
@@ -5886,6 +5968,7 @@ TEST_F(Dhcp6ParserTest, hostReservationPerSubnet) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 7,"
         "    \"pools\": [ { \"pool\": \"2001:db8:7::/64\" } ],"
         "    \"subnet\": \"2001:db8:7::/48\", "
         "    \"reservations-global\": true,"
@@ -5983,6 +6066,7 @@ TEST_F(Dhcp6ParserTest, hostReservationGlobal) {
         "\"reservations-in-subnet\": true,"
         "\"reservations-out-of-pool\": true,"
         "\"subnet6\": [ { "
+        "    \"id\": 1,"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"reservations-global\": false,"
@@ -5990,6 +6074,7 @@ TEST_F(Dhcp6ParserTest, hostReservationGlobal) {
         "    \"reservations-out-of-pool\": false"
         " },"
         " {"
+        "    \"id\": 2,"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\" "
         " } ],"
@@ -6406,6 +6491,7 @@ TEST_F(Dhcp6ParserTest, validClientClassDictionary) {
         "   } \n"
         "], \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ], \n"
         "    \"subnet\": \"2001:db8:1::/64\" } ], \n"
         "\"valid-lifetime\": 4000 } \n";
@@ -6448,6 +6534,7 @@ TEST_F(Dhcp6ParserTest, invalidClientClassDictionary) {
         "   } \n"
         "], \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\":  \"2001:db8::1 - 2001:db8::ffff\" } ], \n"
         "    \"subnet\": \"2001:db8::/64\"  \n"
         " } ] \n"
@@ -6635,6 +6722,7 @@ TEST_F(Dhcp6ParserTest, invalidPoolRange) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"2001:db8:: - 200:1db8::ffff\" } ], \n"
         "    \"subnet\": \"2001:db8::/32\"  \n"
         " } ] \n"
@@ -6653,7 +6741,7 @@ TEST_F(Dhcp6ParserTest, invalidPoolRange) {
 
     EXPECT_EQ(1, rcode);
     string expected = "Failed to create pool defined by: "
-        "2001:db8::-200:1db8::ffff (<string>:7:26)";
+        "2001:db8::-200:1db8::ffff (<string>:8:26)";
     EXPECT_EQ(expected, text);
 }
 
@@ -6666,6 +6754,7 @@ TEST_F(Dhcp6ParserTest, outsideSubnetPool) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"2001:db8:: - 2001:db8::ffff\" } ], \n"
         "    \"subnet\": \"2001:dc8::/32\"  \n"
         " } ] \n"
@@ -6697,6 +6786,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmpty) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8::/48\"  \n"
         " } ],\n"
         "\"shared-networks\": [ ]\n"
@@ -6713,6 +6803,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksNoName) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8::/48\"  \n"
         " } ],\n"
         "\"shared-networks\": [ { } ]\n"
@@ -6728,6 +6819,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmptyName) {
         "\"rebind-timer\": 2000, \n"
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8::/48\"  \n"
         " } ],\n"
         "\"shared-networks\": [ { \"name\": \"\" } ]\n"
@@ -6742,6 +6834,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksEmptyName) {
 TEST_F(Dhcp6ParserTest, sharedNetworksName) {
     string config = "{\n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8::/48\",\n"
         "    \"pools\": [ { \"pool\": \"2001:db8::1 - 2001:db8::ffff\" } ]\n"
         " } ],\n"
@@ -6775,6 +6868,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworks1subnet) {
         "\"shared-networks\": [ {\n"
         "    \"name\": \"foo\"\n,"
         "    \"subnet6\": [ { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db8::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db8::1 - 2001:db8::ffff\" } ]\n"
         "    } ]\n"
@@ -6834,10 +6928,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworks3subnets) {
         "    \"name\": \"foo\"\n,"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
         "        \"renew-timer\": 2,\n"
@@ -6850,6 +6946,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworks3subnets) {
         "        \"max-valid-lifetime\": 3333\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 3, \n"
         "        \"subnet\": \"2001:db3::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n"
         "    }\n"
@@ -6953,10 +7050,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) {
         "    \"reservations-in-subnet\": false,\n"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
         "        \"renew-timer\": 100\n,"
@@ -6982,6 +7081,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDerive) {
         "    \"name\": \"bar\",\n"
         "    \"subnet6\": [\n"
         "    {\n"
+        "        \"id\": 3, \n"
         "        \"subnet\": \"2001:db3::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n"
         "    }\n"
@@ -7077,10 +7177,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveInterfaces) {
         "    \"rebind-timer\": 10, \n"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"rebind-timer\": 100, \n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
@@ -7092,6 +7194,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveInterfaces) {
         "    \"name\": \"bar\",\n"
         "    \"subnet6\": [\n"
         "    {\n"
+        "        \"id\": 3, \n"
         "        \"subnet\": \"2001:db3::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n"
         "    }\n"
@@ -7162,10 +7265,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksInterfacesMixed) {
         "    \"name\": \"foo\"\n,"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"interface\": \"eth0\"\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"interface\": \"eth1\"\n"
         "    }\n"
@@ -7187,10 +7292,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveClientClass) {
         "    \"client-class\": \"alpha\",\n"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
         "        \"client-class\": \"beta\"\n"
@@ -7201,6 +7308,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksDeriveClientClass) {
         "    \"name\": \"bar\",\n"
         "    \"subnet6\": [\n"
         "    {\n"
+        "        \"id\": 3, \n"
         "        \"subnet\": \"2001:db3::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n"
         "    }\n"
@@ -7265,10 +7373,12 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommit) {
         "    \"rapid-commit\": true,\n"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
         "        \"client-class\": \"beta\"\n"
@@ -7280,6 +7390,7 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommit) {
         "    \"rapid-commit\": false,\n"
         "    \"subnet6\": [\n"
         "    {\n"
+        "        \"id\": 3, \n"
         "        \"subnet\": \"2001:db3::/48\",\n"
         "        \"pools\": [ { \"pool\": \"2001:db3::/64\" } ]\n"
         "    }\n"
@@ -7334,11 +7445,13 @@ TEST_F(Dhcp6ParserTest, sharedNetworksRapidCommitMix) {
         "    \"name\": \"frog\"\n,"
         "    \"subnet6\": [\n"
         "    { \n"
+        "        \"id\": 1, \n"
         "        \"subnet\": \"2001:db1::/48\",\n"
         "        \"rapid-commit\": true,\n"
         "        \"pools\": [ { \"pool\": \"2001:db1::/64\" } ]\n"
         "    },\n"
         "    { \n"
+        "        \"id\": 2, \n"
         "        \"subnet\": \"2001:db2::/48\",\n"
         "        \"rapid-commit\": false,\n"
         "        \"pools\": [ { \"pool\": \"2001:db2::/64\" } ],\n"
@@ -8018,11 +8131,13 @@ TEST_F(Dhcp6ParserTest, storeExtendedInfoGlobal) {
         "\"store-extended-info\": true,"
         "\"subnet6\": [ "
         "{ "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\","
         "    \"store-extended-info\": false"
         "},"
         "{"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ffff\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\" "
         "} ],"
@@ -8054,10 +8169,12 @@ TEST_F(Dhcp6ParserTest, storeExtendedInfoNoGlobal) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         "{ "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         "},"
         "{"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::ffff\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\","
         "    \"store-extended-info\": true"
@@ -8189,6 +8306,7 @@ TEST_F(Dhcp6ParserTest, clientClassValidPreferredLifetime) {
         "   } \n"
         "], \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ] \n"
@@ -8253,6 +8371,7 @@ TEST_F(Dhcp6ParserTest, templateClientClassValidPreferredLifetime) {
         "   } \n"
         "], \n"
         "\"subnet6\": [ {  \n"
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\""
         " } ] \n"
index c61873667cb7f4e6323fb0db61c29ee38f15e400..7aefeea48da48dc2bf8f86b54ea3b09a59ea7a4a 100644 (file)
@@ -41,12 +41,14 @@ const char* CONFIRM_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [  { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [  { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"interface-id\": \"\","
@@ -62,12 +64,14 @@ const char* CONFIRM_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [  { \"pool\": \"3000:1::/64\" } ],"
         "    \"subnet\": \"3000:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [  { \"pool\": \"3000:2::/64\" } ],"
         "    \"subnet\": \"3000:2::/48\", "
         "    \"interface-id\": \"\","
index ee36a7c2978cb18dea270b52ac25e8b9e6647379..f39062b9494f76e5a4c03a5af83b8fa65ac13040 100644 (file)
@@ -661,13 +661,13 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configSet) {
         "        },"
         "        \"subnet6\": [ \n";
     string subnet1 =
-        "               {\"subnet\": \"3002::/64\", \n"
+        "               {\"subnet\": \"3002::/64\", \"id\": 1, \n"
         "                \"pools\": [{ \"pool\": \"3002::100-3002::200\" }]}\n";
     string subnet2 =
-        "               {\"subnet\": \"3003::/64\", \n"
+        "               {\"subnet\": \"3003::/64\", \"id\": 2, \n"
         "                \"pools\": [{ \"pool\": \"3003::100-3003::200\" }]}\n";
     string bad_subnet =
-        "               {\"comment\": \"3005::/64\", \n"
+        "               {\"comment\": \"3005::/64\", \"id\": 10, \n"
         "                \"pools\": [{ \"pool\": \"3005::100-3005::200\" }]}\n";
     string subnet_footer =
         "          ] \n";
@@ -899,13 +899,13 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configTest) {
         "        },"
         "        \"subnet6\": [ \n";
     string subnet1 =
-        "               {\"subnet\": \"3002::/64\", \n"
+        "               {\"subnet\": \"3002::/64\", \"id\": 1, \n"
         "                \"pools\": [{ \"pool\": \"3002::100-3002::200\" }]}\n";
     string subnet2 =
-        "               {\"subnet\": \"3003::/64\", \n"
+        "               {\"subnet\": \"3003::/64\", \"id\": 2, \n"
         "                \"pools\": [{ \"pool\": \"3003::100-3003::200\" }]}\n";
     string bad_subnet =
-        "               {\"comment\": \"3005::/64\", \n"
+        "               {\"comment\": \"3005::/64\", \"id\": 10, \n"
         "                \"pools\": [{ \"pool\": \"3005::100-3005::200\" }]}\n";
     string subnet_footer =
         "          ] \n";
@@ -1607,8 +1607,8 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadValid) {
         "        \"interfaces\": [ \"*\" ]"
         "    },"
         "    \"subnet6\": ["
-        "        { \"subnet\": \"2001:db8:1::/64\" },"
-        "        { \"subnet\": \"2001:db8:2::/64\" }"
+        "        { \"subnet\": \"2001:db8:1::/64\", \"id\": 1 },"
+        "        { \"subnet\": \"2001:db8:2::/64\", \"id\": 2 }"
         "     ],"
         "    \"lease-database\": {"
         "       \"type\": \"memfile\", \"persist\": false }"
index ef58d21d5a053dfb275b4ebc9afa493c58567c46..98157d275fe8e9bc0705ca7372754805d932540c 100644 (file)
@@ -105,6 +105,7 @@ Dhcp6SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::ffff\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" } ],"
         " \"dhcp-ddns\" : {"
index 7ae1701c38ab23a98de0d01dd10018cd7f86a608..b3db3adbcddc3a9da75c482b62d8468714cc505b 100644 (file)
@@ -36,6 +36,7 @@ const char* DECLINE_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
@@ -56,6 +57,7 @@ const char* DECLINE_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
@@ -76,6 +78,7 @@ const char* DECLINE_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
index 8fd9b3586765ee3cd1047c1a6ea7f865b11ffe13..085728793714beb35337ba1b593efc039fa94437 100644 (file)
@@ -51,6 +51,7 @@ CONFIG="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
+            \"id\": 1,
             \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ],
         \"dhcp-ddns\": {
@@ -91,6 +92,7 @@ CONFIG_BAD_SYNTAX="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
+            \"id\": 1,
             \"pool\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ],
         \"loggers\": [
@@ -127,6 +129,7 @@ CONFIG_INVALID="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
+            \"id\": 1,
             \"pool\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ],
         \"loggers\": [
@@ -169,6 +172,7 @@ CONFIG_BAD_VALUES="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8::/64\",
+            \"id\": 1,
             \"pools\": [ { \"pool\": \"3000::-3000::ffff\" } ]
         } ],
         \"dhcp-ddns\": {
@@ -207,6 +211,7 @@ INVALID_CONFIG_HOOKS_LOAD="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
+            \"id\": 1,
             \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ],
         \"dhcp-ddns\": {
@@ -263,6 +268,7 @@ INVALID_CONFIG_HOOKS_CALLOUT_FAIL="{
         \"subnet6\": [
         {
             \"subnet\": \"2001:db8:1::/64\",
+            \"id\": 1,
             \"pools\": [ { \"pool\": \"2001:db8:1::10-2001:db8:1::100\" } ]
         } ],
         \"dhcp-ddns\": {
index ee4eb465e1b98ed1931f44f7e4c4f1592b137c94..5a618d1d1b1e08cab0cb3677c69a618454d4c1fd 100644 (file)
@@ -77,6 +77,7 @@ const char* CONFIGS[] = {
     "\"rebind-timer\": 2000, "
     "\"renew-timer\": 1000, "
     "\"subnet6\": [ { "
+    "    \"id\": 1, "
     "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
     "    \"subnet\": \"2001:db8:1::/48\", "
     "    \"interface\": \"eth0\", "
@@ -108,6 +109,7 @@ const char* CONFIGS[] = {
     "\"rebind-timer\": 2000, "
     "\"renew-timer\": 1000, "
     "\"subnet6\": [ { "
+    "    \"id\": 1, "
     "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
     "    \"subnet\": \"2001:db8:1::/48\" "
     " } ],"
@@ -123,6 +125,7 @@ const char* CONFIGS[] = {
     "    \"renew-timer\": 1000, "
     "    \"valid-lifetime\": 4000, "
     "    \"subnet6\": [ {"
+    "       \"id\": 1, "
     "       \"interface\": \"eth0\", "
     "       \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
     "       \"subnet\": \"2001:db8:1::/48\""
@@ -150,6 +153,7 @@ const char* CONFIGS[] = {
     "    \"renew-timer\": 1000, "
     "    \"valid-lifetime\": 4000, "
     "    \"subnet6\": [ {"
+    "       \"id\": 1, "
     "       \"interface\": \"eth0\", "
     "       \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], "
     "       \"subnet\": \"2001:db8:1::/48\", "
@@ -177,6 +181,7 @@ const char* CONFIGS[] = {
     // - user-contexts defined in subnet and each pool
     "{"
     "    \"subnet6\": [ {"
+    "       \"id\": 1, "
     "       \"pools\": [ {"
     "           \"pool\": \"2001:db8:1::/64\","
     "           \"user-context\": { \"value\": 42 }"
@@ -2842,6 +2847,7 @@ TEST_F(Dhcpv6SrvTest, relaySourcePort) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3127,12 +3133,14 @@ TEST_F(Dhcpv6SrvTest, relayOverride) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " {  \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::1\""
         "    }"
         " }, "
         " {  \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
+        "    \"id\": 2, "
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"relay\": { "
         "        \"ip-address\": \"2001:db8:3::2\""
@@ -3237,6 +3245,7 @@ TEST_F(Dhcpv6SrvTest, rsoo) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3288,6 +3297,7 @@ TEST_F(Dhcpv6SrvTest, rsoo2relays) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3405,6 +3415,7 @@ TEST_F(Dhcpv6SrvTest, rsooOverride) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3559,6 +3570,7 @@ TEST_F(Dhcpv6SrvTest, emptyClientId) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3596,6 +3608,7 @@ TEST_F(Dhcpv6SrvTest, emptyServerId) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
@@ -3629,6 +3642,7 @@ TEST_F(Dhcpv6SrvTest, tooLongServerId) {
         "    \"rebind-timer\": 2000, "
         "    \"renew-timer\": 1000, "
         "    \"subnet6\": [ { "
+        "        \"id\": 1, "
         "        \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "        \"subnet\": \"2001:db8::/48\" "
         "     } ],"
index 9deabdd6a090e2f0efeceefab8d141255d338af0..31d3d374697fe31b0237e5ee3dcb321606d03f2a 100644 (file)
@@ -427,6 +427,7 @@ public:
             "\"rebind-timer\": 2000, \n"
             "\"renew-timer\": 1000, \n"
             "\"subnet6\": [ { \n"
+            "    \"id\": 1, \n"
             "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n"
             "    \"subnet\": \"2001:db8:1::/48\", \n"
             "    \"interface\": \"eth0\" \n"
@@ -1462,6 +1463,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationSuffix) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -1516,6 +1518,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationNoSuffix) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -1565,6 +1568,7 @@ TEST_F(FqdnDhcpv6SrvTest, hostnameReservationDdnsDisabled) {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -1667,11 +1671,13 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsScopeTest) {
         "\"renew-timer\": 1000,\n"
         "\"ddns-send-updates\": false,\n"
         "\"subnet6\": [ {\n"
+        "    \"id\": 1, \n"
         "    \"subnet\": \"2001:db8:1::/48\",\n"
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ],\n"
         "    \"interface\": \"eth0\"\n"
         " },\n"
         " {\n"
+        "    \"id\": 2, \n"
         "    \"subnet\": \"2001:db8:2::/48\",\n"
         "    \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::10\" } ],\n"
         "    \"interface\": \"eth1\",\n"
@@ -1764,12 +1770,14 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest) {
             "\"name\": \"frog\", \n"
             "\"interface\": \"eth0\", \n"
             "\"subnet6\": [ { \n"
+                "\"id\": 1, \n"
                 "\"subnet\": \"2001:db8:1::/64\", \n"
                 "\"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::1\" } ], \n"
                 "\"interface\": \"eth0\", \n"
                 "\"ddns-qualifying-suffix\": \"one.example.com.\" \n"
             " }, \n"
             " { \n"
+                "\"id\": 2, \n"
                 "\"subnet\": \"2001:db8:2::/64\", \n"
                 "\"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::1\" } ], \n"
                 "\"interface\": \"eth0\", \n"
@@ -1918,6 +1926,7 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest2) {
             "\"name\": \"frog\", \n"
             "\"interface\": \"eth0\", \n"
             "\"subnet6\": [ { \n"
+                "\"id\": 1, \n"
                 "\"subnet\": \"2001:db8:1::/64\", \n"
                 "\"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::1\" } ], \n"
                 "\"interface\": \"eth0\", \n"
@@ -1925,6 +1934,7 @@ TEST_F(FqdnDhcpv6SrvTest, ddnsSharedNetworkTest2) {
                 "\"ddns-send-updates\": true \n"
             " }, \n"
             " { \n"
+                "\"id\": 2, \n"
                 "\"subnet\": \"2001:db8:2::/64\", \n"
                 "\"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::1\" } ], \n"
                 "\"interface\": \"eth0\", \n"
index d5246d0ea231a70aa548a15f46de9fd28058eaf9..06a5d21c17efd762dd0f840626f731c2eb3bacc4 100644 (file)
@@ -1704,10 +1704,12 @@ TEST_F(HooksDhcpv6SrvTest, subnet6SelectSimple) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"" + valid_iface_ + "\" "
         " }, {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\" "
         " } ],"
@@ -1792,10 +1794,12 @@ TEST_F(HooksDhcpv6SrvTest, subnet6SelectChange) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"" + valid_iface_ + "\" "
         " }, {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\" "
         " } ],"
@@ -1902,6 +1906,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedSolicit) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -1941,6 +1946,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedConfirm) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -1984,6 +1990,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedInfRequest) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -2023,6 +2030,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRapidCommit) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"rapid-commit\": true, "
@@ -2088,6 +2096,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRapidCommitPrefixes) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -2201,6 +2210,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRequest) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -2375,6 +2385,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRequestPrefix) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -2556,6 +2567,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRenew) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -2727,6 +2739,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRenewPrefix) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -2905,6 +2918,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRebind) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -3079,6 +3093,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRebindPrefix) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -3260,6 +3275,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedDecline) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -3324,6 +3340,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedDeclineTwoNAs) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -3391,6 +3408,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedRelease) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -3455,6 +3473,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedReleasePrefix) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -3524,6 +3543,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedReleaseMultiple) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:2::\", "
@@ -3594,6 +3614,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedCache) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\", "
@@ -3683,6 +3704,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedCachePrefix) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -3775,6 +3797,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRequests) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
@@ -3880,6 +3903,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6CommittedParkRequestsPrefixes) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": [ {"
         "        \"prefix\": \"2001:db8:1::\", "
         "        \"prefix-len\": 56, "
@@ -5355,6 +5379,7 @@ TEST_F(HooksDhcpv6SrvTest, host6Identifier) {
         "\"renew-timer\": 1000,\n"
         "\"host-reservation-identifiers\": [ \"flex-id\" ],\n"
         "\"subnet6\": [ {\n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],\n"
         "    \"subnet\": \"2001:db8::/48\", \n"
         "    \"interface\": \"" + valid_iface_ + "\",\n"
@@ -5438,6 +5463,7 @@ TEST_F(HooksDhcpv6SrvTest, host6IdentifierHWAddr) {
         "\"renew-timer\": 1000,\n"
         "\"host-reservation-identifiers\": [ \"flex-id\" ],\n"
         "\"subnet6\": [ {\n"
+        "    \"id\": 1, \n"
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],\n"
         "    \"subnet\": \"2001:db8::/48\", \n"
         "    \"interface\": \"" + valid_iface_ + "\",\n"
@@ -5696,6 +5722,7 @@ TEST_F(HooksDhcpv6SrvTest, leases6ParkedPacketLimit) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth1\" "
index 1424826cb367b392fd3a555656d73c09f99533e3..efc3f463d05a096c0e6cb9ebc7db51a0dff8f537 100644 (file)
@@ -70,6 +70,7 @@ const char* CONFIGS[] = {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -98,6 +99,7 @@ const char* CONFIGS[] = {
         "\"mac-sources\": [ \"ipv6-link-local\" ], "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -126,6 +128,7 @@ const char* CONFIGS[] = {
         "\"mac-sources\": [ \"ipv6-link-local\" ], "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"interface\" : \"eth0\" , "
@@ -157,6 +160,7 @@ const char* CONFIGS[] = {
         "} ],"
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ {"
         "        \"pool\": \"2001:db8:1::/64\","
@@ -206,6 +210,7 @@ const char* CONFIGS[] = {
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"interface\" : \"eth0\","
@@ -246,6 +251,7 @@ const char* CONFIGS[] = {
         "} ],"
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"interface\" : \"eth0\","
@@ -278,6 +284,7 @@ const char* CONFIGS[] = {
         "\"renew-timer\": 10, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::2\" } ],"
         "    \"pd-pools\": ["
@@ -303,6 +310,7 @@ const char* CONFIGS[] = {
         "\"renew-timer\": 10, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::2\" } ],"
         "    \"pd-pools\": ["
@@ -1298,6 +1306,7 @@ HostTest::configString(const DUID& duid,
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ "
         " { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ],"
         "    \"pd-pools\": [ { \"prefix\": \"3001::\", \"prefix-len\": 32,"
index a264b09c2fa1ffd95c8fc81b7b7154862ce3cbb8..154af2bf25d5884d573da62c6a1ef83d8d8b2900 100644 (file)
@@ -44,6 +44,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:3::\", "
@@ -67,6 +68,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"option-data\": [ {"
         "    \"name\": \"sip-server-addr\","
         "    \"data\": \"2001:db8::abcd\""
@@ -88,6 +90,7 @@ const char* CONFIGS[] = {
         "        \"data\": \"2001:db8::1\""
         "    } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"subnet\": \"2001:db8::/32\", "
         "    \"interface\": \"eth0\","
         "    \"option-data\": [ {"
index c7677397dbc6288b03cb2543969693f9dfd09d81..eb06f34707bca2d6b8cfe0d760874af313facfb6 100644 (file)
@@ -384,15 +384,17 @@ TEST_F(JSONFileBackendTest, jsonFile) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/80\" } ],"
         "    \"subnet\": \"2001:db8:2::/64\", "
-        "    \"id\": 0"
         " },"
         " {"
+        "    \"id\": 3, "
         "    \"pools\": [ { \"pool\": \"2001:db8:3::/80\" } ],"
         "    \"subnet\": \"2001:db8:3::/64\" "
         " } ],"
@@ -470,6 +472,7 @@ TEST_F(JSONFileBackendTest, hashComments) {
         "\"renew-timer\": 1000, \n"
         "# comments in the middle should be ignored, too\n"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ],"
@@ -522,6 +525,7 @@ TEST_F(JSONFileBackendTest, cppLineComments) {
         "\"renew-timer\": 1000, \n"
         "// comments in the middle should be ignored, too\n"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ],"
@@ -574,6 +578,7 @@ TEST_F(JSONFileBackendTest, cBlockComments) {
         "\"renew-timer\": 1000, \n"
         "/* comments in the middle should be ignored, too*/\n"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ],"
@@ -627,6 +632,7 @@ TEST_F(JSONFileBackendTest, include) {
         "}";
     string include = "\n"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ]\n";
@@ -674,6 +680,7 @@ TEST_F(JSONFileBackendTest, recursiveInclude) {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, \n"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
         "    \"subnet\": \"2001:db8:1::/64\" "
         " } ],"
index 50ec6566bcbcefaa20d4291b54c0ff834e8bbb95..4ea7a282c07fe5987b280ff8c681d2d83a06b4b7 100644 (file)
@@ -140,6 +140,7 @@ TEST(ParserTest, keywordDhcp6) {
                   "\"rebind-timer\": 2000, \n"
                   "\"renew-timer\": 1000, \n"
                   "\"subnet6\": [ { "
+                  "    \"id\": 1, "
                   "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                   "    \"subnet\": \"2001:db8:1::/48\", "
                   "    \"interface\": \"test\" } ],\n"
@@ -160,6 +161,7 @@ TEST(ParserTest, bashComments) {
                 "# and here\n"
                 "\"renew-timer\": 1000, \n"
                 "\"subnet6\": [ { "
+                "    \"id\": 1, "
                 "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                 "    \"subnet\": \"2001:db8:1::/48\", "
                 "    \"interface\": \"eth0\""
@@ -177,6 +179,7 @@ TEST(ParserTest, cppComments) {
                 "\"rebind-timer\": 2000, // everything after // is ignored\n"
                 "\"renew-timer\": 1000, // this will be ignored, too\n"
                 "\"subnet6\": [ { "
+                "    \"id\": 1, "
                 "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                 "    \"subnet\": \"2001:db8:1::/48\", "
                 "    \"interface\": \"eth0\""
@@ -194,6 +197,7 @@ TEST(ParserTest, bashCommentsInline) {
                 "\"rebind-timer\": 2000, # everything after # is ignored\n"
                 "\"renew-timer\": 1000, # this will be ignored, too\n"
                 "\"subnet6\": [ { "
+                "    \"id\": 1, "
                 "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                 "    \"subnet\": \"2001:db8:1::/48\", "
                 "    \"interface\": \"eth0\""
@@ -212,6 +216,7 @@ TEST(ParserTest, multilineComments) {
                 "\"rebind-timer\": 2000,\n"
                 "\"renew-timer\": 1000, \n"
                 "\"subnet6\": [ { "
+                "    \"id\": 1, "
                 "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                 "    \"subnet\": \"2001:db8:1::/48\", "
                 "    \"interface\": \"eth0\""
@@ -230,6 +235,7 @@ TEST(ParserTest, embbededComments) {
                 "\"rebind-timer\": 2000,\n"
                 "\"renew-timer\": 1000, \n"
                 "\"subnet6\": [ { "
+                "    \"id\": 1, "
                 "    \"user-context\": { \"comment\": \"indirect\" },"
                 "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
                 "    \"subnet\": \"2001:db8:1::/48\", "
@@ -939,6 +945,7 @@ TEST_F(TrailingCommasTest, tests) {
           },
         ],
         "subnet": "2001:db8:1::/64",
+        "id": 1,
       },
     ],
   },
@@ -957,10 +964,10 @@ TEST_F(TrailingCommasTest, tests) {
     addLog("<string>:32.8");
     addLog("<string>:43.38");
     addLog("<string>:44.12");
-    addLog("<string>:46.36");
-    addLog("<string>:47.8");
-    addLog("<string>:48.6");
-    addLog("<string>:49.4");
+    addLog("<string>:47.16");
+    addLog("<string>:48.8");
+    addLog("<string>:49.6");
+    addLog("<string>:50.4");
     EXPECT_TRUE(checkFile());
 
     // Test with many consecutive commas.
index 9e0298e4247b847f6ecdeda6ec2235c7595086fe..48801e6d96d9223c3ea4f702b0cc44bf64dab206 100644 (file)
@@ -87,12 +87,14 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"interface-id\": \"\","
@@ -108,12 +110,14 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:3::/64\" } ],"
         "    \"subnet\": \"2001:db8:3::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:4::/64\" } ],"
         "    \"subnet\": \"2001:db8:4::/48\", "
         "    \"interface-id\": \"\","
@@ -129,12 +133,14 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"3000:1::/64\" } ],"
         "    \"subnet\": \"3000:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"3000:2::/64\" } ],"
         "    \"subnet\": \"3000:2::/48\", "
         "    \"interface-id\": \"\","
@@ -150,12 +156,14 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"3000:3::/64\" } ],"
         "    \"subnet\": \"3000:3::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth1\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"3000:4::/64\" } ],"
         "    \"subnet\": \"3000:4::/48\", "
         "    \"interface-id\": \"\","
@@ -171,6 +179,7 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
         "          \"prefix-len\": 72, "
@@ -181,6 +190,7 @@ const char* REBIND_CONFIGS[] = {
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:2::\", "
         "          \"prefix-len\": 72, "
@@ -200,6 +210,7 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:3:01::\", "
         "          \"prefix-len\": 72, "
@@ -210,6 +221,7 @@ const char* REBIND_CONFIGS[] = {
         "    \"interface\": \"eth1\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:4:01::\", "
         "          \"prefix-len\": 72, "
@@ -229,6 +241,7 @@ const char* REBIND_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
@@ -254,12 +267,14 @@ const char* REBIND_CONFIGS[] = {
         "    \"data\": \"normal_erouter_v6.cm\""
         "}],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
         "    \"interface\": \"eth0\""
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::/64\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"interface-id\": \"\","
@@ -323,6 +338,7 @@ const char* REBIND_CONFIGS[] = {
         "            \"data\": \"3000:1::789\""
         "        } ]"
         "    } ],"
+        "    \"id\": 1, "
         "    \"subnet\": \"3000::/32\", "
         "    \"interface\": \"eth0\""
         " } ],"
index ef9334265339ff1d00fd3c54d0084940605659ad..644bc970b77f813a9a254461e1e76c8450ac351e 100644 (file)
@@ -70,6 +70,7 @@ const char* RENEW_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
@@ -85,6 +86,7 @@ const char* RENEW_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
         "          \"prefix-len\": 72, "
@@ -104,6 +106,7 @@ const char* RENEW_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
@@ -129,6 +132,7 @@ const char* RENEW_CONFIGS[] = {
         "    \"data\": \"normal_erouter_v6.cm\""
         "}],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface-id\": \"\","
@@ -152,6 +156,7 @@ const char* RENEW_CONFIGS[] = {
         "    \"data\": \"3000:2::1\""
         "} ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"option-data\": [ {"
         "        \"name\": \"dns-servers\","
         "        \"data\": \"3000:1::567\""
@@ -206,6 +211,7 @@ const char* RENEW_CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"pd-pools\": ["
         "        { \"prefix\": \"3000::\", "
index 00be27b4c7272d26cefd3c1975992d6e47419d27..2d379bedfc8cbf101f3b346a9dbb78e3f8799613 100644 (file)
@@ -83,6 +83,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:3::\", "
         "          \"prefix-len\": 48, "
@@ -102,12 +103,14 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth0\","
         "    \"rapid-commit\": true"
         " },"
         " {"
+        "    \"id\": 2, "
         "    \"pools\": [ { \"pool\": \"2001:db8:2::1 - 2001:db8:2::10\" } ],"
         "    \"subnet\": \"2001:db8:2::/48\", "
         "    \"interface\": \"eth1\","
@@ -135,6 +138,7 @@ const char* CONFIGS[] = {
         "    \"data\": \"3000:2::1\""
         "} ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"option-data\": [ {"
         "        \"name\": \"dns-servers\","
         "        \"data\": \"3000:1::567\""
@@ -189,6 +193,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pd-pools\": ["
         "        { \"prefix\": \"2001:db8:3::\", "
         "          \"prefix-len\": 48, "
@@ -211,6 +216,7 @@ const char* CONFIGS[] = {
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::1 - 2001:db8:1::10\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"interface\": \"eth0\", "
@@ -253,6 +259,7 @@ const char* CONFIGS[] = {
         "                \"delegated-len\": 64"
         "            }"
         "        ],"
+        "        \"id\": 1, "
         "        \"subnet\": \"3000::/32\", "
         "        \"interface\": \"eth0\""
         "    }"
@@ -282,6 +289,7 @@ const char* CONFIGS[] = {
         "                \"delegated-len\": 64"
         "            }"
         "        ],"
+        "        \"id\": 1, "
         "        \"subnet\": \"3000::/32\", "
         "        \"interface\": \"eth0\""
         "    }"
index cade57fd71c1919354ad2e6600b8de9eb88e8e1a..aaa7ff10f547124836cef04323f49724f34fc184 100644 (file)
@@ -1114,6 +1114,7 @@ const char* NETWORKS_CONFIG[] = {
     "            \"interface\": \"eth1\","
     "            \"subnet6\": ["
     "                {"
+    "                    \"id\": 100, "
     "                    \"subnet\": \"2001:db8:1::/64\","
     "                    \"pd-allocator\": \"flq\","
     "                    \"pd-pools\": ["
@@ -1125,6 +1126,7 @@ const char* NETWORKS_CONFIG[] = {
     "                    ]"
     "                },"
     "                {"
+    "                    \"id\": 10, "
     "                    \"subnet\": \"2001:db8:2::/64\","
     "                    \"pd-allocator\": \"random\","
     "                    \"pd-pools\": ["
@@ -1150,6 +1152,7 @@ const char* NETWORKS_CONFIG[] = {
     "            \"interface\": \"eth1\","
     "            \"subnet6\": ["
     "                {"
+    "                    \"id\": 100, "
     "                    \"subnet\": \"2001:db8:1::/64\","
     "                    \"pd-allocator\": \"random\","
     "                    \"pd-pools\": ["
@@ -1161,6 +1164,7 @@ const char* NETWORKS_CONFIG[] = {
     "                    ]"
     "                },"
     "                {"
+    "                    \"id\": 10, "
     "                    \"subnet\": \"2001:db8:2::/64\","
     "                    \"pd-allocator\": \"flq\","
     "                    \"pd-pools\": ["
index c91818b56dfc0078859eb9058488470c931186a5..530f04fc7c342c28c167d3a0c96fc87435b59fe9 100644 (file)
@@ -38,6 +38,7 @@ const char* TEE_CONFIGS[] = {
     "   \"subnet6\": [ { \n"
     "       \"interface\": \"eth0\", \n"
     "       \"subnet\": \"2001:db8:1::/48\", \n"
+    "       \"id\": 1, \n"
     "       \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n"
     "       \"pd-pools\": [ \n"
     "       { \n"
@@ -54,6 +55,7 @@ const char* TEE_CONFIGS[] = {
     "   \"subnet6\": [ { \n"
     "       \"interface\": \"eth0\", \n"
     "       \"subnet\": \"2001:db8:1::/48\", \n"
+    "       \"id\": 1, \n"
     "       \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n"
     "       \"pd-pools\": [ \n"
     "       { \n"
@@ -72,6 +74,7 @@ const char* TEE_CONFIGS[] = {
     "   \"subnet6\": [ { \n"
     "       \"interface\": \"eth0\", \n"
     "       \"subnet\": \"2001:db8:1::/48\", \n"
+    "       \"id\": 1, \n"
     "       \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ], \n"
     "       \"pd-pools\": [ \n"
     "       { \n"
index f179e2ff0042c66c15f5fc70e86476eccb9470c3..db613e15f4be26a71342f036b5d6403a4e788364 100644 (file)
@@ -157,6 +157,7 @@ public:
                             }
                         ],
                         "subnet": "2001:db8:1::/48",
+                        "id": 1,
                         "interface-id": ""
                     }
                 ]
@@ -413,6 +414,7 @@ public:
                             }
                         ],
                         "subnet": "2001:db8:1::/48",
+                        "id": 1,
                         "interface-id": ""
                     }
                 ]
@@ -644,6 +646,7 @@ public:
                             }
                         ],
                         "subnet": "2001:db8:1::/48",
+                        "id": 1,
                         "interface-id": ""
                     }
                 ]
@@ -851,7 +854,8 @@ private:
               "pool": "2001:db8::/64"
             }
           ],
-          "subnet": "2001:db8::/64"
+          "subnet": "2001:db8::/64",
+          "id": 1
         }
       ]
     }
@@ -1344,6 +1348,7 @@ TEST_F(VendorOptsTest, vendorNeverSend) {
         "          \"data\": \"ISC\""
         "        }],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"renew-timer\": 1000, "
@@ -1444,6 +1449,7 @@ TEST_F(VendorOptsTest, vendorOptionsDocsisDefinitions) {
         "          \"csv-format\": true"
         "        }],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8:1::/64\" } ],"
         "    \"subnet\": \"2001:db8:1::/48\", "
         "    \"renew-timer\": 1000, "
@@ -1551,6 +1557,7 @@ TEST_F(VendorOptsTest, vendorOpsInResponseOnly) {
         "        } ]"
         "    } ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/64\", "
         "    \"interface\": \"eth0\" "
@@ -1666,6 +1673,7 @@ TEST_F(VendorOptsTest, twoVendors) {
         "        }"
         "    ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/64\", "
         "    \"interface\": \"eth0\" "
@@ -1819,6 +1827,7 @@ TEST_F(VendorOptsTest, threeVendors) {
         "        }"
         "    ],"
         "\"subnet6\": [ { "
+        "    \"id\": 1, "
         "    \"pools\": [ { \"pool\": \"2001:db8::/64\" } ],"
         "    \"subnet\": \"2001:db8::/64\", "
         "    \"interface\": \"eth0\" "