From: Francis Dupont Date: Wed, 23 Jan 2019 12:34:08 +0000 (+0100) Subject: [313-return-a-list-of-all-reservations-by-subnet-id] Addressed some comments X-Git-Tag: 429-Updated-StampedValue-to-support-reals_base~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0b3b8469b721979c15843b7fa99b1e7dd8a0647;p=thirdparty%2Fkea.git [313-return-a-list-of-all-reservations-by-subnet-id] Addressed some comments --- diff --git a/src/lib/dhcpsrv/pgsql_host_data_source.h b/src/lib/dhcpsrv/pgsql_host_data_source.h index e5094e1011..f3b1f55205 100644 --- a/src/lib/dhcpsrv/pgsql_host_data_source.h +++ b/src/lib/dhcpsrv/pgsql_host_data_source.h @@ -161,7 +161,8 @@ public: /// @brief Return all hosts in a DHCPv4 subnet. /// /// This method returns all @ref Host objects which represent reservations - /// in a specified subnet. + /// in a specified subnet. Global reservations are returned for the + /// subnet id 0. /// /// @param subnet_id subnet identifier to filter by /// @@ -172,7 +173,8 @@ public: /// @brief Return all hosts in a DHCPv6 subnet. /// /// This method returns all @ref Host objects which represent reservations - /// in a specified subnet. + /// in a specified subnet. Global reservations are returned for the + /// subnet id 0. /// /// @param subnet_id subnet identifier to filter by /// @@ -182,8 +184,13 @@ public: /// @brief Returns range of hosts in a DHCPv4 subnet. /// - /// This method returns a page of @c Host objects which represent - /// reservations in a specified subnet. + /// This method implements paged browsing of host databases. The + /// parameters specify a page size, an index in sources and the + /// starting host id of the range. If not zero this host id is + /// excluded from the returned range. When a source is exhausted + /// the index is updated. There is no guarantee about the order + /// of returned host reservations, only the sources and + /// reservations from the same source are ordered. /// /// @param subnet_id Subnet identifier. /// @param source_index Index of the source (unused). @@ -200,8 +207,13 @@ public: /// @brief Returns range of hosts in a DHCPv6 subnet. /// - /// This method returns a page of @c Host objects which represent - /// reservations in a specified subnet. + /// This method implements paged browsing of host databases. The + /// parameters specify a page size, an index in sources and the + /// starting host id of the range. If not zero this host id is + /// excluded from the returned range. When a source is exhausted + /// the index is updated. There is no guarantee about the order + /// of returned host reservations, only the sources and + /// reservations from the same source are ordered. /// /// @param subnet_id Subnet identifier. /// @param source_index Index of the source (unused). diff --git a/src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.h b/src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.h index e9eaef3f49..8661dfae38 100644 --- a/src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.h +++ b/src/lib/dhcpsrv/testutils/generic_host_data_source_unittest.h @@ -182,28 +182,28 @@ public: /// same subnet can be retrieved properly. /// /// Uses gtest macros to report failures. - /// @param id Identifier type. + /// @param id Identifier type (hwaddr or duid). void testGetAll4(const Host::IdentifierType& id); /// @brief Test that Verifies that IPv6 host reservations in the /// same subnet can be retrieved properly. /// /// Uses gtest macros to report failures. - /// @param id Identifier type. + /// @param id Identifier type (hwaddr or duid). void testGetAll6(const Host::IdentifierType& id); /// @brief Test that Verifies that pages of host reservations in the /// same subnet can be retrieved properly. /// /// Uses gtest macros to report failures. - /// @param id Identifier type. + /// @param id Identifier type (hwaddr or duid). void testGetPage4(const Host::IdentifierType& id); /// @brief Test that Verifies that pages of host reservations in the /// same subnet can be retrieved properly. /// /// Uses gtest macros to report failures. - /// @param id Identifier type. + /// @param id Identifier type (hwaddr or duid). void testGetPage6(const Host::IdentifierType& id); /// @brief Test inserts several hosts with unique IPv4 address and diff --git a/src/lib/dhcpsrv/writable_host_data_source.h b/src/lib/dhcpsrv/writable_host_data_source.h index 1a398064f3..38a3842517 100644 --- a/src/lib/dhcpsrv/writable_host_data_source.h +++ b/src/lib/dhcpsrv/writable_host_data_source.h @@ -59,6 +59,14 @@ public: /// @brief Returns range of hosts in a DHCPv4 subnet. /// + /// This method implements paged browsing of host databases. The + /// parameters specify a page size, an index in sources and the + /// starting host id of the range. If not zero this host id is + /// excluded from the returned range. When a source is exhausted + /// the index is updated. There is no guarantee about the order + /// of returned host reservations, only the sources and + /// reservations from the same source are ordered. + /// /// @param subnet_id Subnet identifier. /// @param source_index Index of the source. /// @param lower_host_id Host identifier used as lower bound for the @@ -74,6 +82,14 @@ public: /// @brief Returns range of hosts in a DHCPv6 subnet. /// + /// This method implements paged browsing of host databases. The + /// parameters specify a page size, an index in sources and the + /// starting host id of the range. If not zero this host id is + /// excluded from the returned range. When a source is exhausted + /// the index is updated. There is no guarantee about the order + /// of returned host reservations, only the sources and + /// reservations from the same source are ordered. + /// /// @param subnet_id Subnet identifier. /// @param source_index Index of the source. /// @param lower_host_id Host identifier used as lower bound for the