string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
" \"option-data\": [ {"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"10.254.226.0/25\" } ],"
" \"subnet\": \"10.254.226.0/24\", "
- " \"rebind-timer\": 2000, "
- " \"renew-timer\": 1000, "
- " \"valid-lifetime\": 4000,"
" \"interface\": \"eth0\" "
" } ],"
"\"valid-lifetime\": 4000 }";
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
" \"option-data\": [ {"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
" \"subnet\": \"192.0.2.0/24\", "
- " \"rebind-timer\": 2000, "
- " \"renew-timer\": 1000, "
- " \"valid-lifetime\": 4000,"
" \"interface\": \"eth0\" "
- " } ],"
- "\"valid-lifetime\": 4000 }";
+ " } ]"
+ "}";
ConstElementPtr json;
ASSERT_NO_THROW(json = parseDHCP4(config));
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
" \"option-data\": [ {"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"192.0.2.0/25\" } ],"
" \"subnet\": \"192.0.2.0/24\", "
- " \"rebind-timer\": 2000, "
- " \"renew-timer\": 1000, "
- " \"valid-lifetime\": 4000,"
" \"interface\": \"eth0\" "
- " } ],"
- "\"valid-lifetime\": 4000 }";
+ " } ]"
+ "}";
ConstElementPtr json;
ASSERT_NO_THROW(json = parseDHCP4(config));
string config_prefix = "{ \"interfaces-config\": {"
" \"interfaces\": [ ]"
"},"
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
" \"option-data\": [ {"
" \"name\": \"tftp-servers\","
" \"space\": \"vendor-4491\","
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.50\" } ],"
" \"subnet\": \"192.0.2.0/24\", "
- " \"renew-timer\": 1000, "
- " \"rebind-timer\": 1000, "
- " \"valid-lifetime\": 4000,"
" \"interface\": \"\""
- " } ],"
- "\"valid-lifetime\": 4000 }";
+ " } ]"
+ "}";
// There is docsis3 (vendor-id=4491) vendor option 2, which is a
// tftp-server. Its format is list of IPv4 addresses.
// so should be backward compatible.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
" \"subnet\": \"192.0.2.0/24\" } ],"
// an exception.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
" \"subnet\": \"192.0.2.0/24\" } ],"
// raises an exception.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
" \"subnet\": \"192.0.2.0/24\" } ],"
// in a global definition.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
" \"subnet\": \"192.0.2.0/24\" } ],"
// in a class definition.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ], "
" \"subnet\": \"192.0.2.0/24\" } ],"
// and data for it and its sub-option.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"option-def\": [ "
"{ \"code\": 1, "
" \"name\": \"foo\", "
// option-data in the client-class.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"option-def\": [ "
"{ \"code\": 1, "
" \"name\": \"foo\", "
// (from a set?) applies.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"option-def\": [ "
"{ \"code\": 1, "
" \"name\": \"foo\", "
// raises an exception.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
" \"subnet\": \"10.0.0.0/24\" } ],"
// in a global definition.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
" \"subnet\": \"10.0.0.0/24\" } ],"
// in a class definition.
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ] }, "
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
- "\"valid-lifetime\": 4000, "
"\"subnet4\": [ "
"{ \"pools\": [ { \"pool\": \"10.0.0.10 - 10.0.0.100\" } ], "
" \"subnet\": \"10.0.0.0/24\" } ],"
string config = "{ \"interfaces-config\": {"
" \"interfaces\": [ \"*\" ]"
"},"
- "\"rebind-timer\": 2000, "
- "\"renew-timer\": 1000, "
"\"subnet4\": [ { "
" \"pools\": [ { \"pool\": \"10.206.80.0/25\" } ],"
" \"subnet\": \"10.206.80.0/24\", "
" \"renew-timer\": 1000, "
" \"valid-lifetime\": 4000,"
" \"interface\": \"eth0\" "
- " } ],"
- "\"valid-lifetime\": 4000 }";
+ " } ]"
+ "}";
ConstElementPtr json;
ASSERT_NO_THROW(json = parseDHCP4(config));