]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3561] Addressed review comments.
authorMarcin Siodelski <marcin@isc.org>
Mon, 8 Dec 2014 17:19:40 +0000 (18:19 +0100)
committerMarcin Siodelski <marcin@isc.org>
Mon, 8 Dec 2014 17:19:40 +0000 (18:19 +0100)
Multiple updates to the documentation of the HostMgr. Also fixed a broken
implementation of the HostMgr::getAll4.

src/lib/dhcpsrv/host_mgr.cc
src/lib/dhcpsrv/host_mgr.h
src/lib/dhcpsrv/libdhcpsrv.dox

index 0e0cc141c6440ea2f1f10698429d8f00e6946f50..8296cadd85ec1ae4db91f76255003795220dde1e 100644 (file)
@@ -75,7 +75,7 @@ HostMgr::getAll4(const IOAddress& address) const {
         ConstHostCollection hosts_plus = alternate_source->getAll4(address);
         hosts.insert(hosts.end(), hosts_plus.begin(), hosts_plus.end());
     }
-    return (getCfgHosts()->getAll4(address));
+    return (hosts);
 }
 
 ConstHostPtr
index 703ae65dd02fdbfed67934b79f28585e52a9b663..cb8ded8dfc834737ccbe1795f85c50a1492492f2 100644 (file)
@@ -47,7 +47,7 @@ namespace dhcp {
 /// For example, for the SQL database the user's credentials, database address,
 /// and database name are required. The @c HostMgr passes these parameters
 /// to an appropriate datasource which is responsible for opening a connection
-/// and maintaing it.
+/// and maintaining it.
 ///
 /// It is possible to switch to a different alternate data source or disable
 /// the use of the alternate datasource, e.g. as a result of server's
@@ -67,8 +67,9 @@ public:
     /// @param access Host data source access parameters for the alternate
     /// host data source. It holds "keyword=value" pairs, separated by spaces.
     /// The supported values are specific to the alternate data source in use.
-    /// However, the "type" parameter is common and it specifies which data
-    /// source is to be used.
+    /// However, the "type" parameter will be common and it will specify which
+    /// data source is to be used. Currently, no parameters are supported
+    /// and the parameter is ignored.
     static void create(const std::string& access = "");
 
     /// @brief Returns a sole instance of the @c HostMgr.
@@ -77,19 +78,22 @@ public:
     /// to be used to gather/manage host reservations. It returns an instance
     /// of the @c HostMgr created by the @c create method. If such instance
     /// doesn't exist yet, it is created using the @c create method with the
-    /// default c
+    /// default value of the data access string, which configures the host
+    /// manager to not use the alternate host data source.
     static HostMgr& instance();
 
     /// @brief Returns all hosts for the specified HW address or DUID.
     ///
     /// This method returns all @c Host objects representing reservations for
-    /// the specified HW address or DUID as documented in the
+    /// the specified HW address or/and DUID as documented in the
     /// @c BaseHostDataSource::getAll.
     ///
     /// It retrieves reservations from both primary and alternate host data
-    /// source as a single collection of @c Host objects. Note that this
-    /// collection may contain duplicates. It is the caller's responsibility
-    /// to check for duplicates.
+    /// source as a single collection of @c Host objects, i.e. if matching
+    /// reservations are in both sources, all of them are returned.
+    ///
+    /// Note that returned collection may contain duplicates. It is the
+    /// caller's responsibility to check for duplicates.
     ///
     /// @param hwaddr HW address of the client or NULL if no HW address
     /// available.
@@ -104,6 +108,9 @@ public:
     /// This method may return multiple @c Host objects if they are connected to
     /// different subnets.
     ///
+    /// If matching reservations are both in the primary and the alternate
+    /// data source, all of them are returned.
+    ///
     /// @param address IPv4 address for which the @c Host object is searched.
     ///
     /// @return Collection of const @c Host objects.
index e285c7038f36b85dd38a3b7acb1520895756dad7..6a7eb57091c2b8e0a38ef53dae8c91c71b0955a0 100644 (file)
@@ -150,7 +150,7 @@ that handles allocation of new leases. It takes parameters that the client
 provided (client-id, DUID, subnet, a hint if the user provided one, etc.) and
 then attempts to allocate a lease.
 
-There is no single best soluction to the address assignment problem. Server
+There is no single best solution to the address assignment problem. Server
 is expected to pick an address from its available pools is currently not used.
 There are many possible algorithms that can do that, each with its own advantages
 and drawbacks. This allocation engine must provide robust operation is radically