Commit 87ba16e0 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[1555] Use asterisk as wildcard for all interfaces that server listens on.

parent 2221a1de
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
// //
// Permission to use, copy, modify, and/or distribute this software for any // Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above // purpose with or without fee is hereby granted, provided that the above
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
{ "item_name": "interfaces", { "item_name": "interfaces",
"item_type": "list", "item_type": "list",
"item_optional": false, "item_optional": false,
"item_default": [ "all" ], "item_default": [ "*" ],
"list_item_spec": "list_item_spec":
{ {
"item_name": "interface_name", "item_name": "interface_name",
"item_type": "string", "item_type": "string",
"item_optional": false, "item_optional": false,
"item_default": "all" "item_default": "*"
} }
} , } ,
......
...@@ -139,7 +139,7 @@ public: ...@@ -139,7 +139,7 @@ public:
/// describing an option. /// describing an option.
std::string createConfigWithOption(const std::map<std::string, std::string>& params) { std::string createConfigWithOption(const std::map<std::string, std::string>& params) {
std::ostringstream stream; std::ostringstream stream;
stream << "{ \"interfaces\": [ \"all\" ]," stream << "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -246,7 +246,7 @@ public: ...@@ -246,7 +246,7 @@ public:
void resetConfiguration() { void resetConfiguration() {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"valid-lifetime\": 4000, " "\"valid-lifetime\": 4000, "
...@@ -323,7 +323,7 @@ TEST_F(Dhcp4ParserTest, emptySubnet) { ...@@ -323,7 +323,7 @@ TEST_F(Dhcp4ParserTest, emptySubnet) {
ConstElementPtr status; ConstElementPtr status;
EXPECT_NO_THROW(status = configureDhcp4Server(*srv_, EXPECT_NO_THROW(status = configureDhcp4Server(*srv_,
Element::fromJSON("{ \"interfaces\": [ \"all\" ]," Element::fromJSON("{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ ], " "\"subnet4\": [ ], "
...@@ -343,7 +343,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) { ...@@ -343,7 +343,7 @@ TEST_F(Dhcp4ParserTest, subnetGlobalDefaults) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -373,7 +373,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) { ...@@ -373,7 +373,7 @@ TEST_F(Dhcp4ParserTest, subnetLocal) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -404,7 +404,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) { ...@@ -404,7 +404,7 @@ TEST_F(Dhcp4ParserTest, poolOutOfSubnet) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -428,7 +428,7 @@ TEST_F(Dhcp4ParserTest, poolPrefixLen) { ...@@ -428,7 +428,7 @@ TEST_F(Dhcp4ParserTest, poolPrefixLen) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -950,7 +950,7 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) { ...@@ -950,7 +950,7 @@ TEST_F(Dhcp4ParserTest, optionStandardDefOverride) {
// configuration does not include options configuration. // configuration does not include options configuration.
TEST_F(Dhcp4ParserTest, optionDataDefaults) { TEST_F(Dhcp4ParserTest, optionDataDefaults) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1023,7 +1023,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) { ...@@ -1023,7 +1023,7 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) {
// The definition is not required for the option that // The definition is not required for the option that
// belongs to the 'dhcp4' option space as it is the // belongs to the 'dhcp4' option space as it is the
// standard option. // standard option.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1101,7 +1101,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) { ...@@ -1101,7 +1101,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
// at the very end (when all other parameters are configured). // at the very end (when all other parameters are configured).
// Starting stage 1. Configure sub-options and their definitions. // Starting stage 1. Configure sub-options and their definitions.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1150,7 +1150,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) { ...@@ -1150,7 +1150,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
// the configuration from the stage 2 is repeated because BIND // the configuration from the stage 2 is repeated because BIND
// configuration manager sends whole configuration for the lists // configuration manager sends whole configuration for the lists
// where at least one element is being modified or added. // where at least one element is being modified or added.
config = "{ \"interfaces\": [ \"all\" ]," config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1246,7 +1246,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) { ...@@ -1246,7 +1246,7 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
// option setting. // option setting.
TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) { TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1318,7 +1318,7 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) { ...@@ -1318,7 +1318,7 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
// for multiple subnets. // for multiple subnets.
TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) { TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"subnet4\": [ { " "\"subnet4\": [ { "
...@@ -1598,7 +1598,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) { ...@@ -1598,7 +1598,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
// In the first stahe we create definitions of suboptions // In the first stahe we create definitions of suboptions
// that we will add to the base option. // that we will add to the base option.
// Let's create some dummy options: foo and foo2. // Let's create some dummy options: foo and foo2.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1651,7 +1651,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) { ...@@ -1651,7 +1651,7 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
// We add our dummy options to this option space and thus // We add our dummy options to this option space and thus
// they should be included as sub-options in the 'vendor-opts' // they should be included as sub-options in the 'vendor-opts'
// option. // option.
config = "{ \"interfaces\": [ \"all\" ]," config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1788,7 +1788,7 @@ TEST_F(Dhcp4ParserTest, allInterfaces) { ...@@ -1788,7 +1788,7 @@ TEST_F(Dhcp4ParserTest, allInterfaces) {
// but it also includes keyword 'all'. This keyword switches server into the // but it also includes keyword 'all'. This keyword switches server into the
// mode when it listens on all interfaces regardless of what interface names // mode when it listens on all interfaces regardless of what interface names
// were specified in the "interfaces" parameter. // were specified in the "interfaces" parameter.
string config = "{ \"interfaces\": [ \"eth0\",\"all\",\"eth1\" ]," string config = "{ \"interfaces\": [ \"eth0\",\"*\",\"eth1\" ],"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
"\"valid-lifetime\": 4000 }"; "\"valid-lifetime\": 4000 }";
......
// Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC") // Copyright (C) 2012-2013 Internet Systems Consortium, Inc. ("ISC")
// //
// Permission to use, copy, modify, and/or distribute this software for any // Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above // purpose with or without fee is hereby granted, provided that the above
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
{ "item_name": "interfaces", { "item_name": "interfaces",
"item_type": "list", "item_type": "list",
"item_optional": false, "item_optional": false,
"item_default": [ "all" ], "item_default": [ "*" ],
"list_item_spec": "list_item_spec":
{ {
"item_name": "interface_name", "item_name": "interface_name",
"item_type": "string", "item_type": "string",
"item_optional": false, "item_optional": false,
"item_default": "all" "item_default": "*"
} }
} , } ,
......
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
std::string>& params) std::string>& params)
{ {
std::ostringstream stream; std::ostringstream stream;
stream << "{ \"interfaces\": [ \"all\" ]," stream << "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -180,7 +180,7 @@ public: ...@@ -180,7 +180,7 @@ public:
void resetConfiguration() { void resetConfiguration() {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -331,7 +331,7 @@ TEST_F(Dhcp6ParserTest, emptySubnet) { ...@@ -331,7 +331,7 @@ TEST_F(Dhcp6ParserTest, emptySubnet) {
ConstElementPtr status; ConstElementPtr status;
EXPECT_NO_THROW(status = configureDhcp6Server(srv_, EXPECT_NO_THROW(status = configureDhcp6Server(srv_,
Element::fromJSON("{ \"interfaces\": [ \"all\" ]," Element::fromJSON("{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -350,7 +350,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) { ...@@ -350,7 +350,7 @@ TEST_F(Dhcp6ParserTest, subnetGlobalDefaults) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -384,7 +384,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) { ...@@ -384,7 +384,7 @@ TEST_F(Dhcp6ParserTest, subnetLocal) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -422,7 +422,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) { ...@@ -422,7 +422,7 @@ TEST_F(Dhcp6ParserTest, subnetInterface) {
// There should be at least one interface // There should be at least one interface
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -455,7 +455,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) { ...@@ -455,7 +455,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceBogus) {
// There should be at least one interface // There should be at least one interface
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -486,7 +486,7 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) { ...@@ -486,7 +486,7 @@ TEST_F(Dhcp6ParserTest, interfaceGlobal) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -556,7 +556,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) { ...@@ -556,7 +556,7 @@ TEST_F(Dhcp6ParserTest, subnetInterfaceId) {
// parameter. // parameter.
TEST_F(Dhcp6ParserTest, interfaceIdGlobal) { TEST_F(Dhcp6ParserTest, interfaceIdGlobal) {
const string config = "{ \"interfaces\": [ \"all\" ]," const string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -611,7 +611,7 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) { ...@@ -611,7 +611,7 @@ TEST_F(Dhcp6ParserTest, poolOutOfSubnet) {
ConstElementPtr status; ConstElementPtr status;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -639,7 +639,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) { ...@@ -639,7 +639,7 @@ TEST_F(Dhcp6ParserTest, poolPrefixLen) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -1159,7 +1159,7 @@ TEST_F(Dhcp6ParserTest, optionStandardDefOverride) { ...@@ -1159,7 +1159,7 @@ TEST_F(Dhcp6ParserTest, optionStandardDefOverride) {
// configuration does not include options configuration. // configuration does not include options configuration.
TEST_F(Dhcp6ParserTest, optionDataDefaults) { TEST_F(Dhcp6ParserTest, optionDataDefaults) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
...@@ -1241,7 +1241,7 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) { ...@@ -1241,7 +1241,7 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) {
// The definition is not required for the option that // The definition is not required for the option that
// belongs to the 'dhcp6' option space as it is the // belongs to the 'dhcp6' option space as it is the
// standard option. // standard option.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1319,7 +1319,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) { ...@@ -1319,7 +1319,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
// at the very end (when all other parameters are configured). // at the very end (when all other parameters are configured).
// Starting stage 1. Configure sub-options and their definitions. // Starting stage 1. Configure sub-options and their definitions.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1368,7 +1368,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) { ...@@ -1368,7 +1368,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
// the configuration from the stage 2 is repeated because BIND // the configuration from the stage 2 is repeated because BIND
// configuration manager sends whole configuration for the lists // configuration manager sends whole configuration for the lists
// where at least one element is being modified or added. // where at least one element is being modified or added.
config = "{ \"interfaces\": [ \"all\" ]," config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1462,7 +1462,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) { ...@@ -1462,7 +1462,7 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
// for multiple subnets. // for multiple subnets.
TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) { TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
ConstElementPtr x; ConstElementPtr x;
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
...@@ -1705,7 +1705,7 @@ TEST_F(Dhcp6ParserTest, stdOptionDataEncapsulate) { ...@@ -1705,7 +1705,7 @@ TEST_F(Dhcp6ParserTest, stdOptionDataEncapsulate) {
// In the first stahe we create definitions of suboptions // In the first stahe we create definitions of suboptions
// that we will add to the base option. // that we will add to the base option.
// Let's create some dummy options: foo and foo2. // Let's create some dummy options: foo and foo2.
string config = "{ \"interfaces\": [ \"all\" ]," string config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1758,7 +1758,7 @@ TEST_F(Dhcp6ParserTest, stdOptionDataEncapsulate) { ...@@ -1758,7 +1758,7 @@ TEST_F(Dhcp6ParserTest, stdOptionDataEncapsulate) {
// We add our dummy options to this option space and thus // We add our dummy options to this option space and thus
// they should be included as sub-options in the 'vendor-opts' // they should be included as sub-options in the 'vendor-opts'
// option. // option.
config = "{ \"interfaces\": [ \"all\" ]," config = "{ \"interfaces\": [ \"*\" ],"
"\"rebind-timer\": 2000," "\"rebind-timer\": 2000,"
"\"renew-timer\": 1000," "\"renew-timer\": 1000,"
"\"option-data\": [ {" "\"option-data\": [ {"
...@@ -1906,7 +1906,7 @@ TEST_F(Dhcp6ParserTest, allInterfaces) { ...@@ -1906,7 +1906,7 @@ TEST_F(Dhcp6ParserTest, allInterfaces) {
// bu also includes keyword 'all'. This keyword switches server into the // bu also includes keyword 'all'. This keyword switches server into the
// mode when it listens on all interfaces regardless of what interface names // mode when it listens on all interfaces regardless of what interface names
// were specified in the "interfaces" parameter. // were specified in the "interfaces" parameter.
string config = "{ \"interfaces\": [ \"eth0\", \"eth1\", \"all\" ]," string config = "{ \"interfaces\": [ \"eth0\", \"eth1\", \"*\" ],"
"\"preferred-lifetime\": 3000," "\"preferred-lifetime\": 3000,"
"\"rebind-timer\": 2000, " "\"rebind-timer\": 2000, "
"\"renew-timer\": 1000, " "\"renew-timer\": 1000, "
......
...@@ -34,7 +34,7 @@ namespace isc { ...@@ -34,7 +34,7 @@ namespace isc {
namespace dhcp { namespace dhcp {
namespace { namespace {
const char* ALL_IFACES_KEYWORD = "all"; const char* ALL_IFACES_KEYWORD = "*";
} }
// *********************** ParserContext ************************* // *********************** ParserContext *************************
......
...@@ -200,8 +200,8 @@ TEST_F(DhcpParserTest, uint32ParserTest) { ...@@ -200,8 +200,8 @@ TEST_F(DhcpParserTest, uint32ParserTest) {
/// 1. Does not allow empty for storage. /// 1. Does not allow empty for storage.
/// 2. Does not allow name other than "interfaces" /// 2. Does not allow name other than "interfaces"
/// 3. Parses list of interfaces and adds them to CfgMgr /// 3. Parses list of interfaces and adds them to CfgMgr
/// 4. Parses 'all' keyword and sets a CfgMgr flag which indicates that /// 4. Parses wildcard interface name and sets a CfgMgr flag which indicates
/// server will listen on all interfaces. /// that server will listen on all interfaces.
TEST_F(DhcpParserTest, interfaceListParserTest) { TEST_F(DhcpParserTest, interfaceListParserTest) {
const std::string name = "interfaces"; const std::string name = "interfaces";
...@@ -234,7 +234,7 @@ TEST_F(DhcpParserTest, interfaceListParserTest) { ...@@ -234,7 +234,7 @@ TEST_F(DhcpParserTest, interfaceListParserTest) {
// Add keyword all to the configuration. This should activate all // Add keyword all to the configuration. This should activate all
// interfaces, including eth2, even though it has not been explicitly // interfaces, including eth2, even though it has not been explicitly
// added. // added.
list_element->add(Element::create("all")); list_element->add(Element::create("*"));
// Reset parser's state. // Reset parser's state.
parser.reset(new InterfaceListConfigParser(name)); parser.reset(new InterfaceListConfigParser(name));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment