Commit Graph

22 Commits (4c6595f4379eafe81f1232c4cf4306cdc1d3a793)

Author SHA1 Message Date
Eric Leblond df3d10865a host: suppress double memory clear
HostFree() is calling HostClearMemory() so calling HostClearMemory()
before HostFree() is useless.
12 years ago
Eric Leblond 12fd60b545 unix-socket: cleanup host table instead of destroying it
This patch should fix the bug #637. Between pcap files, it uses a
new function HostCleanup() to clear tag and threshold on host with
an IP regputation. An other consequence of this modification is
that Host init and shutdown are now init and shutdown unconditionaly.
12 years ago
Eric Leblond d9eaa0d340 host: don't destroy reference counter
The reference counter should not be destroyed in HostClearMemory()
as the host can be reused directly (without going through Init
function).
12 years ago
Victor Julien 18535e6ef9 Host: ignore usecnt add/sub result. Expose HostPrintStats. 12 years ago
Victor Julien e30b1bfe64 Simple IP reputation implementation 12 years ago
Victor Julien d1573a366d Fix GetUsed functions for Host, Flow and Defrag. 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
Eric Leblond 0227a87fcb cleaning: fix warning when building with clang.
clang was issuing some warnings related to unused return in function.
This patch adds some needed error treatment and ignore the rest of the
warnings by adding a cast to void.
13 years ago
Victor Julien 31b673718c host: convert use_cnt to a atomic var (like in flow). 13 years ago
Victor Julien bf4ab2f7e1 Fix misc issues picked up by coccinelle. 13 years ago
Victor Julien cfd4d07dd0 host: convert host hash to use lookup3.c 13 years ago
Victor Julien f4b542d703 Enforce memcap limit before allocating hash table in host and flow engines. 13 years ago
Victor Julien 4157d9408d Various small flow and host table fixes. 13 years ago
Victor Julien e581ec7dff Fix 2 compilation issues. 13 years ago
Victor Julien c0a2cbd478 Move over src and dst thresholding to use host table. Fix a bug in threshold 'both' handling. 13 years ago
Victor Julien a05df345de Introduce host table, make tag use it
Add a host table similar to the flow table. A hash using fine grained
locking. Flow manager for now takes care of book keeping / garbage
collecting.

Tag subsystem now uses this for host based tagging instead of the
global tag hash table. Because the latter used a global lock and the
new code uses very fine grained locking this patch should improve
scalability.
13 years ago
Gurvinder Singh a8ca5719f6 fixed the typo in byte_jump and host.c, Thanks to rmkml for pointing out 15 years ago
William Metcalf ce01927515 Import of GPLv2 Header 050410 15 years ago
Pablo Rincon 25a3a5c6d8 Adding mem wrapper to debug runtime alloc()/free() functions. Fixing some memory leaks. 15 years ago
Victor Julien ecf86f9c23 Rename to Suricata. 15 years ago
Victor Julien 0d0ffb9963 Reorganize header inclusions. 16 years ago
Victor Julien bab4b62376 Initial add of the files. 16 years ago