IPv6Resrv::IPv6Resrv(const Type& type,
const asiolink::IOAddress& prefix,
const uint8_t prefix_len)
- : type_(type), prefix_(asiolink::IOAddress("::")),
- prefix_len_(128){
+ : type_(type), prefix_(asiolink::IOAddress("::")), prefix_len_(128) {
// Validate and set the actual values.
set(type, prefix, prefix_len);
}
std::string server_host_name_;
/// @brief Boot file name (a.k.a. file, carried in DHCPv4 message)
std::string boot_file_name_;
+
+ /// @brief HostID (a unique identifier assigned when the host is stored in
/// MySQL, PostgreSQL or Cassandra)
uint64_t host_id_;
/// we queried other backends for specific host and there was no
/// entry for it.
bool negative_;
- /// @brief keys for authentication .
+ /// @brief key for authentication .
///
- /// This key is a 16 byte value to be used in the authentication field
- /// During server replies specified in the RFC 3315bis authentication field will
- /// contain the below key. While sending reconfigure message authentication field
+ /// key is a 16 byte value to be used in the authentication field.
+ /// Server replies will contain the below key in authentication field as specified in the RFC 3315bis.
+ // While sending reconfigure message authentication field
/// shall contain MD5 hash computed using this key.
AuthKey key_;
- /// @brief HostID (a unique identifier assigned when the host is stored in
};
/// @brief Pointer to the @c Host object.
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
+ /// @brief Returns IPv6 leases for the DUID.
+ ///
+ /// @todo: implement an optimised of the query using index.
+ /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
+ virtual Lease6Collection getLeases6(const DUID& duid) const;
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
/// @brief Maximum length of keys.
const size_t KEY_LEN = 16;
-/// @brief Numeric value representing last supported identifier.
/// @brief Numeric value representing last supported identifier.
///
/// This value is used to validate whether the identifier type stored in
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
+ /// @brief Returns all IPv6 leases for the DUID.
+ ///
+ /// @todo: implement an optimised of the query using index.
+ /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID.
+ virtual Lease6Collection getLeases6(const DUID& duid) const;
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
/// @return Lease collection (may be empty if no IPv6 lease found).
virtual Lease6Collection getLeases6() const;
+ /// @brief Returns IPv6 leases for the DUID.
+ ///
+ /// @todo: implement an optimised of the query using index.
+ /// @return Lease collection (may be empty if no IPv6 lease found) for the DUID
+ virtual Lease6Collection getLeases6(const DUID& duid) const;
+
/// @brief Returns range of IPv6 leases using paging.
///
/// This method implements paged browsing of the lease database. The first
// This test verifies that expired leases are reclaimed before they are
// allocated to another client sending a Request message.
-//TEST_F(ExpirationAllocEngine6Test, reclaimReusedLeases) {
- // testReclaimReusedLeases(DHCPV6_REQUEST, false);
-//}
+/TEST_F(ExpirationAllocEngine6Test, reclaimReusedLeases) {
+ testReclaimReusedLeases(DHCPV6_REQUEST, false);
+}
// This test verifies that allocation engine detects that the expired
// lease has been reclaimed already when it reuses this lease.
}
} // end of anonymous namespace
-
-// Test verifies if
-- This line starts database upgrade to version 3.0
+-- This line adds auth_key column into host reservation table
+ALTER TABLE host_reservations ADD auth_key text;
+
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD user_context text;
ALTER TABLE lease6 ADD user_context text;
# This line concludes database upgrade to version 6.0.
+#add auth key in host tables
+ALTER TABLE hosts
+ ADD COLUMN auth_key VARCHAR(16) NULL;
+
# Add user context into tables holding leases
ALTER TABLE lease4 ADD COLUMN user_context TEXT NULL;
ALTER TABLE lease6 ADD COLUMN user_context TEXT NULL;
# Add user contexts into tables holding DHCP options
ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
-ALTER TABLE ipv6_reservations ADD COLUMN auth_key VARCHAR(128) NOT NULL;
# Create index for searching leases by subnet identifier.
CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
START TRANSACTION;
+-- Create auth_key in hosts table
+ALTER TABLE hosts ADD COLUMN auth_key VARCHAR(16) DEFAULT NULL;
+
-- Add a column holding leases for user context.
ALTER TABLE lease4 ADD COLUMN user_context TEXT;
ALTER TABLE lease6 ADD COLUMN user_context TEXT;