diff options
author | Tomek Mrugalski <tomasz@isc.org> | 2017-08-01 20:52:15 +0200 |
---|---|---|
committer | Tomek Mrugalski <tomasz@isc.org> | 2017-08-01 21:13:43 +0200 |
commit | c16e3e91e6430e9b7e37c5c91df1df93ea7501dd (patch) | |
tree | 57fe4e6e408defdf409636a7d7c06f6cdac3090e /src/lib/dhcpsrv/cfg_subnets6.cc | |
parent | [5272] LeaseX::toElement() implemented (diff) | |
download | kea-c16e3e91e6430e9b7e37c5c91df1df93ea7501dd.tar.xz kea-c16e3e91e6430e9b7e37c5c91df1df93ea7501dd.zip |
[5272] getSubnet implemented.
Diffstat (limited to 'src/lib/dhcpsrv/cfg_subnets6.cc')
-rw-r--r-- | src/lib/dhcpsrv/cfg_subnets6.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/cfg_subnets6.cc b/src/lib/dhcpsrv/cfg_subnets6.cc index a795fe4a60..03ec44f84e 100644 --- a/src/lib/dhcpsrv/cfg_subnets6.cc +++ b/src/lib/dhcpsrv/cfg_subnets6.cc @@ -166,6 +166,20 @@ CfgSubnets6::selectSubnet(const OptionPtr& interface_id, return (Subnet6Ptr()); } +Subnet6Ptr +CfgSubnets6::getSubnet(const SubnetID id) const { + + /// @todo: Once this code is migrated to multi-index container, use + /// an index rather than full scan. + for (auto subnet = subnets_.begin(); subnet != subnets_.end(); ++subnet) { + if ((*subnet)->getID() == id) { + return (*subnet); + } + } + return (Subnet6Ptr()); +} + + bool CfgSubnets6::isDuplicate(const Subnet6& subnet) const { for (Subnet6Collection::const_iterator subnet_it = subnets_.begin(); |