Eric Leblond [Fri, 15 Feb 2013 11:10:25 +0000 (12:10 +0100)]
pcap: set snaplen to MTU if available.
Main objective of this patch is to use a dynamic snaplen to avoid
to truncate packet at the currently fixed snaplen.
It set snaplen to MTU length if the MTU can be retrieved. If not, it
does not set the snaplen which results in using a 65535 snaplen.
libpcap is trying to use mmaped capture and setup the ring by using buffer_size
as the total memory. It also use "rounded" snaplen as frame size. So if we set
snaplen to MTU when available we are optimal regarding the building of the ring.
Eric Leblond [Thu, 14 Feb 2013 10:11:55 +0000 (11:11 +0100)]
teredo: update protocol decoding.
This patch fixes an error in pointer arythmetic and add some
comments to increase maintanability of the code. It also
simplify the decoding code as a careful RFC reading indicate
that if we discard packet containing an authentication field,
it is only possible to have a single origin indication field.
Ignacio Sanchez [Thu, 11 Oct 2012 12:55:40 +0000 (13:55 +0100)]
Adds support for the geoip keyword
Adds support for match-on conditions (src, dst, any, both)
Uses GEOIP_MEMORY_CACHE for performance reasons
Adds support for negation and multiple countries in the same rule
Bug fixes
Changed to take flow direction from rule, if present
Eric Leblond [Mon, 21 Jan 2013 08:27:08 +0000 (09:27 +0100)]
conf: introduce WithDefault function
This patch introduces a new set of functions to the ConfGetChildValue
family. They permit to look under a default node if looking under
base node as failed. This will be used to access to default parameters
for a data type (for instance, first usage will be interface).
Eric Leblond [Wed, 28 Nov 2012 12:22:22 +0000 (13:22 +0100)]
Add removal safe TAILQ iterator.
TAILQ_FOREACH macro was not safe for element removal as it was
accessing the next element in case of a free. This patch is inspired
by Linux list handling and provide a new macro TAILQ_FOREACH_SAFE.
This macro is removal safe and only differs by a last argument being
a temporaty pointer to an element.
Eric Leblond [Wed, 28 Nov 2012 09:34:35 +0000 (10:34 +0100)]
prelude: don't build string objet for NULL string
prelude_string_set_ref don't like when it is called with a NULL
parameter. This patch adds check for NULL value. This is formally
good as there is no use of a NULL description.
Anoop Saldanha [Tue, 27 Nov 2012 06:02:16 +0000 (11:32 +0530)]
fix for bug #526.
Insert pseudo packet under low load conditions to complete rule swap.
This is necessary when we use autofp active packets where most packets
would be sent to the first queue under low load conditions.
Eric Leblond [Mon, 26 Nov 2012 18:36:09 +0000 (19:36 +0100)]
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.
Eric Leblond [Mon, 26 Nov 2012 10:14:01 +0000 (11:14 +0100)]
configure: improve message about pkg-config usage
This patch improve the error message when luajit libraries are not
found. It displays information about the possibility to use
PKG_CONFIG_PATH or the dedicated configure options.
Anoop Saldanha [Sun, 21 Oct 2012 06:31:44 +0000 (12:01 +0530)]
Temporary fix for bug #599.
Treat sigs with negated addresses as non ip-only.
This fix exposes bug #608, which results in 2 failed unittest which
have now been disabled by this commit. Would be reenabled when we
have #608 fix in.
Eric Leblond [Thu, 15 Nov 2012 08:06:01 +0000 (09:06 +0100)]
unix-command: add iface information command.
This patch adds two commands to unix-command. 'iface-list' displays
the list of interface which are sniffed by Suricata and 'iface-stat'
display the available statistics for a single interface. For now,
this is the number of packets and the number of invalid checksums.
Eric Leblond [Fri, 26 Oct 2012 08:21:36 +0000 (10:21 +0200)]
pcap-file: update affinity setting code
The affinity setting code was using the old API. This patch updates
to the new API and also adds a call to RunModeInitiaze() which was
missing in Single running mode.
Eric Leblond [Thu, 25 Oct 2012 20:06:29 +0000 (22:06 +0200)]
unix-socket: introduce API to add commands and tasks
This patch transforms the unix socket into a flexible system to
add commands (triggered by user) and taks (run periodically).
It introduces two functions UnixManagerRegisterCommand and
UnixManagerRegisterBackroundTask to registed commands and tasks.
Other part of Suricata can then declare a new command via a simple
call of the function. In the case of a command the caller is
responsible of building the answer message using Jansson API. The
sending of the message is made by unix manager code.