]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[527-check-return-value-of-multi-index-push_back] Added missing (but not required... 527-check-return-value-of-multi-index-push_back
authorFrancis Dupont <fdupont@isc.org>
Fri, 21 Jun 2019 11:57:33 +0000 (13:57 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 21 Jun 2019 11:57:33 +0000 (13:57 +0200)
src/lib/dhcpsrv/shared_network.cc
src/lib/dhcpsrv/shared_network.h

index 90304624fd551710ca649a7265f0184d6fa4a291..a9b628da6de1d52fe5b8546c97bf4759f1d90fcc 100644 (file)
@@ -374,6 +374,11 @@ SharedNetwork4::getSubnet(const SubnetID& subnet_id) const {
     return (Impl::getSubnet<Subnet4Ptr>(subnets_, subnet_id));
 }
 
+Subnet4Ptr
+SharedNetwork4::getSubnet(const std::string& subnet_prefix) const {
+    return (Impl::getSubnet<Subnet4Ptr>(subnets_, subnet_prefix));
+}
+
 Subnet4Ptr
 SharedNetwork4::getNextSubnet(const Subnet4Ptr& first_subnet,
                               const SubnetID& current_subnet) const {
@@ -474,11 +479,17 @@ SharedNetwork6::delAll() {
     }
     subnets_.clear();
 }
+
 Subnet6Ptr
 SharedNetwork6::getSubnet(const SubnetID& subnet_id) const {
     return (Impl::getSubnet<Subnet6Ptr>(subnets_, subnet_id));
 }
 
+Subnet6Ptr
+SharedNetwork6::getSubnet(const std::string& subnet_prefix) const {
+    return (Impl::getSubnet<Subnet6Ptr>(subnets_, subnet_prefix));
+}
+
 Subnet6Ptr
 SharedNetwork6::getNextSubnet(const Subnet6Ptr& first_subnet,
                               const SubnetID& current_subnet) const {
index 2c132daf970c66ca541fbdd189c70337c2c84bef..cb19a986a190929a991efb1d014844cb323e846a 100644 (file)
@@ -349,6 +349,14 @@ public:
     /// if such subnet doesn't exist within shared network.
     Subnet6Ptr getSubnet(const SubnetID& subnet_id) const;
 
+    /// @brief Returns a subnet for a specified subnet prefix.
+    ///
+    /// @param subnet_prefix Subnet prefix.
+    ///
+    /// @return Shared pointer to a subnet using this prefix or null pointer
+    /// if such subnet doesn't exist within shared network.
+    Subnet6Ptr getSubnet(const std::string& subnet_prefix) const;
+
     /// @brief Retrieves next available IPv6 subnet within shared network.
     ///
     /// See documentation for @ref SharedNetwork6::getNextSubnet.