From: Francis Dupont Date: Thu, 3 Aug 2023 15:13:17 +0000 (+0200) Subject: [#2854] Added DHCPx_QUERY_LABEL X-Git-Tag: Kea-2.5.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a84fc106dd9a28d5da0006818bc8a36a40e6223;p=thirdparty%2Fkea.git [#2854] Added DHCPx_QUERY_LABEL --- diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc index 7e461864c9..1c6591b33c 100644 --- a/src/bin/dhcp4/dhcp4_messages.cc +++ b/src/bin/dhcp4/dhcp4_messages.cc @@ -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.", diff --git a/src/bin/dhcp4/dhcp4_messages.h b/src/bin/dhcp4/dhcp4_messages.h index 50a05d6d1f..95f46809f0 100644 --- a/src/bin/dhcp4/dhcp4_messages.h +++ b/src/bin/dhcp4/dhcp4_messages.h @@ -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; diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 850b27563e..4ededface7 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -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. diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index fd4221d665..d9b1e8cc9c 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -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); diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc index 6644071fa9..76b9979a63 100644 --- a/src/bin/dhcp6/dhcp6_messages.cc +++ b/src/bin/dhcp6/dhcp6_messages.cc @@ -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", diff --git a/src/bin/dhcp6/dhcp6_messages.h b/src/bin/dhcp6/dhcp6_messages.h index 82ab872972..935a0107d0 100644 --- a/src/bin/dhcp6/dhcp6_messages.h +++ b/src/bin/dhcp6/dhcp6_messages.h @@ -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; diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index de4292ea3d..2af69b194a 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -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 diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 58fd2f004c..6a467f55d4 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -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);