Feature #7666
closedrust: zero-dependency crate suricata-ffi
Description
To be used by plugins so that they do not need to pull and compile +200 dependencies to know the value ok ALPROTO_UNKNOWN and such
PA Updated by Philippe Antoine over 1 year ago
- Blocks Task #7501: rust/plugins: first class support for app-layer plugins added
PA Updated by Philippe Antoine over 1 year ago
- Subtask #7667 added
VJ Updated by Victor Julien over 1 year ago
- Subtask deleted (
#7667)
PA Updated by Philippe Antoine over 1 year ago
- Blocked by Bug #7667: rust: move extern C definitions to suricata_sys and bindgen added
PA Updated by Philippe Antoine about 1 year ago
- Blocked by Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgen added
PA Updated by Philippe Antoine about 1 year ago
- Tracker changed from Bug to Feature
PA Updated by Philippe Antoine 11 months ago
- Status changed from New to Assigned
PA Updated by Philippe Antoine 10 months ago
Also, A plugin and Suricata should at runtime check their compile (C ifdef, rust cfg) options : like
#ifdef HAVE_MAGIC
char *magic;
#endif
in File structure
JI Updated by Jason Ish 10 months ago
Philippe Antoine wrote in #note-8:
Also, A plugin and Suricata should at runtime check their compile (C ifdef, rust cfg) options : like
[...]in File structure
Ideally, we'd get rid of any of these for 9. I wonder if moving any compile-time options like this to the end of the structure would help. Of course, no plugin/lib could use them without explicit checking.
JI Updated by Jason Ish 10 months ago ยท Edited
What do you think about naming? "core" doesn't work, as it does not contain the core of Suricata. I do want to get some binding code out of one of my plugins, and this crate is where it will go:
- suricata-ffi: Somewhat makes sense as it's Rust code for working with the Rust API via C interfaces
- suricata-api
But it's also kind of an odd API crate. As it's wrapping/bridging/adapting as its Rust bindings to C bindings to Rust: suricata-rcr? ;)
PA Updated by Philippe Antoine 9 months ago
suricata-basics ?
PA Updated by Philippe Antoine 9 months ago
if we bindgen'd it to C, then cbindgen'd it back to Rust? Did you try that before?
Like I did for jsonbuilder ?
I think you were against filling Suricata-sys with other such stuff...
JI Updated by Jason Ish 9 months ago
Philippe Antoine wrote in #note-14:
if we bindgen'd it to C, then cbindgen'd it back to Rust? Did you try that before?
Like I did for jsonbuilder ?
I think you were against filling Suricata-sys with other such stuff...
I was, somewhat.. But I think its making sense.
`-sys` for all C bindings, whether they be to Rust or C code. I wasn't liking the idea of putting C bindings to Rust code there before, but I'm seeing the light.
Then `-ffi` style crate with some nicer wrappers around those raw bindings? Maybe even name it `-wrapper`? Then many plugins would need only require `suricata-sys` and `suricata-wrapper` right?
PA Updated by Philippe Antoine 7 months ago
- Status changed from Assigned to In Progress
https://github.com/OISF/suricata/pull/14797 has done a big share of the work
PA Updated by Philippe Antoine 7 months ago
- Subject changed from rust: zero-dependency crate suricata-core to rust: zero-dependency crate suricata-ffi
PA Updated by Philippe Antoine 7 months ago
https://github.com/OISF/suricata/pull/14849 to get forward
JI Updated by Jason Ish 5 months ago
- Related to Task #8445: rust/ffi: provide bindings to thread storage added
JI Updated by Jason Ish 5 months ago
- Related to Task #8446: rust/ffi: provide callbacks to flow life cycle added
JI Updated by Jason Ish 5 months ago
- Related to Task #8447: rust/ffi: provide bindings to flow storage added
JI Updated by Jason Ish 5 months ago
- Related to Feature #8477: rust/ffi: provide eve callback added
PA Updated by Philippe Antoine 4 months ago
- Status changed from In Progress to In Review
PA Updated by Philippe Antoine 4 months ago
- Status changed from In Review to Closed