Skip to content

Commit

Permalink
detect/analyzer: add more details for flow_age
Browse files Browse the repository at this point in the history
Ticket: OISF#6312
  • Loading branch information
AkakiAlice committed Oct 22, 2024
1 parent 30806ce commit 4a1f9a3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rust/src/detect/tojson/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
7 changes: 7 additions & 0 deletions src/detect-engine-analyzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4a1f9a3

Please sign in to comment.