-
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
rust ffi ints/v1 #12009
rust ffi ints/v1 #12009
Conversation
jasonish
commented
Oct 22, 2024
- eve/schema: add missing field "code" anomaly events
- rust/applayer: use c_int as return type for get_info_by_id
Rust was using i8 as the return type, while C uses int. As of Rust 1.82, the return value is turned to garbage over the FFI boundary. Ticket: OISF#7338
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #12009 +/- ##
==========================================
- Coverage 83.22% 83.22% -0.01%
==========================================
Files 910 910
Lines 258136 258136
==========================================
- Hits 214831 214825 -6
- Misses 43305 43311 +6
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -445,7 +445,7 @@ pub type StateGetTxFn = unsafe extern "C" fn (*mut c_void, u64) -> *m | |||
pub type StateGetTxCntFn = unsafe extern "C" fn (*mut c_void) -> u64; | |||
pub type StateGetProgressFn = unsafe extern "C" fn (*mut c_void, u8) -> c_int; | |||
pub type GetEventInfoFn = unsafe extern "C" fn (*const c_char, *mut c_int, *mut AppLayerEventType) -> c_int; | |||
pub type GetEventInfoByIdFn = unsafe extern "C" fn (c_int, *mut *const c_char, *mut AppLayerEventType) -> i8; | |||
pub type GetEventInfoByIdFn = unsafe extern "C" fn (c_int, *mut *const c_char, *mut AppLayerEventType) -> c_int; |
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.
That we also use uint8_t
and int
for the event_type (first argument) in C, while not breaking anything right now, could be a source for error.
Information: QA ran without warnings. Pipeline 23161 |
Merged in #12013, thanks! |