]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2854] Added DHCPx_QUERY_LABEL
authorFrancis Dupont <fdupont@isc.org>
Thu, 3 Aug 2023 15:13:17 +0000 (17:13 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 22 Aug 2023 19:10:30 +0000 (21:10 +0200)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_srv.cc

index 7e461864c9da5ce43cf9b0869087da30d98192a5..1c6591b33c1bdadbe0f961d6f1c1e14aabfdbc1b 100644 (file)
@@ -140,6 +140,7 @@ extern const isc::log::MessageID DHCP4_PARSER_EXCEPTION = "DHCP4_PARSER_EXCEPTIO
 extern const isc::log::MessageID DHCP4_PARSER_FAIL = "DHCP4_PARSER_FAIL";
 extern const isc::log::MessageID DHCP4_POST_ALLOCATION_NAME_UPDATE_FAIL = "DHCP4_POST_ALLOCATION_NAME_UPDATE_FAIL";
 extern const isc::log::MessageID DHCP4_QUERY_DATA = "DHCP4_QUERY_DATA";
+extern const isc::log::MessageID DHCP4_QUERY_LABEL = "DHCP4_QUERY_LABEL";
 extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_FAIL = "DHCP4_RECLAIM_EXPIRED_LEASES_FAIL";
 extern const isc::log::MessageID DHCP4_RELEASE = "DHCP4_RELEASE";
 extern const isc::log::MessageID DHCP4_RELEASE_DELETED = "DHCP4_RELEASE_DELETED";
@@ -311,6 +312,7 @@ const char* values[] = {
     "DHCP4_PARSER_FAIL", "failed to create or run parser for configuration element %1: %2",
     "DHCP4_POST_ALLOCATION_NAME_UPDATE_FAIL", "%1: failed to update hostname %2 in a lease after address allocation: %3",
     "DHCP4_QUERY_DATA", "%1, packet details: %2",
+    "DHCP4_QUERY_LABEL", "received query: %1",
     "DHCP4_RECLAIM_EXPIRED_LEASES_FAIL", "failed to reclaim expired leases: %1",
     "DHCP4_RELEASE", "%1: address %2 was released properly.",
     "DHCP4_RELEASE_DELETED", "%1: address %2 was deleted on release.",
index 50a05d6d1f1ecc746b77e2d112d6e71fb613385d..95f46809f0165027528b634395c438d9e9f2f46c 100644 (file)
@@ -141,6 +141,7 @@ extern const isc::log::MessageID DHCP4_PARSER_EXCEPTION;
 extern const isc::log::MessageID DHCP4_PARSER_FAIL;
 extern const isc::log::MessageID DHCP4_POST_ALLOCATION_NAME_UPDATE_FAIL;
 extern const isc::log::MessageID DHCP4_QUERY_DATA;
+extern const isc::log::MessageID DHCP4_QUERY_LABEL;
 extern const isc::log::MessageID DHCP4_RECLAIM_EXPIRED_LEASES_FAIL;
 extern const isc::log::MessageID DHCP4_RELEASE;
 extern const isc::log::MessageID DHCP4_RELEASE_DELETED;
index 850b27563e9acb1ab36a34460d8665c0e9eae202..4ededface7651665f9fd57760f8d4ba61acdb226 100644 (file)
@@ -815,6 +815,10 @@ A debug message printing the details of the received packet. The first
 argument includes the client and the transaction identification
 information.
 
+% DHCP4_QUERY_LABEL received query: %1
+This information message indicates that a query was received. It displays
+the client and the transaction identification information.
+
 % DHCP4_RECLAIM_EXPIRED_LEASES_FAIL failed to reclaim expired leases: %1
 This error message indicates that the reclaim expired leases operation failed
 and provides the cause of failure.
index fd4221d66514b6c8c0c44cb9fda25cb7c31bd6ed..d9b1e8cc9cd1a7ae0c821f7df09230cbde024f8e 100644 (file)
@@ -1229,6 +1229,10 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) {
         }
     }
 
+    // Classify can emit INFO logs so help to track the query.
+    LOG_INFO(dhcp4_logger, DHCP4_QUERY_LABEL)
+        .arg(query->getLabel());
+
     // Update statistics accordingly for received packet.
     processStatsReceived(query);
 
index 6644071fa908353e963ad4f70dace2b4230bf0a8..76b9979a639f9c46568a1fa424760ccb715883e9 100644 (file)
@@ -135,6 +135,7 @@ extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST = "DHCP6_PROCESS_IA
 extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_EXTEND = "DHCP6_PROCESS_IA_PD_EXTEND";
 extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_REQUEST = "DHCP6_PROCESS_IA_PD_REQUEST";
 extern const isc::log::MessageID DHCP6_QUERY_DATA = "DHCP6_QUERY_DATA";
+extern const isc::log::MessageID DHCP6_QUERY_LABEL = "DHCP6_QUERY_LABEL";
 extern const isc::log::MessageID DHCP6_RAPID_COMMIT = "DHCP6_RAPID_COMMIT";
 extern const isc::log::MessageID DHCP6_RECLAIM_EXPIRED_LEASES_FAIL = "DHCP6_RECLAIM_EXPIRED_LEASES_FAIL";
 extern const isc::log::MessageID DHCP6_RELEASE_NA = "DHCP6_RELEASE_NA";
@@ -304,6 +305,7 @@ const char* values[] = {
     "DHCP6_PROCESS_IA_PD_EXTEND", "%1: extending lease lifetime for IA_PD option with iaid=%2",
     "DHCP6_PROCESS_IA_PD_REQUEST", "%1: server is processing IA_PD option with iaid=%2 and hint=%3",
     "DHCP6_QUERY_DATA", "%1, packet details: %2",
+    "DHCP6_QUERY_LABEL", "received query: %1",
     "DHCP6_RAPID_COMMIT", "%1: Rapid Commit option received, following 2-way exchange",
     "DHCP6_RECLAIM_EXPIRED_LEASES_FAIL", "failed to reclaim expired leases: %1",
     "DHCP6_RELEASE_NA", "%1: binding for address %2 and iaid=%3 was released properly",
index 82ab872972c6143e40b8676624163e121059a6cd..935a0107d0fdd210cf1eec5f206d6af3ace1d2d6 100644 (file)
@@ -136,6 +136,7 @@ extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST;
 extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_EXTEND;
 extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_REQUEST;
 extern const isc::log::MessageID DHCP6_QUERY_DATA;
+extern const isc::log::MessageID DHCP6_QUERY_LABEL;
 extern const isc::log::MessageID DHCP6_RAPID_COMMIT;
 extern const isc::log::MessageID DHCP6_RECLAIM_EXPIRED_LEASES_FAIL;
 extern const isc::log::MessageID DHCP6_RELEASE_NA;
index de4292ea3da10da341b2bd0d5c47176424e20bc9..2af69b194a56e7877b458abcea973956fbe681de 100644 (file)
@@ -795,6 +795,10 @@ A debug message printing the details of the received packet. The first
 argument includes the client and the transaction identification
 information.
 
+% DHCP6_QUERY_LABEL received query: %1
+This information message indicates that a query was received. It displays
+the client and the transaction identification information.
+
 % DHCP6_RAPID_COMMIT %1: Rapid Commit option received, following 2-way exchange
 This debug message is issued when the server found a Rapid Commit option
 in the client's message and 2-way exchanges are supported by the
index 58fd2f004c08aa1f673e7dfb51d833749bd373e4..6a467f55d4ba3dafb6a97be8f599d0c5613469ee 100644 (file)
@@ -816,6 +816,10 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) {
         }
     }
 
+    // Classify can emit INFO logs so help to track the query.
+    LOG_INFO(dhcp6_logger, DHCP6_QUERY_LABEL)
+        .arg(query->getLabel());
+
     // Update statistics accordingly for received packet.
     processStatsReceived(query);