Project

General

Profile

Actions

Feature #7666

open

rust: zero-dependency crate suricata-core

Added by Philippe Antoine 8 months ago. Updated 11 days ago.

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

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


Related issues 3 (2 open1 closed)

Blocks Suricata - Task #7501: rust/plugins: first class support for app-layer pluginsNewOISF DevActions
Blocked by Suricata - Bug #7667: rust: move extern C definitions to suricata_sys and bindgenClosedPhilippe AntoineActions
Blocked by Suricata - Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgenIn ProgressPhilippe AntoineActions
Actions #1

Updated by Philippe Antoine 8 months ago

  • Blocks Task #7501: rust/plugins: first class support for app-layer plugins added
Actions #2

Updated by Philippe Antoine 8 months ago

  • Subtask #7667 added
Actions #3

Updated by Victor Julien 7 months ago

  • Subtask deleted (#7667)
Actions #4

Updated by Philippe Antoine 7 months ago

  • Blocked by Bug #7667: rust: move extern C definitions to suricata_sys and bindgen added
Actions #5

Updated by Philippe Antoine 6 months ago

  • Blocked by Optimization #7762: rust: finish moving extern C definitions to suricata_sys and bindgen added
Actions #6

Updated by Philippe Antoine 5 months ago

  • Tracker changed from Bug to Feature
Actions #7

Updated by Philippe Antoine about 2 months ago

  • Status changed from New to Assigned
Actions #8

Updated by Philippe Antoine 16 days 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

Actions #9

Updated by Jason Ish 15 days 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.

Actions #10

Updated by Jason Ish 15 days 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? ;)

Actions #11

Updated by Philippe Antoine 11 days ago

suricata-basics ?

Actions #12

Updated by Jason Ish 11 days ago

Philippe Antoine wrote in #note-11:

suricata-basics ?

That would imply it contains Suricata's basic functionality, but it doesn't. It contains an interface to Suricata functionality, much of which is not "basic" at all.

Actions #13

Updated by Jason Ish 11 days ago

How much of this stuff we need from plugins could ripple into the -sys crate if we bindgen'd it to C, then cbindgen'd it back to Rust? Did you try that before?

Actions #14

Updated by Philippe Antoine 11 days 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...

Actions #15

Updated by Jason Ish 11 days 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?

Actions

Also available in: Atom PDF