Browse Source

[5073a] Main code finished

Francis Dupont 7 years ago
parent
commit
743182ec97

+ 3 - 3
src/bin/dhcp4/dhcp4_srv.cc

@@ -2858,9 +2858,9 @@ Dhcpv4Srv::deferredUnpack(Pkt4Ptr& query)
         if (!def) {
         if (!def) {
             def = LibDHCP::getRuntimeOptionDef(DHCP4_OPTION_SPACE, code);
             def = LibDHCP::getRuntimeOptionDef(DHCP4_OPTION_SPACE, code);
         }
         }
-        // Option 43 has a last resort definition
-        if ((code == DHO_VENDOR_ENCAPSULATED_OPTIONS) && !def) {
-            def = LibDHCP::last_resort_option43_def;
+        // Finish by last resort definition
+        if (!def) {
+            def = LibDHCP::getLastResortOptionDef(DHCP4_OPTION_SPACE, code);
         }
         }
         // If not defined go to the next option
         // If not defined go to the next option
         if (!def) {
         if (!def) {

+ 1 - 2
src/bin/dhcp4/tests/config_parser_unittest.cc

@@ -3179,7 +3179,6 @@ TEST_F(Dhcp4ParserTest, domainSearchOption) {
                                      " domain-search option"));
                                      " domain-search option"));
 }
 }
 
 
-#if 0
 // The goal of this test is to verify that the standard option can
 // The goal of this test is to verify that the standard option can
 // be configured to encapsulate multiple other options.
 // be configured to encapsulate multiple other options.
 TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
 TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
@@ -3430,7 +3429,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) {
         CfgMgr::instance().getStagingCfg()->getCfgOption()->get(5678, 100);
         CfgMgr::instance().getStagingCfg()->getCfgOption()->get(5678, 100);
     ASSERT_FALSE(desc2.option_);
     ASSERT_FALSE(desc2.option_);
 }
 }
-#endif
+
 
 
 // Tests of the hooks libraries configuration.  All tests have the pre-
 // Tests of the hooks libraries configuration.  All tests have the pre-
 // condition (checked in the test fixture's SetUp() method) that no hooks
 // condition (checked in the test fixture's SetUp() method) that no hooks

+ 601 - 84
src/bin/dhcp4/tests/get_config_unittest.cc

@@ -881,8 +881,34 @@ const char* EXTRACTED_CONFIGS[] = {
     // CONFIGURATION 32
     // CONFIGURATION 32
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
-"            \"interfaces\": [ \"eth0\", \"eth1\" ]\n"
+"            \"interfaces\": [ \"*\" ]\n"
 "        },\n"
 "        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"data\": \"1234\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            },\n"
+"            {\n"
+"                \"data\": \"192.168.2.1\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"code\": 1,\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"uint32\"\n"
+"            },\n"
+"            {\n"
+"                \"code\": 2,\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"ipv4-address\"\n"
+"            }\n"
+"        ],\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"renew-timer\": 1000,\n"
 "        \"renew-timer\": 1000,\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
@@ -890,13 +916,143 @@ const char* EXTRACTED_CONFIGS[] = {
     // CONFIGURATION 33
     // CONFIGURATION 33
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ]\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"csv-format\": false,\n"
+"                \"name\": \"vendor-encapsulated-options\"\n"
+"            },\n"
+"            {\n"
+"                \"data\": \"1234\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            },\n"
+"            {\n"
+"                \"code\": 2,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"192.168.2.1\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"code\": 1,\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"uint32\"\n"
+"            },\n"
+"            {\n"
+"                \"code\": 2,\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"ipv4-address\"\n"
+"            }\n"
+"        ],\n"
+"        \"rebind-timer\": 2000,\n"
+"        \"renew-timer\": 1000,\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"pool\": \"192.0.2.1 - 192.0.2.100\"\n"
+"                    }\n"
+"                ],\n"
+"                \"subnet\": \"192.0.2.0/24\"\n"
+"            }\n"
+"        ],\n"
+"        \"valid-lifetime\": 3000\n"
+"    }\n",
+    // CONFIGURATION 34
+"{\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ]\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"code\": 100,\n"
+"                \"csv-format\": false,\n"
+"                \"data\": \"ABCDEF0105\",\n"
+"                \"name\": \"option-one\",\n"
+"                \"space\": \"vendor-4491\"\n"
+"            },\n"
+"            {\n"
+"                \"code\": 100,\n"
+"                \"csv-format\": false,\n"
+"                \"data\": \"1234\",\n"
+"                \"name\": \"option-two\",\n"
+"                \"space\": \"vendor-1234\"\n"
+"            }\n"
+"        ],\n"
+"        \"rebind-timer\": 2000,\n"
+"        \"renew-timer\": 1000,\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"pool\": \"192.0.2.1-192.0.2.10\"\n"
+"                    }\n"
+"                ],\n"
+"                \"subnet\": \"192.0.2.0/24\"\n"
+"            }\n"
+"        ],\n"
+"        \"valid-lifetime\": 4000\n"
+"    }\n",
+    // CONFIGURATION 35
+"{\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ]\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"code\": 100,\n"
+"                \"data\": \"this is a string vendor-opt\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-4491\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"code\": 100,\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-4491\",\n"
+"                \"type\": \"string\"\n"
+"            }\n"
+"        ],\n"
+"        \"rebind-timer\": 2000,\n"
+"        \"renew-timer\": 1000,\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"pool\": \"192.0.2.1 - 192.0.2.100\"\n"
+"                    }\n"
+"                ],\n"
+"                \"subnet\": \"192.0.2.0/24\"\n"
+"            }\n"
+"        ],\n"
+"        \"valid-lifetime\": 4000\n"
+"    }\n",
+    // CONFIGURATION 36
+"{\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"eth0\", \"eth1\" ]\n"
+"        },\n"
+"        \"rebind-timer\": 2000,\n"
+"        \"renew-timer\": 1000,\n"
+"        \"valid-lifetime\": 4000\n"
+"    }\n",
+    // CONFIGURATION 37
+"{\n"
+"        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"eth0\", \"*\", \"eth1\" ]\n"
 "            \"interfaces\": [ \"eth0\", \"*\", \"eth1\" ]\n"
 "        },\n"
 "        },\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"renew-timer\": 1000,\n"
 "        \"renew-timer\": 1000,\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 34
+    // CONFIGURATION 38
 "{\n"
 "{\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
 "            \"always-include-fqdn\": true,\n"
 "            \"always-include-fqdn\": true,\n"
@@ -931,7 +1087,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 35
+    // CONFIGURATION 39
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -956,7 +1112,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 36
+    // CONFIGURATION 40
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1054,7 +1210,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 37
+    // CONFIGURATION 41
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1095,7 +1251,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 38
+    // CONFIGURATION 42
 "{\n"
 "{\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"rebind-timer\": 2000,\n"
 "        \"renew-timer\": 1000,\n"
 "        \"renew-timer\": 1000,\n"
@@ -1138,21 +1294,21 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 39
+    // CONFIGURATION 43
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "        },\n"
 "        },\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 40
+    // CONFIGURATION 44
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "        },\n"
 "        },\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 41
+    // CONFIGURATION 45
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 12345,\n"
 "        \"decline-probation-period\": 12345,\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
@@ -1160,7 +1316,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        },\n"
 "        },\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 42
