Feature #7666
openrust: zero-dependency crate suricata-core
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
Updated by Philippe Antoine 10 months ago
- Blocks Task #7501: rust/plugins: first class support for app-layer plugins added
Updated by Philippe Antoine 9 months ago
- Blocked by Bug #7667: rust: move extern C definitions to suricata_sys and bindgen added
Updated by Philippe Antoine 8 months ago
- Blocked by Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgen added
Updated by Philippe Antoine 3 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
Updated by Jason Ish 3 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.
Updated by Jason Ish 3 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? ;)
Updated by Philippe Antoine 3 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...
Updated by Jason Ish 3 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?