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

gen: Remove _AL_ usage in detect keywords #12433

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

jlucovsky
Copy link
Contributor

This commit removes the _AL_ usage in detect keywords for improved readability.

Some of the HTTP rule keywords already had counterparts without using "AL". These rule keywords are the legacy content modifier keywords that now have sticky buffer equivalents.

For these, "AL" was removed and a suffix was added to the #define:
src/detect-engine-register.h:151: DETECT_HTTP_COOKIE_CM
src/detect-engine-register.h:153: DETECT_HTTP_METHOD_CM
src/detect-engine-register.h:161: DETECT_HTTP_HEADER_CM
src/detect-engine-register.h:173: DETECT_HTTP_RAW_HEADER_CM
src/detect-engine-register.h:175: DETECT_HTTP_URI_CM
src/detect-engine-register.h:179: DETECT_HTTP_STAT_MSG_CM
src/detect-engine-register.h:181: DETECT_HTTP_STAT_CODE_CM
src/detect-engine-register.h:185: DETECT_HTTP_HOST_CM

Describe changes:

  • Modified enums with DETECT_AL_ to DETECT_, e.g., DETECT_AL_APP_LAYER_EVENT -> DETECT_APP_LAYER_EVENT
  • Modified enums with content modifiers to remove AL_ and suffix with _CM, e.g DETECT_AL_HTTP_HEADER -> DETECT_HTTP_HEADER_CM

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

  • To use an LibHTP, Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

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

This commit removes the `_AL_` usage in detect keywords for improved
readability.

Some of the HTTP rule keywords already had counterparts without using
"_AL_". These rule keywords are the legacy content modifier keywords
that now have sticky buffer equivalents.

For these, "_AL_" was removed and a suffix was added to the #define:
src/detect-engine-register.h:151:    DETECT_HTTP_COOKIE_CM
src/detect-engine-register.h:153:    DETECT_HTTP_METHOD_CM
src/detect-engine-register.h:161:    DETECT_HTTP_HEADER_CM
src/detect-engine-register.h:173:    DETECT_HTTP_RAW_HEADER_CM
src/detect-engine-register.h:175:    DETECT_HTTP_URI_CM
src/detect-engine-register.h:179:    DETECT_HTTP_STAT_MSG_CM
src/detect-engine-register.h:181:    DETECT_HTTP_STAT_CODE_CM
src/detect-engine-register.h:185:    DETECT_HTTP_HOST_CM
Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 98.30748% with 12 lines in your changes missing coverage. Please review.

Project coverage is 80.63%. Comparing base (c207cfc) to head (95e8427).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #12433   +/-   ##
=======================================
  Coverage   80.62%   80.63%           
=======================================
  Files         920      920           
  Lines      258697   258704    +7     
=======================================
+ Hits       208566   208595   +29     
+ Misses      50131    50109   -22     
Flag Coverage Δ
fuzzcorpus 56.81% <97.15%> (+<0.01%) ⬆️
livemode 19.39% <89.23%> (+<0.01%) ⬆️
pcap 44.33% <90.88%> (+0.08%) ⬆️
suricata-verify 63.26% <96.71%> (+0.01%) ⬆️
unittests 58.52% <94.35%> (+<0.01%) ⬆️

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 24278

@victorjulien victorjulien added this to the 8.0 milestone Jan 20, 2025
@victorjulien victorjulien merged commit 95e8427 into OISF:master Jan 21, 2025
117 checks passed
@victorjulien
Copy link
Member

Merged in #12436, thanks!

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.

3 participants