-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bindgen more 7762 v8.4.1 #14660
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
Bindgen more 7762 v8.4.1 #14660
Conversation
As will be needed such as AppLayerTxData
and bindgen it to rust. Will make easier the bindgen of RustParser structure which uses a callback which uses AppLayerGetFileState
and bindgen it to rust, and use default trait instead of new Will make easier the bindgen of RustParser structure which uses a callback which uses AppLayerStateData
and bindgen it to rust Will make easier the bindgen of RustParser structure which uses a callback which uses AppLayerGetTxIterTuple
and bindgen it to rust Will make easier the bindgen of RustParser structure which uses a callback which uses StreamSlice
8de34c8 to
1eff1dd
Compare
and bindgen it to rust Will make easier the bindgen of RustParser structure which uses a callback which uses AppLayerResult Keep From<> impl in sys crate that defines it
1eff1dd to
f2eca9e
Compare
| } | ||
| } | ||
|
|
||
| #[cfg(not(feature = "suritest"))] |
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 these helpers, and this belong in the main suricata crate now. This -sys crate should be limited to bindings only. Or this new -ffi crate we've discussed. But suricata would be a better place until then.
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 not allowed by rust
error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
--> src/applayer.rs:100:15
|
100 | impl Drop for AppLayerTxData {
| ^^^^^^^^^^^^^^ must be a struct, enum, or union in the current crate
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.
Do you see another way ?
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 the common idiomatic Rust way is a wrapper like:
pub struct TxData(pub suricata_sys::sys::AppLayerTxData);
You see this pattern a lot.
But I see your point. I think the suritest also shows how details of the Suricata crate are leaking into this crate as well. I assume thats because we need to be linked with the C code for that to compile?
and bindgen it to rust Will make easier the bindgen of RustParser structure which uses a callback which uses AppLayerTxData Move also the free function to C SCAppLayerTxDataCleanup As suricata-sys crate defines AppLayerTxData for rust, It must itself implement the Drop trait, and thus, We need to define a feature surest
and reorder definitions
Ticket: 7662
f2eca9e to
ef21bd1
Compare
|
Setting to draft as unclean history for rust fixups |
jasonish
left a comment
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.
Just the one comment, otherwise looks OK.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14660 +/- ##
==========================================
- Coverage 82.11% 82.10% -0.02%
==========================================
Files 1011 1012 +1
Lines 262812 262847 +35
==========================================
- Hits 215812 215804 -8
- Misses 47000 47043 +43
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
WARNING:
Pipeline = 29201 |
|
WARNING:
Pipeline = 29210 |
|
Replaced by #14665 |
Link to ticket: https://redmine.openinfosecfoundation.org/issues/
https://redmine.openinfosecfoundation.org/issues/7762
Describe changes:
#14627 final round
@jasonish what do you think ?