14 Commits
Author SHA1 Message Date
Jeff Lucovsky 022a79fdd5 misc/cleanup: Simplify <cond> ? true : false
Simplify statements where there's a conditional statement followed by
return true or return false.

Instead of
    if (conditional)
        return true;
    else
        return false;

Use:
        return conditional
2026-03-22 05:43:05 +00:00
Jason Ish bfd6c29f5a detect: SC prefix for extern pub Rust functions
Ticket: #7498
2025-03-31 19:16:53 +02:00
Philippe Antoine 35b6dcec7e detect: use generic integer functions for filesize
Ticket: #4112
2022-06-02 07:39:33 +02:00
Philippe Antoine 2b0be91f28 detect: use generic integer functions for dsize
Ticket: #4112
2022-06-02 07:39:33 +02:00
Philippe Antoine f29b43defd detect: rust generic functions for integers
Move it away from http2 to generic core crate.
And use it for DCERPC (and SMB)

And remove the C version.
Main change in API is the free function is not free itself, but
a rust wrapper around unbox.

Ticket: #4112
2022-06-02 07:39:33 +02:00
Victor Julien 7e2ed11a11 detect: fix bad BUG_ON pattern
cppcheck:

src/detect-engine-uint.c:73:13: warning: Conversion of string literal "unknown mode" to bool always evaluates to true. [incorrectStringBooleanError]
            BUG_ON("unknown mode");
            ^
src/detect-engine-uint.c:328:13: warning: Conversion of string literal "unknown mode" to bool always evaluates to true. [incorrectStringBooleanError]
            BUG_ON("unknown mode");
            ^
src/detect-pcre.c:291:25: warning: Conversion of string literal "Impossible captype" to bool always evaluates to true. [incorrectStringBooleanError]
                        BUG_ON("Impossible captype");
                        ^

Bug: #5291.
2022-04-27 12:18:24 +02:00
Philippe Antoine c9d222a483 detect: allows <> syntax for uint ranges 2021-11-24 08:15:16 +01:00
Philippe Antoine 3f15b2492c detect: errors for rule with impossible conditions
Such as >255 for an uint8 field
2021-11-24 08:15:16 +01:00
Philippe Antoine 3de99a214c pcre2: migrate keywords parsing 2021-09-28 17:46:19 +02:00
frank honza b80cdae1df detect: add comparison-mode LTE/GTE for Detect(U32/u8)Data 2021-03-05 14:47:10 +01:00
Sascha Steinbiss 5dc21b0e09 detect-engine: initialize struct fields 2020-08-04 11:23:12 +02:00
Philippe Antoine a5572890a9 detect: adds engine for u8 keywords 2020-08-02 20:09:21 +02:00
Jeff Lucovsky 4b0085b03c detect: Update to take advantage of PCRE refactor
This commit changes the keyword detectors to use the refactored PCRE
modifications from detect-parse.[ch]
2020-03-19 17:47:45 +01:00
Philippe Antoine 75ec528384 detect: adds utility file for uint keywords 2020-03-19 09:31:22 +01:00