+    // CONFIGURATION 46
 "{\n"
 "{\n"
 "        \"expired-leases-processing\": {\n"
 "        \"expired-leases-processing\": {\n"
 "            \"flush-reclaimed-timer-wait-time\": 35,\n"
 "            \"flush-reclaimed-timer-wait-time\": 35,\n"
@@ -1175,7 +1331,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        },\n"
 "        },\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 43
+    // CONFIGURATION 47
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1194,7 +1350,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 44
+    // CONFIGURATION 48
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1214,7 +1370,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 45
+    // CONFIGURATION 49
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1234,7 +1390,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 46
+    // CONFIGURATION 50
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1255,7 +1411,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 47
+    // CONFIGURATION 51
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1275,7 +1431,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 48
+    // CONFIGURATION 52
 "{\n"
 "{\n"
 "        \"client-classes\": [\n"
 "        \"client-classes\": [\n"
 "            {\n"
 "            {\n"
@@ -1305,7 +1461,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 49
+    // CONFIGURATION 53
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1324,7 +1480,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 50
+    // CONFIGURATION 54
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1344,7 +1500,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 51
+    // CONFIGURATION 55
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -1368,7 +1524,7 @@ const char* EXTRACTED_CONFIGS[] = {
 "        ],\n"
 "        ],\n"
 "        \"valid-lifetime\": 4000\n"
 "        \"valid-lifetime\": 4000\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 52
+    // CONFIGURATION 56
 "{\n"
 "{\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ]\n"
 "            \"interfaces\": [ \"*\" ]\n"
@@ -3938,14 +4094,50 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"hooks-libraries\": [ ],\n"
 "        \"hooks-libraries\": [ ],\n"
 "        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
 "        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
-"            \"interfaces\": [ \"eth0\", \"eth1\" ],\n"
+"            \"interfaces\": [ \"*\" ],\n"
 "            \"re-detect\": false\n"
 "            \"re-detect\": false\n"
 "        },\n"
 "        },\n"
 "        \"lease-database\": {\n"
 "        \"lease-database\": {\n"
 "            \"type\": \"memfile\"\n"
 "            \"type\": \"memfile\"\n"
 "        },\n"
 "        },\n"
-"        \"option-data\": [ ],\n"
-"        \"option-def\": [ ],\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 1,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"1234\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            },\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 2,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"192.168.2.1\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"array\": false,\n"
+"                \"code\": 1,\n"
+"                \"encapsulate\": \"\",\n"
+"                \"name\": \"foo\",\n"
+"                \"record-types\": \"\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"uint32\"\n"
+"            },\n"
+"            {\n"
+"                \"array\": false,\n"
+"                \"code\": 2,\n"
+"                \"encapsulate\": \"\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"record-types\": \"\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"ipv4-address\"\n"
+"            }\n"
+"        ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
@@ -3981,49 +4173,374 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"hooks-libraries\": [ ],\n"
 "        \"hooks-libraries\": [ ],\n"
 "        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
 "        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
 "        \"interfaces-config\": {\n"
 "        \"interfaces-config\": {\n"
