Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect/analyzer: add more details for flow_age - v1 #12011

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading