From: Marcin Siodelski Date: Thu, 31 Mar 2016 11:45:44 +0000 (+0200) Subject: [4302] Addressed review comments. X-Git-Tag: trac4106_update_base~60^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=356f261e364cae5a9231b01773fe9f746172e462;p=thirdparty%2Fkea.git [4302] Addressed review comments. - Rename GET_HOST_HWADDR_DUID to GET_HOST_DHCPID - Fixes and clarifications in doxygen documentation --- diff --git a/src/lib/dhcpsrv/cfg_hosts.h b/src/lib/dhcpsrv/cfg_hosts.h index 85902f969c..196ac20be0 100644 --- a/src/lib/dhcpsrv/cfg_hosts.h +++ b/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. diff --git a/src/lib/dhcpsrv/host_mgr.h b/src/lib/dhcpsrv/host_mgr.h index 7d66366d04..37b8efee91 100644 --- a/src/lib/dhcpsrv/host_mgr.h +++ b/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. /// diff --git a/src/lib/dhcpsrv/mysql_host_data_source.cc b/src/lib/dhcpsrv/mysql_host_data_source.cc index 883abbb8fc..af1cd3c0f2 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.cc +++ b/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); diff --git a/src/lib/dhcpsrv/mysql_host_data_source.h b/src/lib/dhcpsrv/mysql_host_data_source.h index 8d40f149d0..58b1edff5c 100644 --- a/src/lib/dhcpsrv/mysql_host_data_source.h +++ b/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