Parcourir la source

[3604] Use new interface configuration format where applicable.

Also, renamed interface-config to interfaces-config (plural form).
Marcin Siodelski il y a 10 ans
Parent
commit
e994b57ca4
33 fichiers modifiés avec 292 ajouts et 144 suppressions
  1. 3 1
      doc/examples/kea4/multiple-options.json
  2. 4 2
      doc/examples/kea4/reservations.json
  3. 3 1
      doc/examples/kea4/several-subnets.json
  4. 3 1
      doc/examples/kea4/single-subnet.json
  5. 3 1
      doc/examples/kea6/advanced.json
  6. 3 1
      doc/examples/kea6/multiple-options.json
  7. 3 1
      doc/examples/kea6/several-subnets.json
  8. 3 1
      doc/examples/kea6/simple.json
  9. 3 1
      doc/examples/kea6/stateless.json
  10. 2 2
      src/bin/dhcp4/json_config_parser.cc
  11. 63 47
      src/bin/dhcp4/tests/config_parser_unittest.cc
  12. 7 3
      src/bin/dhcp4/tests/d2_unittest.cc
  13. 7 3
      src/bin/dhcp4/tests/dhcp4_process_tests.sh.in
  14. 34 12
      src/bin/dhcp4/tests/dhcp4_srv_unittest.cc
  15. 7 3
      src/bin/dhcp4/tests/direct_client_unittest.cc
  16. 10 3
      src/bin/dhcp4/tests/dora_unittest.cc
  17. 7 3
      src/bin/dhcp4/tests/inform_unittest.cc
  18. 9 3
      src/bin/dhcp4/tests/kea_controller_unittest.cc
  19. 2 2
      src/bin/dhcp6/json_config_parser.cc
  20. 8 8
      src/bin/dhcp6/tests/config_parser_unittest.cc
  21. 7 3
      src/bin/dhcp6/tests/confirm_unittest.cc
  22. 4 2
      src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
  23. 7 3
      src/bin/dhcp6/tests/d2_unittest.cc
  24. 4 3
      src/bin/dhcp6/tests/dhcp6_process_tests.sh.in
  25. 19 7
      src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
  26. 6 2
      src/bin/dhcp6/tests/hooks_unittest.cc
  27. 12 4
      src/bin/dhcp6/tests/infrequest_unittest.cc
  28. 9 3
      src/bin/dhcp6/tests/kea_controller_unittest.cc
  29. 18 6
      src/bin/dhcp6/tests/rebind_unittest.cc
  30. 3 1
      src/bin/dhcp6/tests/sarr_unittest.cc
  31. 6 2
      src/bin/keactrl/kea.conf.pre
  32. 6 2
      src/bin/keactrl/tests/keactrl_tests.sh.in
  33. 7 7
      src/lib/dhcpsrv/parsers/ifaces_config_parser.h

+ 3 - 1
doc/examples/kea4/multiple-options.json

@@ -5,7 +5,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 4 - 2
doc/examples/kea4/reservations.json