-"            \"interfaces\": [ \"*\", \"eth0\", \"eth1\" ],\n"
-"            \"re-detect\": false\n"
-"        },\n"
-"        \"lease-database\": {\n"
-"            \"type\": \"memfile\"\n"
-"        },\n"
-"        \"option-data\": [ ],\n"
-"        \"option-def\": [ ],\n"
-"        \"shared-networks\": [ ],\n"
-"        \"subnet4\": [ ]\n"
-"    }\n",
-    // CONFIGURATION 34
-"{\n"
-"        \"decline-probation-period\": 86400,\n"
-"        \"dhcp-ddns\": {\n"
-"            \"always-include-fqdn\": true,\n"
-"            \"enable-updates\": true,\n"
-"            \"generated-prefix\": \"test.prefix\",\n"
-"            \"max-queue-size\": 2048,\n"
-"            \"ncr-format\": \"JSON\",\n"
-"            \"ncr-protocol\": \"UDP\",\n"
-"            \"override-client-update\": true,\n"
-"            \"override-no-update\": true,\n"
-"            \"qualifying-suffix\": \"test.suffix.\",\n"
-"            \"replace-client-name\": \"when-present\",\n"
-"            \"sender-ip\": \"192.168.2.2\",\n"
-"            \"sender-port\": 778,\n"
-"            \"server-ip\": \"192.168.2.1\",\n"
-"            \"server-port\": 777\n"
-"        },\n"
-"        \"dhcp4o6-port\": 0,\n"
-"        \"echo-client-id\": true,\n"
-"        \"expired-leases-processing\": {\n"
-"            \"flush-reclaimed-timer-wait-time\": 25,\n"
-"            \"hold-reclaimed-time\": 3600,\n"
-"            \"max-reclaim-leases\": 100,\n"
-"            \"max-reclaim-time\": 250,\n"
-"            \"reclaim-timer-wait-time\": 10,\n"
-"            \"unwarned-reclaim-cycles\": 5\n"
-"        },\n"
-"        \"hooks-libraries\": [ ],\n"
-"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
-"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ],\n"
+"            \"re-detect\": false\n"
+"        },\n"
+"        \"lease-database\": {\n"
+"            \"type\": \"memfile\"\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 43,\n"
+"                \"csv-format\": false,\n"
+"                \"data\": \"0104000004D20204C0A80201\",\n"
+"                \"name\": \"vendor-encapsulated-options\",\n"
+"                \"space\": \"dhcp4\"\n"
+"            },\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 1,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"1234\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            },\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 2,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"192.168.2.1\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"array\": false,\n"
+"                \"code\": 1,\n"
+"                \"encapsulate\": \"\",\n"
+"                \"name\": \"foo\",\n"
+"                \"record-types\": \"\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"uint32\"\n"
+"            },\n"
+"            {\n"
+"                \"array\": false,\n"
+"                \"code\": 2,\n"
+"                \"encapsulate\": \"\",\n"
+"                \"name\": \"foo2\",\n"
+"                \"record-types\": \"\",\n"
+"                \"space\": \"vendor-encapsulated-options-space\",\n"
+"                \"type\": \"ipv4-address\"\n"
+"            }\n"
+"        ],\n"
+"        \"shared-networks\": [ ],\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"4o6-interface\": \"\",\n"
+"                \"4o6-interface-id\": \"\",\n"
+"                \"4o6-subnet\": \"\",\n"
+"                \"id\": 1,\n"
+"                \"match-client-id\": true,\n"
+"                \"next-server\": \"0.0.0.0\",\n"
+"                \"option-data\": [ ],\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"option-data\": [ ],\n"
+"                        \"pool\": \"192.0.2.1-192.0.2.100\"\n"
+"                    }\n"
+"                ],\n"
+"                \"rebind-timer\": 2000,\n"
+"                \"relay\": {\n"
+"                    \"ip-address\": \"0.0.0.0\"\n"
+"                },\n"
+"                \"renew-timer\": 1000,\n"
+"                \"reservation-mode\": \"all\",\n"
+"                \"reservations\": [ ],\n"
+"                \"subnet\": \"192.0.2.0/24\",\n"
+"                \"valid-lifetime\": 3000\n"
+"            }\n"
+"        ]\n"
+"    }\n",
+    // CONFIGURATION 34
+"{\n"
+"        \"decline-probation-period\": 86400,\n"
+"        \"dhcp-ddns\": {\n"
+"            \"always-include-fqdn\": false,\n"
+"            \"enable-updates\": false,\n"
+"            \"generated-prefix\": \"myhost\",\n"
+"            \"max-queue-size\": 1024,\n"
+"            \"ncr-format\": \"JSON\",\n"
+"            \"ncr-protocol\": \"UDP\",\n"
+"            \"override-client-update\": false,\n"
+"            \"override-no-update\": false,\n"
+"            \"qualifying-suffix\": \"\",\n"
+"            \"replace-client-name\": \"never\",\n"
+"            \"sender-ip\": \"0.0.0.0\",\n"
+"            \"sender-port\": 0,\n"
+"            \"server-ip\": \"127.0.0.1\",\n"
+"            \"server-port\": 53001\n"
+"        },\n"
+"        \"dhcp4o6-port\": 0,\n"
+"        \"echo-client-id\": true,\n"
+"        \"expired-leases-processing\": {\n"
+"            \"flush-reclaimed-timer-wait-time\": 25,\n"
+"            \"hold-reclaimed-time\": 3600,\n"
+"            \"max-reclaim-leases\": 100,\n"
+"            \"max-reclaim-time\": 250,\n"
+"            \"reclaim-timer-wait-time\": 10,\n"
+"            \"unwarned-reclaim-cycles\": 5\n"
+"        },\n"
+"        \"hooks-libraries\": [ ],\n"
+"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ],\n"
+"            \"re-detect\": false\n"
+"        },\n"
+"        \"lease-database\": {\n"
+"            \"type\": \"memfile\"\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 100,\n"
+"                \"csv-format\": false,\n"
+"                \"data\": \"1234\",\n"
+"                \"space\": \"vendor-1234\"\n"
+"            },\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 100,\n"
+"                \"csv-format\": false,\n"
+"                \"data\": \"ABCDEF0105\",\n"
+"                \"space\": \"vendor-4491\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [ ],\n"
+"        \"shared-networks\": [ ],\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"4o6-interface\": \"\",\n"
+"                \"4o6-interface-id\": \"\",\n"
+"                \"4o6-subnet\": \"\",\n"
+"                \"id\": 1,\n"
+"                \"match-client-id\": true,\n"
+"                \"next-server\": \"0.0.0.0\",\n"
+"                \"option-data\": [ ],\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"option-data\": [ ],\n"
+"                        \"pool\": \"192.0.2.1-192.0.2.10\"\n"
+"                    }\n"
+"                ],\n"
+"                \"rebind-timer\": 2000,\n"
+"                \"relay\": {\n"
+"                    \"ip-address\": \"0.0.0.0\"\n"
+"                },\n"
+"                \"renew-timer\": 1000,\n"
+"                \"reservation-mode\": \"all\",\n"
+"                \"reservations\": [ ],\n"
+"                \"subnet\": \"192.0.2.0/24\",\n"
+"                \"valid-lifetime\": 4000\n"
+"            }\n"
+"        ]\n"
+"    }\n",
+    // CONFIGURATION 35
+"{\n"
+"        \"decline-probation-period\": 86400,\n"
+"        \"dhcp-ddns\": {\n"
+"            \"always-include-fqdn\": false,\n"
+"            \"enable-updates\": false,\n"
+"            \"generated-prefix\": \"myhost\",\n"
+"            \"max-queue-size\": 1024,\n"
+"            \"ncr-format\": \"JSON\",\n"
+"            \"ncr-protocol\": \"UDP\",\n"
+"            \"override-client-update\": false,\n"
+"            \"override-no-update\": false,\n"
+"            \"qualifying-suffix\": \"\",\n"
+"            \"replace-client-name\": \"never\",\n"
+"            \"sender-ip\": \"0.0.0.0\",\n"
+"            \"sender-port\": 0,\n"
+"            \"server-ip\": \"127.0.0.1\",\n"
+"            \"server-port\": 53001\n"
+"        },\n"
+"        \"dhcp4o6-port\": 0,\n"
+"        \"echo-client-id\": true,\n"
+"        \"expired-leases-processing\": {\n"
+"            \"flush-reclaimed-timer-wait-time\": 25,\n"
+"            \"hold-reclaimed-time\": 3600,\n"
+"            \"max-reclaim-leases\": 100,\n"
+"            \"max-reclaim-time\": 250,\n"
+"            \"reclaim-timer-wait-time\": 10,\n"
+"            \"unwarned-reclaim-cycles\": 5\n"
+"        },\n"
+"        \"hooks-libraries\": [ ],\n"
+"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\" ],\n"
+"            \"re-detect\": false\n"
+"        },\n"
+"        \"lease-database\": {\n"
+"            \"type\": \"memfile\"\n"
+"        },\n"
+"        \"option-data\": [\n"
+"            {\n"
+"                \"always-send\": false,\n"
+"                \"code\": 100,\n"
+"                \"csv-format\": true,\n"
+"                \"data\": \"this is a string vendor-opt\",\n"
+"                \"name\": \"foo\",\n"
+"                \"space\": \"vendor-4491\"\n"
+"            }\n"
+"        ],\n"
+"        \"option-def\": [\n"
+"            {\n"
+"                \"array\": false,\n"
+"                \"code\": 100,\n"
+"                \"encapsulate\": \"\",\n"
+"                \"name\": \"foo\",\n"
+"                \"record-types\": \"\",\n"
+"                \"space\": \"vendor-4491\",\n"
+"                \"type\": \"string\"\n"
+"            }\n"
+"        ],\n"
+"        \"shared-networks\": [ ],\n"
+"        \"subnet4\": [\n"
+"            {\n"
+"                \"4o6-interface\": \"\",\n"
+"                \"4o6-interface-id\": \"\",\n"
+"                \"4o6-subnet\": \"\",\n"
+"                \"id\": 1,\n"
+"                \"match-client-id\": true,\n"
+"                \"next-server\": \"0.0.0.0\",\n"
+"                \"option-data\": [ ],\n"
+"                \"pools\": [\n"
+"                    {\n"
+"                        \"option-data\": [ ],\n"
+"                        \"pool\": \"192.0.2.1-192.0.2.100\"\n"
+"                    }\n"
+"                ],\n"
+"                \"rebind-timer\": 2000,\n"
+"                \"relay\": {\n"
+"                    \"ip-address\": \"0.0.0.0\"\n"
+"                },\n"
+"                \"renew-timer\": 1000,\n"
+"                \"reservation-mode\": \"all\",\n"
+"                \"reservations\": [ ],\n"
+"                \"subnet\": \"192.0.2.0/24\",\n"
+"                \"valid-lifetime\": 4000\n"
+"            }\n"
+"        ]\n"
+"    }\n",
+    // CONFIGURATION 36
+"{\n"
+"        \"decline-probation-period\": 86400,\n"
+"        \"dhcp-ddns\": {\n"
+"            \"always-include-fqdn\": false,\n"
+"            \"enable-updates\": false,\n"
+"            \"generated-prefix\": \"myhost\",\n"
+"            \"max-queue-size\": 1024,\n"
+"            \"ncr-format\": \"JSON\",\n"
+"            \"ncr-protocol\": \"UDP\",\n"
+"            \"override-client-update\": false,\n"
+"            \"override-no-update\": false,\n"
+"            \"qualifying-suffix\": \"\",\n"
+"            \"replace-client-name\": \"never\",\n"
+"            \"sender-ip\": \"0.0.0.0\",\n"
+"            \"sender-port\": 0,\n"
+"            \"server-ip\": \"127.0.0.1\",\n"
+"            \"server-port\": 53001\n"
+"        },\n"
+"        \"dhcp4o6-port\": 0,\n"
+"        \"echo-client-id\": true,\n"
+"        \"expired-leases-processing\": {\n"
+"            \"flush-reclaimed-timer-wait-time\": 25,\n"
+"            \"hold-reclaimed-time\": 3600,\n"
+"            \"max-reclaim-leases\": 100,\n"
+"            \"max-reclaim-time\": 250,\n"
+"            \"reclaim-timer-wait-time\": 10,\n"
+"            \"unwarned-reclaim-cycles\": 5\n"
+"        },\n"
+"        \"hooks-libraries\": [ ],\n"
+"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"eth0\", \"eth1\" ],\n"
+"            \"re-detect\": false\n"
+"        },\n"
+"        \"lease-database\": {\n"
+"            \"type\": \"memfile\"\n"
+"        },\n"
+"        \"option-data\": [ ],\n"
+"        \"option-def\": [ ],\n"
+"        \"shared-networks\": [ ],\n"
+"        \"subnet4\": [ ]\n"
+"    }\n",
+    // CONFIGURATION 37
+"{\n"
+"        \"decline-probation-period\": 86400,\n"
+"        \"dhcp-ddns\": {\n"
+"            \"always-include-fqdn\": false,\n"
+"            \"enable-updates\": false,\n"
+"            \"generated-prefix\": \"myhost\",\n"
+"            \"max-queue-size\": 1024,\n"
+"            \"ncr-format\": \"JSON\",\n"
+"            \"ncr-protocol\": \"UDP\",\n"
+"            \"override-client-update\": false,\n"
+"            \"override-no-update\": false,\n"
+"            \"qualifying-suffix\": \"\",\n"
+"            \"replace-client-name\": \"never\",\n"
+"            \"sender-ip\": \"0.0.0.0\",\n"
+"            \"sender-port\": 0,\n"
+"            \"server-ip\": \"127.0.0.1\",\n"
+"            \"server-port\": 53001\n"
+"        },\n"
+"        \"dhcp4o6-port\": 0,\n"
+"        \"echo-client-id\": true,\n"
+"        \"expired-leases-processing\": {\n"
+"            \"flush-reclaimed-timer-wait-time\": 25,\n"
+"            \"hold-reclaimed-time\": 3600,\n"
+"            \"max-reclaim-leases\": 100,\n"
+"            \"max-reclaim-time\": 250,\n"
+"            \"reclaim-timer-wait-time\": 10,\n"
+"            \"unwarned-reclaim-cycles\": 5\n"
+"        },\n"
+"        \"hooks-libraries\": [ ],\n"
+"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
+"        \"interfaces-config\": {\n"
+"            \"interfaces\": [ \"*\", \"eth0\", \"eth1\" ],\n"
+"            \"re-detect\": false\n"
+"        },\n"
+"        \"lease-database\": {\n"
+"            \"type\": \"memfile\"\n"
+"        },\n"
+"        \"option-data\": [ ],\n"
+"        \"option-def\": [ ],\n"
+"        \"shared-networks\": [ ],\n"
+"        \"subnet4\": [ ]\n"
+"    }\n",
+    // CONFIGURATION 38
+"{\n"
+"        \"decline-probation-period\": 86400,\n"
+"        \"dhcp-ddns\": {\n"
+"            \"always-include-fqdn\": true,\n"
+"            \"enable-updates\": true,\n"
+"            \"generated-prefix\": \"test.prefix\",\n"
+"            \"max-queue-size\": 2048,\n"
+"            \"ncr-format\": \"JSON\",\n"
+"            \"ncr-protocol\": \"UDP\",\n"
+"            \"override-client-update\": true,\n"
+"            \"override-no-update\": true,\n"
+"            \"qualifying-suffix\": \"test.suffix.\",\n"
+"            \"replace-client-name\": \"when-present\",\n"
+"            \"sender-ip\": \"192.168.2.2\",\n"
+"            \"sender-port\": 778,\n"
+"            \"server-ip\": \"192.168.2.1\",\n"
+"            \"server-port\": 777\n"
+"        },\n"
+"        \"dhcp4o6-port\": 0,\n"
+"        \"echo-client-id\": true,\n"
+"        \"expired-leases-processing\": {\n"
+"            \"flush-reclaimed-timer-wait-time\": 25,\n"
+"            \"hold-reclaimed-time\": 3600,\n"
+"            \"max-reclaim-leases\": 100,\n"
+"            \"max-reclaim-time\": 250,\n"
+"            \"reclaim-timer-wait-time\": 10,\n"
+"            \"unwarned-reclaim-cycles\": 5\n"
+"        },\n"
+"        \"hooks-libraries\": [ ],\n"
+"        \"host-reservation-identifiers\": [ \"hw-address\", \"duid\", \"circuit-id\", \"client-id\" ],\n"
+"        \"interfaces-config\": {\n"
 "            \"interfaces\": [ \"*\" ],\n"
 "            \"interfaces\": [ \"*\" ],\n"
 "            \"re-detect\": false\n"
 "            \"re-detect\": false\n"
 "        },\n"
 "        },\n"
