Skip to content

rust/ffi: add flow lifecycle callback wrappers - v13 #15334

Open
jasonish wants to merge 5 commits intoOISF:mainfrom
jasonish:suricata-ffi/v13
Open

rust/ffi: add flow lifecycle callback wrappers - v13 #15334
jasonish wants to merge 5 commits intoOISF:mainfrom
jasonish:suricata-ffi/v13

Conversation

@jasonish
Copy link
Copy Markdown
Member

@jasonish jasonish commented May 7, 2026

From my FFI backlog, add nice Rust wrappers around the flow lifecycle
callbacks.

Ticket: https://redmine.openinfosecfoundation.org/issues/8446

Remaining in the backlog:

  • flow storage api
  • thread storage api
  • accessors for flow and packet

Previous PR: #15318

Changes from previous PR:

  • Address review comments
  • Rebase

jasonish added 5 commits May 7, 2026 15:28
Provide Rust friendly callback registrations for flow init, update and finish events. These
callbacks are implemented as Rust closures.

Ticket: OISF#8446
Document for C and Rust, as the C documentation was missing.

Ticket: OISF#8446
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

Codecov Report

❌ Patch coverage is 0% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.61%. Comparing base (899e9f0) to head (b8053a9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15334      +/-   ##
==========================================
- Coverage   82.64%   82.61%   -0.04%     
==========================================
  Files         995      996       +1     
  Lines      271075   271135      +60     
==========================================
- Hits       224042   224002      -40     
- Misses      47033    47133     +100     
Flag Coverage Δ
fuzzcorpus 61.02% <0.00%> (-0.02%) ⬇️
livemode 18.37% <0.00%> (-0.02%) ⬇️
netns 22.57% <0.00%> (-0.04%) ⬇️
pcap 45.16% <0.00%> (-0.10%) ⬇️
suricata-verify 66.35% <0.00%> (-0.04%) ⬇️
unittests 58.55% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link
Copy Markdown

WARNING:

field baseline test %
TREX_GENERIC_stats_chk
.tcp.pkt_on_wrong_thread 0 1771 -
.tcp.ack_unseen_data 151972 159309 104.83%
.tcp.memuse 1824000000 912000000 50.0%
.tcp.reassembly_memuse 2409568 1186640 49.25%
.flow.tcp_reuse 0 44 -
.flow.end.tcp_state.syn_sent 0 44 -
.flow.end.tcp_state.fin_wait2 0 2 -
.flow.end.tcp_state.time_wait 0 31 -
.flow.end.tcp_state.last_ack 0 8 -
.flow.end.tcp_state.close_wait 0 43 -
.app_layer.flow.ftp-data 0 - -
.app_layer.flow.bittorrent-dht 0 - -
.app_layer.error.smtp.gap 0 3 -
.app_layer.error.ftp-data.alloc 0 - -
.app_layer.error.ftp-data.parser 0 - -
.app_layer.error.ftp-data.internal 0 - -
.app_layer.error.bittorrent-dht.alloc 0 - -
.app_layer.error.bittorrent-dht.parser 0 - -
.app_layer.error.bittorrent-dht.internal 0 - -
.app_layer.tx.ftp-data 0 - -
.app_layer.tx.bittorrent-dht 0 - -
.app_layer.flow.ftp_data - 0 -
.app_layer.flow.bittorrent_dht - 0 -
.app_layer.error.ftp_data.gap - 0 -
.app_layer.error.ftp_data.alloc - 0 -
.app_layer.error.ftp_data.parser - 0 -
.app_layer.error.ftp_data.internal - 0 -
.app_layer.error.bittorrent_dht.alloc - 0 -
.app_layer.error.bittorrent_dht.parser - 0 -
.app_layer.error.bittorrent_dht.internal - 0 -
.app_layer.tx.ftp_data - 0 -
.app_layer.tx.bittorrent_dht - 0 -

Pipeline = 31276

@victorjulien
Copy link
Copy Markdown
Member

I see 0% coverage for the PR, can we run some meaningful test in one of the cov enabled CI jobs?

@victorjulien victorjulien added this to the 9.0 milestone May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants