]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2918] added more log messages
authorRazvan Becheriu <razvan@isc.org>
Fri, 6 Oct 2023 13:16:14 +0000 (16:16 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 6 Oct 2023 14:02:59 +0000 (17:02 +0300)
ChangeLog
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 2f6714f113dd5df0de128bbfb5d4addf7e3c9557..1a5fcb6e6c6fb83a5f95aa3ca821338a893c143d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2185.  [func]          razvan
+       Added extended log messages: DHCP4_DISCOVER, DHCP4_REQUEST,
+       DHCP6_PROCESS_IA_NA_SOLICIT, DHCP6_PROCESS_IA_PD_SOLICIT, which
+       include the hint address in the client request. The log message
+       tag DHCP4_LEASE_ADVERT has been renamed to DHCP4_LEASE_OFFER.
+       (Gitlab #2918)
+
 2184.  [bug]           razvan
        Fixed a bug in evaluated expression parser which was not propelry
        handling escaped null characters.
index 94d208ea851e1a3ddc36e11a417e4f75c81bd6ca..091a822628d55811051e0272182793fdd361a0d6 100644 (file)
@@ -133,8 +133,10 @@ extern const isc::log::MessageID DHCP6_PD_LEASE_REUSE = "DHCP6_PD_LEASE_REUSE";
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_EXTEND = "DHCP6_PROCESS_IA_NA_EXTEND";
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_RELEASE = "DHCP6_PROCESS_IA_NA_RELEASE";
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST = "DHCP6_PROCESS_IA_NA_REQUEST";
+extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_SOLICIT = "DHCP6_PROCESS_IA_NA_SOLICIT";
 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_PROCESS_IA_PD_SOLICIT = "DHCP6_PROCESS_IA_PD_SOLICIT";
 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";
@@ -304,8 +306,10 @@ const char* values[] = {
     "DHCP6_PROCESS_IA_NA_EXTEND", "%1: extending lease lifetime for IA_NA option with iaid=%2",
     "DHCP6_PROCESS_IA_NA_RELEASE", "%1: releasing lease for IA_NA option with iaid=%2",
     "DHCP6_PROCESS_IA_NA_REQUEST", "%1: server is processing IA_NA option with iaid=%2 and hint=%3",
+    "DHCP6_PROCESS_IA_NA_SOLICIT", "%1: server is processing IA_NA option with iaid=%2 and hint=%3",
     "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_PROCESS_IA_PD_SOLICIT", "%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",
index 26b9f108cbd9d2422ed55ee68e08b15c1bbda4b8..88e86e7c9a0764cf79b892c3fcb340d4a9e7a845 100644 (file)
@@ -134,8 +134,10 @@ extern const isc::log::MessageID DHCP6_PD_LEASE_REUSE;
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_EXTEND;
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_RELEASE;
 extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST;
+extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_SOLICIT;
 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_PROCESS_IA_PD_SOLICIT;
 extern const isc::log::MessageID DHCP6_QUERY_DATA;
 extern const isc::log::MessageID DHCP6_QUERY_LABEL;
 extern const isc::log::MessageID DHCP6_RAPID_COMMIT;
index 80e0d008a6c4086c764aab61c7a096915dccf340..4ddbd27da57f08ff8a712c468ac87f8a2ca5ac82 100644 (file)
@@ -782,6 +782,15 @@ about the address that the client would like to have allocated.
 If there is no hint, the argument should provide the text indicating
 that the hint hasn't been sent.
 
+% DHCP6_PROCESS_IA_NA_SOLICIT %1: server is processing IA_NA option with iaid=%2 and hint=%3
+This is a debug message that indicates the processing of a received
+IA_NA option. The first argument contains the client and the transaction
+identification information. The second argument holds the IAID of the
+IA_NA option. The third argument may hold the hint for the server
+about the address that the client would like to have allocated.
+If there is no hint, the argument should provide the text indicating
+that the hint hasn't been sent.
+
 % DHCP6_PROCESS_IA_PD_EXTEND %1: extending lease lifetime for IA_PD option with iaid=%2
 This message is logged when the server is starting to extend the lifetime
 of the prefix lease associated with the particular IAID. The first argument
@@ -797,6 +806,15 @@ about the prefix that the client would like to have allocated.
 If there is no hint, the argument should provide the text indicating
 that the hint hasn't been sent.
 
+% DHCP6_PROCESS_IA_PD_SOLICIT %1: server is processing IA_PD option with iaid=%2 and hint=%3
+This is a debug message that indicates a processing of received IA_PD
+option. The first argument contains the client and the transaction
+identification information. The second argument holds the IAID of the
+IA_PD option. The third argument may hold the hint for the server
+about the prefix that the client would like to have allocated.
+If there is no hint, the argument should provide the text indicating
+that the hint hasn't been sent.
+
 % DHCP6_QUERY_DATA %1, packet details: %2
 A debug message printing the details of the received packet. The first
 argument includes the client and the transaction identification
index 29fa2df6a288416e7b1b4a544f5ff940a3934815..8bf504541ab807f6b3fb6eceb79743a70b87d265 100644 (file)
@@ -2340,10 +2340,17 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query,
         hint = hint_opt->getAddress();
     }
 
-    LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST)
-        .arg(query->getLabel())
-        .arg(ia->getIAID())
-        .arg(hint_opt ? hint.toText() : "(no hint)");
+    if (ctx.fake_allocation_) {
+        LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_SOLICIT)
+            .arg(query->getLabel())
+            .arg(ia->getIAID())
+            .arg(hint_opt ? hint.toText() : "(no hint)");
+    } else {
+        LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST)
+            .arg(query->getLabel())
+            .arg(ia->getIAID())
+            .arg(hint_opt ? hint.toText() : "(no hint)");
+    }
 
     // convenience values
     const Subnet6Ptr& subnet = ctx.subnet_;
@@ -2474,10 +2481,17 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query,
         hint = hint_opt->getAddress();
     }
 
-    LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST)
-        .arg(query->getLabel())
-        .arg(ia->getIAID())
-        .arg(hint_opt ? hint.toText() : "(no hint)");
+    if (ctx.fake_allocation_) {
+        LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_SOLICIT)
+            .arg(query->getLabel())
+            .arg(ia->getIAID())
+            .arg(hint_opt ? hint.toText() : "(no hint)");
+    } else {
+        LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST)
+            .arg(query->getLabel())
+            .arg(ia->getIAID())
+            .arg(hint_opt ? hint.toText() : "(no hint)");
+    }
 
     const Subnet6Ptr& subnet = ctx.subnet_;