mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-29 13:07:50 +00:00
[2546] Define ClientIdPtr type
This is akin to the DuidPtr and is a shared point to a Client ID.
This commit is contained in:
parent
084a166845
commit
d87597de14
@ -114,6 +114,9 @@ public:
|
|||||||
bool operator!=(const ClientId& other) const;
|
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::dhcp namespace
|
||||||
}; // end of isc namespace
|
}; // end of isc namespace
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ struct Lease4 {
|
|||||||
///
|
///
|
||||||
/// @todo Should this be a pointer to a client ID or the ID itself?
|
/// @todo Should this be a pointer to a client ID or the ID itself?
|
||||||
/// Compare with the DUID in the Lease6 structure.
|
/// Compare with the DUID in the Lease6 structure.
|
||||||
boost::shared_ptr<ClientId> client_id_;
|
ClientIdPtr client_id_;
|
||||||
|
|
||||||
/// @brief Renewal timer
|
/// @brief Renewal timer
|
||||||
///
|
///
|
||||||
|
@ -230,8 +230,8 @@ public:
|
|||||||
///
|
///
|
||||||
/// @param address Address to use for the initialization
|
/// @param address Address to use for the initialization
|
||||||
///
|
///
|
||||||
/// @return Lease4Ptr. This will not point to anything if the initialization
|
/// @return Lease4Ptr. This will not point to anything if the
|
||||||
/// failed (e.g. unknown address).
|
/// initialization failed (e.g. unknown address).
|
||||||
Lease4Ptr initializeLease4(std::string address) {
|
Lease4Ptr initializeLease4(std::string address) {
|
||||||
Lease4Ptr lease(new Lease4());
|
Lease4Ptr lease(new Lease4());
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ public:
|
|||||||
// Set other parameters. For historical reasons, address 0 is not used.
|
// Set other parameters. For historical reasons, address 0 is not used.
|
||||||
if (address == straddress4_[0]) {
|
if (address == straddress4_[0]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x08);
|
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)));
|
new ClientId(vector<uint8_t>(8, 0x42)));
|
||||||
lease->valid_lft_ = 8677;
|
lease->valid_lft_ = 8677;
|
||||||
lease->cltt_ = 168256;
|
lease->cltt_ = 168256;
|
||||||
@ -259,7 +259,7 @@ public:
|
|||||||
|
|
||||||
} else if (address == straddress4_[1]) {
|
} else if (address == straddress4_[1]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x19);
|
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)));
|
new ClientId(vector<uint8_t>(8, 0x53)));
|
||||||
lease->valid_lft_ = 3677;
|
lease->valid_lft_ = 3677;
|
||||||
lease->cltt_ = 123456;
|
lease->cltt_ = 123456;
|
||||||
@ -267,7 +267,7 @@ public:
|
|||||||
|
|
||||||
} else if (address == straddress4_[2]) {
|
} else if (address == straddress4_[2]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x2a);
|
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)));
|
new ClientId(vector<uint8_t>(8, 0x64)));
|
||||||
lease->valid_lft_ = 5412;
|
lease->valid_lft_ = 5412;
|
||||||
lease->cltt_ = 234567;
|
lease->cltt_ = 234567;
|
||||||
@ -275,7 +275,7 @@ public:
|
|||||||
|
|
||||||
} else if (address == straddress4_[3]) {
|
} else if (address == straddress4_[3]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x19); // Same as lease 1
|
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)));
|
new ClientId(vector<uint8_t>(8, 0x75)));
|
||||||
|
|
||||||
// The times used in the next tests are deliberately restricted - we
|
// The times used in the next tests are deliberately restricted - we
|
||||||
@ -289,7 +289,7 @@ public:
|
|||||||
} else if (address == straddress4_[4]) {
|
} else if (address == straddress4_[4]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x4c);
|
lease->hwaddr_ = vector<uint8_t>(6, 0x4c);
|
||||||
// Same ClientId as straddr4_[1]
|
// 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
|
new ClientId(vector<uint8_t>(8, 0x53))); // Same as lease 1
|
||||||
lease->valid_lft_ = 7736;
|
lease->valid_lft_ = 7736;
|
||||||
lease->cltt_ = 222456;
|
lease->cltt_ = 222456;
|
||||||
@ -298,7 +298,7 @@ public:
|
|||||||
} else if (address == straddress4_[5]) {
|
} else if (address == straddress4_[5]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x19); // Same as lease 1
|
lease->hwaddr_ = vector<uint8_t>(6, 0x19); // Same as lease 1
|
||||||
// Same ClientId and IAID as straddress4_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
|
new ClientId(vector<uint8_t>(8, 0x53))); // Same as lease 1
|
||||||
lease->valid_lft_ = 7832;
|
lease->valid_lft_ = 7832;
|
||||||
lease->cltt_ = 227476;
|
lease->cltt_ = 227476;
|
||||||
@ -307,7 +307,7 @@ public:
|
|||||||
} else if (address == straddress4_[6]) {
|
} else if (address == straddress4_[6]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(6, 0x6e);
|
lease->hwaddr_ = vector<uint8_t>(6, 0x6e);
|
||||||
// Same ClientId as straddress4_1
|
// 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
|
new ClientId(vector<uint8_t>(8, 0x53))); // Same as lease 1
|
||||||
lease->valid_lft_ = 1832;
|
lease->valid_lft_ = 1832;
|
||||||
lease->cltt_ = 627476;
|
lease->cltt_ = 627476;
|
||||||
@ -315,7 +315,7 @@ public:
|
|||||||
|
|
||||||
} else if (address == straddress4_[7]) {
|
} else if (address == straddress4_[7]) {
|
||||||
lease->hwaddr_ = vector<uint8_t>(); // Empty
|
lease->hwaddr_ = vector<uint8_t>(); // Empty
|
||||||
lease->client_id_ = boost::shared_ptr<ClientId>(
|
lease->client_id_ = ClientIdPtr(
|
||||||
new ClientId(vector<uint8_t>())); // Empty
|
new ClientId(vector<uint8_t>())); // Empty
|
||||||
lease->valid_lft_ = 7975;
|
lease->valid_lft_ = 7975;
|
||||||
lease->cltt_ = 213876;
|
lease->cltt_ = 213876;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user