Project

General

Profile

Actions

Optimization #7762

closed
PA PA

rust: finish moving extern C definitions to suricata_sys and bindgen

Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgen

Added by Philippe Antoine 10 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Target version:
Effort:
Difficulty:
Label:


Related issues 5 (4 open1 closed)

Related to Suricata - Optimization #4517: cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and CAssignedOISF DevActions
Blocks Suricata - Feature #7666: rust: zero-dependency crate suricata-ffiIn ProgressPhilippe AntoineActions
Blocks Suricata - Optimization #4747: app-layer: make tx iterator a mandatory part of the APIAssignedOISF DevActions
Copied from Suricata - Bug #7667: rust: move extern C definitions to suricata_sys and bindgenClosedPhilippe AntoineActions
Copied to Suricata - Optimization #8187: rust: move extern C definition to suricata-lua-sys and bindgenAssignedJason IshActions

PA Updated by Philippe Antoine 10 months ago Actions #1

  • Copied from Bug #7667: rust: move extern C definitions to suricata_sys and bindgen added

PA Updated by Philippe Antoine 10 months ago Actions #2

applayer.rs and frames.rs share the same problem : we want to bindgen a C function like `AppLayerFrameNewByRelativeOffset` which uses as argument of type `StreamSlice` which is defined in rust

This is going to be the difficult part.
There are some easier things to do first

PA Updated by Philippe Antoine 10 months ago Actions #3

  • Blocks Feature #7666: rust: zero-dependency crate suricata-ffi added

PA Updated by Philippe Antoine 9 months ago Actions #4

  • Tracker changed from Bug to Optimization

PA Updated by Philippe Antoine 9 months ago Actions #5

  • Related to Optimization #4517: cbindgen export the constants from Rust to C, also for macro such as BIT_U8(1), and remove duplicate definitions between rust and C added

PA Updated by Philippe Antoine 7 months ago Actions #6

Goal : make
git grep 'extern "C" {' rust/src/
return nothing

PA Updated by Philippe Antoine 4 months ago Actions #7

AppLayerRegisterParser difficulty is that AppLayerParserFPtr uses StreamSlice as an argument and it is defined in rust...

PA Updated by Philippe Antoine 4 months ago ยท Edited Actions #8

Philippe Antoine wrote in #note-7:

AppLayerRegisterParser difficulty is that AppLayerParserFPtr uses StreamSlice as an argument and it is defined in rust...

Solutions :
- move StreamSlice definition to C
- Have function prototype use a void*, then cast

StreamSlice but also
  • AppLayerEventType
  • AppLayerGetFileState
  • AppLayerGetTxIterTuple
  • AppLayerTxData
  • AppLayerTxConfig
  • AppLayerStateData

@Jason Ish, what do you think about moving definitions to C ?

PA Updated by Philippe Antoine 3 months ago Actions #9

  • Status changed from In Progress to In Review

PA Updated by Philippe Antoine 3 months ago Actions #10

  • Copied to Optimization #8187: rust: move extern C definition to suricata-lua-sys and bindgen added

PA Updated by Philippe Antoine 2 months ago Actions #11

  • Blocks Optimization #4747: app-layer: make tx iterator a mandatory part of the API added

PA Updated by Philippe Antoine 2 months ago Actions #12

  • Status changed from In Review to Closed
Actions

Also available in: PDF Atom