@@ -4060,7 +4577,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 35
+    // CONFIGURATION 39
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4128,7 +4645,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 36
+    // CONFIGURATION 40
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4347,7 +4864,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 37
+    // CONFIGURATION 41
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4445,7 +4962,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 38
+    // CONFIGURATION 42
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4585,7 +5102,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 39
+    // CONFIGURATION 43
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4628,7 +5145,7 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"shared-networks\": [ ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 40
+    // CONFIGURATION 44
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4671,7 +5188,7 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"shared-networks\": [ ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 41
+    // CONFIGURATION 45
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 12345,\n"
 "        \"decline-probation-period\": 12345,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4714,7 +5231,7 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"shared-networks\": [ ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 42
+    // CONFIGURATION 46
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4757,7 +5274,7 @@ const char* UNPARSED_CONFIGS[] = {
 "        \"shared-networks\": [ ],\n"
 "        \"shared-networks\": [ ],\n"
 "        \"subnet4\": [ ]\n"
 "        \"subnet4\": [ ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 43
+    // CONFIGURATION 47
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4825,7 +5342,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 44
+    // CONFIGURATION 48
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4893,7 +5410,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 45
+    // CONFIGURATION 49
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -4961,7 +5478,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 46
+    // CONFIGURATION 50
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -5029,7 +5546,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 47
+    // CONFIGURATION 51
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -5097,7 +5614,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 48
+    // CONFIGURATION 52
 "{\n"
 "{\n"
 "        \"client-classes\": [\n"
 "        \"client-classes\": [\n"
 "            {\n"
 "            {\n"
@@ -5191,7 +5708,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 49
+    // CONFIGURATION 53
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -5259,7 +5776,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 50
+    // CONFIGURATION 54
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -5328,7 +5845,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 51
+    // CONFIGURATION 55
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"
@@ -5401,7 +5918,7 @@ const char* UNPARSED_CONFIGS[] = {
 "            }\n"
 "            }\n"
 "        ]\n"
 "        ]\n"
 "    }\n",
 "    }\n",
-    // CONFIGURATION 52
+    // CONFIGURATION 56
 "{\n"
 "{\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"decline-probation-period\": 86400,\n"
 "        \"dhcp-ddns\": {\n"
 "        \"dhcp-ddns\": {\n"

+ 42 - 8
src/lib/dhcp/libdhcp++.cc

@@ -54,15 +54,15 @@ VendorOptionDefContainers LibDHCP::vendor4_defs_;
 // Static container with vendor option definitions for DHCPv6.
 // Static container with vendor option definitions for DHCPv6.
 VendorOptionDefContainers LibDHCP::vendor6_defs_;
 VendorOptionDefContainers LibDHCP::vendor6_defs_;
 
 
+// Static container with last resort option definitions for DHCPv4.
+OptionDefContainerPtr LibDHCP::lastresort_defs_(new OptionDefContainer());
+
 // Static container with option definitions created in runtime.
 // Static container with option definitions created in runtime.
 StagedValue<OptionDefSpaceContainer> LibDHCP::runtime_option_defs_;
 StagedValue<OptionDefSpaceContainer> LibDHCP::runtime_option_defs_;
 
 
 // Null container.
 // Null container.
 const OptionDefContainerPtr null_option_def_container_(new OptionDefContainer());
 const OptionDefContainerPtr null_option_def_container_(new OptionDefContainer());
 
 
-// Option 43 definition.
-OptionDefinitionPtr LibDHCP::last_resort_option43_def;
-
 // Those two vendor classes are used for cable modems:
 // Those two vendor classes are used for cable modems:
 
 
 /// DOCSIS3.0 compatible cable modem
 /// DOCSIS3.0 compatible cable modem
@@ -86,6 +86,7 @@ LibDHCP::getOptionDefs(const std::string& space) {
         initVendorOptsDocsis4();
         initVendorOptsDocsis4();
         initStdOptionDefs6();
         initStdOptionDefs6();
         initVendorOptsDocsis6();
         initVendorOptsDocsis6();
+        initLastResortOptionDefs();
     }
     }
 
 
     if (space == DHCP4_OPTION_SPACE) {
     if (space == DHCP4_OPTION_SPACE) {
@@ -260,6 +261,38 @@ LibDHCP::commitRuntimeOptionDefs() {
     runtime_option_defs_.commit();
     runtime_option_defs_.commit();
 }
 }
 
 
+OptionDefinitionPtr
+LibDHCP::getLastResortOptionDef(const std::string& space, const uint16_t code) {
+    OptionDefContainerPtr container = getLastResortOptionDefs(space);
+    const OptionDefContainerTypeIndex& index = container->get<1>();
+    const OptionDefContainerTypeRange& range = index.equal_range(code);
+    if (range.first != range.second) {
+        return (*range.first);
+    }
+
+    return (OptionDefinitionPtr());
+}
+
+OptionDefinitionPtr
+LibDHCP::getLastResortOptionDef(const std::string& space, const std::string& name) {
+    OptionDefContainerPtr container = getLastResortOptionDefs(space);
+    const OptionDefContainerNameIndex& index = container->get<2>();
+    const OptionDefContainerNameRange& range = index.equal_range(name);
+    if (range.first != range.second) {
+        return (*range.first);
+    }
+
+    return (OptionDefinitionPtr());
+}
+
+OptionDefContainerPtr
+LibDHCP::getLastResortOptionDefs(const std::string& space) {
+    if (space == DHCP4_OPTION_SPACE) {
+        return (lastresort_defs_);
+    }
+    return (null_option_def_container_);
+}
+
 bool
 bool
 LibDHCP::deferOption(const std::string& space, const uint16_t code) {
 LibDHCP::deferOption(const std::string& space, const uint16_t code) {
     return ((space == DHCP4_OPTION_SPACE) &&
     return ((space == DHCP4_OPTION_SPACE) &&
@@ -831,11 +864,6 @@ void
 LibDHCP::initStdOptionDefs4() {
 LibDHCP::initStdOptionDefs4() {
     initOptionSpace(v4option_defs_, STANDARD_V4_OPTION_DEFINITIONS,
     initOptionSpace(v4option_defs_, STANDARD_V4_OPTION_DEFINITIONS,
                     STANDARD_V4_OPTION_DEFINITIONS_SIZE);
                     STANDARD_V4_OPTION_DEFINITIONS_SIZE);
-    last_resort_option43_def.reset(new OptionDefinition(
-        LAST_RESORT_OPTION43_DEFINITION.name,
-        LAST_RESORT_OPTION43_DEFINITION.code,
-        LAST_RESORT_OPTION43_DEFINITION.type,
-        LAST_RESORT_OPTION43_DEFINITION.array));
 }
 }
 
 
 void
 void
@@ -855,6 +883,12 @@ LibDHCP::initStdOptionDefs6() {
 }
 }
 
 
 void
 void
+LibDHCP::initLastResortOptionDefs() {
+    initOptionSpace(lastresort_defs_, LAST_RESORT_V4_OPTION_DEFINITIONS,
+                    LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE);
+}
+
+void
 LibDHCP::initVendorOptsDocsis4() {
 LibDHCP::initVendorOptsDocsis4() {
     initOptionSpace(vendor4_defs_[VENDOR_ID_CABLE_LABS], DOCSIS3_V4_DEFS,
     initOptionSpace(vendor4_defs_[VENDOR_ID_CABLE_LABS], DOCSIS3_V4_DEFS,
                     DOCSIS3_V4_DEFS_SIZE);
                     DOCSIS3_V4_DEFS_SIZE);

+ 32 - 3
src/lib/dhcp/libdhcp++.h

@@ -113,6 +113,33 @@ public:
     static OptionDefContainerPtr
     static OptionDefContainerPtr
     getRuntimeOptionDefs(const std::string& space);
     getRuntimeOptionDefs(const std::string& space);
 
 
+    /// @brief Returns last resort option definition by space and option code.
+    ///
+    /// @param space Option space name.
+    /// @param code Option code.
+    ///
+    /// @return Pointer to option definition or NULL if it doesn't exist.
+    static OptionDefinitionPtr getLastResortOptionDef(const std::string& space,
+                                                      const uint16_t code);
+
+    /// @brief Returns last resort option definition by space and option name.
+    ///
+    /// @param space Option space name.
+    /// @param name Option name.
+    ///
+    /// @return Pointer to option definition or NULL if it doesn't exist.
+    static OptionDefinitionPtr getLastResortOptionDef(const std::string& space,
+                                                      const std::string& name);
+
+    /// @brief Returns last resort option definitions for specified option
+    /// space name.
+    ///
+    /// @param space Option space name.
+    ///
+    /// @return Pointer to the container holding option definitions or NULL.
+    static OptionDefContainerPtr
+    getLastResortOptionDefs(const std::string& space);
+
     /// @brief Checks if an option unpacking has to be deferred.
     /// @brief Checks if an option unpacking has to be deferred.
     ///
     ///
     /// DHCPv4 option 43 and 224-254 unpacking is done after classification.
     /// DHCPv4 option 43 and 224-254 unpacking is done after classification.
@@ -123,9 +150,6 @@ public:
     /// @return True if option processing should be deferred.
     /// @return True if option processing should be deferred.
     static bool deferOption(const std::string& space, const uint16_t code);
     static bool deferOption(const std::string& space, const uint16_t code);
 
 
-    /// @brief Last resort definition for DHCPv4 option 43
-    static OptionDefinitionPtr last_resort_option43_def;
-
     /// @brief Factory function to create instance of option.
     /// @brief Factory function to create instance of option.
     ///
     ///
     /// Factory method creates instance of specified option. The option
     /// Factory method creates instance of specified option. The option
@@ -357,6 +381,8 @@ private:
     /// is incorrect. This is a programming error.
     /// is incorrect. This is a programming error.
     static void initStdOptionDefs6();
     static void initStdOptionDefs6();
 
 
+    static void initLastResortOptionDefs();
+
     static void initVendorOptsDocsis4();
     static void initVendorOptsDocsis4();
 
 
     static void initVendorOptsDocsis6();
     static void initVendorOptsDocsis6();
@@ -385,6 +411,9 @@ private:
     /// Container for v6 vendor option definitions
     /// Container for v6 vendor option definitions
     static VendorOptionDefContainers vendor6_defs_;
     static VendorOptionDefContainers vendor6_defs_;
 
 
+    /// Container with DHCPv4 last resort option definitions.
+    static OptionDefContainerPtr lastresort_defs_;
+
     /// Container for additional option definitions created in runtime.
     /// Container for additional option definitions created in runtime.
     static util::StagedValue<OptionDefSpaceContainer> runtime_option_defs_;
     static util::StagedValue<OptionDefSpaceContainer> runtime_option_defs_;
 };
 };

+ 6 - 4
src/lib/dhcp/std_option_defs.h

@@ -216,12 +216,14 @@ const OptionDefParams STANDARD_V4_OPTION_DEFINITIONS[] = {
 const int STANDARD_V4_OPTION_DEFINITIONS_SIZE =
 const int STANDARD_V4_OPTION_DEFINITIONS_SIZE =
     sizeof(STANDARD_V4_OPTION_DEFINITIONS) / sizeof(STANDARD_V4_OPTION_DEFINITIONS[0]);
     sizeof(STANDARD_V4_OPTION_DEFINITIONS) / sizeof(STANDARD_V4_OPTION_DEFINITIONS[0]);
 
 
-/// Last resort definition for option 43
-const OptionDefParams LAST_RESORT_OPTION43_DEFINITION = {
-    "vendor-encapsulated-options", DHO_VENDOR_ENCAPSULATED_OPTIONS,
-    OPT_EMPTY_TYPE, false, NO_RECORD_DEF, "vendor-encapsulated-options-space"
+/// Last resort definitions (only option 43 for now).
+const OptionDefParams LAST_RESORT_V4_OPTION_DEFINITIONS[] = {
+    { "vendor-encapsulated-options", DHO_VENDOR_ENCAPSULATED_OPTIONS,
+      OPT_EMPTY_TYPE, false, NO_RECORD_DEF, "vendor-encapsulated-options-space" }
 };
 };
 
 
+const int LAST_RESORT_V4_OPTION_DEFINITIONS_SIZE = 1;
+
 /// Start Definition of DHCPv6 options
 /// Start Definition of DHCPv6 options
 
 
 // client-fqdn
 // client-fqdn

+ 3 - 0
src/lib/dhcpsrv/cfg_option.cc

@@ -211,6 +211,9 @@ CfgOption::toElement() const {
             if (!def) {
             if (!def) {
                 def = LibDHCP::getRuntimeOptionDef(*name, code);
                 def = LibDHCP::getRuntimeOptionDef(*name, code);
             }
             }
+            if (!def) {
+                def = LibDHCP::getLastResortOptionDef(*name, code);
+            }
             if (def) {
             if (def) {
                 map->set("name", Element::create(def->getName()));
                 map->set("name", Element::create(def->getName()));
             }
             }

+ 5 - 0
src/lib/dhcpsrv/parsers/option_data_parser.cc

@@ -215,6 +215,11 @@ OptionDataParser::findOptionDefinition(const std::string& option_space,
         def = LibDHCP::getRuntimeOptionDef(option_space, search_key);
         def = LibDHCP::getRuntimeOptionDef(option_space, search_key);
     }
     }
 
 
+    if (!def) {
+        // Finish by last resort definitions.
+        def = LibDHCP::getLastResortOptionDef(option_space, search_key);
+    }
+
     return (def);
     return (def);
 }
 }
 
 

+ 4 - 0
src/lib/eval/eval_context.cc

@@ -90,6 +90,10 @@ EvalContext::convertOptionName(const std::string& option_name,
     }
     }
 
 
     if (!option_def) {
     if (!option_def) {
+        option_def = LibDHCP::getLastResortOptionDef(global_space, option_name);
+    }
+
+    if (!option_def) {
         error(loc, "option '" + option_name + "' is not defined");
         error(loc, "option '" + option_name + "' is not defined");
     }
     }