Philippe Antoine
1f066cbbe8
unittest: fix unneeded includes as per cppclean
...
Especially because there is conditional inclusion from a header
3 years ago
Victor Julien
e250ef6402
debug: remove empty header
3 years ago
Philippe Antoine
02f2602dde
src: rework includes as per cppclean
3 years ago
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
4 years ago
Philippe Antoine
1d4fe38ccb
detect: adds test with invalid uint mode <<
4 years ago
Philippe Antoine
2012b14470
detect: use generic functions for icode parsing
4 years ago
Modupe Falodun
2a800d572c
detect-icode: convert unittests to FAIL/PASS APIs
...
Bug: #4045
4 years ago
Philippe Antoine
56f664af6b
pcre2: follow code naming style
4 years ago
Philippe Antoine
48dd0cf804
pcre2: check for PCRE2_ERROR_UNSET
...
Needs maybe to be generalized
4 years ago
Philippe Antoine
3de99a214c
pcre2: migrate keywords parsing
4 years ago
Jeff Lucovsky
1eeb96696b
general: Cleanup bool usage
5 years ago
Victor Julien
68f8b2f40f
detect/icmp: reject invalid rules for icode/itype
5 years ago
Victor Julien
6ab323d323
detect: hide RegisterTests behind ifdef UNITTESTS
...
Update all callers to more aggressively use UNITTESTS guards as well.
5 years ago
Victor Julien
26bcc97515
detect/keywords: dynamic version part of doc URL
6 years ago
Jeff Lucovsky
d3a65fe156
detect: Provide `de_ctx` to free functions
...
This commit makes sure that the `DetectEngineCtx *` is available
to each detector's "free" function.
6 years ago
Shivani Bhardwaj
0e4f261224
Use StringParse* for all parsers and configurations
6 years ago
Jeff Lucovsky
7f6af10fed
general: copyright bump
6 years ago
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]
6 years ago
Jeff Lucovsky
be4c6b85de
general: Convert _Bool to bool
...
This commit addresses task 3167 and changes usages of '_Bool` to `bool`.
The latter is included from `suricata-common.h`
6 years ago
Shivani Bhardwaj
d801c3e588
detect: Make keyword description consistent
...
Closes redmine ticket #3137 .
6 years ago
Shivani Bhardwaj
b5b429c288
detect: Add missing keyword URLs and description
...
Add missing keyword URLs and their description. Fix the ones that
were incorrect.
Partially closes redmine ticket #2974 .
6 years ago
Victor Julien
14896365ef
detect: remove Threadvars argument from API calls
...
Remove it as it's (almost) never used. If it is really needed it can
be accessed through DetectEngineThreadCtx::tv as well.
6 years ago
Victor Julien
91296d1eec
detect/prefilter: add de_ctx to registration
8 years ago
Victor Julien
ab1200fbd7
compiler: more strict compiler warnings
...
Set flags by default:
-Wmissing-prototypes
-Wmissing-declarations
-Wstrict-prototypes
-Wwrite-strings
-Wcast-align
-Wbad-function-cast
-Wformat-security
-Wno-format-nonliteral
-Wmissing-format-attribute
-funsigned-char
Fix minor compiler warnings for these new flags on gcc and clang.
9 years ago
Victor Julien
8edc954e82
detect: get rid of Signature::sm_lists
...
Instead use the lists in init_data during setup and the SigMatchData
arrays during runtime.
9 years ago
Victor Julien
bfd4bc8233
detect: constify Signature/SigMatch use at runtime
9 years ago
Eric Leblond
a2e2f50fb9
documentation: fix list keywords URLs
...
Update URLs in keyword definition to point to sphinx documentation.
9 years ago
Victor Julien
3a86aeac65
detect-icode: implement as u8 hash prefilter
9 years ago
Victor Julien
d5e5c11bd1
detect-icode: implement prefilter
9 years ago
maxtors
9d3fd82849
Removed duplicate include statements.
10 years ago
Victor Julien
e67ae0f174
detect keywords: use parse regex util func
10 years ago
Jason Ish
796dd5223b
tests: no longer necessary to provide successful return code
...
1 pass, 0 is fail.
10 years ago
Ken Steele
923a77e952
Change Match() function to take const SigMatchCtx*
...
The Match functions don't need a pointer to the SigMatch object, just the
context pointer contained inside, so pass the Context to the Match function
rather than the SigMatch object. This allows for further optimization.
Change SigMatch->ctx to have type SigMatchCtx* rather than void* for better
type checking. This requires adding type casts when using or assigning it.
The SigMatch contex should not be changed by the Match() funciton, so pass it
as a const SigMatchCtx*.
11 years ago
Ken Steele
8f1d75039a
Enforce function coding standard
...
Functions should be defined as:
int foo(void)
{
}
Rather than:
int food(void) {
}
All functions where changed by a script to match this standard.
11 years ago
Eric Leblond
6842545331
Add documentation url in list-keyword output.
...
The output of the list-keyword is modified to include the url to
the keyword documentation when this is available. All documented
keywords should have their link set.
list-keyword can be used with an optional value:
no option or short: display list of keywords
csv: display a csv output on info an all keywords
all: display a human readable output of keywords info
$KWD: display the info about one keyword.
13 years ago
Eric Leblond
e176be6fcc
Use unlikely for error treatment.
...
When handling error case on SCMallog, SCCalloc or SCStrdup
we are in an unlikely case. This patch adds the unlikely()
expression to indicate this to gcc.
This patch has been obtained via coccinelle. The transformation
is the following:
@istested@
identifier x;
statement S1;
identifier func =~ "(SCMalloc|SCStrdup|SCCalloc)";
@@
x = func(...)
... when != x
- if (x == NULL) S1
+ if (unlikely(x == NULL)) S1
13 years ago
Anoop Saldanha
a4638fb0ad
code cleanup - replace SigMatchAppendPacket with SigMatchAppendSMToList
14 years ago
Anoop Saldanha
17f3f36d38
packet keywords only added for packet mpm. Rest in stream mpm. Update detection engine to handle the same
14 years ago
Anoop Saldanha
54f8d56f48
Packet inspection keywords modified to not inspect pseudo packet
14 years ago
Gerardo Iglesias Galvan
44692c83aa
Properly check retval for config and conversion function calls
15 years ago
Victor Julien
014f62247a
Another batch of clang fixes. Nothing really serious. Includes a couple of fixes for broken fixes from yesterday.
15 years ago
Victor Julien
3f47eade6b
Fix couple of cases where incorrect handling of keyword parsing errors would lead to access of uninitialized memory. Found by clang.
15 years ago
Victor Julien
d1ce1c502b
Fix -Wall -Werror compilation after unittests update.
16 years ago
Victor Julien
1071a53210
Fix unittests after ip_proto keyword change.
16 years ago
Gerardo Iglesias Galvan
9f4fae5b1a
Fix inconsistent use of dynamic memory allocation
16 years ago
William Metcalf
ce01927515
Import of GPLv2 Header 050410
16 years ago
Gurvinder Singh
69a4fee757
fixed the API and logic error reported by clang tool
16 years ago
Victor Julien
8b30226914
Detection keyword cleanup
16 years ago
Victor Julien
b259e362cd
Convert uricontent to use new scanning methods as well. Move http_method and http_cookie keywords out of pmatch list for now.
16 years ago
Pablo Rincon
25a3a5c6d8
Adding mem wrapper to debug runtime alloc()/free() functions. Fixing some memory leaks.
16 years ago