]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3140] [4127] Checkpoint: skeleton done
authorFrancis Dupont <fdupont@isc.org>
Wed, 15 Oct 2025 10:51:15 +0000 (12:51 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 5 Nov 2025 21:46:17 +0000 (22:46 +0100)
changelog_unreleased/4127-add-drop-stats-admin-filtered [new file with mode: 0644]
doc/sphinx/arm/dhcp4-srv.rst
doc/sphinx/arm/dhcp6-srv.rst
doc/sphinx/arm/stats.rst
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc
src/bin/dhcp4/tests/http_control_socket_unittest.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc
src/bin/dhcp6/tests/http_control_socket_unittest.cc

diff --git a/changelog_unreleased/4127-add-drop-stats-admin-filtered b/changelog_unreleased/4127-add-drop-stats-admin-filtered
new file mode 100644 (file)
index 0000000..e416c42
--- /dev/null
@@ -0,0 +1,6 @@
+[func]         fdupont
+       Added "pkt4-admin-filtered" and "pkt6-admin-filtered"
+       statistics which are increased when an incoming packet
+       was dropped because the server was configured to do so,
+       e.g. by classifying the query into the DROP class.
+       (Gitlab #4127)
index 2ed8401e6da4dab1c1460f9e450ff014d09be2c6..4987774a0cb0b97fab5acbfa32697d2a45f4bd3a 100644 (file)
@@ -7411,6 +7411,12 @@ The DHCPv4 server supports the following statistics:
    |                                                    |                | were dropped following protocol    |
    |                                                    |                | specifications.                    |
    +----------------------------------------------------+----------------+------------------------------------+
+   | pkt4-admin-filtered                                | integer        | Number of incoming packets that    |
+   |                                                    |                | were dropped because the server    |
+   |                                                    |                | was configured to do so, e.g. by   |
+   |                                                    |                | classifying the query into the     |
+   |                                                    |                | ``DROP`` class.                    |
+   +----------------------------------------------------+----------------+------------------------------------+
    | pkt4-receive-drop                                  | integer        | Number of incoming packets that    |
    |                                                    |                | were dropped. The exact reason for |
    |                                                    |                | dropping packets is logged, but    |
@@ -7820,6 +7826,8 @@ a second counter detailing the drop cause:
 
 - ``pkt4-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them)
 
+- ``pkt4-admin-filtered`` - admin filtered out
+
 .. note::
 
    The pool ID can be configured on each pool by explicitly setting the ``pool-id``
index 067c778b6051cde15a561df0491a40e8e82712f2..1156a99eec6d29398eabab0848f357d4fe46bc2e 100644 (file)
@@ -6986,6 +6986,12 @@ The DHCPv6 server supports the following statistics:
    |                                                   |                | were dropped following protocol    |
    |                                                   |                | specifications.                    |
    +---------------------------------------------------+----------------+------------------------------------+
+   | pkt6-admin-filtered                               | integer        | Number of incoming packets that    |
+   |                                                   |                | were dropped because the server    |
+   |                                                   |                | was configured to do so, e.g. by   |
+   |                                                   |                | classifying the query into the     |
+   |                                                   |                | ``DROP`` class.                    |
+   +---------------------------------------------------+----------------+------------------------------------+
    | pkt6-solicit-received                             | integer        | Number of SOLICIT packets          |
    |                                                   |                | received. This statistic is        |
    |                                                   |                | expected to grow; its increase     |
@@ -7715,6 +7721,8 @@ a second counter detailing the drop cause:
 
 - ``pkt6-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them)
 
+- ``pkt6-admin-filtered`` - admin filtered out
+
 .. note::
 
    The pool ID can be configured on each pool by explicitly setting the ``pool-id``
index 5c1ab4d6088ac7ff49cad6191e58b364f8ab9874..32e8e458e21d3daf5c43e990ab907d7b1b215251 100644 (file)
@@ -256,6 +256,12 @@ Here is an example response returning all collected statistics:
                    "2023-06-13 20:42:46.616290"
                ]
            ],
+           "pkt4-admin-filtered": [
+               [
+                   0,
+                   "2023-06-13 20:42:46.616352"
+               ]
+           ],
            "pkt4-decline-received": [
                [
                    0,
@@ -561,6 +567,12 @@ or
                    "2023-06-13 21:28:57.177731"
                ]
            ],
