]> git.ipfire.org Git - thirdparty/suricata.git/log
thirdparty/suricata.git
12 years agoteredo: update protocol decoding. 285/head
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.

12 years agoFix latest build-info modification 281/head
Eric Leblond [Mon, 11 Feb 2013 19:11:53 +0000 (20:11 +0100)] 
Fix latest build-info modification

The creation of build-info.h should have been made in build
directory and not in source directory. This should fix changes
introduced in #738.

12 years agobuild-info: use printf instead of SCLogInfo
Eric Leblond [Wed, 23 Jan 2013 11:17:07 +0000 (12:17 +0100)] 
build-info: use printf instead of SCLogInfo

This change results in a more readable and reusable output.

12 years agoadd configure summary to build-info output
Eric Leblond [Wed, 23 Jan 2013 11:05:23 +0000 (12:05 +0100)] 
add configure summary to build-info output

12 years agosuricata: add information to build-info
Eric Leblond [Wed, 23 Jan 2013 09:40:40 +0000 (10:40 +0100)] 
suricata: add information to build-info

This patch adds information about luajit and jansson to the
output of --build-info command. This should fix #696.

12 years agobug #737. Display a more apt error message when wrong argument's supplied to
Anoop Saldanha [Sat, 2 Feb 2013 14:03:19 +0000 (19:33 +0530)] 
bug #737.  Display a more apt error message when wrong argument's supplied to
reference keyword.

12 years agoAdding comment in suricata.yaml.in to indicate sensor-id option.
Jake Gionet [Thu, 31 Jan 2013 12:20:17 +0000 (06:20 -0600)] 
Adding comment in suricata.yaml.in to indicate sensor-id option.

12 years agoAdding support for Feature #667
Jake Gionet [Thu, 31 Jan 2013 05:15:18 +0000 (23:15 -0600)] 
Adding support for Feature #667

12 years agoFix sig grouping bug when certain sigs are mixed. Add tests.
Victor Julien [Fri, 1 Feb 2013 16:28:32 +0000 (17:28 +0100)] 
Fix sig grouping bug when certain sigs are mixed. Add tests.

12 years agoFix stateful inspection not always inspecting at stream end.
Victor Julien [Wed, 30 Jan 2013 12:29:19 +0000 (13:29 +0100)] 
Fix stateful inspection not always inspecting at stream end.

12 years agofix for #694.
Anoop Saldanha [Thu, 17 Jan 2013 18:53:49 +0000 (00:23 +0530)] 
fix for #694.

Invalidate any address/port vars in the conf that uses a sequence
without quotes.

12 years agounittest to show the seg fault from bug_694
Anoop Saldanha [Tue, 22 Jan 2013 12:56:48 +0000 (18:26 +0530)] 
unittest to show the seg fault from bug_694

12 years agogeoip: add Fedora pkg hint to configure check
Victor Julien [Tue, 22 Jan 2013 12:45:14 +0000 (13:45 +0100)] 
geoip: add Fedora pkg hint to configure check

12 years agoupdated to fix unix shutdown sequence
Anoop Saldanha [Tue, 22 Jan 2013 11:39:22 +0000 (17:09 +0530)] 
updated to fix unix shutdown sequence

Should fix crashes occuring from unix mode shutdown/cleanup phase.

12 years agoAdds support for the geoip keyword
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

Comments addressed. Unit tests added.

12 years agoconf: add unittest for WithDefault functions. 262/head
Eric Leblond [Mon, 21 Jan 2013 16:27:46 +0000 (17:27 +0100)] 
conf: add unittest for WithDefault functions.

12 years agopcap: add support for 'default' interface
Eric Leblond [Mon, 21 Jan 2013 08:56:02 +0000 (09:56 +0100)] 
pcap: add support for 'default' interface

12 years agopfring: add support for 'default' interface
Eric Leblond [Mon, 21 Jan 2013 08:52:13 +0000 (09:52 +0100)] 
pfring: add support for 'default' interface

