]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[4320] Rename ResourceContainer to HintContainer.
authorMarcin Siodelski <marcin@isc.org>
Mon, 6 Jun 2016 12:22:16 +0000 (14:22 +0200)
committerMarcin Siodelski <marcin@isc.org>
Mon, 6 Jun 2016 12:22:16 +0000 (14:22 +0200)
src/bin/dhcp6/dhcp6_srv.cc
src/lib/dhcpsrv/alloc_engine.h
src/lib/dhcpsrv/tests/alloc_engine6_unittest.cc
src/lib/dhcpsrv/tests/alloc_engine_utils.cc
src/lib/dhcpsrv/tests/alloc_engine_utils.h

index a8ee72155e795aeab35d5f6d6ddef65834f434f6..2281af6310af38be5e52f296f8739c335aed3d14 100644 (file)
@@ -1615,7 +1615,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
     // those prefixes and remove those that we have already processed. We
     // don't want to remove them from the context, so we need to copy them
     // into temporary container.
-    AllocEngine::ResourceContainer hints = ctx.currentIA().hints_;
+    AllocEngine::HintContainer hints = ctx.currentIA().hints_;
 
     // For all leases we have now, add the IAADDR with non-zero lifetimes.
     for (Lease6Collection::const_iterator l = leases.begin(); l != leases.end(); ++l) {
@@ -1662,7 +1662,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
 
     // Finally, if there are any addresses requested that we haven't dealt with
     // already, inform the client that he can't have them.
-    for (AllocEngine::ResourceContainer::const_iterator hint = hints.begin();
+    for (AllocEngine::HintContainer::const_iterator hint = hints.begin();
          hint != hints.end(); ++hint) {
         Option6IAAddrPtr iaaddr(new Option6IAAddr(D6O_IAADDR,
                                                   hint->first, 0, 0));
@@ -1775,7 +1775,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
     // those prefixes and remove those that we have already processed. We
     // don't want to remove them from the context, so we need to copy them
     // into temporary container.
-    AllocEngine::ResourceContainer hints = ctx.currentIA().hints_;
+    AllocEngine::HintContainer hints = ctx.currentIA().hints_;
 
     // For all the leases we have now, add the IAPPREFIX with non-zero lifetimes
     for (Lease6Collection::const_iterator l = leases.begin(); l != leases.end(); ++l) {
@@ -1802,7 +1802,7 @@ Dhcpv6Srv::extendIA_PD(const Pkt6Ptr& query,
     // zero lifetimes
     // Finally, if there are any addresses requested that we haven't dealt with
     // already, inform the client that he can't have them.
-    for (AllocEngine::ResourceContainer::const_iterator prefix = hints.begin();
+    for (AllocEngine::HintContainer::const_iterator prefix = hints.begin();
          prefix != hints.end(); ++prefix) {
         // Send the prefix with the zero lifetimes only if the prefix
         // contains non-zero value. A zero value indicates that the hint was
index 85d18a151eba6cc508fce25be1dc5e531eb28b18..01bc568efab7c89d468034c3f4cd5a4daa8543ed 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <list>
 #include <map>
+#include <set>
 #include <utility>
 
 namespace isc {
@@ -251,7 +252,7 @@ public:
     typedef std::pair<isc::asiolink::IOAddress, uint8_t> ResourceType;
 
     /// @brief Container for client's hints.
-    typedef std::vector<ResourceType> ResourceContainer;
+    typedef std::vector<ResourceType> HintContainer;
 
     /// @brief A tuple holding host identifier type and value.
     typedef std::pair<Host::IdentifierType, std::vector<uint8_t> > IdentifierPair;
@@ -351,10 +352,10 @@ public:
             ///
             /// There will typically be just one address, but the protocol
             /// allows more than one address or prefix for each IA container.
-            ResourceContainer hints_;
+            HintContainer hints_;
 
             /// @brief Holds addresses or prefixes allocated for this IA.
-            ResourceContainer allocated_resources_;
+            HintContainer allocated_resources_;
 
             /// @brief A pointer to any old leases that the client had before
             /// update but are no longer valid after the update/allocation.
index 22f49f004ae83a6c85b5f1d938dfc08102571d74..638658b1119b327a28dd034b52d94dd30062a2b3 100644 (file)
@@ -690,7 +690,7 @@ TEST_F(AllocEngine6Test, renewExtendLeaseLifetime) {
     AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100);
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(IOAddress("2001:db8:1::15"), 128));
 
     // Client should receive a lease.
@@ -723,7 +723,7 @@ TEST_F(AllocEngine6Test, renewExtendLeaseLifetimeForReservation) {
     AllocEngine engine(AllocEngine::ALLOC_ITERATIVE, 100);
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(IOAddress("2001:db8:1::15"), 128));
 
     // Client should receive a lease.
@@ -1273,7 +1273,7 @@ TEST_F(AllocEngine6Test, addressRenewal) {
     ASSERT_EQ(1, leases.size());
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(leases[0]->addr_, 128));
 
     Lease6Collection renewed = renewTest(engine, pool_, hints, true);
@@ -1304,7 +1304,7 @@ TEST_F(AllocEngine6Test, reservedAddressRenewal) {
     ASSERT_EQ("2001:db8:1::1c", leases[0]->addr_.toText());
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(leases[0]->addr_, 128));
 
     Lease6Collection renewed = renewTest(engine, pool_, hints, true);
@@ -1440,7 +1440,7 @@ TEST_F(AllocEngine6Test, reservedAddressRenewChange) {
     ASSERT_NE("2001:db8:1::1c", leases[0]->addr_.toText());
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(leases[0]->addr_, 128));
 
     // Create reservation for the client. This is in-pool reservation,
@@ -1464,7 +1464,7 @@ TEST_F(AllocEngine6Test, reservedAddressRenewReserved) {
     ASSERT_EQ(1, leases.size());
 
     // This is what the client will send in his renew message.
-    AllocEngine::ResourceContainer hints;
+    AllocEngine::HintContainer hints;
     hints.push_back(make_pair(leases[0]->addr_, 128));
 
     // Create reservation for this address, but for another client.
index 8d93f8c7849466d3318bb4053e6404cee3d2f81d..9eaafe9df64689602d30ca77d1ba3c43528d9966 100644 (file)
@@ -319,7 +319,7 @@ AllocEngine6Test::simpleAlloc6Test(const Pool6Ptr& pool, const IOAddress& hint,
 
 Lease6Collection
 AllocEngine6Test::renewTest(AllocEngine& engine, const Pool6Ptr& pool,
-                            AllocEngine::ResourceContainer& hints,
+                            AllocEngine::HintContainer& hints,
                             bool in_pool) {
 
     Lease::Type type = pool->getType();
index 2d2f58574e5eeb8f7cf1d771d74f544e9e9bb136..0fcb39348e2c1f9498a5e15d68e1847e945bf8c8 100644 (file)
@@ -276,7 +276,7 @@ public:
     /// @param in_pool specifies whether the lease is expected to be in pool
     /// @return allocated lease(s) (may be empty)
     Lease6Collection renewTest(AllocEngine& engine, const Pool6Ptr& pool,
-                               AllocEngine::ResourceContainer& hints,
+                               AllocEngine::HintContainer& hints,
                                bool in_pool = true);
 
     /// @brief Checks if the address allocation with a hint that is in range,