]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3140] [4156] Made skeleton
authorFrancis Dupont <fdupont@isc.org>
Thu, 16 Oct 2025 14:24:37 +0000 (16:24 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 5 Nov 2025 21:46:17 +0000 (22:46 +0100)
changelog_unreleased/4156-add-drop-stats-rfc-violation [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/4156-add-drop-stats-rfc-violation b/changelog_unreleased/4156-add-drop-stats-rfc-violation
new file mode 100644 (file)
index 0000000..cd190b1
--- /dev/null
@@ -0,0 +1,5 @@
+[func]         fdupont
+       Added "pkt4-rfc-violation" and "pkt6-rfc-violation"
+       statistics which are increased when an incoming packet
+       has to be dropped according to protocol specifications.
+       (Gitlab #4156)
index d0646785dce5212233777e6ed28610b3b0de9f84..2ed8401e6da4dab1c1460f9e450ff014d09be2c6 100644 (file)
@@ -7407,6 +7407,10 @@ The DHCPv4 server supports the following statistics:
    |                                                    |                | were dropped when the queue they   |
    |                                                    |                | were parked became full.           |
    +----------------------------------------------------+----------------+------------------------------------+
+   | pkt4-rfc-violation                                 | integer        | Number of incoming packets that    |
+   |                                                    |                | were dropped following protocol    |
+   |                                                    |                | specifications.                    |
+   +----------------------------------------------------+----------------+------------------------------------+
    | pkt4-receive-drop                                  | integer        | Number of incoming packets that    |
    |                                                    |                | were dropped. The exact reason for |
    |                                                    |                | dropping packets is logged, but    |
@@ -7814,6 +7818,8 @@ a second counter detailing the drop cause:
 
 - ``pkt4-queue-full`` - parked packet in a queue which became full
 
+- ``pkt4-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them)
+
 .. note::
 
    The pool ID can be configured on each pool by explicitly setting the ``pool-id``
index e220310da3d6ec2167a9a7758449ab2333cbc7df..067c778b6051cde15a561df0491a40e8e82712f2 100644 (file)
@@ -6982,6 +6982,10 @@ The DHCPv6 server supports the following statistics:
    |                                                   |                | were dropped when the queue they   |
    |                                                   |                | were parked became full.           |
    +---------------------------------------------------+----------------+------------------------------------+
+   | pkt6-rfc-violation                                | integer        | Number of incoming packets that    |
+   |                                                   |                | were dropped following protocol    |
+   |                                                   |                | specifications.                    |
+   +---------------------------------------------------+----------------+------------------------------------+
    | pkt6-solicit-received                             | integer        | Number of SOLICIT packets          |
    |                                                   |                | received. This statistic is        |
    |                                                   |                | expected to grow; its increase     |
@@ -7709,6 +7713,8 @@ a second counter detailing the drop cause:
 
 - ``pkt6-queue-full`` - parked packet in a queue which became full
 
+- ``pkt6-rfc-violation`` - RFC violation (i.e. protocol specs instruct to drop them)
+
 .. note::
 
    The pool ID can be configured on each pool by explicitly setting the ``pool-id``
index 5f57a4ff5d9cc8fccc6189700a80b408e29d2a81..5c1ab4d6088ac7ff49cad6191e58b364f8ab9874 100644 (file)
@@ -334,6 +334,12 @@ Here is an example response returning all collected statistics:
                    "2023-06-13 20:42:46.616343"
                ]
            ],
+           "pkt4-rfc-violation": [
+               [
+                   0,
+                   "2023-06-13 20:42:46.616351"
+               ]
+           ],
            "pkt4-sent": [
                [
                    0,
@@ -657,6 +663,12 @@ or
                    "2023-06-13 21:28:57.177747"
                ]
            ],
+           "pkt6-rfc-violation": [
+               [
+                   0,
+                   "2023-06-13 21:28:57.177747"
+               ]
+           ],
            "pkt6-sent": [
                [
                    0,
@@ -1080,6 +1092,12 @@ Here is an example response returning all collected statistics:
                    "2023-06-13 20:42:46.616343"
                ]
            ],
+           "pkt4-rfc-violation": [
+               [
+                   0,
+                   "2023-06-13 20:42:46.616351"
+               ]
+           ],
            "pkt4-sent": [
                [
                    0,
@@ -1319,6 +1337,12 @@ or
                    "2023-06-13 21:28:57.177747"
                ]
            ],
+           "pkt6-rfc-violation": [
+               [
+                   0,
+                   "2023-06-13 21:28:57.177747"
+               ]
+           ],
            "pkt6-sent": [
                [
                    0,
index 8609f1d215fc266fb3237a49c3018d714fa53124..87d362f613a056bf75549584ebf1ae6dde962027 100644 (file)
@@ -184,6 +184,7 @@ std::set<std::string> dhcp4_statistics = {
     "pkt4-service-disabled",
     "pkt4-parse-failed",
     "pkt4-queue-full",
+    "pkt4-rfc-violation",
     "pkt4-receive-drop",
     "v4-allocation-fail",
     "v4-allocation-fail-shared-network",
index de742efb5b9b028fb334b0c666885afaa606a8c1..1f79c469ce53b94fe308d20436d16ebcf618a010 100644 (file)
@@ -631,6 +631,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, controlChannelStats) {
         "pkt4-service-disabled",
         "pkt4-parse-failed",
         "pkt4-queue-full",
+        "pkt4-rfc-violation",
         "pkt4-receive-drop",
         "v4-allocation-fail",
         "v4-allocation-fail-shared-network",
index 12971db05bea8fd3af80812619ca868b4bdc7e47..cc25dd08b1359d7ed30dc533501679711653645e 100644 (file)
@@ -942,6 +942,7 @@ BaseCtrlChannelDhcpv4Test::testControlChannelStats() {
         "pkt4-service-disabled",
         "pkt4-parse-failed",
         "pkt4-queue-full",
+        "pkt4-rfc-violation",
         "pkt4-receive-drop",
         "v4-allocation-fail",
         "v4-allocation-fail-shared-network",
index 493a59ea8c8b09db4d290ea31c4bf1795020d72c..a542f20e4540203263d1bd6515e352ed5c1509e7 100644 (file)
@@ -244,6 +244,7 @@ std::set<std::string> dhcp6_statistics = {
     "pkt6-service-disabled",
     "pkt6-parse-failed",
     "pkt6-queue-full",
+    "pkt6-rfc-violation",
     "pkt6-receive-drop",
     "v6-allocation-fail",
     "v6-allocation-fail-shared-network",
index bb91daeef1ce780e39d64fc72e93ce1363d86e4e..2d280247dfa9ee325673d91bd0478e44d5d0c17c 100644 (file)
@@ -639,6 +639,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, controlChannelStats) {
         "pkt6-service-disabled",
         "pkt6-parse-failed",
         "pkt6-queue-full",
+        "pkt6-rfc-violation",
         "pkt6-receive-drop",
         "v6-allocation-fail",
         "v6-allocation-fail-shared-network",
index 5c9b4a7f439a478bd7a6a310713c03cc13f247a8..bf25a6bb0b3f3b9e3eb142e0fc21db9fb9408127 100644 (file)
@@ -957,6 +957,7 @@ BaseCtrlChannelDhcpv6Test::testControlChannelStats() {
         "pkt6-service-disabled",
         "pkt6-parse-failed",
         "pkt6-queue-full",
+        "pkt6-rfc-violation",
         "pkt6-receive-drop",
         "v6-allocation-fail",
         "v6-allocation-fail-shared-network",