Skip to content
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

Convert byte_extract keyword parser to Rust #10881

Closed
wants to merge 3 commits into from

Conversation

jlucovsky
Copy link
Contributor

Continuation of #10833

Convert the byte_extract option parser from C to Rust.

Link to redmine ticket: 6873

Describe changes:

  • Refactor code in rust/src/detect to support re-usability
  • Implement the byte_extract parser in Rust, with unittests
  • Modify the existing byte_extract module to use the Rust parser

Updates:

  • Rebase

Provide values to any of the below to override the defaults.

To use a pull request use a branch name like pr/N where N is the
pull request number.

Alternatively, SV_BRANCH may also be a link to an
OISF/suricata-verify pull-request.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Issue: 6873

Refactor the enums for endian and base handling for broader use.
Implement the keyword parser in Rust.

Issue: 6831
This commit uses Option instead of Result.

Issue: 6831
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Attention: Patch coverage is 96.58703% with 30 lines in your changes are missing coverage. Please review.

Project coverage is 82.85%. Comparing base (240e068) to head (3196a42).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10881      +/-   ##
==========================================
- Coverage   82.95%   82.85%   -0.10%     
==========================================
  Files         917      922       +5     
  Lines      247367   247685     +318     
==========================================
+ Hits       205198   205219      +21     
- Misses      42169    42466     +297     
Flag Coverage Δ
fuzzcorpus 64.33% <73.84%> (-0.18%) ⬇️
suricata-verify 62.42% <62.05%> (+0.11%) ⬆️
unittests 62.20% <96.24%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 20129

Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work Jeff

CI : 🟢
Code : Checking now
Commits segmentation : Could last commit get squashed ?
Commit messages : The redmine ticket 6873 should be mentioned in the commit detect/byte_extract: Move keyword parser to Rust
Git ID set : looks fine for me
CLA : :-p
Doc update : not needed
Redmine ticket : Is https://redmine.openinfosecfoundation.org/issues/6831 handled here ?
Rustfmt : Could you run it to have 2 small changes in byte_extract.rs and byte_math.rs ?
Tests : ok
Dependencies added: none added

@jlucovsky
Copy link
Contributor Author

Continued in #10906

@jlucovsky jlucovsky closed this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants