summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2020-06-17 09:26:00 +0200
committerFrancis Dupont <fdupont@isc.org>2020-07-06 15:05:13 +0200
commit44e0cf8d2c3d49f99fdcd5218d5d71558b0a389b (patch)
treee2ae6604fb69a8d0ca2fd9da55203105b907b420 /src/lib/dhcpsrv
parent[#996] Fixed previous entry grammar (diff)
downloadkea-44e0cf8d2c3d49f99fdcd5218d5d71558b0a389b.tar.xz
kea-44e0cf8d2c3d49f99fdcd5218d5d71558b0a389b.zip
[#1247] Checkpoint: fixed for audit entries
Diffstat (limited to 'src/lib/dhcpsrv')
-rw-r--r--src/lib/dhcpsrv/config_backend_dhcp4.h7
-rw-r--r--src/lib/dhcpsrv/config_backend_dhcp6.h7
-rw-r--r--src/lib/dhcpsrv/config_backend_pool_dhcp4.cc7
-rw-r--r--src/lib/dhcpsrv/config_backend_pool_dhcp4.h7
-rw-r--r--src/lib/dhcpsrv/config_backend_pool_dhcp6.cc7
-rw-r--r--src/lib/dhcpsrv/config_backend_pool_dhcp6.h7
-rw-r--r--src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc4
-rw-r--r--src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc5
-rw-r--r--src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.h7
-rw-r--r--src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc5
-rw-r--r--src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.h7
11 files changed, 46 insertions, 24 deletions
diff --git a/src/lib/dhcpsrv/config_backend_dhcp4.h b/src/lib/dhcpsrv/config_backend_dhcp4.h
index c958274587..4f8ee608e9 100644
--- a/src/lib/dhcpsrv/config_backend_dhcp4.h
+++ b/src/lib/dhcpsrv/config_backend_dhcp4.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -301,10 +301,13 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const = 0;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const = 0;
/// @brief Retrieves all servers.
///
diff --git a/src/lib/dhcpsrv/config_backend_dhcp6.h b/src/lib/dhcpsrv/config_backend_dhcp6.h
index 5f8ec3d1e9..b11056e55e 100644
--- a/src/lib/dhcpsrv/config_backend_dhcp6.h
+++ b/src/lib/dhcpsrv/config_backend_dhcp6.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -302,10 +302,13 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const = 0;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const = 0;
/// @brief Retrieves all servers.
///
diff --git a/src/lib/dhcpsrv/config_backend_pool_dhcp4.cc b/src/lib/dhcpsrv/config_backend_pool_dhcp4.cc
index cf09452020..cc2fb2b315 100644
--- a/src/lib/dhcpsrv/config_backend_pool_dhcp4.cc
+++ b/src/lib/dhcpsrv/config_backend_pool_dhcp4.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -204,11 +204,12 @@ AuditEntryCollection
ConfigBackendPoolDHCPv4::
getRecentAuditEntries(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const {
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const {
AuditEntryCollection audit_entries;
getMultiplePropertiesConst<AuditEntryCollection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv4::getRecentAuditEntries, backend_selector,
- server_selector, audit_entries, modification_time);
+ server_selector, audit_entries, modification_time, modification_id);
return (audit_entries);
}
diff --git a/src/lib/dhcpsrv/config_backend_pool_dhcp4.h b/src/lib/dhcpsrv/config_backend_pool_dhcp4.h
index 56497be43d..8e6ba8b725 100644
--- a/src/lib/dhcpsrv/config_backend_pool_dhcp4.h
+++ b/src/lib/dhcpsrv/config_backend_pool_dhcp4.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -227,11 +227,14 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const;
/// @brief Retrieves all servers from the particular backend.
///
diff --git a/src/lib/dhcpsrv/config_backend_pool_dhcp6.cc b/src/lib/dhcpsrv/config_backend_pool_dhcp6.cc
index d36afbd1c7..0539bc8697 100644
--- a/src/lib/dhcpsrv/config_backend_pool_dhcp6.cc
+++ b/src/lib/dhcpsrv/config_backend_pool_dhcp6.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -204,11 +204,12 @@ AuditEntryCollection
ConfigBackendPoolDHCPv6::
getRecentAuditEntries(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const {
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const {
AuditEntryCollection audit_entries;
getMultiplePropertiesConst<AuditEntryCollection, const boost::posix_time::ptime&>
(&ConfigBackendDHCPv6::getRecentAuditEntries, backend_selector,
- server_selector, audit_entries, modification_time);
+ server_selector, audit_entries, modification_time, modification_id);
return (audit_entries);
}
diff --git a/src/lib/dhcpsrv/config_backend_pool_dhcp6.h b/src/lib/dhcpsrv/config_backend_pool_dhcp6.h
index c79bb44abd..2765acb9a2 100644
--- a/src/lib/dhcpsrv/config_backend_pool_dhcp6.h
+++ b/src/lib/dhcpsrv/config_backend_pool_dhcp6.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -226,11 +226,14 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::BackendSelector& backend_selector,
const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const;
/// @brief Retrieves all servers from the particular backend.
///
diff --git a/src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc b/src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc
index fac44f8163..bd94ce325c 100644
--- a/src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc
+++ b/src/lib/dhcpsrv/tests/cb_ctl_dhcp_unittest.cc
@@ -70,7 +70,7 @@ public:
void addCreateAuditEntry(const std::string& object_type) {
AuditEntryPtr entry(new AuditEntry(object_type, 1234,
AuditEntry::ModificationType::CREATE,
- "some log message"));
+ 2345, "some log message"));
audit_entries_.insert(entry);
}
@@ -86,7 +86,7 @@ public:
const uint64_t object_id) {
AuditEntryPtr entry(new AuditEntry(object_type, object_id,
AuditEntry::ModificationType::DELETE,
- "some log message"));
+ 1234, "some log message"));
audit_entries_.insert(entry);
}
diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc
index edf2ea6f2f..0cbe3dd38c 100644
--- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc
+++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -511,7 +511,8 @@ TestConfigBackendDHCPv4::getModifiedGlobalParameters4(const db::ServerSelector&
AuditEntryCollection
TestConfigBackendDHCPv4::getRecentAuditEntries(const db::ServerSelector&,
- const boost::posix_time::ptime&) const {
+ const boost::posix_time::ptime&,
+ const uint64_t&) const {
return (AuditEntryCollection());
}
diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.h b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.h
index 20cde9869f..fcda52b148 100644
--- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.h
+++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -220,10 +220,13 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const;
/// @brief Retrieves all servers.
///
diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc
index 69b10d56f5..3cdf001334 100644
--- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc
+++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -510,7 +510,8 @@ TestConfigBackendDHCPv6::getModifiedGlobalParameters6(const db::ServerSelector&
AuditEntryCollection
TestConfigBackendDHCPv6::getRecentAuditEntries(const db::ServerSelector&,
- const boost::posix_time::ptime&) const {
+ const boost::posix_time::ptime&,
+ const uint64_t&) const {
return (AuditEntryCollection());
}
diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.h b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.h
index e598df977a..9a1d25a106 100644
--- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.h
+++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.h
@@ -1,4 +1,4 @@
-// Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2019-2020 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -220,10 +220,13 @@ public:
/// @param server_selector Server selector.
/// @param modification_time Timestamp being a lower limit for the returned
/// result set, i.e. entries later than specified time are returned.
+ /// @param modification_id Identifier being a lower limit for the returned
+ /// result set, used when two (or more) entries have modification_time.
/// @return Collection of audit entries.
virtual db::AuditEntryCollection
getRecentAuditEntries(const db::ServerSelector& server_selector,
- const boost::posix_time::ptime& modification_time) const;
+ const boost::posix_time::ptime& modification_time,
+ const uint64_t& modification_id) const;
/// @brief Retrieves all servers.
///