Browse Source

[4302] Addressed review comments.

- Rename GET_HOST_HWADDR_DUID to GET_HOST_DHCPID
- Fixes and clarifications in doxygen documentation
Marcin Siodelski 9 years ago
parent
commit
356f261e36

+ 2 - 0
src/lib/dhcpsrv/cfg_hosts.h

@@ -76,6 +76,7 @@ public:
     /// for a specified identifier. This method may return multiple hosts
     /// because a particular client may have reservations in multiple subnets.
     ///
+    /// @param identifier_type One of the supported identifier types.
     /// @param identifier_begin Pointer to a begining of a buffer containing
     /// an identifier.
     /// @param identifier_len Identifier length.
@@ -91,6 +92,7 @@ public:
     /// for a specified identifier. This method may return multiple hosts
     /// because a particular client may have reservations in multiple subnets.
     ///
+    /// @param identifier_type One of the supported identifier types.
     /// @param identifier_begin Pointer to a begining of a buffer containing
     /// an identifier.
     /// @param identifier_len Identifier length.

+ 9 - 3
src/lib/dhcpsrv/host_mgr.h

@@ -88,7 +88,9 @@ public:
     ///
     /// It retrieves reservations from both primary and alternate host data
     /// source as a single collection of @c Host objects, i.e. if matching
-    /// reservations are in both sources, all of them are returned.
+    /// reservations are in both sources, all of them are returned. The
+    /// reservations from the primary data source are placed before the
+    /// reservations from the alternate source.
     ///
     /// Note that returned collection may contain duplicates. It is the
     /// caller's responsibility to check for duplicates.
@@ -110,7 +112,9 @@ public:
     ///
     /// It retrieves reservations from both primary and alternate host data
     /// source as a single collection of @c Host objects, i.e. if matching
-    /// reservations are in both sources, all of them are returned.
+    /// reservations are in both sources, all of them are returned. The
+    /// reservations from the primary data source are placed before the
+    /// reservations from the alternate source.
     ///
     /// @param identifier_begin Pointer to a begining of a buffer containing
     /// an identifier.
@@ -128,7 +132,9 @@ public:
     /// different subnets.
     ///
     /// If matching reservations are both in the primary and the alternate
-    /// data source, all of them are returned.
+    /// data source, all of them are returned. The reservations from the
+    /// primary data source are placed before the reservations from the
+    /// alternate source.
     ///
     /// @param address IPv4 address for which the @c Host object is searched.
     ///

+ 2 - 2
src/lib/dhcpsrv/mysql_host_data_source.cc

@@ -64,7 +64,7 @@ TaggedStatement tagged_statements[] = {
     // having a specified identifier will be returned from those subnets.
     // Because LEFT JOIN clause is used, the number of rows returned for
     // a single host depends on the number of reservations.
-    {MySqlHostDataSource::GET_HOST_HWADDR_DUID,
+    {MySqlHostDataSource::GET_HOST_DHCPID,
             "SELECT h.host_id, h.dhcp_identifier, h.dhcp_identifier_type, "
                 "h.dhcp4_subnet_id, h.dhcp6_subnet_id, h.ipv4_address, "
                 "h.hostname, h.dhcp4_client_classes, h.dhcp6_client_classes, "
@@ -1429,7 +1429,7 @@ MySqlHostDataSource::getAll(const Host::IdentifierType& identifier_type,
     inbind[0].length = &length;
 
     ConstHostCollection result;
-    impl_->getHostCollection(GET_HOST_HWADDR_DUID, inbind,
+    impl_->getHostCollection(GET_HOST_DHCPID, inbind,
                              impl_->host_ipv6_exchange_,
                              result, false);
     return (result);

+ 1 - 1
src/lib/dhcpsrv/mysql_host_data_source.h

@@ -257,7 +257,7 @@ public:
     enum StatementIndex {
         INSERT_HOST,            // Insert new host to collection
         INSERT_V6_RESRV,        // Insert v6 reservation
-        GET_HOST_HWADDR_DUID,   // Gets hosts by DUID and/or HW address
+        GET_HOST_DHCPID,        // Gets hosts by host identifier
         GET_HOST_ADDR,          // Gets hosts by IPv4 address
         GET_HOST_SUBID4_DHCPID, // Gets host by IPv4 SubnetID, HW address/DUID
         GET_HOST_SUBID6_DHCPID, // Gets host by IPv6 SubnetID, HW address/DUID