-
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
smb: New keyword smb.cmd v6 #7338
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7338 +/- ##
==========================================
- Coverage 77.68% 75.76% -1.93%
==========================================
Files 628 657 +29
Lines 185657 190107 +4450
==========================================
- Hits 144232 144029 -203
- Misses 41425 46078 +4653
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Looks fine enough for me
- CI : ✅
- Code : looks good, one rust question...
- Commits segmentation : nice
- Commit messages : ✅
- Git ID set : looks fine for me
- CLA : I do not have access, but looks like some commits were already merged
- Doc update : nice
- Redmine ticket : ok
- Rustfmt : was not enforced
- Tests : Suricata-verify tests look fine
Version was not rebased on latest master
|
||
fn gen_smb1_command_names() -> HashMap<String, u16> { | ||
let commands = [ | ||
smb1::SMB1_COMMAND_CREATE_DIRECTORY, |
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.
Is there a more idiomatic way ?
cc @jasonish we want to iterate over all known values of an enumeration
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.
These code command constants are not part of an enumeration, but are the defined in the smb1 module.
On the other hand, there is no idiomatic way to iterate over values of enumeration since those couldn't be constants (https://stackoverflow.com/a/21373995)
Moved to #7372 |
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
Make sure these boxes are signed before submitting your Pull Request -- thank you.
Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/5069
Describe changes:
Example of rule
alert smb any any -> any any (msg: "Smb command rule"; smb.cmd: 10; sid: 1;)
. More examples in documentation.suricata-verify-pr: 733