Commit 4d56eac7 authored by Marcin Siodelski's avatar Marcin Siodelski

[#93,!35] Addressed minor and refectoring issues.

parent 554f6127
...@@ -47,6 +47,7 @@ libdhcp_mysql_cb_la_LIBADD = libmysqlcb.la ...@@ -47,6 +47,7 @@ libdhcp_mysql_cb_la_LIBADD = libmysqlcb.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/eval/libkea-eval.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/process/libkea-process.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/stats/libkea-stats.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la libdhcp_mysql_cb_la_LIBADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
......
This diff is collapsed.
...@@ -29,265 +29,265 @@ public: ...@@ -29,265 +29,265 @@ public:
/// @brief Retrieves a single subnet by subnet_prefix. /// @brief Retrieves a single subnet by subnet_prefix.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_prefix Prefix of the subnet to be retrieved. /// @param subnet_prefix Prefix of the subnet to be retrieved.
/// @return Pointer to the retrieved subnet or NULL if not found. /// @return Pointer to the retrieved subnet or NULL if not found.
virtual Subnet4Ptr virtual Subnet4Ptr
getSubnet4(const db::ServerSelector& selector, getSubnet4(const db::ServerSelector& server_selector,
const std::string& subnet_prefix) const; const std::string& subnet_prefix) const;
/// @brief Retrieves a single subnet by subnet identifier. /// @brief Retrieves a single subnet by subnet identifier.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_id Identifier of a subnet to be retrieved. /// @param subnet_id Identifier of a subnet to be retrieved.
/// @return Pointer to the retrieved subnet or NULL if not found. /// @return Pointer to the retrieved subnet or NULL if not found.
virtual Subnet4Ptr virtual Subnet4Ptr
getSubnet4(const db::ServerSelector& selector, const SubnetID& subnet_id) const; getSubnet4(const db::ServerSelector& server_selector, const SubnetID& subnet_id) const;
/// @brief Retrieves all subnets. /// @brief Retrieves all subnets.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @return Collection of subnets or empty collection if no subnet found. /// @return Collection of subnets or empty collection if no subnet found.
virtual Subnet4Collection virtual Subnet4Collection
getAllSubnets4(const db::ServerSelector& selector) const; getAllSubnets4(const db::ServerSelector& server_selector) const;
/// @brief Retrieves subnets modified after specified time. /// @brief Retrieves subnets modified after specified time.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param modification_time Lower bound subnet modification time. /// @param modification_time Lower bound subnet modification time.
/// @return Collection of subnets or empty collection if no subnet found. /// @return Collection of subnets or empty collection if no subnet found.
virtual Subnet4Collection virtual Subnet4Collection
getModifiedSubnets4(const db::ServerSelector& selector, getModifiedSubnets4(const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const; const boost::posix_time::ptime& modification_time) const;
/// @brief Retrieves shared network by name. /// @brief Retrieves shared network by name.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the shared network to be retrieved. /// @param name Name of the shared network to be retrieved.
/// @return Pointer to the shared network or NULL if not found. /// @return Pointer to the shared network or NULL if not found.
virtual SharedNetwork4Ptr virtual SharedNetwork4Ptr
getSharedNetwork4(const db::ServerSelector& selector, getSharedNetwork4(const db::ServerSelector& server_selector,
const std::string& name) const; const std::string& name) const;
/// @brief Retrieves all shared networks. /// @brief Retrieves all shared networks.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @return Collection of shared network or empty collection if /// @return Collection of shared network or empty collection if
/// no shared network found. /// no shared network found.
virtual SharedNetwork4Collection virtual SharedNetwork4Collection
getAllSharedNetworks4(const db::ServerSelector& selector) const; getAllSharedNetworks4(const db::ServerSelector& server_selector) const;
/// @brief Retrieves shared networks modified after specified time. /// @brief Retrieves shared networks modified after specified time.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param modification_time Lower bound shared network modification time. /// @param modification_time Lower bound shared network modification time.
/// @return Collection of shared network or empty collection if /// @return Collection of shared network or empty collection if
/// no shared network found. /// no shared network found.
virtual SharedNetwork4Collection virtual SharedNetwork4Collection
getModifiedSharedNetworks4(const db::ServerSelector& selector, getModifiedSharedNetworks4(const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const; const boost::posix_time::ptime& modification_time) const;
/// @brief Retrieves single option definition by code and space. /// @brief Retrieves single option definition by code and space.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param code Code of the option to be retrieved. /// @param code Code of the option to be retrieved.
/// @param space Option space of the option to be retrieved. /// @param space Option space of the option to be retrieved.
/// @return Pointer to the option definition or NULL if not found. /// @return Pointer to the option definition or NULL if not found.
virtual OptionDefinitionPtr virtual OptionDefinitionPtr
getOptionDef4(const db::ServerSelector& selector, const uint16_t code, getOptionDef4(const db::ServerSelector& server_selector, const uint16_t code,
const std::string& space) const; const std::string& space) const;
/// @brief Retrieves all option definitions. /// @brief Retrieves all option definitions.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @return Collection of option definitions or empty collection if /// @return Collection of option definitions or empty collection if
/// no option definition found. /// no option definition found.
virtual OptionDefContainer virtual OptionDefContainer
getAllOptionDefs4(const db::ServerSelector& selector) const; getAllOptionDefs4(const db::ServerSelector& server_selector) const;
/// @brief Retrieves option definitions modified after specified time. /// @brief Retrieves option definitions modified after specified time.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param modification_time Lower bound option definition modification /// @param modification_time Lower bound option definition modification
/// time. /// time.
/// @return Collection of option definitions or empty collection if /// @return Collection of option definitions or empty collection if
/// no option definition found. /// no option definition found.
virtual OptionDefContainer virtual OptionDefContainer
getModifiedOptionDefs4(const db::ServerSelector& selector, getModifiedOptionDefs4(const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const; const boost::posix_time::ptime& modification_time) const;
/// @brief Retrieves global string parameter value. /// @brief Retrieves global string parameter value.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the global parameter to be retrieved. /// @param name Name of the global parameter to be retrieved.
/// @return Value of the global string parameter. /// @return Value of the global string parameter.
virtual util::OptionalValue<std::string> virtual util::OptionalValue<std::string>
getGlobalStringParameter4(const db::ServerSelector& selector, getGlobalStringParameter4(const db::ServerSelector& server_selector,
const std::string& name) const; const std::string& name) const;
/// @brief Retrieves global number parameter. /// @brief Retrieves global number parameter.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the parameter to be retrieved. /// @param name Name of the parameter to be retrieved.
virtual util::OptionalValue<int64_t> virtual util::OptionalValue<int64_t>
getGlobalNumberParameter4(const db::ServerSelector& selector, getGlobalNumberParameter4(const db::ServerSelector& server_selector,
const std::string& name) const; const std::string& name) const;
/// @brief Retrieves all global parameters as strings. /// @brief Retrieves all global parameters as strings.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
virtual std::map<std::string, std::string> virtual std::map<std::string, std::string>
getAllGlobalParameters4(const db::ServerSelector& selector) const; getAllGlobalParameters4(const db::ServerSelector& server_selector) const;
/// @brief Creates or updates a subnet. /// @brief Creates or updates a subnet.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet Subnet to be added or updated. /// @param subnet Subnet to be added or updated.
virtual void virtual void
createUpdateSubnet4(const db::ServerSelector& selector, createUpdateSubnet4(const db::ServerSelector& server_selector,
const Subnet4Ptr& subnet); const Subnet4Ptr& subnet);
/// @brief Creates or updates a shared network. /// @brief Creates or updates a shared network.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param shared_network Shared network to be added or updated. /// @param shared_network Shared network to be added or updated.
virtual void virtual void
createUpdateSharedNetwork4(const db::ServerSelector& selector, createUpdateSharedNetwork4(const db::ServerSelector& server_selector,
const SharedNetwork4Ptr& shared_network); const SharedNetwork4Ptr& shared_network);
/// @brief Creates or updates an option definition. /// @brief Creates or updates an option definition.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param option_def Option definition to be added or updated. /// @param option_def Option definition to be added or updated.
virtual void virtual void
createUpdateOptionDef4(const db::ServerSelector& selector, createUpdateOptionDef4(const db::ServerSelector& server_selector,
const OptionDefinitionPtr& option_def); const OptionDefinitionPtr& option_def);
/// @brief Creates or updates global option. /// @brief Creates or updates global option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param option Option to be added or updated. /// @param option Option to be added or updated.
virtual void virtual void
createUpdateOption4(const db::ServerSelector& selector, createUpdateOption4(const db::ServerSelector& server_selector,
const OptionPtr& option); const OptionPtr& option);
/// @brief Creates or updates subnet level option. /// @brief Creates or updates subnet level option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_id Identifier of a subnet to which option belongs. /// @param subnet_id Identifier of a subnet to which option belongs.
/// @param option Option to be added or updated. /// @param option Option to be added or updated.
virtual void virtual void
createUpdateOption4(const db::ServerSelector& selector, createUpdateOption4(const db::ServerSelector& server_selector,
const SubnetID& subnet_id, const SubnetID& subnet_id,
const OptionPtr& option); const OptionPtr& option);
/// @brief Creates or updates pool level option. /// @brief Creates or updates pool level option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param pool_start_address Lower bound address of the pool to which /// @param pool_start_address Lower bound address of the pool to which
/// the option belongs. /// the option belongs.
/// @param pool_end_address Upper bound address of the pool to which the /// @param pool_end_address Upper bound address of the pool to which the
/// option belongs. /// option belongs.
/// @param option Option to be added or updated. /// @param option Option to be added or updated.
virtual void virtual void
createUpdateOption4(const db::ServerSelector& selector, createUpdateOption4(const db::ServerSelector& server_selector,
const asiolink::IOAddress& pool_start_address, const asiolink::IOAddress& pool_start_address,
const asiolink::IOAddress& pool_end_address, const asiolink::IOAddress& pool_end_address,
const OptionPtr& option); const OptionPtr& option);
/// @brief Creates or updates global string parameter. /// @brief Creates or updates global string parameter.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the global parameter. /// @param name Name of the global parameter.
/// @param value Value of the global parameter. /// @param value Value of the global parameter.
virtual void virtual void
createUpdateGlobalParameter4(const db::ServerSelector& selector, createUpdateGlobalParameter4(const db::ServerSelector& server_selector,
const std::string& name, const std::string& name,
const std::string& value); const std::string& value);
/// @brief Creates or updates global number parameter. /// @brief Creates or updates global number parameter.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the global parameter. /// @param name Name of the global parameter.
/// @param value Value of the global parameter. /// @param value Value of the global parameter.
virtual void virtual void
createUpdateGlobalParameter4(const db::ServerSelector& selector, createUpdateGlobalParameter4(const db::ServerSelector& server_selector,
const std::string& name, const std::string& name,
const int64_t value); const int64_t value);
/// @brief Deletes subnet by prefix. /// @brief Deletes subnet by prefix.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_prefix Prefix of the subnet to be deleted. /// @param subnet_prefix Prefix of the subnet to be deleted.
virtual void virtual void
deleteSubnet4(const db::ServerSelector& selector, deleteSubnet4(const db::ServerSelector& server_selector,
const std::string& subnet_prefix); const std::string& subnet_prefix);
/// @brief Deletes subnet by identifier. /// @brief Deletes subnet by identifier.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_id Identifier of the subnet to be deleted. /// @param subnet_id Identifier of the subnet to be deleted.
virtual void virtual void
deleteSubnet4(const db::ServerSelector& selector, const SubnetID& subnet_id); deleteSubnet4(const db::ServerSelector& server_selector, const SubnetID& subnet_id);
/// @brief Deletes all subnets. /// @brief Deletes all subnets.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
virtual void virtual void
deleteAllSubnets4(const db::ServerSelector& selector); deleteAllSubnets4(const db::ServerSelector& server_selector);
/// @brief Deletes shared network by name. /// @brief Deletes shared network by name.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the shared network to be deleted. /// @param name Name of the shared network to be deleted.
virtual void virtual void
deleteSharedNetwork4(const db::ServerSelector& selector, deleteSharedNetwork4(const db::ServerSelector& server_selector,
const std::string& name); const std::string& name);
/// @brief Deletes all shared networks. /// @brief Deletes all shared networks.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
virtual void virtual void
deleteAllSharedNetworks4(const db::ServerSelector& selector); deleteAllSharedNetworks4(const db::ServerSelector& server_selector);
/// @brief Deletes option definition. /// @brief Deletes option definition.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param code Code of the option to be deleted. /// @param code Code of the option to be deleted.
/// @param space Option space of the option to be deleted. /// @param space Option space of the option to be deleted.
virtual void virtual void
deleteOptionDef4(const db::ServerSelector& selector, const uint16_t code, deleteOptionDef4(const db::ServerSelector& server_selector, const uint16_t code,
const std::string& space); const std::string& space);
/// @brief Deletes all option definitions. /// @brief Deletes all option definitions.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
virtual void virtual void
deleteAllOptionDefs4(const db::ServerSelector& selector); deleteAllOptionDefs4(const db::ServerSelector& server_selector);
/// @brief Deletes global option. /// @brief Deletes global option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param code Code of the option to be deleted. /// @param code Code of the option to be deleted.
/// @param space Option space of the option to be deleted. /// @param space Option space of the option to be deleted.
virtual void virtual void
deleteOption4(const db::ServerSelector& selector, const uint16_t code, deleteOption4(const db::ServerSelector& server_selector, const uint16_t code,
const std::string& space); const std::string& space);
/// @brief Deletes subnet level option. /// @brief Deletes subnet level option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_id Identifier of the subnet to which deleted option /// @param subnet_id Identifier of the subnet to which deleted option
/// belongs. /// belongs.
/// @param code Code of the deleted option. /// @param code Code of the deleted option.
/// @param space Option space of the deleted option. /// @param space Option space of the deleted option.
virtual void virtual void
deleteOption4(const db::ServerSelector& selector, const SubnetID& subnet_id, deleteOption4(const db::ServerSelector& server_selector, const SubnetID& subnet_id,
const uint16_t code, const std::string& space); const uint16_t code, const std::string& space);
/// @brief Deletes pool level option. /// @brief Deletes pool level option.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param pool_start_address Lower bound address of the pool to which /// @param pool_start_address Lower bound address of the pool to which
/// deleted option belongs. /// deleted option belongs.
/// @param pool_end_address Upper bound address of the pool to which the /// @param pool_end_address Upper bound address of the pool to which the
...@@ -295,7 +295,7 @@ public: ...@@ -295,7 +295,7 @@ public:
/// @param code Code of the deleted option. /// @param code Code of the deleted option.
/// @param space Option space of the deleted option. /// @param space Option space of the deleted option.
virtual void virtual void
deleteOption4(const db::ServerSelector& selector, deleteOption4(const db::ServerSelector& server_selector,
const asiolink::IOAddress& pool_start_address, const asiolink::IOAddress& pool_start_address,
const asiolink::IOAddress& pool_end_address, const asiolink::IOAddress& pool_end_address,
const uint16_t code, const uint16_t code,
...@@ -303,17 +303,17 @@ public: ...@@ -303,17 +303,17 @@ public:
/// @brief Deletes global parameter. /// @brief Deletes global parameter.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param name Name of the global parameter to be deleted. /// @param name Name of the global parameter to be deleted.
virtual void virtual void
deleteGlobalParameter4(const db::ServerSelector& selector, deleteGlobalParameter4(const db::ServerSelector& server_selector,
const std::string& name); const std::string& name);
/// @brief Deletes all global parameters. /// @brief Deletes all global parameters.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
virtual void virtual void
deleteAllGlobalParameters4(const db::ServerSelector& selector); deleteAllGlobalParameters4(const db::ServerSelector& server_selector);
/// @brief Returns backend type in the textual format. /// @brief Returns backend type in the textual format.
/// ///
......
...@@ -36,6 +36,7 @@ mysql_cb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/mysql_cb/libmysqlcb.l ...@@ -36,6 +36,7 @@ mysql_cb_unittests_LDADD = $(top_builddir)/src/hooks/dhcp/mysql_cb/libmysqlcb.l
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la mysql_cb_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
......
...@@ -99,7 +99,9 @@ public: ...@@ -99,7 +99,9 @@ public:
test_subnets_.push_back(subnet); test_subnets_.push_back(subnet);
// Other subnets include mostly null values except for mandatory parameters. // Adding another subnet with the same subnet id to test
// cases that this second instance can override existing
// subnet instance.
subnet.reset(new Subnet4(IOAddress("10.0.0.0"), 8, 20, 30, 40, 1024)); subnet.reset(new Subnet4(IOAddress("10.0.0.0"), 8, 20, 30, 40, 1024));
pool1.reset(new Pool4(IOAddress("10.0.0.10"), IOAddress("10.0.0.20"))); pool1.reset(new Pool4(IOAddress("10.0.0.10"), IOAddress("10.0.0.20")));
...@@ -138,9 +140,13 @@ public: ...@@ -138,9 +140,13 @@ public:
test_networks_.push_back(shared_network); test_networks_.push_back(shared_network);
// Adding another shared network called "level1" to test
// cases that this second instance can override existing
// "level1" instance.
shared_network.reset(new SharedNetwork4("level1")); shared_network.reset(new SharedNetwork4("level1"));
test_networks_.push_back(shared_network); test_networks_.push_back(shared_network);
// Add more shared networks.
shared_network.reset(new SharedNetwork4("level2")); shared_network.reset(new SharedNetwork4("level2"));
test_networks_.push_back(shared_network); test_networks_.push_back(shared_network);
...@@ -407,7 +413,8 @@ TEST_F(MySqlConfigBackendDHCPv4Test, getModifiedSharedNetworks4) { ...@@ -407,7 +413,8 @@ TEST_F(MySqlConfigBackendDHCPv4Test, getModifiedSharedNetworks4) {
ASSERT_TRUE(networks.empty()); ASSERT_TRUE(networks.empty());
} }
// Test that subnet can be inserted, fetched, updated and then fetched again. // Test that option definition can be inserted, fetched, updated and then
// fetched again.
TEST_F(MySqlConfigBackendDHCPv4Test, getOptionDef4) { TEST_F(MySqlConfigBackendDHCPv4Test, getOptionDef4) {
// Insert new option definition. // Insert new option definition.
OptionDefinitionPtr option_def = test_option_defs_[0]; OptionDefinitionPtr option_def = test_option_defs_[0];
...@@ -433,7 +440,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, getOptionDef4) { ...@@ -433,7 +440,7 @@ TEST_F(MySqlConfigBackendDHCPv4Test, getOptionDef4) {
EXPECT_TRUE(returned_option_def->equals(*option_def2)); EXPECT_TRUE(returned_option_def->equals(*option_def2));
} }
// Test that all shared networks can be fetched. // Test that all option definitions can be fetched.
TEST_F(MySqlConfigBackendDHCPv4Test, getAllOptionDefs4) { TEST_F(MySqlConfigBackendDHCPv4Test, getAllOptionDefs4) {
// Insert test option definitions into the database. Note that the second // Insert test option definitions into the database. Note that the second
// option definition will overwrite the first option definition as they use // option definition will overwrite the first option definition as they use
......
...@@ -30,265 +30,265 @@ public: ...@@ -30,265 +30,265 @@ public:
/// @brief Retrieves a single subnet by subnet_prefix. /// @brief Retrieves a single subnet by subnet_prefix.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_prefix Prefix of the subnet to be retrieved. /// @param subnet_prefix Prefix of the subnet to be retrieved.
/// @return Pointer to the retrieved subnet or NULL if not found. /// @return Pointer to the retrieved subnet or NULL if not found.
virtual Subnet4Ptr virtual Subnet4Ptr
getSubnet4(const db::ServerSelector& selector, getSubnet4(const db::ServerSelector& server_selector,
const std::string& subnet_prefix) const = 0; const std::string& subnet_prefix) const = 0;
/// @brief Retrieves a single subnet by subnet identifier. /// @brief Retrieves a single subnet by subnet identifier.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param subnet_id Identifier of a subnet to be retrieved. /// @param subnet_id Identifier of a subnet to be retrieved.
/// @return Pointer to the retrieved subnet or NULL if not found. /// @return Pointer to the retrieved subnet or NULL if not found.
virtual Subnet4Ptr virtual Subnet4Ptr
getSubnet4(const db::ServerSelector& selector, const SubnetID& subnet_id) const = 0; getSubnet4(const db::ServerSelector& server_selector, const SubnetID& subnet_id) const = 0;
/// @brief Retrieves all subnets. /// @brief Retrieves all subnets.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @return Collection of subnets or empty collection if no subnet found. /// @return Collection of subnets or empty collection if no subnet found.
virtual Subnet4Collection virtual Subnet4Collection
getAllSubnets4(const db::ServerSelector& selector) const = 0; getAllSubnets4(const db::ServerSelector& server_selector) const = 0;
/// @brief Retrieves subnets modified after specified time. /// @brief Retrieves subnets modified after specified time.
/// ///
/// @param selector Server selector. /// @param server_selector Server selector.
/// @param modification_time Lower bound subnet modification time. /// @param modification_time Lower bound subnet modification time.
/// @return Collection of subnets or empty collection if no subnet found. /// @return Collection of subnets or empty collection if no subnet found.
virtual Subnet4Collection virtual Subnet4Collection
getModifiedSubnets4(const db::ServerSelector& selector, getModifiedSubnets4(const db::ServerSelector& server_selector,
const boost::posix_time::ptime& modification_time) const = 0; const boost::posix_time::ptime& modification_time) const = 0;