-
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
output: Add linktype name #12772
base: master
Are you sure you want to change the base?
output: Add linktype name #12772
Conversation
Issue: 6954 Add Rust based logic that maintains a hash map of link type values and their associated output names.
Use the hasmap to gather linktype display names. Issue: 6954
Issue: 6954 This commit adds the linktype name to the output stream. The name is determined from the pcap utility function pcap_datalink_val_to_name
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12772 +/- ##
==========================================
- Coverage 80.87% 80.86% -0.01%
==========================================
Files 936 938 +2
Lines 259748 259802 +54
==========================================
+ Hits 210061 210098 +37
- Misses 49687 49704 +17
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Information: QA ran without warnings. Pipeline 25140 |
|
||
#[no_mangle] | ||
pub extern "C" fn SCDatalinkInit() -> *mut HashMap<i32, CString> { | ||
let map: HashMap<i32, CString> = HashMap::new(); |
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.
Q: How many datalink values can we expect to insert in the HashMap?
Or rather, what encouraged the use of a HashMap here?
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 chose a hash map to store the mappings between linktype values and the name as the link type values are established values that are non-sequential. With the small number of entries (12-15), access should be o(1).
Continuation of #12497
Issue: 6954
This commit adds the linktype name to the output stream. The name is determined from a Rust linktype-to-name function.
Link to ticket: https://redmine.openinfosecfoundation.org/issues/6954
Describe changes:
Updates:
Provide values to any of the below to override the defaults.
SV_BRANCH=OISF/suricata-verify#2023