-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applayer plugin 5053 v11 #12471
base: master
Are you sure you want to change the base?
Applayer plugin 5053 v11 #12471
Conversation
and use generic logger callback prototype with later cast and do some other small modifications so that the plugin has less diff
so that it can be used by plugins Avoid export by cbindgen as this constant is also defined in C
so that it can be used by plugins that want to call SCLogError and such
// Struct definitions | ||
#[repr(C)] | ||
#[allow(non_snake_case)] | ||
pub struct SCPlugin { | ||
pub name: *const libc::c_char, | ||
pub license: *const libc::c_char, | ||
pub author: *const libc::c_char, | ||
pub Init: extern "C" fn(), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good example of a data structure that should remain in C, and be provided to Rust via bindgen instead of continuing the pattern of creating C data structure in Rust for the convenience of write once.
@@ -83,7 +83,7 @@ extern crate suricata_derive; | |||
pub mod core; | |||
|
|||
#[macro_use] | |||
pub(crate) mod debug; | |||
pub mod debug; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need 8b12670
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I broke out the fixes from my previous PR to expose SCPlugin to Rust to just a minimal one to fix logging from plugins:
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12471 +/- ##
==========================================
+ Coverage 80.52% 80.55% +0.02%
==========================================
Files 923 923
Lines 259176 259543 +367
==========================================
+ Hits 208708 209067 +359
- Misses 50468 50476 +8
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: QA ran without warnings. Pipeline 24348 |
With the recent refactor, the log level as seen by plugins was not being updated when being set through the C interface, so just set it directly upon plugin initialization.
so that they can be used by rust plugins
Ticket: 7151 Ticket: 7152 Ticket: 7154
Ticket: 7149 Ticket: 7150 Ticket: 7153
d08fb5c
to
b35cd6d
Compare
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/4102 with all 6 subtickets
Describe changes:
@jufajardini what do you think about the doc ?
#12467 rebased to get green CI
There are also #12470 and #12466 which will require a rebase of this PR if they get merged first (or the other way around)
cc @jasonish