From: Marcin Siodelski Date: Fri, 31 Oct 2014 10:03:19 +0000 (+0100) Subject: [3625] Addressed review comments. X-Git-Tag: trac3629a_base^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56ade63c6664046cfb1548e31143f5e00a4bc468;p=thirdparty%2Fkea.git [3625] Addressed review comments. Added @todos to the selectSubnet methods of CfgSubnets4 and CfgSubnets6. --- diff --git a/src/lib/dhcpsrv/cfg_subnets4.h b/src/lib/dhcpsrv/cfg_subnets4.h index c59ad7f3ca..a39ae5fae1 100644 --- a/src/lib/dhcpsrv/cfg_subnets4.h +++ b/src/lib/dhcpsrv/cfg_subnets4.h @@ -84,6 +84,14 @@ public: /// /// If the address matches with a subnet, the subnet is returned. /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets (possibly a couple of times) + /// to find the one which fulfils the search criteria. The subnet storage + /// is implemented as a simple STL vector which precludes fast searches + /// using specific keys. Hence, full scan is required. To improve the + /// search performance a different container type is required, e.g. + /// multi-index container, or something of a similar functionality. + /// /// @param selector Const reference to the selector structure which holds /// various information extracted from the client's packet which are used /// to find appropriate subnet. @@ -100,6 +108,14 @@ public: /// testing. This method is also called by the /// @c selectSubnet(SubnetSelector). /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets to find the one which fulfils + /// the search criteria. The subnet storage is implemented as a simple + /// STL vector which precludes fast searches using specific keys. + /// Hence, full scan is required. To improve the search performance a + /// different container type is required, e.g. multi-index container, + /// or something of a similar functionality. + /// /// @param address Address for which the subnet is searched. /// @param client_classes Optional parameter specifying the classes that /// the client belongs to. diff --git a/src/lib/dhcpsrv/cfg_subnets6.h b/src/lib/dhcpsrv/cfg_subnets6.h index a2c1d2261d..6f631849f8 100644 --- a/src/lib/dhcpsrv/cfg_subnets6.h +++ b/src/lib/dhcpsrv/cfg_subnets6.h @@ -79,6 +79,14 @@ public: /// associated with any subnet. If not, it is checked if the link address /// is in range with any of the subnets. /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets (possibly a couple of times) + /// to find the one which fulfils the search criteria. The subnet storage + /// is implemented as a simple STL vector which precludes fast searches + /// using specific keys. Hence, full scan is required. To improve the + /// search performance a different container type is required, e.g. + /// multi-index container, or something of a similar functionality. + /// /// @param selector Const reference to the selector structure which holds /// various information extracted from the client's packet which are used /// to find appropriate subnet. @@ -99,6 +107,19 @@ public: /// is set to false), the method will simply check if the address is in /// range with any of the subnets. /// + /// @note This method is mainly to be used in unit tests, which often + /// require sanity-checking if the subnet exists for the particular + /// address. For other purposes the @c selectSubnet(SubnetSelector) should + /// rather be used instead. + /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets (possibly a couple of times) + /// to find the one which fulfils the search criteria. The subnet storage + /// is implemented as a simple STL vector which precludes fast searches + /// using specific keys. Hence, full scan is required. To improve the + /// search performance a different container type is required, e.g. + /// multi-index container, or something of a similar functionality. + /// /// @param address Address for which the subnet is searched. /// @param client_classes Optional parameter specifying the classes that /// the client belongs to. @@ -119,6 +140,14 @@ private: /// If any of the subnets is explicitly associated with the interface /// name, the subnet is returned. /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets to find the one which fulfils + /// the search criteria. The subnet storage is implemented as a + /// simple STL vector which precludes fast searches using specific + /// keys. Hence, full scan is required. To improve the search + /// performance a different container type is required, e.g. + /// multi-index container, or something of a similar functionality. + /// /// @param iface_name Interface name. /// @param client_classes Optional parameter specifying the classes that /// the client belongs to. @@ -131,10 +160,18 @@ private: /// @brief Selects a subnet using Interface ID option. /// /// This method searches for the subnet using the Interface ID option - /// inserted by the relay agent to the message from a client. If any + /// inserted by the relay agent to the message from a client. If any /// of the subnets is explicitly associated with that interface id, the /// subnet is returned. /// + /// @todo This method requires performance improvement! It currently + /// iterates over all existing subnets to find the one which fulfils + /// the search criteria. The subnet storage is implemented as a + /// simple STL vector which precludes fast searches using specific + /// keys. Hence, full scan is required. To improve the search + /// performance a different container type is required, e.g. + /// multi-index container, or something of a similar functionality. + /// /// @param interface_id An instance of the Interface ID option received /// from the client. /// @param client_classes Optional parameter specifying the classes that