Commit 3606c3ba authored by mayya's avatar mayya Committed by Tomek Mrugalski
Browse files

fixed minor issues

parent f30ca446
......@@ -73,8 +73,7 @@ AuthKey::operator!=(const AuthKey& other) const {
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);
}
......
......@@ -696,6 +696,8 @@ private:
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_;
......@@ -710,15 +712,14 @@ private:
/// 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.
......
......@@ -312,6 +312,12 @@ public:
/// @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
......
......@@ -76,7 +76,6 @@ const size_t BOOT_FILE_NAME_MAX_LEN = 128;
/// @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
......
......@@ -309,6 +309,12 @@ public:
/// @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
......
......@@ -281,6 +281,12 @@ public:
/// @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
......
......@@ -1590,9 +1590,9 @@ TEST_F(ExpirationAllocEngine6Test, reclaimDeclinedStats) {
// 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.
......
......@@ -1285,5 +1285,3 @@ TEST(AuthKeyTest, basicTest) {
}
} // end of anonymous namespace
// Test verifies if
......@@ -276,6 +276,9 @@ INSERT INTO schema_version (version, minor) VALUES(2, 0);
-- 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;
......
......@@ -679,6 +679,10 @@ SET version = '6', minor = '0';
# 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;
......
......@@ -23,7 +23,6 @@ ALTER TABLE hosts 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);
......
......@@ -19,6 +19,9 @@ psql "$@" >/dev/null <<EOF
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment