]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/analyzer: add more details for flow_age
authorAlice Akaki <akakialice@gmail.com>
Tue, 22 Oct 2024 22:44:27 +0000 (18:44 -0400)
committerVictor Julien <victor@inliniac.net>
Thu, 24 Oct 2024 07:35:25 +0000 (09:35 +0200)
Ticket: #6312

rust/src/detect/tojson/mod.rs
src/detect-engine-analyzer.c

index 2c552bcfa0bcb6a026d2225aea2d828252179ca7..1a1f0cee80281705b69deb446b738f655751a81d 100644 (file)
@@ -77,3 +77,10 @@ pub unsafe extern "C" fn SCDetectU16ToJson(
 ) -> bool {
     return detect_uint_to_json(js, du).is_ok();
 }
+
+#[no_mangle]
+pub unsafe extern "C" fn SCDetectU32ToJson(
+    js: &mut JsonBuilder, du: &DetectUintData<u32>,
+) -> bool {
+    return detect_uint_to_json(js, du).is_ok();
+}
\ No newline at end of file
index 3d4d8991a32d69e541f45d13535129783cdb49c1..dcf3ce60a6a30f0adb717bcca549d4a281259fc4 100644 (file)
@@ -932,6 +932,13 @@ static void DumpMatches(RuleAnalyzer *ctx, JsonBuilder *js, const SigMatchData *
                 jb_close(js);
                 break;
             }
+            case DETECT_FLOW_AGE: {
+                const DetectU32Data *cd = (const DetectU32Data *)smd->ctx;
+                jb_open_object(js, "flow_age");
+                SCDetectU32ToJson(js, cd);
+                jb_close(js);
+                break;
+            }
         }
         jb_close(js);