12 years agoaf-packet: add support for 'default' interface
Eric Leblond [Mon, 21 Jan 2013 08:40:10 +0000 (09:40 +0100)] 
af-packet: add support for 'default' interface

This patch adds support for 'default' interface which is used to get
parameter values when per-interface is not defined.

12 years agoconf: introduce WithDefault function
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).

12 years agopcap-file: don't kill engine in unix socket mode 260/head
Eric Leblond [Thu, 17 Jan 2013 10:12:27 +0000 (11:12 +0100)] 
pcap-file: don't kill engine in unix socket mode

This patch updates the cleaning code to avoid to exit from suricata
in unix socket mode when a invalid pcap is given.

12 years agosuppress: DETECT_SUPPRESS_REGEX should support IPv6 addresses too. Bug #697.
Jamie Strandboge [Fri, 11 Jan 2013 13:21:08 +0000 (07:21 -0600)] 
suppress: DETECT_SUPPRESS_REGEX should support IPv6 addresses too. Bug #697.

12 years agofile md5: print filename and line number on md5 parse errors. Bug #693.
Victor Julien [Wed, 9 Jan 2013 13:07:52 +0000 (14:07 +0100)] 
file md5: print filename and line number on md5 parse errors. Bug #693.

12 years agopreserve the existing error code order
Nikolay Denev [Wed, 9 Jan 2013 10:40:55 +0000 (12:40 +0200)] 
preserve the existing error code order

restore SC_WARN_IPFW_SETSOCKOPT
move SC_ERR_IPFW_SETSOCKOPT at the end of the enum

12 years agosetsockopt() failures are already fatal,
Nikolay Denev [Sat, 22 Dec 2012 14:28:29 +0000 (16:28 +0200)] 
setsockopt() failures are already fatal,
so treat them as such and print error instead of warning.

12 years agoset SO_BROADCAST on the divert socket so that broadcast
Nikolay Denev [Sat, 22 Dec 2012 11:00:13 +0000 (13:00 +0200)] 
set SO_BROADCAST on the divert socket so that broadcast
 packets can be reinjected.

12 years agoFix ftpbounce address calc failing on PPC64
Victor Julien [Tue, 8 Jan 2013 18:32:56 +0000 (19:32 +0100)] 
Fix ftpbounce address calc failing on PPC64

12 years agoUse _mm_free for memory allocated by _mm_alloc. Bug 703. Minor compiler warning fixes.
Victor Julien [Tue, 8 Jan 2013 14:20:21 +0000 (15:20 +0100)] 
Use _mm_free for memory allocated by _mm_alloc. Bug 703. Minor compiler warning fixes.

12 years agoFix double definition of CPU_* macro's for Darwin/OSX. Bug 701.
Victor Julien [Tue, 8 Jan 2013 12:47:14 +0000 (13:47 +0100)] 
Fix double definition of CPU_* macro's for Darwin/OSX. Bug 701.

12 years agoFix byte order detection on Mac OS X/Darwin. Bug 700.
Victor Julien [Tue, 8 Jan 2013 12:32:48 +0000 (13:32 +0100)] 
Fix byte order detection on Mac OS X/Darwin. Bug 700.

