]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2546] Define ClientIdPtr type
authorStephen Morris <stephen@isc.org>
Mon, 10 Dec 2012 10:35:28 +0000 (10:35 +0000)
committerStephen Morris <stephen@isc.org>
Mon, 10 Dec 2012 10:35:28 +0000 (10:35 +0000)
This is akin to the DuidPtr and is a shared point to a Client ID.

src/lib/dhcp/duid.h
src/lib/dhcpsrv/lease_mgr.h
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc

index 1b75f73ebf85454d830d46eeaff85cc438b5961e..60b9706df66e537ce7c6b4a29aaea77abb9b313a 100644 (file)
@@ -114,6 +114,9 @@ public:
     bool operator!=(const ClientId& other) const;
 };
 
+/// @brief Shared pointer to a Client ID.
+typedef boost::shared_ptr<ClientId> ClientIdPtr;
+
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
 
index 8ac04e66176aff426c51d7b1155b012a74ac08b6..6aa3f18ac843738ab30fbb725d1f6a863209b081 100644 (file)
@@ -165,7 +165,7 @@ struct Lease4 {
     ///
     /// @todo Should this be a pointer to a client ID or the ID itself?
     ///       Compare with the DUID in the Lease6 structure.
-    boost::shared_ptr<ClientId> client_id_;
+    ClientIdPtr client_id_;
 
     /// @brief Renewal timer
     ///
index 76d9cc7f2c65e8cc0a42b8a634ed49be27a2c141..8668788c8778072434800f14c896887044262f5a 100644 (file)
@@ -230,8 +230,8 @@ public:
     ///
     /// @param address Address to use for the initialization
     ///
-    /// @return Lease4Ptr.  This will not point to anything if the initialization
-    ///         failed (e.g. unknown address).
+    /// @return Lease4Ptr.  This will not point to anything if the
+    ///         initialization failed (e.g. unknown address).
     Lease4Ptr initializeLease4(std::string address) {
         Lease4Ptr lease(new Lease4());
 
@@ -251,7 +251,7 @@ public:
         // Set other parameters.  For historical reasons, address 0 is not used.
         if (address == straddress4_[0]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x08);
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x42)));
             lease->valid_lft_ = 8677;
             lease->cltt_ = 168256;
@@ -259,7 +259,7 @@ public:
 
         } else if (address == straddress4_[1]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x19);
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x53)));
             lease->valid_lft_ = 3677;
             lease->cltt_ = 123456;
@@ -267,7 +267,7 @@ public:
 
         } else if (address == straddress4_[2]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x2a);
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x64)));
             lease->valid_lft_ = 5412;
             lease->cltt_ = 234567;
@@ -275,7 +275,7 @@ public:
 
         } else if (address == straddress4_[3]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x19);      // Same as lease 1
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x75)));
 
             // The times used in the next tests are deliberately restricted - we
@@ -289,7 +289,7 @@ public:
         } else if (address == straddress4_[4]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x4c);
             // Same ClientId as straddr4_[1]
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x53)));    // Same as lease 1
             lease->valid_lft_ = 7736;
             lease->cltt_ = 222456;
@@ -298,7 +298,7 @@ public:
         } else if (address == straddress4_[5]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x19);      // Same as lease 1
             // Same ClientId and IAID as straddress4_1
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x53)));    // Same as lease 1
             lease->valid_lft_ = 7832;
             lease->cltt_ = 227476;
@@ -307,7 +307,7 @@ public:
         } else if (address == straddress4_[6]) {
             lease->hwaddr_ = vector<uint8_t>(6, 0x6e);
             // Same ClientId as straddress4_1
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>(8, 0x53)));    // Same as lease 1
             lease->valid_lft_ = 1832;
             lease->cltt_ = 627476;
@@ -315,7 +315,7 @@ public:
 
         } else if (address == straddress4_[7]) {
             lease->hwaddr_ = vector<uint8_t>();             // Empty
-            lease->client_id_ = boost::shared_ptr<ClientId>(
+            lease->client_id_ = ClientIdPtr(
                 new ClientId(vector<uint8_t>()));           // Empty
             lease->valid_lft_ = 7975;
             lease->cltt_ = 213876;