+           "pkt6-admin-filtered": [
+               [
+                   0,
+                   "2023-06-13 21:28:57.177747"
+               ]
+           ],
            "pkt6-advertise-received": [
                [
                    0,
@@ -1014,6 +1026,12 @@ Here is an example response returning all collected statistics:
                    "2023-06-13 20:42:46.616290"
                ]
            ],
+           "pkt4-admin-filtered": [
+               [
+                   0,
+                   "2023-06-13 20:42:46.616352"
+               ]
+           ],
            "pkt4-decline-received": [
                [
                    0,
@@ -1235,6 +1253,12 @@ or
                    "2023-06-13 21:28:57.177731"
                ]
            ],
+           "pkt6-admin-filtered": [
+               [
+                   0,
+                   "2023-06-13 21:28:57.177747"
+               ]
+           ],
            "pkt6-advertise-received": [
                [
                    0,
index 87d362f613a056bf75549584ebf1ae6dde962027..5667d529e3bd86cc1901a476aa6c17581ab9a075 100644 (file)
@@ -185,6 +185,7 @@ std::set<std::string> dhcp4_statistics = {
     "pkt4-parse-failed",
     "pkt4-queue-full",
     "pkt4-rfc-violation",
+    "pkt4-admin-filtered",
     "pkt4-receive-drop",
     "v4-allocation-fail",
     "v4-allocation-fail-shared-network",
index 1f79c469ce53b94fe308d20436d16ebcf618a010..649759cc6b1e9f57125a3b26edb9d21e2d7cce16 100644 (file)
@@ -632,6 +632,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, controlChannelStats) {
         "pkt4-parse-failed",
         "pkt4-queue-full",
         "pkt4-rfc-violation",
+        "pkt4-admin-filtered",
         "pkt4-receive-drop",
         "v4-allocation-fail",
         "v4-allocation-fail-shared-network",
index cc25dd08b1359d7ed30dc533501679711653645e..409c60a4296b30f4f3878d22c1ecfb4fef52694a 100644 (file)
@@ -943,6 +943,7 @@ BaseCtrlChannelDhcpv4Test::testControlChannelStats() {
         "pkt4-parse-failed",
         "pkt4-queue-full",
         "pkt4-rfc-violation",
+        "pkt4-admin-filtered",
         "pkt4-receive-drop",
         "v4-allocation-fail",
         "v4-allocation-fail-shared-network",
index a542f20e4540203263d1bd6515e352ed5c1509e7..06a0fd92f293af1add7bddf2f428c2e7712d3f72 100644 (file)
@@ -245,6 +245,7 @@ std::set<std::string> dhcp6_statistics = {
     "pkt6-parse-failed",
     "pkt6-queue-full",
     "pkt6-rfc-violation",
+    "pkt6-admin-filtered",
     "pkt6-receive-drop",
     "v6-allocation-fail",
     "v6-allocation-fail-shared-network",
index 2d280247dfa9ee325673d91bd0478e44d5d0c17c..6e1bae02c958cfc82adf6d291b978d7c4064e3cc 100644 (file)
@@ -640,6 +640,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelStats) {
         "pkt6-parse-failed",
         "pkt6-queue-full",
         "pkt6-rfc-violation",
+        "pkt6-admin-filtered",
         "pkt6-receive-drop",
         "v6-allocation-fail",
         "v6-allocation-fail-shared-network",
index bf25a6bb0b3f3b9e3eb142e0fc21db9fb9408127..ed3dda3d95a0e521672cda2ad85ae58757ac65e0 100644 (file)
@@ -955,9 +955,9 @@ BaseCtrlChannelDhcpv6Test::testControlChannelStats() {
         "pkt6-dhcpv4-response-sent",
         "pkt6-addr-reg-reply-sent",
         "pkt6-service-disabled",
-        "pkt6-parse-failed",
         "pkt6-queue-full",
         "pkt6-rfc-violation",
+        "pkt6-admin-filtered",
         "pkt6-receive-drop",
         "v6-allocation-fail",
         "v6-allocation-fail-shared-network",