12 years agoFix protocol check for IP-only (#689).
Victor Julien [Tue, 18 Dec 2012 15:54:46 +0000 (16:54 +0100)] 
Fix protocol check for IP-only (#689).

12 years agoUpdate changelog for 1.4 suricata-1.4
Victor Julien [Thu, 13 Dec 2012 12:43:06 +0000 (13:43 +0100)] 
Update changelog for 1.4

12 years agoipv6: add event for ipv6 packet with icmpv4 header
Victor Julien [Wed, 12 Dec 2012 17:29:01 +0000 (18:29 +0100)] 
ipv6: add event for ipv6 packet with icmpv4 header

12 years agofix for 653. 245/head
Anoop Saldanha [Wed, 12 Dec 2012 12:18:21 +0000 (17:48 +0530)] 
fix for 653.

break out of afp readring loop if shutdown is initiated.

12 years agoUse GET_PKT_LEN and GET_PKT_DATA macro's
Victor Julien [Tue, 11 Dec 2012 11:10:44 +0000 (12:10 +0100)] 
Use GET_PKT_LEN and GET_PKT_DATA macro's

12 years agomagic: freebsd magic return differently
Eric Leblond [Thu, 6 Dec 2012 14:33:25 +0000 (15:33 +0100)] 
magic: freebsd magic return differently

FreeBSD don't return "Microsoft Office Document" but
"OLE 2 Compound Document". This patch takes this into account.

12 years agofix for bug 675.
Anoop Saldanha [Mon, 10 Dec 2012 19:14:54 +0000 (00:44 +0530)] 
fix for bug 675.

Fix icmpv6-csum to send the right length to calculate the csum.

12 years agoUnittest to show the issue we have with 674 - csum-icmpv6 sends
Anoop Saldanha [Mon, 10 Dec 2012 16:52:31 +0000 (22:22 +0530)] 
Unittest to show the issue we have with 674 - csum-icmpv6 sends
wrong length for csum calculation)

12 years agoipv6: add option to detect HOP/DST headers with only padding. Detect unknown DST...
Victor Julien [Mon, 10 Dec 2012 17:34:11 +0000 (18:34 +0100)] 
ipv6: add option to detect HOP/DST headers with only padding. Detect unknown DST/HOP opts.

12 years agoicmpv6: fix payload handling
Victor Julien [Mon, 10 Dec 2012 15:00:44 +0000 (16:00 +0100)] 
icmpv6: fix payload handling

12 years agodecoder events: fix bug causing some rules not to be inspected if the decoder complet...
Victor Julien [Mon, 10 Dec 2012 12:59:53 +0000 (13:59 +0100)] 
decoder events: fix bug causing some rules not to be inspected if the decoder completed with warnings

12 years agodecode events: add debug statement
Victor Julien [Mon, 10 Dec 2012 12:46:42 +0000 (13:46 +0100)] 
decode events: add debug statement

12 years agoprofiling: fix missing profile names
Victor Julien [Mon, 3 Dec 2012 13:15:39 +0000 (14:15 +0100)] 
profiling: fix missing profile names

12 years agounified2: append open instead of trucate open so that in case we rotate within a...
Victor Julien [Thu, 6 Dec 2012 13:48:56 +0000 (14:48 +0100)] 
unified2: append open instead of trucate open so that in case we rotate within a second we don't overwrite files. Instead we violate the limit.

12 years agoflow: only BUG_ON use_cnt in flows when compiled with debug-validation
Victor Julien [Wed, 5 Dec 2012 17:55:45 +0000 (18:55 +0100)] 
flow: only BUG_ON use_cnt in flows when compiled with debug-validation

12 years agocleanup flowtimeout threadvars retrieval +
Anoop Saldanha [Mon, 3 Dec 2012 18:28:53 +0000 (23:58 +0530)] 
cleanup flowtimeout threadvars retrieval +
throw back pseudo pkt back to packetpool inside flow timeout.

12 years agostream: send eof to app layer from stream end pkt if necessary
Victor Julien [Wed, 5 Dec 2012 17:29:33 +0000 (18:29 +0100)] 
stream: send eof to app layer from stream end pkt if necessary

12 years agoWait until both sides close the TCP connection before initiating cleanup 233/head
Ludovico Cavedon [Sat, 1 Dec 2012 23:29:06 +0000 (15:29 -0800)] 
Wait until both sides close the TCP connection before initiating cleanup

12 years agoUpdate docs from wiki suricata-1.4rc1
Victor Julien [Thu, 29 Nov 2012 12:27:36 +0000 (13:27 +0100)] 
Update docs from wiki

12 years agoUpdate changelog for 1.4rc1
Victor Julien [Thu, 29 Nov 2012 12:26:36 +0000 (13:26 +0100)] 
Update changelog for 1.4rc1

12 years agounix runmode: fix error handling. 231/head
Eric Leblond [Wed, 28 Nov 2012 17:02:09 +0000 (18:02 +0100)] 
unix runmode: fix error handling.

If 'output-dir' argument was not given it was possible to reach a
possibly problematic condition.

12 years agoRemove useless code.
Eric Leblond [Wed, 28 Nov 2012 16:58:18 +0000 (17:58 +0100)] 
Remove useless code.

12 years agofix logic error in sanity check
Eric Leblond [Wed, 28 Nov 2012 16:52:43 +0000 (17:52 +0100)] 
fix logic error in sanity check

12 years agoAdd removal safe TAILQ iterator.
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.

12 years agoprelude: don't build string objet for NULL string
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.

12 years agoFeature 638: Display DAG drop counts on exit; add DAG packet and drop stats to live...
Jason Ish [Thu, 22 Nov 2012 19:45:05 +0000 (13:45 -0600)] 
Feature 638: Display DAG drop counts on exit; add DAG packet and drop stats to live stats.

12 years agoFix length check on user-agent header
Ludovico Cavedon [Tue, 27 Nov 2012 18:06:46 +0000 (10:06 -0800)] 
Fix length check on user-agent header

12 years agoAdd User-Agent header content to file metadata
Ludovico Cavedon [Wed, 14 Nov 2012 00:42:56 +0000 (16:42 -0800)] 
Add User-Agent header content to file metadata

12 years agowarn users that we don't support content strings whose length's > 255.
Anoop Saldanha [Tue, 16 Oct 2012 08:46:23 +0000 (14:16 +0530)] 
warn users that we don't support content strings whose length's > 255.

12 years agoInitialize flow_manager_mutex
Ludovico Cavedon [Wed, 14 Nov 2012 19:09:13 +0000 (11:09 -0800)] 
Initialize flow_manager_mutex

12 years agofix for bug #526.
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.

12 years agoclang: make atomics work
Victor Julien [Tue, 27 Nov 2012 17:55:28 +0000 (18:55 +0100)] 
clang: make atomics work

12 years agoFix detection of spin locks supported. Clean up how we handle falling back to mutex...
Victor Julien [Tue, 27 Nov 2012 15:25:59 +0000 (16:25 +0100)] 
Fix detection of spin locks supported. Clean up how we handle falling back to mutex if spinlocks aren't supported.

12 years agohost: suppress double memory clear 230/head
Eric Leblond [Tue, 27 Nov 2012 09:09:59 +0000 (10:09 +0100)] 
host: suppress double memory clear

HostFree() is calling HostClearMemory() so calling HostClearMemory()
before HostFree() is useless.

12 years agounix-socket: cleanup host table instead of destroying it
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.

12 years agohost: don't destroy reference counter
Eric Leblond [Tue, 27 Nov 2012 09:01:12 +0000 (10:01 +0100)] 
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 agopfring: fix build failure
Eric Leblond [Sat, 24 Nov 2012 15:44:52 +0000 (16:44 +0100)] 
pfring: fix build failure

12 years agoconfigure: improve message about pkg-config usage
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.

12 years agoTemporary fix for bug #599. 223/head
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.

12 years agounittest to show failure for bug #599.
Anoop Saldanha [Sun, 21 Oct 2012 06:44:25 +0000 (12:14 +0530)] 
unittest to show failure for bug #599.

12 years agohttp: add event for libhtp detection of request port not matching tcp port.
Victor Julien [Fri, 23 Nov 2012 09:56:22 +0000 (10:56 +0100)] 
http: add event for libhtp detection of request port not matching tcp port.

12 years agopcap: fix windows commandline mangling win device string
Victor Julien [Thu, 22 Nov 2012 16:56:31 +0000 (17:56 +0100)] 
pcap: fix windows commandline mangling win device string

12 years agoclang: fix warnings when debug is enabled
Victor Julien [Tue, 20 Nov 2012 14:44:05 +0000 (15:44 +0100)] 
clang: fix warnings when debug is enabled

12 years agoreputation: don't give error if config is missing/commented out
Victor Julien [Tue, 20 Nov 2012 14:40:15 +0000 (15:40 +0100)] 
reputation: don't give error if config is missing/commented out

12 years agoMinor fixes
Victor Julien [Tue, 20 Nov 2012 13:40:41 +0000 (14:40 +0100)] 
Minor fixes

12 years agounix runmode: improve JSON handling 215/head
Eric Leblond [Tue, 20 Nov 2012 09:57:16 +0000 (10:57 +0100)] 
unix runmode: improve JSON handling

The jansson function with new in their name take care of ref
counting. The this patch fixes a memory leak.

12 years agounix-manager: fix error and JSON handling
Eric Leblond [Tue, 20 Nov 2012 09:58:34 +0000 (10:58 +0100)] 
unix-manager: fix error and JSON handling

12 years agounix-manager: memory handling fixes.
Eric Leblond [Tue, 20 Nov 2012 09:28:35 +0000 (10:28 +0100)] 
unix-manager: memory handling fixes.

This patch adds unlikey() for memory error handling and fixes a few
error cases.

12 years agounix runmode: use unlikely for memory error
Eric Leblond [Tue, 20 Nov 2012 09:21:16 +0000 (10:21 +0100)] 
unix runmode: use unlikely for memory error

12 years agounix runmode: fix FIXME
Eric Leblond [Tue, 20 Nov 2012 09:17:57 +0000 (10:17 +0100)] 
unix runmode: fix FIXME

12 years agounix runmode: fix JSON mem handling
Eric Leblond [Tue, 20 Nov 2012 09:15:13 +0000 (10:15 +0100)] 
unix runmode: fix JSON mem handling

json_decref was not correctly used through the code. This patch
fixes it.

12 years agounix manager: add static
Eric Leblond [Tue, 20 Nov 2012 09:10:08 +0000 (10:10 +0100)] 
unix manager: add static

12 years agoconfigure: fix indent
Eric Leblond [Tue, 20 Nov 2012 09:09:48 +0000 (10:09 +0100)] 
configure: fix indent

12 years agoDisable 'reload-rules' command.
Eric Leblond [Mon, 19 Nov 2012 11:41:42 +0000 (12:41 +0100)] 
Disable 'reload-rules' command.

12 years agounix-manager: doc and whitespace fixes
Eric Leblond [Mon, 19 Nov 2012 10:53:29 +0000 (11:53 +0100)] 
unix-manager: doc and whitespace fixes

12 years agounix-socket: fix build when jansson not present
Eric Leblond [Mon, 19 Nov 2012 10:49:04 +0000 (11:49 +0100)] 
unix-socket: fix build when jansson not present

12 years agounix-command: add drop counter to iface-stat message
Eric Leblond [Thu, 15 Nov 2012 08:58:01 +0000 (09:58 +0100)] 
unix-command: add drop counter to iface-stat message

12 years agoAdd atomic counter for iface drop.
Eric Leblond [Thu, 15 Nov 2012 08:56:17 +0000 (09:56 +0100)] 
Add atomic counter for iface drop.

12 years agounix-command: add iface information command.
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.

12 years agoaf-packet: update runmode copyright date.
Eric Leblond [Thu, 15 Nov 2012 08:05:08 +0000 (09:05 +0100)] 
af-packet: update runmode copyright date.

12 years agounix-manager: fix error treatment in accept phase
Eric Leblond [Tue, 30 Oct 2012 13:35:23 +0000 (14:35 +0100)] 
unix-manager: fix error treatment in accept phase

12 years agounix-manager: implement multi client support
Eric Leblond [Mon, 29 Oct 2012 10:56:46 +0000 (11:56 +0100)] 
unix-manager: implement multi client support

This patch implements the support of multiple clients connected
at once to the unix socket.

12 years agosuricatasc: improve reading when system is loaded
Eric Leblond [Fri, 26 Oct 2012 14:21:21 +0000 (16:21 +0200)] 
suricatasc: improve reading when system is loaded

12 years agoaffinity: avoid to init structure twice
Eric Leblond [Fri, 26 Oct 2012 08:31:13 +0000 (10:31 +0200)] 
affinity: avoid to init structure twice

In unix socket mode, suricata was doing multiple init of the
structure. This was not needed and caused a memory leak in
mutex creation.

12 years agopcap-file: update affinity setting code
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.

12 years agounix-mode: fix return of pcap-file command
Eric Leblond [Fri, 26 Oct 2012 07:52:11 +0000 (09:52 +0200)] 
unix-mode: fix return of pcap-file command

12 years agounix-socket: introduce API to add commands and tasks
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.

12 years agounix-manager: add unix command socket and associated script
Eric Leblond [Tue, 7 Feb 2012 22:48:56 +0000 (23:48 +0100)] 
unix-manager: add unix command socket and associated script

This patch introduces a unix command socket. JSON formatted messages
can be exchanged between suricata and a program connecting to a
dedicated socket.
The protocol is the following:
 * Client connects to the socket
 * It sends a version message: { "version": "$VERSION_ID" }
 * Server answers with { "return": "OK|NOK" }
If server returns OK, the client is now allowed to send command.

The format of command is the following:
 {
   "command": "pcap-file",
   "arguments": { "filename": "smtp-clean.pcap", "output-dir": "/tmp/out" }
 }
The server will try to execute the "command" specified with the
(optional) provided "arguments".
The answer by server is the following:
 {
   "return": "OK|NOK",
   "message": JSON_OBJECT or information string
 }

A simple script is provided and is available under scripts/suricatasc. It
is not intended to be enterprise-grade tool but it is more a proof of
concept/example code.  The first command line argument of suricatasc is
used to specify the socket to connect to.

Configuration of the feature is made in the YAML under the 'unix-command'
section:
  unix-command:
    enabled: yes
    filename: custom.socket
The path specified in 'filename' is not absolute and is relative to the
state directory.

A new running mode called 'unix-socket' is also added.
When starting in this mode, only a unix socket manager
is started. When it receives a 'pcap-file' command, the manager
start a 'pcap-file' running mode which does not really leave at
the end of file but simply exit. The manager is then able to start
a new running mode with a new file.

To start this mode, Suricata must be started with the --unix-socket
 option which has an optional argument which fix the file name of the
socket. The path is not absolute and is relative to the state directory.

THe 'pcap-file' command adds a file to the list of files to treat.
For each pcap file, a pcap file running mode is started and the output
directory is changed to what specified in the command. The running
mode specified in the 'runmode' YAML setting is used to select which
running mode must be use for the pcap file treatment.

This requires modification in suricata.c file where initialisation code
is now conditional to the fact 'unix-socket' mode is not used.

Two other commands exists to get info on the remaining tasks:
 * pcap-file-number: return the number of files in the waiting queue
 * pcap-file-list: return the list of waiting files
'pcap-file-list' returns a structured object as message. The
structure is the following:
 {
  'count': 2,
  'files': ['file1.pcap', 'file2.pcap']
 }

12 years agotm-threads: add TM_ECODE_DONE state
Eric Leblond [Mon, 17 Sep 2012 13:24:39 +0000 (15:24 +0200)] 
tm-threads: add TM_ECODE_DONE state

This patch adds a nex return state which can be used by threads
to warn that a task has been done. In this case, suricata does not
leave.

12 years agofilestore: create file store directory if needed
Eric Leblond [Tue, 9 Oct 2012 10:56:17 +0000 (12:56 +0200)] 
filestore: create file store directory if needed

This patch modifies the file store system to have it create the
file store directory if needed. It dos not create the full
directory tree as the parent directory must have already been
created.