@@ -4,8 +4,10 @@
 { "Dhcp4":
 { "Dhcp4":
 
 
 {
 {
-# Kea is told to listen on eth0 interface only.
-  "interfaces": [ "eth0" ],
+# Kea is told to listen on ethX interface only.
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea4/several-subnets.json

@@ -6,7 +6,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea4/single-subnet.json

@@ -6,7 +6,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea6/advanced.json

@@ -11,7 +11,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX network interface only.
 # Kea is told to listen on ethX network interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea6/multiple-options.json

@@ -5,7 +5,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea6/several-subnets.json

@@ -6,7 +6,9 @@
 
 
 {
 {
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea6/simple.json

@@ -7,7 +7,9 @@
 
 
 { 
 { 
 # Kea is told to listen on ethX interface only.
 # Kea is told to listen on ethX interface only.
-  "interfaces": [ "ethX" ],
+  "interfaces-config:" {
+    "interfaces": [ "ethX" ]
+  },
 
 
 # We need to specify lease type. As of May 2014, three backends are supported:
 # We need to specify lease type. As of May 2014, three backends are supported:
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
 # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require

+ 3 - 1
doc/examples/kea6/stateless.json

@@ -7,7 +7,9 @@
 
 
 {
 {
 "Dhcp6": {
 "Dhcp6": {
-    "interfaces": [ "ethX" ],
+    "interfaces-config:" {
+        "interfaces": [ "ethX" ]
+    },
 
 
 # This is the list of options that will be granted to all clients that ask.
 # This is the list of options that will be granted to all clients that ask.
     "option-data": [ {
     "option-data": [ {

+ 2 - 2
src/bin/dhcp4/json_config_parser.cc

@@ -370,7 +370,7 @@ namespace dhcp {
         (config_id.compare("rebind-timer") == 0))  {
         (config_id.compare("rebind-timer") == 0))  {
         parser = new Uint32Parser(config_id,
         parser = new Uint32Parser(config_id,
                                  globalContext()->uint32_values_);
                                  globalContext()->uint32_values_);
-    } else if (config_id.compare("interfaces") == 0) {
+    } else if (config_id.compare("interfaces-config") == 0) {
         parser = new IfacesConfigParser4();
         parser = new IfacesConfigParser4();
     } else if (config_id.compare("subnet4") == 0) {
     } else if (config_id.compare("subnet4") == 0) {
         parser = new Subnets4ListConfigParser(config_id);
         parser = new Subnets4ListConfigParser(config_id);
@@ -476,7 +476,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
                 subnet_parser = parser;
                 subnet_parser = parser;
             } else if (config_pair.first == "option-data") {
             } else if (config_pair.first == "option-data") {
                 option_parser = parser;
                 option_parser = parser;
-            } else if (config_pair.first == "interface-config") {
+            } else if (config_pair.first == "interfaces-config") {
                 // The interface parser is independent from any other
                 // The interface parser is independent from any other
                 // parser and can be run here before any other parsers.
                 // parser and can be run here before any other parsers.
                 iface_parser = parser;
                 iface_parser = parser;

+ 63 - 47
src/bin/dhcp4/tests/config_parser_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -124,6 +124,14 @@ public:
         unlink(UNLOAD_MARKER_FILE);
         unlink(UNLOAD_MARKER_FILE);
     };
     };
 
 
+    /// @brief Returns an interface configuration used by the most of the
+    /// unit tests.
+    std::string genIfaceConfig() const {
+        return ("\"interfaces-config\": {"
+                "  \"interfaces\": [ \"*\" ]"
+                "}");
+    }
+
     /// @brief Create the simple configuration with single option.
     /// @brief Create the simple configuration with single option.
     ///
     ///
     /// This function allows to set one of the parameters that configure
     /// This function allows to set one of the parameters that configure
@@ -183,7 +191,7 @@ public:
     /// describing an option.
     /// describing an option.
     std::string createConfigWithOption(const std::map<std::string, std::string>& params) {
     std::string createConfigWithOption(const std::map<std::string, std::string>& params) {
         std::ostringstream stream;
         std::ostringstream stream;
-        stream << "{ \"interfaces\": [ \"*\" ],"
+        stream << "{ " << genIfaceConfig() << "," <<
             "\"rebind-timer\": 2000, "
             "\"rebind-timer\": 2000, "
             "\"renew-timer\": 1000, "
             "\"renew-timer\": 1000, "
             "\"subnet4\": [ { "
             "\"subnet4\": [ { "
@@ -446,7 +454,7 @@ public:
     /// contents of the database do not affect result of
     /// contents of the database do not affect result of
     /// subsequent tests.
     /// subsequent tests.
     void resetConfiguration() {
     void resetConfiguration() {
-        string config = "{ \"interfaces\": [ \"*\" ],"
+        string config = "{ " + genIfaceConfig() + "," +
             "\"hooks-libraries\": [ ], "
             "\"hooks-libraries\": [ ], "
             "\"valid-lifetime\": 4000, "
             "\"valid-lifetime\": 4000, "
             "\"subnet4\": [ ], "
             "\"subnet4\": [ ], "
@@ -500,7 +508,7 @@ TEST_F(Dhcp4ParserTest, emptySubnet) {
     ConstElementPtr status;
     ConstElementPtr status;
 
 
     EXPECT_NO_THROW(status = configureDhcp4Server(*srv_,
     EXPECT_NO_THROW(status = configureDhcp4Server(*srv_,
-                    Element::fromJSON("{ \"interfaces\": [ \"*\" ],"
+                    Element::fromJSON("{ " + genIfaceConfig() + "," +
                                       "\"rebind-timer\": 2000, "
                                       "\"rebind-timer\": 2000, "
                                       "\"renew-timer\": 1000, "
                                       "\"renew-timer\": 1000, "
                                       "\"subnet4\": [  ], "
                                       "\"subnet4\": [  ], "
@@ -519,7 +527,7 @@ TEST_F(Dhcp4ParserTest, emptySubnet) {
 TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) {
 TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) {
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
@@ -553,7 +561,7 @@ TEST_F(Dhcp4ParserTest, unspecifiedRenewTimer) {
 TEST_F(Dhcp4ParserTest, unspecifiedRebindTimer) {
 TEST_F(Dhcp4ParserTest, unspecifiedRebindTimer) {
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
         "    \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
@@ -587,7 +595,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -622,7 +630,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) {
     ConstElementPtr x;
     ConstElementPtr x;
     // Collection of four subnets for which subnet ids should be
     // Collection of four subnets for which subnet ids should be
     // autogenerated - ids are unspecified or set to 0.
     // autogenerated - ids are unspecified or set to 0.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -676,7 +684,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnets) {
 TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
 TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
     ConstElementPtr x;
     ConstElementPtr x;
     // Four subnets with arbitrary subnet ids.
     // Four subnets with arbitrary subnet ids.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -730,7 +738,7 @@ TEST_F(Dhcp4ParserTest, multipleSubnetsExplicitIDs) {
 TEST_F(Dhcp4ParserTest, multipleSubnetsOverlapingIDs) {
 TEST_F(Dhcp4ParserTest, multipleSubnetsOverlapingIDs) {
     ConstElementPtr x;
     ConstElementPtr x;
     // Four subnets, two of them having the same id.
     // Four subnets, two of them having the same id.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -768,7 +776,7 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
     ConstElementPtr x;
     ConstElementPtr x;
 
 
     // All four subnets
     // All four subnets
-    string config4 = "{ \"interfaces\": [ \"*\" ],"
+    string config4 = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -794,7 +802,7 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
 
 
     // Three subnets (the last one removed)
     // Three subnets (the last one removed)
-    string config_first3 = "{ \"interfaces\": [ \"*\" ],"
+    string config_first3 = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -815,7 +823,7 @@ TEST_F(Dhcp4ParserTest, reconfigureRemoveSubnet) {
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
 
 
     // Second subnet removed
     // Second subnet removed
-    string config_second_removed = "{ \"interfaces\": [ \"*\" ],"
+    string config_second_removed = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -899,7 +907,7 @@ TEST_F(Dhcp4ParserTest, nextServerGlobal) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"next-server\": \"1.2.3.4\", "
         "\"next-server\": \"1.2.3.4\", "
@@ -929,7 +937,7 @@ TEST_F(Dhcp4ParserTest, nextServerSubnet) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -960,7 +968,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
     ConstElementPtr status;
     ConstElementPtr status;
 
 
     // Config with junk instead of next-server address
     // Config with junk instead of next-server address
-    string config_bogus1 = "{ \"interfaces\": [ \"*\" ],"
+    string config_bogus1 = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -972,7 +980,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
 
 
     // Config with IPv6 next server address
     // Config with IPv6 next server address
-    string config_bogus2 = "{ \"interfaces\": [ \"*\" ],"
+    string config_bogus2 = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -984,7 +992,7 @@ TEST_F(Dhcp4ParserTest, nextServerNegative) {
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
 
 
     // Config with empty next server address
     // Config with empty next server address
-    string config_bogus3 = "{ \"interfaces\": [ \"*\" ],"
+    string config_bogus3 = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1019,7 +1027,7 @@ TEST_F(Dhcp4ParserTest, nextServerOverride) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"next-server\": \"192.0.0.1\", "
@@ -1049,7 +1057,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config_false = "{ \"interfaces\": [ \"*\" ],"
+    string config_false = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": false,"
         "\"echo-client-id\": false,"
@@ -1058,7 +1066,7 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "    \"subnet\": \"192.0.2.0/24\" } ],"
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
 
 
-    string config_true = "{ \"interfaces\": [ \"*\" ],"
+    string config_true = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"echo-client-id\": true,"
         "\"echo-client-id\": true,"
@@ -1093,7 +1101,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1124,7 +1132,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) {
 TEST_F(Dhcp4ParserTest, multiplePools) {
 TEST_F(Dhcp4ParserTest, multiplePools) {
 
 
     // Collection with two subnets, each with 2 pools.
     // Collection with two subnets, each with 2 pools.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1183,7 +1191,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1208,7 +1216,7 @@ TEST_F(Dhcp4ParserTest, poolPrefixLen) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1785,7 +1793,7 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) {
 // configuration does not include options configuration.
 // configuration does not include options configuration.
 TEST_F(Dhcp4ParserTest, optionDataDefaults) {
 TEST_F(Dhcp4ParserTest, optionDataDefaults) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
         "\"option-data\": [ {"
         "\"option-data\": [ {"
@@ -1857,7 +1865,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) {
     // The definition is not required for the option that
     // The definition is not required for the option that
     // belongs to the 'dhcp4' option space as it is the
     // belongs to the 'dhcp4' option space as it is the
     // standard option.
     // standard option.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"valid-lifetime\": 4000,"
         "\"valid-lifetime\": 4000,"
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
@@ -1937,7 +1945,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
     // at the very end (when all other parameters are configured).
     // at the very end (when all other parameters are configured).
 
 
     // Starting stage 1. Configure sub-options and their definitions.
     // Starting stage 1. Configure sub-options and their definitions.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"valid-lifetime\": 4000,"
         "\"valid-lifetime\": 4000,"
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
@@ -1989,7 +1997,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
     // the configuration from the stage 2 is repeated because BIND
     // the configuration from the stage 2 is repeated because BIND
     // configuration manager sends whole configuration for the lists
     // configuration manager sends whole configuration for the lists
     // where at least one element is being modified or added.
     // where at least one element is being modified or added.
-    config = "{ \"interfaces\": [ \"*\" ],"
+    config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
         "\"option-data\": [ {"
         "\"option-data\": [ {"
@@ -2085,7 +2093,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
 // option setting.
 // option setting.
 TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
 TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"option-data\": [ {"
         "\"option-data\": [ {"
@@ -2239,7 +2247,7 @@ TEST_F(Dhcp4ParserTest, optionDataBoolean) {
 // for multiple subnets.
 // for multiple subnets.
 TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
 TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -2513,7 +2521,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
     // In the first stage we create definitions of suboptions
     // In the first stage we create definitions of suboptions
     // that we will add to the base option.
     // that we will add to the base option.
     // Let's create some dummy options: foo and foo2.
     // Let's create some dummy options: foo and foo2.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"valid-lifetime\": 4000,"
         "\"valid-lifetime\": 4000,"
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
@@ -2569,7 +2577,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
     // We add our dummy options to this option space and thus
     // We add our dummy options to this option space and thus
     // they should be included as sub-options in the 'vendor-opts'
     // they should be included as sub-options in the 'vendor-opts'
     // option.
     // option.
-    config = "{ \"interfaces\": [ \"*\" ],"
+    config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
         "\"option-data\": [ {"
         "\"option-data\": [ {"
@@ -2676,7 +2684,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsHex) {
     // This configuration string is to configure two options
     // This configuration string is to configure two options
     // sharing the code 1 and belonging to the different vendor spaces.
     // sharing the code 1 and belonging to the different vendor spaces.
     // (different vendor-id values).
     // (different vendor-id values).
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"valid-lifetime\": 4000,"
         "\"valid-lifetime\": 4000,"
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
@@ -2735,7 +2743,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) {
     // This configuration string is to configure two options
     // This configuration string is to configure two options
     // sharing the code 1 and belonging to the different vendor spaces.
     // sharing the code 1 and belonging to the different vendor spaces.
     // (different vendor-id values).
     // (different vendor-id values).
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"valid-lifetime\": 4000,"
         "\"valid-lifetime\": 4000,"
         "\"rebind-timer\": 2000,"
         "\"rebind-timer\": 2000,"
         "\"renew-timer\": 1000,"
         "\"renew-timer\": 1000,"
@@ -2799,7 +2807,9 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries) {
 
 
     // Create the first part of the configuration string.
     // Create the first part of the configuration string.
     string config =
     string config =
-        "{ \"interfaces\": [ \"*\" ],"
+        "{  \"interfaces-config\": {"
+            "    \"interfaces\": [ \"*\" ]"
+            "},"
             "\"hooks-libraries\": [";
             "\"hooks-libraries\": [";
 
 
     // Append the libraries (separated by commas if needed)
     // Append the libraries (separated by commas if needed)
@@ -2939,7 +2949,9 @@ TEST_F(Dhcp4ParserTest, selectedInterfaces) {
     IfaceMgrTestConfig test_config(true);
     IfaceMgrTestConfig test_config(true);
 
 
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"eth0\", \"eth1\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"eth0\", \"eth1\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
@@ -2976,7 +2988,9 @@ TEST_F(Dhcp4ParserTest, allInterfaces) {
     // but it also includes asterisk. The asterisk switches server into the
     // but it also includes asterisk. The asterisk switches server into the
     // mode when it listens on all interfaces regardless of what interface names
     // mode when it listens on all interfaces regardless of what interface names
     // were specified in the "interfaces" parameter.
     // were specified in the "interfaces" parameter.
-    string config = "{ \"interfaces\": [ \"eth0\", \"*\", \"eth1\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"eth0\", \"*\", \"eth1\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
@@ -3008,7 +3022,9 @@ TEST_F(Dhcp4ParserTest, selectedInterfacesAndAddresses) {
     IfaceMgrTestConfig test_config(true);
     IfaceMgrTestConfig test_config(true);
 
 
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"eth0/10.0.0.1\", \"eth1/192.0.2.3\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"eth0/10.0.0.1\", \"eth1/192.0.2.3\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"valid-lifetime\": 4000 }";
         "\"valid-lifetime\": 4000 }";
@@ -3053,7 +3069,7 @@ TEST_F(Dhcp4ParserTest, d2ClientConfig) {
     // Verify that the convenience method agrees.
     // Verify that the convenience method agrees.
     ASSERT_FALSE(CfgMgr::instance().ddnsEnabled());
     ASSERT_FALSE(CfgMgr::instance().ddnsEnabled());
 
 
-    string config_str = "{ \"interfaces\": [ \"*\" ],"
+    string config_str = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -3118,7 +3134,7 @@ TEST_F(Dhcp4ParserTest, invalidD2ClientConfig) {
 
 
     // Configuration string with an invalid D2 client config,
     // Configuration string with an invalid D2 client config,
     // "server-ip" is invalid.
     // "server-ip" is invalid.
-    string config_str = "{ \"interfaces\": [ \"*\" ],"
+    string config_str = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -3164,7 +3180,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) {
     ConstElementPtr status;
     ConstElementPtr status;
 
 
     // A config with relay information.
     // A config with relay information.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -3195,7 +3211,7 @@ TEST_F(Dhcp4ParserTest, subnetRelayInfo) {
 // with defined client classes.
 // with defined client classes.
 TEST_F(Dhcp4ParserTest, classifySubnets) {
 TEST_F(Dhcp4ParserTest, classifySubnets) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -3281,7 +3297,7 @@ TEST_F(Dhcp4ParserTest, classifySubnets) {
 // respective IPv4 subnets.
 // respective IPv4 subnets.
 TEST_F(Dhcp4ParserTest, reservations) {
 TEST_F(Dhcp4ParserTest, reservations) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "
@@ -3401,7 +3417,7 @@ TEST_F(Dhcp4ParserTest, reservations) {
 TEST_F(Dhcp4ParserTest, reservationBogus) {
 TEST_F(Dhcp4ParserTest, reservationBogus) {
     // Case 1: misspelled hw-address parameter.
     // Case 1: misspelled hw-address parameter.
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "
@@ -3427,7 +3443,7 @@ TEST_F(Dhcp4ParserTest, reservationBogus) {
     checkResult(x, 1);
     checkResult(x, 1);
 
 
     // Case 2: DUID and HW Address both specified.
     // Case 2: DUID and HW Address both specified.
-    config = "{ \"interfaces\": [ \"*\" ],"
+    config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "
@@ -3455,7 +3471,7 @@ TEST_F(Dhcp4ParserTest, reservationBogus) {
     checkResult(x, 1);
     checkResult(x, 1);
 
 
     // Case 3: Neither ip address nor hostname specified.
     // Case 3: Neither ip address nor hostname specified.
-    config = "{ \"interfaces\": [ \"*\" ],"
+    config = "{ " + genIfaceConfig() + "," +
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "

+ 7 - 3
src/bin/dhcp4/tests/d2_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -74,7 +74,9 @@ Dhcp4SrvD2Test::buildTestNcr(uint32_t dhcid_id_num) {
 
 
 void
 void
 Dhcp4SrvD2Test::reset() {
 Dhcp4SrvD2Test::reset() {
-    std::string config = "{ \"interfaces\": [ \"*\" ],"
+    std::string config = "{ \"interfaces-config\": {"
+            "    \"interfaces\": [ \"*\" ]"
+            "},"
             "\"hooks-libraries\": [ ], "
             "\"hooks-libraries\": [ ], "
             "\"rebind-timer\": 2000, "
             "\"rebind-timer\": 2000, "
             "\"renew-timer\": 1000, "
             "\"renew-timer\": 1000, "
@@ -95,7 +97,9 @@ Dhcp4SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
                             const size_t max_queue_size) {
                             const size_t max_queue_size) {
     std::ostringstream config;
     std::ostringstream config;
     config <<
     config <<
-        "{ \"interfaces\": [ \"*\" ],"
+        "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "

+ 7 - 3
src/bin/dhcp4/tests/dhcp4_process_tests.sh.in

@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 #
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
 # purpose with or without fee is hereby granted, provided that the above
@@ -22,7 +22,9 @@ EXPECTED_VERSION="@PACKAGE_VERSION@"
 CONFIG="{
 CONFIG="{
     \"Dhcp4\":
     \"Dhcp4\":
     {
     {
-        \"interfaces\": [ ],
+        \"interfaces-config\": {
+            \"interfaces\": [ ]
+        },
         \"valid-lifetime\": 4000,
         \"valid-lifetime\": 4000,
         \"renew-timer\": 1000,
         \"renew-timer\": 1000,
         \"rebind-timer\": 2000,
         \"rebind-timer\": 2000,
@@ -58,7 +60,9 @@ CONFIG="{
 CONFIG_INVALID="{
 CONFIG_INVALID="{
     \"Dhcp4\":
     \"Dhcp4\":
     {
     {
-        \"interfaces\": [ ],
+        \"interfaces-config\": {
+            \"interfaces\": [ ]
+        },
         \"valid-lifetime\": -3,
         \"valid-lifetime\": -3,
         \"renew-timer\": 1000,
         \"renew-timer\": 1000,
         \"rebind-timer\": 2000,
         \"rebind-timer\": 2000,

+ 34 - 12
src/bin/dhcp4/tests/dhcp4_srv_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -1142,7 +1142,9 @@ TEST_F(Dhcpv4SrvTest, relayAgentInfoEcho) {
     // subnet 10.254.226.0/24 is in use, because this packet
     // subnet 10.254.226.0/24 is in use, because this packet
     // contains the giaddr which belongs to this subnet and
     // contains the giaddr which belongs to this subnet and
     // this giaddr is used to select the subnet
     // this giaddr is used to select the subnet
-    std::string config = "{ \"interfaces\": [ \"*\" ],"
+    std::string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -1202,7 +1204,9 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsDocsis) {
 
 
     NakedDhcpv4Srv srv(0);
     NakedDhcpv4Srv srv(0);
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "    \"option-data\": [ {"
         "    \"option-data\": [ {"
@@ -1460,7 +1464,9 @@ TEST_F(Dhcpv4SrvTest, nextServerOverride) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"next-server\": \"192.0.0.1\", "
@@ -1507,7 +1513,9 @@ TEST_F(Dhcpv4SrvTest, nextServerGlobal) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"next-server\": \"192.0.0.1\", "
         "\"next-server\": \"192.0.0.1\", "
@@ -2501,7 +2509,9 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectSimple) {
 
 
     // Configure 2 subnets, both directly reachable over local interface
     // Configure 2 subnets, both directly reachable over local interface
     // (let's not complicate the matter with relays)
     // (let's not complicate the matter with relays)
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -2570,7 +2580,9 @@ TEST_F(HooksDhcpv4SrvTest, subnet4SelectChange) {
 
 
     // Configure 2 subnets, both directly reachable over local interface
     // Configure 2 subnets, both directly reachable over local interface
     // (let's not complicate the matter with relays)
     // (let's not complicate the matter with relays)
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -2987,7 +2999,9 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsORO) {
     NakedDhcpv4Srv srv(0);
     NakedDhcpv4Srv srv(0);
 
 
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "    \"option-data\": [ {"
         "    \"option-data\": [ {"
@@ -3074,7 +3088,9 @@ TEST_F(Dhcpv4SrvTest, vendorOptionsORO) {
 // src/lib/dhcp/docsis3_option_defs.h.
 // src/lib/dhcp/docsis3_option_defs.h.
 TEST_F(Dhcpv4SrvTest, vendorOptionsDocsisDefinitions) {
 TEST_F(Dhcpv4SrvTest, vendorOptionsDocsisDefinitions) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config_prefix = "{ \"interfaces\": [ \"*\" ],"
+    string config_prefix = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "    \"option-data\": [ {"
         "    \"option-data\": [ {"
@@ -3163,7 +3179,9 @@ TEST_F(Dhcpv4SrvTest, clientClassify2) {
     // The second subnet does not play any role here. The client's
     // The second subnet does not play any role here. The client's
     // IP address belongs to the first subnet, so only that first
     // IP address belongs to the first subnet, so only that first
     // subnet it being tested.
     // subnet it being tested.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "
@@ -3211,7 +3229,9 @@ TEST_F(Dhcpv4SrvTest, relayOverride) {
     // defined. Both are not belonging to the subnets. That is
     // defined. Both are not belonging to the subnets. That is
     // important, because if the relay belongs to the subnet, there's
     // important, because if the relay belongs to the subnet, there's
     // no need to specify relay override.
     // no need to specify relay override.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "
@@ -3287,7 +3307,9 @@ TEST_F(Dhcpv4SrvTest, relayOverrideAndClientClass) {
     // This test configures 2 subnets. They both are on the same link, so they
     // This test configures 2 subnets. They both are on the same link, so they
     // have the same relay-ip address. Furthermore, the first subnet is
     // have the same relay-ip address. Furthermore, the first subnet is
     // reserved for clients that belong to class "foo".
     // reserved for clients that belong to class "foo".
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ "
         "\"subnet4\": [ "

+ 7 - 3
src/bin/dhcp4/tests/direct_client_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -116,7 +116,9 @@ DirectClientTest::DirectClientTest() : Dhcpv4SrvTest() {
 void
 void
 DirectClientTest::configureSubnet(const std::string& prefix) {
 DirectClientTest::configureSubnet(const std::string& prefix) {
     std::ostringstream config;
     std::ostringstream config;
-    config << "{ \"interfaces\": [ \"*\" ],"
+    config << "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"option-data\": [ ],"
@@ -137,7 +139,9 @@ void
 DirectClientTest::configureTwoSubnets(const std::string& prefix1,
 DirectClientTest::configureTwoSubnets(const std::string& prefix1,
                                       const std::string& prefix2) {
                                       const std::string& prefix2) {
     std::ostringstream config;
     std::ostringstream config;
-    config << "{ \"interfaces\": [ \"*\" ],"
+    config << "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"option-data\": [ ],"
         "\"option-data\": [ ],"

+ 10 - 3
src/bin/dhcp4/tests/dora_unittest.cc

@@ -59,7 +59,9 @@ namespace {
 ///     aa:bb:cc:dd:ee:ff, reserved address 10.0.0.7
 ///     aa:bb:cc:dd:ee:ff, reserved address 10.0.0.7
 const char* DORA_CONFIGS[] = {
 const char* DORA_CONFIGS[] = {
 // Configuration 0
 // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
         "\"valid-lifetime\": 600,"
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
         "    \"subnet\": \"10.0.0.0/24\", "
@@ -97,7 +99,10 @@ const char* DORA_CONFIGS[] = {
     "}",
     "}",
 
 
 // Configuration 1
 // Configuration 1
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
+
         "\"valid-lifetime\": 600,"
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"subnet\": \"192.0.2.0/24\", "
@@ -133,7 +138,9 @@ const char* DORA_CONFIGS[] = {
     "}",
     "}",
 
 
 // Configuration 2
 // Configuration 2
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
         "\"valid-lifetime\": 600,"
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
         "    \"subnet\": \"10.0.0.0/24\", "

+ 7 - 3
src/bin/dhcp4/tests/inform_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -48,7 +48,9 @@ namespace {
 ///   - Quotes Servers option present: 192.0.2.202, 192.0.2.203.
 ///   - Quotes Servers option present: 192.0.2.202, 192.0.2.203.
 const char* INFORM_CONFIGS[] = {
 const char* INFORM_CONFIGS[] = {
 // Configuration 0
 // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
         "\"valid-lifetime\": 600,"
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"subnet\": \"10.0.0.0/24\", "
         "    \"subnet\": \"10.0.0.0/24\", "
@@ -85,7 +87,9 @@ const char* INFORM_CONFIGS[] = {
     "}",
     "}",
 
 
 // Configuration 1
 // Configuration 1
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "      \"interfaces\": [ \"*\" ]"
+        "},"
         "\"valid-lifetime\": 600,"
         "\"valid-lifetime\": 600,"
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
         "    \"subnet\": \"192.0.2.0/24\", "
         "    \"subnet\": \"192.0.2.0/24\", "

+ 9 - 3
src/bin/dhcp4/tests/kea_controller_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -87,7 +87,10 @@ const char* JSONFileBackendTest::TEST_FILE  = "test-config.json";
 TEST_F(JSONFileBackendTest, jsonFile) {
 TEST_F(JSONFileBackendTest, jsonFile) {
 
 
     // Prepare configuration file.
     // Prepare configuration file.
-    string config = "{ \"Dhcp4\": { \"interfaces\": [ \"*\" ],"
+    string config = "{ \"Dhcp4\": {"
+        "\"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
         "\"subnet4\": [ { "
         "\"subnet4\": [ { "
@@ -162,7 +165,10 @@ TEST_F(JSONFileBackendTest, comments) {
 
 
     string config_hash_comments = "# This is a comment. It should be \n"
     string config_hash_comments = "# This is a comment. It should be \n"
         "#ignored. Real config starts in line below\n"
         "#ignored. Real config starts in line below\n"
-        "{ \"Dhcp4\": { \"interfaces\": [ \"*\" ],"
+        "{ \"Dhcp4\": {"
+        "\"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, \n"
         "\"renew-timer\": 1000, \n"
         "# comments in the middle should be ignored, too\n"
         "# comments in the middle should be ignored, too\n"

+ 2 - 2
src/bin/dhcp6/json_config_parser.cc

@@ -597,7 +597,7 @@ namespace dhcp {
         (config_id.compare("rebind-timer") == 0))  {
         (config_id.compare("rebind-timer") == 0))  {
         parser = new Uint32Parser(config_id,
         parser = new Uint32Parser(config_id,
                                  globalContext()->uint32_values_);
                                  globalContext()->uint32_values_);
-    } else if (config_id.compare("interface-config") == 0) {
+    } else if (config_id.compare("interfaces-config") == 0) {
         parser = new IfacesConfigParser6();
         parser = new IfacesConfigParser6();
     } else if (config_id.compare("subnet6") == 0) {
     } else if (config_id.compare("subnet6") == 0) {
         parser = new Subnets6ListConfigParser(config_id);
         parser = new Subnets6ListConfigParser(config_id);
@@ -697,7 +697,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
                 // committed.
                 // committed.
                 hooks_parser = parser;
                 hooks_parser = parser;
                 hooks_parser->build(config_pair.second);
                 hooks_parser->build(config_pair.second);
-            } else if (config_pair.first == "interface-config") {
+            } else if (config_pair.first == "interfaces-config") {
                 // The interface parser is independent from any other parser and
                 // The interface parser is independent from any other parser and
                 // can be run here before other parsers.
                 // can be run here before other parsers.
                 parser->build(config_pair.second);
                 parser->build(config_pair.second);

+ 8 - 8
src/bin/dhcp6/tests/config_parser_unittest.cc

@@ -129,7 +129,7 @@ public:
     /// @brief Returns an interface configuration used by the most of the
     /// @brief Returns an interface configuration used by the most of the
     /// unit tests.
     /// unit tests.
     std::string genIfaceConfig() const {
     std::string genIfaceConfig() const {
-        return ("\"interface-config\": {"
+        return ("\"interfaces-config\": {"
                 "  \"interfaces\": [ \"*\" ]"
                 "  \"interfaces\": [ \"*\" ]"
                 "}");
                 "}");
     }
     }
@@ -1402,7 +1402,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
 
 
     const char *config[] =  {
     const char *config[] =  {
         // No prefix.
         // No prefix.
-        "{ \"interface-config\": { },"
+        "{ \"interfaces-config\": { },"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1416,7 +1416,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"valid-lifetime\": 4000 }"
         "\"valid-lifetime\": 4000 }"
         "] }",
         "] }",
         // No prefix-len.
         // No prefix-len.
-        "{ \"interface-config\": { },"
+        "{ \"interfaces-config\": { },"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1429,7 +1429,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"valid-lifetime\": 4000 }"
         "\"valid-lifetime\": 4000 }"
         "] }",
         "] }",
         // No delegated-len.
         // No delegated-len.
-        "{ \"interface-config\": { },"
+        "{ \"interfaces-config\": { },"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1442,7 +1442,7 @@ TEST_F(Dhcp6ParserTest, invalidPdPools) {
         "\"valid-lifetime\": 4000 }"
         "\"valid-lifetime\": 4000 }"
         "] }",
         "] }",
         // Delegated length is too short.
         // Delegated length is too short.
-        "{ \"interface-config\": { },"
+        "{ \"interfaces-config\": { },"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -2939,7 +2939,7 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries) {
 
 
     // Create the first part of the configuration string.
     // Create the first part of the configuration string.
     string config =
     string config =
-        "{ \"interface-config\": { },"
+        "{ \"interfaces-config\": { },"
            "\"hooks-libraries\": [";
            "\"hooks-libraries\": [";
 
 
     // Append the libraries (separated by commas if needed)
     // Append the libraries (separated by commas if needed)
@@ -3087,7 +3087,7 @@ TEST_F(Dhcp6ParserTest, selectedInterfaces) {
 
 
     ConstElementPtr status;
     ConstElementPtr status;
 
 
-    string config = "{ \"interface-config\": {"
+    string config = "{ \"interfaces-config\": {"
         "  \"interfaces\": [ \"eth0\" ]"
         "  \"interfaces\": [ \"eth0\" ]"
         "},"
         "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
@@ -3126,7 +3126,7 @@ TEST_F(Dhcp6ParserTest, allInterfaces) {
     // but also includes '*'. This keyword switches server into the
     // but also includes '*'. This keyword switches server into the
     // mode when it listens on all interfaces regardless of what interface names
     // mode when it listens on all interfaces regardless of what interface names
     // were specified in the "interfaces" parameter.
     // were specified in the "interfaces" parameter.
-    string config = "{ \"interface-config\": {"
+    string config = "{ \"interfaces-config\": {"
         "  \"interfaces\": [ \"eth0\", \"eth1\", \"*\" ]"
         "  \"interfaces\": [ \"eth0\", \"eth1\", \"*\" ]"
         "},"
         "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"

+ 7 - 3
src/bin/dhcp6/tests/confirm_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -42,7 +42,9 @@ namespace {
 ///
 ///
 const char* CONFIRM_CONFIGS[] = {
 const char* CONFIRM_CONFIGS[] = {
 // Configuration 0
 // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -61,7 +63,9 @@ const char* CONFIRM_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 1
 // Configuration 1
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 4 - 2
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2013,2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -160,7 +160,9 @@ TEST_F(CtrlDhcpv6SrvTest, configReload) {
 
 
     // Use empty parameters list
     // Use empty parameters list
     // Prepare configuration file.
     // Prepare configuration file.
-    string config_txt = "{ \"interfaces\": [ \"*\" ],"
+    string config_txt = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 7 - 3
src/bin/dhcp6/tests/d2_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -75,7 +75,9 @@ Dhcp6SrvD2Test::buildTestNcr(uint32_t dhcid_id_num) {
 
 
 void
 void
 Dhcp6SrvD2Test::reset() {
 Dhcp6SrvD2Test::reset() {
-    std::string config = "{ \"interfaces\": [ \"*\" ],"
+    std::string config = "{ \"interfaces-config\": {"
+            "  \"interfaces\": [ \"*\" ]"
+            "},"
             "\"hooks-libraries\": [ ],"
             "\"hooks-libraries\": [ ],"
             "\"preferred-lifetime\": 3000,"
             "\"preferred-lifetime\": 3000,"
             "\"rebind-timer\": 2000, "
             "\"rebind-timer\": 2000, "
@@ -97,7 +99,9 @@ Dhcp6SrvD2Test::configureD2(bool enable_d2, const bool exp_result,
                             const size_t max_queue_size) {
                             const size_t max_queue_size) {
     std::ostringstream config;
     std::ostringstream config;
     config <<
     config <<
-        "{ \"interfaces\": [ \"*\" ],"
+        "{ \"interfaces-config\": {"
+        "    \"interfaces\": [ \"*\" ]"
+        "},"
         "\"hooks-libraries\": [ ],"
         "\"hooks-libraries\": [ ],"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "

+ 4 - 3
src/bin/dhcp6/tests/dhcp6_process_tests.sh.in

@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC")
 #
 #
 # Permission to use, copy, modify, and/or distribute this software for any
 # Permission to use, copy, modify, and/or distribute this software for any
 # purpose with or without fee is hereby granted, provided that the above
 # purpose with or without fee is hereby granted, provided that the above
@@ -21,8 +21,9 @@ EXPECTED_VERSION="@PACKAGE_VERSION@"
 # Kea configuration to be stored in the configuration file.
 # Kea configuration to be stored in the configuration file.
 CONFIG="{
 CONFIG="{
     \"Dhcp6\":
     \"Dhcp6\":
-    {
-        \"interfaces\": [ ],
+    {   \"interfaces-config\": {
+          \"interfaces\": [ ]
+        },
         \"preferred-lifetime\": 3000,
         \"preferred-lifetime\": 3000,
         \"valid-lifetime\": 4000,
         \"valid-lifetime\": 4000,
         \"renew-timer\": 1000,
         \"renew-timer\": 1000,

+ 19 - 7
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2015  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -286,7 +286,9 @@ TEST_F(Dhcpv6SrvTest, advertiseOptions) {
     IfaceMgrTestConfig test_config(true);
     IfaceMgrTestConfig test_config(true);
 
 
     ConstElementPtr x;
     ConstElementPtr x;
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1569,7 +1571,9 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsORO) {
 
 
     IfaceMgrTestConfig test_config(true);
     IfaceMgrTestConfig test_config(true);
 
 
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1654,7 +1658,9 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsORO) {
 // src/lib/dhcp/docsis3_option_defs.h.
 // src/lib/dhcp/docsis3_option_defs.h.
 TEST_F(Dhcpv6SrvTest, vendorOptionsDocsisDefinitions) {
 TEST_F(Dhcpv6SrvTest, vendorOptionsDocsisDefinitions) {
     ConstElementPtr x;
     ConstElementPtr x;
-    string config_prefix = "{ \"interfaces\": [ \"*\" ],"
+    string config_prefix = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1820,7 +1826,9 @@ TEST_F(Dhcpv6SrvTest, clientClassify2) {
     // The second subnet does not play any role here. The client's
     // The second subnet does not play any role here. The client's
     // IP address belongs to the first subnet, so only that first
     // IP address belongs to the first subnet, so only that first
     // subnet it being tested.
     // subnet it being tested.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -1925,7 +1933,9 @@ TEST_F(Dhcpv6SrvTest, relayOverride) {
     // defined. Both are not belonging to the subnets. That is
     // defined. Both are not belonging to the subnets. That is
     // important, because if the relay belongs to the subnet, there's
     // important, because if the relay belongs to the subnet, there's
     // no need to specify relay override.
     // no need to specify relay override.
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -2001,7 +2011,9 @@ TEST_F(Dhcpv6SrvTest, relayOverrideAndClientClass) {
     // This test configures 2 subnets. They both are on the same link, so they
     // This test configures 2 subnets. They both are on the same link, so they
     // have the same relay-ip address. Furthermore, the first subnet is
     // have the same relay-ip address. Furthermore, the first subnet is
     // reserved for clients that belong to class "foo".
     // reserved for clients that belong to class "foo".
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 6 - 2
src/bin/dhcp6/tests/hooks_unittest.cc

@@ -900,7 +900,9 @@ TEST_F(HooksDhcpv6SrvTest, subnet6_select) {
 
 
     // Configure 2 subnets, both directly reachable over local interface
     // Configure 2 subnets, both directly reachable over local interface
     // (let's not complicate the matter with relays)
     // (let's not complicate the matter with relays)
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -971,7 +973,9 @@ TEST_F(HooksDhcpv6SrvTest, subnet_select_change) {
 
 
     // Configure 2 subnets, both directly reachable over local interface
     // Configure 2 subnets, both directly reachable over local interface
     // (let's not complicate the matter with relays)
     // (let's not complicate the matter with relays)
-    string config = "{ \"interfaces\": [ \"*\" ],"
+    string config = "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 12 - 4
src/bin/dhcp6/tests/infrequest_unittest.cc

@@ -45,7 +45,9 @@ namespace {
 ///   - no subnets defined
 ///   - no subnets defined
 const char* CONFIGS[] = {
 const char* CONFIGS[] = {
     // Configuration 0
     // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -66,7 +68,9 @@ const char* CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
     // Configuration 1
     // Configuration 1
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -81,7 +85,9 @@ const char* CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
     // Configuration 2
     // Configuration 2
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -100,7 +106,9 @@ const char* CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
     // Configuration 3
     // Configuration 3
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"option-data\": [ {"
         "\"option-data\": [ {"
         "    \"name\": \"nis-servers\","
         "    \"name\": \"nis-servers\","
         "    \"data\": \"2001:db8::1, 2001:db8::2\""
         "    \"data\": \"2001:db8::1, 2001:db8::2\""

+ 9 - 3
src/bin/dhcp6/tests/kea_controller_unittest.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2012-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
 // purpose with or without fee is hereby granted, provided that the above
@@ -75,7 +75,10 @@ const char* JSONFileBackendTest::TEST_FILE = "test-config.json";
 TEST_F(JSONFileBackendTest, jsonFile) {
 TEST_F(JSONFileBackendTest, jsonFile) {
 
 
     // Prepare configuration file.
     // Prepare configuration file.
-    string config = "{ \"Dhcp6\": { \"interfaces\": [ \"*\" ],"
+    string config = "{ \"Dhcp6\": {"
+        "\"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -150,7 +153,10 @@ TEST_F(JSONFileBackendTest, comments) {
 
 
     string config_hash_comments = "# This is a comment. It should be \n"
     string config_hash_comments = "# This is a comment. It should be \n"
         "#ignored. Real config starts in line below\n"
         "#ignored. Real config starts in line below\n"
-        "{ \"Dhcp6\": { \"interfaces\": [ \"*\" ],"
+        "{ \"Dhcp6\": {"
+        "\"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, \n"
         "\"renew-timer\": 1000, \n"

+ 18 - 6
src/bin/dhcp6/tests/rebind_unittest.cc

@@ -64,7 +64,9 @@ namespace {
 ///   - this specific configuration is used by tests which don't use relays
 ///   - this specific configuration is used by tests which don't use relays
 const char* REBIND_CONFIGS[] = {
 const char* REBIND_CONFIGS[] = {
 // Configuration 0
 // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -83,7 +85,9 @@ const char* REBIND_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 1
 // Configuration 1
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -102,7 +106,9 @@ const char* REBIND_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 2
 // Configuration 2
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -121,7 +127,9 @@ const char* REBIND_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 3
 // Configuration 3
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -140,7 +148,9 @@ const char* REBIND_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 4
 // Configuration 4
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "
@@ -167,7 +177,9 @@ const char* REBIND_CONFIGS[] = {
         "\"valid-lifetime\": 4000 }",
         "\"valid-lifetime\": 4000 }",
 
 
 // Configuration 5
 // Configuration 5
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 3 - 1
src/bin/dhcp6/tests/sarr_unittest.cc

@@ -34,7 +34,9 @@ namespace {
 ///     match the subnet prefix
 ///     match the subnet prefix
 const char* CONFIGS[] = {
 const char* CONFIGS[] = {
     // Configuration 0
     // Configuration 0
-    "{ \"interfaces\": [ \"*\" ],"
+    "{ \"interfaces-config\": {"
+        "  \"interfaces\": [ \"*\" ]"
+        "},"
         "\"preferred-lifetime\": 3000,"
         "\"preferred-lifetime\": 3000,"
         "\"rebind-timer\": 2000, "
         "\"rebind-timer\": 2000, "
         "\"renew-timer\": 1000, "
         "\"renew-timer\": 1000, "

+ 6 - 2
src/bin/keactrl/kea.conf.pre

@@ -9,7 +9,9 @@
 "Dhcp4":
 "Dhcp4":
 {
 {
 # Add names of interfaces to listen on.
 # Add names of interfaces to listen on.
-  "interfaces": [ ],
+  "interfaces-config:" {
+    "interfaces": [ ]
+  },
 
 
 # Use Memfile lease database backend to store leases in a CSV file.
 # Use Memfile lease database backend to store leases in a CSV file.
   "lease-database": {
   "lease-database": {
@@ -34,7 +36,9 @@
 "Dhcp6":
 "Dhcp6":
 {
 {
 # Add names of interfaces to listen on.
 # Add names of interfaces to listen on.
-  "interfaces": [ ],
+  "interfaces-config:" {
+    "interfaces": [ ]
+  },
 
 
 # Use Memfile lease database backend to store leases in a CSV file.
 # Use Memfile lease database backend to store leases in a CSV file.
   "lease-database": {
   "lease-database": {

+ 6 - 2
src/bin/keactrl/tests/keactrl_tests.sh.in

@@ -35,7 +35,9 @@ d2_name="${wildcard_name}-ddns"
 config="{
 config="{
     \"Dhcp4\":
     \"Dhcp4\":
     {
     {
-        \"interfaces\": [ ],
+        \"interfaces-config\": {
+            \"interfaces\": [ ]
+        },
         \"valid-lifetime\": 4000,
         \"valid-lifetime\": 4000,
         \"renew-timer\": 1000,
         \"renew-timer\": 1000,
         \"rebind-timer\": 2000,
         \"rebind-timer\": 2000,
@@ -52,7 +54,9 @@ config="{
     },
     },
     \"Dhcp6\":
     \"Dhcp6\":
     {
     {
-        \"interfaces\": [ ],
+        \"interfaces-config\": {
+            \"interfaces\": [ ]
+        },
         \"preferred-lifetime\": 3000,
         \"preferred-lifetime\": 3000,
         \"valid-lifetime\": 4000,
         \"valid-lifetime\": 4000,
         \"renew-timer\": 1000,
         \"renew-timer\": 1000,

+ 7 - 7
src/lib/dhcpsrv/parsers/ifaces_config_parser.h

@@ -24,8 +24,8 @@ namespace dhcp {
 
 
 /// @brief Parser for interface list definition.
 /// @brief Parser for interface list definition.
 ///
 ///
-/// This parser handles Dhcp4/interface-config/interfaces and
-/// Dhcp6/interface-config/interfaces entries.
+/// This parser handles Dhcp4/interfaces-config/interfaces and
+/// Dhcp6/interfaces-config/interfaces entries.
 /// It contains a list of network interfaces that the server listens on.
 /// It contains a list of network interfaces that the server listens on.
 /// In particular, it can contain an "*" that designates all interfaces.
 /// In particular, it can contain an "*" that designates all interfaces.
 class InterfaceListConfigParser : public DhcpConfigParser {
 class InterfaceListConfigParser : public DhcpConfigParser {
@@ -66,7 +66,7 @@ private:
 
 
 /// @brief Parser for the configuration of interfaces.
 /// @brief Parser for the configuration of interfaces.
 ///
 ///
-/// This parser parses the "interface-config" parameter which holds the
+/// This parser parses the "interfaces-config" parameter which holds the
 /// full configuration of the DHCP server with respect to the use of
 /// full configuration of the DHCP server with respect to the use of
 /// interfaces, sockets and alike.
 /// interfaces, sockets and alike.
 ///
 ///
@@ -84,9 +84,9 @@ public:
     /// @param protocol AF_INET for DHCPv4 and AF_INET6 for DHCPv6.
     /// @param protocol AF_INET for DHCPv4 and AF_INET6 for DHCPv6.
     IfacesConfigParser(const int protocol);
     IfacesConfigParser(const int protocol);
 
 
-    /// @brief Parses generic parameters in "interface-config".
+    /// @brief Parses generic parameters in "interfaces-config".
     ///
     ///
-    /// The generic parameters in the "interface-config" map are
+    /// The generic parameters in the "interfaces-config" map are
     /// the ones that are common for DHCPv4 and DHCPv6.
     /// the ones that are common for DHCPv4 and DHCPv6.
     ///
     ///
     /// @param ifaces_config A data element holding configuration of
     /// @param ifaces_config A data element holding configuration of
@@ -116,7 +116,7 @@ private:
 };
 };
 
 
 
 
-/// @brief Parser for the "interface-config" parameter of the DHCPv4 server.
+/// @brief Parser for the "interfaces-config" parameter of the DHCPv4 server.
 class IfacesConfigParser4 : public IfacesConfigParser {
 class IfacesConfigParser4 : public IfacesConfigParser {
 public:
 public:
 
 
@@ -139,7 +139,7 @@ public:
 
 
 };
 };
 
 
-/// @brief Parser for the "interface-config" parameter of the DHCPv4 server.
+/// @brief Parser for the "interfaces-config" parameter of the DHCPv4 server.
 class IfacesConfigParser6 : public IfacesConfigParser {
 class IfacesConfigParser6 : public IfacesConfigParser {
 public:
 public: