From: Francis Dupont Date: Mon, 9 Sep 2019 14:13:20 +0000 (+0200) Subject: [897-add-infinite-valid-lifetime] Finished syntax part X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75d7af1a4bb0fc28f062c7cc21edd3ab54fe3d07;p=thirdparty%2Fkea.git [897-add-infinite-valid-lifetime] Finished syntax part --- diff --git a/doc/examples/kea4/all-keys.json b/doc/examples/kea4/all-keys.json index a009adb493..7a355c76ca 100644 --- a/doc/examples/kea4/all-keys.json +++ b/doc/examples/kea4/all-keys.json @@ -737,18 +737,24 @@ "min-valid-lifetime": 4000, // Subnet level max valid lifetime. - "max-valid-lifetime": 8000 + "max-valid-lifetime": 8000, + + // Subnet level allow static leases. + "allow-static-leases": false } ], // Shared network level (default) valid lifetime. "valid-lifetime": 6001, - // Subnet level min valid lifetime. + // Shared network level min valid lifetime. "min-valid-lifetime": 4001, - // Subnet level max valid lifetime. - "max-valid-lifetime": 8001 + // Shared network level max valid lifetime. + "max-valid-lifetime": 8001, + + // Shared network level allow static leases. + "allow-static-leases": false } ], @@ -767,6 +773,9 @@ // Global max valid lifetime value. "max-valid-lifetime": 8000, + // Global allow static leases. + "allow-static-leases": false, + // Reservations (examples are in other files). "reservations": [], diff --git a/doc/examples/kea6/all-keys.json b/doc/examples/kea6/all-keys.json index f677018dd7..3edcdfb953 100644 --- a/doc/examples/kea6/all-keys.json +++ b/doc/examples/kea6/all-keys.json @@ -731,7 +731,10 @@ "min-valid-lifetime": 4000, // Subnet level max valid lifetime. - "max-valid-lifetime": 8000 + "max-valid-lifetime": 8000, + + // Subnet level allow static leases. + "allow-static-leases": false } ], @@ -742,7 +745,10 @@ "min-valid-lifetime": 4001, // Shared network level max valid lifetime. - "max-valid-lifetime": 8001 + "max-valid-lifetime": 8001, + + // Shared network level allow static leases. + "allow-static-leases": false } ], @@ -758,6 +764,10 @@ // Global max valid lifetime value. "max-valid-lifetime": 8000, + // Global allow static leases, i.e. valid lifetime and associated + // timers can get the infinity 0xffffffff value. + "allow-static-leases": false, + // Reservations (examples are in other files). "reservations": [], diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 6bfa9325fd..98bb466b91 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -197,7 +197,9 @@ client will begin the renewal and rebind procedures. .. note:: Beginning with Kea 1.7.0 configured timers are silently limited to one - year (365 days or 31536000 seconds). + year (365 days or 31536000 seconds). To accept infinity (0xffffffff) + valid lifetime and associated timers set the ``allow-static-leases`` + boolean flag to true (default is false). .. note:: diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 79f26c904b..c94c0404bd 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -2123,7 +2123,9 @@ round down) bounds. .. note:: Beginning with Kea 1.7.0 configured timers are silently limited to one - year (365 days or 31536000 seconds). + year (365 days or 31536000 seconds). To accept infinity (0xffffffff) + valid lifetime and associated timers set the ``allow-static-leases`` + boolean flag to true (default is false). To send specific, fixed values use the following two parameters: diff --git a/src/bin/dhcp4/json_config_parser.cc b/src/bin/dhcp4/json_config_parser.cc index f340442895..82b285c7a4 100644 --- a/src/bin/dhcp4/json_config_parser.cc +++ b/src/bin/dhcp4/json_config_parser.cc @@ -563,7 +563,8 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set, (config_pair.first == "t2-percent") || (config_pair.first == "loggers") || (config_pair.first == "hostname-char-set") || - (config_pair.first == "hostname-char-replacement")) { + (config_pair.first == "hostname-char-replacement") || + (config_pair.first == "allow-static-leases")) { CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first, config_pair.second); diff --git a/src/bin/dhcp4/tests/get_config_unittest.cc b/src/bin/dhcp4/tests/get_config_unittest.cc index 6c3ea5109e..fe0078ad7f 100644 --- a/src/bin/dhcp4/tests/get_config_unittest.cc +++ b/src/bin/dhcp4/tests/get_config_unittest.cc @@ -2139,6 +2139,7 @@ const char* EXTRACTED_CONFIGS[] = { const char* UNPARSED_CONFIGS[] = { // CONFIGURATION 0 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2202,6 +2203,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 1 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2292,6 +2294,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 2 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2382,6 +2385,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 3 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2478,6 +2482,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 4 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2654,6 +2659,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 5 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -2830,6 +2836,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 6 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"bar\",\n" " \"calculate-tee-times\": false,\n" @@ -2924,6 +2931,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 7 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3018,6 +3026,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 8 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"nofile\",\n" " \"calculate-tee-times\": false,\n" @@ -3112,6 +3121,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 9 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3204,6 +3214,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 10 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3296,6 +3307,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 11 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3416,6 +3428,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 12 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3536,6 +3549,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 13 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3656,6 +3670,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 14 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": true,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3776,6 +3791,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 15 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -3872,6 +3888,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 16 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4000,6 +4017,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 17 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4092,6 +4110,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 18 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4163,6 +4182,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 19 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4234,6 +4254,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 20 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4314,6 +4335,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 21 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4385,6 +4407,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 22 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4456,6 +4479,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 23 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4527,6 +4551,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 24 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4598,6 +4623,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 25 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4707,6 +4733,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 26 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4816,6 +4843,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 27 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -4935,6 +4963,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 28 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5034,6 +5063,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 29 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5179,6 +5209,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 30 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5297,6 +5328,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 31 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5435,6 +5467,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 32 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5544,6 +5577,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 33 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5658,6 +5692,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 34 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5767,6 +5802,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 35 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -5866,6 +5902,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 36 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6002,6 +6039,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 37 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6109,6 +6147,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 38 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6220,6 +6259,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 39 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6283,6 +6323,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 40 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6346,6 +6387,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 41 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6440,6 +6482,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 42 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6534,6 +6577,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 43 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6630,6 +6674,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 44 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6722,6 +6767,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 45 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6814,6 +6860,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 46 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -6993,6 +7040,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 47 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7100,6 +7148,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 48 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7351,6 +7400,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 49 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7473,6 +7523,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 50 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7649,6 +7700,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 51 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7769,6 +7821,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 52 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7830,6 +7883,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 53 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7891,6 +7945,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 54 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -7952,6 +8007,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 55 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8013,6 +8069,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 56 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8105,6 +8162,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 57 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8197,6 +8255,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 58 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8289,6 +8348,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 59 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8381,6 +8441,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 60 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8473,6 +8534,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 61 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8591,6 +8653,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 62 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8683,6 +8746,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 63 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8776,6 +8840,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 64 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8873,6 +8938,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 65 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -8970,6 +9036,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 66 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -9048,6 +9115,7 @@ const char* UNPARSED_CONFIGS[] = { // CONFIGURATION 67 "{\n" " \"comment\": \"A DHCPv4 server\",\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -9238,6 +9306,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 68 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" @@ -9413,6 +9482,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 69 "{\n" +" \"allow-static-leases\": false,\n" " \"authoritative\": false,\n" " \"boot-file-name\": \"\",\n" " \"calculate-tee-times\": false,\n" diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc index 93659a2861..0cfa1e4c2c 100644 --- a/src/bin/dhcp6/json_config_parser.cc +++ b/src/bin/dhcp6/json_config_parser.cc @@ -682,7 +682,8 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set, (config_pair.first == "t2-percent") || (config_pair.first == "loggers") || (config_pair.first == "hostname-char-set") || - (config_pair.first == "hostname-char-replacement")) { + (config_pair.first == "hostname-char-replacement") || + (config_pair.first == "allow-static-leases")) { CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first, config_pair.second); diff --git a/src/bin/dhcp6/tests/get_config_unittest.cc b/src/bin/dhcp6/tests/get_config_unittest.cc index ee99fc44a9..fbd3cba899 100644 --- a/src/bin/dhcp6/tests/get_config_unittest.cc +++ b/src/bin/dhcp6/tests/get_config_unittest.cc @@ -1926,6 +1926,7 @@ const char* EXTRACTED_CONFIGS[] = { const char* UNPARSED_CONFIGS[] = { // CONFIGURATION 0 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -1994,6 +1995,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 1 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2096,6 +2098,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 2 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2265,6 +2268,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 3 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2434,6 +2438,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 4 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2603,6 +2608,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 5 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2705,6 +2711,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 6 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2800,6 +2807,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 7 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -2895,6 +2903,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 8 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3022,6 +3031,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 9 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3116,6 +3126,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 10 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3212,6 +3223,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 11 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3310,6 +3322,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 12 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3423,6 +3436,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 13 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3519,6 +3533,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 14 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3595,6 +3610,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 15 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3671,6 +3687,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 16 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3756,6 +3773,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 17 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3832,6 +3850,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 18 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -3908,6 +3927,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 19 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4019,6 +4039,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 20 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4130,6 +4151,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 21 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4251,6 +4273,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 22 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4355,6 +4378,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 23 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4502,6 +4526,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 24 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4639,6 +4664,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 25 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4786,6 +4812,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 26 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -4895,6 +4922,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 27 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5008,6 +5036,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 28 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5076,6 +5105,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 29 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5144,6 +5174,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 30 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5238,6 +5269,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 31 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5332,6 +5364,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 32 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5504,6 +5537,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 33 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5613,6 +5647,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 34 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5730,6 +5765,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 35 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5826,6 +5862,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 36 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -5922,6 +5959,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 37 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6020,6 +6058,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 38 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6239,6 +6278,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 39 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6356,6 +6396,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 40 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6424,6 +6465,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 41 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6492,6 +6534,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 42 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6686,6 +6729,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 43 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6805,6 +6849,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 44 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6873,6 +6918,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 45 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -6939,6 +6985,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 46 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7005,6 +7052,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 47 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 12345,\n" " \"dhcp-ddns\": {\n" @@ -7071,6 +7119,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 48 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7137,6 +7186,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 49 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"client-classes\": [\n" " {\n" @@ -7245,6 +7295,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 50 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7339,6 +7390,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 51 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7434,6 +7486,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 52 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7534,6 +7587,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 53 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7634,6 +7688,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 54 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7730,6 +7785,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 55 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7827,6 +7883,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 56 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -7929,6 +7986,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 57 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" @@ -8012,6 +8070,7 @@ const char* UNPARSED_CONFIGS[] = { // CONFIGURATION 58 "{\n" " \"comment\": \"A DHCPv6 server\",\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"client-classes\": [\n" " {\n" @@ -8199,6 +8258,7 @@ const char* UNPARSED_CONFIGS[] = { " }\n", // CONFIGURATION 59 "{\n" +" \"allow-static-leases\": false,\n" " \"calculate-tee-times\": true,\n" " \"decline-probation-period\": 86400,\n" " \"dhcp-ddns\": {\n" diff --git a/src/lib/dhcpsrv/parsers/simple_parser4.cc b/src/lib/dhcpsrv/parsers/simple_parser4.cc index 484c63c813..e121095e52 100644 --- a/src/lib/dhcpsrv/parsers/simple_parser4.cc +++ b/src/lib/dhcpsrv/parsers/simple_parser4.cc @@ -76,7 +76,8 @@ const SimpleKeywords SimpleParser4::GLOBAL4_PARAMETERS = { { "t2-percent", Element::real }, { "loggers", Element::list }, { "hostname-char-set", Element::string }, - { "hostname-char-replacement", Element::string } + { "hostname-char-replacement", Element::string }, + { "allow-static-leases", Element::boolean } }; /// @brief This table defines default global values for DHCPv4 @@ -98,7 +99,8 @@ const SimpleDefaults SimpleParser4::GLOBAL4_DEFAULTS = { { "reservation-mode", Element::string, "all" }, { "calculate-tee-times", Element::boolean, "false" }, { "t1-percent", Element::real, ".50" }, - { "t2-percent", Element::real, ".875" } + { "t2-percent", Element::real, ".875" }, + { "allow-static-leases", Element::boolean, "false" } }; /// @brief This table defines all option definition parameters. @@ -192,6 +194,7 @@ const SimpleKeywords SimpleParser4::SUBNET4_PARAMETERS = { { "calculate-tee-times", Element::boolean }, { "t1-percent", Element::real }, { "t2-percent", Element::real }, + { "allow-static-leases", Element::boolean }, { "metadata", Element::map } }; @@ -250,7 +253,8 @@ const ParamsList SimpleParser4::INHERIT_TO_SUBNET4 = { "max-valid-lifetime", "calculate-tee-times", "t1-percent", - "t2-percent" + "t2-percent", + "allow-static-leases" }; /// @brief This table defines all pool parameters. @@ -297,6 +301,7 @@ const SimpleKeywords SimpleParser4::SHARED_NETWORK4_PARAMETERS = { { "calculate-tee-times", Element::boolean }, { "t1-percent", Element::real }, { "t2-percent", Element::real }, + { "allow-static-leases", Element::boolean }, { "metadata", Element::map } }; diff --git a/src/lib/dhcpsrv/parsers/simple_parser6.cc b/src/lib/dhcpsrv/parsers/simple_parser6.cc index d2c5d8b69c..1bf15d2e99 100644 --- a/src/lib/dhcpsrv/parsers/simple_parser6.cc +++ b/src/lib/dhcpsrv/parsers/simple_parser6.cc @@ -76,7 +76,8 @@ const SimpleKeywords SimpleParser6::GLOBAL6_PARAMETERS = { { "t2-percent", Element::real }, { "loggers", Element::list }, { "hostname-char-set", Element::string }, - { "hostname-char-replacement", Element::string } + { "hostname-char-replacement", Element::string }, + { "allow-static-leases", Element::boolean } }; /// @brief This table defines default global values for DHCPv6 @@ -93,7 +94,8 @@ const SimpleDefaults SimpleParser6::GLOBAL6_DEFAULTS = { { "reservation-mode", Element::string, "all" }, { "calculate-tee-times", Element::boolean, "true" }, { "t1-percent", Element::real, ".50" }, - { "t2-percent", Element::real, ".80" } + { "t2-percent", Element::real, ".80" }, + { "allow-static-leases", Element::boolean, "false" } }; /// @brief This table defines all option definition parameters. @@ -185,6 +187,7 @@ const SimpleKeywords SimpleParser6::SUBNET6_PARAMETERS = { { "calculate-tee-times", Element::boolean }, { "t1-percent", Element::real }, { "t2-percent", Element::real }, + { "allow-static-leases", Element::boolean }, { "metadata", Element::map } }; @@ -231,7 +234,8 @@ const ParamsList SimpleParser6::INHERIT_TO_SUBNET6 = { "max-valid-lifetime", "calculate-tee-times", "t1-percent", - "t2-percent" + "t2-percent", + "allow-static-leases" }; /// @brief This table defines all pool parameters. @@ -297,6 +301,7 @@ const SimpleKeywords SimpleParser6::SHARED_NETWORK6_PARAMETERS = { { "calculate-tee-times", Element::boolean }, { "t1-percent", Element::real }, { "t2-percent", Element::real }, + { "allow-static-leases", Element::boolean }, { "metadata", Element::map } };